From 3d95f635af5a1888600d7b247a80b0da2734375a Mon Sep 17 00:00:00 2001 From: Daniel Kim Date: Sun, 27 Sep 2026 17:50:21 -0700 Subject: [PATCH 1/6] Add directional experiment archiving in CLI and dashboard --- src/commands/exp.rs | 21 +- src/commands/project.rs | 4 +- src/commands/up.rs | 28 ++ src/jobs/ssh/container/tests.rs | 1 + src/local/demo.rs | 3 + src/local/experiments.rs | 104 +++- src/local/model.rs | 2 + src/local/resolve.rs | 1 + src/main.rs | 28 +- src/plane/local_plane.rs | 14 +- src/store.rs | 32 +- ...iew-zPnQv7In.js => PdfPreview-1o-LUkLU.js} | 2 +- ui/dist/assets/index-6n0cyvji.css | 1 + ui/dist/assets/index-DpFa6rhD.css | 1 - .../{index-DGMb5Jdi.js => index-jTIk7TjQ.js} | 464 +++++++++--------- ui/dist/index.html | 4 +- ui/messages/ar.json | 11 +- ui/messages/en.json | 11 +- ui/messages/es.json | 11 +- ui/messages/fa.json | 11 +- ui/messages/hi.json | 11 +- ui/messages/zh-CN.json | 11 +- ui/src/App.tsx | 34 +- ui/src/api.ts | 4 + ui/src/components/ArchiveMenu.tsx | 56 +++ ui/src/components/ExperimentsTable.tsx | 10 + ui/src/components/TreeView.tsx | 30 +- 27 files changed, 641 insertions(+), 269 deletions(-) rename ui/dist/assets/{PdfPreview-zPnQv7In.js => PdfPreview-1o-LUkLU.js} (99%) create mode 100644 ui/dist/assets/index-6n0cyvji.css delete mode 100644 ui/dist/assets/index-DpFa6rhD.css rename ui/dist/assets/{index-DGMb5Jdi.js => index-jTIk7TjQ.js} (51%) create mode 100644 ui/src/components/ArchiveMenu.tsx diff --git a/src/commands/exp.rs b/src/commands/exp.rs index 556921d3..70851dfa 100644 --- a/src/commands/exp.rs +++ b/src/commands/exp.rs @@ -4,6 +4,8 @@ //! orx exp run … launch a local orx-supervised run //! orx exp cancel cancel the in-flight run //! orx exp wake resume this agent when the run succeeds or fails +//! orx exp archive --up|--down hide ancestors or the selected subtree +//! orx exp unarchive --up|--down restore the same nodes //! //! Unlike the project-scoped data commands, every verb here takes an //! *experiment* id from `orx project view `. @@ -16,8 +18,10 @@ use crate::store::Store; use crate::ExpCommand; pub async fn run(args: crate::ExpArgs) -> Result<()> { - let store = Store::open()?; + let mut store = Store::open()?; match args.command { + ExpCommand::Archive { exp_id, up, .. } => archive(&mut store, &exp_id, up, true), + ExpCommand::Unarchive { exp_id, up, .. } => archive(&mut store, &exp_id, up, false), ExpCommand::Status { exp_id, scheduler } => { crate::local::chat::record_chat_target("experiments", &exp_id); resolve_experiment(store, &exp_id)? @@ -47,6 +51,21 @@ pub async fn run(args: crate::ExpArgs) -> Result<()> { } } +fn archive(store: &mut Store, id: &str, up: bool, archived: bool) -> Result<()> { + let direction = if up { + crate::local::experiments::ArchiveDirection::Up + } else { + crate::local::experiments::ArchiveDirection::Down + }; + let ids = crate::local::experiments::set_archived(store, id, direction, archived)?; + println!( + "{} {} experiment(s).", + if archived { "Archived" } else { "Restored" }, + ids.len() + ); + Ok(()) +} + fn wake(store: &Store, exp_id: &str) -> Result<()> { if !crate::local::chat::in_local_session() { return Err(anyhow!( diff --git a/src/commands/project.rs b/src/commands/project.rs index b16056ea..ecda26cf 100644 --- a/src/commands/project.rs +++ b/src/commands/project.rs @@ -6,9 +6,9 @@ use crate::ProjectCommand; pub async fn run(args: crate::ProjectArgs) -> Result<()> { match args.command { - ProjectCommand::View { project_id } => { + ProjectCommand::View { project_id, all } => { let store = crate::store::Store::open()?; - resolve_project(store, &project_id)?.view_project().await + resolve_project(store, &project_id)?.view_project(all).await } ProjectCommand::Edit { project_id, diff --git a/src/commands/up.rs b/src/commands/up.rs index 2bc35655..c24b2b1f 100644 --- a/src/commands/up.rs +++ b/src/commands/up.rs @@ -493,6 +493,10 @@ fn router(state: AppState, remote_auth: Option) -> Router { .route("/api/runs/{id}/logs", get(run_logs)) .route("/api/runs/{id}/diff", get(run_diff)) .route("/api/experiments/{id}/diff", get(experiment_diff)) + .route( + "/api/experiments/{id}/archive", + axum::routing::patch(set_experiment_archive), + ) .route("/api/experiments/{id}/commits", get(experiment_commits)) .route( "/api/experiments/{id}/commits/{sha}/diff", @@ -1930,6 +1934,30 @@ async fn list_experiments(Path(id): Path) -> ApiResult { Ok(Json(json!({ "experiments": experiments }))) } +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +struct ArchiveExperimentRequest { + direction: String, + archived: bool, +} + +async fn set_experiment_archive( + Path(id): Path, + Json(request): Json, +) -> ApiResult { + let direction = match request.direction.as_str() { + "up" => local::experiments::ArchiveDirection::Up, + "down" => local::experiments::ArchiveDirection::Down, + _ => return Err(bad_request("direction must be up or down")), + }; + let mut store = Store::open()?; + if store.get_local_experiment(&id)?.is_none() { + return Err(not_found("experiment")); + } + let ids = local::experiments::set_archived(&mut store, &id, direction, request.archived)?; + Ok(Json(json!({ "ids": ids }))) +} + async fn list_project_runs(Path(id): Path) -> ApiResult { let store = Store::open()?; store diff --git a/src/jobs/ssh/container/tests.rs b/src/jobs/ssh/container/tests.rs index d91dd2b7..86fa2a83 100644 --- a/src/jobs/ssh/container/tests.rs +++ b/src/jobs/ssh/container/tests.rs @@ -470,6 +470,7 @@ async fn supervisor_restart(target: &SshTarget, reference: &str, port: u16) { created_at: 1, updated_at: 1, chat_session_id: None, + archived: false, }) .unwrap(); let (dir, container) = launch(target, Some(reference), "echo ONCE; sleep 8; echo AFTER").await; diff --git a/src/local/demo.rs b/src/local/demo.rs index f7afdb91..94adb4b6 100644 --- a/src/local/demo.rs +++ b/src/local/demo.rs @@ -467,6 +467,7 @@ fn seed_at( created_at: ago(seeded_at, 240, 0), updated_at: ago(seeded_at, 9, 0), chat_session_id: Some(SESSION_ID.into()), + archived: false, }; let lr_probe = LocalExperiment { id: LR_PROBE_EXPERIMENT_ID.into(), @@ -487,6 +488,7 @@ fn seed_at( created_at: ago(seeded_at, 8, 0), updated_at: ago(seeded_at, 8, 0), chat_session_id: None, + archived: false, }; let vocab_probe = LocalExperiment { id: VOCAB_PROBE_EXPERIMENT_ID.into(), @@ -507,6 +509,7 @@ fn seed_at( created_at: ago(seeded_at, 6, 0), updated_at: ago(seeded_at, 6, 0), chat_session_id: None, + archived: false, }; // created_at and run_ended_at must stay RUN_LOG_SPAN_MIN apart. let run_ended_at = ago(seeded_at, 10, 0); diff --git a/src/local/experiments.rs b/src/local/experiments.rs index d334d7cd..663de2b6 100644 --- a/src/local/experiments.rs +++ b/src/local/experiments.rs @@ -1,7 +1,7 @@ //! Local experiment creation — slug, branch, row. Used by //! `orx create-experiment` through the local execution plane. -use std::collections::HashSet; +use std::collections::{HashMap, HashSet}; use std::path::Path; use crate::error::{anyhow, Result}; @@ -36,7 +36,7 @@ fn unique_slug(store: &Store, project: &LocalProject, base: &str) -> Result Result-baseline rows: roots created before baselines @@ -64,6 +64,67 @@ pub fn legacy_root_warning(project: &LocalProject, experiment: &LocalExperiment) }) } +#[derive(Clone, Copy)] +pub enum ArchiveDirection { + Up, + Down, +} + +pub fn set_archived( + store: &mut Store, + id: &str, + direction: ArchiveDirection, + archived: bool, +) -> Result> { + let selected = store + .get_local_experiment(id)? + .ok_or_else(|| anyhow!("Experiment {id} not found."))?; + let experiments = store.list_experiments_by_project(&selected.project_id)?; + let ids = archive_ids(&experiments, &selected, direction); + store.set_experiments_archived(&ids, archived) +} + +fn archive_ids( + experiments: &[LocalExperiment], + selected: &LocalExperiment, + direction: ArchiveDirection, +) -> Vec { + match direction { + ArchiveDirection::Up => { + let by_id: HashMap<_, _> = experiments.iter().map(|e| (e.id.as_str(), e)).collect(); + let mut ids = Vec::new(); + let mut parent = selected.parent_experiment_id.as_deref(); + while let Some(id) = parent { + let Some(experiment) = by_id.get(id) else { + break; + }; + ids.push(experiment.id.clone()); + parent = experiment.parent_experiment_id.as_deref(); + } + ids + } + ArchiveDirection::Down => { + let mut children: HashMap<&str, Vec<&str>> = HashMap::new(); + for experiment in experiments { + if let Some(parent) = experiment.parent_experiment_id.as_deref() { + children.entry(parent).or_default().push(&experiment.id); + } + } + let mut ids = vec![selected.id.clone()]; + let mut stack = vec![selected.id.as_str()]; + while let Some(id) = stack.pop() { + if let Some(next) = children.get(id) { + for child in next { + ids.push((*child).to_string()); + stack.push(*child); + } + } + } + ids + } + } +} + /// Create a local experiment. Every node gets its own `orx/` branch: /// a child forks off its parent's tip, a baseline/root off /// the project's base branch. The base branch itself is never an experiment @@ -124,6 +185,7 @@ pub fn create_experiment( created_at: now, updated_at: now, chat_session_id: crate::local::chat::launching_chat_session(), + archived: false, }; store.create_local_experiment(&experiment)?; Ok(experiment) @@ -164,6 +226,7 @@ mod tests { created_at: 0, updated_at: 0, chat_session_id: None, + archived: false, } } @@ -198,4 +261,39 @@ mod tests { drop(store); let _ = std::fs::remove_dir_all(root); } + + #[test] + fn archive_directions_respect_selection_and_siblings() { + let mut root = experiment(None, "root"); + root.id = "root".into(); + let mut selected = experiment(Some("root"), "selected"); + selected.id = "selected".into(); + let mut child = experiment(Some("selected"), "child"); + child.id = "child".into(); + let mut sibling = experiment(Some("root"), "sibling"); + sibling.id = "sibling".into(); + let all = [root, selected.clone(), child, sibling]; + assert_eq!(archive_ids(&all, &selected, ArchiveDirection::Up), ["root"]); + assert_eq!( + archive_ids(&all, &selected, ArchiveDirection::Down), + ["selected", "child"] + ); + } + + #[test] + fn default_parent_skips_archived_roots() { + let dir = std::env::temp_dir().join(format!("orx-archive-root-{}", uuid::Uuid::new_v4())); + let store = Store::open_at(dir.clone()).unwrap(); + let mut archived = experiment(None, "old"); + archived.archived = true; + store.create_local_experiment(&archived).unwrap(); + assert!(project_root(&store, "p1").unwrap().is_none()); + let mut active = experiment(None, "new"); + active.id = "e2".into(); + active.slug = "new".into(); + store.create_local_experiment(&active).unwrap(); + assert_eq!(project_root(&store, "p1").unwrap().unwrap().id, "e2"); + drop(store); + let _ = std::fs::remove_dir_all(dir); + } } diff --git a/src/local/model.rs b/src/local/model.rs index 7267aa94..771788d8 100644 --- a/src/local/model.rs +++ b/src/local/model.rs @@ -82,6 +82,7 @@ pub struct LocalExperiment { /// Chat session that created this experiment. NULL for dashboard-created, /// legacy and out-of-session rows. Immutable once stamped. pub chat_session_id: Option, + pub archived: bool, } impl LocalExperiment { @@ -100,6 +101,7 @@ impl LocalExperiment { created_at: row.get(9)?, updated_at: row.get(10)?, chat_session_id: row.get(11)?, + archived: row.get(12)?, }) } diff --git a/src/local/resolve.rs b/src/local/resolve.rs index a6cbc73d..fcee6174 100644 --- a/src/local/resolve.rs +++ b/src/local/resolve.rs @@ -72,6 +72,7 @@ mod tests { created_at: now, updated_at: now, chat_session_id: None, + archived: false, } } diff --git a/src/main.rs b/src/main.rs index 2d88b94c..8f19c784 100644 --- a/src/main.rs +++ b/src/main.rs @@ -215,7 +215,12 @@ pub struct ProjectArgs { #[derive(Subcommand, Debug)] pub enum ProjectCommand { /// Show a local project's details and experiment tree. - View { project_id: String }, + View { + project_id: String, + /// Include archived experiments in the listing. + #[arg(long)] + all: bool, + }, /// Edit a local project's name or run command. Edit { @@ -405,6 +410,27 @@ pub struct ExpArgs { #[derive(Subcommand, Debug)] pub enum ExpCommand { + /// Hide ancestors of an experiment, or the experiment and its descendants. + /// A later no-parent create starts a new baseline if all roots are archived. + Archive { + exp_id: String, + /// Archive ancestors above the selected experiment (exclusive). + #[arg(long, conflicts_with = "down")] + up: bool, + /// Archive the selected experiment and descendants (default). + #[arg(long)] + down: bool, + }, + + /// Restore archived experiments using the same directional selection. + Unarchive { + exp_id: String, + #[arg(long, conflicts_with = "down")] + up: bool, + #[arg(long)] + down: bool, + }, + /// Show the experiment's status, run command, and latest run. Status { exp_id: String, diff --git a/src/plane/local_plane.rs b/src/plane/local_plane.rs index 25a53543..ae4d0259 100644 --- a/src/plane/local_plane.rs +++ b/src/plane/local_plane.rs @@ -100,7 +100,7 @@ impl LocalPlane { }) } - pub async fn view_project(&self) -> Result<()> { + pub async fn view_project(&self, all: bool) -> Result<()> { let store = &self.store; let project = self.project()?; println!("{} (local)", project.name); @@ -119,7 +119,11 @@ impl LocalPlane { ), } - let experiments = store.list_experiments_by_project(&project.id)?; + let experiments: Vec<_> = store + .list_experiments_by_project(&project.id)? + .into_iter() + .filter(|e| all || !e.archived) + .collect(); println!("\nExperiments"); if experiments.is_empty() { println!(" (none)"); @@ -131,10 +135,11 @@ impl LocalPlane { "" }; println!( - " {} {}{} ({})", + " {} {}{}{} ({})", e.id, e.display_name(), root, + if e.archived { " [archived]" } else { "" }, e.branch_name ); } @@ -180,6 +185,9 @@ impl LocalPlane { println!("{} ({}) [local]", exp.display_name(), exp.agent_status); println!(" id: {}", exp.id); println!(" branch: {}", exp.branch_name); + if exp.archived { + println!(" archived: yes"); + } match &exp.parent_experiment_id { Some(parent_id) => match store.get_local_experiment(parent_id)? { Some(parent) => { diff --git a/src/store.rs b/src/store.rs index 5c5257ca..80ac13e8 100644 --- a/src/store.rs +++ b/src/store.rs @@ -453,6 +453,7 @@ impl Store { created_at INTEGER NOT NULL, updated_at INTEGER NOT NULL, chat_session_id TEXT, + archived INTEGER NOT NULL DEFAULT 0, UNIQUE(project_id, slug) ); DROP TABLE IF EXISTS local_reports; @@ -608,6 +609,7 @@ impl Store { "ALTER TABLE local_projects ADD COLUMN github_sync_enabled INTEGER NOT NULL DEFAULT 1", "ALTER TABLE local_projects ADD COLUMN workspace_state_json TEXT", "ALTER TABLE local_experiments ADD COLUMN chat_session_id TEXT", + "ALTER TABLE local_experiments ADD COLUMN archived INTEGER NOT NULL DEFAULT 0", "ALTER TABLE ssh_host_tests ADD COLUMN tools_found INTEGER NOT NULL DEFAULT 0", "ALTER TABLE ssh_host_tests ADD COLUMN missing_tools TEXT NOT NULL DEFAULT ''", "ALTER TABLE chat_run_wakeups ADD COLUMN state TEXT NOT NULL DEFAULT 'pending'", @@ -1524,7 +1526,7 @@ impl Store { } for experiment in experiments { tx.execute( - &format!("INSERT INTO local_experiments ({EXPERIMENT_COLS}) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12)"), + &format!("INSERT INTO local_experiments ({EXPERIMENT_COLS}) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13)"), params![ experiment.id, experiment.project_id, @@ -1538,6 +1540,7 @@ impl Store { experiment.created_at, experiment.updated_at, experiment.chat_session_id, + experiment.archived, ], )?; } @@ -1743,11 +1746,11 @@ impl Store { pub fn create_local_experiment(&self, e: &LocalExperiment) -> Result<()> { self.conn.execute( - &format!("INSERT INTO local_experiments ({EXPERIMENT_COLS}) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12)"), + &format!("INSERT INTO local_experiments ({EXPERIMENT_COLS}) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13)"), params![ e.id, e.project_id, e.parent_experiment_id, e.slug, e.branch_name, e.title, e.description, e.run_command, e.agent_status, e.created_at, e.updated_at, - e.chat_session_id, + e.chat_session_id, e.archived, ], )?; Ok(()) @@ -1790,6 +1793,26 @@ impl Store { Ok(()) } + pub fn set_experiments_archived( + &mut self, + ids: &[String], + archived: bool, + ) -> Result> { + let tx = self.conn.transaction()?; + let mut changed = Vec::new(); + for id in ids { + let rows = tx.execute( + "UPDATE local_experiments SET archived = ?2, updated_at = MAX(updated_at + 1, ?3) WHERE id = ?1 AND archived != ?2", + params![id, archived, now_ms()], + )?; + if rows > 0 { + changed.push(id.clone()); + } + } + tx.commit()?; + Ok(changed) + } + // --- chat sessions / messages ------------------------------------------ pub fn create_chat_session(&self, s: &StoredChatSession) -> Result<()> { @@ -3123,7 +3146,7 @@ const PROJECT_COLS: &str = "id, name, slug, github_owner, github_repo, github_sy const EXPERIMENT_COLS: &str = "id, project_id, parent_experiment_id, slug, branch_name, \ title, description, run_command, agent_status, created_at, \ - updated_at, chat_session_id"; + updated_at, chat_session_id, archived"; fn row_to_run(row: &rusqlite::Row<'_>) -> std::result::Result { Ok(StoredRun { @@ -5053,6 +5076,7 @@ mod tests { created_at: 1, updated_at: 1, chat_session_id: chat_session_id.map(str::to_string), + archived: false, } } diff --git a/ui/dist/assets/PdfPreview-zPnQv7In.js b/ui/dist/assets/PdfPreview-1o-LUkLU.js similarity index 99% rename from ui/dist/assets/PdfPreview-zPnQv7In.js rename to ui/dist/assets/PdfPreview-1o-LUkLU.js index 059985e5..a6384f42 100644 --- a/ui/dist/assets/PdfPreview-zPnQv7In.js +++ b/ui/dist/assets/PdfPreview-1o-LUkLU.js @@ -1,4 +1,4 @@ -var a1=Object.defineProperty;var cw=h=>{throw TypeError(h)};var o1=(h,e,t)=>e in h?a1(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t;var L=(h,e,t)=>o1(h,typeof e!="symbol"?e+"":e,t),By=(h,e,t)=>e.has(h)||cw("Cannot "+t);var a=(h,e,t)=>(By(h,e,"read from private field"),t?t.call(h):e.get(h)),b=(h,e,t)=>e.has(h)?cw("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,t),g=(h,e,t,n)=>(By(h,e,"write to private field"),n?n.call(h,t):e.set(h,t),t),y=(h,e,t)=>(By(h,e,"access private method"),t);var Zt=(h,e,t,n)=>({set _(i){g(h,e,i,t)},get _(){return a(h,e,n)}});import{g as vy,c as LA,r as gi,M as l1,j as fe,f as ku,I as Bu,a as c1,i as hw,P as h1,b as dw,S as d1,d as u1,C as f1,e as p1,h as g1}from"./index-DGMb5Jdi.js";const m1=()=>"Find in document",v1=()=>"在文档中查找",y1=()=>"جست‌وجو در سند",b1=()=>"البحث في المستند",E1=()=>"Buscar en el documento",w1=()=>"दस्तावेज़ में खोजें",uw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?v1():t==="fa"?y1():t==="ar"?b1():t==="es"?E1():t==="hi"?w1():m1()}),A1=()=>"Fit to width",x1=()=>"适应宽度",S1=()=>"متناسب با عرض",T1=()=>"ملاءمة العرض",C1=()=>"Ajustar al ancho",P1=()=>"चौड़ाई में फ़िट करें",fw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?x1():t==="fa"?S1():t==="ar"?T1():t==="es"?C1():t==="hi"?P1():A1()}),I1=()=>"Next match",R1=()=>"下一个匹配项",O1=()=>"مورد بعدی",M1=()=>"التطابق التالي",D1=()=>"Coincidencia siguiente",L1=()=>"अगला मिलान",pw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?R1():t==="fa"?O1():t==="ar"?M1():t==="es"?D1():t==="hi"?L1():I1()}),N1=()=>"Previous match",F1=()=>"上一个匹配项",k1=()=>"مورد قبلی",B1=()=>"التطابق السابق",j1=()=>"Coincidencia anterior",U1=()=>"पिछला मिलान",gw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?F1():t==="fa"?k1():t==="ar"?B1():t==="es"?j1():t==="hi"?U1():N1()});/** +var a1=Object.defineProperty;var cw=h=>{throw TypeError(h)};var o1=(h,e,t)=>e in h?a1(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t;var L=(h,e,t)=>o1(h,typeof e!="symbol"?e+"":e,t),By=(h,e,t)=>e.has(h)||cw("Cannot "+t);var a=(h,e,t)=>(By(h,e,"read from private field"),t?t.call(h):e.get(h)),b=(h,e,t)=>e.has(h)?cw("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,t),g=(h,e,t,n)=>(By(h,e,"write to private field"),n?n.call(h,t):e.set(h,t),t),y=(h,e,t)=>(By(h,e,"access private method"),t);var Zt=(h,e,t,n)=>({set _(i){g(h,e,i,t)},get _(){return a(h,e,n)}});import{g as vy,c as LA,r as gi,M as l1,j as fe,f as ku,I as Bu,a as c1,i as hw,P as h1,b as dw,S as d1,d as u1,C as f1,e as p1,h as g1}from"./index-jTIk7TjQ.js";const m1=()=>"Find in document",v1=()=>"在文档中查找",y1=()=>"جست‌وجو در سند",b1=()=>"البحث في المستند",E1=()=>"Buscar en el documento",w1=()=>"दस्तावेज़ में खोजें",uw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?v1():t==="fa"?y1():t==="ar"?b1():t==="es"?E1():t==="hi"?w1():m1()}),A1=()=>"Fit to width",x1=()=>"适应宽度",S1=()=>"متناسب با عرض",T1=()=>"ملاءمة العرض",C1=()=>"Ajustar al ancho",P1=()=>"चौड़ाई में फ़िट करें",fw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?x1():t==="fa"?S1():t==="ar"?T1():t==="es"?C1():t==="hi"?P1():A1()}),I1=()=>"Next match",R1=()=>"下一个匹配项",O1=()=>"مورد بعدی",M1=()=>"التطابق التالي",D1=()=>"Coincidencia siguiente",L1=()=>"अगला मिलान",pw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?R1():t==="fa"?O1():t==="ar"?M1():t==="es"?D1():t==="hi"?L1():I1()}),N1=()=>"Previous match",F1=()=>"上一个匹配项",k1=()=>"مورد قبلی",B1=()=>"التطابق السابق",j1=()=>"Coincidencia anterior",U1=()=>"पिछला मिलान",gw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?F1():t==="fa"?k1():t==="ar"?B1():t==="es"?j1():t==="hi"?U1():N1()});/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. diff --git a/ui/dist/assets/index-6n0cyvji.css b/ui/dist/assets/index-6n0cyvji.css new file mode 100644 index 00000000..bfbc5950 --- /dev/null +++ b/ui/dist/assets/index-6n0cyvji.css @@ -0,0 +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-leading:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--spacing:.25rem;--container-xl:36rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--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-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-diff-selection:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-selection:color-mix(in oklab, var(--surface) 76%, var(--primary))}}:root,:host{--color-diff-gutter-selection:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-gutter-selection:color-mix(in oklab, var(--surface) 68%, var(--primary))}}:root,:host{--color-diff-insert-gutter:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-insert-gutter:color-mix(in oklab, var(--base) 84%, var(--accent-green))}}:root,:host{--color-diff-delete-gutter:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-delete-gutter:color-mix(in oklab, var(--base) 86%, var(--accent-red))}}:root,:host{--color-diff-insert-code:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-insert-code:color-mix(in oklab, var(--base) 91%, var(--accent-green))}}:root,:host{--color-diff-delete-code:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-delete-code:color-mix(in oklab, var(--base) 92%, var(--accent-red))}}:root,:host{--color-diff-insert-edit:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-insert-edit:color-mix(in oklab, var(--base) 72%, var(--accent-green))}}:root,:host{--color-diff-delete-edit:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-delete-edit:color-mix(in oklab, var(--base) 78%, var(--accent-red))}}:root,:host{--color-diff-omit-gutter:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-omit-gutter:color-mix(in oklab, var(--base) 86%, var(--text))}}}@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:1rem;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)}.file-view-editarea::selection{background:var(--editor-selection)}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-auto{pointer-events:auto}.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}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.-inset-14{inset:calc(var(--spacing) * -14)}.-inset-\[7px\]{top:-7px;right:-7px;bottom:-7px;left:-7px}.inset-0{top:0;right:0;bottom:0;left:0}.inset-auto{inset:auto}.inset-x-0{inset-inline:0}.inset-x-4{inset-inline:calc(var(--spacing) * 4)}.inset-x-6{inset-inline:calc(var(--spacing) * 6)}.inset-y-0{inset-block:0}.start-0{inset-inline-start:calc(var(--spacing) * 0)}.start-2{inset-inline-start:calc(var(--spacing) * 2)}.start-3{inset-inline-start:calc(var(--spacing) * 3)}.-end-\[3px\]{inset-inline-end:-3px}.end-0{inset-inline-end:calc(var(--spacing) * 0)}.end-1\.5{inset-inline-end:calc(var(--spacing) * 1.5)}.end-3{inset-inline-end:calc(var(--spacing) * 3)}.end-3\.5{inset-inline-end:calc(var(--spacing) * 3.5)}.top-0{top:0}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-3{top:calc(var(--spacing) * 3)}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-5{top:calc(var(--spacing) * 5)}.top-7{top:calc(var(--spacing) * 7)}.top-16{top:calc(var(--spacing) * 16)}.top-\[calc\(100\%_\+_4px\)\]{top:calc(100% + 4px)}.top-\[calc\(100\%_\+_6px\)\]{top:calc(100% + 6px)}.right-5{right:calc(var(--spacing) * 5)}.bottom-0{bottom:0}.bottom-6{bottom:calc(var(--spacing) * 6)}.bottom-32{bottom:calc(var(--spacing) * 32)}.bottom-\[calc\(100\%_\+_4px\)\]{bottom:calc(100% + 4px)}.bottom-\[calc\(100\%_\+_6px\)\]{bottom:calc(100% + 6px)}.bottom-\[calc\(100\%_\+_8px\)\]{bottom:calc(100% + 8px)}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.z-0{z-index:0}.z-1{z-index:1}.z-2{z-index:2}.z-4{z-index:4}.z-5{z-index:5}.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-70{z-index:70}.z-100{z-index:100}.z-200{z-index:200}.col-span-2{grid-column:span 2/span 2}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.row-start-1{grid-row-start:1}.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}.m-3{margin:calc(var(--spacing) * 3)}.m-5{margin:calc(var(--spacing) * 5)}.m-auto{margin:auto}.mx-0{margin-inline:0}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.-my-0\.5{margin-block:calc(var(--spacing) * -.5)}.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-4{margin-block:calc(var(--spacing) * 4)}.my-6{margin-block:calc(var(--spacing) * 6)}.my-\[5px\]{margin-block:5px}.ms-0{margin-inline-start:0}.ms-1{margin-inline-start:var(--spacing)}.ms-2{margin-inline-start:calc(var(--spacing) * 2)}.ms-3\.5{margin-inline-start:calc(var(--spacing) * 3.5)}.ms-6{margin-inline-start:calc(var(--spacing) * 6)}.ms-auto{margin-inline-start:auto}.me-0{margin-inline-end:0}.me-0\.5{margin-inline-end:calc(var(--spacing) * .5)}.me-1{margin-inline-end:var(--spacing)}.me-2{margin-inline-end:calc(var(--spacing) * 2)}.me-3\.5{margin-inline-end:calc(var(--spacing) * 3.5)}.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{margin-top:calc(var(--spacing) * 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-\[5px\]{margin-top:5px}.mt-\[13px\]{margin-top:13px}.mt-auto{margin-top:auto}.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{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-1{margin-left:var(--spacing)}.box-border{box-sizing:border-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.table{display:table}.field-sizing-content{field-sizing:content}.size-1\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-5\.5{height:calc(var(--spacing) * 5.5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.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-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-40{height:calc(var(--spacing) * 40)}.h-80{height:calc(var(--spacing) * 80)}.h-96{height:calc(var(--spacing) * 96)}.h-\[7px\]{height:7px}.h-\[9px\]{height:9px}.h-\[13px\]{height:13px}.h-\[15px\]{height:15px}.h-\[min\(42rem\,calc\(100vh-2\.5rem\)\)\]{height:min(42rem,100vh - 2.5rem)}.h-\[min\(48rem\,calc\(100vh-2\.5rem\)\)\]{height:min(48rem,100vh - 2.5rem)}.h-auto{height:auto}.h-dvh{height:100dvh}.h-full{height:100%}.h-px{height:1px}.max-h-36{max-height:calc(var(--spacing) * 36)}.max-h-45{max-height:calc(var(--spacing) * 45)}.max-h-48{max-height:calc(var(--spacing) * 48)}.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-120{max-height:calc(var(--spacing) * 120)}.max-h-\[calc\(100vh_-_40px\)\]{max-height:calc(100vh - 40px)}.max-h-\[calc\(100vh_-_var\(--modal-top\)_-_1\.25rem\)\]{max-height:calc(100vh - var(--modal-top) - 1.25rem)}.max-h-\[calc\(100vh_-_var\(--modal-top\)_-_48px\)\]{max-height:calc(100vh - var(--modal-top) - 48px)}.max-h-\[calc\(100vh_-_var\(--new-project-modal-top\)_-_1\.25rem\)\]{max-height:calc(100vh - var(--new-project-modal-top) - 1.25rem)}.max-h-\[min\(18rem\,40vh\)\]{max-height:min(18rem,40vh)}.max-h-\[min\(70vh\,_720px\)\]{max-height:min(70vh,720px)}.max-h-full{max-height:100%}.max-h-none{max-height:none}.min-h-0{min-height:0}.min-h-6{min-height:calc(var(--spacing) * 6)}.min-h-7{min-height:calc(var(--spacing) * 7)}.min-h-8{min-height:calc(var(--spacing) * 8)}.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-22{min-height:calc(var(--spacing) * 22)}.min-h-41{min-height:calc(var(--spacing) * 41)}.min-h-dvh{min-height:100dvh}.min-h-full{min-height:100%}.w-0{width:0}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\/5{width:40%}.w-4{width:calc(var(--spacing) * 4)}.w-4\/5{width:80%}.w-5{width:calc(var(--spacing) * 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-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-9\.5{width:calc(var(--spacing) * 9.5)}.w-10{width:calc(var(--spacing) * 10)}.w-10\.5{width:calc(var(--spacing) * 10.5)}.w-36{width:calc(var(--spacing) * 36)}.w-37{width:calc(var(--spacing) * 37)}.w-40{width:calc(var(--spacing) * 40)}.w-52{width:calc(var(--spacing) * 52)}.w-52\.5{width:calc(var(--spacing) * 52.5)}.w-60{width:calc(var(--spacing) * 60)}.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-96{width:calc(var(--spacing) * 96)}.w-110{width:calc(var(--spacing) * 110)}.w-120{width:calc(var(--spacing) * 120)}.w-140{width:calc(var(--spacing) * 140)}.w-160{width:calc(var(--spacing) * 160)}.w-180{width:calc(var(--spacing) * 180)}.w-200{width:calc(var(--spacing) * 200)}.w-\[7px\]{width:7px}.w-\[9px\]{width:9px}.w-\[13px\]{width:13px}.w-\[15px\]{width:15px}.w-\[min\(440px\,_calc\(100vw_-_48px\)\)\]{width:min(440px,100vw - 48px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-36{max-width:calc(var(--spacing) * 36)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-48{max-width:calc(var(--spacing) * 48)}.max-w-55{max-width:calc(var(--spacing) * 55)}.max-w-60{max-width:calc(var(--spacing) * 60)}.max-w-64{max-width:calc(var(--spacing) * 64)}.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-105{max-width:calc(var(--spacing) * 105)}.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-290{max-width:calc(var(--spacing) * 290)}.max-w-\[88\%\]{max-width:88%}.max-w-\[94vw\]{max-width:94vw}.max-w-\[calc\(100vw-1rem\)\]{max-width:calc(100vw - 1rem)}.max-w-\[calc\(100vw_-_40px\)\]{max-width:calc(100vw - 40px)}.max-w-full{max-width:100%}.max-w-none{max-width:none}.max-w-readable{max-width:var(--readable-col)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-16{min-width:calc(var(--spacing) * 16)}.min-w-20{min-width:calc(var(--spacing) * 20)}.min-w-44{min-width:calc(var(--spacing) * 44)}.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-60{min-width:calc(var(--spacing) * 60)}.min-w-80{min-width:calc(var(--spacing) * 80)}.min-w-full{min-width:100%}.flex-1{flex:1}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-full{flex-basis:100%}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[or-pulse_1\.2s_ease-in-out_infinite\]{animation:1.2s ease-in-out infinite or-pulse}.animate-\[spin_0\.8s_linear_infinite\]{animation:.8s linear infinite spin}.animate-\[spin_0\.9s_linear_infinite\]{animation:.9s linear infinite spin}.animate-\[title-char-in_240ms_ease-out_both\]{animation:.24s ease-out both title-char-in}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-e-resize{cursor:e-resize}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.cursor-zoom-in{cursor:zoom-in}.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-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-\[2rem_minmax\(0\,1fr\)_2rem\]{grid-template-columns:2rem minmax(0,1fr) 2rem}.grid-cols-\[8\.5rem_5rem\]{grid-template-columns:8.5rem 5rem}.grid-cols-\[9rem_minmax\(0\,1fr\)\]{grid-template-columns:9rem minmax(0,1fr)}.grid-cols-\[24px_minmax\(0\,_1fr\)\]{grid-template-columns:24px minmax(0,1fr)}.grid-cols-\[24px_minmax\(0\,_1fr\)_28px\]{grid-template-columns:24px minmax(0,1fr) 28px}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto_minmax\(0\,1fr\)_auto\]{grid-template-columns:auto minmax(0,1fr) auto}.grid-cols-\[minmax\(0\,1fr\)_9rem_9rem_minmax\(18rem\,max-content\)\]{grid-template-columns:minmax(0,1fr) 9rem 9rem minmax(18rem,max-content)}.grid-cols-\[minmax\(0\,_1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.grid-cols-\[minmax\(12rem\,18rem\)_minmax\(12rem\,18rem\)\]{grid-template-columns:minmax(12rem,18rem) minmax(12rem,18rem)}.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!important}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.\!items-stretch{align-items:stretch!important}.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}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-1\.5{column-gap:calc(var(--spacing) * 1.5)}.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-5{column-gap:calc(var(--spacing) * 5)}.gap-x-8{column-gap:calc(var(--spacing) * 8)}.gap-x-12{column-gap:calc(var(--spacing) * 12)}.gap-y-1{row-gap:var(--spacing)}.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}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border-variant>:not(:last-child)){border-color:var(--border-variant)}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.justify-self-end{justify-self:flex-end}.justify-self-start{justify-self:flex-start}.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{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-none{border-radius:0}.rounded-sm{border-radius:6px}.rounded-xl{border-radius:12px}.rounded-xs{border-radius:4px}.rounded-s-none{border-start-start-radius:0;border-end-start-radius:0}.rounded-e-none{border-start-end-radius:0;border-end-end-radius:0}.rounded-b-lg{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.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-x-0{border-inline-style:var(--tw-border-style);border-inline-width:0}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-s-0{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.border-s-2{border-inline-start-style:var(--tw-border-style);border-inline-start-width:2px}.border-s-\[3px\]{border-inline-start-style:var(--tw-border-style);border-inline-start-width:3px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.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-dashed{--tw-border-style:dashed;border-style:dashed}.border-solid{--tw-border-style:solid;border-style:solid}.border-accent-amber,.border-accent-amber\/45{border-color:var(--accent-amber)}@supports (color:color-mix(in lab,red,red)){.border-accent-amber\/45{border-color:color-mix(in oklab,var(--accent-amber) 45%,transparent)}}.border-accent-blue,.border-accent-blue\/45{border-color:var(--accent-blue)}@supports (color:color-mix(in lab,red,red)){.border-accent-blue\/45{border-color:color-mix(in oklab,var(--accent-blue) 45%,transparent)}}.border-accent-green,.border-accent-green\/45{border-color:var(--accent-green)}@supports (color:color-mix(in lab,red,red)){.border-accent-green\/45{border-color:color-mix(in oklab,var(--accent-green) 45%,transparent)}}.border-accent-red{border-color:var(--accent-red)}.border-border{border-color:var(--border)}.border-border-strong{border-color:var(--border-strong)}.border-border-variant{border-color:var(--border-variant)}.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border) 50%,transparent)}}.border-danger-notice-border{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.border-danger-notice-border{border-color:color-mix(in srgb,var(--accent-red) 35%,var(--border-variant))}}.border-primary,.border-primary\/45{border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.border-primary\/45{border-color:color-mix(in oklab,var(--primary) 45%,transparent)}}.border-transparent{border-color:#0000}.border-s-accent-blue{border-inline-start-color:var(--accent-blue)}.border-s-accent-red{border-inline-start-color:var(--accent-red)}.border-s-border{border-inline-start-color:var(--border)}.border-s-border-variant{border-inline-start-color:var(--border-variant)}.border-s-plan-caret{border-inline-start-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.border-s-plan-caret{border-inline-start-color:color-mix(in oklab,var(--base) 35%,var(--text))}}.border-e-border-variant{border-inline-end-color:var(--border-variant)}.border-t-accent-amber{border-top-color:var(--accent-amber)}.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-b-accent-amber{border-bottom-color:var(--accent-amber)}.border-b-border{border-bottom-color:var(--border)}.border-b-border-variant{border-bottom-color:var(--border-variant)}.border-b-divider-subtle{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.border-b-divider-subtle{border-bottom-color:color-mix(in oklab,var(--text) 7%,transparent)}}.bg-accent{background-color:var(--accent)}.bg-accent-amber{background-color:var(--accent-amber)}.bg-accent-amber-subtle{background-color:var(--accent-amber-subtle)}.bg-accent-blue{background-color:var(--accent-blue)}.bg-accent-blue-subtle{background-color:var(--accent-blue-subtle)}.bg-accent-green{background-color:var(--accent-green)}.bg-accent-green-subtle{background-color:var(--accent-green-subtle)}.bg-accent-red{background-color:var(--accent-red)}.bg-accent-red-subtle{background-color:var(--accent-red-subtle)}.bg-accent-teal{background-color:var(--accent-teal)}.bg-background{background-color:var(--base)}.bg-border-variant{background-color:var(--border-variant)}.bg-canvas{background-color:var(--canvas)}.bg-current{background-color:currentColor}.bg-hover-faint{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-hover-faint{background-color:color-mix(in oklab,var(--text) 3%,transparent)}}.bg-hover-muted{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-hover-muted{background-color:color-mix(in oklab,var(--text) 8%,transparent)}}.bg-hover-subtle{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-hover-subtle{background-color:color-mix(in oklab,var(--text) 10%,transparent)}}.bg-modal-backdrop{background-color:#1d1b1a6b}.bg-modal-backdrop-light{background-color:#1d1b1a66}.bg-muted{background-color:var(--muted)}.bg-panel{background-color:var(--panel)}.bg-primary{background-color:var(--primary)}.bg-primary-subtle{background-color:var(--primary-subtle)}.bg-skill-blue-subtle{background-color:var(--skill-blue-subtle)}.bg-surface{background-color:var(--surface)}.bg-surface-bright{background-color:var(--surface-bright)}.bg-terminal{background-color:var(--term-bg)}.bg-terminal-app{background-color:var(--term-app-bg)}.bg-text{background-color:var(--text)}.bg-transparent{background-color:#0000}.bg-white{background-color:#fff}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-none{background-image:none}.from-background{--tw-gradient-from:var(--base);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-terminal{--tw-gradient-from:var(--term-bg);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.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-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.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-0{padding-inline:0}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.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-\[9px\]{padding-inline:9px}.px-\[11px\]{padding-inline:11px}.px-\[13px\]{padding-inline:13px}.px-\[15px\]{padding-inline:15px}.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}.ps-1{padding-inline-start:var(--spacing)}.ps-1\.5{padding-inline-start:calc(var(--spacing) * 1.5)}.ps-2{padding-inline-start:calc(var(--spacing) * 2)}.ps-2\.5{padding-inline-start:calc(var(--spacing) * 2.5)}.ps-3{padding-inline-start:calc(var(--spacing) * 3)}.ps-3\.5{padding-inline-start:calc(var(--spacing) * 3.5)}.ps-4{padding-inline-start:calc(var(--spacing) * 4)}.ps-4\.5{padding-inline-start:calc(var(--spacing) * 4.5)}.ps-5{padding-inline-start:calc(var(--spacing) * 5)}.ps-\[2ch\]{padding-inline-start:2ch}.ps-\[31px\]{padding-inline-start:31px}.pe-0{padding-inline-end:0}.pe-0\.5{padding-inline-end:calc(var(--spacing) * .5)}.pe-1{padding-inline-end:var(--spacing)}.pe-1\.5{padding-inline-end:calc(var(--spacing) * 1.5)}.pe-2{padding-inline-end:calc(var(--spacing) * 2)}.pe-2\.5{padding-inline-end:calc(var(--spacing) * 2.5)}.pe-4{padding-inline-end:calc(var(--spacing) * 4)}.pe-8{padding-inline-end:calc(var(--spacing) * 8)}.pe-10{padding-inline-end:calc(var(--spacing) * 10)}.pe-14{padding-inline-end:calc(var(--spacing) * 14)}.pe-\[1ch\]{padding-inline-end:1ch}.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-5{padding-top:calc(var(--spacing) * 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)}.pt-\[var\(--new-project-modal-top\)\]{padding-top:var(--new-project-modal-top)}.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-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 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-\[2ch\]{padding-left:2ch}.text-center{text-align:center}.text-end{text-align:end}.text-left{text-align:left}.text-right{text-align:right}.text-start{text-align:start}.align-baseline{vertical-align:baseline}.align-middle{vertical-align:middle}.font-\[inherit\]{font-family:inherit}.font-mono{font-family:var(--mono)}.font-sans{font-family:var(--sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-menu{font-size:.8125rem;line-height:var(--tw-leading,1.25rem)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-0{--tw-leading:0px;line-height:0}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.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\.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-medium{--tw-font-weight:var(--font-weight-medium)!important;font-weight:var(--font-weight-medium)!important}.\!font-normal{--tw-font-weight:var(--font-weight-normal)!important;font-weight:var(--font-weight-normal)!important}.font-\[375\]{--tw-font-weight:375;font-weight:375}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.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\.05em\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\[0\.06em\]{--tw-tracking:.06em;letter-spacing:.06em}.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}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-accent-red{color:var(--accent-red)!important}.text-accent-amber{color:var(--accent-amber)}.text-accent-blue{color:var(--accent-blue)}.text-accent-green{color:var(--accent-green)}.text-accent-orange{color:var(--accent-orange)}.text-accent-purple{color:var(--accent-purple)}.text-accent-red{color:var(--accent-red)}.text-accent-teal{color:var(--accent-teal)}.text-background{color:var(--base)}.text-inherit{color:inherit}.text-muted{color:var(--muted)}.text-primary{color:var(--primary)}.text-skill-blue{color:var(--skill-blue)}.text-skill-blue-slash{color:var(--skill-blue-slash)}.text-subtext{color:var(--subtext)}.text-text,.text-text\/80{color:var(--text)}@supports (color:color-mix(in lab,red,red)){.text-text\/80{color:color-mix(in oklab,var(--text) 80%,transparent)}}.text-transparent{color:#0000}.text-white{color:#fff}.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-2{text-underline-offset:2px}.underline-offset-3{text-underline-offset:3px}.caret-text{caret-color:var(--text)}.opacity-0{opacity:0}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-52{opacity:.52}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px 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-card{--tw-shadow:0 14px 36px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.shadow-card{--tw-shadow:0 14px 36px var(--tw-shadow-color,color-mix(in oklab, var(--text) 6%, transparent))}}.shadow-card{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-control{--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-control-subtle{--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)}.shadow-dropdown{--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-elevated{--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-elevated{--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-elevated{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-file-line{--tw-shadow:inset 2px 0 0 var(--tw-shadow-color,var(--accent-blue));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-floating{--tw-shadow:0 8px 24px var(--tw-shadow-color,#00000024);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-hairline{--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-logo{--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-menu{--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-modal{--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-plan{--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-plan-menu{--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-popover{--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-tree{--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)}.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)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-primary{--tw-ring-color:var(--primary)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-background{--tw-ring-offset-color:var(--base)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.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{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[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-\[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-\[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-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}.\[--new-project-modal-top\:clamp\(4rem\,20vh\,24rem\)\]{--new-project-modal-top:clamp(4rem, 20vh, 24rem)}.\[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-open\/limit\:rotate-90:is(:where(.group\/limit):is([open],:popover-open,:open) *){rotate:90deg}.group-focus-within\:pointer-events-auto:is(:where(.group):focus-within *){pointer-events:auto}.group-focus-within\:opacity-100:is(:where(.group):focus-within *),.group-focus-within\/turn\:opacity-100:is(:where(.group\/turn):focus-within *){opacity:1}@media(hover:hover){.group-hover\:pointer-events-auto:is(:where(.group):hover *){pointer-events:auto}.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:opacity-0:is(:where(.group):hover *){opacity:0}.group-hover\:opacity-100:is(:where(.group):hover *),.group-hover\/skill\:opacity-100:is(:where(.group\/skill):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}.placeholder\:text-muted::placeholder{color:var(--muted)}.backdrop\:bg-image-backdrop::backdrop{background-color:#1d1b1ad9}.backdrop\:bg-modal-backdrop-light::backdrop{background-color:#1d1b1a66}.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\:start-0:after{content:var(--tw-content);inset-inline-start:calc(var(--spacing) * 0)}.after\:end-0:after{content:var(--tw-content);inset-inline-end:calc(var(--spacing) * 0)}.after\:top-full:after{content:var(--tw-content);top:100%}.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}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\:border-text:focus-within{border-color:var(--text)}.focus-within\:bg-surface-bright:focus-within{background-color:var(--surface-bright)}@media(hover:hover){.hover\:border-border-strong:hover{border-color:var(--border-strong)}.hover\:border-text:hover{border-color:var(--text)}.hover\:bg-surface:hover{background-color:var(--surface)}.hover\:bg-surface-bright:hover{background-color:var(--surface-bright)}.hover\:bg-transparent:hover{background-color:#0000}.hover\:text-accent-red:hover{color:var(--accent-red)}.hover\:text-primary-hover:hover{color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:text-primary-hover:hover{color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.hover\:text-text:hover{color:var(--text)}.hover\:underline:hover{text-decoration-line:underline}.hover\:decoration-primary:hover{-webkit-text-decoration-color:var(--primary);text-decoration-color:var(--primary)}}.focus\:pointer-events-auto:focus{pointer-events:auto}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:border-text:focus{border-color:var(--text)}.focus\:opacity-100:focus,.focus-visible\:opacity-100:focus-visible{opacity:1}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.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-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-offset-\[-2px\]:focus-visible{outline-offset:-2px}.focus-visible\:outline-primary:focus-visible{outline-color:var(--primary)}.focus-visible\:outline-text:focus-visible{outline-color:var(--text)}.focus-visible\:outline-solid:focus-visible{--tw-outline-style:solid;outline-style:solid}.disabled\:cursor-default:disabled{cursor:default}.disabled\:opacity-45:disabled{opacity:.45}.disabled\:opacity-50:disabled{opacity:.5}@media(prefers-reduced-motion:reduce){.motion-reduce\:transition-none{transition-property:none}}@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\:inset-x-12{inset-inline:calc(var(--spacing) * 12)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:px-12{padding-inline:calc(var(--spacing) * 12)}}@media(min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container not (min-width:36rem){.\@max-xl\:hidden{display:none}}@container not (min-width:32rem){.\@max-lg\:hidden{display:none}}@container (min-width:24rem){.\@sm\:flex-row{flex-direction:row}.\@sm\:items-center{align-items:center}.\@sm\:justify-between{justify-content:space-between}.\@sm\:self-auto{align-self:auto}}@container (min-width:32rem){.\@lg\:flex-row{flex-direction:row}.\@lg\:items-center{align-items:center}.\@lg\:gap-2{gap:calc(var(--spacing) * 2)}}@media(prefers-color-scheme:dark){.dark\:invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.\[\&_\+_\.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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.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(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.badge\]\:ms-2 .badge{margin-inline-start:calc(var(--spacing) * 2)}.\[\&_\.btn\]\:inline-flex .btn{display:inline-flex}.\[\&_\.btn\]\:items-center .btn{align-items:center}.\[\&_\.btn\]\:gap-\[5px\] .btn{gap:5px}.\[\&_\.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-xs .chev{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.chev\]\:text-muted .chev{color:var(--muted)}.\[\&_\.cmd-inline\]\:mx-2 .cmd-inline{margin-inline:calc(var(--spacing) * 2)}.\[\&_\.cmd-inline\]\:gap-2 .cmd-inline{gap:calc(var(--spacing) * 2)}.\[\&_\.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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.count-badge\]\:font-medium .count-badge{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.count-badge\]\:text-text .count-badge{color:var(--text)}.\[\&_\.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-base .error{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.error\]\:text-sm .error{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.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-sm .file-chip{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.file-chip\]\:font-medium .file-chip{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-start .folder-picker-control{text-align:start}.\[\&_\.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-control-subtle .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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.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(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_\.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}.\[\&_\.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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.hc-actions_button\]\:font-medium .hc-actions button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.hc-actions_button\]\:text-text .hc-actions button{color:var(--text)}.\[\&_\.hc-actions_button\:hover\]\:border-border-hover-strong .hc-actions button:hover{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.hc-actions_button\:hover\]\:border-border-hover-strong .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\]\: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-xs .hc-foot{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.hc-foot\]\:text-muted .hc-foot{color:var(--muted)}.\[\&_\.hc-foot_\.hc-command\]\:min-w-0 .hc-foot .hc-command{min-width:0}.\[\&_\.hc-foot_\.hc-command\]\:overflow-hidden .hc-foot .hc-command{overflow:hidden}.\[\&_\.hc-foot_\.hc-command\]\:text-ellipsis .hc-foot .hc-command{text-overflow:ellipsis}.\[\&_\.hc-foot_\.hc-command\]\:whitespace-nowrap .hc-foot .hc-command{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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-slug\]\:min-w-0 .hc-slug{min-width:0}.\[\&_\.hc-slug\]\:overflow-hidden .hc-slug{overflow:hidden}.\[\&_\.hc-slug\]\:text-sm .hc-slug{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.hc-slug\]\:font-semibold .hc-slug{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-sm .hc-toggle{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.hc-toggle\]\:font-medium .hc-toggle{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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\]\:ms-2 .icon-btn{margin-inline-start:calc(var(--spacing) * 2)}.\[\&_\.icon-btn\]\:align-middle .icon-btn{vertical-align:middle}.\[\&_\.id\]\:text-xs .id{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.id\]\:text-muted .id{color:var(--muted)}.\[\&_\.k\]\:text-sm .k{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.k\]\:font-medium .k{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.k\]\:text-subtext .k{color:var(--subtext)}.\[\&_\.k\]\:text-text .k{color:var(--text)}.\[\&_\.katex\]\:text-prose-emphasis .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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.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-base .kv .v{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.kv_\.v\]\:break-normal .kv .v{overflow-wrap:normal;word-break:normal}.\[\&_\.md\]\:max-w-readable .md{max-width:var(--readable-col)}.\[\&_\.md\]\:text-base .md{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.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-2xl .md h1{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.\[\&_\.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-xl .md h2{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_\.md_h3\]\:text-lg .md h3{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_\.model-id\]\:block .model-id{display:block}.\[\&_\.model-id\]\:text-xs .model-id{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.model-id\]\:text-muted .model-id{color:var(--muted)}.\[\&_\.model-item\]\:ps-6 .model-item{padding-inline-start: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}.\[\&_\.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}.\[\&_\.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-sm .node-action{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.node-action\]\:font-medium .node-action{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.node-action\]\:text-text .node-action{color:var(--text)}.\[\&_\.node-action\]\:no-underline .node-action{text-decoration-line:none}.\[\&_\.node-action-ext\]\:ms-auto .node-action-ext{margin-inline-start: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-xs .node-eyebrow{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.node-eyebrow\]\:font-medium .node-eyebrow{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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-xs .node-meta{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-start .node-overview-link{text-align:start}.\[\&_\.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\]\:text-sm .node-slug{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.node-slug\]\:font-semibold .node-slug{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.node-title\]\:text-text .node-title{color:var(--text)}.\[\&_\.openresearch-diff-file\]\:w-full .openresearch-diff-file{width:100%}.\[\&_\.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\(--color-diff-delete-code\)\] .openresearch-diff-file{--diff-code-delete-background-color:var(--color-diff-delete-code)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-edit-background-color\:var\(--color-diff-delete-edit\)\] .openresearch-diff-file{--diff-code-delete-edit-background-color:var(--color-diff-delete-edit)}.\[\&_\.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\(--color-diff-insert-code\)\] .openresearch-diff-file{--diff-code-insert-background-color:var(--color-diff-insert-code)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-edit-background-color\:var\(--color-diff-insert-edit\)\] .openresearch-diff-file{--diff-code-insert-edit-background-color:var(--color-diff-insert-edit)}.\[\&_\.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\(--color-diff-delete-gutter\)\] .openresearch-diff-file{--diff-gutter-delete-background-color:var(--color-diff-delete-gutter)}.\[\&_\.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\(--color-diff-insert-gutter\)\] .openresearch-diff-file{--diff-gutter-insert-background-color:var(--color-diff-insert-gutter)}.\[\&_\.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\(--color-diff-gutter-selection\)\] .openresearch-diff-file{--diff-gutter-selected-background-color:var(--color-diff-gutter-selection)}.\[\&_\.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\(--color-diff-omit-gutter\)\] .openresearch-diff-file{--diff-omit-gutter-line-color:var(--color-diff-omit-gutter)}.\[\&_\.openresearch-diff-file\]\:\[--diff-selection-background-color\:var\(--color-diff-selection\)\] .openresearch-diff-file{--diff-selection-background-color:var(--color-diff-selection)}.\[\&_\.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_\.diff-code\]\:py-0 .openresearch-diff-file .diff-code{padding-block:0}.\[\&_\.openresearch-diff-file_\.diff-code\]\:ps-\[2ch\] .openresearch-diff-file .diff-code{padding-inline-start:2ch}.\[\&_\.openresearch-diff-file_\.diff-code\]\:pe-4 .openresearch-diff-file .diff-code{padding-inline-end:calc(var(--spacing) * 4)}.\[\&_\.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-border .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top-color:var(--border)}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-delete\)\]\:bg-diff-delete-code .openresearch-diff-file .diff-line:has(.diff-code-delete){background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-delete\)\]\:bg-diff-delete-code .openresearch-diff-file .diff-line:has(.diff-code-delete){background-color:color-mix(in oklab,var(--base) 92%,var(--accent-red))}}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-insert\)\]\:bg-diff-insert-code .openresearch-diff-file .diff-line:has(.diff-code-insert){background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-insert\)\]\:bg-diff-insert-code .openresearch-diff-file .diff-line:has(.diff-code-insert){background-color:color-mix(in oklab,var(--base) 91%,var(--accent-green))}}.\[\&_\.openresearch-diff-file\.diff-unified\]\:table-fixed .openresearch-diff-file.diff-unified{table-layout:fixed}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:first-child\]\:p-0 .openresearch-diff-file.diff-unified .diff-line>td:first-child{padding:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:w-\[7ch\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:7ch}.\[\&_\.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-e .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:border-e-border .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-inline-end-color:var(--border)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:ps-3\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-inline-start:calc(var(--spacing) * 3.5)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pe-2\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-inline-end:calc(var(--spacing) * 2.5)}.\[\&_\.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\)\]\: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\)\]\:text-end .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){text-align:end}.\[\&_\.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-diff-gutter-text .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:text-diff-gutter-text .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){color:color-mix(in oklab,var(--text) 45%,var(--base))}}.\[\&_\.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-\[7ch\] .openresearch-diff-file.diff-unified col.diff-gutter-col:nth-child(2){width:7ch}.\[\&_\.option-menu\]\:w-max .option-menu{width:max-content}.\[\&_\.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\]\:ps-3 .paper-destination{padding-inline-start:calc(var(--spacing) * 3)}.\[\&_\.paper-destination\]\:pe-2 .paper-destination{padding-inline-end:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pt-2 .paper-destination{padding-top:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pb-2 .paper-destination{padding-bottom:calc(var(--spacing) * 2)}.\[\&_\.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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.paper-destination_code\]\:font-normal .paper-destination code{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_\.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\]\:text-xs .paper-pick .id{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-sm .paper-pick .title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.paper-pick_\.title\]\:font-medium .paper-pick .title{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.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\]\:text-xs .paper-results .id{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.paper-results_\.id\]\:text-muted .paper-results .id{color:var(--muted)}.\[\&_\.paper-results_\.title\]\:text-sm .paper-results .title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.paper-results_\.title\]\:font-medium .paper-results .title{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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-start .paper-results button{text-align:start}.\[\&_\.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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.path_code\]\:font-medium .path code{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.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)}.\[\&_\.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-default-title\]\:text-base .project-default-title,.\[\&_\.project-field-label\]\:text-base .project-field-label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.project-field-label\]\:font-medium .project-field-label{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.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(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.project-location-label\]\:font-medium .project-location-label{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.project-location-label\]\:text-text .project-location-label{color:var(--text)}.\[\&_\.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-base .project-path-notice{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.project-path-notice\]\:text-sm .project-path-notice{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.project-path-notice\]\:leading-\[1\.4\] .project-path-notice{--tw-leading:1.4;line-height:1.4}.\[\&_\.project-path-notice\]\:leading-relaxed .project-path-notice{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_\.project-path-notice\]\:text-subtext .project-path-notice{color:var(--subtext)}.\[\&_\.project-path-notice\]\:text-text .project-path-notice{color:var(--text)}.\[\&_\.project-path-notice\.error\]\:border-danger-notice-border .project-path-notice.error{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.project-path-notice\.error\]\:border-danger-notice-border .project-path-notice.error{border-color:color-mix(in srgb,var(--accent-red) 35%,var(--border-variant))}}.\[\&_\.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\]\:pt-0 .rail-body{padding-top:0}.\[\&_\.rail-body\]\:pb-1 .rail-body{padding-bottom: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\]\:text-sm .repo-hint{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.repo-hint\]\:font-normal .repo-hint{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_\.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}.\[\&_\.sel\]\:font-medium .sel{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.sel\]\:text-text .sel{color:var(--text)}.\[\&_\.session-dot\]\:inline-flex .session-dot{display:inline-flex}.\[\&_\.session-dot\]\:w-4 .session-dot{width:calc(var(--spacing) * 4)}.\[\&_\.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-dot\:empty\]\:hidden .session-dot:empty{display:none}.\[\&_\.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\:focus-visible\]\:inline-flex .session-menu-btn:focus-visible{display:inline-flex}.\[\&_\.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-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\]\:\[mask-image\:linear-gradient\(to_right\,black_calc\(100\%_-_16px\)\,transparent\)\] .session-title{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 16px),#0000);mask-image:linear-gradient(90deg,#000 calc(100% - 16px),#0000)}.\[\&_\.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\]\: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-form\]\:mt-6 .settings-form{margin-top:calc(var(--spacing) * 6)}.\[\&_\.settings-form\]\:border-t-0 .settings-form{border-top-style:var(--tw-border-style);border-top-width:0}.\[\&_\.settings-form\]\:pt-0 .settings-form{padding-top:0}.\[\&_\.settings-sub\]\:mb-3 .settings-sub{margin-bottom:calc(var(--spacing) * 3)}.\[\&_\.skill-chip\]\:align-baseline .skill-chip{vertical-align:baseline}.\[\&_\.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-xs .stats{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.stats\]\:font-medium .stats{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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-hover-strong .tab-close:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.tab-close\:hover\]\:bg-hover-strong .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\]\:pe-1 .tab-label>span{padding-inline-end: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\]\:pe-1 .tab-label:after{padding-inline-end:var(--spacing)}.\[\&_\.tab-label\:\:after\]\:font-medium .tab-label:after{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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}.\[\&_\.title\]\:max-w-60 .title{max-width:calc(var(--spacing) * 60)}.\[\&_\.title\]\:overflow-hidden .title{overflow:hidden}.\[\&_\.title\]\:text-sm .title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.title\]\:font-medium .title{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.title\]\:text-ellipsis .title{text-overflow:ellipsis}.\[\&_\.title\]\:whitespace-nowrap .title{white-space:nowrap}.\[\&_\.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\]\:flex .v{display:flex}.\[\&_\.v\]\:min-w-0 .v{min-width:0}.\[\&_\.v\]\:flex-wrap .v{flex-wrap:wrap}.\[\&_\.v\]\:items-center .v{align-items:center}.\[\&_\.v\]\:gap-2 .v{gap:calc(var(--spacing) * 2)}.\[\&_\.v\]\:font-sans .v{font-family:var(--sans)}.\[\&_\.v\]\:text-base .v{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.v\]\:text-sm .v{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.v\]\:break-words .v{overflow-wrap:break-word}.\[\&_\.v\]\:break-all .v{word-break:break-all}.\[\&_\.v\]\:text-text .v{color:var(--text)}.\[\&_\: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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\: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(--font-weight-medium);font-weight:var(--font-weight-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-base>.error{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\>_\.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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\>_\.seg_button\]\:font-medium>.seg button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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}.\[\&_\>_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(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_\>_label\]\:gap-2>label{gap:calc(var(--spacing) * 2)}.\[\&_\>_p\]\:m-0>p{margin:0}.\[\&_\>_p\]\:text-sm>p{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\>_p\]\:leading-relaxed>p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_\>_p\]\:text-text>p{color:var(--text)}.\[\&_\>_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)}.\[\&_\[data-tip-align\=\'end\'\]\:\:after\]\:start-auto [data-tip-align=end]:after{inset-inline-start:auto}.\[\&_\[data-tip-align\=\'end\'\]\:\:after\]\:end-0 [data-tip-align=end]:after{inset-inline-end:calc(var(--spacing) * 0)}.\[\&_\[data-tip-align\=\'end\'\]\:\:after\]\:translate-none [data-tip-align=end]:after{translate:none}.\[\&_\[data-tip-align\=\'start\'\]\:\:after\]\:start-0 [data-tip-align=start]:after{inset-inline-start:calc(var(--spacing) * 0)}.\[\&_\[data-tip-align\=\'start\'\]\:\:after\]\:translate-none [data-tip-align=start]:after{translate:none}.\[\&_a\]\:text-sm a{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_a\]\:whitespace-nowrap a{white-space:nowrap}.\[\&_a\]\:text-primary a{color:var(--primary)}.\[\&_a\]\:text-subtext a{color:var(--subtext)}.\[\&_blockquote\]\:mx-0 blockquote{margin-inline:0}.\[\&_blockquote\]\:my-1\.5 blockquote{margin-block:calc(var(--spacing) * 1.5)}.\[\&_blockquote\]\:border-s-\[3px\] blockquote{border-inline-start-style:var(--tw-border-style);border-inline-start-width:3px}.\[\&_blockquote\]\:border-s-border blockquote{border-inline-start-color:var(--border)}.\[\&_blockquote\]\:ps-2\.5 blockquote{padding-inline-start:calc(var(--spacing) * 2.5)}.\[\&_blockquote\]\:pe-0 blockquote{padding-inline-end:0}.\[\&_blockquote\]\:pt-0\.5 blockquote{padding-top:calc(var(--spacing) * .5)}.\[\&_blockquote\]\:pb-0\.5 blockquote{padding-bottom:calc(var(--spacing) * .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\]\: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-border button{border-color:var(--border)}.\[\&_button\]\:border-b-border-variant button{border-bottom-color:var(--border-variant)}.\[\&_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-\[11px\] button{padding-block:11px}.\[\&_button\]\:text-start button{text-align:start}.\[\&_button\]\:text-sm button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_button\]\:font-medium button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_button\]\:text-muted button{color:var(--muted)}.\[\&_button\]\:text-text button{color:var(--text)}.\[\&_button\]\:\[font\:inherit\] button{font:inherit}.\[\&_button\.active\]\:bg-background button.active{background-color:var(--base)}.\[\&_button\.active\]\:bg-surface button.active{background-color:var(--surface)}.\[\&_button\.active\]\:shadow-diff-active 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\.active\]\:shadow-segment button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&_button\.active\]\:shadow-segment button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,color-mix(in oklab, var(--text) 25%, transparent))}}.\[\&_button\.active\]\:shadow-segment 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\:disabled\]\:cursor-default button:disabled{cursor:default}.\[\&_button\:disabled\]\:text-muted button:disabled{color:var(--muted)}.\[\&_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\]\: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\]\:font-mono code{font-family:var(--mono)}.\[\&_code\]\:text-sm code{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_code\]\:text-xs code{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_code\]\:font-medium code{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_code\]\:text-ellipsis code{text-overflow:ellipsis}.\[\&_code\]\:whitespace-nowrap code{white-space:nowrap}.\[\&_code\]\:whitespace-pre-wrap code{white-space:pre-wrap}.\[\&_code\]\:text-primary code{color:var(--primary)}.\[\&_code\]\:text-text code{color:var(--text)}.\[\&_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(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.\[\&_h1\]\:text-4xl h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.\[\&_h1\]\:text-xl h1{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_h1\]\:text-prose-emphasis h1{font-size:1.05em}.\[\&_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(--font-weight-semibold);font-weight:var(--font-weight-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-3xl h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.\[\&_h2\]\:text-4xl h2{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.\[\&_h2\]\:text-5xl h2{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.\[\&_h2\]\:text-lg h2{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_h2\]\:text-sm h2{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_h2\]\:text-xl h2{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_h2\]\:text-prose-emphasis h2{font-size:1.05em}.\[\&_h2\]\:leading-tight h2{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.\[\&_h2\]\:font-medium h2{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_h2\]\:font-semibold h2{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_h2\]\:tracking-\[-0\.02em\] h2{--tw-tracking:-.02em;letter-spacing:-.02em}.\[\&_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-3 h3{margin-top:calc(var(--spacing) * 3)}.\[\&_h3\]\:mt-5\.5 h3{margin-top:calc(var(--spacing) * 5.5)}.\[\&_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-base h3{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_h3\]\:text-xl h3{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_h3\]\:text-prose-emphasis h3{font-size:1.05em}.\[\&_h3\]\:leading-\[1\.35\] h3{--tw-leading:1.35;line-height:1.35}.\[\&_h3\]\:font-semibold h3{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-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-lg h4{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_h4\]\:text-sm h4{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_h4\]\:text-prose-emphasis h4{font-size:1.05em}.\[\&_h4\]\:leading-\[1\.4\] h4{--tw-leading:1.4;line-height:1.4}.\[\&_h4\]\:font-semibold h4{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_h4\]\:text-accent-amber h4{color:var(--accent-amber)}.\[\&_h4\]\:text-text h4{color:var(--text)}.\[\&_img\]\:mx-auto img{margin-inline:auto}.\[\&_img\]\:my-0 img{margin-block:0}.\[\&_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\]\:max-h-\[min\(480px\,60vh\)\] img{max-height:min(480px,60vh)}.\[\&_img\]\:w-13 img{width:calc(var(--spacing) * 13)}.\[\&_img\]\:w-auto img{width:auto}.\[\&_img\]\:max-w-55 img{max-width:calc(var(--spacing) * 55)}.\[\&_img\]\:max-w-full img{max-width:100%}.\[\&_img\]\:rounded-none img{border-radius:0}.\[\&_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-0 img{border-style:var(--tw-border-style);border-width:0}.\[\&_img\]\:border-border img{border-color:var(--border)}.\[\&_img\]\:border-border-variant img{border-color:var(--border-variant)}.\[\&_img\]\:object-contain img{object-fit:contain}.\[\&_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\]\:px-2\.5 input{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_input\]\:py-2 input{padding-block:calc(var(--spacing) * 2)}.\[\&_input\]\:font-sans input{font-family:var(--sans)}.\[\&_input\]\:text-sm input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_input\]\:font-normal input{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_input\]\:text-text input{color:var(--text)}.\[\&_input\]\:outline-none input{--tw-outline-style:none;outline-style:none}.\[\&_input\:\:placeholder\]\:text-subtext input::placeholder{color:var(--subtext)}.\[\&_label\]\:flex label{display:flex}.\[\&_label\]\:flex-col label{flex-direction:column}.\[\&_label\]\:gap-1 label{gap:var(--spacing)}.\[\&_label\]\:text-sm label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_label\]\:font-medium label{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_legend\]\:font-medium legend{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_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\]\:ps-5\.5 ol{padding-inline-start: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-\[46ch\] p{max-width:46ch}.\[\&_p\]\:text-sm p{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_p\]\:leading-normal p{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_p\]\:text-balance p{text-wrap:balance}.\[\&_p\]\:text-subtext p{color:var(--subtext)}.\[\&_p\]\:text-text p{color:var(--text)}.\[\&_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(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_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(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.\[\&_p\.empty-state-title\]\:font-normal p.empty-state-title{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_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-border-muted pre{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_pre\]\:border-border-muted 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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_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(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_pre_code\]\:text-inherit pre code{color:inherit}.\[\&_select\]\:font-sans select{font-family:var(--sans)}.\[\&_select\]\:text-sm select{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_select\]\:font-normal select{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_select\]\:text-text select{color:var(--text)}.\[\&_span\]\:absolute span{position:absolute}.\[\&_span\]\:start-\[3px\] span{inset-inline-start:3px}.\[\&_span\]\:top-\[3px\] span{top:3px}.\[\&_span\]\:h-3\.5 span{height:calc(var(--spacing) * 3.5)}.\[\&_span\]\:w-3\.5 span{width:calc(var(--spacing) * 3.5)}.\[\&_span\]\:translate-x-4 span{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&_span\]\:overflow-hidden span{overflow:hidden}.\[\&_span\]\:rounded-full span{border-radius:999px}.\[\&_span\]\:bg-background span{background-color:var(--base)}.\[\&_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(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_strong\]\:font-semibold strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-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\]\: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-sm table{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_tbody_tr\:hover_td\]\:bg-surface-bright tbody tr:hover td{background-color:var(--surface-bright)}.\[\&_td\]\:h-12 td{height:calc(var(--spacing) * 12)}.\[\&_td\]\:border-b td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_td\]\:border-b-border-variant td{border-bottom-color:var(--border-variant)}.\[\&_td\]\:border-b-divider-faint td{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_td\]\:border-b-divider-faint td{border-bottom-color:color-mix(in oklab,var(--text) 6%,transparent)}}.\[\&_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\]\:ps-0 td{padding-inline-start:0}.\[\&_td\]\:pe-2\.5 td{padding-inline-end:calc(var(--spacing) * 2.5)}.\[\&_td\]\:pt-0 td{padding-top:0}.\[\&_td\]\:pb-0 td{padding-bottom:0}.\[\&_td\]\:text-start td{text-align:start}.\[\&_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\]\: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\]\:text-end td:last-child{text-align:end}.\[\&_td\:last-child\]\:whitespace-nowrap td:last-child{white-space:nowrap}.\[\&_td\[colspan\]\]\:text-start td[colspan]{text-align:start}.\[\&_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\]\:font-mono textarea{font-family:var(--mono)}.\[\&_textarea\]\:text-base textarea{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_textarea\]\:text-sm textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_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\]\:text-start th{text-align:start}.\[\&_th\]\:text-sm th{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_th\]\:font-medium th{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_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)}.\[\&_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(--font-weight-medium);font-weight:var(--font-weight-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\]\:ps-5\.5 ul{padding-inline-start: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-hover-muted.active{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\.active\]\:bg-hover-muted.active{background-color:color-mix(in oklab,var(--text) 8%,transparent)}}.\[\&\.active\]\:bg-panel.active{background-color:var(--panel)}.\[\&\.active\]\:bg-surface.active{background-color:var(--surface)}.\[\&\.active\]\:font-medium.active{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&\.active\]\:text-muted.active{color:var(--muted)}.\[\&\.active\]\:text-primary.active{color:var(--primary)}.\[\&\.active\]\:text-text.active{color:var(--text)}.\[\&\.active\:\:after\]\:absolute.active:after{position:absolute}.\[\&\.active\:\:after\]\:start-0.active:after{inset-inline-start:calc(var(--spacing) * 0)}.\[\&\.active\:\:after\]\:end-0.active:after{inset-inline-end:calc(var(--spacing) * 0)}.\[\&\.active\:\:after\]\:-bottom-px.active:after{bottom:-1px}.\[\&\.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\]\:start-auto.align-right{inset-inline-start:auto}.\[\&\.align-right\]\:end-0.align-right{inset-inline-end:calc(var(--spacing) * 0)}.\[\&\.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)}.\[\&\.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\]\:pe-0\.5.closable{padding-inline-end:calc(var(--spacing) * .5)}.\[\&\.code\]\:text-accent-orange.code{color:var(--accent-orange)}.\[\&\.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-dot\]\:hidden.editing .session-dot,.\[\&\.editing_\.session-menu-btn\]\:hidden.editing .session-menu-btn{display:none}.\[\&\.err\]\:bg-accent-red.err{background-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-danger-outline.fail{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.fail\]\:border-danger-outline.fail{border-color:color-mix(in oklab,var(--accent-red) 55%,transparent)}}.\[\&\.failed\]\:text-accent-red.failed{color:var(--accent-red)}.\[\&\.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-tree-live.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)}.\[\&\.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-panel-max.max{--tw-shadow:0 12px 40px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&\.max\]\:shadow-panel-max.max{--tw-shadow:0 12px 40px var(--tw-shadow-color,color-mix(in oklab, var(--text) 22%, transparent))}}.\[\&\.max\]\:shadow-panel-max.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-dot\]\:hidden.menu-open .session-dot{display:none}.\[\&\.menu-open_\.session-menu-btn\]\:inline-flex.menu-open .session-menu-btn{display:inline-flex}.\[\&\.muted\]\:text-muted.muted{color:var(--muted)}.\[\&\.ok\]\:bg-accent-green.ok{background-color:var(--accent-green)}.\[\&\.on\]\:bg-primary.on{background-color:var(--primary)}.\[\&\.on\]\:text-background.on{color:var(--base)}.\[\&\.open\]\:rotate-90.open{rotate:90deg}.\[\&\.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-s-accent-amber.permission{border-inline-start-color:var(--accent-amber)}.\[\&\.plan\]\:border-s-accent-blue.plan{border-inline-start-color:var(--accent-blue)}.\[\&\.question\]\:border-s-accent-purple.question{border-inline-start-color:var(--accent-purple)}.\[\&\.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-selected.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\]\:start-auto.session-menu{inset-inline-start:auto}.\[\&\.session-menu\]\:end-1\.5.session-menu{inset-inline-end:calc(var(--spacing) * 1.5)}.\[\&\.session-menu\]\:top-\[calc\(100\%_-_2px\)\].session-menu{top:calc(100% - 2px)}.\[\&\.session-menu\]\:min-w-35.session-menu{min-width:calc(var(--spacing) * 35)}.\[\&\.spreadsheet\]\:text-accent-green.spreadsheet,.\[\&\.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)}.\[\&\.warn\]\:bg-accent-amber.warn{background-color:var(--accent-amber)}.\[\&\:\:-webkit-details-marker\]\:hidden::-webkit-details-marker{display:none}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}.\[\&\:\:-webkit-search-cancel-button\]\:hidden::-webkit-search-cancel-button{display:none}.\[\&\:\:after\]\:pointer-events-none:after{pointer-events:none}.\[\&\:\:after\]\:absolute:after{position:absolute}.\[\&\:\:after\]\:start-0:after{inset-inline-start:calc(var(--spacing) * 0)}.\[\&\:\:after\]\:end-0:after{inset-inline-end:calc(var(--spacing) * 0)}.\[\&\:\:after\]\:top-full:after{top:100%}.\[\&\:\: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)}.\[\&\:active\]\:bg-resizer-hover:active{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\]\:bg-resizer-hover:active{background-color:color-mix(in oklab,var(--text) 12%,transparent)}}.\[\&\:active\:not\(\:disabled\)\]\:border-primary-active:active:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\:not\(\:disabled\)\]\:border-primary-active:active:not(:disabled){border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\:active\:not\(\:disabled\)\]\:bg-danger-active:active:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\:not\(\:disabled\)\]\:bg-danger-active:active:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 14%,transparent)}}.\[\&\:active\:not\(\:disabled\)\]\:bg-highlight:active:not(:disabled){background-color:var(--highlight)}.\[\&\:active\:not\(\:disabled\)\]\:bg-primary-active:active:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\:not\(\:disabled\)\]\:bg-primary-active:active:not(:disabled){background-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\:disabled\]\:cursor-default:disabled{cursor:default}.\[\&\:focus\]\:border-accent-blue:focus{border-color:var(--accent-blue)}.\[\&\: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-visible_\.session-dot\]\:hidden:focus-visible .session-dot{display:none}.\[\&\:focus-visible_\.session-menu-btn\]\:inline-flex:focus-visible .session-menu-btn{display:inline-flex}.\[\&\:has\(\.session-menu-btn\:focus-visible\)_\.session-dot\]\:hidden:has(.session-menu-btn:focus-visible) .session-dot{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\]\:border-primary:hover{border-color:var(--primary)}.\[\&\:hover\]\:border-text:hover{border-color:var(--text)}.\[\&\:hover\]\:bg-canvas:hover{background-color:var(--canvas)}.\[\&\:hover\]\:bg-highlight:hover{background-color:var(--highlight)}.\[\&\:hover\]\:bg-panel:hover{background-color:var(--panel)}.\[\&\:hover\]\:bg-resizer-hover:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\]\:bg-resizer-hover:hover{background-color:color-mix(in oklab,var(--text) 12%,transparent)}}.\[\&\:hover\]\:bg-surface:hover{background-color:var(--surface)}.\[\&\:hover\]\:bg-text:hover{background-color:var(--text)}.\[\&\:hover\]\:text-background:hover{color:var(--base)}.\[\&\:hover\]\:text-text:hover{color:var(--text)}.\[\&\:hover\]\:underline:hover{text-decoration-line:underline}.\[\&\:hover\]\:shadow-tree-hover: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_\.ft-row-delete\]\:opacity-100:hover .ft-row-delete,.\[\&\:hover_\.md-code-copy\]\:opacity-100:hover .md-code-copy{opacity:1}.\[\&\:hover_\.session-dot\]\:hidden:hover .session-dot{display:none}.\[\&\:hover_\.session-menu-btn\]\:inline-flex:hover .session-menu-btn{display:inline-flex}.\[\&\:hover\:not\(\.active\)\]\:bg-surface:hover:not(.active){background-color:var(--surface)}.\[\&\: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-accent-blue:hover:not(:disabled){border-color:var(--accent-blue)}.\[\&\:hover\:not\(\:disabled\)\]\:border-border-strong:hover:not(:disabled){border-color:var(--border-strong)}.\[\&\:hover\:not\(\:disabled\)\]\:border-primary-hover:hover:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:border-primary-hover:hover:not(:disabled){border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\:hover\:not\(\:disabled\)\]\:border-text:hover:not(:disabled){border-color:var(--text)}.\[\&\:hover\:not\(\:disabled\)\]\:bg-accent-amber-subtle:hover:not(:disabled){background-color:var(--accent-amber-subtle)}.\[\&\:hover\:not\(\:disabled\)\]\:bg-accent-blue\/90:hover:not(:disabled){background-color:var(--accent-blue)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-accent-blue\/90:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-blue) 90%,transparent)}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-danger-hover:hover:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-danger-hover:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 8%,transparent)}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-primary-hover:hover:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-primary-hover:hover:not(:disabled){background-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-stop-hover:hover:not(:disabled){background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-stop-hover:hover:not(:disabled){background-color:color-mix(in oklab,var(--surface) 88%,var(--text))}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-surface:hover:not(:disabled){background-color:var(--surface)}.\[\&\:hover\:not\(\:disabled\)\]\:text-accent-red:hover:not(:disabled){color:var(--accent-red)}.\[\&\:hover\:not\(\:disabled\)\]\:text-text:hover:not(:disabled){color:var(--text)}.\[\&\: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\]\:-start-px:not(.active)+.tab:not(.active):before{inset-inline-start:-1px}.\[\&\: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\]\: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)}.\[\&\>\.settings-form\:first-child\]\:mt-0>.settings-form:first-child{margin-top:0}.\[\&\>div\:first-child\]\:border-t-0>div:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.\[\&\[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}: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\)\)\]\:ms-auto{margin-inline-start:auto}.\[\@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:720px){.\[\@container\(\(max-width\:_720px\)\)\]\:hidden{display:none}.\[\@container\(\(max-width\:_720px\)\)\]\:\!w-full{width:100%!important}}@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))}}@media(max-width:520px){.\[\@media\(\(max-width\:_520px\)\)\]\:flex-col{flex-direction:column}.\[\@media\(\(max-width\:_520px\)\)\]\:items-start{align-items:flex-start}}@media(max-width:600px){.\[\@media\(\(max-width\:_600px\)\)\]\:col-span-2{grid-column:span 2/span 2}.\[\@media\(\(max-width\:_600px\)\)\]\:grid-cols-2{grid-template-columns:repeat(2,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(max-width:960px){.\[\@media\(\(max-width\:_960px\)\)\]\:col-span-3{grid-column:span 3/span 3}.\[\@media\(\(max-width\:_960px\)\)\]\:mb-1{margin-bottom:var(--spacing)}.\[\@media\(\(max-width\:_960px\)\)\]\:block{display:block}.\[\@media\(\(max-width\:_960px\)\)\]\:hidden{display:none}.\[\@media\(\(max-width\:_960px\)\)\]\:grid-cols-\[minmax\(0\,0\.8fr\)_minmax\(0\,0\.8fr\)_minmax\(0\,1\.4fr\)\]{grid-template-columns:minmax(0,.8fr) minmax(0,.8fr) minmax(0,1.4fr)}.\[\@media\(\(max-width\:_960px\)\)\]\:flex-wrap{flex-wrap:wrap}.\[\@media\(\(max-width\:_960px\)\)\]\:items-start{align-items:flex-start}.\[\@media\(\(max-width\:_960px\)\)\]\:gap-x-4{column-gap:calc(var(--spacing) * 4)}.\[\@media\(\(max-width\:_960px\)\)\]\:gap-y-3{row-gap:calc(var(--spacing) * 3)}.\[\@media\(\(max-width\:_960px\)\)\]\:px-4{padding-inline:calc(var(--spacing) * 4)}.\[\@media\(\(max-width\:_960px\)\)\]\:py-4{padding-block:calc(var(--spacing) * 4)}.\[\@media\(\(max-width\:_960px\)\)\]\:pt-6{padding-top:calc(var(--spacing) * 6)}.\[\@media\(\(max-width\:_960px\)\)\]\:break-all{word-break:break-all}.\[\@media\(\(max-width\:_960px\)\)\]\:whitespace-normal{white-space:normal}}@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;--border:#d4d4d4;--border-variant:#e5e5e5;--accent-orange:#da642c;--accent-red:#d94654;--accent-teal:#209a84;--accent-blue:#3a8dff;--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;--skill-blue:#184f91;--skill-blue-subtle:#d9e9fb;--skill-blue-slash:#7fa6d2;--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;--modal-top:min(30vh, 260px);--term-bg:#1a1a1a;--term-foreground:#e6e1e0;--term-selection:#2c3441;--term-app-bg:#fdfbfb;--term-app-foreground:#1d1b1a;--term-app-selection:#e9e2d8;--term-app-ansi-black:#1d1b1a;--term-app-ansi-red:#c0392b;--term-app-ansi-green:#3d8b37;--term-app-ansi-yellow:#b26a00;--term-app-ansi-blue:#2a6fcb;--term-app-ansi-magenta:#8e44ad;--term-app-ansi-cyan:#1a8a7a;--term-app-ansi-white:#8f8a85;--term-app-ansi-bright-black:#6b6663;--term-app-ansi-bright-red:#d94654;--term-app-ansi-bright-green:#5eb64c;--term-app-ansi-bright-yellow:#da9100;--term-app-ansi-bright-blue:#3a8dff;--term-app-ansi-bright-magenta:#9c5cff;--term-app-ansi-bright-cyan:#209a84;--term-app-ansi-bright-white:#1d1b1a;--tool-shimmer:var(--text)}@supports (color:color-mix(in lab,red,red)){:root{--tool-shimmer:color-mix(in srgb, var(--text) 58%, var(--subtext))}}:root{--editor-selection:var(--primary)}@supports (color:color-mix(in lab,red,red)){:root{--editor-selection:color-mix(in oklab, var(--primary) 22%, transparent)}}:root{--readable-col:840px;--border-strong:var(--border);--accent:var(--primary);--teal:var(--accent-teal);--green:var(--accent-green);--red:var(--accent-red);--amber:var(--accent-amber);--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}:root[data-theme=light]{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;--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;--skill-blue:#79adf0;--skill-blue-subtle:#183452;--skill-blue-slash:#527ca8;--accent-purple-subtle:#251933;--dots-muted:#2a2523;--dots-strong:#555;--term-app-bg:#141110;--term-app-foreground:#e6e1e0;--term-app-selection:#2c3441;--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}.tinker-logo{clip-path:inset(34% 9%)}:root[data-theme=dark] .tinker-logo{filter:invert();mix-blend-mode:screen}:root:is([lang=fa],[lang=ar]) #root :where(p,h1,h2,h3,h4,h5,h6,button,label,li,th,td,dt,dd,[role=status],[role=alert]),.md :where(p,h1,h2,h3,h4,li,th,td,blockquote),:root:is([lang=fa],[lang=ar]) #root .file-view-note{unicode-bidi:plaintext}:where(pre,code,.font-mono,.code-source-text,.xterm,.openresearch-diff){direction:ltr;unicode-bidi:isolate}.xterm{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:var(--tool-shimmer);opacity:1}}.tool-running-shimmer{color:#0000;background:linear-gradient(100deg,var(--muted) 12%,var(--subtext) 34%,var(--tool-shimmer) 50%,var(--subtext) 66%,var(--muted) 88%);-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-group-summary .tool-group-label{transition:color .12s}.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;cursor:pointer;font-weight:inherit;text-align: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;display:inline}.tool-line,.tool-group-summary{font-weight:375}.tool-group-rows .tool-line{font-size:var(--text-sm)}.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}.md .file-chip{padding-block:.5px;line-height:1.3}.md .file-chip .file-chip-open{color:currentColor;opacity:.6}.md .file-chip .file-chip-label{text-decoration-line:underline;-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong);text-underline-offset:2px;text-decoration-thickness:.6px}.md .file-chip:hover:not(:disabled) .file-chip-label,.md .file-chip:focus-visible .file-chip-label{-webkit-text-decoration-color:var(--primary);text-decoration-color:var(--primary)}.md .file-chip:disabled .file-chip-label{text-decoration-line:none}.md .file-chip:disabled .file-chip-open{display:none}.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}.project-row:hover .project-row-title{text-underline-offset:2px;text-decoration-line:underline}.project-row:has(.project-row-secondary:hover) .project-row-title{text-decoration-line:none}@media(hover:none){.project-row-delete{opacity:1;pointer-events:auto}}.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){.activity-pulse{animation:none}.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)}}.workspace-body .chat-header{padding-inline-end:8.5rem}.workspace-card-visible .chat-pane{padding-inline-end:16rem}.workspace-card-visible .chat-header{padding-inline-end:1rem}.workspace-card-visible .workspace-tools{top:1.25rem}.code-source-text,.openresearch-diff .diff-line{font-family:var(--mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.55;-moz-tab-size:4;tab-size:4;line-height:1.55}.code-source-wrap,.openresearch-diff .diff-code{overflow-wrap:normal;word-break:normal;overflow-wrap:break-word;white-space:pre-wrap}@property --tw-leading{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes pulse{50%{opacity:.5}} diff --git a/ui/dist/assets/index-DpFa6rhD.css b/ui/dist/assets/index-DpFa6rhD.css deleted file mode 100644 index 9bfc1b91..00000000 --- a/ui/dist/assets/index-DpFa6rhD.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-leading:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--spacing:.25rem;--container-xl:36rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--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-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-diff-selection:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-selection:color-mix(in oklab, var(--surface) 76%, var(--primary))}}:root,:host{--color-diff-gutter-selection:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-gutter-selection:color-mix(in oklab, var(--surface) 68%, var(--primary))}}:root,:host{--color-diff-insert-gutter:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-insert-gutter:color-mix(in oklab, var(--base) 84%, var(--accent-green))}}:root,:host{--color-diff-delete-gutter:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-delete-gutter:color-mix(in oklab, var(--base) 86%, var(--accent-red))}}:root,:host{--color-diff-insert-code:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-insert-code:color-mix(in oklab, var(--base) 91%, var(--accent-green))}}:root,:host{--color-diff-delete-code:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-delete-code:color-mix(in oklab, var(--base) 92%, var(--accent-red))}}:root,:host{--color-diff-insert-edit:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-insert-edit:color-mix(in oklab, var(--base) 72%, var(--accent-green))}}:root,:host{--color-diff-delete-edit:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-delete-edit:color-mix(in oklab, var(--base) 78%, var(--accent-red))}}:root,:host{--color-diff-omit-gutter:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-omit-gutter:color-mix(in oklab, var(--base) 86%, var(--text))}}}@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:1rem;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)}.file-view-editarea::selection{background:var(--editor-selection)}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-auto{pointer-events:auto}.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}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.-inset-14{inset:calc(var(--spacing) * -14)}.-inset-\[7px\]{top:-7px;right:-7px;bottom:-7px;left:-7px}.inset-0{top:0;right:0;bottom:0;left:0}.inset-auto{inset:auto}.inset-x-0{inset-inline:0}.inset-x-4{inset-inline:calc(var(--spacing) * 4)}.inset-x-6{inset-inline:calc(var(--spacing) * 6)}.inset-y-0{inset-block:0}.start-0{inset-inline-start:calc(var(--spacing) * 0)}.start-2{inset-inline-start:calc(var(--spacing) * 2)}.start-3{inset-inline-start:calc(var(--spacing) * 3)}.-end-\[3px\]{inset-inline-end:-3px}.end-0{inset-inline-end:calc(var(--spacing) * 0)}.end-1\.5{inset-inline-end:calc(var(--spacing) * 1.5)}.end-3{inset-inline-end:calc(var(--spacing) * 3)}.end-3\.5{inset-inline-end:calc(var(--spacing) * 3.5)}.top-0{top:0}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-3{top:calc(var(--spacing) * 3)}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-5{top:calc(var(--spacing) * 5)}.top-7{top:calc(var(--spacing) * 7)}.top-16{top:calc(var(--spacing) * 16)}.top-\[calc\(100\%_\+_6px\)\]{top:calc(100% + 6px)}.right-5{right:calc(var(--spacing) * 5)}.bottom-0{bottom:0}.bottom-6{bottom:calc(var(--spacing) * 6)}.bottom-32{bottom:calc(var(--spacing) * 32)}.bottom-\[calc\(100\%_\+_4px\)\]{bottom:calc(100% + 4px)}.bottom-\[calc\(100\%_\+_6px\)\]{bottom:calc(100% + 6px)}.bottom-\[calc\(100\%_\+_8px\)\]{bottom:calc(100% + 8px)}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.z-0{z-index:0}.z-1{z-index:1}.z-2{z-index:2}.z-4{z-index:4}.z-5{z-index:5}.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-70{z-index:70}.z-100{z-index:100}.z-200{z-index:200}.col-span-2{grid-column:span 2/span 2}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.row-start-1{grid-row-start:1}.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}.m-3{margin:calc(var(--spacing) * 3)}.m-5{margin:calc(var(--spacing) * 5)}.m-auto{margin:auto}.mx-0{margin-inline:0}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.-my-0\.5{margin-block:calc(var(--spacing) * -.5)}.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-4{margin-block:calc(var(--spacing) * 4)}.my-6{margin-block:calc(var(--spacing) * 6)}.my-\[5px\]{margin-block:5px}.ms-0{margin-inline-start:0}.ms-1{margin-inline-start:var(--spacing)}.ms-2{margin-inline-start:calc(var(--spacing) * 2)}.ms-3\.5{margin-inline-start:calc(var(--spacing) * 3.5)}.ms-6{margin-inline-start:calc(var(--spacing) * 6)}.ms-auto{margin-inline-start:auto}.me-0{margin-inline-end:0}.me-0\.5{margin-inline-end:calc(var(--spacing) * .5)}.me-1{margin-inline-end:var(--spacing)}.me-2{margin-inline-end:calc(var(--spacing) * 2)}.me-3\.5{margin-inline-end:calc(var(--spacing) * 3.5)}.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{margin-top:calc(var(--spacing) * 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-\[5px\]{margin-top:5px}.mt-\[13px\]{margin-top:13px}.mt-auto{margin-top:auto}.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{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-1{margin-left:var(--spacing)}.box-border{box-sizing:border-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.table{display:table}.field-sizing-content{field-sizing:content}.size-1\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-5\.5{height:calc(var(--spacing) * 5.5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.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-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-40{height:calc(var(--spacing) * 40)}.h-80{height:calc(var(--spacing) * 80)}.h-96{height:calc(var(--spacing) * 96)}.h-\[7px\]{height:7px}.h-\[9px\]{height:9px}.h-\[13px\]{height:13px}.h-\[15px\]{height:15px}.h-\[min\(42rem\,calc\(100vh-2\.5rem\)\)\]{height:min(42rem,100vh - 2.5rem)}.h-\[min\(48rem\,calc\(100vh-2\.5rem\)\)\]{height:min(48rem,100vh - 2.5rem)}.h-auto{height:auto}.h-dvh{height:100dvh}.h-full{height:100%}.h-px{height:1px}.max-h-36{max-height:calc(var(--spacing) * 36)}.max-h-45{max-height:calc(var(--spacing) * 45)}.max-h-48{max-height:calc(var(--spacing) * 48)}.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-120{max-height:calc(var(--spacing) * 120)}.max-h-\[calc\(100vh_-_40px\)\]{max-height:calc(100vh - 40px)}.max-h-\[calc\(100vh_-_var\(--modal-top\)_-_1\.25rem\)\]{max-height:calc(100vh - var(--modal-top) - 1.25rem)}.max-h-\[calc\(100vh_-_var\(--modal-top\)_-_48px\)\]{max-height:calc(100vh - var(--modal-top) - 48px)}.max-h-\[calc\(100vh_-_var\(--new-project-modal-top\)_-_1\.25rem\)\]{max-height:calc(100vh - var(--new-project-modal-top) - 1.25rem)}.max-h-\[min\(18rem\,40vh\)\]{max-height:min(18rem,40vh)}.max-h-\[min\(70vh\,_720px\)\]{max-height:min(70vh,720px)}.max-h-full{max-height:100%}.max-h-none{max-height:none}.min-h-0{min-height:0}.min-h-6{min-height:calc(var(--spacing) * 6)}.min-h-7{min-height:calc(var(--spacing) * 7)}.min-h-8{min-height:calc(var(--spacing) * 8)}.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-22{min-height:calc(var(--spacing) * 22)}.min-h-41{min-height:calc(var(--spacing) * 41)}.min-h-dvh{min-height:100dvh}.min-h-full{min-height:100%}.w-0{width:0}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\/5{width:40%}.w-4{width:calc(var(--spacing) * 4)}.w-4\/5{width:80%}.w-5{width:calc(var(--spacing) * 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-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-9\.5{width:calc(var(--spacing) * 9.5)}.w-10{width:calc(var(--spacing) * 10)}.w-10\.5{width:calc(var(--spacing) * 10.5)}.w-36{width:calc(var(--spacing) * 36)}.w-37{width:calc(var(--spacing) * 37)}.w-40{width:calc(var(--spacing) * 40)}.w-52{width:calc(var(--spacing) * 52)}.w-52\.5{width:calc(var(--spacing) * 52.5)}.w-60{width:calc(var(--spacing) * 60)}.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-96{width:calc(var(--spacing) * 96)}.w-110{width:calc(var(--spacing) * 110)}.w-120{width:calc(var(--spacing) * 120)}.w-140{width:calc(var(--spacing) * 140)}.w-160{width:calc(var(--spacing) * 160)}.w-180{width:calc(var(--spacing) * 180)}.w-200{width:calc(var(--spacing) * 200)}.w-\[7px\]{width:7px}.w-\[9px\]{width:9px}.w-\[13px\]{width:13px}.w-\[15px\]{width:15px}.w-\[min\(440px\,_calc\(100vw_-_48px\)\)\]{width:min(440px,100vw - 48px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-36{max-width:calc(var(--spacing) * 36)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-48{max-width:calc(var(--spacing) * 48)}.max-w-55{max-width:calc(var(--spacing) * 55)}.max-w-60{max-width:calc(var(--spacing) * 60)}.max-w-64{max-width:calc(var(--spacing) * 64)}.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-105{max-width:calc(var(--spacing) * 105)}.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-290{max-width:calc(var(--spacing) * 290)}.max-w-\[88\%\]{max-width:88%}.max-w-\[94vw\]{max-width:94vw}.max-w-\[calc\(100vw-1rem\)\]{max-width:calc(100vw - 1rem)}.max-w-\[calc\(100vw_-_40px\)\]{max-width:calc(100vw - 40px)}.max-w-full{max-width:100%}.max-w-none{max-width:none}.max-w-readable{max-width:var(--readable-col)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-16{min-width:calc(var(--spacing) * 16)}.min-w-20{min-width:calc(var(--spacing) * 20)}.min-w-44{min-width:calc(var(--spacing) * 44)}.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-60{min-width:calc(var(--spacing) * 60)}.min-w-80{min-width:calc(var(--spacing) * 80)}.min-w-full{min-width:100%}.flex-1{flex:1}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-full{flex-basis:100%}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[or-pulse_1\.2s_ease-in-out_infinite\]{animation:1.2s ease-in-out infinite or-pulse}.animate-\[spin_0\.8s_linear_infinite\]{animation:.8s linear infinite spin}.animate-\[spin_0\.9s_linear_infinite\]{animation:.9s linear infinite spin}.animate-\[title-char-in_240ms_ease-out_both\]{animation:.24s ease-out both title-char-in}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-e-resize{cursor:e-resize}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.cursor-zoom-in{cursor:zoom-in}.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-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-\[2rem_minmax\(0\,1fr\)_2rem\]{grid-template-columns:2rem minmax(0,1fr) 2rem}.grid-cols-\[8\.5rem_5rem\]{grid-template-columns:8.5rem 5rem}.grid-cols-\[9rem_minmax\(0\,1fr\)\]{grid-template-columns:9rem minmax(0,1fr)}.grid-cols-\[24px_minmax\(0\,_1fr\)\]{grid-template-columns:24px minmax(0,1fr)}.grid-cols-\[24px_minmax\(0\,_1fr\)_28px\]{grid-template-columns:24px minmax(0,1fr) 28px}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto_minmax\(0\,1fr\)_auto\]{grid-template-columns:auto minmax(0,1fr) auto}.grid-cols-\[minmax\(0\,1fr\)_9rem_9rem_minmax\(18rem\,max-content\)\]{grid-template-columns:minmax(0,1fr) 9rem 9rem minmax(18rem,max-content)}.grid-cols-\[minmax\(0\,_1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.grid-cols-\[minmax\(12rem\,18rem\)_minmax\(12rem\,18rem\)\]{grid-template-columns:minmax(12rem,18rem) minmax(12rem,18rem)}.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!important}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.\!items-stretch{align-items:stretch!important}.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}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-1\.5{column-gap:calc(var(--spacing) * 1.5)}.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-5{column-gap:calc(var(--spacing) * 5)}.gap-x-8{column-gap:calc(var(--spacing) * 8)}.gap-x-12{column-gap:calc(var(--spacing) * 12)}.gap-y-1{row-gap:var(--spacing)}.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}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border-variant>:not(:last-child)){border-color:var(--border-variant)}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.justify-self-end{justify-self:flex-end}.justify-self-start{justify-self:flex-start}.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{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-none{border-radius:0}.rounded-sm{border-radius:6px}.rounded-xl{border-radius:12px}.rounded-xs{border-radius:4px}.rounded-s-none{border-start-start-radius:0;border-end-start-radius:0}.rounded-e-none{border-start-end-radius:0;border-end-end-radius:0}.rounded-b-lg{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.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-x-0{border-inline-style:var(--tw-border-style);border-inline-width:0}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-s-0{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.border-s-2{border-inline-start-style:var(--tw-border-style);border-inline-start-width:2px}.border-s-\[3px\]{border-inline-start-style:var(--tw-border-style);border-inline-start-width:3px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.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-dashed{--tw-border-style:dashed;border-style:dashed}.border-solid{--tw-border-style:solid;border-style:solid}.border-accent-amber,.border-accent-amber\/45{border-color:var(--accent-amber)}@supports (color:color-mix(in lab,red,red)){.border-accent-amber\/45{border-color:color-mix(in oklab,var(--accent-amber) 45%,transparent)}}.border-accent-blue,.border-accent-blue\/45{border-color:var(--accent-blue)}@supports (color:color-mix(in lab,red,red)){.border-accent-blue\/45{border-color:color-mix(in oklab,var(--accent-blue) 45%,transparent)}}.border-accent-green,.border-accent-green\/45{border-color:var(--accent-green)}@supports (color:color-mix(in lab,red,red)){.border-accent-green\/45{border-color:color-mix(in oklab,var(--accent-green) 45%,transparent)}}.border-accent-red{border-color:var(--accent-red)}.border-border{border-color:var(--border)}.border-border-strong{border-color:var(--border-strong)}.border-border-variant{border-color:var(--border-variant)}.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border) 50%,transparent)}}.border-danger-notice-border{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.border-danger-notice-border{border-color:color-mix(in srgb,var(--accent-red) 35%,var(--border-variant))}}.border-primary,.border-primary\/45{border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.border-primary\/45{border-color:color-mix(in oklab,var(--primary) 45%,transparent)}}.border-transparent{border-color:#0000}.border-s-accent-blue{border-inline-start-color:var(--accent-blue)}.border-s-accent-red{border-inline-start-color:var(--accent-red)}.border-s-border{border-inline-start-color:var(--border)}.border-s-border-variant{border-inline-start-color:var(--border-variant)}.border-s-plan-caret{border-inline-start-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.border-s-plan-caret{border-inline-start-color:color-mix(in oklab,var(--base) 35%,var(--text))}}.border-e-border-variant{border-inline-end-color:var(--border-variant)}.border-t-accent-amber{border-top-color:var(--accent-amber)}.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-b-accent-amber{border-bottom-color:var(--accent-amber)}.border-b-border{border-bottom-color:var(--border)}.border-b-border-variant{border-bottom-color:var(--border-variant)}.border-b-divider-subtle{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.border-b-divider-subtle{border-bottom-color:color-mix(in oklab,var(--text) 7%,transparent)}}.bg-accent{background-color:var(--accent)}.bg-accent-amber{background-color:var(--accent-amber)}.bg-accent-amber-subtle{background-color:var(--accent-amber-subtle)}.bg-accent-blue{background-color:var(--accent-blue)}.bg-accent-blue-subtle{background-color:var(--accent-blue-subtle)}.bg-accent-green{background-color:var(--accent-green)}.bg-accent-green-subtle{background-color:var(--accent-green-subtle)}.bg-accent-red{background-color:var(--accent-red)}.bg-accent-red-subtle{background-color:var(--accent-red-subtle)}.bg-accent-teal{background-color:var(--accent-teal)}.bg-background{background-color:var(--base)}.bg-border-variant{background-color:var(--border-variant)}.bg-canvas{background-color:var(--canvas)}.bg-current{background-color:currentColor}.bg-hover-faint{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-hover-faint{background-color:color-mix(in oklab,var(--text) 3%,transparent)}}.bg-hover-muted{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-hover-muted{background-color:color-mix(in oklab,var(--text) 8%,transparent)}}.bg-hover-subtle{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-hover-subtle{background-color:color-mix(in oklab,var(--text) 10%,transparent)}}.bg-modal-backdrop{background-color:#1d1b1a6b}.bg-modal-backdrop-light{background-color:#1d1b1a66}.bg-muted{background-color:var(--muted)}.bg-panel{background-color:var(--panel)}.bg-primary{background-color:var(--primary)}.bg-primary-subtle{background-color:var(--primary-subtle)}.bg-skill-blue-subtle{background-color:var(--skill-blue-subtle)}.bg-surface{background-color:var(--surface)}.bg-surface-bright{background-color:var(--surface-bright)}.bg-terminal{background-color:var(--term-bg)}.bg-terminal-app{background-color:var(--term-app-bg)}.bg-text{background-color:var(--text)}.bg-transparent{background-color:#0000}.bg-white{background-color:#fff}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-none{background-image:none}.from-background{--tw-gradient-from:var(--base);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-terminal{--tw-gradient-from:var(--term-bg);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.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-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.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-0{padding-inline:0}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.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-\[9px\]{padding-inline:9px}.px-\[11px\]{padding-inline:11px}.px-\[13px\]{padding-inline:13px}.px-\[15px\]{padding-inline:15px}.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}.ps-1{padding-inline-start:var(--spacing)}.ps-1\.5{padding-inline-start:calc(var(--spacing) * 1.5)}.ps-2{padding-inline-start:calc(var(--spacing) * 2)}.ps-2\.5{padding-inline-start:calc(var(--spacing) * 2.5)}.ps-3{padding-inline-start:calc(var(--spacing) * 3)}.ps-3\.5{padding-inline-start:calc(var(--spacing) * 3.5)}.ps-4{padding-inline-start:calc(var(--spacing) * 4)}.ps-4\.5{padding-inline-start:calc(var(--spacing) * 4.5)}.ps-5{padding-inline-start:calc(var(--spacing) * 5)}.ps-\[2ch\]{padding-inline-start:2ch}.ps-\[31px\]{padding-inline-start:31px}.pe-0{padding-inline-end:0}.pe-0\.5{padding-inline-end:calc(var(--spacing) * .5)}.pe-1{padding-inline-end:var(--spacing)}.pe-1\.5{padding-inline-end:calc(var(--spacing) * 1.5)}.pe-2{padding-inline-end:calc(var(--spacing) * 2)}.pe-2\.5{padding-inline-end:calc(var(--spacing) * 2.5)}.pe-4{padding-inline-end:calc(var(--spacing) * 4)}.pe-8{padding-inline-end:calc(var(--spacing) * 8)}.pe-10{padding-inline-end:calc(var(--spacing) * 10)}.pe-14{padding-inline-end:calc(var(--spacing) * 14)}.pe-\[1ch\]{padding-inline-end:1ch}.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-5{padding-top:calc(var(--spacing) * 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)}.pt-\[var\(--new-project-modal-top\)\]{padding-top:var(--new-project-modal-top)}.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-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 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-\[2ch\]{padding-left:2ch}.text-center{text-align:center}.text-end{text-align:end}.text-left{text-align:left}.text-right{text-align:right}.text-start{text-align:start}.align-baseline{vertical-align:baseline}.align-middle{vertical-align:middle}.font-\[inherit\]{font-family:inherit}.font-mono{font-family:var(--mono)}.font-sans{font-family:var(--sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-menu{font-size:.8125rem;line-height:var(--tw-leading,1.25rem)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-0{--tw-leading:0px;line-height:0}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.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\.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-medium{--tw-font-weight:var(--font-weight-medium)!important;font-weight:var(--font-weight-medium)!important}.\!font-normal{--tw-font-weight:var(--font-weight-normal)!important;font-weight:var(--font-weight-normal)!important}.font-\[375\]{--tw-font-weight:375;font-weight:375}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.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\.05em\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\[0\.06em\]{--tw-tracking:.06em;letter-spacing:.06em}.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}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-accent-red{color:var(--accent-red)!important}.text-accent-amber{color:var(--accent-amber)}.text-accent-blue{color:var(--accent-blue)}.text-accent-green{color:var(--accent-green)}.text-accent-orange{color:var(--accent-orange)}.text-accent-purple{color:var(--accent-purple)}.text-accent-red{color:var(--accent-red)}.text-accent-teal{color:var(--accent-teal)}.text-background{color:var(--base)}.text-inherit{color:inherit}.text-muted{color:var(--muted)}.text-primary{color:var(--primary)}.text-skill-blue{color:var(--skill-blue)}.text-skill-blue-slash{color:var(--skill-blue-slash)}.text-subtext{color:var(--subtext)}.text-text,.text-text\/80{color:var(--text)}@supports (color:color-mix(in lab,red,red)){.text-text\/80{color:color-mix(in oklab,var(--text) 80%,transparent)}}.text-transparent{color:#0000}.text-white{color:#fff}.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-2{text-underline-offset:2px}.underline-offset-3{text-underline-offset:3px}.caret-text{caret-color:var(--text)}.opacity-0{opacity:0}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-52{opacity:.52}.opacity-70{opacity:.7}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px 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-card{--tw-shadow:0 14px 36px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.shadow-card{--tw-shadow:0 14px 36px var(--tw-shadow-color,color-mix(in oklab, var(--text) 6%, transparent))}}.shadow-card{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-control{--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-control-subtle{--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)}.shadow-dropdown{--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-elevated{--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-elevated{--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-elevated{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-file-line{--tw-shadow:inset 2px 0 0 var(--tw-shadow-color,var(--accent-blue));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-floating{--tw-shadow:0 8px 24px var(--tw-shadow-color,#00000024);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-hairline{--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-logo{--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-menu{--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-modal{--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-plan{--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-plan-menu{--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-popover{--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-tree{--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)}.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)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-primary{--tw-ring-color:var(--primary)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-background{--tw-ring-offset-color:var(--base)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.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{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[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-\[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-\[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-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}.\[--new-project-modal-top\:clamp\(4rem\,20vh\,24rem\)\]{--new-project-modal-top:clamp(4rem, 20vh, 24rem)}.\[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-open\/limit\:rotate-90:is(:where(.group\/limit):is([open],:popover-open,:open) *){rotate:90deg}.group-focus-within\:pointer-events-auto:is(:where(.group):focus-within *){pointer-events:auto}.group-focus-within\:opacity-100:is(:where(.group):focus-within *),.group-focus-within\/turn\:opacity-100:is(:where(.group\/turn):focus-within *){opacity:1}@media(hover:hover){.group-hover\:pointer-events-auto:is(:where(.group):hover *){pointer-events:auto}.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:opacity-0:is(:where(.group):hover *){opacity:0}.group-hover\:opacity-100:is(:where(.group):hover *),.group-hover\/skill\:opacity-100:is(:where(.group\/skill):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}.placeholder\:text-muted::placeholder{color:var(--muted)}.backdrop\:bg-image-backdrop::backdrop{background-color:#1d1b1ad9}.backdrop\:bg-modal-backdrop-light::backdrop{background-color:#1d1b1a66}.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\:start-0:after{content:var(--tw-content);inset-inline-start:calc(var(--spacing) * 0)}.after\:end-0:after{content:var(--tw-content);inset-inline-end:calc(var(--spacing) * 0)}.after\:top-full:after{content:var(--tw-content);top:100%}.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}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\:border-text:focus-within{border-color:var(--text)}.focus-within\:bg-surface-bright:focus-within{background-color:var(--surface-bright)}@media(hover:hover){.hover\:border-border-strong:hover{border-color:var(--border-strong)}.hover\:border-text:hover{border-color:var(--text)}.hover\:bg-surface:hover{background-color:var(--surface)}.hover\:bg-surface-bright:hover{background-color:var(--surface-bright)}.hover\:bg-transparent:hover{background-color:#0000}.hover\:text-accent-red:hover{color:var(--accent-red)}.hover\:text-primary-hover:hover{color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:text-primary-hover:hover{color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.hover\:text-text:hover{color:var(--text)}.hover\:underline:hover{text-decoration-line:underline}.hover\:decoration-primary:hover{-webkit-text-decoration-color:var(--primary);text-decoration-color:var(--primary)}}.focus\:pointer-events-auto:focus{pointer-events:auto}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:border-text:focus{border-color:var(--text)}.focus\:opacity-100:focus,.focus-visible\:opacity-100:focus-visible{opacity:1}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.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-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-offset-\[-2px\]:focus-visible{outline-offset:-2px}.focus-visible\:outline-primary:focus-visible{outline-color:var(--primary)}.focus-visible\:outline-text:focus-visible{outline-color:var(--text)}.focus-visible\:outline-solid:focus-visible{--tw-outline-style:solid;outline-style:solid}.disabled\:cursor-default:disabled{cursor:default}.disabled\:opacity-45:disabled{opacity:.45}.disabled\:opacity-50:disabled{opacity:.5}@media(prefers-reduced-motion:reduce){.motion-reduce\:transition-none{transition-property:none}}@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\:inset-x-12{inset-inline:calc(var(--spacing) * 12)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:px-12{padding-inline:calc(var(--spacing) * 12)}}@media(min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container not (min-width:36rem){.\@max-xl\:hidden{display:none}}@container not (min-width:32rem){.\@max-lg\:hidden{display:none}}@container (min-width:24rem){.\@sm\:flex-row{flex-direction:row}.\@sm\:items-center{align-items:center}.\@sm\:justify-between{justify-content:space-between}.\@sm\:self-auto{align-self:auto}}@container (min-width:32rem){.\@lg\:flex-row{flex-direction:row}.\@lg\:items-center{align-items:center}.\@lg\:gap-2{gap:calc(var(--spacing) * 2)}}@media(prefers-color-scheme:dark){.dark\:invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.\[\&_\+_\.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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.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(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.badge\]\:ms-2 .badge{margin-inline-start:calc(var(--spacing) * 2)}.\[\&_\.btn\]\:inline-flex .btn{display:inline-flex}.\[\&_\.btn\]\:items-center .btn{align-items:center}.\[\&_\.btn\]\:gap-\[5px\] .btn{gap:5px}.\[\&_\.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-xs .chev{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.chev\]\:text-muted .chev{color:var(--muted)}.\[\&_\.cmd-inline\]\:mx-2 .cmd-inline{margin-inline:calc(var(--spacing) * 2)}.\[\&_\.cmd-inline\]\:gap-2 .cmd-inline{gap:calc(var(--spacing) * 2)}.\[\&_\.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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.count-badge\]\:font-medium .count-badge{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.count-badge\]\:text-text .count-badge{color:var(--text)}.\[\&_\.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-base .error{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.error\]\:text-sm .error{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.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-sm .file-chip{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.file-chip\]\:font-medium .file-chip{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-start .folder-picker-control{text-align:start}.\[\&_\.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-control-subtle .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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.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(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_\.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}.\[\&_\.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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.hc-actions_button\]\:font-medium .hc-actions button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.hc-actions_button\]\:text-text .hc-actions button{color:var(--text)}.\[\&_\.hc-actions_button\:hover\]\:border-border-hover-strong .hc-actions button:hover{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.hc-actions_button\:hover\]\:border-border-hover-strong .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\]\: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-xs .hc-foot{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.hc-foot\]\:text-muted .hc-foot{color:var(--muted)}.\[\&_\.hc-foot_\.hc-command\]\:min-w-0 .hc-foot .hc-command{min-width:0}.\[\&_\.hc-foot_\.hc-command\]\:overflow-hidden .hc-foot .hc-command{overflow:hidden}.\[\&_\.hc-foot_\.hc-command\]\:text-ellipsis .hc-foot .hc-command{text-overflow:ellipsis}.\[\&_\.hc-foot_\.hc-command\]\:whitespace-nowrap .hc-foot .hc-command{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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-slug\]\:min-w-0 .hc-slug{min-width:0}.\[\&_\.hc-slug\]\:overflow-hidden .hc-slug{overflow:hidden}.\[\&_\.hc-slug\]\:text-sm .hc-slug{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.hc-slug\]\:font-semibold .hc-slug{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-sm .hc-toggle{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.hc-toggle\]\:font-medium .hc-toggle{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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\]\:ms-2 .icon-btn{margin-inline-start:calc(var(--spacing) * 2)}.\[\&_\.icon-btn\]\:align-middle .icon-btn{vertical-align:middle}.\[\&_\.id\]\:text-xs .id{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.id\]\:text-muted .id{color:var(--muted)}.\[\&_\.k\]\:text-sm .k{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.k\]\:font-medium .k{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.k\]\:text-subtext .k{color:var(--subtext)}.\[\&_\.k\]\:text-text .k{color:var(--text)}.\[\&_\.katex\]\:text-prose-emphasis .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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.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-base .kv .v{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.kv_\.v\]\:break-normal .kv .v{overflow-wrap:normal;word-break:normal}.\[\&_\.md\]\:max-w-readable .md{max-width:var(--readable-col)}.\[\&_\.md\]\:text-base .md{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.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-2xl .md h1{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.\[\&_\.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-xl .md h2{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_\.md_h3\]\:text-lg .md h3{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_\.model-id\]\:block .model-id{display:block}.\[\&_\.model-id\]\:text-xs .model-id{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.model-id\]\:text-muted .model-id{color:var(--muted)}.\[\&_\.model-item\]\:ps-6 .model-item{padding-inline-start: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}.\[\&_\.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}.\[\&_\.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-sm .node-action{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.node-action\]\:font-medium .node-action{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.node-action\]\:text-text .node-action{color:var(--text)}.\[\&_\.node-action\]\:no-underline .node-action{text-decoration-line:none}.\[\&_\.node-action-ext\]\:ms-auto .node-action-ext{margin-inline-start: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-xs .node-eyebrow{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.node-eyebrow\]\:font-medium .node-eyebrow{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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-xs .node-meta{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-start .node-overview-link{text-align:start}.\[\&_\.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\]\:text-sm .node-slug{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.node-slug\]\:font-semibold .node-slug{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.node-title\]\:text-text .node-title{color:var(--text)}.\[\&_\.openresearch-diff-file\]\:w-full .openresearch-diff-file{width:100%}.\[\&_\.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\(--color-diff-delete-code\)\] .openresearch-diff-file{--diff-code-delete-background-color:var(--color-diff-delete-code)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-edit-background-color\:var\(--color-diff-delete-edit\)\] .openresearch-diff-file{--diff-code-delete-edit-background-color:var(--color-diff-delete-edit)}.\[\&_\.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\(--color-diff-insert-code\)\] .openresearch-diff-file{--diff-code-insert-background-color:var(--color-diff-insert-code)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-edit-background-color\:var\(--color-diff-insert-edit\)\] .openresearch-diff-file{--diff-code-insert-edit-background-color:var(--color-diff-insert-edit)}.\[\&_\.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\(--color-diff-delete-gutter\)\] .openresearch-diff-file{--diff-gutter-delete-background-color:var(--color-diff-delete-gutter)}.\[\&_\.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\(--color-diff-insert-gutter\)\] .openresearch-diff-file{--diff-gutter-insert-background-color:var(--color-diff-insert-gutter)}.\[\&_\.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\(--color-diff-gutter-selection\)\] .openresearch-diff-file{--diff-gutter-selected-background-color:var(--color-diff-gutter-selection)}.\[\&_\.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\(--color-diff-omit-gutter\)\] .openresearch-diff-file{--diff-omit-gutter-line-color:var(--color-diff-omit-gutter)}.\[\&_\.openresearch-diff-file\]\:\[--diff-selection-background-color\:var\(--color-diff-selection\)\] .openresearch-diff-file{--diff-selection-background-color:var(--color-diff-selection)}.\[\&_\.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_\.diff-code\]\:py-0 .openresearch-diff-file .diff-code{padding-block:0}.\[\&_\.openresearch-diff-file_\.diff-code\]\:ps-\[2ch\] .openresearch-diff-file .diff-code{padding-inline-start:2ch}.\[\&_\.openresearch-diff-file_\.diff-code\]\:pe-4 .openresearch-diff-file .diff-code{padding-inline-end:calc(var(--spacing) * 4)}.\[\&_\.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-border .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top-color:var(--border)}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-delete\)\]\:bg-diff-delete-code .openresearch-diff-file .diff-line:has(.diff-code-delete){background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-delete\)\]\:bg-diff-delete-code .openresearch-diff-file .diff-line:has(.diff-code-delete){background-color:color-mix(in oklab,var(--base) 92%,var(--accent-red))}}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-insert\)\]\:bg-diff-insert-code .openresearch-diff-file .diff-line:has(.diff-code-insert){background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-insert\)\]\:bg-diff-insert-code .openresearch-diff-file .diff-line:has(.diff-code-insert){background-color:color-mix(in oklab,var(--base) 91%,var(--accent-green))}}.\[\&_\.openresearch-diff-file\.diff-unified\]\:table-fixed .openresearch-diff-file.diff-unified{table-layout:fixed}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:first-child\]\:p-0 .openresearch-diff-file.diff-unified .diff-line>td:first-child{padding:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:w-\[7ch\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:7ch}.\[\&_\.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-e .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:border-e-border .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-inline-end-color:var(--border)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:ps-3\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-inline-start:calc(var(--spacing) * 3.5)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pe-2\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-inline-end:calc(var(--spacing) * 2.5)}.\[\&_\.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\)\]\: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\)\]\:text-end .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){text-align:end}.\[\&_\.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-diff-gutter-text .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:text-diff-gutter-text .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){color:color-mix(in oklab,var(--text) 45%,var(--base))}}.\[\&_\.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-\[7ch\] .openresearch-diff-file.diff-unified col.diff-gutter-col:nth-child(2){width:7ch}.\[\&_\.option-menu\]\:w-max .option-menu{width:max-content}.\[\&_\.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\]\:ps-3 .paper-destination{padding-inline-start:calc(var(--spacing) * 3)}.\[\&_\.paper-destination\]\:pe-2 .paper-destination{padding-inline-end:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pt-2 .paper-destination{padding-top:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pb-2 .paper-destination{padding-bottom:calc(var(--spacing) * 2)}.\[\&_\.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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.paper-destination_code\]\:font-normal .paper-destination code{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_\.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\]\:text-xs .paper-pick .id{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-sm .paper-pick .title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.paper-pick_\.title\]\:font-medium .paper-pick .title{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.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\]\:text-xs .paper-results .id{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.paper-results_\.id\]\:text-muted .paper-results .id{color:var(--muted)}.\[\&_\.paper-results_\.title\]\:text-sm .paper-results .title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.paper-results_\.title\]\:font-medium .paper-results .title{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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-start .paper-results button{text-align:start}.\[\&_\.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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.path_code\]\:font-medium .path code{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.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)}.\[\&_\.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-default-title\]\:text-base .project-default-title,.\[\&_\.project-field-label\]\:text-base .project-field-label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.project-field-label\]\:font-medium .project-field-label{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.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(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.project-location-label\]\:font-medium .project-location-label{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.project-location-label\]\:text-text .project-location-label{color:var(--text)}.\[\&_\.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-base .project-path-notice{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.project-path-notice\]\:text-sm .project-path-notice{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.project-path-notice\]\:leading-\[1\.4\] .project-path-notice{--tw-leading:1.4;line-height:1.4}.\[\&_\.project-path-notice\]\:leading-relaxed .project-path-notice{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_\.project-path-notice\]\:text-subtext .project-path-notice{color:var(--subtext)}.\[\&_\.project-path-notice\]\:text-text .project-path-notice{color:var(--text)}.\[\&_\.project-path-notice\.error\]\:border-danger-notice-border .project-path-notice.error{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.project-path-notice\.error\]\:border-danger-notice-border .project-path-notice.error{border-color:color-mix(in srgb,var(--accent-red) 35%,var(--border-variant))}}.\[\&_\.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\]\:pt-0 .rail-body{padding-top:0}.\[\&_\.rail-body\]\:pb-1 .rail-body{padding-bottom: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\]\:text-sm .repo-hint{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.repo-hint\]\:font-normal .repo-hint{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_\.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}.\[\&_\.sel\]\:font-medium .sel{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.sel\]\:text-text .sel{color:var(--text)}.\[\&_\.session-dot\]\:inline-flex .session-dot{display:inline-flex}.\[\&_\.session-dot\]\:w-4 .session-dot{width:calc(var(--spacing) * 4)}.\[\&_\.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-dot\:empty\]\:hidden .session-dot:empty{display:none}.\[\&_\.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\:focus-visible\]\:inline-flex .session-menu-btn:focus-visible{display:inline-flex}.\[\&_\.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-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\]\:\[mask-image\:linear-gradient\(to_right\,black_calc\(100\%_-_16px\)\,transparent\)\] .session-title{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 16px),#0000);mask-image:linear-gradient(90deg,#000 calc(100% - 16px),#0000)}.\[\&_\.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\]\: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-form\]\:mt-6 .settings-form{margin-top:calc(var(--spacing) * 6)}.\[\&_\.settings-form\]\:border-t-0 .settings-form{border-top-style:var(--tw-border-style);border-top-width:0}.\[\&_\.settings-form\]\:pt-0 .settings-form{padding-top:0}.\[\&_\.settings-sub\]\:mb-3 .settings-sub{margin-bottom:calc(var(--spacing) * 3)}.\[\&_\.skill-chip\]\:align-baseline .skill-chip{vertical-align:baseline}.\[\&_\.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-xs .stats{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.stats\]\:font-medium .stats{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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-hover-strong .tab-close:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.tab-close\:hover\]\:bg-hover-strong .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\]\:pe-1 .tab-label>span{padding-inline-end: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\]\:pe-1 .tab-label:after{padding-inline-end:var(--spacing)}.\[\&_\.tab-label\:\:after\]\:font-medium .tab-label:after{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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}.\[\&_\.title\]\:max-w-60 .title{max-width:calc(var(--spacing) * 60)}.\[\&_\.title\]\:overflow-hidden .title{overflow:hidden}.\[\&_\.title\]\:text-sm .title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.title\]\:font-medium .title{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.title\]\:text-ellipsis .title{text-overflow:ellipsis}.\[\&_\.title\]\:whitespace-nowrap .title{white-space:nowrap}.\[\&_\.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\]\:flex .v{display:flex}.\[\&_\.v\]\:min-w-0 .v{min-width:0}.\[\&_\.v\]\:flex-wrap .v{flex-wrap:wrap}.\[\&_\.v\]\:items-center .v{align-items:center}.\[\&_\.v\]\:gap-2 .v{gap:calc(var(--spacing) * 2)}.\[\&_\.v\]\:font-sans .v{font-family:var(--sans)}.\[\&_\.v\]\:text-base .v{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.v\]\:text-sm .v{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.v\]\:break-words .v{overflow-wrap:break-word}.\[\&_\.v\]\:break-all .v{word-break:break-all}.\[\&_\.v\]\:text-text .v{color:var(--text)}.\[\&_\: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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\: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(--font-weight-medium);font-weight:var(--font-weight-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-base>.error{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\>_\.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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\>_\.seg_button\]\:font-medium>.seg button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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}.\[\&_\>_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(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_\>_label\]\:gap-2>label{gap:calc(var(--spacing) * 2)}.\[\&_\>_p\]\:m-0>p{margin:0}.\[\&_\>_p\]\:text-sm>p{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\>_p\]\:leading-relaxed>p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_\>_p\]\:text-text>p{color:var(--text)}.\[\&_\>_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)}.\[\&_\[data-tip-align\=\'end\'\]\:\:after\]\:start-auto [data-tip-align=end]:after{inset-inline-start:auto}.\[\&_\[data-tip-align\=\'end\'\]\:\:after\]\:end-0 [data-tip-align=end]:after{inset-inline-end:calc(var(--spacing) * 0)}.\[\&_\[data-tip-align\=\'end\'\]\:\:after\]\:translate-none [data-tip-align=end]:after{translate:none}.\[\&_\[data-tip-align\=\'start\'\]\:\:after\]\:start-0 [data-tip-align=start]:after{inset-inline-start:calc(var(--spacing) * 0)}.\[\&_\[data-tip-align\=\'start\'\]\:\:after\]\:translate-none [data-tip-align=start]:after{translate:none}.\[\&_a\]\:text-sm a{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_a\]\:whitespace-nowrap a{white-space:nowrap}.\[\&_a\]\:text-primary a{color:var(--primary)}.\[\&_a\]\:text-subtext a{color:var(--subtext)}.\[\&_blockquote\]\:mx-0 blockquote{margin-inline:0}.\[\&_blockquote\]\:my-1\.5 blockquote{margin-block:calc(var(--spacing) * 1.5)}.\[\&_blockquote\]\:border-s-\[3px\] blockquote{border-inline-start-style:var(--tw-border-style);border-inline-start-width:3px}.\[\&_blockquote\]\:border-s-border blockquote{border-inline-start-color:var(--border)}.\[\&_blockquote\]\:ps-2\.5 blockquote{padding-inline-start:calc(var(--spacing) * 2.5)}.\[\&_blockquote\]\:pe-0 blockquote{padding-inline-end:0}.\[\&_blockquote\]\:pt-0\.5 blockquote{padding-top:calc(var(--spacing) * .5)}.\[\&_blockquote\]\:pb-0\.5 blockquote{padding-bottom:calc(var(--spacing) * .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\]\: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-border button{border-color:var(--border)}.\[\&_button\]\:border-b-border-variant button{border-bottom-color:var(--border-variant)}.\[\&_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-\[11px\] button{padding-block:11px}.\[\&_button\]\:text-start button{text-align:start}.\[\&_button\]\:text-sm button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_button\]\:font-medium button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_button\]\:text-muted button{color:var(--muted)}.\[\&_button\]\:text-text button{color:var(--text)}.\[\&_button\]\:\[font\:inherit\] button{font:inherit}.\[\&_button\.active\]\:bg-background button.active{background-color:var(--base)}.\[\&_button\.active\]\:bg-surface button.active{background-color:var(--surface)}.\[\&_button\.active\]\:shadow-diff-active 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\.active\]\:shadow-segment button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&_button\.active\]\:shadow-segment button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,color-mix(in oklab, var(--text) 25%, transparent))}}.\[\&_button\.active\]\:shadow-segment 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\:disabled\]\:cursor-default button:disabled{cursor:default}.\[\&_button\:disabled\]\:text-muted button:disabled{color:var(--muted)}.\[\&_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\]\: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\]\:font-mono code{font-family:var(--mono)}.\[\&_code\]\:text-sm code{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_code\]\:text-xs code{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_code\]\:font-medium code{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_code\]\:text-ellipsis code{text-overflow:ellipsis}.\[\&_code\]\:whitespace-nowrap code{white-space:nowrap}.\[\&_code\]\:whitespace-pre-wrap code{white-space:pre-wrap}.\[\&_code\]\:text-primary code{color:var(--primary)}.\[\&_code\]\:text-text code{color:var(--text)}.\[\&_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(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.\[\&_h1\]\:text-4xl h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.\[\&_h1\]\:text-xl h1{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_h1\]\:text-prose-emphasis h1{font-size:1.05em}.\[\&_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(--font-weight-semibold);font-weight:var(--font-weight-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-3xl h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.\[\&_h2\]\:text-4xl h2{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.\[\&_h2\]\:text-5xl h2{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.\[\&_h2\]\:text-lg h2{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_h2\]\:text-sm h2{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_h2\]\:text-xl h2{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_h2\]\:text-prose-emphasis h2{font-size:1.05em}.\[\&_h2\]\:leading-tight h2{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.\[\&_h2\]\:font-medium h2{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_h2\]\:font-semibold h2{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_h2\]\:tracking-\[-0\.02em\] h2{--tw-tracking:-.02em;letter-spacing:-.02em}.\[\&_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-3 h3{margin-top:calc(var(--spacing) * 3)}.\[\&_h3\]\:mt-5\.5 h3{margin-top:calc(var(--spacing) * 5.5)}.\[\&_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-base h3{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_h3\]\:text-xl h3{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_h3\]\:text-prose-emphasis h3{font-size:1.05em}.\[\&_h3\]\:leading-\[1\.35\] h3{--tw-leading:1.35;line-height:1.35}.\[\&_h3\]\:font-semibold h3{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-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-lg h4{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_h4\]\:text-sm h4{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_h4\]\:text-prose-emphasis h4{font-size:1.05em}.\[\&_h4\]\:leading-\[1\.4\] h4{--tw-leading:1.4;line-height:1.4}.\[\&_h4\]\:font-semibold h4{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_h4\]\:text-accent-amber h4{color:var(--accent-amber)}.\[\&_h4\]\:text-text h4{color:var(--text)}.\[\&_img\]\:mx-auto img{margin-inline:auto}.\[\&_img\]\:my-0 img{margin-block:0}.\[\&_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\]\:max-h-\[min\(480px\,60vh\)\] img{max-height:min(480px,60vh)}.\[\&_img\]\:w-13 img{width:calc(var(--spacing) * 13)}.\[\&_img\]\:w-auto img{width:auto}.\[\&_img\]\:max-w-55 img{max-width:calc(var(--spacing) * 55)}.\[\&_img\]\:max-w-full img{max-width:100%}.\[\&_img\]\:rounded-none img{border-radius:0}.\[\&_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-0 img{border-style:var(--tw-border-style);border-width:0}.\[\&_img\]\:border-border img{border-color:var(--border)}.\[\&_img\]\:border-border-variant img{border-color:var(--border-variant)}.\[\&_img\]\:object-contain img{object-fit:contain}.\[\&_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\]\:px-2\.5 input{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_input\]\:py-2 input{padding-block:calc(var(--spacing) * 2)}.\[\&_input\]\:font-sans input{font-family:var(--sans)}.\[\&_input\]\:text-sm input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_input\]\:font-normal input{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_input\]\:text-text input{color:var(--text)}.\[\&_input\]\:outline-none input{--tw-outline-style:none;outline-style:none}.\[\&_input\:\:placeholder\]\:text-subtext input::placeholder{color:var(--subtext)}.\[\&_label\]\:flex label{display:flex}.\[\&_label\]\:flex-col label{flex-direction:column}.\[\&_label\]\:gap-1 label{gap:var(--spacing)}.\[\&_label\]\:text-sm label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_label\]\:font-medium label{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_legend\]\:font-medium legend{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_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\]\:ps-5\.5 ol{padding-inline-start: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-\[46ch\] p{max-width:46ch}.\[\&_p\]\:text-sm p{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_p\]\:leading-normal p{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_p\]\:text-balance p{text-wrap:balance}.\[\&_p\]\:text-subtext p{color:var(--subtext)}.\[\&_p\]\:text-text p{color:var(--text)}.\[\&_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(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_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(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.\[\&_p\.empty-state-title\]\:font-normal p.empty-state-title{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_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-border-muted pre{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_pre\]\:border-border-muted 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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_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(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_pre_code\]\:text-inherit pre code{color:inherit}.\[\&_select\]\:font-sans select{font-family:var(--sans)}.\[\&_select\]\:text-sm select{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_select\]\:font-normal select{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_select\]\:text-text select{color:var(--text)}.\[\&_span\]\:absolute span{position:absolute}.\[\&_span\]\:start-\[3px\] span{inset-inline-start:3px}.\[\&_span\]\:top-\[3px\] span{top:3px}.\[\&_span\]\:h-3\.5 span{height:calc(var(--spacing) * 3.5)}.\[\&_span\]\:w-3\.5 span{width:calc(var(--spacing) * 3.5)}.\[\&_span\]\:translate-x-4 span{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&_span\]\:overflow-hidden span{overflow:hidden}.\[\&_span\]\:rounded-full span{border-radius:999px}.\[\&_span\]\:bg-background span{background-color:var(--base)}.\[\&_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(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_strong\]\:font-semibold strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-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\]\: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-sm table{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_tbody_tr\:hover_td\]\:bg-surface-bright tbody tr:hover td{background-color:var(--surface-bright)}.\[\&_td\]\:h-12 td{height:calc(var(--spacing) * 12)}.\[\&_td\]\:border-b td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_td\]\:border-b-border-variant td{border-bottom-color:var(--border-variant)}.\[\&_td\]\:border-b-divider-faint td{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_td\]\:border-b-divider-faint td{border-bottom-color:color-mix(in oklab,var(--text) 6%,transparent)}}.\[\&_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\]\:ps-0 td{padding-inline-start:0}.\[\&_td\]\:pe-2\.5 td{padding-inline-end:calc(var(--spacing) * 2.5)}.\[\&_td\]\:pt-0 td{padding-top:0}.\[\&_td\]\:pb-0 td{padding-bottom:0}.\[\&_td\]\:text-start td{text-align:start}.\[\&_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\]\: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\]\:text-end td:last-child{text-align:end}.\[\&_td\:last-child\]\:whitespace-nowrap td:last-child{white-space:nowrap}.\[\&_td\[colspan\]\]\:text-start td[colspan]{text-align:start}.\[\&_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\]\:font-mono textarea{font-family:var(--mono)}.\[\&_textarea\]\:text-base textarea{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_textarea\]\:text-sm textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_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\]\:text-start th{text-align:start}.\[\&_th\]\:text-sm th{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_th\]\:font-medium th{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_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)}.\[\&_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(--font-weight-medium);font-weight:var(--font-weight-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\]\:ps-5\.5 ul{padding-inline-start: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-hover-muted.active{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\.active\]\:bg-hover-muted.active{background-color:color-mix(in oklab,var(--text) 8%,transparent)}}.\[\&\.active\]\:bg-panel.active{background-color:var(--panel)}.\[\&\.active\]\:bg-surface.active{background-color:var(--surface)}.\[\&\.active\]\:font-medium.active{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&\.active\]\:text-muted.active{color:var(--muted)}.\[\&\.active\]\:text-primary.active{color:var(--primary)}.\[\&\.active\]\:text-text.active{color:var(--text)}.\[\&\.active\:\:after\]\:absolute.active:after{position:absolute}.\[\&\.active\:\:after\]\:start-0.active:after{inset-inline-start:calc(var(--spacing) * 0)}.\[\&\.active\:\:after\]\:end-0.active:after{inset-inline-end:calc(var(--spacing) * 0)}.\[\&\.active\:\:after\]\:-bottom-px.active:after{bottom:-1px}.\[\&\.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\]\:start-auto.align-right{inset-inline-start:auto}.\[\&\.align-right\]\:end-0.align-right{inset-inline-end:calc(var(--spacing) * 0)}.\[\&\.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)}.\[\&\.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\]\:pe-0\.5.closable{padding-inline-end:calc(var(--spacing) * .5)}.\[\&\.code\]\:text-accent-orange.code{color:var(--accent-orange)}.\[\&\.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-dot\]\:hidden.editing .session-dot,.\[\&\.editing_\.session-menu-btn\]\:hidden.editing .session-menu-btn{display:none}.\[\&\.err\]\:bg-accent-red.err{background-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-danger-outline.fail{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.fail\]\:border-danger-outline.fail{border-color:color-mix(in oklab,var(--accent-red) 55%,transparent)}}.\[\&\.failed\]\:text-accent-red.failed{color:var(--accent-red)}.\[\&\.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-tree-live.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)}.\[\&\.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-panel-max.max{--tw-shadow:0 12px 40px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&\.max\]\:shadow-panel-max.max{--tw-shadow:0 12px 40px var(--tw-shadow-color,color-mix(in oklab, var(--text) 22%, transparent))}}.\[\&\.max\]\:shadow-panel-max.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-dot\]\:hidden.menu-open .session-dot{display:none}.\[\&\.menu-open_\.session-menu-btn\]\:inline-flex.menu-open .session-menu-btn{display:inline-flex}.\[\&\.muted\]\:text-muted.muted{color:var(--muted)}.\[\&\.ok\]\:bg-accent-green.ok{background-color:var(--accent-green)}.\[\&\.on\]\:bg-primary.on{background-color:var(--primary)}.\[\&\.on\]\:text-background.on{color:var(--base)}.\[\&\.open\]\:rotate-90.open{rotate:90deg}.\[\&\.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-s-accent-amber.permission{border-inline-start-color:var(--accent-amber)}.\[\&\.plan\]\:border-s-accent-blue.plan{border-inline-start-color:var(--accent-blue)}.\[\&\.question\]\:border-s-accent-purple.question{border-inline-start-color:var(--accent-purple)}.\[\&\.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-selected.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\]\:start-auto.session-menu{inset-inline-start:auto}.\[\&\.session-menu\]\:end-1\.5.session-menu{inset-inline-end:calc(var(--spacing) * 1.5)}.\[\&\.session-menu\]\:top-\[calc\(100\%_-_2px\)\].session-menu{top:calc(100% - 2px)}.\[\&\.session-menu\]\:min-w-35.session-menu{min-width:calc(var(--spacing) * 35)}.\[\&\.spreadsheet\]\:text-accent-green.spreadsheet,.\[\&\.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)}.\[\&\.warn\]\:bg-accent-amber.warn{background-color:var(--accent-amber)}.\[\&\:\:-webkit-details-marker\]\:hidden::-webkit-details-marker{display:none}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}.\[\&\:\:-webkit-search-cancel-button\]\:hidden::-webkit-search-cancel-button{display:none}.\[\&\:\:after\]\:pointer-events-none:after{pointer-events:none}.\[\&\:\:after\]\:absolute:after{position:absolute}.\[\&\:\:after\]\:start-0:after{inset-inline-start:calc(var(--spacing) * 0)}.\[\&\:\:after\]\:end-0:after{inset-inline-end:calc(var(--spacing) * 0)}.\[\&\:\:after\]\:top-full:after{top:100%}.\[\&\:\: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)}.\[\&\:active\]\:bg-resizer-hover:active{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\]\:bg-resizer-hover:active{background-color:color-mix(in oklab,var(--text) 12%,transparent)}}.\[\&\:active\:not\(\:disabled\)\]\:border-primary-active:active:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\:not\(\:disabled\)\]\:border-primary-active:active:not(:disabled){border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\:active\:not\(\:disabled\)\]\:bg-danger-active:active:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\:not\(\:disabled\)\]\:bg-danger-active:active:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 14%,transparent)}}.\[\&\:active\:not\(\:disabled\)\]\:bg-highlight:active:not(:disabled){background-color:var(--highlight)}.\[\&\:active\:not\(\:disabled\)\]\:bg-primary-active:active:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\:not\(\:disabled\)\]\:bg-primary-active:active:not(:disabled){background-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\:disabled\]\:cursor-default:disabled{cursor:default}.\[\&\:focus\]\:border-accent-blue:focus{border-color:var(--accent-blue)}.\[\&\: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-visible_\.session-dot\]\:hidden:focus-visible .session-dot{display:none}.\[\&\:focus-visible_\.session-menu-btn\]\:inline-flex:focus-visible .session-menu-btn{display:inline-flex}.\[\&\:has\(\.session-menu-btn\:focus-visible\)_\.session-dot\]\:hidden:has(.session-menu-btn:focus-visible) .session-dot{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\]\:border-primary:hover{border-color:var(--primary)}.\[\&\:hover\]\:border-text:hover{border-color:var(--text)}.\[\&\:hover\]\:bg-canvas:hover{background-color:var(--canvas)}.\[\&\:hover\]\:bg-highlight:hover{background-color:var(--highlight)}.\[\&\:hover\]\:bg-panel:hover{background-color:var(--panel)}.\[\&\:hover\]\:bg-resizer-hover:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\]\:bg-resizer-hover:hover{background-color:color-mix(in oklab,var(--text) 12%,transparent)}}.\[\&\:hover\]\:bg-surface:hover{background-color:var(--surface)}.\[\&\:hover\]\:bg-text:hover{background-color:var(--text)}.\[\&\:hover\]\:text-background:hover{color:var(--base)}.\[\&\:hover\]\:text-text:hover{color:var(--text)}.\[\&\:hover\]\:underline:hover{text-decoration-line:underline}.\[\&\:hover\]\:shadow-tree-hover: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_\.ft-row-delete\]\:opacity-100:hover .ft-row-delete,.\[\&\:hover_\.md-code-copy\]\:opacity-100:hover .md-code-copy{opacity:1}.\[\&\:hover_\.session-dot\]\:hidden:hover .session-dot{display:none}.\[\&\:hover_\.session-menu-btn\]\:inline-flex:hover .session-menu-btn{display:inline-flex}.\[\&\:hover\:not\(\.active\)\]\:bg-surface:hover:not(.active){background-color:var(--surface)}.\[\&\: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-accent-blue:hover:not(:disabled){border-color:var(--accent-blue)}.\[\&\:hover\:not\(\:disabled\)\]\:border-border-strong:hover:not(:disabled){border-color:var(--border-strong)}.\[\&\:hover\:not\(\:disabled\)\]\:border-primary-hover:hover:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:border-primary-hover:hover:not(:disabled){border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\:hover\:not\(\:disabled\)\]\:border-text:hover:not(:disabled){border-color:var(--text)}.\[\&\:hover\:not\(\:disabled\)\]\:bg-accent-amber-subtle:hover:not(:disabled){background-color:var(--accent-amber-subtle)}.\[\&\:hover\:not\(\:disabled\)\]\:bg-accent-blue\/90:hover:not(:disabled){background-color:var(--accent-blue)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-accent-blue\/90:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-blue) 90%,transparent)}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-danger-hover:hover:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-danger-hover:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 8%,transparent)}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-primary-hover:hover:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-primary-hover:hover:not(:disabled){background-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-stop-hover:hover:not(:disabled){background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-stop-hover:hover:not(:disabled){background-color:color-mix(in oklab,var(--surface) 88%,var(--text))}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-surface:hover:not(:disabled){background-color:var(--surface)}.\[\&\:hover\:not\(\:disabled\)\]\:text-accent-red:hover:not(:disabled){color:var(--accent-red)}.\[\&\:hover\:not\(\:disabled\)\]\:text-text:hover:not(:disabled){color:var(--text)}.\[\&\: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\]\:-start-px:not(.active)+.tab:not(.active):before{inset-inline-start:-1px}.\[\&\: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\]\: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)}.\[\&\>\.settings-form\:first-child\]\:mt-0>.settings-form:first-child{margin-top:0}.\[\&\>div\:first-child\]\:border-t-0>div:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.\[\&\[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}: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\)\)\]\:ms-auto{margin-inline-start:auto}.\[\@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:720px){.\[\@container\(\(max-width\:_720px\)\)\]\:hidden{display:none}.\[\@container\(\(max-width\:_720px\)\)\]\:\!w-full{width:100%!important}}@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))}}@media(max-width:520px){.\[\@media\(\(max-width\:_520px\)\)\]\:flex-col{flex-direction:column}.\[\@media\(\(max-width\:_520px\)\)\]\:items-start{align-items:flex-start}}@media(max-width:600px){.\[\@media\(\(max-width\:_600px\)\)\]\:col-span-2{grid-column:span 2/span 2}.\[\@media\(\(max-width\:_600px\)\)\]\:grid-cols-2{grid-template-columns:repeat(2,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(max-width:960px){.\[\@media\(\(max-width\:_960px\)\)\]\:col-span-3{grid-column:span 3/span 3}.\[\@media\(\(max-width\:_960px\)\)\]\:mb-1{margin-bottom:var(--spacing)}.\[\@media\(\(max-width\:_960px\)\)\]\:block{display:block}.\[\@media\(\(max-width\:_960px\)\)\]\:hidden{display:none}.\[\@media\(\(max-width\:_960px\)\)\]\:grid-cols-\[minmax\(0\,0\.8fr\)_minmax\(0\,0\.8fr\)_minmax\(0\,1\.4fr\)\]{grid-template-columns:minmax(0,.8fr) minmax(0,.8fr) minmax(0,1.4fr)}.\[\@media\(\(max-width\:_960px\)\)\]\:flex-wrap{flex-wrap:wrap}.\[\@media\(\(max-width\:_960px\)\)\]\:items-start{align-items:flex-start}.\[\@media\(\(max-width\:_960px\)\)\]\:gap-x-4{column-gap:calc(var(--spacing) * 4)}.\[\@media\(\(max-width\:_960px\)\)\]\:gap-y-3{row-gap:calc(var(--spacing) * 3)}.\[\@media\(\(max-width\:_960px\)\)\]\:px-4{padding-inline:calc(var(--spacing) * 4)}.\[\@media\(\(max-width\:_960px\)\)\]\:py-4{padding-block:calc(var(--spacing) * 4)}.\[\@media\(\(max-width\:_960px\)\)\]\:pt-6{padding-top:calc(var(--spacing) * 6)}.\[\@media\(\(max-width\:_960px\)\)\]\:break-all{word-break:break-all}.\[\@media\(\(max-width\:_960px\)\)\]\:whitespace-normal{white-space:normal}}@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;--border:#d4d4d4;--border-variant:#e5e5e5;--accent-orange:#da642c;--accent-red:#d94654;--accent-teal:#209a84;--accent-blue:#3a8dff;--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;--skill-blue:#184f91;--skill-blue-subtle:#d9e9fb;--skill-blue-slash:#7fa6d2;--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;--modal-top:min(30vh, 260px);--term-bg:#1a1a1a;--term-foreground:#e6e1e0;--term-selection:#2c3441;--term-app-bg:#fdfbfb;--term-app-foreground:#1d1b1a;--term-app-selection:#e9e2d8;--term-app-ansi-black:#1d1b1a;--term-app-ansi-red:#c0392b;--term-app-ansi-green:#3d8b37;--term-app-ansi-yellow:#b26a00;--term-app-ansi-blue:#2a6fcb;--term-app-ansi-magenta:#8e44ad;--term-app-ansi-cyan:#1a8a7a;--term-app-ansi-white:#8f8a85;--term-app-ansi-bright-black:#6b6663;--term-app-ansi-bright-red:#d94654;--term-app-ansi-bright-green:#5eb64c;--term-app-ansi-bright-yellow:#da9100;--term-app-ansi-bright-blue:#3a8dff;--term-app-ansi-bright-magenta:#9c5cff;--term-app-ansi-bright-cyan:#209a84;--term-app-ansi-bright-white:#1d1b1a;--tool-shimmer:var(--text)}@supports (color:color-mix(in lab,red,red)){:root{--tool-shimmer:color-mix(in srgb, var(--text) 58%, var(--subtext))}}:root{--editor-selection:var(--primary)}@supports (color:color-mix(in lab,red,red)){:root{--editor-selection:color-mix(in oklab, var(--primary) 22%, transparent)}}:root{--readable-col:840px;--border-strong:var(--border);--accent:var(--primary);--teal:var(--accent-teal);--green:var(--accent-green);--red:var(--accent-red);--amber:var(--accent-amber);--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}:root[data-theme=light]{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;--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;--skill-blue:#79adf0;--skill-blue-subtle:#183452;--skill-blue-slash:#527ca8;--accent-purple-subtle:#251933;--dots-muted:#2a2523;--dots-strong:#555;--term-app-bg:#141110;--term-app-foreground:#e6e1e0;--term-app-selection:#2c3441;--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}.tinker-logo{clip-path:inset(34% 9%)}:root[data-theme=dark] .tinker-logo{filter:invert();mix-blend-mode:screen}:root:is([lang=fa],[lang=ar]) #root :where(p,h1,h2,h3,h4,h5,h6,button,label,li,th,td,dt,dd,[role=status],[role=alert]),.md :where(p,h1,h2,h3,h4,li,th,td,blockquote),:root:is([lang=fa],[lang=ar]) #root .file-view-note{unicode-bidi:plaintext}:where(pre,code,.font-mono,.code-source-text,.xterm,.openresearch-diff){direction:ltr;unicode-bidi:isolate}.xterm{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:var(--tool-shimmer);opacity:1}}.tool-running-shimmer{color:#0000;background:linear-gradient(100deg,var(--muted) 12%,var(--subtext) 34%,var(--tool-shimmer) 50%,var(--subtext) 66%,var(--muted) 88%);-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-group-summary .tool-group-label{transition:color .12s}.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;cursor:pointer;font-weight:inherit;text-align: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;display:inline}.tool-line,.tool-group-summary{font-weight:375}.tool-group-rows .tool-line{font-size:var(--text-sm)}.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}.md .file-chip{padding-block:.5px;line-height:1.3}.md .file-chip .file-chip-open{color:currentColor;opacity:.6}.md .file-chip .file-chip-label{text-decoration-line:underline;-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong);text-underline-offset:2px;text-decoration-thickness:.6px}.md .file-chip:hover:not(:disabled) .file-chip-label,.md .file-chip:focus-visible .file-chip-label{-webkit-text-decoration-color:var(--primary);text-decoration-color:var(--primary)}.md .file-chip:disabled .file-chip-label{text-decoration-line:none}.md .file-chip:disabled .file-chip-open{display:none}.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}.project-row:hover .project-row-title{text-underline-offset:2px;text-decoration-line:underline}.project-row:has(.project-row-secondary:hover) .project-row-title{text-decoration-line:none}@media(hover:none){.project-row-delete{opacity:1;pointer-events:auto}}.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){.activity-pulse{animation:none}.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)}}.workspace-body .chat-header{padding-inline-end:8.5rem}.workspace-card-visible .chat-pane{padding-inline-end:16rem}.workspace-card-visible .chat-header{padding-inline-end:1rem}.workspace-card-visible .workspace-tools{top:1.25rem}.code-source-text,.openresearch-diff .diff-line{font-family:var(--mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.55;-moz-tab-size:4;tab-size:4;line-height:1.55}.code-source-wrap,.openresearch-diff .diff-code{overflow-wrap:normal;word-break:normal;overflow-wrap:break-word;white-space:pre-wrap}@property --tw-leading{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes pulse{50%{opacity:.5}} diff --git a/ui/dist/assets/index-DGMb5Jdi.js b/ui/dist/assets/index-jTIk7TjQ.js similarity index 51% rename from ui/dist/assets/index-DGMb5Jdi.js rename to ui/dist/assets/index-jTIk7TjQ.js index c703d214..00752e73 100644 --- a/ui/dist/assets/index-DGMb5Jdi.js +++ b/ui/dist/assets/index-jTIk7TjQ.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PdfPreview-zPnQv7In.js","assets/PdfPreview-DNMWzGmA.css"])))=>i.map(i=>d[i]); -var yV=Object.defineProperty;var $9=e=>{throw TypeError(e)};var xV=(e,n,t)=>n in e?yV(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Hs=(e,n,t)=>xV(e,typeof n!="symbol"?n+"":n,t),R2=(e,n,t)=>n.has(e)||$9("Cannot "+t);var ue=(e,n,t)=>(R2(e,n,"read from private field"),t?t.call(e):n.get(e)),ot=(e,n,t)=>n.has(e)?$9("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),qe=(e,n,t,r)=>(R2(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),Pt=(e,n,t)=>(R2(e,n,"access private method"),t);var Op=(e,n,t,r)=>({set _(s){qe(e,n,s,t)},get _(){return ue(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function vm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M2={exports:{}},Dp={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PdfPreview-1o-LUkLU.js","assets/PdfPreview-DNMWzGmA.css"])))=>i.map(i=>d[i]); +var SV=Object.defineProperty;var B9=e=>{throw TypeError(e)};var CV=(e,n,t)=>n in e?SV(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Us=(e,n,t)=>CV(e,typeof n!="symbol"?n+"":n,t),O2=(e,n,t)=>n.has(e)||B9("Cannot "+t);var le=(e,n,t)=>(O2(e,n,"read from private field"),t?t.call(e):n.get(e)),lt=(e,n,t)=>n.has(e)?B9("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Ue=(e,n,t,r)=>(O2(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),Ht=(e,n,t)=>(O2(e,n,"access private method"),t);var Dp=(e,n,t,r)=>({set _(s){Ue(e,n,s,t)},get _(){return le(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function bm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D2={exports:{}},Lp={};/** * @license React * react-jsx-runtime.production.js * @@ -7,7 +7,7 @@ var yV=Object.defineProperty;var $9=e=>{throw TypeError(e)};var xV=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var B9;function wV(){if(B9)return Dp;B9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:i}}return Dp.Fragment=n,Dp.jsx=t,Dp.jsxs=t,Dp}var P9;function kV(){return P9||(P9=1,M2.exports=wV()),M2.exports}var f=kV(),O2={exports:{}},Jt={};/** + */var P9;function EV(){if(P9)return Lp;P9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:i}}return Lp.Fragment=n,Lp.jsx=t,Lp.jsxs=t,Lp}var F9;function NV(){return F9||(F9=1,D2.exports=EV()),D2.exports}var f=NV(),L2={exports:{}},rn={};/** * @license React * react.production.js * @@ -15,7 +15,7 @@ var yV=Object.defineProperty;var $9=e=>{throw TypeError(e)};var xV=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var F9;function SV(){if(F9)return Jt;F9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),p=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,v={};function b(F,U,K){this.props=F,this.context=U,this.refs=v,this.updater=K||x}b.prototype.isReactComponent={},b.prototype.setState=function(F,U){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,U,"setState")},b.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function w(){}w.prototype=b.prototype;function y(F,U,K){this.props=F,this.context=U,this.refs=v,this.updater=K||x}var C=y.prototype=new w;C.constructor=y,k(C,b.prototype),C.isPureReactComponent=!0;var N=Array.isArray;function z(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function M(F,U,K){var ne=K.ref;return{$$typeof:e,type:F,key:U,ref:ne!==void 0?ne:null,props:K}}function D(F,U){return M(F.type,U,F.props)}function I(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){var U={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(K){return U[K]})}var q=/\/+/g;function H(F,U){return typeof F=="object"&&F!==null&&F.key!=null?$(""+F.key):U.toString(36)}function Q(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(z,z):(F.status="pending",F.then(function(U){F.status==="pending"&&(F.status="fulfilled",F.value=U)},function(U){F.status==="pending"&&(F.status="rejected",F.reason=U)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function V(F,U,K,ne,ce){var _e=typeof F;(_e==="undefined"||_e==="boolean")&&(F=null);var se=!1;if(F===null)se=!0;else switch(_e){case"bigint":case"string":case"number":se=!0;break;case"object":switch(F.$$typeof){case e:case n:se=!0;break;case h:return se=F._init,V(se(F._payload),U,K,ne,ce)}}if(se)return ce=ce(F),se=ne===""?"."+H(F,0):ne,N(ce)?(K="",se!=null&&(K=se.replace(q,"$&/")+"/"),V(ce,U,K,"",function(le){return le})):ce!=null&&(I(ce)&&(ce=D(ce,K+(ce.key==null||F&&F.key===ce.key?"":(""+ce.key).replace(q,"$&/")+"/")+se)),U.push(ce)),1;se=0;var G=ne===""?".":ne+":";if(N(F))for(var oe=0;oe{const n=A.useContext(fO);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},CV=({client:e,children:n})=>(A.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(fO.Provider,{value:e,children:n})),EV={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var au,bk,eO,NV=(eO=class{constructor(){ot(this,au,EV);ot(this,bk,!1)}setTimeoutProvider(e){qe(this,au,e)}setTimeout(e,n){return ue(this,au).setTimeout(e,n)}clearTimeout(e){ue(this,au).clearTimeout(e)}setInterval(e,n){return ue(this,au).setInterval(e,n)}clearInterval(e){ue(this,au).clearInterval(e)}},au=new WeakMap,bk=new WeakMap,eO);const x_=new NV;function zV(e){setTimeout(e,0)}const jV=typeof window>"u"||"Deno"in globalThis;function Ks(){}function TV(e,n){return typeof e=="function"?e(n):e}function dO(e){return typeof e=="number"&&e>=0&&e!==1/0}function hO(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Hr(e,n){return typeof e=="function"?e(n):e}function q9(e,n){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(n.queryHash!==yk(a,n.options))return!1}else if(!lh(n.queryKey,a))return!1}if(t!=="all"){const c=n.isActive();if(t==="active"&&!c||t==="inactive"&&c)return!1}return!(typeof o=="boolean"&&n.isStale()!==o||s&&s!==n.state.fetchStatus||i&&!i(n))}function U9(e,n){const{exact:t,status:r,predicate:s,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(V_(n.options.mutationKey)!==V_(i))return!1}else if(!lh(n.options.mutationKey,i))return!1}return!(r&&n.state.status!==r||s&&!s(n))}function yk(e,n){return((n==null?void 0:n.queryKeyHashFn)||V_)(e)}function V_(e){return JSON.stringify(e,(n,t)=>R4(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function lh(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let r=0;r500)return n;const r=G9(e)&&G9(n);if(!r&&!(R4(e)&&R4(n)))return n;const s=(r?e:Object.keys(e)).length,i=r?n:Object.keys(n),a=i.length,o=r?new Array(a):{};let c=0;for(let u=0;u{x_.setTimeout(n,e)})}function M4(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?xk(e,n):n}function MV(e,n,t=0){const r=[...e,n];return t&&r.length>t?r.slice(1):r}function OV(e,n,t=0){const r=[n,...e];return t&&r.length>t?r.slice(0,-1):r}const wk=Symbol();function pO(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===wk?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function kk(e,n){return typeof e=="function"?e(...n):!!e}function DV(e,n,t){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),r||(r=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),e}let LV=()=>jV;const Sk=()=>LV();var uf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},C_,ou,Gd,tO,IV=(tO=class extends uf{constructor(){super();ot(this,C_);ot(this,ou);ot(this,Gd);qe(this,Gd,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){ue(this,ou)||this.setEventListener(ue(this,Gd))}onUnsubscribe(){var n;this.hasListeners()||((n=ue(this,ou))==null||n.call(this),qe(this,ou,void 0))}setEventListener(n){var t;qe(this,Gd,n),(t=ue(this,ou))==null||t.call(this),qe(this,ou,n(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(n){ue(this,C_)!==n&&(qe(this,C_,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(t=>{t(n)})}isFocused(){var n;return typeof ue(this,C_)=="boolean"?ue(this,C_):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},C_=new WeakMap,ou=new WeakMap,Gd=new WeakMap,tO);const Ck=new IV,$V=zV;function BV(){let e=[],n=0,t=o=>{o()},r=o=>{o()},s=$V;const i=o=>{n?e.push(o):s(()=>{t(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(c=>{t(c)})})})};return{batch:o=>{let c;n++;try{c=o()}finally{n--,n||a()}return c},batchCalls:o=>(...c)=>{i(()=>{o(...c)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}const Or=BV();var Vd,cu,Kd,nO,PV=(nO=class extends uf{constructor(){super();ot(this,Vd,!0);ot(this,cu);ot(this,Kd);qe(this,Kd,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n(!0),r=()=>n(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){ue(this,cu)||this.setEventListener(ue(this,Kd))}onUnsubscribe(){var n;this.hasListeners()||((n=ue(this,cu))==null||n.call(this),qe(this,cu,void 0))}setEventListener(n){var t;qe(this,Kd,n),(t=ue(this,cu))==null||t.call(this),qe(this,cu,n(this.setOnline.bind(this)))}setOnline(n){ue(this,Vd)!==n&&(qe(this,Vd,n),this.listeners.forEach(t=>{t(n)}))}isOnline(){return ue(this,Vd)}},Vd=new WeakMap,cu=new WeakMap,Kd=new WeakMap,nO);const dv=new PV;function FV(e){return Math.min(1e3*2**e,3e4)}function mO(e){return(e??"online")==="online"?dv.isOnline():!0}var hv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function HV(e){return e instanceof hv}function gO(e){let n=!1,t=0,r,s="pending",i,a;const o=new Promise((w,y)=>{i=w,a=y});o.catch(Ks);const c=()=>s!=="pending",u=w=>{var y;if(!c()){const C=new hv(w);k(C),(y=e.onCancel)==null||y.call(e,C)}},h=()=>{n=!0},_=()=>{n=!1},p=()=>Ck.isFocused()&&(e.networkMode==="always"||dv.isOnline())&&e.canRun(),m=()=>mO(e.networkMode)&&e.canRun(),x=w=>{c()||(r==null||r(),s="resolved",i(w))},k=w=>{c()||(r==null||r(),s="rejected",a(w))},v=()=>new Promise(w=>{var y;r=C=>{(c()||p())&&w(C)},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;r=void 0,c()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(c())return;let w;const y=t===0?e.initialPromise:void 0;try{w=y??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(x).catch(C=>{var M;if(c())return;const N=e.retry??(Sk()?0:3),z=e.retryDelay??FV,T=typeof z=="function"?z(t,C):z,j=N===!0||typeof N=="number"&&tp()?void 0:v()).then(()=>{n?k(C):b()})})};return{promise:o,status:()=>s,cancel:u,continue:()=>(r==null||r(),o),cancelRetry:h,continueRetry:_,canStart:m,start:()=>(m()?b():v().then(b),o)}}var E_,rO,vO=(rO=class{constructor(){ot(this,E_)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dO(this.gcTime)&&qe(this,E_,x_.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Sk()?1/0:3e5))}clearGcTimeout(){ue(this,E_)!==void 0&&(x_.clearTimeout(ue(this,E_)),qe(this,E_,void 0))}},E_=new WeakMap,rO);function qV(e){return{onFetch:(n,t)=>{var h,_,p,m,x;const r=n.options,s=(p=(_=(h=n.fetchOptions)==null?void 0:h.meta)==null?void 0:_.fetchMore)==null?void 0:p.direction,i=((m=n.state.data)==null?void 0:m.pages)||[],a=((x=n.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let k=!1;const v=y=>{DV(y,()=>n.signal,()=>k=!0)},b=pO(n.options,n.fetchOptions),w=async(y,C,N)=>{if(k)return Promise.reject(n.signal.reason);if(C==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const I={client:n.client,queryKey:n.queryKey,pageParam:C,direction:N?"backward":"forward",meta:n.options.meta};return v(I),I})(),j=await b(T),{maxPages:M}=n.options,D=N?OV:MV;return{pages:D(y.pages,j,M),pageParams:D(y.pageParams,C,M)}};if(s&&i.length){const y=s==="backward",C=y?UV:K9,N={pages:i,pageParams:a};o=await w(N,C(r,N),y)}else{const y=e??i.length;do{const C=c===0?a[0]??r.initialPageParam:K9(r,o);if(c>0&&C==null)break;o=await w(o,C),c++}while(c{var k,v;return(v=(k=n.options).persister)==null?void 0:v.call(k,u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t)}:n.fetchFn=u}}}function K9(e,{pages:n,pageParams:t}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,t[r],t):void 0}function UV(e,{pages:n,pageParams:t}){var r;return n.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,n[0],n,t[0],t):void 0}var Wd,N_,Qd,Ra,z_,gs,sm,j_,Qa,qc,sO,GV=(sO=class extends vO{constructor(n){super();ot(this,Qa);ot(this,Wd);ot(this,N_);ot(this,Qd);ot(this,Ra);ot(this,z_);ot(this,gs);ot(this,sm);ot(this,j_);qe(this,j_,!1),qe(this,sm,n.defaultOptions),this.setOptions(n.options),this.observers=[],qe(this,z_,n.client),qe(this,Ra,ue(this,z_).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,qe(this,N_,Q9(this.options)),this.state=n.state??ue(this,N_),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return ue(this,Wd)}get promise(){var n;return(n=ue(this,gs))==null?void 0:n.promise}setOptions(n){if(this.options={...ue(this,sm),...n},n!=null&&n._type&&qe(this,Wd,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Q9(this.options);t.data!==void 0&&(this.setState(W9(t.data,t.dataUpdatedAt)),qe(this,N_,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ue(this,Ra).remove(this)}setData(n,t){const r=M4(this.state.data,n,this.options);return Pt(this,Qa,qc).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(n){Pt(this,Qa,qc).call(this,{type:"setState",state:n})}cancel(n){var r,s;const t=(r=ue(this,gs))==null?void 0:r.promise;return(s=ue(this,gs))==null||s.cancel(n),t?t.then(Ks).catch(Ks):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return ue(this,N_)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>Hr(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===wk||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Hr(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!hO(this.state.dataUpdatedAt,n)}onFocus(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(t=ue(this,gs))==null||t.continue()}onOnline(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(t=ue(this,gs))==null||t.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),ue(this,Ra).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const t=this.observers.indexOf(n);t!==-1&&(this.observers.splice(t,1),this.observers.length||(ue(this,gs)&&(ue(this,j_)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?ue(this,gs).cancel({revert:!0}):ue(this,gs).cancelRetry()),this.scheduleGc()),ue(this,Ra).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Pt(this,Qa,qc).call(this,{type:"invalidate"})}async fetch(n,t){var u,h,_,p,m,x,k,v,b,w,y,C;if(this.state.fetchStatus!=="idle"&&((u=ue(this,gs))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(ue(this,gs))return ue(this,gs).continueRetry(),ue(this,gs).promise}if(n&&this.setOptions(n),!this.options.queryFn){const N=this.observers.find(z=>z.options.queryFn);N&&this.setOptions(N.options)}const r=new AbortController,s=N=>{Object.defineProperty(N,"signal",{enumerable:!0,get:()=>(qe(this,j_,!0),r.signal)})},i=()=>{const N=pO(this.options,t),T=(()=>{const j={client:ue(this,z_),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return qe(this,j_,!1),this.options.persister?this.options.persister(N,T,this):N(T)},o=(()=>{const N={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:ue(this,z_),state:this.state,fetchFn:i};return s(N),N})();(h=ue(this,Wd)==="infinite"?qV(this.options.pages):this.options.behavior)==null||h.onFetch(o,this),qe(this,Qd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((_=o.fetchOptions)==null?void 0:_.meta))&&Pt(this,Qa,qc).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const c=qe(this,gs,gO({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,onCancel:N=>{N instanceof hv&&N.revert&&this.setState({...ue(this,Qd),fetchStatus:"idle"}),r.abort()},onFail:(N,z)=>{Pt(this,Qa,qc).call(this,{type:"failed",failureCount:N,error:z})},onPause:()=>{Pt(this,Qa,qc).call(this,{type:"pause"})},onContinue:()=>{Pt(this,Qa,qc).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const N=await c.start();if(N===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(N),(x=(m=ue(this,Ra).config).onSuccess)==null||x.call(m,N,this),(v=(k=ue(this,Ra).config).onSettled)==null||v.call(k,N,this.state.error,this),N}catch(N){if(N instanceof hv){if(N.silent)return ue(this,gs).promise;if(N.revert){if(this.state.data===void 0)throw N;return this.state.data}}throw Pt(this,Qa,qc).call(this,{type:"error",error:N}),(w=(b=ue(this,Ra).config).onError)==null||w.call(b,N,this),(C=(y=ue(this,Ra).config).onSettled)==null||C.call(y,this.state.data,N,this),N}finally{ue(this,gs)===c&&qe(this,gs,void 0),this.scheduleGc()}}},Wd=new WeakMap,N_=new WeakMap,Qd=new WeakMap,Ra=new WeakMap,z_=new WeakMap,gs=new WeakMap,sm=new WeakMap,j_=new WeakMap,Qa=new WeakSet,qc=function(n){const t=r=>{switch(n.type){case"failed":return{...r,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...bO(r.data,this.options),fetchMeta:n.meta??null};case"success":const s={...r,...W9(n.data,n.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return qe(this,Qd,n.manual?s:void 0),s;case"error":const i=n.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...n.state}}};this.state=t(this.state),Or.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),ue(this,Ra).notify({query:this,type:"updated",action:n})})},sO);function bO(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mO(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function W9(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Q9(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,r=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var oi,En,im,ci,T_,Xd,Wc,am,Yd,Zd,A_,R_,lu,Jd,Pn,t0,O4,D4,L4,I4,$4,B4,P4,F4,iO,Ek=(iO=class extends uf{constructor(n,t){super();ot(this,Pn);ot(this,oi);ot(this,En);ot(this,im);ot(this,ci);ot(this,T_);ot(this,Xd);ot(this,Wc);ot(this,am);ot(this,Yd);ot(this,Zd);ot(this,A_);ot(this,R_);ot(this,lu);ot(this,Jd,new Set);this.options=t,qe(this,oi,n),qe(this,Wc,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ue(this,En).addObserver(this),X9(ue(this,En),this.options)?Pt(this,Pn,t0).call(this):this.updateResult(),Pt(this,Pn,$4).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return H4(ue(this,En),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return H4(ue(this,En),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Pt(this,Pn,B4).call(this),Pt(this,Pn,P4).call(this),ue(this,En).removeObserver(this)}setOptions(n){const t=this.options,r=ue(this,En);if(this.options=ue(this,oi).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Hr(this.options.enabled,ue(this,En))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Pt(this,Pn,F4).call(this),ue(this,En).setOptions(this.options),t._defaulted&&!c0(this.options,t)&&ue(this,oi).getQueryCache().notify({type:"observerOptionsUpdated",query:ue(this,En),observer:this});const s=this.hasListeners();s&&Y9(ue(this,En),r,this.options,t)&&Pt(this,Pn,t0).call(this),this.updateResult(),s&&(ue(this,En)!==r||Hr(this.options.enabled,ue(this,En))!==Hr(t.enabled,ue(this,En))||Hr(this.options.staleTime,ue(this,En))!==Hr(t.staleTime,ue(this,En)))&&Pt(this,Pn,D4).call(this);const i=Pt(this,Pn,L4).call(this);s&&(ue(this,En)!==r||Hr(this.options.enabled,ue(this,En))!==Hr(t.enabled,ue(this,En))||i!==ue(this,lu))&&Pt(this,Pn,I4).call(this,i)}getOptimisticResult(n){const t=ue(this,oi).getQueryCache().build(ue(this,oi),n),r=this.createResult(t,n);return c0(this.getCurrentResult(),r)||(qe(this,ci,r),qe(this,Xd,this.options),qe(this,T_,ue(this,En).state)),r}getCurrentResult(){return ue(this,ci)}trackResult(n,t){return new Proxy(n,{get:(r,s)=>(this.trackProp(s),t==null||t(s),Reflect.get(r,s))})}trackProp(n){ue(this,Jd).add(n)}getCurrentQuery(){return ue(this,En)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const t=ue(this,oi).defaultQueryOptions(n),r=ue(this,oi).getQueryCache().build(ue(this,oi),t);let s=()=>{},i;const a=new Promise(o=>{i=o,s=ue(this,oi).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),o(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const o=this.createResult(r,t);return i==null||i(o),o}).finally(()=>{s()}),a])}fetch(n){return Pt(this,Pn,t0).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),ue(this,ci)))}createResult(n,t){var z;const r=ue(this,En),s=this.options,i=ue(this,ci),a=ue(this,T_),o=ue(this,Xd),c=n!==r?n.state:ue(this,im),{state:u}=n;let h={...u},_=!1,p;if(t._optimisticResults){const T=this.hasListeners(),j=!T&&X9(n,t),M=T&&Y9(n,r,t,s);(j||M)&&(h={...h,...bO(u.data,n.options)}),t._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:k}=h;p=h.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&k==="pending"){let T;i!=null&&i.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData)?(T=i.data,v=!0):T=typeof t.placeholderData=="function"?t.placeholderData((z=ue(this,Zd))==null?void 0:z.state.data,ue(this,Zd)):t.placeholderData,T!==void 0&&(k="success",p=M4(i==null?void 0:i.data,T,t),_=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&t.select===ue(this,am))p=ue(this,Yd);else try{qe(this,am,t.select),p=t.select(p),p=M4(i==null?void 0:i.data,p,t),qe(this,Yd,p),qe(this,Wc,null)}catch(T){qe(this,Wc,T)}else p===void 0&&qe(this,Wc,null);ue(this,Wc)&&(m=ue(this,Wc),p=ue(this,Yd),x=Date.now(),k="error",_=!1);const b=h.fetchStatus==="fetching",w=k==="pending",y=k==="error",C=w&&b,N=p!==void 0;return{status:k,fetchStatus:h.fetchStatus,isPending:w,isSuccess:k==="success",isError:y,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:h.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:y&&!N,isPaused:h.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:y&&N,isStale:Nk(n,t),refetch:this.refetch,isEnabled:Hr(t.enabled,n)!==!1}}updateResult(){const n=ue(this,ci),t=this.createResult(ue(this,En),this.options);if(qe(this,T_,ue(this,En).state),qe(this,Xd,this.options),ue(this,T_).data!==void 0&&qe(this,Zd,ue(this,En)),c0(t,n))return;qe(this,ci,t);const s=(()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!ue(this,Jd).size)return!0;const o=new Set(a??ue(this,Jd));return this.options.throwOnError&&o.add("error"),Object.keys(ue(this,ci)).some(c=>{const u=c;return ue(this,ci)[u]!==n[u]&&o.has(u)})})();Or.batch(()=>{s&&this.listeners.forEach(i=>{i(ue(this,ci))}),ue(this,oi).getQueryCache().notify({query:ue(this,En),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Pt(this,Pn,$4).call(this)}},oi=new WeakMap,En=new WeakMap,im=new WeakMap,ci=new WeakMap,T_=new WeakMap,Xd=new WeakMap,Wc=new WeakMap,am=new WeakMap,Yd=new WeakMap,Zd=new WeakMap,A_=new WeakMap,R_=new WeakMap,lu=new WeakMap,Jd=new WeakMap,Pn=new WeakSet,t0=function(n){Pt(this,Pn,F4).call(this);let t=ue(this,En).fetch(this.options,n);return n!=null&&n.throwOnError||(t=t.catch(Ks)),t},O4=function(n){return!Sk()&&Hr(this.options.enabled,ue(this,En))!==!1&&dO(n)},D4=function(){Pt(this,Pn,B4).call(this);const n=Hr(this.options.staleTime,ue(this,En));if(ue(this,ci).isStale||!Pt(this,Pn,O4).call(this,n))return;const t=hO(ue(this,ci).dataUpdatedAt,n)+1;qe(this,A_,x_.setTimeout(()=>{ue(this,ci).isStale||this.updateResult()},t))},L4=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ue(this,En)):this.options.refetchInterval)??!1},I4=function(n){Pt(this,Pn,P4).call(this),qe(this,lu,n),!(ue(this,lu)===0||!Pt(this,Pn,O4).call(this,ue(this,lu)))&&qe(this,R_,x_.setInterval(()=>{(this.options.refetchIntervalInBackground||Ck.isFocused())&&Pt(this,Pn,t0).call(this)},ue(this,lu)))},$4=function(){Pt(this,Pn,D4).call(this),Pt(this,Pn,I4).call(this,Pt(this,Pn,L4).call(this))},B4=function(){ue(this,A_)!==void 0&&(x_.clearTimeout(ue(this,A_)),qe(this,A_,void 0))},P4=function(){ue(this,R_)!==void 0&&(x_.clearInterval(ue(this,R_)),qe(this,R_,void 0))},F4=function(){const n=ue(this,oi).getQueryCache().build(ue(this,oi),this.options);if(n===ue(this,En))return;const t=ue(this,En);qe(this,En,n),qe(this,im,n.state),this.hasListeners()&&(t==null||t.removeObserver(this),n.addObserver(this))},iO);function VV(e,n){return Hr(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Hr(n.retryOnMount,e)===!1)}function X9(e,n){return VV(e,n)||e.state.data!==void 0&&H4(e,n,n.refetchOnMount)}function H4(e,n,t){if(Hr(n.enabled,e)!==!1&&Hr(n.staleTime,e)!=="static"){const r=typeof t=="function"?t(e):t;return r==="always"||r!==!1&&Nk(e,n)}return!1}function Y9(e,n,t,r){return(e!==n||Hr(r.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&Nk(e,t)}function Nk(e,n){return Hr(n.enabled,e)!==!1&&e.isStaleByTime(Hr(n.staleTime,e))}var om,Po,Us,M_,Fo,tu,aO,KV=(aO=class extends vO{constructor(n){super();ot(this,Fo);ot(this,om);ot(this,Po);ot(this,Us);ot(this,M_);qe(this,om,n.client),this.mutationId=n.mutationId,qe(this,Us,n.mutationCache),qe(this,Po,[]),this.state=n.state||yO(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){ue(this,Po).includes(n)||(ue(this,Po).push(n),this.clearGcTimeout(),ue(this,Us).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){qe(this,Po,ue(this,Po).filter(t=>t!==n)),this.scheduleGc(),ue(this,Us).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){ue(this,Po).length||(this.state.status==="pending"?this.scheduleGc():ue(this,Us).remove(this))}continue(){var n;return((n=ue(this,M_))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var o,c,u,h,_,p,m,x,k,v,b,w,y,C,N,z,T,j;const t=()=>{Pt(this,Fo,tu).call(this,{type:"continue"})},r={client:ue(this,om),meta:this.options.meta,mutationKey:this.options.mutationKey},s=qe(this,M_,gO({fn:()=>this.options.mutationFn?this.options.mutationFn(n,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,D)=>{Pt(this,Fo,tu).call(this,{type:"failed",failureCount:M,error:D})},onPause:()=>{Pt(this,Fo,tu).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ue(this,Us).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)t();else{Pt(this,Fo,tu).call(this,{type:"pending",variables:n,isPaused:a}),ue(this,Us).config.onMutate&&await ue(this,Us).config.onMutate(n,this,r);const D=await((c=(o=this.options).onMutate)==null?void 0:c.call(o,n,r));D!==this.state.context&&Pt(this,Fo,tu).call(this,{type:"pending",context:D,variables:n,isPaused:a})}const M=await s.start();return await((h=(u=ue(this,Us).config).onSuccess)==null?void 0:h.call(u,M,n,this.state.context,this,r)),await((p=(_=this.options).onSuccess)==null?void 0:p.call(_,M,n,this.state.context,r)),await((x=(m=ue(this,Us).config).onSettled)==null?void 0:x.call(m,M,null,this.state.variables,this.state.context,this,r)),await((v=(k=this.options).onSettled)==null?void 0:v.call(k,M,null,n,this.state.context,r)),Pt(this,Fo,tu).call(this,{type:"success",data:M}),M}catch(M){try{await((w=(b=ue(this,Us).config).onError)==null?void 0:w.call(b,M,n,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((C=(y=this.options).onError)==null?void 0:C.call(y,M,n,this.state.context,r))}catch(D){Promise.reject(D)}try{await((z=(N=ue(this,Us).config).onSettled)==null?void 0:z.call(N,void 0,M,this.state.variables,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,M,n,this.state.context,r))}catch(D){Promise.reject(D)}throw Pt(this,Fo,tu).call(this,{type:"error",error:M}),M}finally{ue(this,M_)===s&&qe(this,M_,void 0),ue(this,Us).runNext(this)}}},om=new WeakMap,Po=new WeakMap,Us=new WeakMap,M_=new WeakMap,Fo=new WeakSet,tu=function(n){const t=r=>{switch(n.type){case"failed":return{...r,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...r,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:n.error,failureCount:r.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Or.batch(()=>{ue(this,Po).forEach(r=>{r.onMutationUpdate(n)}),ue(this,Us).notify({mutation:this,type:"updated",action:n})})},aO);function yO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qc,Xa,cm,oO,WV=(oO=class extends uf{constructor(n={}){super();ot(this,Qc);ot(this,Xa);ot(this,cm);this.config=n,qe(this,Qc,new Set),qe(this,Xa,new Map),qe(this,cm,0)}build(n,t,r){const s=new KV({client:n,mutationCache:this,mutationId:++Op(this,cm)._,options:n.defaultMutationOptions(t),state:r});return this.add(s),s}add(n){ue(this,Qc).add(n);const t=Ug(n);if(typeof t=="string"){const r=ue(this,Xa).get(t);r?r.push(n):ue(this,Xa).set(t,[n])}this.notify({type:"added",mutation:n})}remove(n){if(ue(this,Qc).delete(n)){const t=Ug(n);if(typeof t=="string"){const r=ue(this,Xa).get(t);if(r)if(r.length>1){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}else r[0]===n&&ue(this,Xa).delete(t)}}this.notify({type:"removed",mutation:n})}canRun(n){var r;const t=Ug(n);if(typeof t=="string"){const s=(r=ue(this,Xa).get(t))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===n}else return!0}runNext(n){var r,s;const t=Ug(n);return typeof t=="string"?((s=(r=ue(this,Xa).get(t))==null?void 0:r.find(i=>i!==n&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Or.batch(()=>{ue(this,Qc).forEach(n=>{this.notify({type:"removed",mutation:n})}),ue(this,Qc).clear(),ue(this,Xa).clear()})}getAll(){return Array.from(ue(this,Qc))}find(n){const t={exact:!0,...n};return this.getAll().find(r=>U9(t,r))}findAll(n={}){return this.getAll().filter(t=>U9(n,t))}notify(n){Or.batch(()=>{this.listeners.forEach(t=>{t(n)})})}resumePausedMutations(){const n=this.getAll().filter(t=>t.state.isPaused);return Or.batch(()=>Promise.all(n.map(t=>t.continue().catch(Ks))))}},Qc=new WeakMap,Xa=new WeakMap,cm=new WeakMap,oO);function Ug(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Xc,uu,Gs,Yc,Ko,n0,q4,cO,QV=(cO=class extends uf{constructor(t,r){super();ot(this,Ko);ot(this,Xc);ot(this,uu);ot(this,Gs);ot(this,Yc);qe(this,Xc,t),this.setOptions(r),this.bindMethods(),Pt(this,Ko,n0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const r=this.options;this.options=ue(this,Xc).defaultMutationOptions(t),c0(this.options,r)||ue(this,Xc).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ue(this,Gs),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&V_(r.mutationKey)!==V_(this.options.mutationKey)?this.reset():((s=ue(this,Gs))==null?void 0:s.state.status)==="pending"&&ue(this,Gs).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&ue(this,Gs)&&(ue(this,Gs).addObserver(this),Pt(this,Ko,n0).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=ue(this,Gs))==null||t.removeObserver(this)}onMutationUpdate(t){Pt(this,Ko,n0).call(this),Pt(this,Ko,q4).call(this,t)}getCurrentResult(){return ue(this,uu)}reset(){var t;(t=ue(this,Gs))==null||t.removeObserver(this),qe(this,Gs,void 0),Pt(this,Ko,n0).call(this),Pt(this,Ko,q4).call(this)}mutate(t,r){var s;return qe(this,Yc,r),(s=ue(this,Gs))==null||s.removeObserver(this),qe(this,Gs,ue(this,Xc).getMutationCache().build(ue(this,Xc),this.options)),ue(this,Gs).addObserver(this),ue(this,Gs).execute(t)}},Xc=new WeakMap,uu=new WeakMap,Gs=new WeakMap,Yc=new WeakMap,Ko=new WeakSet,n0=function(){var r;const t=((r=ue(this,Gs))==null?void 0:r.state)??yO();qe(this,uu,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},q4=function(t){Or.batch(()=>{var r,s,i,a,o,c,u,h;if(ue(this,Yc)&&this.hasListeners()){const _=ue(this,uu).variables,p=ue(this,uu).context,m={client:ue(this,Xc),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(r=ue(this,Yc)).onSuccess)==null||s.call(r,t.data,_,p,m)}catch(x){Promise.reject(x)}try{(a=(i=ue(this,Yc)).onSettled)==null||a.call(i,t.data,null,_,p,m)}catch(x){Promise.reject(x)}}else if((t==null?void 0:t.type)==="error"){try{(c=(o=ue(this,Yc)).onError)==null||c.call(o,t.error,_,p,m)}catch(x){Promise.reject(x)}try{(h=(u=ue(this,Yc)).onSettled)==null||h.call(u,void 0,t.error,_,p,m)}catch(x){Promise.reject(x)}}}this.listeners.forEach(_=>{_(ue(this,uu))})})},cO);function Z9(e,n){const t=new Set(n);return e.filter(r=>!t.has(r))}var eh,li,th,O_,Ki,D_,lm,um,_m,fm,xs,U4,G4,xO,V4,K4,W4,lO,XV=(lO=class extends uf{constructor(n,t,r){super();ot(this,xs);ot(this,eh);ot(this,li);ot(this,th);ot(this,O_);ot(this,Ki);ot(this,D_);ot(this,lm);ot(this,um);ot(this,_m);ot(this,fm,[]);qe(this,eh,n),qe(this,O_,r),qe(this,th,[]),qe(this,Ki,[]),qe(this,li,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&ue(this,Ki).forEach(n=>{n.subscribe(t=>{Pt(this,xs,K4).call(this,n,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,ue(this,Ki).forEach(n=>{n.destroy()})}setQueries(n,t){qe(this,th,n),qe(this,O_,t),Or.batch(()=>{const r=ue(this,Ki),s=Pt(this,xs,V4).call(this,ue(this,th));s.forEach(_=>_.observer.setOptions(_.defaultedQueryOptions));const i=s.map(_=>_.observer),a=i.map(_=>_.getCurrentResult()),o=r.length!==i.length,c=i.some((_,p)=>_!==r[p]),u=o||c,h=u?!0:a.some((_,p)=>{const m=ue(this,li)[p];return!m||!c0(_,m)});!u&&!h||(u&&(qe(this,fm,s),qe(this,Ki,i)),qe(this,li,a),this.hasListeners()&&(u&&(Z9(r,i).forEach(_=>{_.destroy()}),Z9(i,r).forEach(_=>{_.subscribe(p=>{Pt(this,xs,K4).call(this,_,p)})})),Pt(this,xs,W4).call(this)))})}getCurrentResult(){return ue(this,li)}getQueries(){return ue(this,Ki).map(n=>n.getCurrentQuery())}getObservers(){return ue(this,Ki)}getOptimisticResult(n,t){const r=Pt(this,xs,V4).call(this,n),s=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=r.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>Pt(this,xs,G4).call(this,a??s,t,i),()=>Pt(this,xs,U4).call(this,s,r)]}},eh=new WeakMap,li=new WeakMap,th=new WeakMap,O_=new WeakMap,Ki=new WeakMap,D_=new WeakMap,lm=new WeakMap,um=new WeakMap,_m=new WeakMap,fm=new WeakMap,xs=new WeakSet,U4=function(n,t){const r=new Set;return t.map((s,i)=>{const a=n[i];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{r.has(o)||(r.add(o),t.forEach(c=>{c.observer.trackProp(o)}))})})},G4=function(n,t,r){if(t){const s=ue(this,_m),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((a,o)=>a!==s[o]));return(ue(this,li)!==ue(this,um)||i||t!==ue(this,lm))&&(qe(this,lm,t),qe(this,um,ue(this,li)),r!==void 0&&qe(this,_m,r),qe(this,D_,xk(ue(this,D_),t(n)))),ue(this,D_)}return n},xO=function(){var n;return!((n=ue(this,O_))!=null&&n.combine)||ue(this,Ki).some((t,r)=>{var s;return t.options.suspense&&((s=ue(this,li)[r])==null?void 0:s.data)===void 0})},V4=function(n){const t=new Map;ue(this,Ki).forEach(s=>{const i=s.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(s):t.set(i,[s])});const r=[];return n.forEach(s=>{var o;const i=ue(this,eh).defaultQueryOptions(s),a=((o=t.get(i.queryHash))==null?void 0:o.shift())??new Ek(ue(this,eh),i);r.push({defaultedQueryOptions:i,observer:a})}),r},K4=function(n,t){const r=ue(this,Ki).indexOf(n);r!==-1&&(qe(this,li,ue(this,li).slice()),ue(this,li)[r]=t,Pt(this,xs,W4).call(this))},W4=function(){var n;if(this.hasListeners()){const t=Pt(this,xs,xO).call(this),r=ue(this,D_),s=t?r:Pt(this,xs,G4).call(this,Pt(this,xs,U4).call(this,ue(this,li),ue(this,fm)),(n=ue(this,O_))==null?void 0:n.combine);(t||r!==s)&&Or.batch(()=>{this.listeners.forEach(i=>{i(ue(this,li))})})}},lO),Ho,uO,YV=(uO=class extends uf{constructor(n={}){super();ot(this,Ho);this.config=n,qe(this,Ho,new Map)}build(n,t,r){const s=t.queryKey,i=t.queryHash??yk(s,t);let a=this.get(i);return a||(a=new GV({client:n,queryKey:s,queryHash:i,options:n.defaultQueryOptions(t),state:r,defaultOptions:n.getQueryDefaults(s)}),this.add(a)),a}add(n){ue(this,Ho).has(n.queryHash)||(ue(this,Ho).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const t=ue(this,Ho).get(n.queryHash);t&&(n.destroy(),t===n&&ue(this,Ho).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Or.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return ue(this,Ho).get(n)}getAll(){return[...ue(this,Ho).values()]}find(n){const t={exact:!0,...n};return this.getAll().find(r=>q9(t,r))}findAll(n={}){const t=this.getAll();return Object.keys(n).length>0?t.filter(r=>q9(n,r)):t}notify(n){Or.batch(()=>{this.listeners.forEach(t=>{t(n)})})}onFocus(){Or.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Or.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Ho=new WeakMap,uO),Rr,_u,fu,nh,rh,du,sh,ih,_O,ZV=(_O=class{constructor(e={}){ot(this,Rr);ot(this,_u);ot(this,fu);ot(this,nh);ot(this,rh);ot(this,du);ot(this,sh);ot(this,ih);qe(this,Rr,e.queryCache||new YV),qe(this,_u,e.mutationCache||new WV),qe(this,fu,e.defaultOptions||{}),qe(this,nh,new Map),qe(this,rh,new Map),qe(this,du,0)}mount(){Op(this,du)._++,ue(this,du)===1&&(qe(this,sh,Ck.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,Rr).onFocus())})),qe(this,ih,dv.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,Rr).onOnline())})))}unmount(){var e,n;Op(this,du)._--,ue(this,du)===0&&((e=ue(this,sh))==null||e.call(this),qe(this,sh,void 0),(n=ue(this,ih))==null||n.call(this),qe(this,ih,void 0))}isFetching(e){return ue(this,Rr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ue(this,_u).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=ue(this,Rr).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=ue(this,Rr).build(this,n),r=t.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime(Hr(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return ue(this,Rr).findAll(e).map(({queryKey:n,state:t})=>[n,t.data])}setQueryData(e,n,t){var a;const r=this.defaultQueryOptions({queryKey:e}),s=(a=ue(this,Rr).get(r.queryHash))==null?void 0:a.state.data,i=TV(n,s);if(i!==void 0)return ue(this,Rr).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Or.batch(()=>ue(this,Rr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,t)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=ue(this,Rr).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const n=ue(this,Rr);Or.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=ue(this,Rr);return Or.batch(()=>{const r=t.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},n)})}cancelQueries(e,n={}){const t={revert:!0,...n},r=Or.batch(()=>ue(this,Rr).findAll(e).map(s=>s.cancel(t)));return Promise.all(r).then(Ks).catch(Ks)}invalidateQueries(e,n={}){return Or.batch(()=>(ue(this,Rr).findAll(e).forEach(t=>{t.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},r=Or.batch(()=>ue(this,Rr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Ks)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ks)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=ue(this,Rr).build(this,n),r=t.isStaleByTime(Hr(n.staleTime,t))?await t.fetch(n):t.state.data,s=n.select;return s?s(r):r}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=ue(this,Rr).build(this,n);return t.isStaleByTime(Hr(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ks).catch(Ks)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ks).catch(Ks)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return dv.isOnline()?ue(this,_u).resumePausedMutations():Promise.resolve()}getQueryCache(){return ue(this,Rr)}getMutationCache(){return ue(this,_u)}getDefaultOptions(){return ue(this,fu)}setDefaultOptions(e){qe(this,fu,e)}setQueryDefaults(e,n){ue(this,nh).set(V_(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...ue(this,nh).values()],t={};return n.forEach(r=>{lh(e,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(e,n){ue(this,rh).set(V_(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...ue(this,rh).values()],t={};return n.forEach(r=>{lh(e,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...ue(this,fu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=yk(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===wk&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ue(this,fu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ue(this,Rr).clear(),ue(this,_u).clear()}},Rr=new WeakMap,_u=new WeakMap,fu=new WeakMap,nh=new WeakMap,rh=new WeakMap,du=new WeakMap,sh=new WeakMap,ih=new WeakMap,_O);const wO=A.createContext(!1),kO=()=>A.useContext(wO);wO.Provider;function JV(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const eK=A.createContext(JV()),SO=()=>A.useContext(eK),CO=(e,n,t)=>{const r=t!=null&&t.state.error&&typeof e.throwOnError=="function"?kk(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||r)&&(n.isReset()||(e.retryOnMount=!1))},EO=e=>{A.useEffect(()=>{e.clearReset()},[e])},NO=({result:e,errorResetBoundary:n,throwOnError:t,query:r,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||kk(t,[e.error,r])),zO=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>t(r(...s)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Q4=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,jO=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function tK({queries:e,...n},t){const r=ym(),s=kO(),i=SO(),a=n.subscribed!==!1,o=A.useMemo(()=>e.map(k=>{const v=r.defaultQueryOptions(k);return v._optimisticResults=s?"isRestoring":a?"optimistic":void 0,v}),[e,r,s,a]);o.forEach(k=>{zO(k);const v=r.getQueryCache().get(k.queryHash);CO(k,i,v)}),EO(i);const[c]=A.useState(()=>new XV(r,o,n)),[u,h,_]=c.getOptimisticResult(o,n.combine),p=!s&&a;A.useSyncExternalStore(A.useCallback(k=>p?c.subscribe(Or.batchCalls(k)):Ks,[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),A.useEffect(()=>{c.setQueries(o,n)},[o,n,c]);const m=u.some((k,v)=>Q4(o[v],k))?u.flatMap((k,v)=>{const b=o[v];if(b&&Q4(b,k)){const w=new Ek(r,b);return jO(b,w,i)}return[]}):[];if(m.length>0)throw Promise.all(m);const x=u.find((k,v)=>{const b=o[v];return b&&NO({result:k,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(x)throw x.error;return h(_())}function nK(e,n,t){const r=kO(),s=SO(),i=ym(),a=i.defaultQueryOptions(e),o=i.getQueryCache().get(a.queryHash),c=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,zO(a),CO(a,s,o),EO(s);const[u]=A.useState(()=>new n(i,a)),h=u.getOptimisticResult(a),_=!r&&c;if(A.useSyncExternalStore(A.useCallback(p=>{const m=_?u.subscribe(Or.batchCalls(p)):Ks;return u.updateResult(),m},[u,_]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),A.useEffect(()=>{u.setOptions(a)},[a,u]),Q4(a,h))throw jO(a,u,s);if(NO({result:h,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw h.error;return a.notifyOnChangeProps?h:u.trackResult(h)}function ct(e,n){return nK(e,Ek)}function rK(e,n){const t=ym(),r=t.getQueryCache();return A.useSyncExternalStore(A.useCallback(s=>r.subscribe(Or.batchCalls(s)),[r]),()=>t.isFetching(e),()=>t.isFetching(e))}function an(e,n){const t=ym(),[r]=A.useState(()=>new QV(t,e));A.useEffect(()=>{r.setOptions(e)},[r,e]);const s=A.useSyncExternalStore(A.useCallback(a=>r.subscribe(Or.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=A.useCallback((...a)=>{r.mutate(a[0],a[1]).catch(Ks)},[r]);if(s.error&&kk(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const et=new ZV({defaultOptions:{queries:{staleTime:3e4,gcTime:6e5,retry:!1,networkMode:"always",refetchOnReconnect:!0},mutations:{retry:!1,networkMode:"always"}}}),ll=new Set;let J9=null,xb=0;const X4=new Set,sK=()=>xb,eE=e=>(X4.add(e),()=>{X4.delete(e)}),Ia=()=>["workspace",xb],zt=(e,...n)=>[...Ia(),e,...n];function iK(e,n=!1){if(J9===e&&!n)return!1;const t=Ia();return J9=e,xb++,ll.clear(),zk({queryKey:t}),X4.forEach(r=>r()),!0}const Dn=e=>e[1]===xb;async function zk(e){await et.cancelQueries(e,{revert:!1}),et.removeQueries(e)}function Jr(e,n){if(Dn(e))return et.setQueryData(e,n)}var D2={exports:{}},Lp={},L2={exports:{}},I2={};/** + */var H9;function zV(){if(H9)return rn;H9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),p=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,v={};function b(F,U,K){this.props=F,this.context=U,this.refs=v,this.updater=K||w}b.prototype.isReactComponent={},b.prototype.setState=function(F,U){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,U,"setState")},b.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function x(){}x.prototype=b.prototype;function y(F,U,K){this.props=F,this.context=U,this.refs=v,this.updater=K||w}var C=y.prototype=new x;C.constructor=y,k(C,b.prototype),C.isPureReactComponent=!0;var z=Array.isArray;function E(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function M(F,U,K){var ne=K.ref;return{$$typeof:e,type:F,key:U,ref:ne!==void 0?ne:null,props:K}}function D(F,U){return M(F.type,U,F.props)}function I(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){var U={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(K){return U[K]})}var q=/\/+/g;function H(F,U){return typeof F=="object"&&F!==null&&F.key!=null?$(""+F.key):U.toString(36)}function Q(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(E,E):(F.status="pending",F.then(function(U){F.status==="pending"&&(F.status="fulfilled",F.value=U)},function(U){F.status==="pending"&&(F.status="rejected",F.reason=U)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function V(F,U,K,ne,oe){var ue=typeof F;(ue==="undefined"||ue==="boolean")&&(F=null);var se=!1;if(F===null)se=!0;else switch(ue){case"bigint":case"string":case"number":se=!0;break;case"object":switch(F.$$typeof){case e:case n:se=!0;break;case h:return se=F._init,V(se(F._payload),U,K,ne,oe)}}if(se)return oe=oe(F),se=ne===""?"."+H(F,0):ne,z(oe)?(K="",se!=null&&(K=se.replace(q,"$&/")+"/"),V(oe,U,K,"",function(ce){return ce})):oe!=null&&(I(oe)&&(oe=D(oe,K+(oe.key==null||F&&F.key===oe.key?"":(""+oe.key).replace(q,"$&/")+"/")+se)),U.push(oe)),1;se=0;var G=ne===""?".":ne+":";if(z(F))for(var ae=0;ae{const n=A.useContext(hO);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},jV=({client:e,children:n})=>(A.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(hO.Provider,{value:e,children:n})),TV={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var mu,xk,nO,AV=(nO=class{constructor(){lt(this,mu,TV);lt(this,xk,!1)}setTimeoutProvider(e){Ue(this,mu,e)}setTimeout(e,n){return le(this,mu).setTimeout(e,n)}clearTimeout(e){le(this,mu).clearTimeout(e)}setInterval(e,n){return le(this,mu).setInterval(e,n)}clearInterval(e){le(this,mu).clearInterval(e)}},mu=new WeakMap,xk=new WeakMap,nO);const j_=new AV;function RV(e){setTimeout(e,0)}const MV=typeof window>"u"||"Deno"in globalThis;function Qs(){}function OV(e,n){return typeof e=="function"?e(n):e}function pO(e){return typeof e=="number"&&e>=0&&e!==1/0}function mO(e,n){return Math.max(e+(n||0)-Date.now(),0)}function qr(e,n){return typeof e=="function"?e(n):e}function U9(e,n){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(n.queryHash!==wk(a,n.options))return!1}else if(!uh(n.queryKey,a))return!1}if(t!=="all"){const c=n.isActive();if(t==="active"&&!c||t==="inactive"&&c)return!1}return!(typeof o=="boolean"&&n.isStale()!==o||s&&s!==n.state.fetchStatus||i&&!i(n))}function G9(e,n){const{exact:t,status:r,predicate:s,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(ef(n.options.mutationKey)!==ef(i))return!1}else if(!uh(n.options.mutationKey,i))return!1}return!(r&&n.state.status!==r||s&&!s(n))}function wk(e,n){return((n==null?void 0:n.queryKeyHashFn)||ef)(e)}function ef(e){return JSON.stringify(e,(n,t)=>O4(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function uh(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let r=0;r500)return n;const r=V9(e)&&V9(n);if(!r&&!(O4(e)&&O4(n)))return n;const s=(r?e:Object.keys(e)).length,i=r?n:Object.keys(n),a=i.length,o=r?new Array(a):{};let c=0;for(let u=0;u{j_.setTimeout(n,e)})}function D4(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?kk(e,n):n}function IV(e,n,t=0){const r=[...e,n];return t&&r.length>t?r.slice(1):r}function $V(e,n,t=0){const r=[n,...e];return t&&r.length>t?r.slice(0,-1):r}const Sk=Symbol();function gO(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===Sk?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ck(e,n){return typeof e=="function"?e(...n):!!e}function BV(e,n,t){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),r||(r=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),e}let PV=()=>MV;const Ek=()=>PV();var vf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},M_,gu,Vd,rO,FV=(rO=class extends vf{constructor(){super();lt(this,M_);lt(this,gu);lt(this,Vd);Ue(this,Vd,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){le(this,gu)||this.setEventListener(le(this,Vd))}onUnsubscribe(){var n;this.hasListeners()||((n=le(this,gu))==null||n.call(this),Ue(this,gu,void 0))}setEventListener(n){var t;Ue(this,Vd,n),(t=le(this,gu))==null||t.call(this),Ue(this,gu,n(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(n){le(this,M_)!==n&&(Ue(this,M_,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(t=>{t(n)})}isFocused(){var n;return typeof le(this,M_)=="boolean"?le(this,M_):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},M_=new WeakMap,gu=new WeakMap,Vd=new WeakMap,rO);const Nk=new FV,HV=RV;function qV(){let e=[],n=0,t=o=>{o()},r=o=>{o()},s=HV;const i=o=>{n?e.push(o):s(()=>{t(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(c=>{t(c)})})})};return{batch:o=>{let c;n++;try{c=o()}finally{n--,n||a()}return c},batchCalls:o=>(...c)=>{i(()=>{o(...c)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}const Dr=qV();var Kd,vu,Wd,sO,UV=(sO=class extends vf{constructor(){super();lt(this,Kd,!0);lt(this,vu);lt(this,Wd);Ue(this,Wd,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n(!0),r=()=>n(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){le(this,vu)||this.setEventListener(le(this,Wd))}onUnsubscribe(){var n;this.hasListeners()||((n=le(this,vu))==null||n.call(this),Ue(this,vu,void 0))}setEventListener(n){var t;Ue(this,Wd,n),(t=le(this,vu))==null||t.call(this),Ue(this,vu,n(this.setOnline.bind(this)))}setOnline(n){le(this,Kd)!==n&&(Ue(this,Kd,n),this.listeners.forEach(t=>{t(n)}))}isOnline(){return le(this,Kd)}},Kd=new WeakMap,vu=new WeakMap,Wd=new WeakMap,sO);const dv=new UV;function GV(e){return Math.min(1e3*2**e,3e4)}function vO(e){return(e??"online")==="online"?dv.isOnline():!0}var hv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function VV(e){return e instanceof hv}function bO(e){let n=!1,t=0,r,s="pending",i,a;const o=new Promise((x,y)=>{i=x,a=y});o.catch(Qs);const c=()=>s!=="pending",u=x=>{var y;if(!c()){const C=new hv(x);k(C),(y=e.onCancel)==null||y.call(e,C)}},h=()=>{n=!0},_=()=>{n=!1},p=()=>Nk.isFocused()&&(e.networkMode==="always"||dv.isOnline())&&e.canRun(),m=()=>vO(e.networkMode)&&e.canRun(),w=x=>{c()||(r==null||r(),s="resolved",i(x))},k=x=>{c()||(r==null||r(),s="rejected",a(x))},v=()=>new Promise(x=>{var y;r=C=>{(c()||p())&&x(C)},(y=e.onPause)==null||y.call(e)}).then(()=>{var x;r=void 0,c()||(x=e.onContinue)==null||x.call(e)}),b=()=>{if(c())return;let x;const y=t===0?e.initialPromise:void 0;try{x=y??e.fn()}catch(C){x=Promise.reject(C)}Promise.resolve(x).then(w).catch(C=>{var M;if(c())return;const z=e.retry??(Ek()?0:3),E=e.retryDelay??GV,T=typeof E=="function"?E(t,C):E,j=z===!0||typeof z=="number"&&tp()?void 0:v()).then(()=>{n?k(C):b()})})};return{promise:o,status:()=>s,cancel:u,continue:()=>(r==null||r(),o),cancelRetry:h,continueRetry:_,canStart:m,start:()=>(m()?b():v().then(b),o)}}var O_,iO,yO=(iO=class{constructor(){lt(this,O_)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pO(this.gcTime)&&Ue(this,O_,j_.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ek()?1/0:3e5))}clearGcTimeout(){le(this,O_)!==void 0&&(j_.clearTimeout(le(this,O_)),Ue(this,O_,void 0))}},O_=new WeakMap,iO);function KV(e){return{onFetch:(n,t)=>{var h,_,p,m,w;const r=n.options,s=(p=(_=(h=n.fetchOptions)==null?void 0:h.meta)==null?void 0:_.fetchMore)==null?void 0:p.direction,i=((m=n.state.data)==null?void 0:m.pages)||[],a=((w=n.state.data)==null?void 0:w.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let k=!1;const v=y=>{BV(y,()=>n.signal,()=>k=!0)},b=gO(n.options,n.fetchOptions),x=async(y,C,z)=>{if(k)return Promise.reject(n.signal.reason);if(C==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const I={client:n.client,queryKey:n.queryKey,pageParam:C,direction:z?"backward":"forward",meta:n.options.meta};return v(I),I})(),j=await b(T),{maxPages:M}=n.options,D=z?$V:IV;return{pages:D(y.pages,j,M),pageParams:D(y.pageParams,C,M)}};if(s&&i.length){const y=s==="backward",C=y?WV:W9,z={pages:i,pageParams:a};o=await x(z,C(r,z),y)}else{const y=e??i.length;do{const C=c===0?a[0]??r.initialPageParam:W9(r,o);if(c>0&&C==null)break;o=await x(o,C),c++}while(c{var k,v;return(v=(k=n.options).persister)==null?void 0:v.call(k,u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t)}:n.fetchFn=u}}}function W9(e,{pages:n,pageParams:t}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,t[r],t):void 0}function WV(e,{pages:n,pageParams:t}){var r;return n.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,n[0],n,t[0],t):void 0}var Qd,D_,Xd,Fa,L_,vs,im,I_,co,Gc,aO,QV=(aO=class extends yO{constructor(n){super();lt(this,co);lt(this,Qd);lt(this,D_);lt(this,Xd);lt(this,Fa);lt(this,L_);lt(this,vs);lt(this,im);lt(this,I_);Ue(this,I_,!1),Ue(this,im,n.defaultOptions),this.setOptions(n.options),this.observers=[],Ue(this,L_,n.client),Ue(this,Fa,le(this,L_).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Ue(this,D_,X9(this.options)),this.state=n.state??le(this,D_),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return le(this,Qd)}get promise(){var n;return(n=le(this,vs))==null?void 0:n.promise}setOptions(n){if(this.options={...le(this,im),...n},n!=null&&n._type&&Ue(this,Qd,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=X9(this.options);t.data!==void 0&&(this.setState(Q9(t.data,t.dataUpdatedAt)),Ue(this,D_,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&le(this,Fa).remove(this)}setData(n,t){const r=D4(this.state.data,n,this.options);return Ht(this,co,Gc).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(n){Ht(this,co,Gc).call(this,{type:"setState",state:n})}cancel(n){var r,s;const t=(r=le(this,vs))==null?void 0:r.promise;return(s=le(this,vs))==null||s.cancel(n),t?t.then(Qs).catch(Qs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return le(this,D_)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>qr(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sk||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>qr(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!mO(this.state.dataUpdatedAt,n)}onFocus(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(t=le(this,vs))==null||t.continue()}onOnline(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(t=le(this,vs))==null||t.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),le(this,Fa).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const t=this.observers.indexOf(n);t!==-1&&(this.observers.splice(t,1),this.observers.length||(le(this,vs)&&(le(this,I_)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?le(this,vs).cancel({revert:!0}):le(this,vs).cancelRetry()),this.scheduleGc()),le(this,Fa).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ht(this,co,Gc).call(this,{type:"invalidate"})}async fetch(n,t){var u,h,_,p,m,w,k,v,b,x,y,C;if(this.state.fetchStatus!=="idle"&&((u=le(this,vs))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(le(this,vs))return le(this,vs).continueRetry(),le(this,vs).promise}if(n&&this.setOptions(n),!this.options.queryFn){const z=this.observers.find(E=>E.options.queryFn);z&&this.setOptions(z.options)}const r=new AbortController,s=z=>{Object.defineProperty(z,"signal",{enumerable:!0,get:()=>(Ue(this,I_,!0),r.signal)})},i=()=>{const z=gO(this.options,t),T=(()=>{const j={client:le(this,L_),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return Ue(this,I_,!1),this.options.persister?this.options.persister(z,T,this):z(T)},o=(()=>{const z={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:le(this,L_),state:this.state,fetchFn:i};return s(z),z})();(h=le(this,Qd)==="infinite"?KV(this.options.pages):this.options.behavior)==null||h.onFetch(o,this),Ue(this,Xd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((_=o.fetchOptions)==null?void 0:_.meta))&&Ht(this,co,Gc).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const c=Ue(this,vs,bO({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,onCancel:z=>{z instanceof hv&&z.revert&&this.setState({...le(this,Xd),fetchStatus:"idle"}),r.abort()},onFail:(z,E)=>{Ht(this,co,Gc).call(this,{type:"failed",failureCount:z,error:E})},onPause:()=>{Ht(this,co,Gc).call(this,{type:"pause"})},onContinue:()=>{Ht(this,co,Gc).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const z=await c.start();if(z===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(z),(w=(m=le(this,Fa).config).onSuccess)==null||w.call(m,z,this),(v=(k=le(this,Fa).config).onSettled)==null||v.call(k,z,this.state.error,this),z}catch(z){if(z instanceof hv){if(z.silent)return le(this,vs).promise;if(z.revert){if(this.state.data===void 0)throw z;return this.state.data}}throw Ht(this,co,Gc).call(this,{type:"error",error:z}),(x=(b=le(this,Fa).config).onError)==null||x.call(b,z,this),(C=(y=le(this,Fa).config).onSettled)==null||C.call(y,this.state.data,z,this),z}finally{le(this,vs)===c&&Ue(this,vs,void 0),this.scheduleGc()}}},Qd=new WeakMap,D_=new WeakMap,Xd=new WeakMap,Fa=new WeakMap,L_=new WeakMap,vs=new WeakMap,im=new WeakMap,I_=new WeakMap,co=new WeakSet,Gc=function(n){const t=r=>{switch(n.type){case"failed":return{...r,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...xO(r.data,this.options),fetchMeta:n.meta??null};case"success":const s={...r,...Q9(n.data,n.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ue(this,Xd,n.manual?s:void 0),s;case"error":const i=n.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...n.state}}};this.state=t(this.state),Dr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),le(this,Fa).notify({query:this,type:"updated",action:n})})},aO);function xO(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vO(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Q9(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function X9(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,r=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var li,Tn,am,ui,$_,Yd,Xc,om,Zd,Jd,B_,P_,bu,eh,Vn,n0,L4,I4,$4,B4,P4,F4,H4,q4,oO,zk=(oO=class extends vf{constructor(n,t){super();lt(this,Vn);lt(this,li);lt(this,Tn);lt(this,am);lt(this,ui);lt(this,$_);lt(this,Yd);lt(this,Xc);lt(this,om);lt(this,Zd);lt(this,Jd);lt(this,B_);lt(this,P_);lt(this,bu);lt(this,eh,new Set);this.options=t,Ue(this,li,n),Ue(this,Xc,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(le(this,Tn).addObserver(this),Y9(le(this,Tn),this.options)?Ht(this,Vn,n0).call(this):this.updateResult(),Ht(this,Vn,P4).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return U4(le(this,Tn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return U4(le(this,Tn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ht(this,Vn,F4).call(this),Ht(this,Vn,H4).call(this),le(this,Tn).removeObserver(this)}setOptions(n){const t=this.options,r=le(this,Tn);if(this.options=le(this,li).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qr(this.options.enabled,le(this,Tn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ht(this,Vn,q4).call(this),le(this,Tn).setOptions(this.options),t._defaulted&&!l0(this.options,t)&&le(this,li).getQueryCache().notify({type:"observerOptionsUpdated",query:le(this,Tn),observer:this});const s=this.hasListeners();s&&Z9(le(this,Tn),r,this.options,t)&&Ht(this,Vn,n0).call(this),this.updateResult(),s&&(le(this,Tn)!==r||qr(this.options.enabled,le(this,Tn))!==qr(t.enabled,le(this,Tn))||qr(this.options.staleTime,le(this,Tn))!==qr(t.staleTime,le(this,Tn)))&&Ht(this,Vn,I4).call(this);const i=Ht(this,Vn,$4).call(this);s&&(le(this,Tn)!==r||qr(this.options.enabled,le(this,Tn))!==qr(t.enabled,le(this,Tn))||i!==le(this,bu))&&Ht(this,Vn,B4).call(this,i)}getOptimisticResult(n){const t=le(this,li).getQueryCache().build(le(this,li),n),r=this.createResult(t,n);return l0(this.getCurrentResult(),r)||(Ue(this,ui,r),Ue(this,Yd,this.options),Ue(this,$_,le(this,Tn).state)),r}getCurrentResult(){return le(this,ui)}trackResult(n,t){return new Proxy(n,{get:(r,s)=>(this.trackProp(s),t==null||t(s),Reflect.get(r,s))})}trackProp(n){le(this,eh).add(n)}getCurrentQuery(){return le(this,Tn)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const t=le(this,li).defaultQueryOptions(n),r=le(this,li).getQueryCache().build(le(this,li),t);let s=()=>{},i;const a=new Promise(o=>{i=o,s=le(this,li).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),o(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const o=this.createResult(r,t);return i==null||i(o),o}).finally(()=>{s()}),a])}fetch(n){return Ht(this,Vn,n0).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),le(this,ui)))}createResult(n,t){var E;const r=le(this,Tn),s=this.options,i=le(this,ui),a=le(this,$_),o=le(this,Yd),c=n!==r?n.state:le(this,am),{state:u}=n;let h={...u},_=!1,p;if(t._optimisticResults){const T=this.hasListeners(),j=!T&&Y9(n,t),M=T&&Z9(n,r,t,s);(j||M)&&(h={...h,...xO(u.data,n.options)}),t._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:m,errorUpdatedAt:w,status:k}=h;p=h.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&k==="pending"){let T;i!=null&&i.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData)?(T=i.data,v=!0):T=typeof t.placeholderData=="function"?t.placeholderData((E=le(this,Jd))==null?void 0:E.state.data,le(this,Jd)):t.placeholderData,T!==void 0&&(k="success",p=D4(i==null?void 0:i.data,T,t),_=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&t.select===le(this,om))p=le(this,Zd);else try{Ue(this,om,t.select),p=t.select(p),p=D4(i==null?void 0:i.data,p,t),Ue(this,Zd,p),Ue(this,Xc,null)}catch(T){Ue(this,Xc,T)}else p===void 0&&Ue(this,Xc,null);le(this,Xc)&&(m=le(this,Xc),p=le(this,Zd),w=Date.now(),k="error",_=!1);const b=h.fetchStatus==="fetching",x=k==="pending",y=k==="error",C=x&&b,z=p!==void 0;return{status:k,fetchStatus:h.fetchStatus,isPending:x,isSuccess:k==="success",isError:y,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:h.dataUpdatedAt,error:m,errorUpdatedAt:w,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:y&&!z,isPaused:h.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:y&&z,isStale:jk(n,t),refetch:this.refetch,isEnabled:qr(t.enabled,n)!==!1}}updateResult(){const n=le(this,ui),t=this.createResult(le(this,Tn),this.options);if(Ue(this,$_,le(this,Tn).state),Ue(this,Yd,this.options),le(this,$_).data!==void 0&&Ue(this,Jd,le(this,Tn)),l0(t,n))return;Ue(this,ui,t);const s=(()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!le(this,eh).size)return!0;const o=new Set(a??le(this,eh));return this.options.throwOnError&&o.add("error"),Object.keys(le(this,ui)).some(c=>{const u=c;return le(this,ui)[u]!==n[u]&&o.has(u)})})();Dr.batch(()=>{s&&this.listeners.forEach(i=>{i(le(this,ui))}),le(this,li).getQueryCache().notify({query:le(this,Tn),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ht(this,Vn,P4).call(this)}},li=new WeakMap,Tn=new WeakMap,am=new WeakMap,ui=new WeakMap,$_=new WeakMap,Yd=new WeakMap,Xc=new WeakMap,om=new WeakMap,Zd=new WeakMap,Jd=new WeakMap,B_=new WeakMap,P_=new WeakMap,bu=new WeakMap,eh=new WeakMap,Vn=new WeakSet,n0=function(n){Ht(this,Vn,q4).call(this);let t=le(this,Tn).fetch(this.options,n);return n!=null&&n.throwOnError||(t=t.catch(Qs)),t},L4=function(n){return!Ek()&&qr(this.options.enabled,le(this,Tn))!==!1&&pO(n)},I4=function(){Ht(this,Vn,F4).call(this);const n=qr(this.options.staleTime,le(this,Tn));if(le(this,ui).isStale||!Ht(this,Vn,L4).call(this,n))return;const t=mO(le(this,ui).dataUpdatedAt,n)+1;Ue(this,B_,j_.setTimeout(()=>{le(this,ui).isStale||this.updateResult()},t))},$4=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(le(this,Tn)):this.options.refetchInterval)??!1},B4=function(n){Ht(this,Vn,H4).call(this),Ue(this,bu,n),!(le(this,bu)===0||!Ht(this,Vn,L4).call(this,le(this,bu)))&&Ue(this,P_,j_.setInterval(()=>{(this.options.refetchIntervalInBackground||Nk.isFocused())&&Ht(this,Vn,n0).call(this)},le(this,bu)))},P4=function(){Ht(this,Vn,I4).call(this),Ht(this,Vn,B4).call(this,Ht(this,Vn,$4).call(this))},F4=function(){le(this,B_)!==void 0&&(j_.clearTimeout(le(this,B_)),Ue(this,B_,void 0))},H4=function(){le(this,P_)!==void 0&&(j_.clearInterval(le(this,P_)),Ue(this,P_,void 0))},q4=function(){const n=le(this,li).getQueryCache().build(le(this,li),this.options);if(n===le(this,Tn))return;const t=le(this,Tn);Ue(this,Tn,n),Ue(this,am,n.state),this.hasListeners()&&(t==null||t.removeObserver(this),n.addObserver(this))},oO);function XV(e,n){return qr(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&qr(n.retryOnMount,e)===!1)}function Y9(e,n){return XV(e,n)||e.state.data!==void 0&&U4(e,n,n.refetchOnMount)}function U4(e,n,t){if(qr(n.enabled,e)!==!1&&qr(n.staleTime,e)!=="static"){const r=typeof t=="function"?t(e):t;return r==="always"||r!==!1&&jk(e,n)}return!1}function Z9(e,n,t,r){return(e!==n||qr(r.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&jk(e,t)}function jk(e,n){return qr(n.enabled,e)!==!1&&e.isStaleByTime(qr(n.staleTime,e))}var cm,qo,Vs,F_,Uo,_u,cO,YV=(cO=class extends yO{constructor(n){super();lt(this,Uo);lt(this,cm);lt(this,qo);lt(this,Vs);lt(this,F_);Ue(this,cm,n.client),this.mutationId=n.mutationId,Ue(this,Vs,n.mutationCache),Ue(this,qo,[]),this.state=n.state||wO(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){le(this,qo).includes(n)||(le(this,qo).push(n),this.clearGcTimeout(),le(this,Vs).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Ue(this,qo,le(this,qo).filter(t=>t!==n)),this.scheduleGc(),le(this,Vs).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){le(this,qo).length||(this.state.status==="pending"?this.scheduleGc():le(this,Vs).remove(this))}continue(){var n;return((n=le(this,F_))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var o,c,u,h,_,p,m,w,k,v,b,x,y,C,z,E,T,j;const t=()=>{Ht(this,Uo,_u).call(this,{type:"continue"})},r={client:le(this,cm),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Ue(this,F_,bO({fn:()=>this.options.mutationFn?this.options.mutationFn(n,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,D)=>{Ht(this,Uo,_u).call(this,{type:"failed",failureCount:M,error:D})},onPause:()=>{Ht(this,Uo,_u).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>le(this,Vs).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)t();else{Ht(this,Uo,_u).call(this,{type:"pending",variables:n,isPaused:a}),le(this,Vs).config.onMutate&&await le(this,Vs).config.onMutate(n,this,r);const D=await((c=(o=this.options).onMutate)==null?void 0:c.call(o,n,r));D!==this.state.context&&Ht(this,Uo,_u).call(this,{type:"pending",context:D,variables:n,isPaused:a})}const M=await s.start();return await((h=(u=le(this,Vs).config).onSuccess)==null?void 0:h.call(u,M,n,this.state.context,this,r)),await((p=(_=this.options).onSuccess)==null?void 0:p.call(_,M,n,this.state.context,r)),await((w=(m=le(this,Vs).config).onSettled)==null?void 0:w.call(m,M,null,this.state.variables,this.state.context,this,r)),await((v=(k=this.options).onSettled)==null?void 0:v.call(k,M,null,n,this.state.context,r)),Ht(this,Uo,_u).call(this,{type:"success",data:M}),M}catch(M){try{await((x=(b=le(this,Vs).config).onError)==null?void 0:x.call(b,M,n,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((C=(y=this.options).onError)==null?void 0:C.call(y,M,n,this.state.context,r))}catch(D){Promise.reject(D)}try{await((E=(z=le(this,Vs).config).onSettled)==null?void 0:E.call(z,void 0,M,this.state.variables,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,M,n,this.state.context,r))}catch(D){Promise.reject(D)}throw Ht(this,Uo,_u).call(this,{type:"error",error:M}),M}finally{le(this,F_)===s&&Ue(this,F_,void 0),le(this,Vs).runNext(this)}}},cm=new WeakMap,qo=new WeakMap,Vs=new WeakMap,F_=new WeakMap,Uo=new WeakSet,_u=function(n){const t=r=>{switch(n.type){case"failed":return{...r,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...r,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:n.error,failureCount:r.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Dr.batch(()=>{le(this,qo).forEach(r=>{r.onMutationUpdate(n)}),le(this,Vs).notify({mutation:this,type:"updated",action:n})})},cO);function wO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yc,lo,lm,lO,ZV=(lO=class extends vf{constructor(n={}){super();lt(this,Yc);lt(this,lo);lt(this,lm);this.config=n,Ue(this,Yc,new Set),Ue(this,lo,new Map),Ue(this,lm,0)}build(n,t,r){const s=new YV({client:n,mutationCache:this,mutationId:++Dp(this,lm)._,options:n.defaultMutationOptions(t),state:r});return this.add(s),s}add(n){le(this,Yc).add(n);const t=Ug(n);if(typeof t=="string"){const r=le(this,lo).get(t);r?r.push(n):le(this,lo).set(t,[n])}this.notify({type:"added",mutation:n})}remove(n){if(le(this,Yc).delete(n)){const t=Ug(n);if(typeof t=="string"){const r=le(this,lo).get(t);if(r)if(r.length>1){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}else r[0]===n&&le(this,lo).delete(t)}}this.notify({type:"removed",mutation:n})}canRun(n){var r;const t=Ug(n);if(typeof t=="string"){const s=(r=le(this,lo).get(t))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===n}else return!0}runNext(n){var r,s;const t=Ug(n);return typeof t=="string"?((s=(r=le(this,lo).get(t))==null?void 0:r.find(i=>i!==n&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Dr.batch(()=>{le(this,Yc).forEach(n=>{this.notify({type:"removed",mutation:n})}),le(this,Yc).clear(),le(this,lo).clear()})}getAll(){return Array.from(le(this,Yc))}find(n){const t={exact:!0,...n};return this.getAll().find(r=>G9(t,r))}findAll(n={}){return this.getAll().filter(t=>G9(n,t))}notify(n){Dr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}resumePausedMutations(){const n=this.getAll().filter(t=>t.state.isPaused);return Dr.batch(()=>Promise.all(n.map(t=>t.continue().catch(Qs))))}},Yc=new WeakMap,lo=new WeakMap,lm=new WeakMap,lO);function Ug(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Zc,yu,Ks,Jc,Xo,r0,G4,uO,JV=(uO=class extends vf{constructor(t,r){super();lt(this,Xo);lt(this,Zc);lt(this,yu);lt(this,Ks);lt(this,Jc);Ue(this,Zc,t),this.setOptions(r),this.bindMethods(),Ht(this,Xo,r0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const r=this.options;this.options=le(this,Zc).defaultMutationOptions(t),l0(this.options,r)||le(this,Zc).getMutationCache().notify({type:"observerOptionsUpdated",mutation:le(this,Ks),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ef(r.mutationKey)!==ef(this.options.mutationKey)?this.reset():((s=le(this,Ks))==null?void 0:s.state.status)==="pending"&&le(this,Ks).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&le(this,Ks)&&(le(this,Ks).addObserver(this),Ht(this,Xo,r0).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=le(this,Ks))==null||t.removeObserver(this)}onMutationUpdate(t){Ht(this,Xo,r0).call(this),Ht(this,Xo,G4).call(this,t)}getCurrentResult(){return le(this,yu)}reset(){var t;(t=le(this,Ks))==null||t.removeObserver(this),Ue(this,Ks,void 0),Ht(this,Xo,r0).call(this),Ht(this,Xo,G4).call(this)}mutate(t,r){var s;return Ue(this,Jc,r),(s=le(this,Ks))==null||s.removeObserver(this),Ue(this,Ks,le(this,Zc).getMutationCache().build(le(this,Zc),this.options)),le(this,Ks).addObserver(this),le(this,Ks).execute(t)}},Zc=new WeakMap,yu=new WeakMap,Ks=new WeakMap,Jc=new WeakMap,Xo=new WeakSet,r0=function(){var r;const t=((r=le(this,Ks))==null?void 0:r.state)??wO();Ue(this,yu,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},G4=function(t){Dr.batch(()=>{var r,s,i,a,o,c,u,h;if(le(this,Jc)&&this.hasListeners()){const _=le(this,yu).variables,p=le(this,yu).context,m={client:le(this,Zc),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(r=le(this,Jc)).onSuccess)==null||s.call(r,t.data,_,p,m)}catch(w){Promise.reject(w)}try{(a=(i=le(this,Jc)).onSettled)==null||a.call(i,t.data,null,_,p,m)}catch(w){Promise.reject(w)}}else if((t==null?void 0:t.type)==="error"){try{(c=(o=le(this,Jc)).onError)==null||c.call(o,t.error,_,p,m)}catch(w){Promise.reject(w)}try{(h=(u=le(this,Jc)).onSettled)==null||h.call(u,void 0,t.error,_,p,m)}catch(w){Promise.reject(w)}}}this.listeners.forEach(_=>{_(le(this,yu))})})},uO);function J9(e,n){const t=new Set(n);return e.filter(r=>!t.has(r))}var th,_i,nh,H_,sa,q_,um,_m,fm,dm,ws,V4,K4,kO,W4,Q4,X4,_O,eK=(_O=class extends vf{constructor(n,t,r){super();lt(this,ws);lt(this,th);lt(this,_i);lt(this,nh);lt(this,H_);lt(this,sa);lt(this,q_);lt(this,um);lt(this,_m);lt(this,fm);lt(this,dm,[]);Ue(this,th,n),Ue(this,H_,r),Ue(this,nh,[]),Ue(this,sa,[]),Ue(this,_i,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&le(this,sa).forEach(n=>{n.subscribe(t=>{Ht(this,ws,Q4).call(this,n,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,le(this,sa).forEach(n=>{n.destroy()})}setQueries(n,t){Ue(this,nh,n),Ue(this,H_,t),Dr.batch(()=>{const r=le(this,sa),s=Ht(this,ws,W4).call(this,le(this,nh));s.forEach(_=>_.observer.setOptions(_.defaultedQueryOptions));const i=s.map(_=>_.observer),a=i.map(_=>_.getCurrentResult()),o=r.length!==i.length,c=i.some((_,p)=>_!==r[p]),u=o||c,h=u?!0:a.some((_,p)=>{const m=le(this,_i)[p];return!m||!l0(_,m)});!u&&!h||(u&&(Ue(this,dm,s),Ue(this,sa,i)),Ue(this,_i,a),this.hasListeners()&&(u&&(J9(r,i).forEach(_=>{_.destroy()}),J9(i,r).forEach(_=>{_.subscribe(p=>{Ht(this,ws,Q4).call(this,_,p)})})),Ht(this,ws,X4).call(this)))})}getCurrentResult(){return le(this,_i)}getQueries(){return le(this,sa).map(n=>n.getCurrentQuery())}getObservers(){return le(this,sa)}getOptimisticResult(n,t){const r=Ht(this,ws,W4).call(this,n),s=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=r.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>Ht(this,ws,K4).call(this,a??s,t,i),()=>Ht(this,ws,V4).call(this,s,r)]}},th=new WeakMap,_i=new WeakMap,nh=new WeakMap,H_=new WeakMap,sa=new WeakMap,q_=new WeakMap,um=new WeakMap,_m=new WeakMap,fm=new WeakMap,dm=new WeakMap,ws=new WeakSet,V4=function(n,t){const r=new Set;return t.map((s,i)=>{const a=n[i];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{r.has(o)||(r.add(o),t.forEach(c=>{c.observer.trackProp(o)}))})})},K4=function(n,t,r){if(t){const s=le(this,fm),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((a,o)=>a!==s[o]));return(le(this,_i)!==le(this,_m)||i||t!==le(this,um))&&(Ue(this,um,t),Ue(this,_m,le(this,_i)),r!==void 0&&Ue(this,fm,r),Ue(this,q_,kk(le(this,q_),t(n)))),le(this,q_)}return n},kO=function(){var n;return!((n=le(this,H_))!=null&&n.combine)||le(this,sa).some((t,r)=>{var s;return t.options.suspense&&((s=le(this,_i)[r])==null?void 0:s.data)===void 0})},W4=function(n){const t=new Map;le(this,sa).forEach(s=>{const i=s.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(s):t.set(i,[s])});const r=[];return n.forEach(s=>{var o;const i=le(this,th).defaultQueryOptions(s),a=((o=t.get(i.queryHash))==null?void 0:o.shift())??new zk(le(this,th),i);r.push({defaultedQueryOptions:i,observer:a})}),r},Q4=function(n,t){const r=le(this,sa).indexOf(n);r!==-1&&(Ue(this,_i,le(this,_i).slice()),le(this,_i)[r]=t,Ht(this,ws,X4).call(this))},X4=function(){var n;if(this.hasListeners()){const t=Ht(this,ws,kO).call(this),r=le(this,q_),s=t?r:Ht(this,ws,K4).call(this,Ht(this,ws,V4).call(this,le(this,_i),le(this,dm)),(n=le(this,H_))==null?void 0:n.combine);(t||r!==s)&&Dr.batch(()=>{this.listeners.forEach(i=>{i(le(this,_i))})})}},_O),Go,fO,tK=(fO=class extends vf{constructor(n={}){super();lt(this,Go);this.config=n,Ue(this,Go,new Map)}build(n,t,r){const s=t.queryKey,i=t.queryHash??wk(s,t);let a=this.get(i);return a||(a=new QV({client:n,queryKey:s,queryHash:i,options:n.defaultQueryOptions(t),state:r,defaultOptions:n.getQueryDefaults(s)}),this.add(a)),a}add(n){le(this,Go).has(n.queryHash)||(le(this,Go).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const t=le(this,Go).get(n.queryHash);t&&(n.destroy(),t===n&&le(this,Go).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Dr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return le(this,Go).get(n)}getAll(){return[...le(this,Go).values()]}find(n){const t={exact:!0,...n};return this.getAll().find(r=>U9(t,r))}findAll(n={}){const t=this.getAll();return Object.keys(n).length>0?t.filter(r=>U9(n,r)):t}notify(n){Dr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}onFocus(){Dr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Dr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Go=new WeakMap,fO),Mr,xu,wu,rh,sh,ku,ih,ah,dO,nK=(dO=class{constructor(e={}){lt(this,Mr);lt(this,xu);lt(this,wu);lt(this,rh);lt(this,sh);lt(this,ku);lt(this,ih);lt(this,ah);Ue(this,Mr,e.queryCache||new tK),Ue(this,xu,e.mutationCache||new ZV),Ue(this,wu,e.defaultOptions||{}),Ue(this,rh,new Map),Ue(this,sh,new Map),Ue(this,ku,0)}mount(){Dp(this,ku)._++,le(this,ku)===1&&(Ue(this,ih,Nk.subscribe(async e=>{e&&(await this.resumePausedMutations(),le(this,Mr).onFocus())})),Ue(this,ah,dv.subscribe(async e=>{e&&(await this.resumePausedMutations(),le(this,Mr).onOnline())})))}unmount(){var e,n;Dp(this,ku)._--,le(this,ku)===0&&((e=le(this,ih))==null||e.call(this),Ue(this,ih,void 0),(n=le(this,ah))==null||n.call(this),Ue(this,ah,void 0))}isFetching(e){return le(this,Mr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return le(this,xu).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=le(this,Mr).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=le(this,Mr).build(this,n),r=t.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime(qr(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return le(this,Mr).findAll(e).map(({queryKey:n,state:t})=>[n,t.data])}setQueryData(e,n,t){var a;const r=this.defaultQueryOptions({queryKey:e}),s=(a=le(this,Mr).get(r.queryHash))==null?void 0:a.state.data,i=OV(n,s);if(i!==void 0)return le(this,Mr).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Dr.batch(()=>le(this,Mr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,t)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=le(this,Mr).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const n=le(this,Mr);Dr.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=le(this,Mr);return Dr.batch(()=>{const r=t.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},n)})}cancelQueries(e,n={}){const t={revert:!0,...n},r=Dr.batch(()=>le(this,Mr).findAll(e).map(s=>s.cancel(t)));return Promise.all(r).then(Qs).catch(Qs)}invalidateQueries(e,n={}){return Dr.batch(()=>(le(this,Mr).findAll(e).forEach(t=>{t.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},r=Dr.batch(()=>le(this,Mr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Qs)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Qs)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=le(this,Mr).build(this,n),r=t.isStaleByTime(qr(n.staleTime,t))?await t.fetch(n):t.state.data,s=n.select;return s?s(r):r}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=le(this,Mr).build(this,n);return t.isStaleByTime(qr(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Qs).catch(Qs)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Qs).catch(Qs)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return dv.isOnline()?le(this,xu).resumePausedMutations():Promise.resolve()}getQueryCache(){return le(this,Mr)}getMutationCache(){return le(this,xu)}getDefaultOptions(){return le(this,wu)}setDefaultOptions(e){Ue(this,wu,e)}setQueryDefaults(e,n){le(this,rh).set(ef(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...le(this,rh).values()],t={};return n.forEach(r=>{uh(e,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(e,n){le(this,sh).set(ef(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...le(this,sh).values()],t={};return n.forEach(r=>{uh(e,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...le(this,wu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=wk(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Sk&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...le(this,wu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){le(this,Mr).clear(),le(this,xu).clear()}},Mr=new WeakMap,xu=new WeakMap,wu=new WeakMap,rh=new WeakMap,sh=new WeakMap,ku=new WeakMap,ih=new WeakMap,ah=new WeakMap,dO);const SO=A.createContext(!1),CO=()=>A.useContext(SO);SO.Provider;function rK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const sK=A.createContext(rK()),EO=()=>A.useContext(sK),NO=(e,n,t)=>{const r=t!=null&&t.state.error&&typeof e.throwOnError=="function"?Ck(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||r)&&(n.isReset()||(e.retryOnMount=!1))},zO=e=>{A.useEffect(()=>{e.clearReset()},[e])},jO=({result:e,errorResetBoundary:n,throwOnError:t,query:r,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Ck(t,[e.error,r])),TO=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>t(r(...s)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Y4=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,AO=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function iK({queries:e,...n},t){const r=xm(),s=CO(),i=EO(),a=n.subscribed!==!1,o=A.useMemo(()=>e.map(k=>{const v=r.defaultQueryOptions(k);return v._optimisticResults=s?"isRestoring":a?"optimistic":void 0,v}),[e,r,s,a]);o.forEach(k=>{TO(k);const v=r.getQueryCache().get(k.queryHash);NO(k,i,v)}),zO(i);const[c]=A.useState(()=>new eK(r,o,n)),[u,h,_]=c.getOptimisticResult(o,n.combine),p=!s&&a;A.useSyncExternalStore(A.useCallback(k=>p?c.subscribe(Dr.batchCalls(k)):Qs,[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),A.useEffect(()=>{c.setQueries(o,n)},[o,n,c]);const m=u.some((k,v)=>Y4(o[v],k))?u.flatMap((k,v)=>{const b=o[v];if(b&&Y4(b,k)){const x=new zk(r,b);return AO(b,x,i)}return[]}):[];if(m.length>0)throw Promise.all(m);const w=u.find((k,v)=>{const b=o[v];return b&&jO({result:k,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(w)throw w.error;return h(_())}function aK(e,n,t){const r=CO(),s=EO(),i=xm(),a=i.defaultQueryOptions(e),o=i.getQueryCache().get(a.queryHash),c=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,TO(a),NO(a,s,o),zO(s);const[u]=A.useState(()=>new n(i,a)),h=u.getOptimisticResult(a),_=!r&&c;if(A.useSyncExternalStore(A.useCallback(p=>{const m=_?u.subscribe(Dr.batchCalls(p)):Qs;return u.updateResult(),m},[u,_]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),A.useEffect(()=>{u.setOptions(a)},[a,u]),Y4(a,h))throw AO(a,u,s);if(jO({result:h,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw h.error;return a.notifyOnChangeProps?h:u.trackResult(h)}function ut(e,n){return aK(e,zk)}function oK(e,n){const t=xm(),r=t.getQueryCache();return A.useSyncExternalStore(A.useCallback(s=>r.subscribe(Dr.batchCalls(s)),[r]),()=>t.isFetching(e),()=>t.isFetching(e))}function dn(e,n){const t=xm(),[r]=A.useState(()=>new JV(t,e));A.useEffect(()=>{r.setOptions(e)},[r,e]);const s=A.useSyncExternalStore(A.useCallback(a=>r.subscribe(Dr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=A.useCallback((...a)=>{r.mutate(a[0],a[1]).catch(Qs)},[r]);if(s.error&&Ck(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const Je=new nK({defaultOptions:{queries:{staleTime:3e4,gcTime:6e5,retry:!1,networkMode:"always",refetchOnReconnect:!0},mutations:{retry:!1,networkMode:"always"}}}),_l=new Set;let eE=null,wb=0;const Z4=new Set,cK=()=>wb,tE=e=>(Z4.add(e),()=>{Z4.delete(e)}),Va=()=>["workspace",wb],Tt=(e,...n)=>[...Va(),e,...n];function lK(e,n=!1){if(eE===e&&!n)return!1;const t=Va();return eE=e,wb++,_l.clear(),Tk({queryKey:t}),Z4.forEach(r=>r()),!0}const Fn=e=>e[1]===wb;async function Tk(e){await Je.cancelQueries(e,{revert:!1}),Je.removeQueries(e)}function Yr(e,n){if(Fn(e))return Je.setQueryData(e,n)}var I2={exports:{}},Ip={},$2={exports:{}},B2={};/** * @license React * scheduler.production.js * @@ -23,7 +23,7 @@ var yV=Object.defineProperty;var $9=e=>{throw TypeError(e)};var xV=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var tE;function aK(){return tE||(tE=1,(function(e){function n(V,J){var Z=V.length;V.push(J);e:for(;0>>1,L=V[B];if(0>>1;Bs(K,Z))nes(ce,K)?(V[B]=ce,V[ne]=Z,B=ne):(V[B]=K,V[U]=Z,B=U);else if(nes(ce,Z))V[B]=ce,V[ne]=Z,B=ne;else break e}}return J}function s(V,J){var Z=V.sortIndex-J.sortIndex;return Z!==0?Z:V.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var c=[],u=[],h=1,_=null,p=3,m=!1,x=!1,k=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(V){for(var J=t(u);J!==null;){if(J.callback===null)r(u);else if(J.startTime<=V)r(u),J.sortIndex=J.expirationTime,n(c,J);else break;J=t(u)}}function N(V){if(k=!1,C(V),!x)if(t(c)!==null)x=!0,z||(z=!0,$());else{var J=t(u);J!==null&&Q(N,J.startTime-V)}}var z=!1,T=-1,j=5,M=-1;function D(){return v?!0:!(e.unstable_now()-MV&&D());){var B=_.callback;if(typeof B=="function"){_.callback=null,p=_.priorityLevel;var L=B(_.expirationTime<=V);if(V=e.unstable_now(),typeof L=="function"){_.callback=L,C(V),J=!0;break t}_===t(c)&&r(c),C(V)}else r(c);_=t(c)}if(_!==null)J=!0;else{var F=t(u);F!==null&&Q(N,F.startTime-V),J=!1}}break e}finally{_=null,p=Z,m=!1}J=void 0}}finally{J?$():z=!1}}}var $;if(typeof y=="function")$=function(){y(I)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,H=q.port2;q.port1.onmessage=I,$=function(){H.postMessage(null)}}else $=function(){b(I,0)};function Q(V,J){T=b(function(){V(e.unstable_now())},J)}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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125B?(V.sortIndex=Z,n(u,V),t(c)===null&&V===t(u)&&(k?(w(T),T=-1):k=!0,Q(N,Z-B))):(V.sortIndex=L,n(c,V),x||m||(x=!0,z||(z=!0,$()))),V},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(V){var J=p;return function(){var Z=p;p=J;try{return V.apply(this,arguments)}finally{p=Z}}}})(I2)),I2}var nE;function oK(){return nE||(nE=1,L2.exports=aK()),L2.exports}var $2={exports:{}},qs={};/** + */var nE;function uK(){return nE||(nE=1,(function(e){function n(V,Z){var Y=V.length;V.push(Z);e:for(;0>>1,L=V[B];if(0>>1;Bs(K,Y))nes(oe,K)?(V[B]=oe,V[ne]=Y,B=ne):(V[B]=K,V[U]=Y,B=U);else if(nes(oe,Y))V[B]=oe,V[ne]=Y,B=ne;else break e}}return Z}function s(V,Z){var Y=V.sortIndex-Z.sortIndex;return Y!==0?Y:V.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var c=[],u=[],h=1,_=null,p=3,m=!1,w=!1,k=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(V){for(var Z=t(u);Z!==null;){if(Z.callback===null)r(u);else if(Z.startTime<=V)r(u),Z.sortIndex=Z.expirationTime,n(c,Z);else break;Z=t(u)}}function z(V){if(k=!1,C(V),!w)if(t(c)!==null)w=!0,E||(E=!0,$());else{var Z=t(u);Z!==null&&Q(z,Z.startTime-V)}}var E=!1,T=-1,j=5,M=-1;function D(){return v?!0:!(e.unstable_now()-MV&&D());){var B=_.callback;if(typeof B=="function"){_.callback=null,p=_.priorityLevel;var L=B(_.expirationTime<=V);if(V=e.unstable_now(),typeof L=="function"){_.callback=L,C(V),Z=!0;break t}_===t(c)&&r(c),C(V)}else r(c);_=t(c)}if(_!==null)Z=!0;else{var F=t(u);F!==null&&Q(z,F.startTime-V),Z=!1}}break e}finally{_=null,p=Y,m=!1}Z=void 0}}finally{Z?$():E=!1}}}var $;if(typeof y=="function")$=function(){y(I)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,H=q.port2;q.port1.onmessage=I,$=function(){H.postMessage(null)}}else $=function(){b(I,0)};function Q(V,Z){T=b(function(){V(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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125B?(V.sortIndex=Y,n(u,V),t(c)===null&&V===t(u)&&(k?(x(T),T=-1):k=!0,Q(z,Y-B))):(V.sortIndex=L,n(c,V),w||m||(w=!0,E||(E=!0,$()))),V},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(V){var Z=p;return function(){var Y=p;p=Z;try{return V.apply(this,arguments)}finally{p=Y}}}})(B2)),B2}var rE;function _K(){return rE||(rE=1,$2.exports=uK()),$2.exports}var P2={exports:{}},Gs={};/** * @license React * react-dom.production.js * @@ -31,7 +31,7 @@ var yV=Object.defineProperty;var $9=e=>{throw TypeError(e)};var xV=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var rE;function cK(){if(rE)return qs;rE=1;var e=bm();function n(c){var u="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),$2.exports=cK(),$2.exports}/** + */var sE;function fK(){if(sE)return Gs;sE=1;var e=ym();function n(c){var u="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),P2.exports=fK(),P2.exports}/** * @license React * react-dom-client.production.js * @@ -39,15 +39,15 @@ var yV=Object.defineProperty;var $9=e=>{throw TypeError(e)};var xV=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var iE;function lK(){if(iE)return Lp;iE=1;var e=oK(),n=bm(),t=TO();function r(l){var d="https://react.dev/errors/"+l;if(1L||(l.current=B[L],B[L]=null,L--)}function K(l,d){L++,B[L]=l.current,l.current=d}var ne=F(null),ce=F(null),_e=F(null),se=F(null);function G(l,d){switch(K(_e,d),K(ce,l),K(ne,null),d.nodeType){case 9:case 11:l=(l=d.documentElement)&&(l=l.namespaceURI)?o9(l):0;break;default:if(l=d.tagName,d=d.namespaceURI)d=o9(d),l=c9(d,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}U(ne),K(ne,l)}function oe(){U(ne),U(ce),U(_e)}function le(l){l.memoizedState!==null&&K(se,l);var d=ne.current,g=c9(d,l.type);d!==g&&(K(ce,l),K(ne,g))}function pe(l){ce.current===l&&(U(ne),U(ce)),se.current===l&&(U(se),Tp._currentValue=Z)}var be,Me;function Le(l){if(be===void 0)try{throw Error()}catch(g){var d=g.stack.trim().match(/\n( *(at )?)/);be=d&&d[1]||"",Me=-1L||(l.current=B[L],B[L]=null,L--)}function K(l,d){L++,B[L]=l.current,l.current=d}var ne=F(null),oe=F(null),ue=F(null),se=F(null);function G(l,d){switch(K(ue,d),K(oe,l),K(ne,null),d.nodeType){case 9:case 11:l=(l=d.documentElement)&&(l=l.namespaceURI)?c9(l):0;break;default:if(l=d.tagName,d=d.namespaceURI)d=c9(d),l=l9(d,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}U(ne),K(ne,l)}function ae(){U(ne),U(oe),U(ue)}function ce(l){l.memoizedState!==null&&K(se,l);var d=ne.current,g=l9(d,l.type);d!==g&&(K(oe,l),K(ne,g))}function pe(l){oe.current===l&&(U(ne),U(oe)),se.current===l&&(U(se),Ap._currentValue=Y)}var be,Ae;function De(l){if(be===void 0)try{throw Error()}catch(g){var d=g.stack.trim().match(/\n( *(at )?)/);be=d&&d[1]||"",Ae=-1)":-1R||he[S]!==Ee[R]){var $e=` -`+he[S].replace(" at new "," at ");return l.displayName&&$e.includes("")&&($e=$e.replace("",l.displayName)),$e}while(1<=S&&0<=R);break}}}finally{Ke=!1,Error.prepareStackTrace=g}return(g=l?l.displayName||l.name:"")?Le(g):""}function we(l,d){switch(l.tag){case 26:case 27:case 5:return Le(l.type);case 16:return Le("Lazy");case 13:return l.child!==d&&d!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return je(l.type,!1);case 11:return je(l.type.render,!1);case 1:return je(l.type,!0);case 31:return Le("Activity");default:return""}}function rt(l){try{var d="",g=null;do d+=we(l,g),g=l,l=l.return;while(l);return d}catch(S){return` +`+be+l+Ae}var We=!1;function Ne(l,d){if(!l||We)return"";We=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var S={DetermineComponentFrameRoot:function(){try{if(d){var qe=function(){throw Error()};if(Object.defineProperty(qe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(qe,[])}catch(Re){var ze=Re}Reflect.construct(l,[],qe)}else{try{qe.call()}catch(Re){ze=Re}l.call(qe.prototype)}}else{try{throw Error()}catch(Re){ze=Re}(qe=l())&&typeof qe.catch=="function"&&qe.catch(function(){})}}catch(Re){if(Re&&ze&&typeof Re.stack=="string")return[Re.stack,ze.stack]}return[null,null]}};S.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var R=Object.getOwnPropertyDescriptor(S.DetermineComponentFrameRoot,"name");R&&R.configurable&&Object.defineProperty(S.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=S.DetermineComponentFrameRoot(),X=O[0],re=O[1];if(X&&re){var de=X.split(` +`),Se=re.split(` +`);for(R=S=0;SR||de[S]!==Se[R]){var $e=` +`+de[S].replace(" at new "," at ");return l.displayName&&$e.includes("")&&($e=$e.replace("",l.displayName)),$e}while(1<=S&&0<=R);break}}}finally{We=!1,Error.prepareStackTrace=g}return(g=l?l.displayName||l.name:"")?De(g):""}function xe(l,d){switch(l.tag){case 26:case 27:case 5:return De(l.type);case 16:return De("Lazy");case 13:return l.child!==d&&d!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return Ne(l.type,!1);case 11:return Ne(l.type.render,!1);case 1:return Ne(l.type,!0);case 31:return De("Activity");default:return""}}function rt(l){try{var d="",g=null;do d+=xe(l,g),g=l,l=l.return;while(l);return d}catch(S){return` Error generating stack: `+S.message+` -`+S.stack}}var Ze=Object.prototype.hasOwnProperty,at=e.unstable_scheduleCallback,St=e.unstable_cancelCallback,Ft=e.unstable_shouldYield,ut=e.unstable_requestPaint,dt=e.unstable_now,Ie=e.unstable_getCurrentPriorityLevel,me=e.unstable_ImmediatePriority,Ae=e.unstable_UserBlockingPriority,Pe=e.unstable_NormalPriority,nt=e.unstable_LowPriority,_t=e.unstable_IdlePriority,pt=e.log,yt=e.unstable_setDisableYieldValue,Zt=null,nn=null;function jt(l){if(typeof pt=="function"&&yt(l),nn&&typeof nn.setStrictMode=="function")try{nn.setStrictMode(Zt,l)}catch{}}var mt=Math.clz32?Math.clz32:An,ft=Math.log,en=Math.LN2;function An(l){return l>>>=0,l===0?32:31-(ft(l)/en|0)|0}var xr=256,kn=262144,Ln=4194304;function Un(l){var d=l&42;if(d!==0)return d;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function dr(l,d,g){var S=l.pendingLanes;if(S===0)return 0;var R=0,O=l.suspendedLanes,Y=l.pingedLanes;l=l.warmLanes;var re=S&134217727;return re!==0?(S=re&~O,S!==0?R=Un(S):(Y&=re,Y!==0?R=Un(Y):g||(g=re&~l,g!==0&&(R=Un(g))))):(re=S&~O,re!==0?R=Un(re):Y!==0?R=Un(Y):g||(g=S&~l,g!==0&&(R=Un(g)))),R===0?0:d!==0&&d!==R&&(d&O)===0&&(O=R&-R,g=d&-d,O>=g||O===32&&(g&4194048)!==0)?d:R}function es(l,d){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&d)===0}function Ct(l,d){switch(l){case 1:case 2:case 4:case 8:case 64:return d+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 d+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 on(){var l=Ln;return Ln<<=1,(Ln&62914560)===0&&(Ln=4194304),l}function cn(l){for(var d=[],g=0;31>g;g++)d.push(l);return d}function fn(l,d){l.pendingLanes|=d,d!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function wr(l,d,g,S,R,O){var Y=l.pendingLanes;l.pendingLanes=g,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=g,l.entangledLanes&=g,l.errorRecoveryDisabledLanes&=g,l.shellSuspendCounter=0;var re=l.entanglements,he=l.expirationTimes,Ee=l.hiddenUpdates;for(g=Y&~g;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var Wn=/[\n"\\]/g;function mr(l){return l.replace(Wn,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function Is(l,d,g,S,R,O,Y,re){l.name="",Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?l.type=Y:l.removeAttribute("type"),d!=null?Y==="number"?(d===0&&l.value===""||l.value!=d)&&(l.value=""+Wr(d)):l.value!==""+Wr(d)&&(l.value=""+Wr(d)):Y!=="submit"&&Y!=="reset"||l.removeAttribute("value"),d!=null?Lr(l,Y,Wr(d)):g!=null?Lr(l,Y,Wr(g)):S!=null&&l.removeAttribute("value"),R==null&&O!=null&&(l.defaultChecked=!!O),R!=null&&(l.checked=R&&typeof R!="function"&&typeof R!="symbol"),re!=null&&typeof re!="function"&&typeof re!="symbol"&&typeof re!="boolean"?l.name=""+Wr(re):l.removeAttribute("name")}function $s(l,d,g,S,R,O,Y,re){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(l.type=O),d!=null||g!=null){if(!(O!=="submit"&&O!=="reset"||d!=null)){Es(l);return}g=g!=null?""+Wr(g):"",d=d!=null?""+Wr(d):g,re||d===l.value||(l.value=d),l.defaultValue=d}S=S??R,S=typeof S!="function"&&typeof S!="symbol"&&!!S,l.checked=re?l.checked:!!S,l.defaultChecked=!!S,Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"&&(l.name=Y),Es(l)}function Lr(l,d,g){d==="number"&&mi(l.ownerDocument)===l||l.defaultValue===""+g||(l.defaultValue=""+g)}function gi(l,d,g,S){if(l=l.options,d){d={};for(var R=0;R"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uc=!1;if(ds)try{var da={};Object.defineProperty(da,"passive",{get:function(){uc=!0}}),window.addEventListener("test",da,da),window.removeEventListener("test",da,da)}catch{uc=!1}var fr=null,_c=null,ir=null;function Ef(){if(ir)return ir;var l,d=_c,g=d.length,S,R="value"in fr?fr.value:fr.textContent,O=R.length;for(l=0;l=ma),Eo=" ",Df=!1;function Lf(l,d){switch(l){case"keyup":return Of.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function As(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var mn=!1;function Hu(l,d){switch(l){case"compositionend":return As(d);case"keypress":return d.which!==32?null:(Df=!0,Eo);case"textInput":return l=d.data,l===Eo&&Df?null:l;default:return null}}function qu(l,d){if(mn)return l==="compositionend"||!Co&&Lf(l,d)?(l=Ef(),ir=_c=fr=null,mn=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1=d)return{node:g,offset:d-l};l=S}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=ve(g)}}function X(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?X(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function ae(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var d=mi(l.document);d instanceof l.HTMLIFrameElement;){try{var g=typeof d.contentWindow.location.href=="string"}catch{g=!1}if(g)l=d.contentWindow;else break;d=mi(l.document)}return d}function xe(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}var Re=ds&&"documentMode"in document&&11>=document.documentMode,Se=null,He=null,We=null,Lt=!1;function Qn(l,d,g){var S=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;Lt||Se==null||Se!==mi(S)||(S=Se,"selectionStart"in S&&xe(S)?S={start:S.selectionStart,end:S.selectionEnd}:(S=(S.ownerDocument&&S.ownerDocument.defaultView||window).getSelection(),S={anchorNode:S.anchorNode,anchorOffset:S.anchorOffset,focusNode:S.focusNode,focusOffset:S.focusOffset}),We&&te(We,S)||(We=S,S=jg(He,"onSelect"),0>=Y,R-=Y,jo=1<<32-mt(d)+R|g<rn?(wn=Et,Et=null):wn=Et.sibling;var On=Te(ke,Et,Ce[rn],Be);if(On===null){Et===null&&(Et=wn);break}l&&Et&&On.alternate===null&&d(ke,Et),ge=O(On,ge,rn),Mn===null?It=On:Mn.sibling=On,Mn=On,Et=wn}if(rn===Ce.length)return g(ke,Et),Cn&&kc(ke,rn),It;if(Et===null){for(;rnrn?(wn=Et,Et=null):wn=Et.sibling;var Wl=Te(ke,Et,On.value,Be);if(Wl===null){Et===null&&(Et=wn);break}l&&Et&&Wl.alternate===null&&d(ke,Et),ge=O(Wl,ge,rn),Mn===null?It=Wl:Mn.sibling=Wl,Mn=Wl,Et=wn}if(On.done)return g(ke,Et),Cn&&kc(ke,rn),It;if(Et===null){for(;!On.done;rn++,On=Ce.next())On=Fe(ke,On.value,Be),On!==null&&(ge=O(On,ge,rn),Mn===null?It=On:Mn.sibling=On,Mn=On);return Cn&&kc(ke,rn),It}for(Et=S(Et);!On.done;rn++,On=Ce.next())On=Oe(Et,ke,rn,On.value,Be),On!==null&&(l&&On.alternate!==null&&Et.delete(On.key===null?rn:On.key),ge=O(On,ge,rn),Mn===null?It=On:Mn.sibling=On,Mn=On);return l&&Et.forEach(function(bV){return d(ke,bV)}),Cn&&kc(ke,rn),It}function nr(ke,ge,Ce,Be){if(typeof Ce=="object"&&Ce!==null&&Ce.type===k&&Ce.key===null&&(Ce=Ce.props.children),typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case m:e:{for(var It=Ce.key;ge!==null;){if(ge.key===It){if(It=Ce.type,It===k){if(ge.tag===7){g(ke,ge.sibling),Be=R(ge,Ce.props.children),Be.return=ke,ke=Be;break e}}else if(ge.elementType===It||typeof It=="object"&&It!==null&&It.$$typeof===j&&n_(It)===ge.type){g(ke,ge.sibling),Be=R(ge,Ce.props),op(Be,Ce),Be.return=ke,ke=Be;break e}g(ke,ge);break}else d(ke,ge);ge=ge.sibling}Ce.type===k?(Be=Yu(Ce.props.children,ke.mode,Be,Ce.key),Be.return=ke,ke=Be):(Be=Vm(Ce.type,Ce.key,Ce.props,null,ke.mode,Be),op(Be,Ce),Be.return=ke,ke=Be)}return Y(ke);case x:e:{for(It=Ce.key;ge!==null;){if(ge.key===It)if(ge.tag===4&&ge.stateNode.containerInfo===Ce.containerInfo&&ge.stateNode.implementation===Ce.implementation){g(ke,ge.sibling),Be=R(ge,Ce.children||[]),Be.return=ke,ke=Be;break e}else{g(ke,ge);break}else d(ke,ge);ge=ge.sibling}Be=Xy(Ce,ke.mode,Be),Be.return=ke,ke=Be}return Y(ke);case j:return Ce=n_(Ce),nr(ke,ge,Ce,Be)}if(Q(Ce))return xt(ke,ge,Ce,Be);if($(Ce)){if(It=$(Ce),typeof It!="function")throw Error(r(150));return Ce=It.call(Ce),Ut(ke,ge,Ce,Be)}if(typeof Ce.then=="function")return nr(ke,ge,Jm(Ce),Be);if(Ce.$$typeof===y)return nr(ke,ge,Qm(ke,Ce),Be);eg(ke,Ce)}return typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint"?(Ce=""+Ce,ge!==null&&ge.tag===6?(g(ke,ge.sibling),Be=R(ge,Ce),Be.return=ke,ke=Be):(g(ke,ge),Be=Qy(Ce,ke.mode,Be),Be.return=ke,ke=Be),Y(ke)):g(ke,ge)}return function(ke,ge,Ce,Be){try{ap=0;var It=nr(ke,ge,Ce,Be);return Wf=null,It}catch(Et){if(Et===Kf||Et===Ym)throw Et;var Mn=Bi(29,Et,null,ke.mode);return Mn.lanes=Be,Mn.return=ke,Mn}finally{}}}var s_=ZC(!0),JC=ZC(!1),Al=!1;function cx(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lx(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Rl(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function Ml(l,d,g){var S=l.updateQueue;if(S===null)return null;if(S=S.shared,(In&2)!==0){var R=S.pending;return R===null?d.next=d:(d.next=R.next,R.next=d),S.pending=d,d=Gm(l),tp(l,null,g),d}return $r(l,S,d,g),Gm(l)}function cp(l,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194048)!==0)){var S=d.lanes;S&=l.pendingLanes,g|=S,d.lanes=g,dn(l,g)}}function ux(l,d){var g=l.updateQueue,S=l.alternate;if(S!==null&&(S=S.updateQueue,g===S)){var R=null,O=null;if(g=g.firstBaseUpdate,g!==null){do{var Y={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};O===null?R=O=Y:O=O.next=Y,g=g.next}while(g!==null);O===null?R=O=d:O=O.next=d}else R=O=d;g={baseState:S.baseState,firstBaseUpdate:R,lastBaseUpdate:O,shared:S.shared,callbacks:S.callbacks},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=d:l.next=d,g.lastBaseUpdate=d}var _x=!1;function lp(){if(_x){var l=Vf;if(l!==null)throw l}}function up(l,d,g,S){_x=!1;var R=l.updateQueue;Al=!1;var O=R.firstBaseUpdate,Y=R.lastBaseUpdate,re=R.shared.pending;if(re!==null){R.shared.pending=null;var he=re,Ee=he.next;he.next=null,Y===null?O=Ee:Y.next=Ee,Y=he;var $e=l.alternate;$e!==null&&($e=$e.updateQueue,re=$e.lastBaseUpdate,re!==Y&&(re===null?$e.firstBaseUpdate=Ee:re.next=Ee,$e.lastBaseUpdate=he))}if(O!==null){var Fe=R.baseState;Y=0,$e=Ee=he=null,re=O;do{var Te=re.lane&-536870913,Oe=Te!==re.lane;if(Oe?(xn&Te)===Te:(S&Te)===Te){Te!==0&&Te===Gf&&(_x=!0),$e!==null&&($e=$e.next={lane:0,tag:re.tag,payload:re.payload,callback:null,next:null});e:{var xt=l,Ut=re;Te=d;var nr=g;switch(Ut.tag){case 1:if(xt=Ut.payload,typeof xt=="function"){Fe=xt.call(nr,Fe,Te);break e}Fe=xt;break e;case 3:xt.flags=xt.flags&-65537|128;case 0:if(xt=Ut.payload,Te=typeof xt=="function"?xt.call(nr,Fe,Te):xt,Te==null)break e;Fe=_({},Fe,Te);break e;case 2:Al=!0}}Te=re.callback,Te!==null&&(l.flags|=64,Oe&&(l.flags|=8192),Oe=R.callbacks,Oe===null?R.callbacks=[Te]:Oe.push(Te))}else Oe={lane:Te,tag:re.tag,payload:re.payload,callback:re.callback,next:null},$e===null?(Ee=$e=Oe,he=Fe):$e=$e.next=Oe,Y|=Te;if(re=re.next,re===null){if(re=R.shared.pending,re===null)break;Oe=re,re=Oe.next,Oe.next=null,R.lastBaseUpdate=Oe,R.shared.pending=null}}while(!0);$e===null&&(he=Fe),R.baseState=he,R.firstBaseUpdate=Ee,R.lastBaseUpdate=$e,O===null&&(R.shared.lanes=0),$l|=Y,l.lanes=Y,l.memoizedState=Fe}}function e7(l,d){if(typeof l!="function")throw Error(r(191,l));l.call(d)}function t7(l,d){var g=l.callbacks;if(g!==null)for(l.callbacks=null,l=0;lO?O:8;var Y=V.T,re={};V.T=re,Tx(l,!1,d,g);try{var he=R(),Ee=V.S;if(Ee!==null&&Ee(re,he),he!==null&&typeof he=="object"&&typeof he.then=="function"){var $e=cG(he,S);dp(l,d,$e,Ui(l))}else dp(l,d,S,Ui(l))}catch(Fe){dp(l,d,{then:function(){},status:"rejected",reason:Fe},Ui())}finally{J.p=O,Y!==null&&re.types!==null&&(Y.types=re.types),V.T=Y}}function hG(){}function zx(l,d,g,S){if(l.tag!==5)throw Error(r(476));var R=M7(l).queue;R7(l,R,d,Z,g===null?hG:function(){return O7(l),g(S)})}function M7(l){var d=l.memoizedState;if(d!==null)return d;d={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nc,lastRenderedState:Z},next:null};var g={};return d.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nc,lastRenderedState:g},next:null},l.memoizedState=d,l=l.alternate,l!==null&&(l.memoizedState=d),d}function O7(l){var d=M7(l);d.next===null&&(d=l.alternate.memoizedState),dp(l,d.next.queue,{},Ui())}function jx(){return Ms(Tp)}function D7(){return Zr().memoizedState}function L7(){return Zr().memoizedState}function pG(l){for(var d=l.return;d!==null;){switch(d.tag){case 24:case 3:var g=Ui();l=Rl(g);var S=Ml(d,l,g);S!==null&&(Ci(S,d,g),cp(S,d,g)),d={cache:sx()},l.payload=d;return}d=d.return}}function mG(l,d,g){var S=Ui();g={lane:S,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},ug(l)?$7(d,g):(g=El(l,d,g,S),g!==null&&(Ci(g,l,S),B7(g,d,S)))}function I7(l,d,g){var S=Ui();dp(l,d,g,S)}function dp(l,d,g,S){var R={lane:S,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(ug(l))$7(d,R);else{var O=l.alternate;if(l.lanes===0&&(O===null||O.lanes===0)&&(O=d.lastRenderedReducer,O!==null))try{var Y=d.lastRenderedState,re=O(Y,g);if(R.hasEagerState=!0,R.eagerState=re,ks(re,Y))return $r(l,d,R,0),or===null&&xa(),!1}catch{}finally{}if(g=El(l,d,R,S),g!==null)return Ci(g,l,S),B7(g,d,S),!0}return!1}function Tx(l,d,g,S){if(S={lane:2,revertLane:c2(),gesture:null,action:S,hasEagerState:!1,eagerState:null,next:null},ug(l)){if(d)throw Error(r(479))}else d=El(l,g,S,2),d!==null&&Ci(d,l,2)}function ug(l){var d=l.alternate;return l===tn||d!==null&&d===tn}function $7(l,d){Xf=rg=!0;var g=l.pending;g===null?d.next=d:(d.next=g.next,g.next=d),l.pending=d}function B7(l,d,g){if((g&4194048)!==0){var S=d.lanes;S&=l.pendingLanes,g|=S,d.lanes=g,dn(l,g)}}var hp={readContext:Ms,use:ag,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useLayoutEffect:Br,useInsertionEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useSyncExternalStore:Br,useId:Br,useHostTransitionStatus:Br,useFormState:Br,useActionState:Br,useOptimistic:Br,useMemoCache:Br,useCacheRefresh:Br};hp.useEffectEvent=Br;var P7={readContext:Ms,use:ag,useCallback:function(l,d){return ii().memoizedState=[l,d===void 0?null:d],l},useContext:Ms,useEffect:k7,useImperativeHandle:function(l,d,g){g=g!=null?g.concat([l]):null,cg(4194308,4,N7.bind(null,d,l),g)},useLayoutEffect:function(l,d){return cg(4194308,4,l,d)},useInsertionEffect:function(l,d){cg(4,2,l,d)},useMemo:function(l,d){var g=ii();d=d===void 0?null:d;var S=l();if(i_){jt(!0);try{l()}finally{jt(!1)}}return g.memoizedState=[S,d],S},useReducer:function(l,d,g){var S=ii();if(g!==void 0){var R=g(d);if(i_){jt(!0);try{g(d)}finally{jt(!1)}}}else R=d;return S.memoizedState=S.baseState=R,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:R},S.queue=l,l=l.dispatch=mG.bind(null,tn,l),[S.memoizedState,l]},useRef:function(l){var d=ii();return l={current:l},d.memoizedState=l},useState:function(l){l=kx(l);var d=l.queue,g=I7.bind(null,tn,d);return d.dispatch=g,[l.memoizedState,g]},useDebugValue:Ex,useDeferredValue:function(l,d){var g=ii();return Nx(g,l,d)},useTransition:function(){var l=kx(!1);return l=R7.bind(null,tn,l.queue,!0,!1),ii().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,d,g){var S=tn,R=ii();if(Cn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=d(),or===null)throw Error(r(349));(xn&127)!==0||o7(S,d,g)}R.memoizedState=g;var O={value:g,getSnapshot:d};return R.queue=O,k7(l7.bind(null,S,O,l),[l]),S.flags|=2048,Zf(9,{destroy:void 0},c7.bind(null,S,O,g,d),null),g},useId:function(){var l=ii(),d=or.identifierPrefix;if(Cn){var g=To,S=jo;g=(S&~(1<<32-mt(S)-1)).toString(32)+g,d="_"+d+"R_"+g,g=sg++,0<\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof S.is=="string"?Y.createElement("select",{is:S.is}):Y.createElement("select"),S.multiple?O.multiple=!0:S.size&&(O.size=S.size);break;default:O=typeof S.is=="string"?Y.createElement(R,{is:S.is}):Y.createElement(R)}}O[hn]=d,O[Tr]=S;e:for(Y=d.child;Y!==null;){if(Y.tag===5||Y.tag===6)O.appendChild(Y.stateNode);else if(Y.tag!==4&&Y.tag!==27&&Y.child!==null){Y.child.return=Y,Y=Y.child;continue}if(Y===d)break e;for(;Y.sibling===null;){if(Y.return===null||Y.return===d)break e;Y=Y.return}Y.sibling.return=Y.return,Y=Y.sibling}d.stateNode=O;e:switch(Ds(O,R,S),R){case"button":case"input":case"select":case"textarea":S=!!S.autoFocus;break e;case"img":S=!0;break e;default:S=!1}S&&jc(d)}}return br(d),Ux(d,d.type,l===null?null:l.memoizedProps,d.pendingProps,g),null;case 6:if(l&&d.stateNode!=null)l.memoizedProps!==S&&jc(d);else{if(typeof S!="string"&&d.stateNode===null)throw Error(r(166));if(l=_e.current,qf(d)){if(l=d.stateNode,g=d.memoizedProps,S=null,R=Rs,R!==null)switch(R.tag){case 27:case 5:S=R.memoizedProps}l[hn]=d,l=!!(l.nodeValue===g||S!==null&&S.suppressHydrationWarning===!0||i9(l.nodeValue,g)),l||jl(d,!0)}else l=Tg(l).createTextNode(S),l[hn]=d,d.stateNode=l}return br(d),null;case 31:if(g=d.memoizedState,l===null||l.memoizedState!==null){if(S=qf(d),g!==null){if(l===null){if(!S)throw Error(r(318));if(l=d.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(557));l[hn]=d}else Zu(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;br(d),l=!1}else g=ex(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),l=!0;if(!l)return d.flags&256?(Fi(d),d):(Fi(d),null);if((d.flags&128)!==0)throw Error(r(558))}return br(d),null;case 13:if(S=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(R=qf(d),S!==null&&S.dehydrated!==null){if(l===null){if(!R)throw Error(r(318));if(R=d.memoizedState,R=R!==null?R.dehydrated:null,!R)throw Error(r(317));R[hn]=d}else Zu(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;br(d),R=!1}else R=ex(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=R),R=!0;if(!R)return d.flags&256?(Fi(d),d):(Fi(d),null)}return Fi(d),(d.flags&128)!==0?(d.lanes=g,d):(g=S!==null,l=l!==null&&l.memoizedState!==null,g&&(S=d.child,R=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(R=S.alternate.memoizedState.cachePool.pool),O=null,S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(O=S.memoizedState.cachePool.pool),O!==R&&(S.flags|=2048)),g!==l&&g&&(d.child.flags|=8192),pg(d,d.updateQueue),br(d),null);case 4:return oe(),l===null&&f2(d.stateNode.containerInfo),br(d),null;case 10:return Cc(d.type),br(d),null;case 19:if(U(Yr),S=d.memoizedState,S===null)return br(d),null;if(R=(d.flags&128)!==0,O=S.rendering,O===null)if(R)mp(S,!1);else{if(Pr!==0||l!==null&&(l.flags&128)!==0)for(l=d.child;l!==null;){if(O=ng(l),O!==null){for(d.flags|=128,mp(S,!1),l=O.updateQueue,d.updateQueue=l,pg(d,l),d.subtreeFlags=0,l=g,g=d.child;g!==null;)IC(g,l),g=g.sibling;return K(Yr,Yr.current&1|2),Cn&&kc(d,S.treeForkCount),d.child}l=l.sibling}S.tail!==null&&dt()>yg&&(d.flags|=128,R=!0,mp(S,!1),d.lanes=4194304)}else{if(!R)if(l=ng(O),l!==null){if(d.flags|=128,R=!0,l=l.updateQueue,d.updateQueue=l,pg(d,l),mp(S,!0),S.tail===null&&S.tailMode==="hidden"&&!O.alternate&&!Cn)return br(d),null}else 2*dt()-S.renderingStartTime>yg&&g!==536870912&&(d.flags|=128,R=!0,mp(S,!1),d.lanes=4194304);S.isBackwards?(O.sibling=d.child,d.child=O):(l=S.last,l!==null?l.sibling=O:d.child=O,S.last=O)}return S.tail!==null?(l=S.tail,S.rendering=l,S.tail=l.sibling,S.renderingStartTime=dt(),l.sibling=null,g=Yr.current,K(Yr,R?g&1|2:g&1),Cn&&kc(d,S.treeForkCount),l):(br(d),null);case 22:case 23:return Fi(d),dx(),S=d.memoizedState!==null,l!==null?l.memoizedState!==null!==S&&(d.flags|=8192):S&&(d.flags|=8192),S?(g&536870912)!==0&&(d.flags&128)===0&&(br(d),d.subtreeFlags&6&&(d.flags|=8192)):br(d),g=d.updateQueue,g!==null&&pg(d,g.retryQueue),g=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),S=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(S=d.memoizedState.cachePool.pool),S!==g&&(d.flags|=2048),l!==null&&U(t_),null;case 24:return g=null,l!==null&&(g=l.memoizedState.cache),d.memoizedState.cache!==g&&(d.flags|=2048),Cc(ss),br(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function xG(l,d){switch(Zy(d),d.tag){case 1:return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return Cc(ss),oe(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 26:case 27:case 5:return pe(d),null;case 31:if(d.memoizedState!==null){if(Fi(d),d.alternate===null)throw Error(r(340));Zu()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 13:if(Fi(d),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(r(340));Zu()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return U(Yr),null;case 4:return oe(),null;case 10:return Cc(d.type),null;case 22:case 23:return Fi(d),dx(),l!==null&&U(t_),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 24:return Cc(ss),null;case 25:return null;default:return null}}function u8(l,d){switch(Zy(d),d.tag){case 3:Cc(ss),oe();break;case 26:case 27:case 5:pe(d);break;case 4:oe();break;case 31:d.memoizedState!==null&&Fi(d);break;case 13:Fi(d);break;case 19:U(Yr);break;case 10:Cc(d.type);break;case 22:case 23:Fi(d),dx(),l!==null&&U(t_);break;case 24:Cc(ss)}}function gp(l,d){try{var g=d.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var R=S.next;g=R;do{if((g.tag&l)===l){S=void 0;var O=g.create,Y=g.inst;S=O(),Y.destroy=S}g=g.next}while(g!==R)}}catch(re){Zn(d,d.return,re)}}function Ll(l,d,g){try{var S=d.updateQueue,R=S!==null?S.lastEffect:null;if(R!==null){var O=R.next;S=O;do{if((S.tag&l)===l){var Y=S.inst,re=Y.destroy;if(re!==void 0){Y.destroy=void 0,R=d;var he=g,Ee=re;try{Ee()}catch($e){Zn(R,he,$e)}}}S=S.next}while(S!==O)}}catch($e){Zn(d,d.return,$e)}}function _8(l){var d=l.updateQueue;if(d!==null){var g=l.stateNode;try{t7(d,g)}catch(S){Zn(l,l.return,S)}}}function f8(l,d,g){g.props=a_(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(S){Zn(l,d,S)}}function vp(l,d){try{var g=l.ref;if(g!==null){switch(l.tag){case 26:case 27:case 5:var S=l.stateNode;break;case 30:S=l.stateNode;break;default:S=l.stateNode}typeof g=="function"?l.refCleanup=g(S):g.current=S}}catch(R){Zn(l,d,R)}}function Ao(l,d){var g=l.ref,S=l.refCleanup;if(g!==null)if(typeof S=="function")try{S()}catch(R){Zn(l,d,R)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(R){Zn(l,d,R)}else g.current=null}function d8(l){var d=l.type,g=l.memoizedProps,S=l.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":g.autoFocus&&S.focus();break e;case"img":g.src?S.src=g.src:g.srcSet&&(S.srcset=g.srcSet)}}catch(R){Zn(l,l.return,R)}}function Gx(l,d,g){try{var S=l.stateNode;qG(S,l.type,g,d),S[Tr]=d}catch(R){Zn(l,l.return,R)}}function h8(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&ql(l.type)||l.tag===4}function Vx(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||h8(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&ql(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Kx(l,d,g){var S=l.tag;if(S===5||S===6)l=l.stateNode,d?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(l,d):(d=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,d.appendChild(l),g=g._reactRootContainer,g!=null||d.onclick!==null||(d.onclick=Ir));else if(S!==4&&(S===27&&ql(l.type)&&(g=l.stateNode,d=null),l=l.child,l!==null))for(Kx(l,d,g),l=l.sibling;l!==null;)Kx(l,d,g),l=l.sibling}function mg(l,d,g){var S=l.tag;if(S===5||S===6)l=l.stateNode,d?g.insertBefore(l,d):g.appendChild(l);else if(S!==4&&(S===27&&ql(l.type)&&(g=l.stateNode),l=l.child,l!==null))for(mg(l,d,g),l=l.sibling;l!==null;)mg(l,d,g),l=l.sibling}function p8(l){var d=l.stateNode,g=l.memoizedProps;try{for(var S=l.type,R=d.attributes;R.length;)d.removeAttributeNode(R[0]);Ds(d,S,g),d[hn]=l,d[Tr]=g}catch(O){Zn(l,l.return,O)}}var Tc=!1,os=!1,Wx=!1,m8=typeof WeakSet=="function"?WeakSet:Set,Ss=null;function wG(l,d){if(l=l.containerInfo,p2=Ig,l=ae(l),xe(l)){if("selectionStart"in l)var g={start:l.selectionStart,end:l.selectionEnd};else e:{g=(g=l.ownerDocument)&&g.defaultView||window;var S=g.getSelection&&g.getSelection();if(S&&S.rangeCount!==0){g=S.anchorNode;var R=S.anchorOffset,O=S.focusNode;S=S.focusOffset;try{g.nodeType,O.nodeType}catch{g=null;break e}var Y=0,re=-1,he=-1,Ee=0,$e=0,Fe=l,Te=null;t:for(;;){for(var Oe;Fe!==g||R!==0&&Fe.nodeType!==3||(re=Y+R),Fe!==O||S!==0&&Fe.nodeType!==3||(he=Y+S),Fe.nodeType===3&&(Y+=Fe.nodeValue.length),(Oe=Fe.firstChild)!==null;)Te=Fe,Fe=Oe;for(;;){if(Fe===l)break t;if(Te===g&&++Ee===R&&(re=Y),Te===O&&++$e===S&&(he=Y),(Oe=Fe.nextSibling)!==null)break;Fe=Te,Te=Fe.parentNode}Fe=Oe}g=re===-1||he===-1?null:{start:re,end:he}}else g=null}g=g||{start:0,end:0}}else g=null;for(m2={focusedElem:l,selectionRange:g},Ig=!1,Ss=d;Ss!==null;)if(d=Ss,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,Ss=l;else for(;Ss!==null;){switch(d=Ss,O=d.alternate,l=d.flags,d.tag){case 0:if((l&4)!==0&&(l=d.updateQueue,l=l!==null?l.events:null,l!==null))for(g=0;g title"))),Ds(O,S,g),O[hn]=l,sr(O),S=O;break e;case"link":var Y=w9("link","href",R).get(S+(g.href||""));if(Y){for(var re=0;renr&&(Y=nr,nr=Ut,Ut=Y);var ke=ze(re,Ut),ge=ze(re,nr);if(ke&&ge&&(Oe.rangeCount!==1||Oe.anchorNode!==ke.node||Oe.anchorOffset!==ke.offset||Oe.focusNode!==ge.node||Oe.focusOffset!==ge.offset)){var Ce=Fe.createRange();Ce.setStart(ke.node,ke.offset),Oe.removeAllRanges(),Ut>nr?(Oe.addRange(Ce),Oe.extend(ge.node,ge.offset)):(Ce.setEnd(ge.node,ge.offset),Oe.addRange(Ce))}}}}for(Fe=[],Oe=re;Oe=Oe.parentNode;)Oe.nodeType===1&&Fe.push({element:Oe,left:Oe.scrollLeft,top:Oe.scrollTop});for(typeof re.focus=="function"&&re.focus(),re=0;reg?32:g,V.T=null,g=t2,t2=null;var O=Pl,Y=Dc;if(ps=0,rd=Pl=null,Dc=0,(In&6)!==0)throw Error(r(331));var re=In;if(In|=4,N8(O.current),S8(O,O.current,Y,g),In=re,Sp(0,!1),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(Zt,O)}catch{}return!0}finally{J.p=R,V.T=S,G8(l,d)}}function K8(l,d,g){d=wa(g,d),d=Ox(l.stateNode,d,2),l=Ml(l,d,2),l!==null&&(fn(l,2),Ro(l))}function Zn(l,d,g){if(l.tag===3)K8(l,l,g);else for(;d!==null;){if(d.tag===3){K8(d,l,g);break}else if(d.tag===1){var S=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(Bl===null||!Bl.has(S))){l=wa(g,l),g=W7(2),S=Ml(d,g,2),S!==null&&(Q7(g,S,d,l),fn(S,2),Ro(S));break}}d=d.return}}function i2(l,d,g){var S=l.pingCache;if(S===null){S=l.pingCache=new CG;var R=new Set;S.set(d,R)}else R=S.get(d),R===void 0&&(R=new Set,S.set(d,R));R.has(g)||(Yx=!0,R.add(g),l=TG.bind(null,l,d,g),d.then(l,l))}function TG(l,d,g){var S=l.pingCache;S!==null&&S.delete(d),l.pingedLanes|=l.suspendedLanes&g,l.warmLanes&=~g,or===l&&(xn&g)===g&&(Pr===4||Pr===3&&(xn&62914560)===xn&&300>dt()-bg?(In&2)===0&&sd(l,0):Zx|=g,nd===xn&&(nd=0)),Ro(l)}function W8(l,d){d===0&&(d=on()),l=qn(l,d),l!==null&&(fn(l,d),Ro(l))}function AG(l){var d=l.memoizedState,g=0;d!==null&&(g=d.retryLane),W8(l,g)}function RG(l,d){var g=0;switch(l.tag){case 31:case 13:var S=l.stateNode,R=l.memoizedState;R!==null&&(g=R.retryLane);break;case 19:S=l.stateNode;break;case 22:S=l.stateNode._retryCache;break;default:throw Error(r(314))}S!==null&&S.delete(d),W8(l,g)}function MG(l,d){return at(l,d)}var Eg=null,ad=null,a2=!1,Ng=!1,o2=!1,Hl=0;function Ro(l){l!==ad&&l.next===null&&(ad===null?Eg=ad=l:ad=ad.next=l),Ng=!0,a2||(a2=!0,DG())}function Sp(l,d){if(!o2&&Ng){o2=!0;do for(var g=!1,S=Eg;S!==null;){if(l!==0){var R=S.pendingLanes;if(R===0)var O=0;else{var Y=S.suspendedLanes,re=S.pingedLanes;O=(1<<31-mt(42|l)+1)-1,O&=R&~(Y&~re),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(g=!0,Z8(S,O))}else O=xn,O=dr(S,S===or?O:0,S.cancelPendingCommit!==null||S.timeoutHandle!==-1),(O&3)===0||es(S,O)||(g=!0,Z8(S,O));S=S.next}while(g);o2=!1}}function OG(){Q8()}function Q8(){Ng=a2=!1;var l=0;Hl!==0&&GG()&&(l=Hl);for(var d=dt(),g=null,S=Eg;S!==null;){var R=S.next,O=X8(S,d);O===0?(S.next=null,g===null?Eg=R:g.next=R,R===null&&(ad=g)):(g=S,(l!==0||(O&3)!==0)&&(Ng=!0)),S=R}ps!==0&&ps!==5||Sp(l),Hl!==0&&(Hl=0)}function X8(l,d){for(var g=l.suspendedLanes,S=l.pingedLanes,R=l.expirationTimes,O=l.pendingLanes&-62914561;0re)break;var $e=he.transferSize,Fe=he.initiatorType;$e&&a9(Fe)&&(he=he.responseEnd,Y+=$e*(he"u"?null:document;function v9(l,d,g){var S=od;if(S&&typeof d=="string"&&d){var R=mr(d);R='link[rel="'+l+'"][href="'+R+'"]',typeof g=="string"&&(R+='[crossorigin="'+g+'"]'),g9.has(R)||(g9.add(R),l={rel:l,crossOrigin:g,href:d},S.querySelector(R)===null&&(d=S.createElement("link"),Ds(d,"link",l),sr(d),S.head.appendChild(d)))}}function eV(l){Lc.D(l),v9("dns-prefetch",l,null)}function tV(l,d){Lc.C(l,d),v9("preconnect",l,d)}function nV(l,d,g){Lc.L(l,d,g);var S=od;if(S&&l&&d){var R='link[rel="preload"][as="'+mr(d)+'"]';d==="image"&&g&&g.imageSrcSet?(R+='[imagesrcset="'+mr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(R+='[imagesizes="'+mr(g.imageSizes)+'"]')):R+='[href="'+mr(l)+'"]';var O=R;switch(d){case"style":O=cd(l);break;case"script":O=ld(l)}za.has(O)||(l=_({rel:"preload",href:d==="image"&&g&&g.imageSrcSet?void 0:l,as:d},g),za.set(O,l),S.querySelector(R)!==null||d==="style"&&S.querySelector(zp(O))||d==="script"&&S.querySelector(jp(O))||(d=S.createElement("link"),Ds(d,"link",l),sr(d),S.head.appendChild(d)))}}function rV(l,d){Lc.m(l,d);var g=od;if(g&&l){var S=d&&typeof d.as=="string"?d.as:"script",R='link[rel="modulepreload"][as="'+mr(S)+'"][href="'+mr(l)+'"]',O=R;switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=ld(l)}if(!za.has(O)&&(l=_({rel:"modulepreload",href:l},d),za.set(O,l),g.querySelector(R)===null)){switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(jp(O)))return}S=g.createElement("link"),Ds(S,"link",l),sr(S),g.head.appendChild(S)}}}function sV(l,d,g){Lc.S(l,d,g);var S=od;if(S&&l){var R=Vr(S).hoistableStyles,O=cd(l);d=d||"default";var Y=R.get(O);if(!Y){var re={loading:0,preload:null};if(Y=S.querySelector(zp(O)))re.loading=5;else{l=_({rel:"stylesheet",href:l,"data-precedence":d},g),(g=za.get(O))&&k2(l,g);var he=Y=S.createElement("link");sr(he),Ds(he,"link",l),he._p=new Promise(function(Ee,$e){he.onload=Ee,he.onerror=$e}),he.addEventListener("load",function(){re.loading|=1}),he.addEventListener("error",function(){re.loading|=2}),re.loading|=4,Rg(Y,d,S)}Y={type:"stylesheet",instance:Y,count:1,state:re},R.set(O,Y)}}}function iV(l,d){Lc.X(l,d);var g=od;if(g&&l){var S=Vr(g).hoistableScripts,R=ld(l),O=S.get(R);O||(O=g.querySelector(jp(R)),O||(l=_({src:l,async:!0},d),(d=za.get(R))&&S2(l,d),O=g.createElement("script"),sr(O),Ds(O,"link",l),g.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},S.set(R,O))}}function aV(l,d){Lc.M(l,d);var g=od;if(g&&l){var S=Vr(g).hoistableScripts,R=ld(l),O=S.get(R);O||(O=g.querySelector(jp(R)),O||(l=_({src:l,async:!0,type:"module"},d),(d=za.get(R))&&S2(l,d),O=g.createElement("script"),sr(O),Ds(O,"link",l),g.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},S.set(R,O))}}function b9(l,d,g,S){var R=(R=_e.current)?Ag(R):null;if(!R)throw Error(r(446));switch(l){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(d=cd(g.href),g=Vr(R).hoistableStyles,S=g.get(d),S||(S={type:"style",instance:null,count:0,state:null},g.set(d,S)),S):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){l=cd(g.href);var O=Vr(R).hoistableStyles,Y=O.get(l);if(Y||(R=R.ownerDocument||R,Y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(l,Y),(O=R.querySelector(zp(l)))&&!O._p&&(Y.instance=O,Y.state.loading=5),za.has(l)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},za.set(l,g),O||oV(R,l,g,Y.state))),d&&S===null)throw Error(r(528,""));return Y}if(d&&S!==null)throw Error(r(529,""));return null;case"script":return d=g.async,g=g.src,typeof g=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=ld(g),g=Vr(R).hoistableScripts,S=g.get(d),S||(S={type:"script",instance:null,count:0,state:null},g.set(d,S)),S):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,l))}}function cd(l){return'href="'+mr(l)+'"'}function zp(l){return'link[rel="stylesheet"]['+l+"]"}function y9(l){return _({},l,{"data-precedence":l.precedence,precedence:null})}function oV(l,d,g,S){l.querySelector('link[rel="preload"][as="style"]['+d+"]")?S.loading=1:(d=l.createElement("link"),S.preload=d,d.addEventListener("load",function(){return S.loading|=1}),d.addEventListener("error",function(){return S.loading|=2}),Ds(d,"link",g),sr(d),l.head.appendChild(d))}function ld(l){return'[src="'+mr(l)+'"]'}function jp(l){return"script[async]"+l}function x9(l,d,g){if(d.count++,d.instance===null)switch(d.type){case"style":var S=l.querySelector('style[data-href~="'+mr(g.href)+'"]');if(S)return d.instance=S,sr(S),S;var R=_({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return S=(l.ownerDocument||l).createElement("style"),sr(S),Ds(S,"style",R),Rg(S,g.precedence,l),d.instance=S;case"stylesheet":R=cd(g.href);var O=l.querySelector(zp(R));if(O)return d.state.loading|=4,d.instance=O,sr(O),O;S=y9(g),(R=za.get(R))&&k2(S,R),O=(l.ownerDocument||l).createElement("link"),sr(O);var Y=O;return Y._p=new Promise(function(re,he){Y.onload=re,Y.onerror=he}),Ds(O,"link",S),d.state.loading|=4,Rg(O,g.precedence,l),d.instance=O;case"script":return O=ld(g.src),(R=l.querySelector(jp(O)))?(d.instance=R,sr(R),R):(S=g,(R=za.get(O))&&(S=_({},g),S2(S,R)),l=l.ownerDocument||l,R=l.createElement("script"),sr(R),Ds(R,"link",S),l.head.appendChild(R),d.instance=R);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(S=d.instance,d.state.loading|=4,Rg(S,g.precedence,l));return d.instance}function Rg(l,d,g){for(var S=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),R=S.length?S[S.length-1]:null,O=R,Y=0;Y title"):null)}function cV(l,d,g){if(g===1||d.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;switch(d.rel){case"stylesheet":return l=d.disabled,typeof d.precedence=="string"&&l==null;default:return!0}case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function S9(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function lV(l,d,g,S){if(g.type==="stylesheet"&&(typeof S.media!="string"||matchMedia(S.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var R=cd(S.href),O=d.querySelector(zp(R));if(O){d=O._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(l.count++,l=Og.bind(l),d.then(l,l)),g.state.loading|=4,g.instance=O,sr(O);return}O=d.ownerDocument||d,S=y9(S),(R=za.get(R))&&k2(S,R),O=O.createElement("link"),sr(O);var Y=O;Y._p=new Promise(function(re,he){Y.onload=re,Y.onerror=he}),Ds(O,"link",S),g.instance=O}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(g,d),(d=g.state.preload)&&(g.state.loading&3)===0&&(l.count++,g=Og.bind(l),d.addEventListener("load",g),d.addEventListener("error",g))}}var C2=0;function uV(l,d){return l.stylesheets&&l.count===0&&Lg(l,l.stylesheets),0C2?50:800)+d);return l.unsuspend=g,function(){l.unsuspend=null,clearTimeout(S),clearTimeout(R)}}:null}function Og(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lg(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Dg=null;function Lg(l,d){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Dg=new Map,d.forEach(_V,l),Dg=null,Og.call(l))}function _V(l,d){if(!(d.state.loading&4)){var g=Dg.get(l);if(g)var S=g.get(null);else{g=new Map,Dg.set(l,g);for(var R=l.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),D2.exports=lK(),D2.exports}var _K=uK();const fK=!1;var AO=A.useLayoutEffect;function dK(e,n,t){A.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function hK(e){const n=A.useRef(null);return A.useImperativeHandle(e,()=>n.current,[]),n}function k0(e){return e[e.length-1]}function uh(e,n){return typeof e=="function"?e(n):e}const RO=Object.prototype.hasOwnProperty,pK=Object.prototype.propertyIsEnumerable;function MO(e){for(const n in e)if(RO.call(e,n))return!0;return!1}const mK=()=>Object.create(null),l_=(e,n)=>w_(e,n,mK);function w_(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=lE(e)&&lE(s);if(!i&&!(pv(e)&&pv(s)))return s;const a=i?e:oE(e);if(!a)return s;const o=i?s:oE(s);if(!o)return s;const c=a.length,u=o.length,h=i?new Array(u):t();let _=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!cE(t)||!t.hasOwnProperty("isPrototypeOf"))}function cE(e){return Object.prototype.toString.call(e)==="[object Object]"}function lE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vu(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!vu(e[a],n[a],t)))return!1;return s===i}return!1}const gK=/[\x00-\x1f\x7f"<>`{}]/g;function vK(e){return e.replace(gK,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function uE(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return vK(n)}const bK=["http:","https:","mailto:","tel:"];function mv(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function Ip(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=uE(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+uE(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function yK(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function xK(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const c=t;n.delete(c.key),c.next&&(t=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const c={key:i,value:a,prev:r};r&&(r.next=c),r=c,t||(t=c),n.set(i,c)}},clear(){n.clear(),t=void 0,r=void 0}}}const pu=4,OO=5;function DO(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const c=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=c,t[4]=c,t[5]=c,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!I.parse&&I.caseSensitive===j&&I.prefix===z&&I.suffix===T));if(D)w=D;else{const I=wK(N,_,j,z,T);w=I,I.parent=s,I.depth=i;let $;N===1?$=s.dynamic??(s.dynamic=[]):N===3?$=s.optional??(s.optional=[]):$=s.wildcard??(s.wildcard=[]),$.push(I),$.length===2&&(a==null||a.push($))}break}}s=w}if(k&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=Rd(_);b.kind=OO,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&_.endsWith("/")){const b=Rd(_);b.kind=pu,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=k??null,s.priority=((h=p==null?void 0:p.params)==null?void 0:h.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=_)}if(t.children)for(const _ of t.children)wb(e,n,_,c,s,i,a,o)}function LO(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function Rd(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function wK(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function kK(e,n){const t=Rd("/"),r=new Uint16Array(6),s=[];for(const i of e)wb(!1,r,i,1,t,0,s);for(const i of s)i.sort(LO);n.masksTree=t,n.flatCache=gv(1e3)}function SK(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=Tk(e,n.masksTree);return n.flatCache.set(e,r),r}function CK(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=Rd("/"),wb(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),Tk(r,a,t)}function EK(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=Tk(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=$O(i.route)),n.matchCache.set(r,i),i}function NK(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function zK(e,n=!1,t){const r=Rd(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let c=0;wb(n,s,e,1,r,0,i,u=>{if(t==null||t(u,c),u.id in a&&jk(),a[u.id]=u,c!==0&&u.path){const h=NK(u.fullPath);(!o[h]||u.fullPath.endsWith("/"))&&(o[h]=u)}c++});for(const u of i)u.sort(LO);return{processedTree:{segmentTree:r,singleCache:gv(1e3),matchCache:gv(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Tk(e,n,t=!1){const r=e.split("/"),s=TK(e,r,n,t);if(!s)return null;const[i]=IO(e,r,s);return{route:s.node.route,rawParams:i}}function IO(e,n,t){var h,_,p,m;const r=jK(t.node);let s=null;const i=Object.create(null);let a=((h=t.extract)==null?void 0:h.part)??0,o=((_=t.extract)==null?void 0:_.node)??0,c=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;z--){const T=_.wildcard[z],{prefix:j,suffix:M}=T;if(!(j&&(y||!(T.caseSensitive?C:N??(N=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const D=n.slice(p).join("/"),I=D.slice(-M.length);if((T.caseSensitive?I:I.toLowerCase())!==M||D.length-M.length=0;T--){const j=_.optional[T];o.push({node:j,index:p,skipped:z,statics:x,dynamics:k,optionals:v,extract:b,rawParams:w})}if(!y)for(let T=_.optional.length-1;T>=0;T--){const j=_.optional[T],{prefix:M,suffix:D}=j;if(M||D){const I=j.caseSensitive?C:N??(N=C.toLowerCase());if(M&&!I.startsWith(M)||D&&I.indexOf(D,I.length-D.length)=0;z--){const T=_.dynamic[z],{prefix:j,suffix:M}=T;if(j||M){const D=T.caseSensitive?C:N??(N=C.toLowerCase());if(j&&!D.startsWith(j)||M&&D.indexOf(M,D.length-M.length)=0;z--){const T=_.pathless[z];o.push({node:T,index:p,skipped:m,statics:x,dynamics:k,optionals:v,extract:b,rawParams:w})}}if(u)return u;if(r&&c){let h=c.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===pu)>(e.node.kind===pu)||n.node.kind===pu==(e.node.kind===pu)&&n.node.depth>e.node.depth))):!0}function F1(e){return H1(e.filter(n=>n!==void 0).join("/"))}function H1(e){return e.replace(/\/{2,}/g,"/")}function BO(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Zc(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function PO(e){return Zc(BO(e))}function vv(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function RK(e,n,t){return vv(e,t)===vv(n,t)}function MK({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=H1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=H1(e)),a=e.split("/");a.length>1&&k0(a)==="";)a.pop();const u=n.split("/");for(let h=0,_=u.length;h<_;h++){const p=u[h];p===""?h?h===_-1&&a.push(p):a=[p]:p===".."?a.length>1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(k0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),c=(s?H1(o):o)||"/";return i&&r&&r.set(i,c),c}function OK(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function B2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>dE(s,t)).join("/"):dE(r,t)}function fE({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,c,u="";for(;oe.state.__TSR_key||e.href;function FK(e){const n=e.getAttribute(hE);if(n)return`[${hE}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let Kg=!1;const q1="window";function Y4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function pE(e){const n=new Set;for(const t of e){if(t===q1)continue;const r=Y4(t);r&&n.add(r)}return n}function HK(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||PK,i=new Set,a=o=>{const c=nu[o]||(nu[o]={});for(const u of i)u===document?c[q1]={scrollX,scrollY}:u.isConnected&&(c[FK(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,Kg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{Kg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),BK()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var k;const c=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,h=r.next,_=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),x=o.fromLocation&&s(o.fromLocation);if(r.restoring&&x&&x!==m){const v=nu[x];if(v){let b=nu[m];for(const w in v){if(w===q1){if(h)continue}else{const y=Y4(w);if(!y||h&&u&&(p??(p=pE(u)),p.has(y)))continue}b||(b=nu[m]={}),b[w]??(b[w]=v[w])}}}Kg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(h){!v&&u&&(p??(p=pE(u)));const y=v&&b&&_,C=r.restoring?nu[m]:void 0;if(C)for(const N in C){const{scrollX:z,scrollY:T}=C[N];if(N===q1){if(y)continue;scrollTo({top:T,left:z,behavior:c}),w=!0}else{const j=Y4(N);j&&(j.scrollLeft=z,j.scrollTop=T,p==null||p.delete(j))}}if(!v){const N={top:0,left:0,behavior:c};if(w||scrollTo(N),p)for(const z of p)z.scrollTo(N)}}!w&&v&&b&&((k=document.getElementById(v))==null||k.scrollIntoView(b))}finally{Kg=!1}}))}function qK(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function P2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function UK(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=P2(s):Array.isArray(i)?i.push(P2(s)):t[r]=[i,P2(s)]}return t}const GK=/^(?:\s|["[{\d-]|fa|nu|tr)/,VK=WK(JSON.parse),KK=QK(JSON.stringify,JSON.parse);function WK(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=UK(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function QK(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!GK.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=qK(s,r);return i?`?${i}`:""}}const Od="__root__";function XK(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function FO(e){return e instanceof Response&&!!e.options}function YK(e){return{input:({url:n})=>{for(const t of e)n=Z4(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=HO(e[t],n);return n}}}function ZK(e){const n=PO(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=F1(["/",n,i.pathname]),i)}}function Z4(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function HO(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function JK(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),c=t(void 0),u=t([]),h=r(()=>u.get().map(k=>i.get(k).get())),_=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:h.get(),location:o.get(),resolvedLocation:c.get()}));function p(k){let v=i.get(k);return v||(v=t(void 0),i.set(k,v)),v}const m={status:a,location:o,resolvedLocation:c,ids:u,matches:h,byRoute:i,__store:_,getMatchStore:p,setMatches:x};function x(k){const v=u.get(),b=k.map(w=>w.routeId);s(()=>{xK(v,b)||u.set(b);for(const w of v)b.includes(w)||i.get(w).set(()=>{});for(const w of k){const y=p(w.routeId);y.get()!==w&&y.set(w)}})}return m}var bu="__TSR_index",mE="popstate",gE="beforeunload";function eW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...c})=>{var _,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((_=e.getBlockers)==null?void 0:_.call(e))??[],h=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&u.length&&h)for(const m of u){const x=bv(c.path,c.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:c.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,c)=>{const u=n.state[bu];o=vE(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:a,state:o})},replace:(a,o,c)=>{const u=n.state[bu];o=vE(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[bu]!==0,createHref:a=>e.createHref(a),block:a=>{var c;if(!e.setBlockers)return()=>{};const o=((c=e.getBlockers)==null?void 0:c.call(e))??[];return e.setBlockers([...o,a]),()=>{var h,_;const u=((h=e.getBlockers)==null?void 0:h.call(e))??[];(_=e.setBlockers)==null||_.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function vE(e,n){n||(n={});const t=Ak();return{...n,key:t,__TSR_key:t,[bu]:e}}function tW(e){var T,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),c=(()=>bv(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((T=n.history.state)!=null&&T.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=Ak();n.history.replaceState({[bu]:0,key:M,__TSR_key:M},"")}let u=c(),h,_=!1,p=!1,m=!1,x=!1;const k=()=>u;let v;const b=()=>{v&&(z._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),z._ignoreSubscribers=!1,v=void 0,h=void 0)},w=(M,D,I)=>{const $=o(D),q=!!v;q||(h=u),u=bv(D,I),v=[$,I,(v==null?void 0:v[2])||M],q||queueMicrotask(()=>b())},y=M=>{u=c(),z.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=c(),D=M.state[bu]-u.state[bu],I=D===1,$=D===-1,q=!I&&!$||_;_=!1;const H=q?"GO":$?"BACK":"FORWARD",Q=q?{type:"GO",index:D}:{type:$?"BACK":"FORWARD"};if(m)m=!1;else{const V=i();if(typeof document<"u"&&V.length){for(const J of V)if(await J.blockerFn({currentLocation:u,nextLocation:M,action:H})){p=!0,n.history.go(1),z.notify(Q);return}}}u=c(),z.notify(Q)},N=M=>{if(x){x=!1;return}let D=!1;const I=i();if(typeof document<"u"&&I.length)for(const $ of I){const q=$.enableBeforeUnload??!0;if(q===!0){D=!0;break}if(typeof q=="function"&&q()===!0){D=!0;break}}if(D)return M.preventDefault(),M.returnValue=""},z=eW({getLocation:k,getLength:()=>n.history.length,pushState:(M,D)=>w(!0,M,D),replaceState:(M,D)=>w(!1,M,D),back:M=>(M&&(m=!0),x=!0,n.history.back()),forward:M=>{M&&(m=!0),x=!0,n.history.forward()},go:M=>{_=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(gE,N,{capture:!0}),n.removeEventListener(mE,C)},onBlocked:()=>{h&&u!==h&&(u=h)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(gE,N,{capture:!0}),n.addEventListener(mE,C),n.history.pushState=function(...M){const D=t.apply(n.history,M);return z._ignoreSubscribers||y("PUSH"),D},n.history.replaceState=function(...M){const D=r.apply(n.history,M);return z._ignoreSubscribers||y("REPLACE"),D},z}function nW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function bv(e,n){const t=nW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=Ak();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[bu]:0,key:i,__TSR_key:i}}}function Ak(){return(Math.random()+1).toString(36).substring(7)}function bE(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function kb(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function yE({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function rW(e,n,t,r){var s,i,a,o;for(const c of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===c.routeId)||(i=(s=e.routesById[c.routeId].options).onLeave)==null||i.call(s,c)}for(const c of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[c.routeId].options)[n.some(u=>u.routeId===c.routeId)?"onStay":"onEnter"])==null||o.call(a,c)}}var sW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??fK??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=OK(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=tW()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=gv(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=JK(this.latestLocation,u),HK(this)}const o=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==o||a!==c){this.basepath=o;const u=[],h=PO(o);h&&h!=="/"&&u.push(ZK({basepath:o})),c&&u.push(c),this.rewrite=u.length===0?void 0:u.length===1?u[0]:YK(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=zK(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&kK(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:c,search:u,hash:h,href:_,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const b=this.options.parseSearch(u),w=this.options.stringifySearch(b);return{href:c+w+h,publicHref:c+w+h,pathname:Ip(c).path,external:!1,searchStr:w,search:l_(r==null?void 0:r.search,b),hash:Ip(h.slice(1)).path,state:w_(r==null?void 0:r.state,p)}}const m=new URL(_,this.origin),x=Z4(this.rewrite,m),k=this.options.parseSearch(x.search),v=this.options.stringifySearch(k);return x.search=v,{href:x.href.replace(x.origin,""),publicHref:_,pathname:Ip(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:v,search:l_(r==null?void 0:r.search,k),hash:Ip(x.hash.slice(1)).path,state:w_(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const c=s(a);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>MK({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=EK(Zc(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,D;if(i.href){const I=bv(i.href,{});i={...i,to:Z4(this.rewrite,new URL(I.pathname,this.origin)).pathname,search:this.options.parseSearch(I.search),hash:I.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const c=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],h=o[3],_=this.resolvePathWithBase(c,i.to?`${i.to}`:".");let p=xE(i.params,h);const m=this.routesByPath[Zc(_)];let x;if(m)x=this.getRouteBranch(m);else if(_.includes("$"))x=[];else{const[I,$,q]=this.getMatchedRoutes(_);x=I,this.options.notFoundRoute&&(!q||q.path!=="/"&&$["**"])&&(x=[...x,this.options.notFoundRoute])}if(x.length&&MO(p))for(const I of x){const $=((M=I.options.params)==null?void 0:M.stringify)??I.options.stringifyParams;if($){p===h&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,$(p))}catch{}}}const k=t.leaveParams?_:Ip(fE({path:_,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((D=this.options.search)!=null&&D.strict)){const I={};x.forEach($=>{if($.options.validateSearch)try{Object.assign(I,U1($.options.validateSearch,{...I,...v}))}catch{}}),v=I}v=aW(v,i,x,t._includeValidateSearch),v=l_(u,v);const b=this.options.stringifySearch(v),w=i.hash===!0?a.hash:i.hash?uh(i.hash,a.hash):void 0,y=w?`#${w}`:"";let C=i.state===!0?a.state:i.state?uh(i.state,a.state):{};i.state&&(C=w_(a.state,C));const N=`${k}${b}${y}`;let z,T,j=!1;if(this.rewrite){const I=new URL(N,this.origin),$=HO(this.rewrite,I);z=I.href.replace(I.origin,""),$.origin!==this.origin?(T=$.href,j=!0):T=$.pathname+$.search+$.hash}else z=yK(N),T=z;return{publicHref:T,href:z,pathname:k,search:v,searchStr:b,state:C,hash:w??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=SK(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:c,...u}=i.route,h=xE(c,a);s.maskedLocation=r({from:t.from,...u,params:h})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=Zc(this.latestLocation.href)===Zc(s.href)&&vu(yE(s.state),yE(this.latestLocation.state)),o=this._commitPromise;let c;const u=new Promise(h=>{c=h});if(u.resolve=()=>{c(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:h,hashScrollIntoView:_,...p}=s;h&&(p={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=_??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const c=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=c;const u=this.commitLocation({...c,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===c&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var c,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const _=this.buildLocation({to:t,...a});s=s??_.publicHref,i=i??_.publicHref}const h=!o&&i?i:s;if(mv(h,this.protocolAllowlist))return;if(!a.ignoreBlocker){const _=((u=(c=this.history).getBlockers)==null?void 0:u.call(c))??[];for(const p of _)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(h):window.location.href=h;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await pW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,c=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(kb(o,c)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,h;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(_=>!s||s(_)).map(_=>_.id)),o=[];for(const[_,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(_),o.push(_));const c=_=>{if(a.has(_.id)){const p=this.routesById[_.routeId],m={..._,invalid:!0,...(t!=null&&t.forcePending||_.status==="error"||_.status==="notFound")&&bE(p)?{status:"pending",error:void 0}:void 0};return _._flight=void 0,m}return _};this._committed=r.map(c);for(const[_,p]of this._cache)a.has(_)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const _ of a)(h=this._flights)==null||h.delete(_);for(const _ of o)_.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&mv(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[h,_]of r)(!i||i(_))&&(o.push(h),a.push(_));const c=[];for(const[h,_]of s??[])(!i||_.some(i))&&(c.push(h),a.push(..._));for(const h of o)r.delete(h);for(const h of c)s.delete(h);for(const h of a){const _=h._flight;h._flight=void 0,_&&!--_[2]&&(((u=this._flights)==null?void 0:u.get(h.id))===_&&this._flights.delete(h.id),c.push(_[1]))}for(const h of c)h.abort()},this.loadRouteChunk=Dd,this.preloadRoute=t=>mW(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=CK(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!c||t.params&&!vu(c.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?vu(o.search,i.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??KK,parseSearch:e.parseSearch??VK,protocolAllowlist:e.protocolAllowlist??bK}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=$O(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:Zc(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?oW(this.options.notFoundMode,i):void 0,c=new Array(i.length),u=this._committed,h=(x,k)=>{const v=u[k];return(v==null?void 0:v.routeId)===x.id?v:x===this.options.notFoundRoute?u.find(b=>b.routeId===x.id):void 0};let _;for(let x=0;x{const m=p(c.preSearchFilters?c.preSearchFilters.reduce((x,k)=>k(x),_):_);return c.postSearchFilters?c.postSearchFilters.reduce((x,k)=>k(x),m):m};s.push(h)}const u=c.validateSearch;if(r&&u){const h=({search:_,next:p,meta:m})=>{const x=p(_);try{const k=U1(u,x);if(m&&k)for(const v in k)v in x||(m.defaulted||(m.defaulted=new Map)).set(v,k[v]);return{...x,...k}}catch{}return x};s.push(h)}}const i=(o,c,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return c;const _=uh(n.search,c);return u&&(u.explicit=_),_}const h=(_,p)=>{if(p){const m=u||{};return{search:i(o+1,_,m),meta:m}}return i(o+1,_,u)};return s[o]({search:c,next:h,meta:u})};return i(0,e)}function oW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return Od}function xE(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,uh(e,t))}function wE(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function J4(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function cW(e,n){const t=J4(e,"component");let r=J4(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function Dd(e,n,t){const r=()=>n===!1?void 0:n?J4(e,n):cW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...c}=a.options;Object.assign(e.options,c),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function Rk(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function ff(e,n){return e.routesById[n.routeId]}function C0(e,n,t){return FO(e)?[Xi,e]:_h(e)?(e.routeId||(e.routeId=t),[Sb,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[sl,e]):[Wo,e]}function Mk(e,n){var r,s;let t=C0(n,!0,e.id);if(t[0]!==sl)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=C0(i,!0,e.id)}return t}function l0(e,n,t,r,s){return s[0].signal.aborted?wu:Lk(e,n,t,Mk(t,r),s)}async function lW(e,n,t,r,s,i){var h,_;const[a,o]=n,c=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:x.id};try{const C=m._ctx||(m._ctx=x.options.context?x.options.context({...v,deps:m.loaderDeps,context:k})||{}:void 0);m.context={...k,...C}}catch(C){return Jc(e,m),[p,l0(e,n,x,C,t)]}if(c.aborted)return[p,wu];const b=m.paramsError??m.searchError;if(b!==void 0)return Jc(e,m),[p,l0(e,n,x,b,t)];const w=x.options.beforeLoad;if(!w)continue;const y=m.status;p>=i&&(m.status="pending",(_=t[7])==null||_.call(t));try{E0(e,m,"beforeLoad",t[0]);const C=await _f(w({...v,search:m.search,context:m.context,...e.options.additionalContext}),c);if(c.aborted)return[p,wu];const N=Lk(e,n,x,C0(C,!1,x.id),t);if(N[0]!==Wo)return Jc(e,m),[p,N];m.context={...m.context,...C}}catch(C){return Jc(e,m),[p,l0(e,n,x,C,t)]}finally{m.status=y,E0(e,m,!1,t[0])}}s()}function Ok(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function Jc(e,n){var r;const t=n._flight;n._flight=void 0,(r=Ok(e,n,t))==null||r.abort()}function Ti(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(c=>c.id===a.id)))o[2]=0;else{const c=Ok(e,a,o);c&&s.push(c)}}for(const a of s)a.abort()}function Dk(e){for(const n of e){const t=n._flight;t&&t[2]++}}function E0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function qO(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:c=>e.navigate({...c,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function kE(e,n,t,r,s,i,a){const o=a[0],c=o.signal;if(c.aborted)return wu;if(!s)return[Wo,void 0];let u=t._flight;E0(e,t,"loader",o);try{if(!u){const h=new AbortController;u=[Promise.resolve().then(()=>s(qO(e,n,t,r,h,i,!!a[3]))).then(_=>C0(_,!1,r.id),_=>C0(_,!0,r.id)).then(_=>{var p;return _[0]!==Wo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||h.abort()),_[0]===sl&&u[2]?Mk(r,_[1]):_}),h,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],Lk(e,n,r,await _f(u[0],c),a)}catch(h){if(h!==c||!c.aborted)throw h;return Jc(e,t),wu}finally{E0(e,t,!1,o)}}function SE(e,n,t){n[0]!==Xi&&(e.status="success",e.error=void 0,n[0]===Wo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function uW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&Jc(e,r)}function CE(e,n){return n[0]===sl||n[0]===Sb?{...e,status:n[0]===sl?"error":"notFound",error:n[1],_flight:void 0}:e}function _W(e,n,t,r,s,i,a){var $,q;const o=n[1][t],c=ff(e,o),u=!!i[3],h=e._cache.get(o.id);let _,p=!1,m;try{if(o.status==="success"&&(_=c.options.shouldReload,typeof _=="function"&&(_=_(qO(e,n,o,c,i[0],s,u))),i[0].signal.aborted&&(m=wu)),!m)if(o.status!=="success")p=!0;else{const H=u||o.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||_||_===void 0&&Date.now()-o.updatedAt>=H&&(i[5]||o.cause==="enter"||i[2].some(Q=>Q.routeId===o.routeId&&Q.id!==o.id)))}}catch(H){o.invalid=!0,Jc(e,o),m=l0(e,n,c,H,i)}const x=c.options.loader,k=typeof x=="function",v=k?x:x==null?void 0:x.handler,b=!u||c.options.preload!==!1;let w=b&&x?($=e._flights)==null?void 0:$.get(o.id):void 0;w===o._flight||m?w=void 0:w&&!p&&!u&&_===void 0?p=!0:p||(w=void 0);const y=!!(x&&p&&o.status==="success"&&!u&&!i[4]&&((k?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,N=C&&!y&&(o.status!=="success"||!!x),z=t>=a?i[7]:void 0,T=c.lazyFn&&c._lazy!==!0?z:void 0;if(C&&!x&&(o.invalid=!1,o.updatedAt=Date.now()),w&&w[2]++,N){const H=o._flight;o._flight=w,(q=Ok(e,o,H))==null||q.abort(),t>=a&&(o.status="pending"),z==null||z()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):N?kE(e,n,o,c,v,s,i):Promise.resolve([Wo,o.loaderData])).then(H=>(N&&(SE(o,H,u),H[0]===Wo&&(x&&!i[0].signal.aborted&&uW(e,o,h),t>=a&&(o.status="pending"))),H)),M=_f(Promise.resolve().then(()=>Dd(c,void 0,T)),i[0].signal).then(()=>{},H=>n[1].some((Q,V)=>V<=t&&(Q.status==="error"||Q.status==="notFound"||Q._notFound))?void 0:[t,l0(e,n,c,H,i)]).then(H=>j.then(Q=>(N&&!H&&Q[0]===Wo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",z==null||z()),H)));if(r.push([t,j,M]),!y)return j.then(H=>CE(o,H));const D={...o,status:"pending",preload:!1,_flight:w};o.invalid=!1,o.isFetching="loader";const I=kE(e,n,D,c,v,s,i).then(H=>(o.isFetching=!1,SE(D,H,!1),H));return(n[2]??(n[2]=[])).push([t,I,M,D]),I.then(H=>CE(D,H))}async function e3(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const c=ff(e,n[o]);try{const u=Dd(c,!1);u&&await _f(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(c.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function B_(e,n){n[2]&&(Ti(e,n[2].map(t=>t[3])),n[2]=void 0)}async function EE(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=Xi)throw[o,a];!s&&a[0]!==Wo&&(s=[o,a],await Promise.all((t??[]).map(c=>{if(!(c[0]<=o))return c[1].then(u=>{if(u[0]===Xi)throw[c[0],u]})})))}})))}catch(i){return i}return n??s}function Lk(e,n,t,r,s,i){for(;r[0]===Xi;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[Xi,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(c){r=i?[sl,c]:Mk(t,c),i=!0}}return r}async function UO(e,n,t,r,s,i){const a=n[1];let o=await s,c=!1;const u=a.findIndex(m=>m._notFound),h=m=>m[1][0]===Sb?e3(e,a,m,r.signal):m[0];let _=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=Xi)_=0;else if(o){_=o[2]??(o[2]=await h(o));for(const m of t){if(m[0]>=_)break;const x=await m[1];if(x[0]!==Wo&&x[0]=_)break;const x=await m[2];if(x){o=x;break}}if(((o==null?void 0:o[1][0])??0)>=Xi){const m=o[1];if(m[0]!==Xi||m[1].options.reloadDocument||m[2])return B_(e,n),m;c=!0,o=[0,[sl,new Error("Too many redirects")]]}const p=o?o[2]??await h(o):u;if(p>=0){const m=o==null?void 0:o[1],x=m==null?void 0:m[0],k=a[p],v=m==null?void 0:m[1],b=()=>{m&&(k._notFound=void 0,x===sl?k.status="error":(v.routeId=k.routeId,k.routeId===e.routeTree.id?(k.status="success",k._notFound=!0):k.status="notFound"),k.error=v,k.isFetching=!1)};b(),m||i==null||i();const w=ff(e,k);try{await _f(m?Promise.resolve().then(()=>Dd(w,x===sl?"errorComponent":"notFoundComponent")):Promise.all([Dd(w),Dd(w,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return B_(e,n),wu}m?c&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),B_(e,n),Ti(e,a),b()):k.status="success"}return n}async function GO(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let c=r;cw._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const w=await e3(e,t,void 0,i,u);t[u]._notFound=void 0,t[w]._notFound=!0,u=w}let h=u<0?t.length:u+1,_=0;for(;_{for(let w=m;w=Xi&&(h=0);k()}if(!i.aborted&&!r[3]){const w=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),w.push(C[1]));for(const y of w)y.abort()}const b=UO(e,s,p,r[0],EE(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=EE(s[2],void 0,void 0,b.then(w=>S0(w)?0:Rk(t).length,()=>0))),a=await b}catch(c){if(B_(e,s),c===i&&i.aborted)return wu;throw c}return S0(a)?a:GO(e,a,i,r[6]===t.length?r[6]:0)}function t3(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>t3(e,n),w);return}s[2]=0}const v=t.map(w=>({...w,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(w=>(w&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+x),w));return}}function $p(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function NE(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!Rk(n[3]).some(i=>i.id===t[1]))return;let s;try{await _f(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function KO(e,n){e._committed=n,e.stores.setMatches(n)}function fW(e,n,t,r){const s=e._committed,i=e._cache;for(const c of t)c.preload=!1,r&&(c._assetEnd=void 0);const a=Rk(t).length,o=new Map;{const c=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((_,p)=>_.id===u.id&&(p=(u.preload?h.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:h.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,KO(e,t),Ti(e,[...i.values(),...s],[...t,...o.values()]),rW(e,s,t,n)}async function Wg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function WO(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function dW(e,n,t,r,s){const i=t.map(c=>({...c}));Dk(i);for(const c of r)Jc(e,i[c[0]]),i[c[0]]=c[3];const a=[n[2],i];let o;try{o=await UO(e,a,r,n[0],s)}catch(c){throw Ti(e,i),c}if(S0(o)){Ti(e,i),o[0]===Xi&&e._tx===n&&e._committed===t&&await WO(e,n,o);return}if(await GO(e,o,n[0].signal),e._tx!==n||e._committed!==t){Ti(e,i);return}for(const c of i){const u=e._cache.get(c.id);u!=null&&u._flight&&u._flight===c._flight&&(e._cache.delete(c.id),Jc(e,u))}KO(e,i),Ti(e,t,i)}async function hW(e,n,t,r,s,i){const a=await VO(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(S0(a)){const _=a[0]===Xi&&e._tx===n;if((!_||a[1].options.reloadDocument)&&$p(e,n),Ti(e,n[3]),n[3]=[],!_)return;if(e._tx!==n){$p(e,n);return}await WO(e,n,a);return}const o=a[1];if(e._tx===n&&await NE(e,n),e._tx!==n){$p(e,n),Ti(e,o),B_(e,a);return}const c=n[2],u=kb(c,e.stores.resolvedLocation.get()),h=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await NE(e,n),e._tx!==n){$p(e,n),Ti(e,o),B_(e,a);return}const _=()=>{$p(e,n),fW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(_,o);if(e._tx!==n){B_(e,a);return}h!=null&&h.length&&dW(e,n,o,h,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function pW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,c=e._handoff,u=c==null?void 0:c[0](),h=new AbortController,_=e._preflight;if(e._preflight=h,u||c==null||c[1](),_==null||_.abort(),!h.signal.aborted){const N=kb(i,r);e.emit({type:"onBeforeNavigate",...N}),h.signal.aborted||e.emit({type:"onBeforeLoad",...N})}if(h.signal.aborted){await Wg(e,t);return}const p=s.href===i.href;let m=h;const x=e.matchRoutes(i,{_controller:h});Dk(x);const k=u?c[1](x):void 0;if(k?m=u:u==null||u.abort(),h.signal.aborted){Ti(e,x),await Wg(e,t);return}e._preflight=void 0;let v;const b=()=>hW(e,y,p,()=>t3(e,y),n==null?void 0:n.sync,k),w=n!=null&&n.sync?new Promise(N=>v=N):Promise.resolve().then(b).then(),y=[m,o,i,x,Date.now(),w];if(e._tx=y,t){for(const N of e.stores.matches.get()){if(e._tx!==y)break;N.isFetching&&E0(e,N,!1)}t[0].abort(),Ti(e,t[3],y[3],!0)}if(e._tx!==y){Ti(e,y[3]),y[3]=[],v==null||v(),await Wg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(k||!e._committed.length&&((C=x[0])==null?void 0:C.status)!=="success"&&!x.some(N=>N._notFound))&&t3(e,y),v==null||v(b()),await w,await Wg(e,y)}async function mW(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,c;try{try{a=e.matchRoutes(t,{_controller:i}),Dk(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),c=await VO(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),Ti(e,a)),i.abort()}if(!S0(c))return c[1];if(!o||c.length<3)return;t=c[2]}catch(u){_h(u)||console.error(u);return}}}const gW="Error preloading route! ☝️";var QO=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var c,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(c=this.options).getParentRoute)==null?void 0:u.call(c),r?this._path=Od:this.parentRoute||jk();let s=r?Od:t==null?void 0:t.path;s&&s!=="/"&&(s=BO(s));const i=(t==null?void 0:t.id)||s;let a=r?Od:F1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=F1(["/",a]));const o=a==="__root__"?"/":F1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=Zc(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>XK({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},vW=class extends QO{constructor(e){super(e)}},Ik=class extends A.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?A.createElement(this.props.errorComponent??bW,{error:e,reset:this.reset}):this.props.children}};function bW({error:e}){const[n,t]=A.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function yW({children:e,fallback:n=null}){return f.jsx(Je.Fragment,{children:XO()?e:n})}function XO(){return Je.useSyncExternalStore(xW,()=>!0,()=>!1)}function xW(){return()=>{}}var YO=A.createContext(null);function di(e){return A.useContext(YO)}var Cb=A.createContext(void 0),wW=A.createContext(void 0),Cr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Cr||{});function kW({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,h,_){const p=h.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:h.deps;if(m!==void 0&&m.dep===u){m.version=_,h.depsTail=m;return}const x=u.subsTail;if(x!==void 0&&x.version===_&&x.sub===h)return;const k=h.depsTail=u.subsTail={version:_,dep:u,sub:h,prevDep:p,nextDep:m,prevSub:x,nextSub:void 0};m!==void 0&&(m.prevDep=k),p!==void 0?p.nextDep=k:h.deps=k,x!==void 0?x.nextSub=k:u.subs=k}function s(u,h=u.sub){const _=u.dep,p=u.prevDep,m=u.nextDep,x=u.nextSub,k=u.prevSub;return m!==void 0?m.prevDep=p:h.depsTail=p,p!==void 0?p.nextDep=m:h.deps=m,x!==void 0?x.prevSub=k:_.subsTail=k,k!==void 0?k.nextSub=x:(_.subs=x)===void 0&&t(_),m}function i(u){let h=u.nextSub,_;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&c(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const x=p.subs;if(x!==void 0){const k=(u=x).nextSub;k!==void 0&&(_={value:h,prev:_},h=k);continue}}if((u=h)!==void 0){h=u.nextSub;continue}for(;_!==void 0;)if(u=_.value,_=_.prev,u!==void 0){h=u.nextSub;continue e}break}while(!0)}function a(u,h){let _,p=0,m=!1;e:do{const x=u.dep,k=x.flags;if(h.flags&16)m=!0;else if((k&17)===17){if(e(x)){const v=x.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((k&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(_={value:u,prev:_}),u=x.deps,h=x,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=h.subs,b=v.nextSub!==void 0;if(b?(u=_.value,_=_.prev):u=v,m){if(e(h)){b&&o(v),h=u.sub;continue}m=!1}else h.flags&=-33;h=u.sub;const w=u.nextDep;if(w!==void 0){u=w;continue e}}return m}while(!0)}function o(u){do{const h=u.sub,_=h.flags;(_&48)===32&&(h.flags=_|16,(_&6)===2&&n(h))}while((u=u.nextSub)!==void 0)}function c(u,h){let _=h.depsTail;for(;_!==void 0;){if(_===u)return!0;_=_.prevDep}return!1}}function SW(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const n3=[];let G1=0;const{link:zE,unlink:CW,propagate:EW,checkDirty:ZO,shallowPropagate:jE}=kW({update(e){return e._update()},notify(e){n3[r3++]=e,e.flags&=~Cr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Cr.Mutable|Cr.Dirty,xv(e))}});let Qg=0,r3=0,Bo,s3=0;function NW(e){try{++s3,e()}finally{--s3||JO()}}function xv(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=CW(t,e)}function JO(){if(!(s3>0)){for(;Qg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(i){const a=Bo,o=(n==null?void 0:n.compare)??Object.is;if(t)Bo=s,++G1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=Cr.Mutable|Cr.RecursedCheck);try{const c=s._snapshot,u=typeof i=="function"?i(c):i===void 0&&t?r(c):i;return c===void 0||!o(c,u)?(s._snapshot=u,!0):!1}finally{Bo=a,t&&(s.flags&=~Cr.RecursedCheck),xv(s)}}};return t?(s.flags=Cr.Mutable|Cr.Dirty,s.get=function(){const i=s.flags;if(i&Cr.Dirty||i&Cr.Pending&&ZO(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&jE(a)}}else i&Cr.Pending&&(s.flags=i&~Cr.Pending);return Bo!==void 0&&zE(s,Bo,G1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(EW(a),jE(a),JO())}},s}function zW(e){const n=()=>{const r=Bo;Bo=t,++G1,t.depsTail=void 0,t.flags=Cr.Watching|Cr.RecursedCheck;try{return e()}finally{Bo=r,t.flags&=~Cr.RecursedCheck,xv(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Cr.Watching|Cr.RecursedCheck,notify(){const r=this.flags;r&Cr.Dirty||r&Cr.Pending&&ZO(this.deps,this)?n():this.flags=Cr.Watching},stop(){this.flags=Cr.None,this.depsTail=void 0,xv(this)}};return n(),t}var F2={exports:{}},H2={},q2={exports:{}},U2={};/** +`+S.stack}}var Ze=Object.prototype.hasOwnProperty,ct=e.unstable_scheduleCallback,Ct=e.unstable_cancelCallback,qt=e.unstable_shouldYield,dt=e.unstable_requestPaint,ht=e.unstable_now,Le=e.unstable_getCurrentPriorityLevel,me=e.unstable_ImmediatePriority,Te=e.unstable_UserBlockingPriority,He=e.unstable_NormalPriority,nt=e.unstable_LowPriority,_t=e.unstable_IdlePriority,St=e.log,yt=e.unstable_setDisableYieldValue,Zt=null,un=null;function At(l){if(typeof St=="function"&&yt(l),un&&typeof un.setStrictMode=="function")try{un.setStrictMode(Zt,l)}catch{}}var pt=Math.clz32?Math.clz32:us,mt=Math.log,_n=Math.LN2;function us(l){return l>>>=0,l===0?32:31-(mt(l)/_n|0)|0}var xr=256,Qt=262144,Mn=4194304;function mr(l){var d=l&42;if(d!==0)return d;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function gr(l,d,g){var S=l.pendingLanes;if(S===0)return 0;var R=0,O=l.suspendedLanes,X=l.pingedLanes;l=l.warmLanes;var re=S&134217727;return re!==0?(S=re&~O,S!==0?R=mr(S):(X&=re,X!==0?R=mr(X):g||(g=re&~l,g!==0&&(R=mr(g))))):(re=S&~O,re!==0?R=mr(re):X!==0?R=mr(X):g||(g=S&~l,g!==0&&(R=mr(g)))),R===0?0:d!==0&&d!==R&&(d&O)===0&&(O=R&-R,g=d&-d,O>=g||O===32&&(g&4194048)!==0)?d:R}function _s(l,d){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&d)===0}function Et(l,d){switch(l){case 1:case 2:case 4:case 8:case 64:return d+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 d+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 fn(){var l=Mn;return Mn<<=1,(Mn&62914560)===0&&(Mn=4194304),l}function an(l){for(var d=[],g=0;31>g;g++)d.push(l);return d}function xn(l,d){l.pendingLanes|=d,d!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Ir(l,d,g,S,R,O){var X=l.pendingLanes;l.pendingLanes=g,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=g,l.entangledLanes&=g,l.errorRecoveryDisabledLanes&=g,l.shellSuspendCounter=0;var re=l.entanglements,de=l.expirationTimes,Se=l.hiddenUpdates;for(g=X&~g;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var Kr=/[\n"\\]/g;function Wr(l){return l.replace(Kr,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function Ui(l,d,g,S,R,O,X,re){l.name="",X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?l.type=X:l.removeAttribute("type"),d!=null?X==="number"?(d===0&&l.value===""||l.value!=d)&&(l.value=""+Ar(d)):l.value!==""+Ar(d)&&(l.value=""+Ar(d)):X!=="submit"&&X!=="reset"||l.removeAttribute("value"),d!=null?Fs(l,X,Ar(d)):g!=null?Fs(l,X,Ar(g)):S!=null&&l.removeAttribute("value"),R==null&&O!=null&&(l.defaultChecked=!!O),R!=null&&(l.checked=R&&typeof R!="function"&&typeof R!="symbol"),re!=null&&typeof re!="function"&&typeof re!="symbol"&&typeof re!="boolean"?l.name=""+Ar(re):l.removeAttribute("name")}function Gi(l,d,g,S,R,O,X,re){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(l.type=O),d!=null||g!=null){if(!(O!=="submit"&&O!=="reset"||d!=null)){vi(l);return}g=g!=null?""+Ar(g):"",d=d!=null?""+Ar(d):g,re||d===l.value||(l.value=d),l.defaultValue=d}S=S??R,S=typeof S!="function"&&typeof S!="symbol"&&!!S,l.checked=re?l.checked:!!S,l.defaultChecked=!!S,X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"&&(l.name=X),vi(l)}function Fs(l,d,g){d==="number"&&yi(l.ownerDocument)===l||l.defaultValue===""+g||(l.defaultValue=""+g)}function Rr(l,d,g,S){if(l=l.options,d){d={};for(var R=0;R"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ki=!1;if(fs)try{var ka={};Object.defineProperty(ka,"passive",{get:function(){Ki=!0}}),window.addEventListener("test",ka,ka),window.removeEventListener("test",ka,ka)}catch{Ki=!1}var pr=null,pc=null,sr=null;function Mf(){if(sr)return sr;var l,d=pc,g=d.length,S,R="value"in pr?pr.value:pr.textContent,O=R.length;for(l=0;l=Na),Tl=" ",Al=!1;function t_(l,d){switch(l){case"keyup":return Jh.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function If(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var za=!1;function Rl(l,d){switch(l){case"compositionend":return If(d);case"keypress":return d.which!==32?null:(Al=!0,Tl);case"textInput":return l=d.data,l===Tl&&Al?null:l;default:return null}}function n_(l,d){if(za)return l==="compositionend"||!zl&&t_(l,d)?(l=Mf(),sr=pc=pr=null,za=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1=d)return{node:g,offset:d-l};l=S}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=ge(g)}}function Ie(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?Ie(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function Pe(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var d=yi(l.document);d instanceof l.HTMLIFrameElement;){try{var g=typeof d.contentWindow.location.href=="string"}catch{g=!1}if(g)l=d.contentWindow;else break;d=yi(l.document)}return d}function Yt(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}var vn=fs&&"documentMode"in document&&11>=document.documentMode,hn=null,J=null,he=null,je=!1;function Be(l,d,g){var S=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;je||hn==null||hn!==yi(S)||(S=hn,"selectionStart"in S&&Yt(S)?S={start:S.selectionStart,end:S.selectionEnd}:(S=(S.ownerDocument&&S.ownerDocument.defaultView||window).getSelection(),S={anchorNode:S.anchorNode,anchorOffset:S.anchorOffset,focusNode:S.focusNode,focusOffset:S.focusOffset}),he&&te(he,S)||(he=S,S=jg(J,"onSelect"),0>=X,R-=X,Ro=1<<32-pt(d)+R|g<cn?(Nn=zt,zt=null):Nn=zt.sibling;var Pn=ze(we,zt,ke[cn],Fe);if(Pn===null){zt===null&&(zt=Nn);break}l&&zt&&Pn.alternate===null&&d(we,zt),ve=O(Pn,ve,cn),Bn===null?Pt=Pn:Bn.sibling=Pn,Bn=Pn,zt=Nn}if(cn===ke.length)return g(we,zt),jn&&Cc(we,cn),Pt;if(zt===null){for(;cncn?(Nn=zt,zt=null):Nn=zt.sibling;var su=ze(we,zt,Pn.value,Fe);if(su===null){zt===null&&(zt=Nn);break}l&&zt&&su.alternate===null&&d(we,zt),ve=O(su,ve,cn),Bn===null?Pt=su:Bn.sibling=su,Bn=su,zt=Nn}if(Pn.done)return g(we,zt),jn&&Cc(we,cn),Pt;if(zt===null){for(;!Pn.done;cn++,Pn=ke.next())Pn=qe(we,Pn.value,Fe),Pn!==null&&(ve=O(Pn,ve,cn),Bn===null?Pt=Pn:Bn.sibling=Pn,Bn=Pn);return jn&&Cc(we,cn),Pt}for(zt=S(zt);!Pn.done;cn++,Pn=ke.next())Pn=Re(zt,we,cn,Pn.value,Fe),Pn!==null&&(l&&Pn.alternate!==null&&zt.delete(Pn.key===null?cn:Pn.key),ve=O(Pn,ve,cn),Bn===null?Pt=Pn:Bn.sibling=Pn,Bn=Pn);return l&&zt.forEach(function(kV){return d(we,kV)}),jn&&Cc(we,cn),Pt}function or(we,ve,ke,Fe){if(typeof ke=="object"&&ke!==null&&ke.type===k&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var Pt=ke.key;ve!==null;){if(ve.key===Pt){if(Pt=ke.type,Pt===k){if(ve.tag===7){g(we,ve.sibling),Fe=R(ve,ke.props.children),Fe.return=we,we=Fe;break e}}else if(ve.elementType===Pt||typeof Pt=="object"&&Pt!==null&&Pt.$$typeof===j&&u_(Pt)===ve.type){g(we,ve.sibling),Fe=R(ve,ke.props),cp(Fe,ke),Fe.return=we,we=Fe;break e}g(we,ve);break}else d(we,ve);ve=ve.sibling}ke.type===k?(Fe=i_(ke.props.children,we.mode,Fe,ke.key),Fe.return=we,we=Fe):(Fe=Vm(ke.type,ke.key,ke.props,null,we.mode,Fe),cp(Fe,ke),Fe.return=we,we=Fe)}return X(we);case w:e:{for(Pt=ke.key;ve!==null;){if(ve.key===Pt)if(ve.tag===4&&ve.stateNode.containerInfo===ke.containerInfo&&ve.stateNode.implementation===ke.implementation){g(we,ve.sibling),Fe=R(ve,ke.children||[]),Fe.return=we,we=Fe;break e}else{g(we,ve);break}else d(we,ve);ve=ve.sibling}Fe=Zy(ke,we.mode,Fe),Fe.return=we,we=Fe}return X(we);case j:return ke=u_(ke),or(we,ve,ke,Fe)}if(Q(ke))return kt(we,ve,ke,Fe);if($(ke)){if(Pt=$(ke),typeof Pt!="function")throw Error(r(150));return ke=Pt.call(ke),Gt(we,ve,ke,Fe)}if(typeof ke.then=="function")return or(we,ve,Jm(ke),Fe);if(ke.$$typeof===y)return or(we,ve,Qm(we,ke),Fe);eg(we,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,ve!==null&&ve.tag===6?(g(we,ve.sibling),Fe=R(ve,ke),Fe.return=we,we=Fe):(g(we,ve),Fe=Yy(ke,we.mode,Fe),Fe.return=we,we=Fe),X(we)):g(we,ve)}return function(we,ve,ke,Fe){try{op=0;var Pt=or(we,ve,ke,Fe);return Qf=null,Pt}catch(zt){if(zt===Wf||zt===Ym)throw zt;var Bn=Xi(29,zt,null,we.mode);return Bn.lanes=Fe,Bn.return=we,Bn}finally{}}}var f_=JC(!0),e7=JC(!1),Fl=!1;function ux(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _x(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Hl(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function ql(l,d,g){var S=l.updateQueue;if(S===null)return null;if(S=S.shared,(qn&2)!==0){var R=S.pending;return R===null?d.next=d:(d.next=R.next,R.next=d),S.pending=d,d=Gm(l),np(l,null,g),d}return Br(l,S,d,g),Gm(l)}function lp(l,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194048)!==0)){var S=d.lanes;S&=l.pendingLanes,g|=S,d.lanes=g,gn(l,g)}}function fx(l,d){var g=l.updateQueue,S=l.alternate;if(S!==null&&(S=S.updateQueue,g===S)){var R=null,O=null;if(g=g.firstBaseUpdate,g!==null){do{var X={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};O===null?R=O=X:O=O.next=X,g=g.next}while(g!==null);O===null?R=O=d:O=O.next=d}else R=O=d;g={baseState:S.baseState,firstBaseUpdate:R,lastBaseUpdate:O,shared:S.shared,callbacks:S.callbacks},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=d:l.next=d,g.lastBaseUpdate=d}var dx=!1;function up(){if(dx){var l=Kf;if(l!==null)throw l}}function _p(l,d,g,S){dx=!1;var R=l.updateQueue;Fl=!1;var O=R.firstBaseUpdate,X=R.lastBaseUpdate,re=R.shared.pending;if(re!==null){R.shared.pending=null;var de=re,Se=de.next;de.next=null,X===null?O=Se:X.next=Se,X=de;var $e=l.alternate;$e!==null&&($e=$e.updateQueue,re=$e.lastBaseUpdate,re!==X&&(re===null?$e.firstBaseUpdate=Se:re.next=Se,$e.lastBaseUpdate=de))}if(O!==null){var qe=R.baseState;X=0,$e=Se=de=null,re=O;do{var ze=re.lane&-536870913,Re=ze!==re.lane;if(Re?(En&ze)===ze:(S&ze)===ze){ze!==0&&ze===Vf&&(dx=!0),$e!==null&&($e=$e.next={lane:0,tag:re.tag,payload:re.payload,callback:null,next:null});e:{var kt=l,Gt=re;ze=d;var or=g;switch(Gt.tag){case 1:if(kt=Gt.payload,typeof kt=="function"){qe=kt.call(or,qe,ze);break e}qe=kt;break e;case 3:kt.flags=kt.flags&-65537|128;case 0:if(kt=Gt.payload,ze=typeof kt=="function"?kt.call(or,qe,ze):kt,ze==null)break e;qe=_({},qe,ze);break e;case 2:Fl=!0}}ze=re.callback,ze!==null&&(l.flags|=64,Re&&(l.flags|=8192),Re=R.callbacks,Re===null?R.callbacks=[ze]:Re.push(ze))}else Re={lane:ze,tag:re.tag,payload:re.payload,callback:re.callback,next:null},$e===null?(Se=$e=Re,de=qe):$e=$e.next=Re,X|=ze;if(re=re.next,re===null){if(re=R.shared.pending,re===null)break;Re=re,re=Re.next,Re.next=null,R.lastBaseUpdate=Re,R.shared.pending=null}}while(!0);$e===null&&(de=qe),R.baseState=de,R.firstBaseUpdate=Se,R.lastBaseUpdate=$e,O===null&&(R.shared.lanes=0),Wl|=X,l.lanes=X,l.memoizedState=qe}}function t7(l,d){if(typeof l!="function")throw Error(r(191,l));l.call(d)}function n7(l,d){var g=l.callbacks;if(g!==null)for(l.callbacks=null,l=0;lO?O:8;var X=V.T,re={};V.T=re,Rx(l,!1,d,g);try{var de=R(),Se=V.S;if(Se!==null&&Se(re,de),de!==null&&typeof de=="object"&&typeof de.then=="function"){var $e=fG(de,S);hp(l,d,$e,ta(l))}else hp(l,d,S,ta(l))}catch(qe){hp(l,d,{then:function(){},status:"rejected",reason:qe},ta())}finally{Z.p=O,X!==null&&re.types!==null&&(X.types=re.types),V.T=X}}function vG(){}function Tx(l,d,g,S){if(l.tag!==5)throw Error(r(476));var R=O7(l).queue;M7(l,R,d,Y,g===null?vG:function(){return D7(l),g(S)})}function O7(l){var d=l.memoizedState;if(d!==null)return d;d={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jc,lastRenderedState:Y},next:null};var g={};return d.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jc,lastRenderedState:g},next:null},l.memoizedState=d,l=l.alternate,l!==null&&(l.memoizedState=d),d}function D7(l){var d=O7(l);d.next===null&&(d=l.alternate.memoizedState),hp(l,d.next.queue,{},ta())}function Ax(){return Ls(Ap)}function L7(){return Xr().memoizedState}function I7(){return Xr().memoizedState}function bG(l){for(var d=l.return;d!==null;){switch(d.tag){case 24:case 3:var g=ta();l=Hl(g);var S=ql(d,l,g);S!==null&&(Mi(S,d,g),lp(S,d,g)),d={cache:ax()},l.payload=d;return}d=d.return}}function yG(l,d,g){var S=ta();g={lane:S,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},ug(l)?B7(d,g):(g=Ll(l,d,g,S),g!==null&&(Mi(g,l,S),P7(g,d,S)))}function $7(l,d,g){var S=ta();hp(l,d,g,S)}function hp(l,d,g,S){var R={lane:S,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(ug(l))B7(d,R);else{var O=l.alternate;if(l.lanes===0&&(O===null||O.lanes===0)&&(O=d.lastRenderedReducer,O!==null))try{var X=d.lastRenderedState,re=O(X,g);if(R.hasEagerState=!0,R.eagerState=re,$r(re,X))return Br(l,d,R,0),lr===null&&Ta(),!1}catch{}finally{}if(g=Ll(l,d,R,S),g!==null)return Mi(g,l,S),P7(g,d,S),!0}return!1}function Rx(l,d,g,S){if(S={lane:2,revertLane:u2(),gesture:null,action:S,hasEagerState:!1,eagerState:null,next:null},ug(l)){if(d)throw Error(r(479))}else d=Ll(l,g,S,2),d!==null&&Mi(d,l,2)}function ug(l){var d=l.alternate;return l===sn||d!==null&&d===sn}function B7(l,d){Yf=rg=!0;var g=l.pending;g===null?d.next=d:(d.next=g.next,g.next=d),l.pending=d}function P7(l,d,g){if((g&4194048)!==0){var S=d.lanes;S&=l.pendingLanes,g|=S,d.lanes=g,gn(l,g)}}var pp={readContext:Ls,use:ag,useCallback:Pr,useContext:Pr,useEffect:Pr,useImperativeHandle:Pr,useLayoutEffect:Pr,useInsertionEffect:Pr,useMemo:Pr,useReducer:Pr,useRef:Pr,useState:Pr,useDebugValue:Pr,useDeferredValue:Pr,useTransition:Pr,useSyncExternalStore:Pr,useId:Pr,useHostTransitionStatus:Pr,useFormState:Pr,useActionState:Pr,useOptimistic:Pr,useMemoCache:Pr,useCacheRefresh:Pr};pp.useEffectEvent=Pr;var F7={readContext:Ls,use:ag,useCallback:function(l,d){return oi().memoizedState=[l,d===void 0?null:d],l},useContext:Ls,useEffect:S7,useImperativeHandle:function(l,d,g){g=g!=null?g.concat([l]):null,cg(4194308,4,z7.bind(null,d,l),g)},useLayoutEffect:function(l,d){return cg(4194308,4,l,d)},useInsertionEffect:function(l,d){cg(4,2,l,d)},useMemo:function(l,d){var g=oi();d=d===void 0?null:d;var S=l();if(d_){At(!0);try{l()}finally{At(!1)}}return g.memoizedState=[S,d],S},useReducer:function(l,d,g){var S=oi();if(g!==void 0){var R=g(d);if(d_){At(!0);try{g(d)}finally{At(!1)}}}else R=d;return S.memoizedState=S.baseState=R,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:R},S.queue=l,l=l.dispatch=yG.bind(null,sn,l),[S.memoizedState,l]},useRef:function(l){var d=oi();return l={current:l},d.memoizedState=l},useState:function(l){l=Cx(l);var d=l.queue,g=$7.bind(null,sn,d);return d.dispatch=g,[l.memoizedState,g]},useDebugValue:zx,useDeferredValue:function(l,d){var g=oi();return jx(g,l,d)},useTransition:function(){var l=Cx(!1);return l=M7.bind(null,sn,l.queue,!0,!1),oi().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,d,g){var S=sn,R=oi();if(jn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=d(),lr===null)throw Error(r(349));(En&127)!==0||c7(S,d,g)}R.memoizedState=g;var O={value:g,getSnapshot:d};return R.queue=O,S7(u7.bind(null,S,O,l),[l]),S.flags|=2048,Jf(9,{destroy:void 0},l7.bind(null,S,O,g,d),null),g},useId:function(){var l=oi(),d=lr.identifierPrefix;if(jn){var g=Mo,S=Ro;g=(S&~(1<<32-pt(S)-1)).toString(32)+g,d="_"+d+"R_"+g,g=sg++,0<\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof S.is=="string"?X.createElement("select",{is:S.is}):X.createElement("select"),S.multiple?O.multiple=!0:S.size&&(O.size=S.size);break;default:O=typeof S.is=="string"?X.createElement(R,{is:S.is}):X.createElement(R)}}O[On]=d,O[hr]=S;e:for(X=d.child;X!==null;){if(X.tag===5||X.tag===6)O.appendChild(X.stateNode);else if(X.tag!==4&&X.tag!==27&&X.child!==null){X.child.return=X,X=X.child;continue}if(X===d)break e;for(;X.sibling===null;){if(X.return===null||X.return===d)break e;X=X.return}X.sibling.return=X.return,X=X.sibling}d.stateNode=O;e:switch($s(O,R,S),R){case"button":case"input":case"select":case"textarea":S=!!S.autoFocus;break e;case"img":S=!0;break e;default:S=!1}S&&Ac(d)}}return br(d),Vx(d,d.type,l===null?null:l.memoizedProps,d.pendingProps,g),null;case 6:if(l&&d.stateNode!=null)l.memoizedProps!==S&&Ac(d);else{if(typeof S!="string"&&d.stateNode===null)throw Error(r(166));if(l=ue.current,Uf(d)){if(l=d.stateNode,g=d.memoizedProps,S=null,R=Ds,R!==null)switch(R.tag){case 27:case 5:S=R.memoizedProps}l[On]=d,l=!!(l.nodeValue===g||S!==null&&S.suppressHydrationWarning===!0||a9(l.nodeValue,g)),l||Bl(d,!0)}else l=Tg(l).createTextNode(S),l[On]=d,d.stateNode=l}return br(d),null;case 31:if(g=d.memoizedState,l===null||l.memoizedState!==null){if(S=Uf(d),g!==null){if(l===null){if(!S)throw Error(r(318));if(l=d.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(557));l[On]=d}else a_(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;br(d),l=!1}else g=nx(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),l=!0;if(!l)return d.flags&256?(Zi(d),d):(Zi(d),null);if((d.flags&128)!==0)throw Error(r(558))}return br(d),null;case 13:if(S=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(R=Uf(d),S!==null&&S.dehydrated!==null){if(l===null){if(!R)throw Error(r(318));if(R=d.memoizedState,R=R!==null?R.dehydrated:null,!R)throw Error(r(317));R[On]=d}else a_(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;br(d),R=!1}else R=nx(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=R),R=!0;if(!R)return d.flags&256?(Zi(d),d):(Zi(d),null)}return Zi(d),(d.flags&128)!==0?(d.lanes=g,d):(g=S!==null,l=l!==null&&l.memoizedState!==null,g&&(S=d.child,R=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(R=S.alternate.memoizedState.cachePool.pool),O=null,S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(O=S.memoizedState.cachePool.pool),O!==R&&(S.flags|=2048)),g!==l&&g&&(d.child.flags|=8192),pg(d,d.updateQueue),br(d),null);case 4:return ae(),l===null&&h2(d.stateNode.containerInfo),br(d),null;case 10:return Nc(d.type),br(d),null;case 19:if(U(Qr),S=d.memoizedState,S===null)return br(d),null;if(R=(d.flags&128)!==0,O=S.rendering,O===null)if(R)gp(S,!1);else{if(Fr!==0||l!==null&&(l.flags&128)!==0)for(l=d.child;l!==null;){if(O=ng(l),O!==null){for(d.flags|=128,gp(S,!1),l=O.updateQueue,d.updateQueue=l,pg(d,l),d.subtreeFlags=0,l=g,g=d.child;g!==null;)$C(g,l),g=g.sibling;return K(Qr,Qr.current&1|2),jn&&Cc(d,S.treeForkCount),d.child}l=l.sibling}S.tail!==null&&ht()>yg&&(d.flags|=128,R=!0,gp(S,!1),d.lanes=4194304)}else{if(!R)if(l=ng(O),l!==null){if(d.flags|=128,R=!0,l=l.updateQueue,d.updateQueue=l,pg(d,l),gp(S,!0),S.tail===null&&S.tailMode==="hidden"&&!O.alternate&&!jn)return br(d),null}else 2*ht()-S.renderingStartTime>yg&&g!==536870912&&(d.flags|=128,R=!0,gp(S,!1),d.lanes=4194304);S.isBackwards?(O.sibling=d.child,d.child=O):(l=S.last,l!==null?l.sibling=O:d.child=O,S.last=O)}return S.tail!==null?(l=S.tail,S.rendering=l,S.tail=l.sibling,S.renderingStartTime=ht(),l.sibling=null,g=Qr.current,K(Qr,R?g&1|2:g&1),jn&&Cc(d,S.treeForkCount),l):(br(d),null);case 22:case 23:return Zi(d),px(),S=d.memoizedState!==null,l!==null?l.memoizedState!==null!==S&&(d.flags|=8192):S&&(d.flags|=8192),S?(g&536870912)!==0&&(d.flags&128)===0&&(br(d),d.subtreeFlags&6&&(d.flags|=8192)):br(d),g=d.updateQueue,g!==null&&pg(d,g.retryQueue),g=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),S=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(S=d.memoizedState.cachePool.pool),S!==g&&(d.flags|=2048),l!==null&&U(l_),null;case 24:return g=null,l!==null&&(g=l.memoizedState.cache),d.memoizedState.cache!==g&&(d.flags|=2048),Nc(ts),br(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function CG(l,d){switch(ex(d),d.tag){case 1:return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return Nc(ts),ae(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 26:case 27:case 5:return pe(d),null;case 31:if(d.memoizedState!==null){if(Zi(d),d.alternate===null)throw Error(r(340));a_()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 13:if(Zi(d),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(r(340));a_()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return U(Qr),null;case 4:return ae(),null;case 10:return Nc(d.type),null;case 22:case 23:return Zi(d),px(),l!==null&&U(l_),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 24:return Nc(ts),null;case 25:return null;default:return null}}function _8(l,d){switch(ex(d),d.tag){case 3:Nc(ts),ae();break;case 26:case 27:case 5:pe(d);break;case 4:ae();break;case 31:d.memoizedState!==null&&Zi(d);break;case 13:Zi(d);break;case 19:U(Qr);break;case 10:Nc(d.type);break;case 22:case 23:Zi(d),px(),l!==null&&U(l_);break;case 24:Nc(ts)}}function vp(l,d){try{var g=d.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var R=S.next;g=R;do{if((g.tag&l)===l){S=void 0;var O=g.create,X=g.inst;S=O(),X.destroy=S}g=g.next}while(g!==R)}}catch(re){tr(d,d.return,re)}}function Vl(l,d,g){try{var S=d.updateQueue,R=S!==null?S.lastEffect:null;if(R!==null){var O=R.next;S=O;do{if((S.tag&l)===l){var X=S.inst,re=X.destroy;if(re!==void 0){X.destroy=void 0,R=d;var de=g,Se=re;try{Se()}catch($e){tr(R,de,$e)}}}S=S.next}while(S!==O)}}catch($e){tr(d,d.return,$e)}}function f8(l){var d=l.updateQueue;if(d!==null){var g=l.stateNode;try{n7(d,g)}catch(S){tr(l,l.return,S)}}}function d8(l,d,g){g.props=h_(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(S){tr(l,d,S)}}function bp(l,d){try{var g=l.ref;if(g!==null){switch(l.tag){case 26:case 27:case 5:var S=l.stateNode;break;case 30:S=l.stateNode;break;default:S=l.stateNode}typeof g=="function"?l.refCleanup=g(S):g.current=S}}catch(R){tr(l,d,R)}}function Oo(l,d){var g=l.ref,S=l.refCleanup;if(g!==null)if(typeof S=="function")try{S()}catch(R){tr(l,d,R)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(R){tr(l,d,R)}else g.current=null}function h8(l){var d=l.type,g=l.memoizedProps,S=l.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":g.autoFocus&&S.focus();break e;case"img":g.src?S.src=g.src:g.srcSet&&(S.srcset=g.srcSet)}}catch(R){tr(l,l.return,R)}}function Kx(l,d,g){try{var S=l.stateNode;KG(S,l.type,g,d),S[hr]=d}catch(R){tr(l,l.return,R)}}function p8(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&Jl(l.type)||l.tag===4}function Wx(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||p8(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&Jl(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Qx(l,d,g){var S=l.tag;if(S===5||S===6)l=l.stateNode,d?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(l,d):(d=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,d.appendChild(l),g=g._reactRootContainer,g!=null||d.onclick!==null||(d.onclick=Hs));else if(S!==4&&(S===27&&Jl(l.type)&&(g=l.stateNode,d=null),l=l.child,l!==null))for(Qx(l,d,g),l=l.sibling;l!==null;)Qx(l,d,g),l=l.sibling}function mg(l,d,g){var S=l.tag;if(S===5||S===6)l=l.stateNode,d?g.insertBefore(l,d):g.appendChild(l);else if(S!==4&&(S===27&&Jl(l.type)&&(g=l.stateNode),l=l.child,l!==null))for(mg(l,d,g),l=l.sibling;l!==null;)mg(l,d,g),l=l.sibling}function m8(l){var d=l.stateNode,g=l.memoizedProps;try{for(var S=l.type,R=d.attributes;R.length;)d.removeAttributeNode(R[0]);$s(d,S,g),d[On]=l,d[hr]=g}catch(O){tr(l,l.return,O)}}var Rc=!1,ss=!1,Xx=!1,g8=typeof WeakSet=="function"?WeakSet:Set,js=null;function EG(l,d){if(l=l.containerInfo,g2=Ig,l=Pe(l),Yt(l)){if("selectionStart"in l)var g={start:l.selectionStart,end:l.selectionEnd};else e:{g=(g=l.ownerDocument)&&g.defaultView||window;var S=g.getSelection&&g.getSelection();if(S&&S.rangeCount!==0){g=S.anchorNode;var R=S.anchorOffset,O=S.focusNode;S=S.focusOffset;try{g.nodeType,O.nodeType}catch{g=null;break e}var X=0,re=-1,de=-1,Se=0,$e=0,qe=l,ze=null;t:for(;;){for(var Re;qe!==g||R!==0&&qe.nodeType!==3||(re=X+R),qe!==O||S!==0&&qe.nodeType!==3||(de=X+S),qe.nodeType===3&&(X+=qe.nodeValue.length),(Re=qe.firstChild)!==null;)ze=qe,qe=Re;for(;;){if(qe===l)break t;if(ze===g&&++Se===R&&(re=X),ze===O&&++$e===S&&(de=X),(Re=qe.nextSibling)!==null)break;qe=ze,ze=qe.parentNode}qe=Re}g=re===-1||de===-1?null:{start:re,end:de}}else g=null}g=g||{start:0,end:0}}else g=null;for(v2={focusedElem:l,selectionRange:g},Ig=!1,js=d;js!==null;)if(d=js,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,js=l;else for(;js!==null;){switch(d=js,O=d.alternate,l=d.flags,d.tag){case 0:if((l&4)!==0&&(l=d.updateQueue,l=l!==null?l.events:null,l!==null))for(g=0;g title"))),$s(O,S,g),O[On]=l,cr(O),S=O;break e;case"link":var X=k9("link","href",R).get(S+(g.href||""));if(X){for(var re=0;reor&&(X=or,or=Gt,Gt=X);var we=Ee(re,Gt),ve=Ee(re,or);if(we&&ve&&(Re.rangeCount!==1||Re.anchorNode!==we.node||Re.anchorOffset!==we.offset||Re.focusNode!==ve.node||Re.focusOffset!==ve.offset)){var ke=qe.createRange();ke.setStart(we.node,we.offset),Re.removeAllRanges(),Gt>or?(Re.addRange(ke),Re.extend(ve.node,ve.offset)):(ke.setEnd(ve.node,ve.offset),Re.addRange(ke))}}}}for(qe=[],Re=re;Re=Re.parentNode;)Re.nodeType===1&&qe.push({element:Re,left:Re.scrollLeft,top:Re.scrollTop});for(typeof re.focus=="function"&&re.focus(),re=0;reg?32:g,V.T=null,g=r2,r2=null;var O=Xl,X=Ic;if(ms=0,sd=Xl=null,Ic=0,(qn&6)!==0)throw Error(r(331));var re=qn;if(qn|=4,z8(O.current),C8(O,O.current,X,g),qn=re,Cp(0,!1),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(Zt,O)}catch{}return!0}finally{Z.p=R,V.T=S,V8(l,d)}}function W8(l,d,g){d=Aa(g,d),d=Lx(l.stateNode,d,2),l=ql(l,d,2),l!==null&&(xn(l,2),Do(l))}function tr(l,d,g){if(l.tag===3)W8(l,l,g);else for(;d!==null;){if(d.tag===3){W8(d,l,g);break}else if(d.tag===1){var S=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(Ql===null||!Ql.has(S))){l=Aa(g,l),g=Q7(2),S=ql(d,g,2),S!==null&&(X7(g,S,d,l),xn(S,2),Do(S));break}}d=d.return}}function o2(l,d,g){var S=l.pingCache;if(S===null){S=l.pingCache=new jG;var R=new Set;S.set(d,R)}else R=S.get(d),R===void 0&&(R=new Set,S.set(d,R));R.has(g)||(Jx=!0,R.add(g),l=OG.bind(null,l,d,g),d.then(l,l))}function OG(l,d,g){var S=l.pingCache;S!==null&&S.delete(d),l.pingedLanes|=l.suspendedLanes&g,l.warmLanes&=~g,lr===l&&(En&g)===g&&(Fr===4||Fr===3&&(En&62914560)===En&&300>ht()-bg?(qn&2)===0&&id(l,0):e2|=g,rd===En&&(rd=0)),Do(l)}function Q8(l,d){d===0&&(d=fn()),l=Jn(l,d),l!==null&&(xn(l,d),Do(l))}function DG(l){var d=l.memoizedState,g=0;d!==null&&(g=d.retryLane),Q8(l,g)}function LG(l,d){var g=0;switch(l.tag){case 31:case 13:var S=l.stateNode,R=l.memoizedState;R!==null&&(g=R.retryLane);break;case 19:S=l.stateNode;break;case 22:S=l.stateNode._retryCache;break;default:throw Error(r(314))}S!==null&&S.delete(d),Q8(l,g)}function IG(l,d){return ct(l,d)}var Eg=null,od=null,c2=!1,Ng=!1,l2=!1,Zl=0;function Do(l){l!==od&&l.next===null&&(od===null?Eg=od=l:od=od.next=l),Ng=!0,c2||(c2=!0,BG())}function Cp(l,d){if(!l2&&Ng){l2=!0;do for(var g=!1,S=Eg;S!==null;){if(l!==0){var R=S.pendingLanes;if(R===0)var O=0;else{var X=S.suspendedLanes,re=S.pingedLanes;O=(1<<31-pt(42|l)+1)-1,O&=R&~(X&~re),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(g=!0,J8(S,O))}else O=En,O=gr(S,S===lr?O:0,S.cancelPendingCommit!==null||S.timeoutHandle!==-1),(O&3)===0||_s(S,O)||(g=!0,J8(S,O));S=S.next}while(g);l2=!1}}function $G(){X8()}function X8(){Ng=c2=!1;var l=0;Zl!==0&&QG()&&(l=Zl);for(var d=ht(),g=null,S=Eg;S!==null;){var R=S.next,O=Y8(S,d);O===0?(S.next=null,g===null?Eg=R:g.next=R,R===null&&(od=g)):(g=S,(l!==0||(O&3)!==0)&&(Ng=!0)),S=R}ms!==0&&ms!==5||Cp(l),Zl!==0&&(Zl=0)}function Y8(l,d){for(var g=l.suspendedLanes,S=l.pingedLanes,R=l.expirationTimes,O=l.pendingLanes&-62914561;0re)break;var $e=de.transferSize,qe=de.initiatorType;$e&&o9(qe)&&(de=de.responseEnd,X+=$e*(de"u"?null:document;function b9(l,d,g){var S=cd;if(S&&typeof d=="string"&&d){var R=Wr(d);R='link[rel="'+l+'"][href="'+R+'"]',typeof g=="string"&&(R+='[crossorigin="'+g+'"]'),v9.has(R)||(v9.add(R),l={rel:l,crossOrigin:g,href:d},S.querySelector(R)===null&&(d=S.createElement("link"),$s(d,"link",l),cr(d),S.head.appendChild(d)))}}function sV(l){$c.D(l),b9("dns-prefetch",l,null)}function iV(l,d){$c.C(l,d),b9("preconnect",l,d)}function aV(l,d,g){$c.L(l,d,g);var S=cd;if(S&&l&&d){var R='link[rel="preload"][as="'+Wr(d)+'"]';d==="image"&&g&&g.imageSrcSet?(R+='[imagesrcset="'+Wr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(R+='[imagesizes="'+Wr(g.imageSizes)+'"]')):R+='[href="'+Wr(l)+'"]';var O=R;switch(d){case"style":O=ld(l);break;case"script":O=ud(l)}Ia.has(O)||(l=_({rel:"preload",href:d==="image"&&g&&g.imageSrcSet?void 0:l,as:d},g),Ia.set(O,l),S.querySelector(R)!==null||d==="style"&&S.querySelector(jp(O))||d==="script"&&S.querySelector(Tp(O))||(d=S.createElement("link"),$s(d,"link",l),cr(d),S.head.appendChild(d)))}}function oV(l,d){$c.m(l,d);var g=cd;if(g&&l){var S=d&&typeof d.as=="string"?d.as:"script",R='link[rel="modulepreload"][as="'+Wr(S)+'"][href="'+Wr(l)+'"]',O=R;switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=ud(l)}if(!Ia.has(O)&&(l=_({rel:"modulepreload",href:l},d),Ia.set(O,l),g.querySelector(R)===null)){switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(Tp(O)))return}S=g.createElement("link"),$s(S,"link",l),cr(S),g.head.appendChild(S)}}}function cV(l,d,g){$c.S(l,d,g);var S=cd;if(S&&l){var R=Tr(S).hoistableStyles,O=ld(l);d=d||"default";var X=R.get(O);if(!X){var re={loading:0,preload:null};if(X=S.querySelector(jp(O)))re.loading=5;else{l=_({rel:"stylesheet",href:l,"data-precedence":d},g),(g=Ia.get(O))&&C2(l,g);var de=X=S.createElement("link");cr(de),$s(de,"link",l),de._p=new Promise(function(Se,$e){de.onload=Se,de.onerror=$e}),de.addEventListener("load",function(){re.loading|=1}),de.addEventListener("error",function(){re.loading|=2}),re.loading|=4,Rg(X,d,S)}X={type:"stylesheet",instance:X,count:1,state:re},R.set(O,X)}}}function lV(l,d){$c.X(l,d);var g=cd;if(g&&l){var S=Tr(g).hoistableScripts,R=ud(l),O=S.get(R);O||(O=g.querySelector(Tp(R)),O||(l=_({src:l,async:!0},d),(d=Ia.get(R))&&E2(l,d),O=g.createElement("script"),cr(O),$s(O,"link",l),g.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},S.set(R,O))}}function uV(l,d){$c.M(l,d);var g=cd;if(g&&l){var S=Tr(g).hoistableScripts,R=ud(l),O=S.get(R);O||(O=g.querySelector(Tp(R)),O||(l=_({src:l,async:!0,type:"module"},d),(d=Ia.get(R))&&E2(l,d),O=g.createElement("script"),cr(O),$s(O,"link",l),g.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},S.set(R,O))}}function y9(l,d,g,S){var R=(R=ue.current)?Ag(R):null;if(!R)throw Error(r(446));switch(l){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(d=ld(g.href),g=Tr(R).hoistableStyles,S=g.get(d),S||(S={type:"style",instance:null,count:0,state:null},g.set(d,S)),S):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){l=ld(g.href);var O=Tr(R).hoistableStyles,X=O.get(l);if(X||(R=R.ownerDocument||R,X={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(l,X),(O=R.querySelector(jp(l)))&&!O._p&&(X.instance=O,X.state.loading=5),Ia.has(l)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},Ia.set(l,g),O||_V(R,l,g,X.state))),d&&S===null)throw Error(r(528,""));return X}if(d&&S!==null)throw Error(r(529,""));return null;case"script":return d=g.async,g=g.src,typeof g=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=ud(g),g=Tr(R).hoistableScripts,S=g.get(d),S||(S={type:"script",instance:null,count:0,state:null},g.set(d,S)),S):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,l))}}function ld(l){return'href="'+Wr(l)+'"'}function jp(l){return'link[rel="stylesheet"]['+l+"]"}function x9(l){return _({},l,{"data-precedence":l.precedence,precedence:null})}function _V(l,d,g,S){l.querySelector('link[rel="preload"][as="style"]['+d+"]")?S.loading=1:(d=l.createElement("link"),S.preload=d,d.addEventListener("load",function(){return S.loading|=1}),d.addEventListener("error",function(){return S.loading|=2}),$s(d,"link",g),cr(d),l.head.appendChild(d))}function ud(l){return'[src="'+Wr(l)+'"]'}function Tp(l){return"script[async]"+l}function w9(l,d,g){if(d.count++,d.instance===null)switch(d.type){case"style":var S=l.querySelector('style[data-href~="'+Wr(g.href)+'"]');if(S)return d.instance=S,cr(S),S;var R=_({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return S=(l.ownerDocument||l).createElement("style"),cr(S),$s(S,"style",R),Rg(S,g.precedence,l),d.instance=S;case"stylesheet":R=ld(g.href);var O=l.querySelector(jp(R));if(O)return d.state.loading|=4,d.instance=O,cr(O),O;S=x9(g),(R=Ia.get(R))&&C2(S,R),O=(l.ownerDocument||l).createElement("link"),cr(O);var X=O;return X._p=new Promise(function(re,de){X.onload=re,X.onerror=de}),$s(O,"link",S),d.state.loading|=4,Rg(O,g.precedence,l),d.instance=O;case"script":return O=ud(g.src),(R=l.querySelector(Tp(O)))?(d.instance=R,cr(R),R):(S=g,(R=Ia.get(O))&&(S=_({},g),E2(S,R)),l=l.ownerDocument||l,R=l.createElement("script"),cr(R),$s(R,"link",S),l.head.appendChild(R),d.instance=R);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(S=d.instance,d.state.loading|=4,Rg(S,g.precedence,l));return d.instance}function Rg(l,d,g){for(var S=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),R=S.length?S[S.length-1]:null,O=R,X=0;X title"):null)}function fV(l,d,g){if(g===1||d.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;switch(d.rel){case"stylesheet":return l=d.disabled,typeof d.precedence=="string"&&l==null;default:return!0}case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function C9(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function dV(l,d,g,S){if(g.type==="stylesheet"&&(typeof S.media!="string"||matchMedia(S.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var R=ld(S.href),O=d.querySelector(jp(R));if(O){d=O._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(l.count++,l=Og.bind(l),d.then(l,l)),g.state.loading|=4,g.instance=O,cr(O);return}O=d.ownerDocument||d,S=x9(S),(R=Ia.get(R))&&C2(S,R),O=O.createElement("link"),cr(O);var X=O;X._p=new Promise(function(re,de){X.onload=re,X.onerror=de}),$s(O,"link",S),g.instance=O}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(g,d),(d=g.state.preload)&&(g.state.loading&3)===0&&(l.count++,g=Og.bind(l),d.addEventListener("load",g),d.addEventListener("error",g))}}var N2=0;function hV(l,d){return l.stylesheets&&l.count===0&&Lg(l,l.stylesheets),0N2?50:800)+d);return l.unsuspend=g,function(){l.unsuspend=null,clearTimeout(S),clearTimeout(R)}}:null}function Og(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lg(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Dg=null;function Lg(l,d){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Dg=new Map,d.forEach(pV,l),Dg=null,Og.call(l))}function pV(l,d){if(!(d.state.loading&4)){var g=Dg.get(l);if(g)var S=g.get(null);else{g=new Map,Dg.set(l,g);for(var R=l.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),I2.exports=dK(),I2.exports}var pK=hK();const mK=!1;var MO=A.useLayoutEffect;function gK(e,n,t){A.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function vK(e){const n=A.useRef(null);return A.useImperativeHandle(e,()=>n.current,[]),n}function S0(e){return e[e.length-1]}function _h(e,n){return typeof e=="function"?e(n):e}const OO=Object.prototype.hasOwnProperty,bK=Object.prototype.propertyIsEnumerable;function DO(e){for(const n in e)if(OO.call(e,n))return!0;return!1}const yK=()=>Object.create(null),g_=(e,n)=>T_(e,n,yK);function T_(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=uE(e)&&uE(s);if(!i&&!(pv(e)&&pv(s)))return s;const a=i?e:cE(e);if(!a)return s;const o=i?s:cE(s);if(!o)return s;const c=a.length,u=o.length,h=i?new Array(u):t();let _=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!lE(t)||!t.hasOwnProperty("isPrototypeOf"))}function lE(e){return Object.prototype.toString.call(e)==="[object Object]"}function uE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function zu(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!zu(e[a],n[a],t)))return!1;return s===i}return!1}const xK=/[\x00-\x1f\x7f"<>`{}]/g;function wK(e){return e.replace(xK,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function _E(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return wK(n)}const kK=["http:","https:","mailto:","tel:"];function mv(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function $p(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=_E(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+_E(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function SK(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function CK(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const c=t;n.delete(c.key),c.next&&(t=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const c={key:i,value:a,prev:r};r&&(r.next=c),r=c,t||(t=c),n.set(i,c)}},clear(){n.clear(),t=void 0,r=void 0}}}const Cu=4,LO=5;function IO(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const c=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=c,t[4]=c,t[5]=c,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!I.parse&&I.caseSensitive===j&&I.prefix===E&&I.suffix===T));if(D)x=D;else{const I=EK(z,_,j,E,T);x=I,I.parent=s,I.depth=i;let $;z===1?$=s.dynamic??(s.dynamic=[]):z===3?$=s.optional??(s.optional=[]):$=s.wildcard??(s.wildcard=[]),$.push(I),$.length===2&&(a==null||a.push($))}break}}s=x}if(k&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=Md(_);b.kind=LO,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&_.endsWith("/")){const b=Md(_);b.kind=Cu,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=k??null,s.priority=((h=p==null?void 0:p.params)==null?void 0:h.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=_)}if(t.children)for(const _ of t.children)kb(e,n,_,c,s,i,a,o)}function $O(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function Md(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function EK(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function NK(e,n){const t=Md("/"),r=new Uint16Array(6),s=[];for(const i of e)kb(!1,r,i,1,t,0,s);for(const i of s)i.sort($O);n.masksTree=t,n.flatCache=gv(1e3)}function zK(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=Rk(e,n.masksTree);return n.flatCache.set(e,r),r}function jK(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=Md("/"),kb(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),Rk(r,a,t)}function TK(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=Rk(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=PO(i.route)),n.matchCache.set(r,i),i}function AK(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function RK(e,n=!1,t){const r=Md(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let c=0;kb(n,s,e,1,r,0,i,u=>{if(t==null||t(u,c),u.id in a&&Ak(),a[u.id]=u,c!==0&&u.path){const h=AK(u.fullPath);(!o[h]||u.fullPath.endsWith("/"))&&(o[h]=u)}c++});for(const u of i)u.sort($O);return{processedTree:{segmentTree:r,singleCache:gv(1e3),matchCache:gv(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Rk(e,n,t=!1){const r=e.split("/"),s=OK(e,r,n,t);if(!s)return null;const[i]=BO(e,r,s);return{route:s.node.route,rawParams:i}}function BO(e,n,t){var h,_,p,m;const r=MK(t.node);let s=null;const i=Object.create(null);let a=((h=t.extract)==null?void 0:h.part)??0,o=((_=t.extract)==null?void 0:_.node)??0,c=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;E--){const T=_.wildcard[E],{prefix:j,suffix:M}=T;if(!(j&&(y||!(T.caseSensitive?C:z??(z=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const D=n.slice(p).join("/"),I=D.slice(-M.length);if((T.caseSensitive?I:I.toLowerCase())!==M||D.length-M.length=0;T--){const j=_.optional[T];o.push({node:j,index:p,skipped:E,statics:w,dynamics:k,optionals:v,extract:b,rawParams:x})}if(!y)for(let T=_.optional.length-1;T>=0;T--){const j=_.optional[T],{prefix:M,suffix:D}=j;if(M||D){const I=j.caseSensitive?C:z??(z=C.toLowerCase());if(M&&!I.startsWith(M)||D&&I.indexOf(D,I.length-D.length)=0;E--){const T=_.dynamic[E],{prefix:j,suffix:M}=T;if(j||M){const D=T.caseSensitive?C:z??(z=C.toLowerCase());if(j&&!D.startsWith(j)||M&&D.indexOf(M,D.length-M.length)=0;E--){const T=_.pathless[E];o.push({node:T,index:p,skipped:m,statics:w,dynamics:k,optionals:v,extract:b,rawParams:x})}}if(u)return u;if(r&&c){let h=c.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===Cu)>(e.node.kind===Cu)||n.node.kind===Cu==(e.node.kind===Cu)&&n.node.depth>e.node.depth))):!0}function F1(e){return H1(e.filter(n=>n!==void 0).join("/"))}function H1(e){return e.replace(/\/{2,}/g,"/")}function FO(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function el(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function HO(e){return el(FO(e))}function vv(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function LK(e,n,t){return vv(e,t)===vv(n,t)}function IK({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=H1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=H1(e)),a=e.split("/");a.length>1&&S0(a)==="";)a.pop();const u=n.split("/");for(let h=0,_=u.length;h<_;h++){const p=u[h];p===""?h?h===_-1&&a.push(p):a=[p]:p===".."?a.length>1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(S0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),c=(s?H1(o):o)||"/";return i&&r&&r.set(i,c),c}function $K(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function F2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>hE(s,t)).join("/"):hE(r,t)}function dE({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,c,u="";for(;oe.state.__TSR_key||e.href;function GK(e){const n=e.getAttribute(pE);if(n)return`[${pE}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let Kg=!1;const q1="window";function J4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function mE(e){const n=new Set;for(const t of e){if(t===q1)continue;const r=J4(t);r&&n.add(r)}return n}function VK(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||UK,i=new Set,a=o=>{const c=fu[o]||(fu[o]={});for(const u of i)u===document?c[q1]={scrollX,scrollY}:u.isConnected&&(c[GK(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,Kg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{Kg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),qK()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var k;const c=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,h=r.next,_=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),w=o.fromLocation&&s(o.fromLocation);if(r.restoring&&w&&w!==m){const v=fu[w];if(v){let b=fu[m];for(const x in v){if(x===q1){if(h)continue}else{const y=J4(x);if(!y||h&&u&&(p??(p=mE(u)),p.has(y)))continue}b||(b=fu[m]={}),b[x]??(b[x]=v[x])}}}Kg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let x=!1;if(h){!v&&u&&(p??(p=mE(u)));const y=v&&b&&_,C=r.restoring?fu[m]:void 0;if(C)for(const z in C){const{scrollX:E,scrollY:T}=C[z];if(z===q1){if(y)continue;scrollTo({top:T,left:E,behavior:c}),x=!0}else{const j=J4(z);j&&(j.scrollLeft=E,j.scrollTop=T,p==null||p.delete(j))}}if(!v){const z={top:0,left:0,behavior:c};if(x||scrollTo(z),p)for(const E of p)E.scrollTo(z)}}!x&&v&&b&&((k=document.getElementById(v))==null||k.scrollIntoView(b))}finally{Kg=!1}}))}function KK(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function H2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function WK(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=H2(s):Array.isArray(i)?i.push(H2(s)):t[r]=[i,H2(s)]}return t}const QK=/^(?:\s|["[{\d-]|fa|nu|tr)/,XK=ZK(JSON.parse),YK=JK(JSON.stringify,JSON.parse);function ZK(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=WK(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function JK(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!QK.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=KK(s,r);return i?`?${i}`:""}}const Dd="__root__";function eW(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function qO(e){return e instanceof Response&&!!e.options}function tW(e){return{input:({url:n})=>{for(const t of e)n=e3(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=UO(e[t],n);return n}}}function nW(e){const n=HO(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=F1(["/",n,i.pathname]),i)}}function e3(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function UO(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function rW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),c=t(void 0),u=t([]),h=r(()=>u.get().map(k=>i.get(k).get())),_=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:h.get(),location:o.get(),resolvedLocation:c.get()}));function p(k){let v=i.get(k);return v||(v=t(void 0),i.set(k,v)),v}const m={status:a,location:o,resolvedLocation:c,ids:u,matches:h,byRoute:i,__store:_,getMatchStore:p,setMatches:w};function w(k){const v=u.get(),b=k.map(x=>x.routeId);s(()=>{CK(v,b)||u.set(b);for(const x of v)b.includes(x)||i.get(x).set(()=>{});for(const x of k){const y=p(x.routeId);y.get()!==x&&y.set(x)}})}return m}var ju="__TSR_index",gE="popstate",vE="beforeunload";function sW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...c})=>{var _,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((_=e.getBlockers)==null?void 0:_.call(e))??[],h=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&u.length&&h)for(const m of u){const w=bv(c.path,c.state);if(await m.blockerFn({currentLocation:n,nextLocation:w,action:c.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,c)=>{const u=n.state[ju];o=bE(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:a,state:o})},replace:(a,o,c)=>{const u=n.state[ju];o=bE(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[ju]!==0,createHref:a=>e.createHref(a),block:a=>{var c;if(!e.setBlockers)return()=>{};const o=((c=e.getBlockers)==null?void 0:c.call(e))??[];return e.setBlockers([...o,a]),()=>{var h,_;const u=((h=e.getBlockers)==null?void 0:h.call(e))??[];(_=e.setBlockers)==null||_.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function bE(e,n){n||(n={});const t=Mk();return{...n,key:t,__TSR_key:t,[ju]:e}}function iW(e){var T,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),c=(()=>bv(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((T=n.history.state)!=null&&T.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=Mk();n.history.replaceState({[ju]:0,key:M,__TSR_key:M},"")}let u=c(),h,_=!1,p=!1,m=!1,w=!1;const k=()=>u;let v;const b=()=>{v&&(E._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),E._ignoreSubscribers=!1,v=void 0,h=void 0)},x=(M,D,I)=>{const $=o(D),q=!!v;q||(h=u),u=bv(D,I),v=[$,I,(v==null?void 0:v[2])||M],q||queueMicrotask(()=>b())},y=M=>{u=c(),E.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=c(),D=M.state[ju]-u.state[ju],I=D===1,$=D===-1,q=!I&&!$||_;_=!1;const H=q?"GO":$?"BACK":"FORWARD",Q=q?{type:"GO",index:D}:{type:$?"BACK":"FORWARD"};if(m)m=!1;else{const V=i();if(typeof document<"u"&&V.length){for(const Z of V)if(await Z.blockerFn({currentLocation:u,nextLocation:M,action:H})){p=!0,n.history.go(1),E.notify(Q);return}}}u=c(),E.notify(Q)},z=M=>{if(w){w=!1;return}let D=!1;const I=i();if(typeof document<"u"&&I.length)for(const $ of I){const q=$.enableBeforeUnload??!0;if(q===!0){D=!0;break}if(typeof q=="function"&&q()===!0){D=!0;break}}if(D)return M.preventDefault(),M.returnValue=""},E=sW({getLocation:k,getLength:()=>n.history.length,pushState:(M,D)=>x(!0,M,D),replaceState:(M,D)=>x(!1,M,D),back:M=>(M&&(m=!0),w=!0,n.history.back()),forward:M=>{M&&(m=!0),w=!0,n.history.forward()},go:M=>{_=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(vE,z,{capture:!0}),n.removeEventListener(gE,C)},onBlocked:()=>{h&&u!==h&&(u=h)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(vE,z,{capture:!0}),n.addEventListener(gE,C),n.history.pushState=function(...M){const D=t.apply(n.history,M);return E._ignoreSubscribers||y("PUSH"),D},n.history.replaceState=function(...M){const D=r.apply(n.history,M);return E._ignoreSubscribers||y("REPLACE"),D},E}function aW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function bv(e,n){const t=aW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=Mk();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[ju]:0,key:i,__TSR_key:i}}}function Mk(){return(Math.random()+1).toString(36).substring(7)}function yE(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function Sb(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function xE({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function oW(e,n,t,r){var s,i,a,o;for(const c of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===c.routeId)||(i=(s=e.routesById[c.routeId].options).onLeave)==null||i.call(s,c)}for(const c of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[c.routeId].options)[n.some(u=>u.routeId===c.routeId)?"onStay":"onEnter"])==null||o.call(a,c)}}var cW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??mK??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=$K(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=iW()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=gv(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=rW(this.latestLocation,u),VK(this)}const o=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==o||a!==c){this.basepath=o;const u=[],h=HO(o);h&&h!=="/"&&u.push(nW({basepath:o})),c&&u.push(c),this.rewrite=u.length===0?void 0:u.length===1?u[0]:tW(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=RK(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&NK(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:c,search:u,hash:h,href:_,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const b=this.options.parseSearch(u),x=this.options.stringifySearch(b);return{href:c+x+h,publicHref:c+x+h,pathname:$p(c).path,external:!1,searchStr:x,search:g_(r==null?void 0:r.search,b),hash:$p(h.slice(1)).path,state:T_(r==null?void 0:r.state,p)}}const m=new URL(_,this.origin),w=e3(this.rewrite,m),k=this.options.parseSearch(w.search),v=this.options.stringifySearch(k);return w.search=v,{href:w.href.replace(w.origin,""),publicHref:_,pathname:$p(w.pathname).path,external:!!this.rewrite&&w.origin!==this.origin,searchStr:v,search:g_(r==null?void 0:r.search,k),hash:$p(w.hash.slice(1)).path,state:T_(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const c=s(a);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>IK({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=TK(el(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,D;if(i.href){const I=bv(i.href,{});i={...i,to:e3(this.rewrite,new URL(I.pathname,this.origin)).pathname,search:this.options.parseSearch(I.search),hash:I.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const c=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],h=o[3],_=this.resolvePathWithBase(c,i.to?`${i.to}`:".");let p=wE(i.params,h);const m=this.routesByPath[el(_)];let w;if(m)w=this.getRouteBranch(m);else if(_.includes("$"))w=[];else{const[I,$,q]=this.getMatchedRoutes(_);w=I,this.options.notFoundRoute&&(!q||q.path!=="/"&&$["**"])&&(w=[...w,this.options.notFoundRoute])}if(w.length&&DO(p))for(const I of w){const $=((M=I.options.params)==null?void 0:M.stringify)??I.options.stringifyParams;if($){p===h&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,$(p))}catch{}}}const k=t.leaveParams?_:$p(dE({path:_,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((D=this.options.search)!=null&&D.strict)){const I={};w.forEach($=>{if($.options.validateSearch)try{Object.assign(I,U1($.options.validateSearch,{...I,...v}))}catch{}}),v=I}v=uW(v,i,w,t._includeValidateSearch),v=g_(u,v);const b=this.options.stringifySearch(v),x=i.hash===!0?a.hash:i.hash?_h(i.hash,a.hash):void 0,y=x?`#${x}`:"";let C=i.state===!0?a.state:i.state?_h(i.state,a.state):{};i.state&&(C=T_(a.state,C));const z=`${k}${b}${y}`;let E,T,j=!1;if(this.rewrite){const I=new URL(z,this.origin),$=UO(this.rewrite,I);E=I.href.replace(I.origin,""),$.origin!==this.origin?(T=$.href,j=!0):T=$.pathname+$.search+$.hash}else E=SK(z),T=E;return{publicHref:T,href:E,pathname:k,search:v,searchStr:b,state:C,hash:x??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=zK(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:c,...u}=i.route,h=wE(c,a);s.maskedLocation=r({from:t.from,...u,params:h})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=el(this.latestLocation.href)===el(s.href)&&zu(xE(s.state),xE(this.latestLocation.state)),o=this._commitPromise;let c;const u=new Promise(h=>{c=h});if(u.resolve=()=>{c(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:h,hashScrollIntoView:_,...p}=s;h&&(p={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=_??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const c=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=c;const u=this.commitLocation({...c,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===c&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var c,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const _=this.buildLocation({to:t,...a});s=s??_.publicHref,i=i??_.publicHref}const h=!o&&i?i:s;if(mv(h,this.protocolAllowlist))return;if(!a.ignoreBlocker){const _=((u=(c=this.history).getBlockers)==null?void 0:u.call(c))??[];for(const p of _)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(h):window.location.href=h;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await bW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,c=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Sb(o,c)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,h;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(_=>!s||s(_)).map(_=>_.id)),o=[];for(const[_,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(_),o.push(_));const c=_=>{if(a.has(_.id)){const p=this.routesById[_.routeId],m={..._,invalid:!0,...(t!=null&&t.forcePending||_.status==="error"||_.status==="notFound")&&yE(p)?{status:"pending",error:void 0}:void 0};return _._flight=void 0,m}return _};this._committed=r.map(c);for(const[_,p]of this._cache)a.has(_)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const _ of a)(h=this._flights)==null||h.delete(_);for(const _ of o)_.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&mv(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[h,_]of r)(!i||i(_))&&(o.push(h),a.push(_));const c=[];for(const[h,_]of s??[])(!i||_.some(i))&&(c.push(h),a.push(..._));for(const h of o)r.delete(h);for(const h of c)s.delete(h);for(const h of a){const _=h._flight;h._flight=void 0,_&&!--_[2]&&(((u=this._flights)==null?void 0:u.get(h.id))===_&&this._flights.delete(h.id),c.push(_[1]))}for(const h of c)h.abort()},this.loadRouteChunk=Ld,this.preloadRoute=t=>yW(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=jK(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!c||t.params&&!zu(c.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?zu(o.search,i.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??YK,parseSearch:e.parseSearch??XK,protocolAllowlist:e.protocolAllowlist??kK}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=PO(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:el(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?_W(this.options.notFoundMode,i):void 0,c=new Array(i.length),u=this._committed,h=(w,k)=>{const v=u[k];return(v==null?void 0:v.routeId)===w.id?v:w===this.options.notFoundRoute?u.find(b=>b.routeId===w.id):void 0};let _;for(let w=0;w{const m=p(c.preSearchFilters?c.preSearchFilters.reduce((w,k)=>k(w),_):_);return c.postSearchFilters?c.postSearchFilters.reduce((w,k)=>k(w),m):m};s.push(h)}const u=c.validateSearch;if(r&&u){const h=({search:_,next:p,meta:m})=>{const w=p(_);try{const k=U1(u,w);if(m&&k)for(const v in k)v in w||(m.defaulted||(m.defaulted=new Map)).set(v,k[v]);return{...w,...k}}catch{}return w};s.push(h)}}const i=(o,c,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return c;const _=_h(n.search,c);return u&&(u.explicit=_),_}const h=(_,p)=>{if(p){const m=u||{};return{search:i(o+1,_,m),meta:m}}return i(o+1,_,u)};return s[o]({search:c,next:h,meta:u})};return i(0,e)}function _W(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return Dd}function wE(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,_h(e,t))}function kE(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function t3(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function fW(e,n){const t=t3(e,"component");let r=t3(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function Ld(e,n,t){const r=()=>n===!1?void 0:n?t3(e,n):fW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...c}=a.options;Object.assign(e.options,c),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function Ok(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function yf(e,n){return e.routesById[n.routeId]}function E0(e,n,t){return qO(e)?[oa,e]:fh(e)?(e.routeId||(e.routeId=t),[Cb,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[al,e]):[Yo,e]}function Dk(e,n){var r,s;let t=E0(n,!0,e.id);if(t[0]!==al)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=E0(i,!0,e.id)}return t}function u0(e,n,t,r,s){return s[0].signal.aborted?Ru:$k(e,n,t,Dk(t,r),s)}async function dW(e,n,t,r,s,i){var h,_;const[a,o]=n,c=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:w.id};try{const C=m._ctx||(m._ctx=w.options.context?w.options.context({...v,deps:m.loaderDeps,context:k})||{}:void 0);m.context={...k,...C}}catch(C){return tl(e,m),[p,u0(e,n,w,C,t)]}if(c.aborted)return[p,Ru];const b=m.paramsError??m.searchError;if(b!==void 0)return tl(e,m),[p,u0(e,n,w,b,t)];const x=w.options.beforeLoad;if(!x)continue;const y=m.status;p>=i&&(m.status="pending",(_=t[7])==null||_.call(t));try{N0(e,m,"beforeLoad",t[0]);const C=await bf(x({...v,search:m.search,context:m.context,...e.options.additionalContext}),c);if(c.aborted)return[p,Ru];const z=$k(e,n,w,E0(C,!1,w.id),t);if(z[0]!==Yo)return tl(e,m),[p,z];m.context={...m.context,...C}}catch(C){return tl(e,m),[p,u0(e,n,w,C,t)]}finally{m.status=y,N0(e,m,!1,t[0])}}s()}function Lk(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function tl(e,n){var r;const t=n._flight;n._flight=void 0,(r=Lk(e,n,t))==null||r.abort()}function $i(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(c=>c.id===a.id)))o[2]=0;else{const c=Lk(e,a,o);c&&s.push(c)}}for(const a of s)a.abort()}function Ik(e){for(const n of e){const t=n._flight;t&&t[2]++}}function N0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function GO(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:c=>e.navigate({...c,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function SE(e,n,t,r,s,i,a){const o=a[0],c=o.signal;if(c.aborted)return Ru;if(!s)return[Yo,void 0];let u=t._flight;N0(e,t,"loader",o);try{if(!u){const h=new AbortController;u=[Promise.resolve().then(()=>s(GO(e,n,t,r,h,i,!!a[3]))).then(_=>E0(_,!1,r.id),_=>E0(_,!0,r.id)).then(_=>{var p;return _[0]!==Yo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||h.abort()),_[0]===al&&u[2]?Dk(r,_[1]):_}),h,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],$k(e,n,r,await bf(u[0],c),a)}catch(h){if(h!==c||!c.aborted)throw h;return tl(e,t),Ru}finally{N0(e,t,!1,o)}}function CE(e,n,t){n[0]!==oa&&(e.status="success",e.error=void 0,n[0]===Yo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function hW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&tl(e,r)}function EE(e,n){return n[0]===al||n[0]===Cb?{...e,status:n[0]===al?"error":"notFound",error:n[1],_flight:void 0}:e}function pW(e,n,t,r,s,i,a){var $,q;const o=n[1][t],c=yf(e,o),u=!!i[3],h=e._cache.get(o.id);let _,p=!1,m;try{if(o.status==="success"&&(_=c.options.shouldReload,typeof _=="function"&&(_=_(GO(e,n,o,c,i[0],s,u))),i[0].signal.aborted&&(m=Ru)),!m)if(o.status!=="success")p=!0;else{const H=u||o.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||_||_===void 0&&Date.now()-o.updatedAt>=H&&(i[5]||o.cause==="enter"||i[2].some(Q=>Q.routeId===o.routeId&&Q.id!==o.id)))}}catch(H){o.invalid=!0,tl(e,o),m=u0(e,n,c,H,i)}const w=c.options.loader,k=typeof w=="function",v=k?w:w==null?void 0:w.handler,b=!u||c.options.preload!==!1;let x=b&&w?($=e._flights)==null?void 0:$.get(o.id):void 0;x===o._flight||m?x=void 0:x&&!p&&!u&&_===void 0?p=!0:p||(x=void 0);const y=!!(w&&p&&o.status==="success"&&!u&&!i[4]&&((k?void 0:w.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,z=C&&!y&&(o.status!=="success"||!!w),E=t>=a?i[7]:void 0,T=c.lazyFn&&c._lazy!==!0?E:void 0;if(C&&!w&&(o.invalid=!1,o.updatedAt=Date.now()),x&&x[2]++,z){const H=o._flight;o._flight=x,(q=Lk(e,o,H))==null||q.abort(),t>=a&&(o.status="pending"),E==null||E()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):z?SE(e,n,o,c,v,s,i):Promise.resolve([Yo,o.loaderData])).then(H=>(z&&(CE(o,H,u),H[0]===Yo&&(w&&!i[0].signal.aborted&&hW(e,o,h),t>=a&&(o.status="pending"))),H)),M=bf(Promise.resolve().then(()=>Ld(c,void 0,T)),i[0].signal).then(()=>{},H=>n[1].some((Q,V)=>V<=t&&(Q.status==="error"||Q.status==="notFound"||Q._notFound))?void 0:[t,u0(e,n,c,H,i)]).then(H=>j.then(Q=>(z&&!H&&Q[0]===Yo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",E==null||E()),H)));if(r.push([t,j,M]),!y)return j.then(H=>EE(o,H));const D={...o,status:"pending",preload:!1,_flight:x};o.invalid=!1,o.isFetching="loader";const I=SE(e,n,D,c,v,s,i).then(H=>(o.isFetching=!1,CE(D,H,!1),H));return(n[2]??(n[2]=[])).push([t,I,M,D]),I.then(H=>EE(D,H))}async function n3(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const c=yf(e,n[o]);try{const u=Ld(c,!1);u&&await bf(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(c.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function K_(e,n){n[2]&&($i(e,n[2].map(t=>t[3])),n[2]=void 0)}async function NE(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=oa)throw[o,a];!s&&a[0]!==Yo&&(s=[o,a],await Promise.all((t??[]).map(c=>{if(!(c[0]<=o))return c[1].then(u=>{if(u[0]===oa)throw[c[0],u]})})))}})))}catch(i){return i}return n??s}function $k(e,n,t,r,s,i){for(;r[0]===oa;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[oa,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(c){r=i?[al,c]:Dk(t,c),i=!0}}return r}async function VO(e,n,t,r,s,i){const a=n[1];let o=await s,c=!1;const u=a.findIndex(m=>m._notFound),h=m=>m[1][0]===Cb?n3(e,a,m,r.signal):m[0];let _=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=oa)_=0;else if(o){_=o[2]??(o[2]=await h(o));for(const m of t){if(m[0]>=_)break;const w=await m[1];if(w[0]!==Yo&&w[0]=_)break;const w=await m[2];if(w){o=w;break}}if(((o==null?void 0:o[1][0])??0)>=oa){const m=o[1];if(m[0]!==oa||m[1].options.reloadDocument||m[2])return K_(e,n),m;c=!0,o=[0,[al,new Error("Too many redirects")]]}const p=o?o[2]??await h(o):u;if(p>=0){const m=o==null?void 0:o[1],w=m==null?void 0:m[0],k=a[p],v=m==null?void 0:m[1],b=()=>{m&&(k._notFound=void 0,w===al?k.status="error":(v.routeId=k.routeId,k.routeId===e.routeTree.id?(k.status="success",k._notFound=!0):k.status="notFound"),k.error=v,k.isFetching=!1)};b(),m||i==null||i();const x=yf(e,k);try{await bf(m?Promise.resolve().then(()=>Ld(x,w===al?"errorComponent":"notFoundComponent")):Promise.all([Ld(x),Ld(x,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return K_(e,n),Ru}m?c&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),K_(e,n),$i(e,a),b()):k.status="success"}return n}async function KO(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let c=r;cx._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const x=await n3(e,t,void 0,i,u);t[u]._notFound=void 0,t[x]._notFound=!0,u=x}let h=u<0?t.length:u+1,_=0;for(;_{for(let x=m;x=oa&&(h=0);k()}if(!i.aborted&&!r[3]){const x=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),x.push(C[1]));for(const y of x)y.abort()}const b=VO(e,s,p,r[0],NE(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=NE(s[2],void 0,void 0,b.then(x=>C0(x)?0:Ok(t).length,()=>0))),a=await b}catch(c){if(K_(e,s),c===i&&i.aborted)return Ru;throw c}return C0(a)?a:KO(e,a,i,r[6]===t.length?r[6]:0)}function r3(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>r3(e,n),x);return}s[2]=0}const v=t.map(x=>({...x,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(x=>(x&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+w),x));return}}function Bp(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function zE(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!Ok(n[3]).some(i=>i.id===t[1]))return;let s;try{await bf(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function QO(e,n){e._committed=n,e.stores.setMatches(n)}function mW(e,n,t,r){const s=e._committed,i=e._cache;for(const c of t)c.preload=!1,r&&(c._assetEnd=void 0);const a=Ok(t).length,o=new Map;{const c=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((_,p)=>_.id===u.id&&(p=(u.preload?h.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:h.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,QO(e,t),$i(e,[...i.values(),...s],[...t,...o.values()]),oW(e,s,t,n)}async function Wg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function XO(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function gW(e,n,t,r,s){const i=t.map(c=>({...c}));Ik(i);for(const c of r)tl(e,i[c[0]]),i[c[0]]=c[3];const a=[n[2],i];let o;try{o=await VO(e,a,r,n[0],s)}catch(c){throw $i(e,i),c}if(C0(o)){$i(e,i),o[0]===oa&&e._tx===n&&e._committed===t&&await XO(e,n,o);return}if(await KO(e,o,n[0].signal),e._tx!==n||e._committed!==t){$i(e,i);return}for(const c of i){const u=e._cache.get(c.id);u!=null&&u._flight&&u._flight===c._flight&&(e._cache.delete(c.id),tl(e,u))}QO(e,i),$i(e,t,i)}async function vW(e,n,t,r,s,i){const a=await WO(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(C0(a)){const _=a[0]===oa&&e._tx===n;if((!_||a[1].options.reloadDocument)&&Bp(e,n),$i(e,n[3]),n[3]=[],!_)return;if(e._tx!==n){Bp(e,n);return}await XO(e,n,a);return}const o=a[1];if(e._tx===n&&await zE(e,n),e._tx!==n){Bp(e,n),$i(e,o),K_(e,a);return}const c=n[2],u=Sb(c,e.stores.resolvedLocation.get()),h=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await zE(e,n),e._tx!==n){Bp(e,n),$i(e,o),K_(e,a);return}const _=()=>{Bp(e,n),mW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(_,o);if(e._tx!==n){K_(e,a);return}h!=null&&h.length&&gW(e,n,o,h,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function bW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,c=e._handoff,u=c==null?void 0:c[0](),h=new AbortController,_=e._preflight;if(e._preflight=h,u||c==null||c[1](),_==null||_.abort(),!h.signal.aborted){const z=Sb(i,r);e.emit({type:"onBeforeNavigate",...z}),h.signal.aborted||e.emit({type:"onBeforeLoad",...z})}if(h.signal.aborted){await Wg(e,t);return}const p=s.href===i.href;let m=h;const w=e.matchRoutes(i,{_controller:h});Ik(w);const k=u?c[1](w):void 0;if(k?m=u:u==null||u.abort(),h.signal.aborted){$i(e,w),await Wg(e,t);return}e._preflight=void 0;let v;const b=()=>vW(e,y,p,()=>r3(e,y),n==null?void 0:n.sync,k),x=n!=null&&n.sync?new Promise(z=>v=z):Promise.resolve().then(b).then(),y=[m,o,i,w,Date.now(),x];if(e._tx=y,t){for(const z of e.stores.matches.get()){if(e._tx!==y)break;z.isFetching&&N0(e,z,!1)}t[0].abort(),$i(e,t[3],y[3],!0)}if(e._tx!==y){$i(e,y[3]),y[3]=[],v==null||v(),await Wg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(k||!e._committed.length&&((C=w[0])==null?void 0:C.status)!=="success"&&!w.some(z=>z._notFound))&&r3(e,y),v==null||v(b()),await x,await Wg(e,y)}async function yW(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,c;try{try{a=e.matchRoutes(t,{_controller:i}),Ik(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),c=await WO(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),$i(e,a)),i.abort()}if(!C0(c))return c[1];if(!o||c.length<3)return;t=c[2]}catch(u){fh(u)||console.error(u);return}}}const xW="Error preloading route! ☝️";var YO=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var c,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(c=this.options).getParentRoute)==null?void 0:u.call(c),r?this._path=Dd:this.parentRoute||Ak();let s=r?Dd:t==null?void 0:t.path;s&&s!=="/"&&(s=FO(s));const i=(t==null?void 0:t.id)||s;let a=r?Dd:F1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=F1(["/",a]));const o=a==="__root__"?"/":F1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=el(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>eW({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},wW=class extends YO{constructor(e){super(e)}},Bk=class extends A.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?A.createElement(this.props.errorComponent??kW,{error:e,reset:this.reset}):this.props.children}};function kW({error:e}){const[n,t]=A.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function SW({children:e,fallback:n=null}){return f.jsx(et.Fragment,{children:ZO()?e:n})}function ZO(){return et.useSyncExternalStore(CW,()=>!0,()=>!1)}function CW(){return()=>{}}var JO=A.createContext(null);function pi(e){return A.useContext(JO)}var Eb=A.createContext(void 0),EW=A.createContext(void 0),kr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(kr||{});function NW({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,h,_){const p=h.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:h.deps;if(m!==void 0&&m.dep===u){m.version=_,h.depsTail=m;return}const w=u.subsTail;if(w!==void 0&&w.version===_&&w.sub===h)return;const k=h.depsTail=u.subsTail={version:_,dep:u,sub:h,prevDep:p,nextDep:m,prevSub:w,nextSub:void 0};m!==void 0&&(m.prevDep=k),p!==void 0?p.nextDep=k:h.deps=k,w!==void 0?w.nextSub=k:u.subs=k}function s(u,h=u.sub){const _=u.dep,p=u.prevDep,m=u.nextDep,w=u.nextSub,k=u.prevSub;return m!==void 0?m.prevDep=p:h.depsTail=p,p!==void 0?p.nextDep=m:h.deps=m,w!==void 0?w.prevSub=k:_.subsTail=k,k!==void 0?k.nextSub=w:(_.subs=w)===void 0&&t(_),m}function i(u){let h=u.nextSub,_;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&c(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const w=p.subs;if(w!==void 0){const k=(u=w).nextSub;k!==void 0&&(_={value:h,prev:_},h=k);continue}}if((u=h)!==void 0){h=u.nextSub;continue}for(;_!==void 0;)if(u=_.value,_=_.prev,u!==void 0){h=u.nextSub;continue e}break}while(!0)}function a(u,h){let _,p=0,m=!1;e:do{const w=u.dep,k=w.flags;if(h.flags&16)m=!0;else if((k&17)===17){if(e(w)){const v=w.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((k&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(_={value:u,prev:_}),u=w.deps,h=w,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=h.subs,b=v.nextSub!==void 0;if(b?(u=_.value,_=_.prev):u=v,m){if(e(h)){b&&o(v),h=u.sub;continue}m=!1}else h.flags&=-33;h=u.sub;const x=u.nextDep;if(x!==void 0){u=x;continue e}}return m}while(!0)}function o(u){do{const h=u.sub,_=h.flags;(_&48)===32&&(h.flags=_|16,(_&6)===2&&n(h))}while((u=u.nextSub)!==void 0)}function c(u,h){let _=h.depsTail;for(;_!==void 0;){if(_===u)return!0;_=_.prevDep}return!1}}function zW(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const s3=[];let G1=0;const{link:jE,unlink:jW,propagate:TW,checkDirty:eD,shallowPropagate:TE}=NW({update(e){return e._update()},notify(e){s3[i3++]=e,e.flags&=~kr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=kr.Mutable|kr.Dirty,xv(e))}});let Qg=0,i3=0,Ho,a3=0;function AW(e){try{++a3,e()}finally{--a3||tD()}}function xv(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=jW(t,e)}function tD(){if(!(a3>0)){for(;Qg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(i){const a=Ho,o=(n==null?void 0:n.compare)??Object.is;if(t)Ho=s,++G1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=kr.Mutable|kr.RecursedCheck);try{const c=s._snapshot,u=typeof i=="function"?i(c):i===void 0&&t?r(c):i;return c===void 0||!o(c,u)?(s._snapshot=u,!0):!1}finally{Ho=a,t&&(s.flags&=~kr.RecursedCheck),xv(s)}}};return t?(s.flags=kr.Mutable|kr.Dirty,s.get=function(){const i=s.flags;if(i&kr.Dirty||i&kr.Pending&&eD(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&TE(a)}}else i&kr.Pending&&(s.flags=i&~kr.Pending);return Ho!==void 0&&jE(s,Ho,G1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(TW(a),TE(a),tD())}},s}function RW(e){const n=()=>{const r=Ho;Ho=t,++G1,t.depsTail=void 0,t.flags=kr.Watching|kr.RecursedCheck;try{return e()}finally{Ho=r,t.flags&=~kr.RecursedCheck,xv(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:kr.Watching|kr.RecursedCheck,notify(){const r=this.flags;r&kr.Dirty||r&kr.Pending&&eD(this.deps,this)?n():this.flags=kr.Watching},stop(){this.flags=kr.None,this.depsTail=void 0,xv(this)}};return n(),t}var q2={exports:{}},U2={},G2={exports:{}},V2={};/** * @license React * use-sync-external-store-shim.production.js * @@ -55,7 +55,7 @@ Error generating stack: `+S.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var AE;function jW(){if(AE)return U2;AE=1;var e=bm();function n(_,p){return _===p&&(_!==0||1/_===1/p)||_!==_&&p!==p}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function o(_,p){var m=p(),x=r({inst:{value:m,getSnapshot:p}}),k=x[0].inst,v=x[1];return i(function(){k.value=m,k.getSnapshot=p,c(k)&&v({inst:k})},[_,m,p]),s(function(){return c(k)&&v({inst:k}),_(function(){c(k)&&v({inst:k})})},[_]),a(m),m}function c(_){var p=_.getSnapshot;_=_.value;try{var m=p();return!t(_,m)}catch{return!0}}function u(_,p){return p()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return U2.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,U2}var RE;function TW(){return RE||(RE=1,q2.exports=jW()),q2.exports}/** + */var RE;function MW(){if(RE)return V2;RE=1;var e=ym();function n(_,p){return _===p&&(_!==0||1/_===1/p)||_!==_&&p!==p}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function o(_,p){var m=p(),w=r({inst:{value:m,getSnapshot:p}}),k=w[0].inst,v=w[1];return i(function(){k.value=m,k.getSnapshot=p,c(k)&&v({inst:k})},[_,m,p]),s(function(){return c(k)&&v({inst:k}),_(function(){c(k)&&v({inst:k})})},[_]),a(m),m}function c(_){var p=_.getSnapshot;_=_.value;try{var m=p();return!t(_,m)}catch{return!0}}function u(_,p){return p()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return V2.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,V2}var ME;function OW(){return ME||(ME=1,G2.exports=MW()),G2.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -63,532 +63,532 @@ Error generating stack: `+S.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ME;function AW(){if(ME)return H2;ME=1;var e=bm(),n=TW();function t(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,c=e.useDebugValue;return H2.useSyncExternalStoreWithSelector=function(u,h,_,p,m){var x=i(null);if(x.current===null){var k={hasValue:!1,value:null};x.current=k}else k=x.current;x=o(function(){function b(z){if(!w){if(w=!0,y=z,z=p(z),m!==void 0&&k.hasValue){var T=k.value;if(m(T,z))return C=T}return C=z}if(T=C,r(y,z))return T;var j=p(z);return m!==void 0&&m(T,j)?(y=z,T):(y=z,C=j)}var w=!1,y,C,N=_===void 0?null:_;return[function(){return b(h())},N===null?void 0:function(){return b(N())}]},[h,_,p,m]);var v=s(u,x[0],x[1]);return a(function(){k.hasValue=!0,k.value=v},[v]),c(v),v},H2}var OE;function RW(){return OE||(OE=1,F2.exports=AW()),F2.exports}var eD=RW();const MW=vm(eD);function OW(e,n){return e===n}function Xo(e,n,t=OW){const r=A.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=A.useCallback(()=>e==null?void 0:e.get(),[e]);return eD.useSyncExternalStoreWithSelector(r,s,s,n,t)}var DE={};function $k(e,n){const t=A.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=w_(t.current,s):s}}function df(e){const n=di(),t=A.useContext(e.from?wW:Cb),r=e.from??t,s=n.stores.getMatchStore(r),i=$k(e,n),a=Xo(s,o=>o?i(o):DE);if(a!==DE)return a;(e.shouldThrow??!0)&&jk()}function tD(e){return df({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function nD(e){const{select:n,...t}=e;return df({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function rD(e){return df({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function sD(e){return df({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Eb(e){const n=di();return A.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function Bk(e){return df({...e,select:n=>e.select?e.select(n.context):n.context})}function G2(e){const n=A.useRef(e);return vu(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function DW(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function LW(e,n,t){if(e!=null&&e.external)return mv(e.href,t)?void 0:e.href;if(!qW(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),mv(n,t)?void 0:n}catch{}}function IW(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!RK(e.pathname,n.pathname,r))return!1}else{const a=vv(e.pathname,r),o=vv(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!vu(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function $W(e,n){const t=di(),r=hK(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:c,preloadDelay:u,preloadIntentProximity:h,hashScrollIntoView:_,replace:p,startTransition:m,resetScroll:x,viewTransition:k,children:v,target:b,disabled:w,style:y,className:C,onClick:N,onBlur:z,onFocus:T,onMouseEnter:j,onMouseLeave:M,onTouchStart:D,ignoreBlocker:I,params:$,search:q,hash:H,state:Q,mask:V,reloadDocument:J,unsafeRelative:Z,from:B,_fromLocation:L,...F}=e,U=XO(),K=G2(e.search),ne=G2(e.params),ce=G2(a),_e=A.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,K,ne,e.state,e.mask,e.unsafeRelative]),se=A.useCallback(ut=>{const dt=t.buildLocation({_fromLocation:ut,..._e}),Ie=HW(dt.maskedLocation?dt.maskedLocation.publicHref:dt.publicHref,dt.maskedLocation?dt.maskedLocation.external:dt.external,t.history,w),me=LW(Ie,o,t.protocolAllowlist);return[Ie==null?void 0:Ie.href,me,IW(ut,dt,ce,t.basepath,U,me!==void 0)]},[ce,w,U,_e,t,o]),[G,oe,le]=Xo(t.stores.location,se,DW),pe=le?uh(s,{})??BW:V2,be=le?V2:uh(i,{})??V2,Me=[C,pe.className,be.className].filter(Boolean).join(" "),Le=(y||pe.style||be.style)&&{...y,...pe.style,...be.style},Ke=A.useRef(!1),je=e.reloadDocument||oe||w?!1:c??t.options.defaultPreload,we=u??t.options.defaultPreloadDelay??0,rt=A.useCallback(()=>{t.preloadRoute(_e).catch(ut=>{console.warn(ut),console.warn(gW)})},[t,_e]),Ze=A.useCallback(ut=>{if(!ut){K2(r);return}if(!(ut.isIntersecting??je==="intent")){ut.isIntersecting===!1&&K2(r);return}if(!we){rt();return}u0.has(r)||u0.set(r,setTimeout(()=>{u0.delete(r),rt()},we))},[rt,r,je,we]);dK(r,Ze,je!=="viewport"),A.useEffect(()=>{Ke.current||je==="render"&&(rt(),Ke.current=!0)},[rt,je]);const at=ut=>{const dt=ut.currentTarget.getAttribute("target"),Ie=b!==void 0?b:dt;!w&&!(ut.metaKey||ut.altKey||ut.ctrlKey||ut.shiftKey)&&!ut.defaultPrevented&&(!Ie||Ie==="_self")&&ut.button===0&&(ut.preventDefault(),t.navigate({..._e,replace:p,resetScroll:x,hashScrollIntoView:_,startTransition:m,viewTransition:k,ignoreBlocker:I}))};if(oe)return{...F,ref:r,href:oe,...v&&{children:v},...b&&{target:b},...w&&{disabled:w},...y&&{style:y},...C&&{className:C},...N&&{onClick:N},...z&&{onBlur:z},...T&&{onFocus:T},...j&&{onMouseEnter:j},...M&&{onMouseLeave:M},...D&&{onTouchStart:D}};const St=()=>{je==="intent"&&rt()},Ft=()=>{je==="intent"&&K2(r)};return{...F,...pe,...be,href:G,ref:r,onClick:_d([N,at]),onBlur:_d([z,Ft]),onFocus:_d([T,Ze]),onMouseEnter:_d([j,Ze]),onMouseLeave:_d([M,Ft]),onTouchStart:_d([D,St]),disabled:!!w,target:b,...Le&&{style:Le},...Me&&{className:Me},...w&&PW,...le&&FW}}var V2={},BW={className:"active"},PW={role:"link","aria-disabled":!0},FW={"data-status":"active","aria-current":"page"},u0=new WeakMap,K2=e=>{clearTimeout(u0.get(e)),u0.delete(e)},_d=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function HW(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function qW(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Nb=A.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=$W(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...c}=i;return A.createElement("a",c,a)}return A.createElement(t,i,a)}),UW=class extends QO{constructor(n){super(n),this.useMatch=t=>df({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Bk({...t,from:this.id}),this.useSearch=t=>sD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>rD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>nD({...t,from:this.id}),this.useLoaderData=t=>tD({...t,from:this.id}),this.useNavigate=()=>Eb({from:this.fullPath}),this.Link=Je.forwardRef((t,r)=>f.jsx(Nb,{ref:r,from:this.fullPath,...t}))}};function GW(e){return new UW(e)}function VW(){return e=>WW(e)}var KW=class extends vW{constructor(e){super(e),this.useMatch=n=>df({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Bk({...n,from:this.id}),this.useSearch=n=>sD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>rD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>nD({...n,from:this.id}),this.useLoaderData=n=>tD({...n,from:this.id}),this.useNavigate=()=>Eb({from:this.fullPath}),this.Link=Je.forwardRef((n,t)=>f.jsx(Nb,{ref:t,from:this.fullPath,...n}))}};function WW(e){return new KW(e)}function tc(e){return n=>{const t=GW(n);return t.isRoot=!1,t}}function QW(e){const n=di(),t=`not-found-${Xo(n.stores.location,r=>r.pathname)}-${Xo(n.stores.status,r=>r)}`;return f.jsx(Ik,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if(_h(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(_h(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function XW(){return f.jsx("p",{children:"Not Found"})}function bd(e){return f.jsx(f.Fragment,{children:e.children})}function iD(e,n,t){return n.options.notFoundComponent?f.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...t}):f.jsx(XW,{})}function zb(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?f.jsx(t,{}):null}var YW=(e,n)=>e[0]===n[0]&&e[1]===n[1],aD=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,oD=A.memo(function({routeId:n}){const t=di();return f.jsx(ZW,{router:t,match:Xo(t.stores.getMatchStore(n),r=>r)})});function ZW({router:e,match:n}){var _,p;const t=e.routesById[n.routeId],r=zb(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((_=e.options.notFoundRoute)==null?void 0:_.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",c=aD(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?A.Suspense:bd,u=s?Ik:bd,h=a?QW:bd;return f.jsxs(t.isRoot?t.options.shellComponent??bd:bd,{children:[f.jsx(Cb.Provider,{value:n.routeId,children:f.jsx(c,{fallback:r,children:f.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,x)=>{if(_h(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,x)},children:f.jsx(h,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return A.createElement(a,m)},children:o?f.jsx(yW,{fallback:r,children:f.jsx(LE,{match:n})}):f.jsx(LE,{match:n})})})})}),null]})}var LE=A.memo(function({match:n}){const t=di(),r=n.routeId,s=t.routesById[r],i=A.useMemo(()=>{var c;const o=(c=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:c({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=A.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?f.jsx(o,{},i):f.jsx(N0,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!aD(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return zb(t,s)}if(n.status==="notFound")return iD(t,s,n.error);if(n.status==="error")throw n.error;return a}),N0=A.memo(function(){const n=di(),t=A.useContext(Cb);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=Xo(o,c=>[!!c._notFound,c.error],YW),i=Xo(n.stores.ids,c=>c[c.indexOf(t)+1])}if(r)return iD(n,n.routesById[t],s);if(!i)return null;const a=f.jsx(oD,{routeId:i});return t===Od?f.jsx(A.Suspense,{fallback:zb(n),children:a}):a});function cD(e,n){const t=e[1];e.length=0,t==null||t(n)}function JW({t:e}){const n=di(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{cD(t,!1),t.push(s,i),e(n),A.startTransition(r)}),AO(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Zc(s.publicHref)!==Zc(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...kb(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function eQ(){const e=di(),n=e.routesById[Od],t=zb(e,n),r=e.ssr?bd:A.Suspense,s=f.jsxs(f.Fragment,{children:[f.jsx(JW,{t:A.useState()[1]}),f.jsx(r,{fallback:t,children:f.jsx(tQ,{})})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:s}):s}function tQ(){const e=di(),n=e._rendered,t=Xo(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;AO(()=>{n[0]===t&&cD(n,!0)},[n,t]);const i=s?f.jsx(oD,{routeId:s}):null;return f.jsx(Cb.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:f.jsx(Ik,{getResetKey:()=>r,onCatch:void 0,children:i})})}var nQ=e=>({createMutableStore:TE,createReadonlyStore:TE,batch:NW}),rQ=e=>new sQ(e),sQ=class extends sW{constructor(e){super(e,nQ)}};function iQ({router:e,children:n,...t}){MO(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=f.jsx(YO.Provider,{value:e,children:n});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function aQ({router:e,...n}){return f.jsx(iQ,{router:e,...n,children:f.jsx(eQ,{})})}function oQ(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function cQ(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=oQ(e),a=di(),{history:o}=a,[c,u]=A.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return A.useEffect(()=>{const h=async _=>{function p(b){const w=a.parseLocation(b),[,y,C]=a.getMatchedRoutes(w.pathname);return C===void 0?{routeId:"__notFound__",fullPath:w.pathname,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}}const m=p(_.currentLocation),x=p(_.nextLocation);if(m.routeId==="__notFound__"&&x.routeId!=="__notFound__")return!1;const k=await t({action:_.action,current:m,next:x});if(!i)return k;if(!k)return!1;const v=await new Promise(b=>{u({status:"blocked",current:m,next:x,action:_.action,proceed:()=>b(!1),reset:()=>b(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),v};return s?void 0:o.block({blockerFn:h,enableBeforeUnload:r})},[t,r,s,i,o,a]),c}function lD(e){const n=di({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return Xo(t.stores.__store,$k(e,t))}function lQ(e){const n=di();return Xo(n.stores.location,$k(e,n))}const wv=new WeakMap,V1=new WeakMap;function Za(e,n,t="*"){var r;for(const s of e.getQueryCache().findAll({queryKey:n}))wv.set(s,(wv.get(s)??0)+1),(r=V1.get(s))==null||r.add(t)}function xm(e,n,t,r=!0){if(!n)return e;const s=new Map(n.map(c=>[c.id,c])),i=new Set(e.map(c=>c.id)),a=n.filter(c=>t.has(c.id)&&!i.has(c.id)),o=e.filter(c=>!t.has(c.id)||s.has(c.id)).map(c=>t.has(c.id)?s.get(c.id)??c:c);return r?[...a,...o]:[...o,...a]}async function Oh(e,n,t,r=(s,i)=>i??s){const s=e.getQueryCache().find({queryKey:n,exact:!0}),i=s?wv.get(s):void 0,a=await t();if(!s||wv.get(s)===i||s.state.fetchStatus!=="fetching"||e.getQueryCache().find({queryKey:n,exact:!0})!==s)return a;e.setQueryData(n,c=>c??a);const o=new Set;V1.set(s,o);try{const c=await t();return o.size?r(c,e.getQueryData(n),o):c}finally{V1.get(s)===o&&V1.delete(s)}}const fh=e=>typeof e=="string"&&/^[0-9a-f]{40}$/i.test(e);function uD(e){const n=e.queryKey[2];if(n==="resolvedFile")return fh(e.queryKey[7]);const t=n==="getProjectFile"?e.queryKey[5]:n==="getCodeTree"?e.queryKey[4]:null;return typeof t=="object"&&t!==null&&"ref"in t&&fh(t.ref)}function Ta(e,n=Ia(),t,r=!1){if(!Dn(n))return;const s={queryKey:n,predicate:i=>e.includes(String(i.queryKey[2]))&&!uD(i)&&(!t||t(i))};r?et.cancelQueries(s).then(()=>{Dn(n)&&et.invalidateQueries(s)}):et.invalidateQueries(s)}const _D=["resolvedFile","getProjectFile","getArtifactFileText","getArtifactFileMetadata"],Pk=["getArtifacts","getArtifactFileText","getArtifactFileMetadata"],uQ=["listProjects","listProjectActivity","listExperiments","listRuns","listChatSessions","getChatMessages","getHarnesses","getUpdateStatus",...Pk,..._D,"getAbsoluteFile","fileVersion","getCodeTree","getSessionWorktree","getRunDiff","getExperimentDiff"];function _Q(e,n=Ia(),t=!1){const r=et.getQueryData([...n,"listChatSessions",e])??[],s=et.getQueryData([...n,"listRuns",e])??[],i=et.getQueryData([...n,"listExperiments",e])??[];Ta([..._D,...Pk,"getRunDiff","getExperimentDiff","getCodeTree","getSessionWorktree","fileVersion","getProjectGitStatus","getOverleafState","getOverleafStatus"],n,a=>{const o=a.queryKey[2];return o==="getRunDiff"?s.some(c=>c.id===a.queryKey[3]):o==="getExperimentDiff"?i.some(c=>c.id===a.queryKey[3]):o==="getSessionWorktree"?r.some(c=>c.id===a.queryKey[3]):o==="fileVersion"?typeof a.queryKey[3]=="string"&&a.queryKey[3].startsWith(`/api/projects/${e}/`):a.queryKey[3]===e},t)}function jb(e){const n=Ia();ll.add(e),Za(et,[...n,"listChatSessions"],e),et.setQueriesData({queryKey:[...n,"listChatSessions"]},t=>t==null?void 0:t.filter(r=>r.id!==e));for(const t of["getChatMessages","getSessionWorktree"])zk({queryKey:[...n,t,e]})}function fQ(e){const n=Ia(),t=et.getQueryData([...n,"listChatSessions",e]);for(const r of t??[])jb(r.id);zk({queryKey:n,predicate:r=>r.queryKey.slice(3).includes(e)})}const dQ={hf:["getHfSettings","getComputeSettings","getEnvVars"],tinker:["getTinkerSettings","getComputeSettings","getEnvVars"],k8s:["getK8sSettings","getComputeSettings"],modal:["getModalSettings","getComputeSettings","getEnvVars"],slurm:["getSlurmSettings","getComputeSettings"],ray:["getRaySettings","getComputeSettings"],env:["getEnvVars","getHfSettings","getTinkerSettings","getModalSettings","getSlurmSettings","getRaySettings","getK8sSettings","getOpenResearchSettings","getComputeSettings","getHarnesses"],"data-dir":["getDataDir"],ssh:["getSshSettings","getSshConfig","getSshMasterStatus","getComputeSettings"],compute:["getComputeSettings"],git:["githubAccount","repoAccess","getProjectGitStatus"],profile:["getProfile"],"lit-sources":["getLitSources"],projects:["getProjectDefaults","getProjectGitStatus"],telemetry:["getTelemetry"]};function hQ(e,n){var a;if(!Dn(n))return;const t=(o,c=n,u)=>Ta(o,c,u,!0),r=e.split("?")[0];if(/\/(ui-state|open|reveal|prewarm|validate|preflight)$/.test(r))return;const s=(a=/^\/api\/settings\/([^/]+)/.exec(r))==null?void 0:a[1];if(s){t(dQ[s]??[],n);return}if(r.startsWith("/api/local-models")&&!/\/(discover|check)$/.test(r)){t(["getLocalModels","getHarnesses"],n);return}if(r==="/api/user-skills"){t(["listUserSkills","getSkills","getSkillContent"],n);return}if(r==="/api/latex-templates"){t(["listLatexTemplates"],n);return}if(r==="/api/overleaf/token"){t(["getOverleafSettings","getOverleafState","getOverleafStatus"],n);return}if(r.startsWith("/api/update/")){t(["getUpdateStatus","getLocalMachine"],n);return}if(r.startsWith("/api/remote/")||r.startsWith("/_orx/")){t(["listRemoteSessions"],n),et.invalidateQueries({queryKey:["gateway","runtime"]});return}if(r.startsWith("/api/chat/")){r==="/api/chat/sessions"&&t(["getProjectStarterPrompts","listProjectActivity"],n);return}const i=/^\/api\/projects\/([^/]+)(.*)$/.exec(r);if(i){const[,o,c]=i;if(c.startsWith("/file")){_Q(o,n,!0);return}t(["listProjects","listProjectActivity"],n),t(["getProjectGitStatus","getCodeTree","getProjectStarterPrompts"],n,u=>u.queryKey[3]===o);return}(r==="/api/projects"||r==="/api/onboarding/complete")&&t(["listProjects","listProjectActivity","getUiState","getProfile"],n)}const pQ={},mQ="en",Fk=["en","zh-CN","fa","ar","es","hi"],fD="orx:locale",Hk=["localStorage","preferredLanguage","baseLocale"],IE=[],z0=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let $E=!1,E=()=>{var t;let e=Hk;!z0&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=pD(window.location.href));const n=gQ(e);if(n)return $E||($E=!0,dD(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function gQ(e,n){let t;for(const r of e){if(r==="baseLocale")t=mQ;else if(r==="preferredLanguage"&&!z0)t=wQ();else if(r==="localStorage"&&!z0)t=localStorage.getItem(fD)??void 0;else if(mD(r)&&kv.has(r)){const i=kv.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return yQ(a)}}const s=j0(t);if(s)return s}}const vQ=e=>{window.location.reload()};let dD=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=E()}catch{}const s=[];let i=Hk;!z0&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=pD(window.location.href));for(const c of i)if(c!=="baseLocale"){if(c==="localStorage"&&typeof window<"u")localStorage.setItem(fD,e);else if(mD(c)&&kv.has(c)){const u=kv.get(c);if(u){let h=u.setLocale(e);h instanceof Promise&&(h=h.catch(_=>{throw new Error(`Custom strategy "${c}" setLocale failed.`,{cause:_})}),s.push(h))}}}const a=()=>{!z0&&t.reload&&window.location&&e!==r&&vQ()};if(s.length)return Promise.all(s).then(()=>{a()});a()},bQ=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function j0(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of Fk)if(t.toLowerCase()===n)return t}function hD(e){return!!e&&Fk.some(n=>n===e)}function yQ(e){const n=j0(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${Fk.join(", ")}`)}function xQ(e,n){return e.exec(n.href)}function wQ(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=j0(t.fullTag);if(r)return r;const s=j0(t.baseTag);if(s)return s}}function kQ(e){return SQ(e)}function SQ(e){const n=typeof e=="string"?new URL(e,bQ()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&j0(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let BE,PE;function CQ(e){if(IE.length===0)return;const n=typeof e=="string"?e:e.href;if(BE===n)return PE;const t=new URL(n,"http://example.com"),r=kQ(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of IE){const c=new pQ(o.match,a.href);if(xQ(c,a)){i=o;break}}if(i)break}return BE=n,PE=i,i}function pD(e){const n=CQ(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:Hk}const kv=new Map;function mD(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const EQ=e=>`Actions for ${e==null?void 0:e.name}`,NQ=e=>`${e==null?void 0:e.name} 的操作`,zQ=e=>`عملیات ${e==null?void 0:e.name}`,jQ=e=>`إجراءات ${e==null?void 0:e.name}`,TQ=e=>`Acciones para ${e==null?void 0:e.name}`,AQ=e=>`${e==null?void 0:e.name} के लिए क्रियाएं`,RQ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?NQ(e):t==="fa"?zQ(e):t==="ar"?jQ(e):t==="es"?TQ(e):t==="hi"?AQ(e):EQ(e)}),MQ=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,OQ=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,DQ=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,LQ=e=>`${e==null?void 0:e.path} — اضغط المسافة للمعاينة؛ انقر نقرًا مزدوجًا أو اضغط Enter لإبقائه مفتوحًا في تبويب`,IQ=e=>`${e==null?void 0:e.path} — pulsa Espacio para previsualizarlo; haz doble clic o pulsa Intro para mantenerlo abierto en una pestaña`,$Q=e=>`${e==null?void 0:e.path} — पूर्वावलोकन के लिए स्पेस दबाएं; टैब में खुला रखने के लिए डबल-क्लिक करें या Enter दबाएं`,BQ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?OQ(e):t==="fa"?DQ(e):t==="ar"?LQ(e):t==="es"?IQ(e):t==="hi"?$Q(e):MQ(e)}),PQ=e=>`Branch: ${e==null?void 0:e.branch}`,FQ=e=>`分支:${e==null?void 0:e.branch}`,HQ=e=>`شاخه: ${e==null?void 0:e.branch}`,qQ=e=>`الفرع: ${e==null?void 0:e.branch}`,UQ=e=>`Rama: ${e==null?void 0:e.branch}`,GQ=e=>`ब्रांच: ${e==null?void 0:e.branch}`,VQ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?FQ(e):t==="fa"?HQ(e):t==="ar"?qQ(e):t==="es"?UQ(e):t==="hi"?GQ(e):PQ(e)}),KQ=e=>`Browse code on ${e==null?void 0:e.branch}`,WQ=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,QQ=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,XQ=e=>`تصفّح الشيفرة على ${e==null?void 0:e.branch}`,YQ=e=>`Explorar el código en ${e==null?void 0:e.branch}`,ZQ=e=>`${e==null?void 0:e.branch} पर कोड ब्राउज़ करें`,gD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?WQ(e):t==="fa"?QQ(e):t==="ar"?XQ(e):t==="es"?YQ(e):t==="hi"?ZQ(e):KQ(e)}),JQ=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,eX=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,tX=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,nX=e=>`أداة البرمجة والنموذج المستخدمان في هذه المحادثة: ${e==null?void 0:e.label}`,rX=e=>`Agente y modelo de este chat: ${e==null?void 0:e.label}`,sX=e=>`इस चैट का हार्नेस और मॉडल: ${e==null?void 0:e.label}`,iX=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?eX(e):t==="fa"?tX(e):t==="ar"?nX(e):t==="es"?rX(e):t==="hi"?sX(e):JQ(e)}),aX=e=>`Collapse ${e==null?void 0:e.name}`,oX=e=>`折叠 ${e==null?void 0:e.name}`,cX=e=>`بستن ${e==null?void 0:e.name}`,lX=e=>`طيّ ${e==null?void 0:e.name}`,uX=e=>`Contraer ${e==null?void 0:e.name}`,_X=e=>`${e==null?void 0:e.name} समेटें`,fX=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?oX(e):t==="fa"?cX(e):t==="ar"?lX(e):t==="es"?uX(e):t==="hi"?_X(e):aX(e)}),dX=e=>`Committed changes versus ${e==null?void 0:e.parent}`,hX=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,pX=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,mX=e=>`التغييرات المودعة مقابل ${e==null?void 0:e.parent}`,gX=e=>`Cambios confirmados respecto a ${e==null?void 0:e.parent}`,vX=e=>`${e==null?void 0:e.parent} की तुलना में कमिट किए गए बदलाव`,bX=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hX(e):t==="fa"?pX(e):t==="ar"?mX(e):t==="es"?gX(e):t==="hi"?vX(e):dX(e)}),yX=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,xX=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,wX=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,kX=e=>`التغييرات المودعة مقابل ${e==null?void 0:e.parent} (الفرق مقتطع؛ الأعداد حدود دنيا)`,SX=e=>`Cambios confirmados respecto a ${e==null?void 0:e.parent} (diff truncado; los recuentos son mínimos)`,CX=e=>`${e==null?void 0:e.parent} की तुलना में कमिट किए गए बदलाव (डिफ़ छोटा किया गया; संख्याएं न्यूनतम हैं)`,EX=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?xX(e):t==="fa"?wX(e):t==="ar"?kX(e):t==="es"?SX(e):t==="hi"?CX(e):yX(e)}),NX=e=>`Copy ${e==null?void 0:e.value}`,zX=e=>`复制 ${e==null?void 0:e.value}`,jX=e=>`کپی ${e==null?void 0:e.value}`,TX=e=>`نسخ ${e==null?void 0:e.value}`,AX=e=>`Copiar ${e==null?void 0:e.value}`,RX=e=>`${e==null?void 0:e.value} कॉपी करें`,MX=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?zX(e):t==="fa"?jX(e):t==="ar"?TX(e):t==="es"?AX(e):t==="hi"?RX(e):NX(e)}),OX=e=>`Delete ${e==null?void 0:e.name}`,DX=e=>`删除 ${e==null?void 0:e.name}`,LX=e=>`حذف ${e==null?void 0:e.name}`,IX=e=>`حذف ${e==null?void 0:e.name}`,$X=e=>`Eliminar ${e==null?void 0:e.name}`,BX=e=>`${e==null?void 0:e.name} हटाएं`,i3=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?DX(e):t==="fa"?LX(e):t==="ar"?IX(e):t==="es"?$X(e):t==="hi"?BX(e):OX(e)}),PX=e=>`Download ${e==null?void 0:e.name}`,FX=e=>`下载 ${e==null?void 0:e.name}`,HX=e=>`بارگیری ${e==null?void 0:e.name}`,qX=e=>`تنزيل ${e==null?void 0:e.name}`,UX=e=>`Descargar ${e==null?void 0:e.name}`,GX=e=>`${e==null?void 0:e.name} डाउनलोड करें`,Sv=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?FX(e):t==="fa"?HX(e):t==="ar"?qX(e):t==="es"?UX(e):t==="hi"?GX(e):PX(e)}),VX=e=>`Expand ${e==null?void 0:e.name}`,KX=e=>`展开 ${e==null?void 0:e.name}`,WX=e=>`باز کردن ${e==null?void 0:e.name}`,QX=e=>`توسيع ${e==null?void 0:e.name}`,XX=e=>`Expandir ${e==null?void 0:e.name}`,YX=e=>`${e==null?void 0:e.name} फैलाएं`,ZX=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?KX(e):t==="fa"?WX(e):t==="ar"?QX(e):t==="es"?XX(e):t==="hi"?YX(e):VX(e)}),JX=e=>`Hide additional ${e==null?void 0:e.target}`,eY=e=>`隐藏其余${e==null?void 0:e.target}`,tY=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,nY=e=>`إخفاء ${e==null?void 0:e.target} الإضافية`,rY=e=>`Ocultar ${e==null?void 0:e.target} adicionales`,sY=e=>`अतिरिक्त ${e==null?void 0:e.target} छिपाएं`,iY=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?eY(e):t==="fa"?tY(e):t==="ar"?nY(e):t==="es"?rY(e):t==="hi"?sY(e):JX(e)}),aY=e=>`Hide error details for ${e==null?void 0:e.activity}`,oY=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,cY=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,lY=e=>`إخفاء تفاصيل الخطأ لـ ${e==null?void 0:e.activity}`,uY=e=>`Ocultar los detalles del error de ${e==null?void 0:e.activity}`,_Y=e=>`${e==null?void 0:e.activity} के लिए त्रुटि विवरण छिपाएं`,fY=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?oY(e):t==="fa"?cY(e):t==="ar"?lY(e):t==="es"?uY(e):t==="hi"?_Y(e):aY(e)}),dY=e=>`${e==null?void 0:e.count} consecutive identical calls`,hY=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,pY=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,mY=e=>`الاستدعاءات المتطابقة المتتالية: ${e==null?void 0:e.count}`,gY=e=>`Llamadas idénticas consecutivas: ${e==null?void 0:e.count}`,vY=e=>`${e==null?void 0:e.count} लगातार समान कॉल`,bY=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hY(e):t==="fa"?pY(e):t==="ar"?mY(e):t==="es"?gY(e):t==="hi"?vY(e):dY(e)}),yY=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,xY=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,wY=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,kY=e=>`${e==null?void 0:e.name} — انقر نقرًا مزدوجًا أو اضغط Enter لإبقائه مفتوحًا`,SY=e=>`${e==null?void 0:e.name} — haz doble clic o pulsa Intro para mantenerlo abierto`,CY=e=>`${e==null?void 0:e.name} — खुला रखने के लिए डबल-क्लिक करें या Enter दबाएं`,EY=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?xY(e):t==="fa"?wY(e):t==="ar"?kY(e):t==="es"?SY(e):t==="hi"?CY(e):yY(e)}),NY=e=>`Open ${e==null?void 0:e.branch} on GitHub`,zY=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,jY=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,TY=e=>`فتح ${e==null?void 0:e.branch} على GitHub`,AY=e=>`Abrir ${e==null?void 0:e.branch} en GitHub`,RY=e=>`${e==null?void 0:e.branch} को GitHub पर खोलें`,vD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?zY(e):t==="fa"?jY(e):t==="ar"?TY(e):t==="es"?AY(e):t==="hi"?RY(e):NY(e)}),MY=e=>`Open experiment ${e==null?void 0:e.name}`,OY=e=>`打开实验 ${e==null?void 0:e.name}`,DY=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,LY=e=>`فتح التجربة ${e==null?void 0:e.name}`,IY=e=>`Abrir el experimento ${e==null?void 0:e.name}`,$Y=e=>`${e==null?void 0:e.name} प्रयोग खोलें`,BY=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?OY(e):t==="fa"?DY(e):t==="ar"?LY(e):t==="es"?IY(e):t==="hi"?$Y(e):MY(e)}),PY=e=>`Open ${e==null?void 0:e.path} in the right pane`,FY=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,HY=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,qY=e=>`فتح ${e==null?void 0:e.path} في الجزء الأيمن`,UY=e=>`Abrir ${e==null?void 0:e.path} en el panel derecho`,GY=e=>`${e==null?void 0:e.path} को दाएं पैनल में खोलें`,VY=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?FY(e):t==="fa"?HY(e):t==="ar"?qY(e):t==="es"?UY(e):t==="hi"?GY(e):PY(e)}),KY=e=>`Open ${e==null?void 0:e.name}`,WY=e=>`打开 ${e==null?void 0:e.name}`,QY=e=>`باز کردن ${e==null?void 0:e.name}`,XY=e=>`فتح ${e==null?void 0:e.name}`,YY=e=>`Abrir ${e==null?void 0:e.name}`,ZY=e=>`${e==null?void 0:e.name} खोलें`,JY=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?WY(e):t==="fa"?QY(e):t==="ar"?XY(e):t==="es"?YY(e):t==="hi"?ZY(e):KY(e)}),eZ=e=>`Open logs for run ${e==null?void 0:e.run}`,tZ=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,nZ=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,rZ=e=>`فتح سجلات التشغيل ${e==null?void 0:e.run}`,sZ=e=>`Abrir los logs de la ejecución ${e==null?void 0:e.run}`,iZ=e=>`रन ${e==null?void 0:e.run} के लॉग खोलें`,aZ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?tZ(e):t==="fa"?nZ(e):t==="ar"?rZ(e):t==="es"?sZ(e):t==="hi"?iZ(e):eZ(e)}),oZ=e=>`Open ${e==null?void 0:e.name} on GitHub`,cZ=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,lZ=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,uZ=e=>`فتح ${e==null?void 0:e.name} على GitHub`,_Z=e=>`Abrir ${e==null?void 0:e.name} en GitHub`,fZ=e=>`${e==null?void 0:e.name} को GitHub पर खोलें`,Cv=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?cZ(e):t==="fa"?lZ(e):t==="ar"?uZ(e):t==="es"?_Z(e):t==="hi"?fZ(e):oZ(e)}),dZ=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,hZ=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,pZ=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,mZ=e=>`فتح سجلات التشغيل ${e==null?void 0:e.id} في الجزء الأيمن`,gZ=e=>`Abrir los logs de la ejecución ${e==null?void 0:e.id} en el panel derecho`,vZ=e=>`दाएं पैनल में रन ${e==null?void 0:e.id} के लॉग खोलें`,bZ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hZ(e):t==="fa"?pZ(e):t==="ar"?mZ(e):t==="es"?gZ(e):t==="hi"?vZ(e):dZ(e)}),yZ=e=>`Overleaf — ${e==null?void 0:e.status}`,xZ=e=>`Overleaf — ${e==null?void 0:e.status}`,wZ=e=>`Overleaf — ${e==null?void 0:e.status}`,kZ=e=>`Overleaf — ${e==null?void 0:e.status}`,SZ=e=>`Overleaf — ${e==null?void 0:e.status}`,CZ=e=>`Overleaf — ${e==null?void 0:e.status}`,EZ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?xZ(e):t==="fa"?wZ(e):t==="ar"?kZ(e):t==="es"?SZ(e):t==="hi"?CZ(e):yZ(e)}),NZ=e=>`Preview /${e==null?void 0:e.name} skill`,zZ=e=>`预览 /${e==null?void 0:e.name} 技能`,jZ=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,TZ=e=>`معاينة مهارة /${e==null?void 0:e.name}`,AZ=e=>`Vista previa de la skill /${e==null?void 0:e.name}`,RZ=e=>`/${e==null?void 0:e.name} स्किल का पूर्वावलोकन करें`,MZ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?zZ(e):t==="fa"?jZ(e):t==="ar"?TZ(e):t==="es"?AZ(e):t==="hi"?RZ(e):NZ(e)}),OZ=e=>`Remove annotation ${e==null?void 0:e.number}`,DZ=e=>`移除批注 ${e==null?void 0:e.number}`,LZ=e=>`حذف یادداشت ${e==null?void 0:e.number}`,IZ=e=>`إزالة التعليق ${e==null?void 0:e.number}`,$Z=e=>`Quitar la anotación ${e==null?void 0:e.number}`,BZ=e=>`एनोटेशन ${e==null?void 0:e.number} हटाएं`,PZ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?DZ(e):t==="fa"?LZ(e):t==="ar"?IZ(e):t==="es"?$Z(e):t==="hi"?BZ(e):OZ(e)}),FZ=e=>`Remove ${e==null?void 0:e.name}`,HZ=e=>`移除 ${e==null?void 0:e.name}`,qZ=e=>`حذف ${e==null?void 0:e.name}`,UZ=e=>`إزالة ${e==null?void 0:e.name}`,GZ=e=>`Quitar ${e==null?void 0:e.name}`,VZ=e=>`${e==null?void 0:e.name} हटाएं`,KZ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?HZ(e):t==="fa"?qZ(e):t==="ar"?UZ(e):t==="es"?GZ(e):t==="hi"?VZ(e):FZ(e)}),WZ=e=>`Remove queued message: ${e==null?void 0:e.text}`,QZ=e=>`移除排队消息:${e==null?void 0:e.text}`,XZ=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,YZ=e=>`إزالة الرسالة من قائمة الانتظار: ${e==null?void 0:e.text}`,ZZ=e=>`Quitar el mensaje en cola: ${e==null?void 0:e.text}`,JZ=e=>`कतार में लगा संदेश हटाएं: ${e==null?void 0:e.text}`,eJ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?QZ(e):t==="fa"?XZ(e):t==="ar"?YZ(e):t==="es"?ZZ(e):t==="hi"?JZ(e):WZ(e)}),tJ=e=>`Retry queued message: ${e==null?void 0:e.text}`,nJ=e=>`重试排队消息:${e==null?void 0:e.text}`,rJ=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,sJ=e=>`إعادة محاولة إرسال الرسالة في قائمة الانتظار: ${e==null?void 0:e.text}`,iJ=e=>`Reintentar el mensaje en cola: ${e==null?void 0:e.text}`,aJ=e=>`कतार में लगा संदेश फिर से भेजें: ${e==null?void 0:e.text}`,oJ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nJ(e):t==="fa"?rJ(e):t==="ar"?sJ(e):t==="es"?iJ(e):t==="hi"?aJ(e):tJ(e)}),cJ=e=>`Run ${e==null?void 0:e.value} in a terminal here`,lJ=e=>`在此处的终端中运行 ${e==null?void 0:e.value}`,uJ=e=>`اجرای ${e==null?void 0:e.value} در ترمینال همین‌جا`,_J=e=>`تشغيل ${e==null?void 0:e.value} في طرفية هنا`,fJ=e=>`Ejecutar ${e==null?void 0:e.value} en una terminal aquí`,dJ=e=>`${e==null?void 0:e.value} को यहाँ टर्मिनल में चलाएँ`,FE=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?lJ(e):t==="fa"?uJ(e):t==="ar"?_J(e):t==="es"?fJ(e):t==="hi"?dJ(e):cJ(e)}),hJ=e=>`Run ${e==null?void 0:e.id}`,pJ=e=>`运行 ${e==null?void 0:e.id}`,mJ=e=>`اجرای ${e==null?void 0:e.id}`,gJ=e=>`تشغيل ${e==null?void 0:e.id}`,vJ=e=>`Ejecución ${e==null?void 0:e.id}`,bJ=e=>`रन ${e==null?void 0:e.id}`,yJ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?pJ(e):t==="fa"?mJ(e):t==="ar"?gJ(e):t==="es"?vJ(e):t==="hi"?bJ(e):hJ(e)}),xJ=e=>`Show error details for ${e==null?void 0:e.activity}`,wJ=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,kJ=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,SJ=e=>`عرض تفاصيل الخطأ لـ ${e==null?void 0:e.activity}`,CJ=e=>`Mostrar los detalles del error de ${e==null?void 0:e.activity}`,EJ=e=>`${e==null?void 0:e.activity} के लिए त्रुटि विवरण दिखाएं`,NJ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wJ(e):t==="fa"?kJ(e):t==="ar"?SJ(e):t==="es"?CJ(e):t==="hi"?EJ(e):xJ(e)}),zJ=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,jJ=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,TJ=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,AJ=e=>`عرض المزيد من ${e==null?void 0:e.target} (${e==null?void 0:e.count})`,RJ=e=>`Mostrar ${e==null?void 0:e.count} ${e==null?void 0:e.target} más`,MJ=e=>`${e==null?void 0:e.count} और ${e==null?void 0:e.target} दिखाएं`,OJ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?jJ(e):t==="fa"?TJ(e):t==="ar"?AJ(e):t==="es"?RJ(e):t==="hi"?MJ(e):zJ(e)}),DJ=e=>`${e==null?void 0:e.name} skill`,LJ=e=>`${e==null?void 0:e.name} 技能`,IJ=e=>`مهارت ${e==null?void 0:e.name}`,$J=e=>`مهارة ${e==null?void 0:e.name}`,BJ=e=>`Skill ${e==null?void 0:e.name}`,PJ=e=>`${e==null?void 0:e.name} स्किल`,FJ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?LJ(e):t==="fa"?IJ(e):t==="ar"?$J(e):t==="es"?BJ(e):t==="hi"?PJ(e):DJ(e)}),HJ=e=>`Value for ${e==null?void 0:e.name}`,qJ=e=>`${e==null?void 0:e.name} 的值`,UJ=e=>`مقدار ${e==null?void 0:e.name}`,GJ=e=>`قيمة ${e==null?void 0:e.name}`,VJ=e=>`Valor de ${e==null?void 0:e.name}`,KJ=e=>`${e==null?void 0:e.name} के लिए वैल्यू`,WJ=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?qJ(e):t==="fa"?UJ(e):t==="ar"?GJ(e):t==="es"?VJ(e):t==="hi"?KJ(e):HJ(e)}),QJ=()=>"Agent reported back",XJ=()=>"智能体已返回结果",YJ=()=>"عامل نتیجه را گزارش کرد",ZJ=()=>"أبلغ الوكيل بالنتيجة",JJ=()=>"El agente informó de los resultados",eee=()=>"एजेंट ने रिपोर्ट भेजी",tee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XJ():t==="fa"?YJ():t==="ar"?ZJ():t==="es"?JJ():t==="hi"?eee():QJ()}),nee=()=>"Browse",ree=()=>"浏览",see=()=>"مرور",iee=()=>"تصفّح",aee=()=>"Navegar",oee=()=>"ब्राउज़ करें",cee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ree():t==="fa"?see():t==="ar"?iee():t==="es"?aee():t==="hi"?oee():nee()}),lee=()=>"Browsing…",uee=()=>"正在浏览…",_ee=()=>"در حال مرور…",fee=()=>"جارٍ التصفّح…",dee=()=>"Navegando…",hee=()=>"ब्राउज़ कर रहा है…",pee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uee():t==="fa"?_ee():t==="ar"?fee():t==="es"?dee():t==="hi"?hee():lee()}),mee=()=>"Checked experiment status and updated notes",gee=()=>"已检查实验状态并更新笔记",vee=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",bee=()=>"فحص حالة التجربة وحدّث الملاحظات",yee=()=>"Consultó el estado del experimento y actualizó las notas",xee=()=>"प्रयोग की स्थिति जाँची और नोट्स अपडेट किए",wee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gee():t==="fa"?vee():t==="ar"?bee():t==="es"?yee():t==="hi"?xee():mee()}),kee=()=>"Closed an agent",See=()=>"已关闭智能体",Cee=()=>"عامل بسته شد",Eee=()=>"أغلق وكيلًا",Nee=()=>"Cerró un agente",zee=()=>"एक एजेंट बंद किया",jee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?See():t==="fa"?Cee():t==="ar"?Eee():t==="es"?Nee():t==="hi"?zee():kee()}),Tee=()=>"Context compacted",Aee=()=>"上下文已压缩",Ree=()=>"زمینه فشرده شد",Mee=()=>"تم ضغط السياق",Oee=()=>"Contexto comprimido",Dee=()=>"कॉन्टेक्स्ट छोटा किया गया",Lee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Aee():t==="fa"?Ree():t==="ar"?Mee():t==="es"?Oee():t==="hi"?Dee():Tee()}),Iee=()=>"Compacting conversation…",$ee=()=>"正在压缩对话…",Bee=()=>"در حال فشرده‌سازی گفت‌وگو…",Pee=()=>"جارٍ ضغط المحادثة…",Fee=()=>"Comprimiendo la conversación…",Hee=()=>"बातचीत छोटी की जा रही है…",HE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$ee():t==="fa"?Bee():t==="ar"?Pee():t==="es"?Fee():t==="hi"?Hee():Iee()}),qee=()=>"Compacting failed",Uee=()=>"压缩失败",Gee=()=>"فشرده‌سازی ناموفق بود",Vee=()=>"فشل الضغط",Kee=()=>"Error al comprimir",Wee=()=>"छोटा करना विफल",Qee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uee():t==="fa"?Gee():t==="ar"?Vee():t==="es"?Kee():t==="hi"?Wee():qee()}),Xee=e=>`Created ${e==null?void 0:e.target}`,Yee=e=>`已创建 ${e==null?void 0:e.target}`,Zee=e=>`${e==null?void 0:e.target} ایجاد شد`,Jee=e=>`أنشأ ${e==null?void 0:e.target}`,ete=e=>`Creó ${e==null?void 0:e.target}`,tte=e=>`${e==null?void 0:e.target} बनाया`,nte=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Yee(e):t==="fa"?Zee(e):t==="ar"?Jee(e):t==="es"?ete(e):t==="hi"?tte(e):Xee(e)}),rte=()=>"Delegate",ste=()=>"委派",ite=()=>"واگذاری",ate=()=>"تفويض",ote=()=>"Delegar",cte=()=>"सौंपें",lte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ste():t==="fa"?ite():t==="ar"?ate():t==="es"?ote():t==="hi"?cte():rte()}),ute=()=>"Delegating…",_te=()=>"正在委派…",fte=()=>"در حال واگذاری…",dte=()=>"جارٍ التفويض…",hte=()=>"Delegando…",pte=()=>"सौंप रहा है…",mte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_te():t==="fa"?fte():t==="ar"?dte():t==="es"?hte():t==="hi"?pte():ute()}),gte=e=>`Deleted ${e==null?void 0:e.target}`,vte=e=>`已删除 ${e==null?void 0:e.target}`,bte=e=>`${e==null?void 0:e.target} حذف شد`,yte=e=>`حذف ${e==null?void 0:e.target}`,xte=e=>`Eliminó ${e==null?void 0:e.target}`,wte=e=>`${e==null?void 0:e.target} हटाया`,kte=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?vte(e):t==="fa"?bte(e):t==="ar"?yte(e):t==="es"?xte(e):t==="hi"?wte(e):gte(e)}),Ste=()=>"Edit",Cte=()=>"编辑",Ete=()=>"ویرایش",Nte=()=>"تعديل",zte=()=>"Editar",jte=()=>"संपादित करें",Tte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cte():t==="fa"?Ete():t==="ar"?Nte():t==="es"?zte():t==="hi"?jte():Ste()}),Ate=e=>`Edited ${e==null?void 0:e.target}`,Rte=e=>`已编辑 ${e==null?void 0:e.target}`,Mte=e=>`${e==null?void 0:e.target} ویرایش شد`,Ote=e=>`عدّل ${e==null?void 0:e.target}`,Dte=e=>`Editó ${e==null?void 0:e.target}`,Lte=e=>`${e==null?void 0:e.target} संपादित किया`,Ite=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Rte(e):t==="fa"?Mte(e):t==="ar"?Ote(e):t==="es"?Dte(e):t==="hi"?Lte(e):Ate(e)}),$te=()=>"Editing…",Bte=()=>"正在编辑…",Pte=()=>"در حال ویرایش…",Fte=()=>"جارٍ التعديل…",Hte=()=>"Editando…",qte=()=>"संपादित कर रहा है…",Ute=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bte():t==="fa"?Pte():t==="ar"?Fte():t==="es"?Hte():t==="hi"?qte():$te()}),Gte=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,Vte=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,Kte=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,Wte=e=>`${e==null?void 0:e.activity} عن «${e==null?void 0:e.query}»`,Qte=e=>`${e==null?void 0:e.activity}: “${e==null?void 0:e.query}”`,Xte=e=>`“${e==null?void 0:e.query}” के लिए ${e==null?void 0:e.activity}`,Yte=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Vte(e):t==="fa"?Kte(e):t==="ar"?Wte(e):t==="es"?Qte(e):t==="hi"?Xte(e):Gte(e)}),Zte=()=>"Imported from your terminal — new turns continue in the agent's own history",Jte=()=>"从你的终端导入 — 新的回合将在智能体自己的历史中继续",ene=()=>"از ترمینال شما وارد شد — نوبت‌های جدید در تاریخچهٔ خود عامل ادامه می‌یابند",tne=()=>"مستورد من طرفيتك — الجولات الجديدة تتابع في سجل الوكيل نفسه",nne=()=>"Importado desde tu terminal — los turnos nuevos continúan en el historial del agente",rne=()=>"आपके टर्मिनल से इम्पोर्ट किया गया — नए टर्न एजेंट के अपने इतिहास में जारी रहेंगे",sne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jte():t==="fa"?ene():t==="ar"?tne():t==="es"?nne():t==="hi"?rne():Zte()}),ine=e=>`Listed files matching ${e==null?void 0:e.pattern}`,ane=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,one=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,cne=e=>`سرد الملفات المطابقة لـ ${e==null?void 0:e.pattern}`,lne=e=>`Listó archivos que coinciden con ${e==null?void 0:e.pattern}`,une=e=>`${e==null?void 0:e.pattern} से मेल खाती फ़ाइलों की सूची बनाई`,_ne=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ane(e):t==="fa"?one(e):t==="ar"?cne(e):t==="es"?lne(e):t==="hi"?une(e):ine(e)}),fne=()=>"Load",dne=()=>"加载",hne=()=>"بارگیری",pne=()=>"تحميل",mne=()=>"Cargar",gne=()=>"लोड करें",vne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dne():t==="fa"?hne():t==="ar"?pne():t==="es"?mne():t==="hi"?gne():fne()}),bne=()=>"Loaded a skill",yne=()=>"已加载技能",xne=()=>"یک مهارت بارگیری شد",wne=()=>"حمّل مهارة",kne=()=>"Cargó una skill",Sne=()=>"एक स्किल लोड की",Cne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yne():t==="fa"?xne():t==="ar"?wne():t==="es"?kne():t==="hi"?Sne():bne()}),Ene=e=>`Loaded ${e==null?void 0:e.name} skill`,Nne=e=>`已加载技能 ${e==null?void 0:e.name}`,zne=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,jne=e=>`حمّل مهارة ${e==null?void 0:e.name}`,Tne=e=>`Cargó la skill ${e==null?void 0:e.name}`,Ane=e=>`${e==null?void 0:e.name} स्किल लोड की`,Rne=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Nne(e):t==="fa"?zne(e):t==="ar"?jne(e):t==="es"?Tne(e):t==="hi"?Ane(e):Ene(e)}),Mne=()=>"Loading…",One=()=>"正在加载…",Dne=()=>"در حال بارگیری…",Lne=()=>"جارٍ التحميل…",Ine=()=>"Cargando…",$ne=()=>"लोड हो रहा है…",Bne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?One():t==="fa"?Dne():t==="ar"?Lne():t==="es"?Ine():t==="hi"?$ne():Mne()}),Pne=e=>`Opened ${e==null?void 0:e.target}`,Fne=e=>`已打开 ${e==null?void 0:e.target}`,Hne=e=>`${e==null?void 0:e.target} باز شد`,qne=e=>`فتح ${e==null?void 0:e.target}`,Une=e=>`Abrió ${e==null?void 0:e.target}`,Gne=e=>`${e==null?void 0:e.target} खोला`,Vne=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Fne(e):t==="fa"?Hne(e):t==="ar"?qne(e):t==="es"?Une(e):t==="hi"?Gne(e):Pne(e)}),Kne=e=>`Ran ${e==null?void 0:e.command}`,Wne=e=>`已运行 ${e==null?void 0:e.command}`,Qne=e=>`${e==null?void 0:e.command} اجرا شد`,Xne=e=>`نفّذ ${e==null?void 0:e.command}`,Yne=e=>`Ejecutó ${e==null?void 0:e.command}`,Zne=e=>`${e==null?void 0:e.command} चलाया`,Jne=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Wne(e):t==="fa"?Qne(e):t==="ar"?Xne(e):t==="es"?Yne(e):t==="hi"?Zne(e):Kne(e)}),ere=()=>"Ran a sub-agent",tre=()=>"已运行子智能体",nre=()=>"یک عامل فرعی اجرا شد",rre=()=>"شغّل وكيلًا فرعيًا",sre=()=>"Ejecutó un subagente",ire=()=>"एक सब-एजेंट चलाया",are=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tre():t==="fa"?nre():t==="ar"?rre():t==="es"?sre():t==="hi"?ire():ere()}),ore=()=>"Read",cre=()=>"读取",lre=()=>"خواندن",ure=()=>"قراءة",_re=()=>"Leer",fre=()=>"पढ़ें",dre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cre():t==="fa"?lre():t==="ar"?ure():t==="es"?_re():t==="hi"?fre():ore()}),hre=()=>"Read experiment notes",pre=()=>"已读取实验笔记",mre=()=>"یادداشت‌های آزمایش خوانده شد",gre=()=>"قرأ ملاحظات التجربة",vre=()=>"Leyó las notas del experimento",bre=()=>"प्रयोग के नोट्स पढ़े",yre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pre():t==="fa"?mre():t==="ar"?gre():t==="es"?vre():t==="hi"?bre():hre()}),xre=()=>"Read a paper",wre=()=>"已读取论文",kre=()=>"یک مقاله خوانده شد",Sre=()=>"قرأ ورقة",Cre=()=>"Leyó un paper",Ere=()=>"एक पेपर पढ़ा",Nre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wre():t==="fa"?kre():t==="ar"?Sre():t==="es"?Cre():t==="hi"?Ere():xre()}),zre=e=>`Read ${e==null?void 0:e.name} skill`,jre=e=>`已读取技能 ${e==null?void 0:e.name}`,Tre=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,Are=e=>`قرأ مهارة ${e==null?void 0:e.name}`,Rre=e=>`Leyó la skill ${e==null?void 0:e.name}`,Mre=e=>`${e==null?void 0:e.name} स्किल पढ़ी`,W2=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?jre(e):t==="fa"?Tre(e):t==="ar"?Are(e):t==="es"?Rre(e):t==="hi"?Mre(e):zre(e)}),Ore=e=>`Read ${e==null?void 0:e.target}`,Dre=e=>`已读取 ${e==null?void 0:e.target}`,Lre=e=>`${e==null?void 0:e.target} خوانده شد`,Ire=e=>`قرأ ${e==null?void 0:e.target}`,$re=e=>`Leyó ${e==null?void 0:e.target}`,Bre=e=>`${e==null?void 0:e.target} पढ़ा`,Bp=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Dre(e):t==="fa"?Lre(e):t==="ar"?Ire(e):t==="es"?$re(e):t==="hi"?Bre(e):Ore(e)}),Pre=()=>"Read a web page",Fre=()=>"已读取网页",Hre=()=>"یک صفحهٔ وب خوانده شد",qre=()=>"قرأ صفحة ويب",Ure=()=>"Leyó una página web",Gre=()=>"एक वेब पेज पढ़ा",Vre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fre():t==="fa"?Hre():t==="ar"?qre():t==="es"?Ure():t==="hi"?Gre():Pre()}),Kre=()=>"Reading…",Wre=()=>"正在读取…",Qre=()=>"در حال خواندن…",Xre=()=>"جارٍ القراءة…",Yre=()=>"Leyendo…",Zre=()=>"पढ़ रहा है…",Jre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wre():t==="fa"?Qre():t==="ar"?Xre():t==="es"?Yre():t==="hi"?Zre():Kre()}),ese=()=>"Resumed an agent",tse=()=>"已恢复智能体",nse=()=>"عامل از سر گرفته شد",rse=()=>"استأنف عمل وكيل",sse=()=>"Reanudó un agente",ise=()=>"एक एजेंट फिर से शुरू किया",ase=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tse():t==="fa"?nse():t==="ar"?rse():t==="es"?sse():t==="hi"?ise():ese()}),ose=()=>"Review",cse=()=>"查看",lse=()=>"بازبینی",use=()=>"مراجعة",_se=()=>"Revisar",fse=()=>"समीक्षा करें",dse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cse():t==="fa"?lse():t==="ar"?use():t==="es"?_se():t==="hi"?fse():ose()}),hse=()=>"Reviewed run log",pse=()=>"已查看运行日志",mse=()=>"گزارش اجرا بازبینی شد",gse=()=>"راجع سجل التشغيل",vse=()=>"Revisó el log de la ejecución",bse=()=>"रन लॉग की समीक्षा की",yse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pse():t==="fa"?mse():t==="ar"?gse():t==="es"?vse():t==="hi"?bse():hse()}),xse=()=>"Reviewed run logs",wse=()=>"已查看运行日志",kse=()=>"گزارش‌های اجرا بازبینی شد",Sse=()=>"راجع سجلات التشغيل",Cse=()=>"Revisó los logs de las ejecuciones",Ese=()=>"रन लॉग की समीक्षा की",Nse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wse():t==="fa"?kse():t==="ar"?Sse():t==="es"?Cse():t==="hi"?Ese():xse()}),zse=()=>"Reviewed experiment status and notes",jse=()=>"已查看实验状态和笔记",Tse=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",Ase=()=>"راجع حالة التجربة وملاحظاتها",Rse=()=>"Revisó el estado y las notas del experimento",Mse=()=>"प्रयोग की स्थिति और नोट्स की समीक्षा की",Ose=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jse():t==="fa"?Tse():t==="ar"?Ase():t==="es"?Rse():t==="hi"?Mse():zse()}),Dse=()=>"Reviewing…",Lse=()=>"正在查看…",Ise=()=>"در حال بازبینی…",$se=()=>"جارٍ المراجعة…",Bse=()=>"Revisando…",Pse=()=>"समीक्षा कर रहा है…",Fse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lse():t==="fa"?Ise():t==="ar"?$se():t==="es"?Bse():t==="hi"?Pse():Dse()}),Hse=()=>"Run",qse=()=>"运行",Use=()=>"اجرا",Gse=()=>"تشغيل",Vse=()=>"Ejecutar",Kse=()=>"चलाएं",Wse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qse():t==="fa"?Use():t==="ar"?Gse():t==="es"?Vse():t==="hi"?Kse():Hse()}),Qse=()=>"Running…",Xse=()=>"正在运行…",Yse=()=>"در حال اجرا…",Zse=()=>"جارٍ التشغيل…",Jse=()=>"Ejecutando…",eie=()=>"चल रहा है…",bD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xse():t==="fa"?Yse():t==="ar"?Zse():t==="es"?Jse():t==="hi"?eie():Qse()}),tie=()=>"Search",nie=()=>"搜索",rie=()=>"جست‌وجو",sie=()=>"بحث",iie=()=>"Buscar",aie=()=>"खोजें",oie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nie():t==="fa"?rie():t==="ar"?sie():t==="es"?iie():t==="hi"?aie():tie()}),cie=()=>"Searched alphaXiv full text",lie=()=>"已搜索 alphaXiv 全文",uie=()=>"متن کامل alphaXiv جست‌وجو شد",_ie=()=>"بحث في نص alphaXiv الكامل",fie=()=>"Buscó en el texto completo de alphaXiv",die=()=>"alphaXiv का पूरा टेक्स्ट खोजा",hie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lie():t==="fa"?uie():t==="ar"?_ie():t==="es"?fie():t==="hi"?die():cie()}),pie=()=>"Searched alphaXiv semantically",mie=()=>"已对 alphaXiv 进行语义搜索",gie=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",vie=()=>"أجرى بحثًا دلاليًا في alphaXiv",bie=()=>"Hizo una búsqueda semántica en alphaXiv",yie=()=>"alphaXiv को सिमेंटिक रूप से खोजा",xie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mie():t==="fa"?gie():t==="ar"?vie():t==="es"?bie():t==="hi"?yie():pie()}),wie=()=>"Searched bioRxiv",kie=()=>"已搜索 bioRxiv",Sie=()=>"bioRxiv جست‌وجو شد",Cie=()=>"بحث في bioRxiv",Eie=()=>"Buscó en bioRxiv",Nie=()=>"bioRxiv खोजा",zie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kie():t==="fa"?Sie():t==="ar"?Cie():t==="es"?Eie():t==="hi"?Nie():wie()}),jie=()=>"Searched code",Tie=()=>"已搜索代码",Aie=()=>"کد جست‌وجو شد",Rie=()=>"بحث في الشيفرة",Mie=()=>"Buscó en el código",Oie=()=>"कोड खोजा",Q2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tie():t==="fa"?Aie():t==="ar"?Rie():t==="es"?Mie():t==="hi"?Oie():jie()}),Die=e=>`Searched code for “${e==null?void 0:e.pattern}”`,Lie=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,Iie=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,$ie=e=>`بحث في الشيفرة عن «${e==null?void 0:e.pattern}»`,Bie=e=>`Buscó “${e==null?void 0:e.pattern}” en el código`,Pie=e=>`“${e==null?void 0:e.pattern}” के लिए कोड खोजा`,X2=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Lie(e):t==="fa"?Iie(e):t==="ar"?$ie(e):t==="es"?Bie(e):t==="hi"?Pie(e):Die(e)}),Fie=e=>`Searched images for “${e==null?void 0:e.query}”`,Hie=e=>`已搜索图片“${e==null?void 0:e.query}”`,qie=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,Uie=e=>`بحث في الصور عن «${e==null?void 0:e.query}»`,Gie=e=>`Buscó imágenes de “${e==null?void 0:e.query}”`,Vie=e=>`“${e==null?void 0:e.query}” के लिए इमेज खोजीं`,Kie=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Hie(e):t==="fa"?qie(e):t==="ar"?Uie(e):t==="es"?Gie(e):t==="hi"?Vie(e):Fie(e)}),Wie=()=>"Searched the literature",Qie=()=>"已搜索文献",Xie=()=>"منابع علمی جست‌وجو شد",Yie=()=>"بحث في الأدبيات",Zie=()=>"Buscó en la literatura",Jie=()=>"साहित्य खोजा",qE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qie():t==="fa"?Xie():t==="ar"?Yie():t==="es"?Zie():t==="hi"?Jie():Wie()}),eae=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,tae=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,nae=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,rae=e=>`بحث عن «${e==null?void 0:e.pattern}» في صفحة`,sae=e=>`Buscó “${e==null?void 0:e.pattern}” en una página`,iae=e=>`पेज पर “${e==null?void 0:e.pattern}” खोजा`,aae=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?tae(e):t==="fa"?nae(e):t==="ar"?rae(e):t==="es"?sae(e):t==="hi"?iae(e):eae(e)}),oae=()=>"Searched OpenAlex",cae=()=>"已搜索 OpenAlex",lae=()=>"OpenAlex جست‌وجو شد",uae=()=>"بحث في OpenAlex",_ae=()=>"Buscó en OpenAlex",fae=()=>"OpenAlex खोजा",dae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cae():t==="fa"?lae():t==="ar"?uae():t==="es"?_ae():t==="hi"?fae():oae()}),hae=()=>"Searched PubMed",pae=()=>"已搜索 PubMed",mae=()=>"PubMed جست‌وجو شد",gae=()=>"بحث في PubMed",vae=()=>"Buscó en PubMed",bae=()=>"PubMed खोजा",yae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pae():t==="fa"?mae():t==="ar"?gae():t==="es"?vae():t==="hi"?bae():hae()}),xae=e=>`Searched the web for “${e==null?void 0:e.query}”`,wae=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,kae=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,Sae=e=>`بحث في الويب عن «${e==null?void 0:e.query}»`,Cae=e=>`Buscó “${e==null?void 0:e.query}” en la web`,Eae=e=>`“${e==null?void 0:e.query}” के लिए वेब खोजा`,UE=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wae(e):t==="fa"?kae(e):t==="ar"?Sae(e):t==="es"?Cae(e):t==="hi"?Eae(e):xae(e)}),Nae=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,zae=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,jae=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,Tae=e=>`بحث في صفحة ويب عن «${e==null?void 0:e.pattern}»`,Aae=e=>`Buscó “${e==null?void 0:e.pattern}” en una página web`,Rae=e=>`“${e==null?void 0:e.pattern}” के लिए एक वेब पेज खोजा`,Mae=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?zae(e):t==="fa"?jae(e):t==="ar"?Tae(e):t==="es"?Aae(e):t==="hi"?Rae(e):Nae(e)}),Oae=()=>"Searching…",Dae=()=>"正在搜索…",Lae=()=>"در حال جست‌وجو…",Iae=()=>"جارٍ البحث…",$ae=()=>"Buscando…",Bae=()=>"खोज रहा है…",Pae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dae():t==="fa"?Lae():t==="ar"?Iae():t==="es"?$ae():t==="hi"?Bae():Oae()}),Fae=()=>"Sent input to an agent",Hae=()=>"已向智能体发送输入",qae=()=>"ورودی به عامل فرستاده شد",Uae=()=>"أرسل مدخلًا إلى وكيل",Gae=()=>"Envió información a un agente",Vae=()=>"एक एजेंट को इनपुट भेजा",Kae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hae():t==="fa"?qae():t==="ar"?Uae():t==="es"?Gae():t==="hi"?Vae():Fae()}),Wae=()=>"Spawned an agent",Qae=()=>"已创建智能体",Xae=()=>"یک عامل ساخته شد",Yae=()=>"أنشأ وكيلًا",Zae=()=>"Creó un agente",Jae=()=>"एक एजेंट शुरू किया",eoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qae():t==="fa"?Xae():t==="ar"?Yae():t==="es"?Zae():t==="hi"?Jae():Wae()}),toe=()=>"Sub-agent",noe=()=>"子智能体",roe=()=>"عامل فرعی",soe=()=>"وكيل فرعي",ioe=()=>"Subagente",aoe=()=>"सब-एजेंट",ooe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?noe():t==="fa"?roe():t==="ar"?soe():t==="es"?ioe():t==="hi"?aoe():toe()}),coe=()=>"Sub-agent interrupted",loe=()=>"子智能体已中断",uoe=()=>"عامل فرعی متوقف شد",_oe=()=>"قُوطع الوكيل الفرعي",foe=()=>"Subagente interrumpido",doe=()=>"सब-एजेंट बाधित हुआ",hoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?loe():t==="fa"?uoe():t==="ar"?_oe():t==="es"?foe():t==="hi"?doe():coe()}),poe=()=>"Sub-agent started",moe=()=>"子智能体已启动",goe=()=>"عامل فرعی آغاز شد",voe=()=>"بدأ الوكيل الفرعي",boe=()=>"Subagente iniciado",yoe=()=>"सब-एजेंट शुरू हुआ",xoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?moe():t==="fa"?goe():t==="ar"?voe():t==="es"?boe():t==="hi"?yoe():poe()}),woe=()=>"Updated experiment notes",koe=()=>"已更新实验笔记",Soe=()=>"یادداشت‌های آزمایش به‌روز شد",Coe=()=>"حدّث ملاحظات التجربة",Eoe=()=>"Actualizó las notas del experimento",Noe=()=>"प्रयोग के नोट्स अपडेट किए",zoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?koe():t==="fa"?Soe():t==="ar"?Coe():t==="es"?Eoe():t==="hi"?Noe():woe()}),joe=()=>"Waiting on an agent",Toe=()=>"正在等待智能体",Aoe=()=>"در انتظار عامل",Roe=()=>"في انتظار وكيل",Moe=()=>"Esperando a un agente",Ooe=()=>"एजेंट का इंतज़ार है",Doe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Toe():t==="fa"?Aoe():t==="ar"?Roe():t==="es"?Moe():t==="hi"?Ooe():joe()}),Loe=e=>`Approval required: ${e==null?void 0:e.label}`,Ioe=e=>`需要批准:${e==null?void 0:e.label}`,$oe=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,Boe=e=>`الموافقة مطلوبة: ${e==null?void 0:e.label}`,Poe=e=>`Aprobación necesaria: ${e==null?void 0:e.label}`,Foe=e=>`स्वीकृति ज़रूरी है: ${e==null?void 0:e.label}`,GE=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ioe(e):t==="fa"?$oe(e):t==="ar"?Boe(e):t==="es"?Poe(e):t==="hi"?Foe(e):Loe(e)}),Hoe=()=>"The CLI is retrying the turn.",qoe=()=>"CLI 正在重试本轮。",Uoe=()=>"CLI در حال تلاش دوباره برای این نوبت است.",Goe=()=>"تحاول واجهة سطر الأوامر تنفيذ الجولة مجددًا.",Voe=()=>"La CLI está reintentando el turno.",Koe=()=>"CLI टर्न फिर से कोशिश कर रहा है।",Woe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qoe():t==="fa"?Uoe():t==="ar"?Goe():t==="es"?Voe():t==="hi"?Koe():Hoe()}),Qoe=()=>"Continue is available.",Xoe=()=>"可以继续。",Yoe=()=>"ادامه در دسترس است.",Zoe=()=>"المتابعة متاحة.",Joe=()=>"Puedes continuar.",ece=()=>"जारी रखना उपलब्ध है।",tce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xoe():t==="fa"?Yoe():t==="ar"?Zoe():t==="es"?Joe():t==="hi"?ece():Qoe()}),nce=()=>"Retry is available.",rce=()=>"可以重试。",sce=()=>"تلاش دوباره در دسترس است.",ice=()=>"إعادة المحاولة متاحة.",ace=()=>"Puedes reintentarlo.",oce=()=>"फिर से कोशिश करना उपलब्ध है।",cce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rce():t==="fa"?sce():t==="ar"?ice():t==="es"?ace():t==="hi"?oce():nce()}),lce=()=>"Running a tool",uce=()=>"正在运行工具",_ce=()=>"در حال اجرای ابزار",fce=()=>"جارٍ تشغيل أداة",dce=()=>"Ejecutando una herramienta",hce=()=>"एक टूल चल रहा है",pce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uce():t==="fa"?_ce():t==="ar"?fce():t==="es"?dce():t==="hi"?hce():lce()}),mce=()=>"Tool activity completed",gce=()=>"工具活动已完成",vce=()=>"فعالیت ابزار کامل شد",bce=()=>"اكتمل نشاط الأداة",yce=()=>"Actividad de la herramienta completada",xce=()=>"टूल गतिविधि पूरी हुई",wce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gce():t==="fa"?vce():t==="ar"?bce():t==="es"?yce():t==="hi"?xce():mce()}),kce=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,Sce=e=>`工具活动失败:${e==null?void 0:e.labels}`,Cce=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,Ece=e=>`فشل نشاط الأداة: ${e==null?void 0:e.labels}`,Nce=e=>`Error en la actividad de la herramienta: ${e==null?void 0:e.labels}`,zce=e=>`टूल गतिविधि विफल: ${e==null?void 0:e.labels}`,jce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Sce(e):t==="fa"?Cce(e):t==="ar"?Ece(e):t==="es"?Nce(e):t==="hi"?zce(e):kce(e)}),Tce=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,Ace=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,Rce=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,Mce=e=>`فشل ${e==null?void 0:e.count} من أنشطة الأدوات: ${e==null?void 0:e.labels}`,Oce=e=>`Actividades de herramientas con error (${e==null?void 0:e.count}): ${e==null?void 0:e.labels}`,Dce=e=>`${e==null?void 0:e.count} टूल गतिविधियाँ विफल: ${e==null?void 0:e.labels}`,Lce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ace(e):t==="fa"?Rce(e):t==="ar"?Mce(e):t==="es"?Oce(e):t==="hi"?Dce(e):Tce(e)}),Ice=()=>"Turn did not finish.",$ce=()=>"本轮未完成。",Bce=()=>"این نوبت کامل نشد.",Pce=()=>"لم تكتمل الجولة.",Fce=()=>"El turno no terminó.",Hce=()=>"यह टर्न पूरा नहीं हुआ।",qce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$ce():t==="fa"?Bce():t==="ar"?Pce():t==="es"?Fce():t==="hi"?Hce():Ice()}),Uce=()=>"Artifacts",Gce=()=>"产物",Vce=()=>"خروجی‌ها",Kce=()=>"المُخرَجات",Wce=()=>"Artefactos",Qce=()=>"आर्टिफ़ैक्ट",yD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gce():t==="fa"?Vce():t==="ar"?Kce():t==="es"?Wce():t==="hi"?Qce():Uce()}),Xce=()=>"Close panel",Yce=()=>"关闭面板",Zce=()=>"بستن پنل",Jce=()=>"إغلاق اللوحة",ele=()=>"Cerrar panel",tle=()=>"पैनल बंद करें",T0=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yce():t==="fa"?Zce():t==="ar"?Jce():t==="es"?ele():t==="hi"?tle():Xce()}),nle=()=>"Current task",rle=()=>"当前任务",sle=()=>"وظیفهٔ فعلی",ile=()=>"المهمة الحالية",ale=()=>"Tarea actual",ole=()=>"मौजूदा टास्क",VE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rle():t==="fa"?sle():t==="ar"?ile():t==="es"?ale():t==="hi"?ole():nle()}),cle=()=>"Drag to resize panel",lle=()=>"拖动以调整面板大小",ule=()=>"برای تغییر اندازهٔ پنل بکشید",_le=()=>"اسحب لتغيير حجم اللوحة",fle=()=>"Arrastra para cambiar el tamaño del panel",dle=()=>"पैनल का आकार बदलने के लिए खींचें",hle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lle():t==="fa"?ule():t==="ar"?_le():t==="es"?fle():t==="hi"?dle():cle()}),ple=()=>"Drag toward the center to restore panel",mle=()=>"向中央拖动以恢复面板",gle=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",vle=()=>"اسحب نحو المنتصف لاستعادة اللوحة",ble=()=>"Arrastra hacia el centro para restaurar el panel",yle=()=>"पैनल वापस लाने के लिए बीच की ओर खींचें",xle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mle():t==="fa"?gle():t==="ar"?vle():t==="es"?ble():t==="hi"?yle():ple()}),wle=()=>"Entire project",kle=()=>"整个项目",Sle=()=>"کل پروژه",Cle=()=>"المشروع بالكامل",Ele=()=>"Todo el proyecto",Nle=()=>"पूरा प्रोजेक्ट",KE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kle():t==="fa"?Sle():t==="ar"?Cle():t==="es"?Ele():t==="hi"?Nle():wle()}),zle=()=>"Expand panel",jle=()=>"展开面板",Tle=()=>"گسترش پنل",Ale=()=>"توسيع اللوحة",Rle=()=>"Expandir panel",Mle=()=>"पैनल फैलाएं",WE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jle():t==="fa"?Tle():t==="ar"?Ale():t==="es"?Rle():t==="hi"?Mle():zle()}),Ole=e=>`Experiment filter: ${e==null?void 0:e.scope}`,Dle=e=>`实验筛选:${e==null?void 0:e.scope}`,Lle=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,Ile=e=>`تصفية التجارب: ${e==null?void 0:e.scope}`,$le=e=>`Filtro de experimentos: ${e==null?void 0:e.scope}`,Ble=e=>`प्रयोग फ़िल्टर: ${e==null?void 0:e.scope}`,Ple=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Dle(e):t==="fa"?Lle(e):t==="ar"?Ile(e):t==="es"?$le(e):t==="hi"?Ble(e):Ole(e)}),Fle=()=>"Experiment view",Hle=()=>"实验视图",qle=()=>"نمای آزمایش",Ule=()=>"عرض التجربة",Gle=()=>"Vista de experimento",Vle=()=>"प्रयोग व्यू",Kle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hle():t==="fa"?qle():t==="ar"?Ule():t==="es"?Gle():t==="hi"?Vle():Fle()}),Wle=()=>"Experiments",Qle=()=>"实验",Xle=()=>"آزمایش‌ها",Yle=()=>"التجارب",Zle=()=>"Experimentos",Jle=()=>"प्रयोग",xD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qle():t==="fa"?Xle():t==="ar"?Yle():t==="es"?Zle():t==="hi"?Jle():Wle()}),eue=()=>"Files",tue=()=>"文件",nue=()=>"فایل‌ها",rue=()=>"الملفات",sue=()=>"Archivos",iue=()=>"फ़ाइलें",a3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tue():t==="fa"?nue():t==="ar"?rue():t==="es"?sue():t==="hi"?iue():eue()}),aue=()=>"Filter experiments",oue=()=>"筛选实验",cue=()=>"فیلتر آزمایش‌ها",lue=()=>"تصفية التجارب",uue=()=>"Filtrar experimentos",_ue=()=>"प्रयोग फ़िल्टर करें",fue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oue():t==="fa"?cue():t==="ar"?lue():t==="es"?uue():t==="hi"?_ue():aue()}),due=()=>"Current task filtering is unavailable for unattributed experiments",hue=()=>"存在无法归属的实验时,不能按当前任务筛选",pue=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",mue=()=>"تصفية المهمة الحالية غير متاحة للتجارب غير المنسوبة",gue=()=>"No se puede filtrar por la tarea actual en experimentos sin tarea asignada",vue=()=>"बिना श्रेय वाले प्रयोगों के लिए मौजूदा टास्क फ़िल्टरिंग उपलब्ध नहीं है",bue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hue():t==="fa"?pue():t==="ar"?mue():t==="es"?gue():t==="hi"?vue():due()}),yue=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",xue=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",wue=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",kue=()=>"لا توجد تجارب من المهمة الحالية بعد. بدّل إلى «المشروع بالكامل» لرؤية جميع التجارب.",Sue=()=>"Aún no hay experimentos de la tarea actual. Cambia a Todo el proyecto para ver todos los experimentos.",Cue=()=>"मौजूदा टास्क से अभी तक कोई प्रयोग नहीं। सभी प्रयोग देखने के लिए पूरा प्रोजेक्ट पर स्विच करें।",Eue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xue():t==="fa"?wue():t==="ar"?kue():t==="es"?Sue():t==="hi"?Cue():yue()}),Nue=()=>"Open a task to filter to its experiments",zue=()=>"请打开一个任务以筛选其实验",jue=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",Tue=()=>"افتح مهمة لعرض تجاربها فقط",Aue=()=>"Abre una tarea para filtrar por sus experimentos",Rue=()=>"इसके प्रयोगों तक फ़िल्टर करने के लिए एक टास्क खोलें",Mue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zue():t==="fa"?jue():t==="ar"?Tue():t==="es"?Aue():t==="hi"?Rue():Nue()}),Oue=()=>"projects",Due=()=>"项目",Lue=()=>"پروژه‌ها",Iue=()=>"المشاريع",$ue=()=>"los proyectos",Bue=()=>"प्रोजेक्ट",_0=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Due():t==="fa"?Lue():t==="ar"?Iue():t==="es"?$ue():t==="hi"?Bue():Oue()}),Pue=()=>"Restore panel",Fue=()=>"还原面板",Hue=()=>"بازگرداندن اندازهٔ پنل",que=()=>"استعادة اللوحة",Uue=()=>"Restaurar panel",Gue=()=>"पैनल वापस लाएं",QE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fue():t==="fa"?Hue():t==="ar"?que():t==="es"?Uue():t==="hi"?Gue():Pue()}),Vue=()=>"Retry",Kue=()=>"重试",Wue=()=>"تلاش دوباره",Que=()=>"إعادة المحاولة",Xue=()=>"Reintentar",Yue=()=>"फिर से कोशिश करें",Qs=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kue():t==="fa"?Wue():t==="ar"?Que():t==="es"?Xue():t==="hi"?Yue():Vue()}),Zue=()=>"Select a project to browse its files.",Jue=()=>"选择一个项目以浏览其文件。",e_e=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",t_e=()=>"اختر مشروعًا لتصفح ملفاته.",n_e=()=>"Selecciona un proyecto para explorar sus archivos.",r_e=()=>"फ़ाइलें ब्राउज़ करने के लिए एक प्रोजेक्ट चुनें।",s_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jue():t==="fa"?e_e():t==="ar"?t_e():t==="es"?n_e():t==="hi"?r_e():Zue()}),i_e=()=>"settings",a_e=()=>"设置",o_e=()=>"تنظیمات",c_e=()=>"الإعدادات",l_e=()=>"la configuración",u_e=()=>"सेटिंग्स",__e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a_e():t==="fa"?o_e():t==="ar"?c_e():t==="es"?l_e():t==="hi"?u_e():i_e()}),f_e=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,d_e=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,h_e=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,p_e=e=>`تعذّر تحميل ${e==null?void 0:e.items} في OpenResearch.`,m_e=e=>`Error al cargar ${e==null?void 0:e.items} de OpenResearch.`,g_e=e=>`OpenResearch ${e==null?void 0:e.items} लोड नहीं हो सके।`,v_e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?d_e(e):t==="fa"?h_e(e):t==="ar"?p_e(e):t==="es"?m_e(e):t==="hi"?g_e(e):f_e(e)}),b_e=()=>"Sub-agent",y_e=()=>"子智能体",x_e=()=>"عامل فرعی",w_e=()=>"وكيل فرعي",k_e=()=>"Subagente",S_e=()=>"सब-एजेंट",C_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y_e():t==="fa"?x_e():t==="ar"?w_e():t==="es"?k_e():t==="hi"?S_e():b_e()}),E_e=()=>"Table",N_e=()=>"表格",z_e=()=>"جدول",j_e=()=>"جدول",T_e=()=>"Tabla",A_e=()=>"टेबल",R_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N_e():t==="fa"?z_e():t==="ar"?j_e():t==="es"?T_e():t==="hi"?A_e():E_e()}),M_e=()=>"Tree",O_e=()=>"树状图",D_e=()=>"درخت",L_e=()=>"شجرة",I_e=()=>"Árbol",$_e=()=>"ट्री",B_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?O_e():t==="fa"?D_e():t==="ar"?L_e():t==="es"?I_e():t==="hi"?$_e():M_e()}),P_e=e=>`Collapse ${e==null?void 0:e.name}`,F_e=e=>`折叠 ${e==null?void 0:e.name}`,H_e=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,q_e=e=>`طيّ ${e==null?void 0:e.name}`,U_e=e=>`Contraer ${e==null?void 0:e.name}`,G_e=e=>`${e==null?void 0:e.name} समेटें`,V_e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?F_e(e):t==="fa"?H_e(e):t==="ar"?q_e(e):t==="es"?U_e(e):t==="hi"?G_e(e):P_e(e)}),K_e=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,W_e=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,Q_e=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,X_e=e=>`حذف «${e==null?void 0:e.path}» من دليل المُخرَجات؟`,Y_e=e=>`¿Eliminar “${e==null?void 0:e.path}” del directorio de artefactos?`,Z_e=e=>`“${e==null?void 0:e.path}” को आर्टिफ़ैक्ट डायरेक्टरी से हटाएं?`,qk=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?W_e(e):t==="fa"?Q_e(e):t==="ar"?X_e(e):t==="es"?Y_e(e):t==="hi"?Z_e(e):K_e(e)}),J_e=e=>`Delete folder ${e==null?void 0:e.name}`,efe=e=>`删除文件夹 ${e==null?void 0:e.name}`,tfe=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,nfe=e=>`حذف المجلد ${e==null?void 0:e.name}`,rfe=e=>`Eliminar la carpeta ${e==null?void 0:e.name}`,sfe=e=>`${e==null?void 0:e.name} फ़ोल्डर हटाएं`,ife=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?efe(e):t==="fa"?tfe(e):t==="ar"?nfe(e):t==="es"?rfe(e):t==="hi"?sfe(e):J_e(e)}),afe=e=>`Expand ${e==null?void 0:e.name}`,ofe=e=>`展开 ${e==null?void 0:e.name}`,cfe=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,lfe=e=>`توسيع ${e==null?void 0:e.name}`,ufe=e=>`Expandir ${e==null?void 0:e.name}`,_fe=e=>`${e==null?void 0:e.name} फैलाएं`,ffe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ofe(e):t==="fa"?cfe(e):t==="ar"?lfe(e):t==="es"?ufe(e):t==="hi"?_fe(e):afe(e)}),dfe=()=>"Binary or unsupported file — no inline preview.",hfe=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",pfe=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",mfe=()=>"ملف ثنائي أو غير مدعوم — لا توجد معاينة مضمّنة.",gfe=()=>"Archivo binario o no compatible — sin vista previa.",vfe=()=>"बाइनरी या असमर्थित फ़ाइल — इनलाइन प्रीव्यू नहीं है।",bfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hfe():t==="fa"?pfe():t==="ar"?mfe():t==="es"?gfe():t==="hi"?vfe():dfe()}),yfe=()=>"Copy path",xfe=()=>"复制路径",wfe=()=>"کپی مسیر",kfe=()=>"نسخ المسار",Sfe=()=>"Copiar ruta",Cfe=()=>"पथ कॉपी करें",Efe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xfe():t==="fa"?wfe():t==="ar"?kfe():t==="es"?Sfe():t==="hi"?Cfe():yfe()}),Nfe=()=>"Artifact not found",zfe=()=>"找不到产物",jfe=()=>"خروجی پیدا نشد",Tfe=()=>"لم يُعثر على المُخرَج",Afe=()=>"No se encontró el artefacto",Rfe=()=>"आर्टिफ़ैक्ट नहीं मिला",Mfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zfe():t==="fa"?jfe():t==="ar"?Tfe():t==="es"?Afe():t==="hi"?Rfe():Nfe()}),Ofe=()=>"Open raw",Dfe=()=>"打开原始文件",Lfe=()=>"باز کردن فایل خام",Ife=()=>"فتح الملف الخام",$fe=()=>"Abrir sin formato",Bfe=()=>"रॉ खोलें",Pfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dfe():t==="fa"?Lfe():t==="ar"?Ife():t==="es"?$fe():t==="hi"?Bfe():Ofe()}),Ffe=()=>"Click an artifact to view it",Hfe=()=>"点击产物即可查看",qfe=()=>"برای مشاهده، یک خروجی را انتخاب کنید",Ufe=()=>"انقر على مُخرَج لعرضه",Gfe=()=>"Selecciona un artefacto para verlo",Vfe=()=>"देखने के लिए किसी आर्टिफ़ैक्ट पर क्लिक करें",Kfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hfe():t==="fa"?qfe():t==="ar"?Ufe():t==="es"?Gfe():t==="hi"?Vfe():Ffe()}),Wfe=()=>"Delete artifact",Qfe=()=>"删除产物",Xfe=()=>"حذف خروجی",Yfe=()=>"حذف المُخرَج",Zfe=()=>"Eliminar artefacto",Jfe=()=>"आर्टिफ़ैक्ट हटाएं",XE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qfe():t==="fa"?Xfe():t==="ar"?Yfe():t==="es"?Zfe():t==="hi"?Jfe():Wfe()}),ede=()=>"Delete folder",tde=()=>"删除文件夹",nde=()=>"حذف پوشه",rde=()=>"حذف المجلد",sde=()=>"Eliminar carpeta",ide=()=>"फ़ोल्डर हटाएं",ade=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tde():t==="fa"?nde():t==="ar"?rde():t==="es"?sde():t==="hi"?ide():ede()}),ode=()=>"Failed to load:",cde=()=>"加载失败:",lde=()=>"بارگیری ناموفق بود:",ude=()=>"تعذّر التحميل:",_de=()=>"Error al cargar:",fde=()=>"लोड नहीं हो सका:",dde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cde():t==="fa"?lde():t==="ar"?ude():t==="es"?_de():t==="hi"?fde():ode()}),hde=()=>"File truncated — showing the first 512 KB.",pde=()=>"文件已截断——仅显示前 512 KB。",mde=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",gde=()=>"تم اقتطاع الملف — عرض أول 512 كيلوبايت.",vde=()=>"Archivo truncado — se muestran los primeros 512 KB.",bde=()=>"फ़ाइल छोटी की गई — पहले 512 KB दिखाए जा रहे हैं।",yde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pde():t==="fa"?mde():t==="ar"?gde():t==="es"?vde():t==="hi"?bde():hde()}),xde=()=>"Listing truncated — the folder has more artifacts.",wde=()=>"列表已截断——文件夹中还有更多产物。",kde=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",Sde=()=>"تم اقتطاع القائمة — يحتوي المجلد على مُخرَجات أخرى.",Cde=()=>"Listado truncado — la carpeta tiene más artefactos.",Ede=()=>"सूची छोटी की गई — इस फ़ोल्डर में और भी आर्टिफ़ैक्ट हैं।",Nde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wde():t==="fa"?kde():t==="ar"?Sde():t==="es"?Cde():t==="hi"?Ede():xde()}),zde=()=>"Loading…",jde=()=>"正在加载…",Tde=()=>"در حال بارگیری…",Ade=()=>"جارٍ التحميل…",Rde=()=>"Cargando…",Mde=()=>"लोड हो रहा है…",wD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jde():t==="fa"?Tde():t==="ar"?Ade():t==="es"?Rde():t==="hi"?Mde():zde()}),Ode=()=>"Loading artifacts…",Dde=()=>"正在加载产物…",Lde=()=>"در حال بارگیری خروجی‌ها…",Ide=()=>"جارٍ تحميل المُخرَجات…",$de=()=>"Cargando artefactos…",Bde=()=>"आर्टिफ़ैक्ट लोड हो रहे हैं…",Pde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dde():t==="fa"?Lde():t==="ar"?Ide():t==="es"?$de():t==="hi"?Bde():Ode()}),Fde=()=>"Modified",Hde=()=>"修改时间",qde=()=>"ویرایش‌شده",Ude=()=>"عُدّل",Gde=()=>"Modificado",Vde=()=>"बदला गया",Kde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hde():t==="fa"?qde():t==="ar"?Ude():t==="es"?Gde():t==="hi"?Vde():Fde()}),Wde=()=>"No artifacts yet",Qde=()=>"尚无产物",Xde=()=>"هنوز خروجی‌ای وجود ندارد",Yde=()=>"لا توجد مُخرَجات بعد",Zde=()=>"Aún no hay artefactos",Jde=()=>"अभी तक कोई आर्टिफ़ैक्ट नहीं",ehe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qde():t==="fa"?Xde():t==="ar"?Yde():t==="es"?Zde():t==="hi"?Jde():Wde()}),the=()=>"Open raw in new tab",nhe=()=>"在新标签页中打开原始文件",rhe=()=>"باز کردن فایل خام در زبانهٔ جدید",she=()=>"فتح الملف الخام في تبويب جديد",ihe=()=>"Abrir sin formato en una pestaña nueva",ahe=()=>"नए टैब में रॉ खोलें",YE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nhe():t==="fa"?rhe():t==="ar"?she():t==="es"?ihe():t==="hi"?ahe():the()}),ohe=()=>"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.",che=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件。",lhe=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید.",uhe=()=>"هذه هي مساحة المُخرَجات الدائمة للمشروع، للتقارير والأشكال والصور وملفات CSV وملفات PDF وغيرها من مُخرَجات البحث. اطلب من الوكيل كتابة تقرير أو أضِف ملفاتك الخاصة.",_he=()=>"Este es el espacio de resultados permanente del proyecto: informes, figuras, imágenes, CSV, PDF y otros artefactos de investigación. Pídele al agente un informe o añade tus propios archivos.",fhe=()=>"यह प्रोजेक्ट का स्थायी आउटपुट स्थान है — रिपोर्ट, फ़िगर, इमेज, CSV, PDF और अन्य शोध आर्टिफ़ैक्ट के लिए। एजेंट से कोई लेख लिखने को कहें या अपनी फ़ाइलें खुद जोड़ें।",dhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?che():t==="fa"?lhe():t==="ar"?uhe():t==="es"?_he():t==="hi"?fhe():ohe()}),hhe=()=>"File too large to preview inline.",phe=()=>"文件太大,无法内嵌预览。",mhe=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",ghe=()=>"الملف كبير جدًا للمعاينة المضمّنة.",vhe=()=>"El archivo es demasiado grande para previsualizarlo.",bhe=()=>"फ़ाइल इनलाइन प्रीव्यू के लिए बहुत बड़ी है।",yhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?phe():t==="fa"?mhe():t==="ar"?ghe():t==="es"?vhe():t==="hi"?bhe():hhe()}),xhe=()=>"This is the baseline branch, so there is no parent comparison.",whe=()=>"这是基线分支,因此没有父分支可供比较。",khe=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",She=()=>"هذا هو الفرع الأساس، فلا يوجد فرع أصل للمقارنة.",Che=()=>"Esta es la rama base, así que no hay comparación con una rama padre.",Ehe=()=>"यह बेसलाइन ब्रांच है, इसलिए कोई पैरेंट तुलना नहीं है।",Nhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?whe():t==="fa"?khe():t==="ar"?She():t==="es"?Che():t==="hi"?Ehe():xhe()}),zhe=()=>"Failed to load changes:",jhe=()=>"加载更改失败:",The=()=>"بارگیری تغییرات ناموفق بود:",Ahe=()=>"تعذّر تحميل التغييرات:",Rhe=()=>"Error al cargar los cambios:",Mhe=()=>"बदलाव लोड नहीं हो सके:",Ohe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jhe():t==="fa"?The():t==="ar"?Ahe():t==="es"?Rhe():t==="hi"?Mhe():zhe()}),Dhe=()=>"Loading changes…",Lhe=()=>"正在加载更改…",Ihe=()=>"در حال بارگیری تغییرات…",$he=()=>"جارٍ تحميل التغييرات…",Bhe=()=>"Cargando cambios…",Phe=()=>"बदलाव लोड हो रहे हैं…",Fhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lhe():t==="fa"?Ihe():t==="ar"?$he():t==="es"?Bhe():t==="hi"?Phe():Dhe()}),Hhe=()=>"No committed changes from the parent branch.",qhe=()=>"与父分支相比没有已提交的更改。",Uhe=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",Ghe=()=>"لا توجد تغييرات مودعة عن الفرع الأصل.",Vhe=()=>"No hay cambios confirmados respecto a la rama padre.",Khe=()=>"पैरेंट ब्रांच से कोई कमिट किए गए बदलाव नहीं।",Whe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qhe():t==="fa"?Uhe():t==="ar"?Ghe():t==="es"?Vhe():t==="hi"?Khe():Hhe()}),Qhe=e=>`agent ${e==null?void 0:e.number}`,Xhe=e=>`智能体 ${e==null?void 0:e.number}`,Yhe=e=>`عامل ${e==null?void 0:e.number}`,Zhe=e=>`وكيل ${e==null?void 0:e.number}`,Jhe=e=>`agente ${e==null?void 0:e.number}`,epe=e=>`एजेंट ${e==null?void 0:e.number}`,ZE=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Xhe(e):t==="fa"?Yhe(e):t==="ar"?Zhe(e):t==="es"?Jhe(e):t==="hi"?epe(e):Qhe(e)}),tpe=()=>"agent sessions",npe=()=>"智能体会话",rpe=()=>"نشست‌های عامل‌ها",spe=()=>"جلسات الوكلاء",ipe=()=>"sesiones de agente",ape=()=>"एजेंट सेशन",ope=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?npe():t==="fa"?rpe():t==="ar"?spe():t==="es"?ipe():t==="hi"?ape():tpe()}),cpe=()=>"All sessions",lpe=()=>"所有会话",upe=()=>"همهٔ نشست‌ها",_pe=()=>"كل الجلسات",fpe=()=>"Todas las sesiones",dpe=()=>"सभी सेशन",kD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lpe():t==="fa"?upe():t==="ar"?_pe():t==="es"?fpe():t==="hi"?dpe():cpe()}),hpe=e=>`${e==null?void 0:e.count} annotations`,ppe=e=>`${e==null?void 0:e.count} 条批注`,mpe=e=>`${e==null?void 0:e.count} یادداشت`,gpe=e=>`التعليقات: ${e==null?void 0:e.count}`,vpe=e=>`${e==null?void 0:e.count} anotaciones`,bpe=e=>`${e==null?void 0:e.count} एनोटेशन`,ype=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ppe(e):t==="fa"?mpe(e):t==="ar"?gpe(e):t==="es"?vpe(e):t==="hi"?bpe(e):hpe(e)}),xpe=()=>"Archive",wpe=()=>"归档",kpe=()=>"بایگانی",Spe=()=>"أرشفة",Cpe=()=>"Archivar",Epe=()=>"आर्काइव करें",Npe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wpe():t==="fa"?kpe():t==="ar"?Spe():t==="es"?Cpe():t==="hi"?Epe():xpe()}),zpe=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",jpe=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",Tpe=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",Ape=()=>"اسأل وكيل البحث… (/ للأوامر والمهارات، ! للطرفية)",Rpe=()=>"Pregunta al agente de investigación… (/ para comandos y skills, ! para la shell)",Mpe=()=>"शोध एजेंट से पूछें… (कमांड और स्किल के लिए /, शेल के लिए !)",Ope=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jpe():t==="fa"?Tpe():t==="ar"?Ape():t==="es"?Rpe():t==="hi"?Mpe():zpe()}),Dpe=()=>"Asked about selected text",Lpe=()=>"已询问所选文本",Ipe=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",$pe=()=>"سأل عن النص المحدد",Bpe=()=>"Preguntó sobre el texto seleccionado",Ppe=()=>"चयनित टेक्स्ट के बारे में पूछा",Fpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lpe():t==="fa"?Ipe():t==="ar"?$pe():t==="es"?Bpe():t==="hi"?Ppe():Dpe()}),Hpe=()=>"Attachment",qpe=()=>"附件",Upe=()=>"پیوست",Gpe=()=>"مرفق",Vpe=()=>"Adjunto",Kpe=()=>"अटैचमेंट",Wpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qpe():t==="fa"?Upe():t==="ar"?Gpe():t==="es"?Vpe():t==="hi"?Kpe():Hpe()}),Qpe=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,Xpe=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,Ype=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,Zpe=e=>`${e==null?void 0:e.name} كبير جدًا — يجب أن يكون كل مرفق أقل من 30 ميغابايت.`,Jpe=e=>`${e==null?void 0:e.name} es demasiado grande — cada adjunto debe ocupar menos de 30 MB.`,e0e=e=>`${e==null?void 0:e.name} बहुत बड़ी है — हर अटैचमेंट 30 MB से कम होनी चाहिए।`,t0e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Xpe(e):t==="fa"?Ype(e):t==="ar"?Zpe(e):t==="es"?Jpe(e):t==="hi"?e0e(e):Qpe(e)}),n0e=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",r0e=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",s0e=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",i0e=()=>"تتجاوز المرفقات الحد الإجمالي 40 ميغابايت — أزِل واحدًا وحاول مجددًا.",a0e=()=>"Los adjuntos superan el límite total de 40 MB — quita uno y vuelve a intentarlo.",o0e=()=>"अटैचमेंट 40 MB की कुल सीमा से ज़्यादा हैं — एक हटाएं और फिर से कोशिश करें।",c0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?r0e():t==="fa"?s0e():t==="ar"?i0e():t==="es"?a0e():t==="hi"?o0e():n0e()}),l0e=()=>"Wait for the turn to finish before running a command.",u0e=()=>"请等待本轮结束后再运行命令。",_0e=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",f0e=()=>"انتظر انتهاء الجولة قبل تنفيذ أمر.",d0e=()=>"Espera a que termine el turno antes de ejecutar un comando.",h0e=()=>"कमांड चलाने से पहले टर्न खत्म होने का इंतज़ार करें।",p0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u0e():t==="fa"?_0e():t==="ar"?f0e():t==="es"?d0e():t==="hi"?h0e():l0e()}),m0e=e=>`Exited with code ${e==null?void 0:e.code}`,g0e=e=>`退出码 ${e==null?void 0:e.code}`,v0e=e=>`با کد ${e==null?void 0:e.code} خارج شد`,b0e=e=>`خرج برمز ${e==null?void 0:e.code}`,y0e=e=>`Terminó con el código ${e==null?void 0:e.code}`,x0e=e=>`कोड ${e==null?void 0:e.code} के साथ बाहर निकला`,w0e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?g0e(e):t==="fa"?v0e(e):t==="ar"?b0e(e):t==="es"?y0e(e):t==="hi"?x0e(e):m0e(e)}),k0e=e=>`Command not run: ${e==null?void 0:e.error}`,S0e=e=>`命令未运行:${e==null?void 0:e.error}`,C0e=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,E0e=e=>`لم يُنفَّذ الأمر: ${e==null?void 0:e.error}`,N0e=e=>`No se ejecutó el comando: ${e==null?void 0:e.error}`,z0e=e=>`कमांड नहीं चलाई गई: ${e==null?void 0:e.error}`,JE=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?S0e(e):t==="fa"?C0e(e):t==="ar"?E0e(e):t==="es"?N0e(e):t==="hi"?z0e(e):k0e(e)}),j0e=()=>"Collapse tool activity",T0e=()=>"折叠工具活动",A0e=()=>"بستن فعالیت ابزارها",R0e=()=>"طيّ نشاط الأداة",M0e=()=>"Contraer actividad de herramientas",O0e=()=>"टूल गतिविधि समेटें",D0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?T0e():t==="fa"?A0e():t==="ar"?R0e():t==="es"?M0e():t==="hi"?O0e():j0e()}),L0e=()=>"Wait for the turn to finish before compacting.",I0e=()=>"请等待本轮结束后再压缩。",$0e=()=>"پیش از فشرده‌سازی، منتظر پایان نوبت بمانید.",B0e=()=>"انتظر انتهاء الجولة قبل الضغط.",P0e=()=>"Espera a que termine el turno antes de comprimir.",F0e=()=>"छोटा करने से पहले टर्न पूरा होने का इंतज़ार करें।",H0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?I0e():t==="fa"?$0e():t==="ar"?B0e():t==="es"?P0e():t==="hi"?F0e():L0e()}),q0e=e=>`Compacting failed: ${e==null?void 0:e.error}`,U0e=e=>`压缩失败:${e==null?void 0:e.error}`,G0e=e=>`فشرده‌سازی ناموفق بود: ${e==null?void 0:e.error}`,V0e=e=>`فشل الضغط: ${e==null?void 0:e.error}`,K0e=e=>`Error al comprimir: ${e==null?void 0:e.error}`,W0e=e=>`छोटा करना विफल: ${e==null?void 0:e.error}`,Q0e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?U0e(e):t==="fa"?G0e(e):t==="ar"?V0e(e):t==="es"?K0e(e):t==="hi"?W0e(e):q0e(e)}),X0e=()=>"Continue",Y0e=()=>"继续",Z0e=()=>"ادامه",J0e=()=>"متابعة",eme=()=>"Continuar",tme=()=>"जारी रखें",nme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y0e():t==="fa"?Z0e():t==="ar"?J0e():t==="es"?eme():t==="hi"?tme():X0e()}),rme=()=>"Copy response",sme=()=>"复制回复",ime=()=>"کپی پاسخ",ame=()=>"نسخ الرد",ome=()=>"Copiar respuesta",cme=()=>"जवाब कॉपी करें",eN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sme():t==="fa"?ime():t==="ar"?ame():t==="es"?ome():t==="hi"?cme():rme()}),lme=e=>`Delete “${e==null?void 0:e.title}”? + */var OE;function DW(){if(OE)return U2;OE=1;var e=ym(),n=OW();function t(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,c=e.useDebugValue;return U2.useSyncExternalStoreWithSelector=function(u,h,_,p,m){var w=i(null);if(w.current===null){var k={hasValue:!1,value:null};w.current=k}else k=w.current;w=o(function(){function b(E){if(!x){if(x=!0,y=E,E=p(E),m!==void 0&&k.hasValue){var T=k.value;if(m(T,E))return C=T}return C=E}if(T=C,r(y,E))return T;var j=p(E);return m!==void 0&&m(T,j)?(y=E,T):(y=E,C=j)}var x=!1,y,C,z=_===void 0?null:_;return[function(){return b(h())},z===null?void 0:function(){return b(z())}]},[h,_,p,m]);var v=s(u,w[0],w[1]);return a(function(){k.hasValue=!0,k.value=v},[v]),c(v),v},U2}var DE;function LW(){return DE||(DE=1,q2.exports=DW()),q2.exports}var nD=LW();const IW=bm(nD);function $W(e,n){return e===n}function Jo(e,n,t=$W){const r=A.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=A.useCallback(()=>e==null?void 0:e.get(),[e]);return nD.useSyncExternalStoreWithSelector(r,s,s,n,t)}var LE={};function Pk(e,n){const t=A.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=T_(t.current,s):s}}function xf(e){const n=pi(),t=A.useContext(e.from?EW:Eb),r=e.from??t,s=n.stores.getMatchStore(r),i=Pk(e,n),a=Jo(s,o=>o?i(o):LE);if(a!==LE)return a;(e.shouldThrow??!0)&&Ak()}function rD(e){return xf({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function sD(e){const{select:n,...t}=e;return xf({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function iD(e){return xf({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function aD(e){return xf({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Nb(e){const n=pi();return A.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function Fk(e){return xf({...e,select:n=>e.select?e.select(n.context):n.context})}function K2(e){const n=A.useRef(e);return zu(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function BW(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function PW(e,n,t){if(e!=null&&e.external)return mv(e.href,t)?void 0:e.href;if(!KW(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),mv(n,t)?void 0:n}catch{}}function FW(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!LK(e.pathname,n.pathname,r))return!1}else{const a=vv(e.pathname,r),o=vv(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!zu(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function HW(e,n){const t=pi(),r=vK(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:c,preloadDelay:u,preloadIntentProximity:h,hashScrollIntoView:_,replace:p,startTransition:m,resetScroll:w,viewTransition:k,children:v,target:b,disabled:x,style:y,className:C,onClick:z,onBlur:E,onFocus:T,onMouseEnter:j,onMouseLeave:M,onTouchStart:D,ignoreBlocker:I,params:$,search:q,hash:H,state:Q,mask:V,reloadDocument:Z,unsafeRelative:Y,from:B,_fromLocation:L,...F}=e,U=ZO(),K=K2(e.search),ne=K2(e.params),oe=K2(a),ue=A.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,K,ne,e.state,e.mask,e.unsafeRelative]),se=A.useCallback(dt=>{const ht=t.buildLocation({_fromLocation:dt,...ue}),Le=VW(ht.maskedLocation?ht.maskedLocation.publicHref:ht.publicHref,ht.maskedLocation?ht.maskedLocation.external:ht.external,t.history,x),me=PW(Le,o,t.protocolAllowlist);return[Le==null?void 0:Le.href,me,FW(dt,ht,oe,t.basepath,U,me!==void 0)]},[oe,x,U,ue,t,o]),[G,ae,ce]=Jo(t.stores.location,se,BW),pe=ce?_h(s,{})??qW:W2,be=ce?W2:_h(i,{})??W2,Ae=[C,pe.className,be.className].filter(Boolean).join(" "),De=(y||pe.style||be.style)&&{...y,...pe.style,...be.style},We=A.useRef(!1),Ne=e.reloadDocument||ae||x?!1:c??t.options.defaultPreload,xe=u??t.options.defaultPreloadDelay??0,rt=A.useCallback(()=>{t.preloadRoute(ue).catch(dt=>{console.warn(dt),console.warn(xW)})},[t,ue]),Ze=A.useCallback(dt=>{if(!dt){Q2(r);return}if(!(dt.isIntersecting??Ne==="intent")){dt.isIntersecting===!1&&Q2(r);return}if(!xe){rt();return}_0.has(r)||_0.set(r,setTimeout(()=>{_0.delete(r),rt()},xe))},[rt,r,Ne,xe]);gK(r,Ze,Ne!=="viewport"),A.useEffect(()=>{We.current||Ne==="render"&&(rt(),We.current=!0)},[rt,Ne]);const ct=dt=>{const ht=dt.currentTarget.getAttribute("target"),Le=b!==void 0?b:ht;!x&&!(dt.metaKey||dt.altKey||dt.ctrlKey||dt.shiftKey)&&!dt.defaultPrevented&&(!Le||Le==="_self")&&dt.button===0&&(dt.preventDefault(),t.navigate({...ue,replace:p,resetScroll:w,hashScrollIntoView:_,startTransition:m,viewTransition:k,ignoreBlocker:I}))};if(ae)return{...F,ref:r,href:ae,...v&&{children:v},...b&&{target:b},...x&&{disabled:x},...y&&{style:y},...C&&{className:C},...z&&{onClick:z},...E&&{onBlur:E},...T&&{onFocus:T},...j&&{onMouseEnter:j},...M&&{onMouseLeave:M},...D&&{onTouchStart:D}};const Ct=()=>{Ne==="intent"&&rt()},qt=()=>{Ne==="intent"&&Q2(r)};return{...F,...pe,...be,href:G,ref:r,onClick:fd([z,ct]),onBlur:fd([E,qt]),onFocus:fd([T,Ze]),onMouseEnter:fd([j,Ze]),onMouseLeave:fd([M,qt]),onTouchStart:fd([D,Ct]),disabled:!!x,target:b,...De&&{style:De},...Ae&&{className:Ae},...x&&UW,...ce&&GW}}var W2={},qW={className:"active"},UW={role:"link","aria-disabled":!0},GW={"data-status":"active","aria-current":"page"},_0=new WeakMap,Q2=e=>{clearTimeout(_0.get(e)),_0.delete(e)},fd=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function VW(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function KW(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var zb=A.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=HW(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...c}=i;return A.createElement("a",c,a)}return A.createElement(t,i,a)}),WW=class extends YO{constructor(n){super(n),this.useMatch=t=>xf({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Fk({...t,from:this.id}),this.useSearch=t=>aD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>iD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>sD({...t,from:this.id}),this.useLoaderData=t=>rD({...t,from:this.id}),this.useNavigate=()=>Nb({from:this.fullPath}),this.Link=et.forwardRef((t,r)=>f.jsx(zb,{ref:r,from:this.fullPath,...t}))}};function QW(e){return new WW(e)}function XW(){return e=>ZW(e)}var YW=class extends wW{constructor(e){super(e),this.useMatch=n=>xf({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Fk({...n,from:this.id}),this.useSearch=n=>aD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>iD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>sD({...n,from:this.id}),this.useLoaderData=n=>rD({...n,from:this.id}),this.useNavigate=()=>Nb({from:this.fullPath}),this.Link=et.forwardRef((n,t)=>f.jsx(zb,{ref:t,from:this.fullPath,...n}))}};function ZW(e){return new YW(e)}function sc(e){return n=>{const t=QW(n);return t.isRoot=!1,t}}function JW(e){const n=pi(),t=`not-found-${Jo(n.stores.location,r=>r.pathname)}-${Jo(n.stores.status,r=>r)}`;return f.jsx(Bk,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if(fh(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(fh(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function eQ(){return f.jsx("p",{children:"Not Found"})}function yd(e){return f.jsx(f.Fragment,{children:e.children})}function oD(e,n,t){return n.options.notFoundComponent?f.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...t}):f.jsx(eQ,{})}function jb(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?f.jsx(t,{}):null}var tQ=(e,n)=>e[0]===n[0]&&e[1]===n[1],cD=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,lD=A.memo(function({routeId:n}){const t=pi();return f.jsx(nQ,{router:t,match:Jo(t.stores.getMatchStore(n),r=>r)})});function nQ({router:e,match:n}){var _,p;const t=e.routesById[n.routeId],r=jb(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((_=e.options.notFoundRoute)==null?void 0:_.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",c=cD(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?A.Suspense:yd,u=s?Bk:yd,h=a?JW:yd;return f.jsxs(t.isRoot?t.options.shellComponent??yd:yd,{children:[f.jsx(Eb.Provider,{value:n.routeId,children:f.jsx(c,{fallback:r,children:f.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,w)=>{if(fh(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,w)},children:f.jsx(h,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return A.createElement(a,m)},children:o?f.jsx(SW,{fallback:r,children:f.jsx(IE,{match:n})}):f.jsx(IE,{match:n})})})})}),null]})}var IE=A.memo(function({match:n}){const t=pi(),r=n.routeId,s=t.routesById[r],i=A.useMemo(()=>{var c;const o=(c=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:c({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=A.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?f.jsx(o,{},i):f.jsx(z0,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!cD(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return jb(t,s)}if(n.status==="notFound")return oD(t,s,n.error);if(n.status==="error")throw n.error;return a}),z0=A.memo(function(){const n=pi(),t=A.useContext(Eb);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=Jo(o,c=>[!!c._notFound,c.error],tQ),i=Jo(n.stores.ids,c=>c[c.indexOf(t)+1])}if(r)return oD(n,n.routesById[t],s);if(!i)return null;const a=f.jsx(lD,{routeId:i});return t===Dd?f.jsx(A.Suspense,{fallback:jb(n),children:a}):a});function uD(e,n){const t=e[1];e.length=0,t==null||t(n)}function rQ({t:e}){const n=pi(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{uD(t,!1),t.push(s,i),e(n),A.startTransition(r)}),MO(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(el(s.publicHref)!==el(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...Sb(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function sQ(){const e=pi(),n=e.routesById[Dd],t=jb(e,n),r=e.ssr?yd:A.Suspense,s=f.jsxs(f.Fragment,{children:[f.jsx(rQ,{t:A.useState()[1]}),f.jsx(r,{fallback:t,children:f.jsx(iQ,{})})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:s}):s}function iQ(){const e=pi(),n=e._rendered,t=Jo(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;MO(()=>{n[0]===t&&uD(n,!0)},[n,t]);const i=s?f.jsx(lD,{routeId:s}):null;return f.jsx(Eb.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:f.jsx(Bk,{getResetKey:()=>r,onCatch:void 0,children:i})})}var aQ=e=>({createMutableStore:AE,createReadonlyStore:AE,batch:AW}),oQ=e=>new cQ(e),cQ=class extends cW{constructor(e){super(e,aQ)}};function lQ({router:e,children:n,...t}){DO(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=f.jsx(JO.Provider,{value:e,children:n});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function uQ({router:e,...n}){return f.jsx(lQ,{router:e,...n,children:f.jsx(sQ,{})})}function _Q(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function fQ(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=_Q(e),a=pi(),{history:o}=a,[c,u]=A.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return A.useEffect(()=>{const h=async _=>{function p(b){const x=a.parseLocation(b),[,y,C]=a.getMatchedRoutes(x.pathname);return C===void 0?{routeId:"__notFound__",fullPath:x.pathname,pathname:x.pathname,params:y,search:a.options.parseSearch(b.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:x.pathname,params:y,search:a.options.parseSearch(b.search)}}const m=p(_.currentLocation),w=p(_.nextLocation);if(m.routeId==="__notFound__"&&w.routeId!=="__notFound__")return!1;const k=await t({action:_.action,current:m,next:w});if(!i)return k;if(!k)return!1;const v=await new Promise(b=>{u({status:"blocked",current:m,next:w,action:_.action,proceed:()=>b(!1),reset:()=>b(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),v};return s?void 0:o.block({blockerFn:h,enableBeforeUnload:r})},[t,r,s,i,o,a]),c}function _D(e){const n=pi({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return Jo(t.stores.__store,Pk(e,t))}function dQ(e){const n=pi();return Jo(n.stores.location,Pk(e,n))}const wv=new WeakMap,V1=new WeakMap;function _o(e,n,t="*"){var r;for(const s of e.getQueryCache().findAll({queryKey:n}))wv.set(s,(wv.get(s)??0)+1),(r=V1.get(s))==null||r.add(t)}function wm(e,n,t,r=!0){if(!n)return e;const s=new Map(n.map(c=>[c.id,c])),i=new Set(e.map(c=>c.id)),a=n.filter(c=>t.has(c.id)&&!i.has(c.id)),o=e.filter(c=>!t.has(c.id)||s.has(c.id)).map(c=>t.has(c.id)?s.get(c.id)??c:c);return r?[...a,...o]:[...o,...a]}async function Dh(e,n,t,r=(s,i)=>i??s){const s=e.getQueryCache().find({queryKey:n,exact:!0}),i=s?wv.get(s):void 0,a=await t();if(!s||wv.get(s)===i||s.state.fetchStatus!=="fetching"||e.getQueryCache().find({queryKey:n,exact:!0})!==s)return a;e.setQueryData(n,c=>c??a);const o=new Set;V1.set(s,o);try{const c=await t();return o.size?r(c,e.getQueryData(n),o):c}finally{V1.get(s)===o&&V1.delete(s)}}const dh=e=>typeof e=="string"&&/^[0-9a-f]{40}$/i.test(e);function fD(e){const n=e.queryKey[2];if(n==="resolvedFile")return dh(e.queryKey[7]);const t=n==="getProjectFile"?e.queryKey[5]:n==="getCodeTree"?e.queryKey[4]:null;return typeof t=="object"&&t!==null&&"ref"in t&&dh(t.ref)}function Ba(e,n=Va(),t,r=!1){if(!Fn(n))return;const s={queryKey:n,predicate:i=>e.includes(String(i.queryKey[2]))&&!fD(i)&&(!t||t(i))};r?Je.cancelQueries(s).then(()=>{Fn(n)&&Je.invalidateQueries(s)}):Je.invalidateQueries(s)}const dD=["resolvedFile","getProjectFile","getArtifactFileText","getArtifactFileMetadata"],Hk=["getArtifacts","getArtifactFileText","getArtifactFileMetadata"],hQ=["listProjects","listProjectActivity","listExperiments","listRuns","listChatSessions","getChatMessages","getHarnesses","getUpdateStatus",...Hk,...dD,"getAbsoluteFile","fileVersion","getCodeTree","getSessionWorktree","getRunDiff","getExperimentDiff"];function pQ(e,n=Va(),t=!1){const r=Je.getQueryData([...n,"listChatSessions",e])??[],s=Je.getQueryData([...n,"listRuns",e])??[],i=Je.getQueryData([...n,"listExperiments",e])??[];Ba([...dD,...Hk,"getRunDiff","getExperimentDiff","getCodeTree","getSessionWorktree","fileVersion","getProjectGitStatus","getOverleafState","getOverleafStatus"],n,a=>{const o=a.queryKey[2];return o==="getRunDiff"?s.some(c=>c.id===a.queryKey[3]):o==="getExperimentDiff"?i.some(c=>c.id===a.queryKey[3]):o==="getSessionWorktree"?r.some(c=>c.id===a.queryKey[3]):o==="fileVersion"?typeof a.queryKey[3]=="string"&&a.queryKey[3].startsWith(`/api/projects/${e}/`):a.queryKey[3]===e},t)}function Tb(e){const n=Va();_l.add(e),_o(Je,[...n,"listChatSessions"],e),Je.setQueriesData({queryKey:[...n,"listChatSessions"]},t=>t==null?void 0:t.filter(r=>r.id!==e));for(const t of["getChatMessages","getSessionWorktree"])Tk({queryKey:[...n,t,e]})}function mQ(e){const n=Va(),t=Je.getQueryData([...n,"listChatSessions",e]);for(const r of t??[])Tb(r.id);Tk({queryKey:n,predicate:r=>r.queryKey.slice(3).includes(e)})}const gQ={hf:["getHfSettings","getComputeSettings","getEnvVars"],tinker:["getTinkerSettings","getComputeSettings","getEnvVars"],k8s:["getK8sSettings","getComputeSettings"],modal:["getModalSettings","getComputeSettings","getEnvVars"],slurm:["getSlurmSettings","getComputeSettings"],ray:["getRaySettings","getComputeSettings"],env:["getEnvVars","getHfSettings","getTinkerSettings","getModalSettings","getSlurmSettings","getRaySettings","getK8sSettings","getOpenResearchSettings","getComputeSettings","getHarnesses"],"data-dir":["getDataDir"],ssh:["getSshSettings","getSshConfig","getSshMasterStatus","getComputeSettings"],compute:["getComputeSettings"],git:["githubAccount","repoAccess","getProjectGitStatus"],profile:["getProfile"],"lit-sources":["getLitSources"],projects:["getProjectDefaults","getProjectGitStatus"],telemetry:["getTelemetry"]};function vQ(e,n){var a;if(!Fn(n))return;const t=(o,c=n,u)=>Ba(o,c,u,!0),r=e.split("?")[0];if(/\/(ui-state|open|reveal|prewarm|validate|preflight)$/.test(r))return;const s=(a=/^\/api\/settings\/([^/]+)/.exec(r))==null?void 0:a[1];if(s){t(gQ[s]??[],n);return}if(r.startsWith("/api/local-models")&&!/\/(discover|check)$/.test(r)){t(["getLocalModels","getHarnesses"],n);return}if(r==="/api/user-skills"){t(["listUserSkills","getSkills","getSkillContent"],n);return}if(r==="/api/latex-templates"){t(["listLatexTemplates"],n);return}if(r==="/api/overleaf/token"){t(["getOverleafSettings","getOverleafState","getOverleafStatus"],n);return}if(r.startsWith("/api/update/")){t(["getUpdateStatus","getLocalMachine"],n);return}if(r.startsWith("/api/remote/")||r.startsWith("/_orx/")){t(["listRemoteSessions"],n),Je.invalidateQueries({queryKey:["gateway","runtime"]});return}if(r.startsWith("/api/chat/")){r==="/api/chat/sessions"&&t(["getProjectStarterPrompts","listProjectActivity"],n);return}const i=/^\/api\/projects\/([^/]+)(.*)$/.exec(r);if(i){const[,o,c]=i;if(c.startsWith("/file")){pQ(o,n,!0);return}t(["listProjects","listProjectActivity"],n),t(["getProjectGitStatus","getCodeTree","getProjectStarterPrompts"],n,u=>u.queryKey[3]===o);return}(r==="/api/projects"||r==="/api/onboarding/complete")&&t(["listProjects","listProjectActivity","getUiState","getProfile"],n)}const bQ={},yQ="en",qk=["en","zh-CN","fa","ar","es","hi"],hD="orx:locale",Uk=["localStorage","preferredLanguage","baseLocale"],$E=[],j0=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let BE=!1,N=()=>{var t;let e=Uk;!j0&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=gD(window.location.href));const n=xQ(e);if(n)return BE||(BE=!0,pD(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function xQ(e,n){let t;for(const r of e){if(r==="baseLocale")t=yQ;else if(r==="preferredLanguage"&&!j0)t=EQ();else if(r==="localStorage"&&!j0)t=localStorage.getItem(hD)??void 0;else if(vD(r)&&kv.has(r)){const i=kv.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return SQ(a)}}const s=T0(t);if(s)return s}}const wQ=e=>{window.location.reload()};let pD=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=N()}catch{}const s=[];let i=Uk;!j0&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=gD(window.location.href));for(const c of i)if(c!=="baseLocale"){if(c==="localStorage"&&typeof window<"u")localStorage.setItem(hD,e);else if(vD(c)&&kv.has(c)){const u=kv.get(c);if(u){let h=u.setLocale(e);h instanceof Promise&&(h=h.catch(_=>{throw new Error(`Custom strategy "${c}" setLocale failed.`,{cause:_})}),s.push(h))}}}const a=()=>{!j0&&t.reload&&window.location&&e!==r&&wQ()};if(s.length)return Promise.all(s).then(()=>{a()});a()},kQ=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function T0(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of qk)if(t.toLowerCase()===n)return t}function mD(e){return!!e&&qk.some(n=>n===e)}function SQ(e){const n=T0(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${qk.join(", ")}`)}function CQ(e,n){return e.exec(n.href)}function EQ(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=T0(t.fullTag);if(r)return r;const s=T0(t.baseTag);if(s)return s}}function NQ(e){return zQ(e)}function zQ(e){const n=typeof e=="string"?new URL(e,kQ()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&T0(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let PE,FE;function jQ(e){if($E.length===0)return;const n=typeof e=="string"?e:e.href;if(PE===n)return FE;const t=new URL(n,"http://example.com"),r=NQ(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of $E){const c=new bQ(o.match,a.href);if(CQ(c,a)){i=o;break}}if(i)break}return PE=n,FE=i,i}function gD(e){const n=jQ(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:Uk}const kv=new Map;function vD(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const TQ=e=>`Actions for ${e==null?void 0:e.name}`,AQ=e=>`${e==null?void 0:e.name} 的操作`,RQ=e=>`عملیات ${e==null?void 0:e.name}`,MQ=e=>`إجراءات ${e==null?void 0:e.name}`,OQ=e=>`Acciones para ${e==null?void 0:e.name}`,DQ=e=>`${e==null?void 0:e.name} के लिए क्रियाएं`,LQ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?AQ(e):t==="fa"?RQ(e):t==="ar"?MQ(e):t==="es"?OQ(e):t==="hi"?DQ(e):TQ(e)}),IQ=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,$Q=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,BQ=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,PQ=e=>`${e==null?void 0:e.path} — اضغط المسافة للمعاينة؛ انقر نقرًا مزدوجًا أو اضغط Enter لإبقائه مفتوحًا في تبويب`,FQ=e=>`${e==null?void 0:e.path} — pulsa Espacio para previsualizarlo; haz doble clic o pulsa Intro para mantenerlo abierto en una pestaña`,HQ=e=>`${e==null?void 0:e.path} — पूर्वावलोकन के लिए स्पेस दबाएं; टैब में खुला रखने के लिए डबल-क्लिक करें या Enter दबाएं`,qQ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?$Q(e):t==="fa"?BQ(e):t==="ar"?PQ(e):t==="es"?FQ(e):t==="hi"?HQ(e):IQ(e)}),UQ=e=>`Branch: ${e==null?void 0:e.branch}`,GQ=e=>`分支:${e==null?void 0:e.branch}`,VQ=e=>`شاخه: ${e==null?void 0:e.branch}`,KQ=e=>`الفرع: ${e==null?void 0:e.branch}`,WQ=e=>`Rama: ${e==null?void 0:e.branch}`,QQ=e=>`ब्रांच: ${e==null?void 0:e.branch}`,XQ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?GQ(e):t==="fa"?VQ(e):t==="ar"?KQ(e):t==="es"?WQ(e):t==="hi"?QQ(e):UQ(e)}),YQ=e=>`Browse code on ${e==null?void 0:e.branch}`,ZQ=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,JQ=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,eX=e=>`تصفّح الشيفرة على ${e==null?void 0:e.branch}`,tX=e=>`Explorar el código en ${e==null?void 0:e.branch}`,nX=e=>`${e==null?void 0:e.branch} पर कोड ब्राउज़ करें`,bD=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?ZQ(e):t==="fa"?JQ(e):t==="ar"?eX(e):t==="es"?tX(e):t==="hi"?nX(e):YQ(e)}),rX=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,sX=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,iX=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,aX=e=>`أداة البرمجة والنموذج المستخدمان في هذه المحادثة: ${e==null?void 0:e.label}`,oX=e=>`Agente y modelo de este chat: ${e==null?void 0:e.label}`,cX=e=>`इस चैट का हार्नेस और मॉडल: ${e==null?void 0:e.label}`,lX=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?sX(e):t==="fa"?iX(e):t==="ar"?aX(e):t==="es"?oX(e):t==="hi"?cX(e):rX(e)}),uX=e=>`Collapse ${e==null?void 0:e.name}`,_X=e=>`折叠 ${e==null?void 0:e.name}`,fX=e=>`بستن ${e==null?void 0:e.name}`,dX=e=>`طيّ ${e==null?void 0:e.name}`,hX=e=>`Contraer ${e==null?void 0:e.name}`,pX=e=>`${e==null?void 0:e.name} समेटें`,mX=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?_X(e):t==="fa"?fX(e):t==="ar"?dX(e):t==="es"?hX(e):t==="hi"?pX(e):uX(e)}),gX=e=>`Committed changes versus ${e==null?void 0:e.parent}`,vX=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,bX=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,yX=e=>`التغييرات المودعة مقابل ${e==null?void 0:e.parent}`,xX=e=>`Cambios confirmados respecto a ${e==null?void 0:e.parent}`,wX=e=>`${e==null?void 0:e.parent} की तुलना में कमिट किए गए बदलाव`,kX=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?vX(e):t==="fa"?bX(e):t==="ar"?yX(e):t==="es"?xX(e):t==="hi"?wX(e):gX(e)}),SX=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,CX=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,EX=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,NX=e=>`التغييرات المودعة مقابل ${e==null?void 0:e.parent} (الفرق مقتطع؛ الأعداد حدود دنيا)`,zX=e=>`Cambios confirmados respecto a ${e==null?void 0:e.parent} (diff truncado; los recuentos son mínimos)`,jX=e=>`${e==null?void 0:e.parent} की तुलना में कमिट किए गए बदलाव (डिफ़ छोटा किया गया; संख्याएं न्यूनतम हैं)`,TX=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?CX(e):t==="fa"?EX(e):t==="ar"?NX(e):t==="es"?zX(e):t==="hi"?jX(e):SX(e)}),AX=e=>`Copy ${e==null?void 0:e.value}`,RX=e=>`复制 ${e==null?void 0:e.value}`,MX=e=>`کپی ${e==null?void 0:e.value}`,OX=e=>`نسخ ${e==null?void 0:e.value}`,DX=e=>`Copiar ${e==null?void 0:e.value}`,LX=e=>`${e==null?void 0:e.value} कॉपी करें`,IX=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?RX(e):t==="fa"?MX(e):t==="ar"?OX(e):t==="es"?DX(e):t==="hi"?LX(e):AX(e)}),$X=e=>`Delete ${e==null?void 0:e.name}`,BX=e=>`删除 ${e==null?void 0:e.name}`,PX=e=>`حذف ${e==null?void 0:e.name}`,FX=e=>`حذف ${e==null?void 0:e.name}`,HX=e=>`Eliminar ${e==null?void 0:e.name}`,qX=e=>`${e==null?void 0:e.name} हटाएं`,o3=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?BX(e):t==="fa"?PX(e):t==="ar"?FX(e):t==="es"?HX(e):t==="hi"?qX(e):$X(e)}),UX=e=>`Download ${e==null?void 0:e.name}`,GX=e=>`下载 ${e==null?void 0:e.name}`,VX=e=>`بارگیری ${e==null?void 0:e.name}`,KX=e=>`تنزيل ${e==null?void 0:e.name}`,WX=e=>`Descargar ${e==null?void 0:e.name}`,QX=e=>`${e==null?void 0:e.name} डाउनलोड करें`,Sv=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?GX(e):t==="fa"?VX(e):t==="ar"?KX(e):t==="es"?WX(e):t==="hi"?QX(e):UX(e)}),XX=e=>`Expand ${e==null?void 0:e.name}`,YX=e=>`展开 ${e==null?void 0:e.name}`,ZX=e=>`باز کردن ${e==null?void 0:e.name}`,JX=e=>`توسيع ${e==null?void 0:e.name}`,eY=e=>`Expandir ${e==null?void 0:e.name}`,tY=e=>`${e==null?void 0:e.name} फैलाएं`,nY=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?YX(e):t==="fa"?ZX(e):t==="ar"?JX(e):t==="es"?eY(e):t==="hi"?tY(e):XX(e)}),rY=e=>`Hide additional ${e==null?void 0:e.target}`,sY=e=>`隐藏其余${e==null?void 0:e.target}`,iY=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,aY=e=>`إخفاء ${e==null?void 0:e.target} الإضافية`,oY=e=>`Ocultar ${e==null?void 0:e.target} adicionales`,cY=e=>`अतिरिक्त ${e==null?void 0:e.target} छिपाएं`,lY=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?sY(e):t==="fa"?iY(e):t==="ar"?aY(e):t==="es"?oY(e):t==="hi"?cY(e):rY(e)}),uY=e=>`Hide error details for ${e==null?void 0:e.activity}`,_Y=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,fY=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,dY=e=>`إخفاء تفاصيل الخطأ لـ ${e==null?void 0:e.activity}`,hY=e=>`Ocultar los detalles del error de ${e==null?void 0:e.activity}`,pY=e=>`${e==null?void 0:e.activity} के लिए त्रुटि विवरण छिपाएं`,mY=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?_Y(e):t==="fa"?fY(e):t==="ar"?dY(e):t==="es"?hY(e):t==="hi"?pY(e):uY(e)}),gY=e=>`${e==null?void 0:e.count} consecutive identical calls`,vY=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,bY=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,yY=e=>`الاستدعاءات المتطابقة المتتالية: ${e==null?void 0:e.count}`,xY=e=>`Llamadas idénticas consecutivas: ${e==null?void 0:e.count}`,wY=e=>`${e==null?void 0:e.count} लगातार समान कॉल`,kY=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?vY(e):t==="fa"?bY(e):t==="ar"?yY(e):t==="es"?xY(e):t==="hi"?wY(e):gY(e)}),SY=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,CY=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,EY=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,NY=e=>`${e==null?void 0:e.name} — انقر نقرًا مزدوجًا أو اضغط Enter لإبقائه مفتوحًا`,zY=e=>`${e==null?void 0:e.name} — haz doble clic o pulsa Intro para mantenerlo abierto`,jY=e=>`${e==null?void 0:e.name} — खुला रखने के लिए डबल-क्लिक करें या Enter दबाएं`,TY=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?CY(e):t==="fa"?EY(e):t==="ar"?NY(e):t==="es"?zY(e):t==="hi"?jY(e):SY(e)}),AY=e=>`Open ${e==null?void 0:e.branch} on GitHub`,RY=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,MY=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,OY=e=>`فتح ${e==null?void 0:e.branch} على GitHub`,DY=e=>`Abrir ${e==null?void 0:e.branch} en GitHub`,LY=e=>`${e==null?void 0:e.branch} को GitHub पर खोलें`,yD=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?RY(e):t==="fa"?MY(e):t==="ar"?OY(e):t==="es"?DY(e):t==="hi"?LY(e):AY(e)}),IY=e=>`Open experiment ${e==null?void 0:e.name}`,$Y=e=>`打开实验 ${e==null?void 0:e.name}`,BY=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,PY=e=>`فتح التجربة ${e==null?void 0:e.name}`,FY=e=>`Abrir el experimento ${e==null?void 0:e.name}`,HY=e=>`${e==null?void 0:e.name} प्रयोग खोलें`,qY=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?$Y(e):t==="fa"?BY(e):t==="ar"?PY(e):t==="es"?FY(e):t==="hi"?HY(e):IY(e)}),UY=e=>`Open ${e==null?void 0:e.path} in the right pane`,GY=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,VY=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,KY=e=>`فتح ${e==null?void 0:e.path} في الجزء الأيمن`,WY=e=>`Abrir ${e==null?void 0:e.path} en el panel derecho`,QY=e=>`${e==null?void 0:e.path} को दाएं पैनल में खोलें`,XY=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?GY(e):t==="fa"?VY(e):t==="ar"?KY(e):t==="es"?WY(e):t==="hi"?QY(e):UY(e)}),YY=e=>`Open ${e==null?void 0:e.name}`,ZY=e=>`打开 ${e==null?void 0:e.name}`,JY=e=>`باز کردن ${e==null?void 0:e.name}`,eZ=e=>`فتح ${e==null?void 0:e.name}`,tZ=e=>`Abrir ${e==null?void 0:e.name}`,nZ=e=>`${e==null?void 0:e.name} खोलें`,rZ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?ZY(e):t==="fa"?JY(e):t==="ar"?eZ(e):t==="es"?tZ(e):t==="hi"?nZ(e):YY(e)}),sZ=e=>`Open logs for run ${e==null?void 0:e.run}`,iZ=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,aZ=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,oZ=e=>`فتح سجلات التشغيل ${e==null?void 0:e.run}`,cZ=e=>`Abrir los logs de la ejecución ${e==null?void 0:e.run}`,lZ=e=>`रन ${e==null?void 0:e.run} के लॉग खोलें`,uZ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?iZ(e):t==="fa"?aZ(e):t==="ar"?oZ(e):t==="es"?cZ(e):t==="hi"?lZ(e):sZ(e)}),_Z=e=>`Open ${e==null?void 0:e.name} on GitHub`,fZ=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,dZ=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,hZ=e=>`فتح ${e==null?void 0:e.name} على GitHub`,pZ=e=>`Abrir ${e==null?void 0:e.name} en GitHub`,mZ=e=>`${e==null?void 0:e.name} को GitHub पर खोलें`,Cv=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?fZ(e):t==="fa"?dZ(e):t==="ar"?hZ(e):t==="es"?pZ(e):t==="hi"?mZ(e):_Z(e)}),gZ=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,vZ=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,bZ=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,yZ=e=>`فتح سجلات التشغيل ${e==null?void 0:e.id} في الجزء الأيمن`,xZ=e=>`Abrir los logs de la ejecución ${e==null?void 0:e.id} en el panel derecho`,wZ=e=>`दाएं पैनल में रन ${e==null?void 0:e.id} के लॉग खोलें`,kZ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?vZ(e):t==="fa"?bZ(e):t==="ar"?yZ(e):t==="es"?xZ(e):t==="hi"?wZ(e):gZ(e)}),SZ=e=>`Overleaf — ${e==null?void 0:e.status}`,CZ=e=>`Overleaf — ${e==null?void 0:e.status}`,EZ=e=>`Overleaf — ${e==null?void 0:e.status}`,NZ=e=>`Overleaf — ${e==null?void 0:e.status}`,zZ=e=>`Overleaf — ${e==null?void 0:e.status}`,jZ=e=>`Overleaf — ${e==null?void 0:e.status}`,TZ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?CZ(e):t==="fa"?EZ(e):t==="ar"?NZ(e):t==="es"?zZ(e):t==="hi"?jZ(e):SZ(e)}),AZ=e=>`Preview /${e==null?void 0:e.name} skill`,RZ=e=>`预览 /${e==null?void 0:e.name} 技能`,MZ=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,OZ=e=>`معاينة مهارة /${e==null?void 0:e.name}`,DZ=e=>`Vista previa de la skill /${e==null?void 0:e.name}`,LZ=e=>`/${e==null?void 0:e.name} स्किल का पूर्वावलोकन करें`,IZ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?RZ(e):t==="fa"?MZ(e):t==="ar"?OZ(e):t==="es"?DZ(e):t==="hi"?LZ(e):AZ(e)}),$Z=e=>`Remove annotation ${e==null?void 0:e.number}`,BZ=e=>`移除批注 ${e==null?void 0:e.number}`,PZ=e=>`حذف یادداشت ${e==null?void 0:e.number}`,FZ=e=>`إزالة التعليق ${e==null?void 0:e.number}`,HZ=e=>`Quitar la anotación ${e==null?void 0:e.number}`,qZ=e=>`एनोटेशन ${e==null?void 0:e.number} हटाएं`,UZ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?BZ(e):t==="fa"?PZ(e):t==="ar"?FZ(e):t==="es"?HZ(e):t==="hi"?qZ(e):$Z(e)}),GZ=e=>`Remove ${e==null?void 0:e.name}`,VZ=e=>`移除 ${e==null?void 0:e.name}`,KZ=e=>`حذف ${e==null?void 0:e.name}`,WZ=e=>`إزالة ${e==null?void 0:e.name}`,QZ=e=>`Quitar ${e==null?void 0:e.name}`,XZ=e=>`${e==null?void 0:e.name} हटाएं`,YZ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?VZ(e):t==="fa"?KZ(e):t==="ar"?WZ(e):t==="es"?QZ(e):t==="hi"?XZ(e):GZ(e)}),ZZ=e=>`Remove queued message: ${e==null?void 0:e.text}`,JZ=e=>`移除排队消息:${e==null?void 0:e.text}`,eJ=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,tJ=e=>`إزالة الرسالة من قائمة الانتظار: ${e==null?void 0:e.text}`,nJ=e=>`Quitar el mensaje en cola: ${e==null?void 0:e.text}`,rJ=e=>`कतार में लगा संदेश हटाएं: ${e==null?void 0:e.text}`,sJ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?JZ(e):t==="fa"?eJ(e):t==="ar"?tJ(e):t==="es"?nJ(e):t==="hi"?rJ(e):ZZ(e)}),iJ=e=>`Retry queued message: ${e==null?void 0:e.text}`,aJ=e=>`重试排队消息:${e==null?void 0:e.text}`,oJ=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,cJ=e=>`إعادة محاولة إرسال الرسالة في قائمة الانتظار: ${e==null?void 0:e.text}`,lJ=e=>`Reintentar el mensaje en cola: ${e==null?void 0:e.text}`,uJ=e=>`कतार में लगा संदेश फिर से भेजें: ${e==null?void 0:e.text}`,_J=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?aJ(e):t==="fa"?oJ(e):t==="ar"?cJ(e):t==="es"?lJ(e):t==="hi"?uJ(e):iJ(e)}),fJ=e=>`Run ${e==null?void 0:e.value} in a terminal here`,dJ=e=>`在此处的终端中运行 ${e==null?void 0:e.value}`,hJ=e=>`اجرای ${e==null?void 0:e.value} در ترمینال همین‌جا`,pJ=e=>`تشغيل ${e==null?void 0:e.value} في طرفية هنا`,mJ=e=>`Ejecutar ${e==null?void 0:e.value} en una terminal aquí`,gJ=e=>`${e==null?void 0:e.value} को यहाँ टर्मिनल में चलाएँ`,HE=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?dJ(e):t==="fa"?hJ(e):t==="ar"?pJ(e):t==="es"?mJ(e):t==="hi"?gJ(e):fJ(e)}),vJ=e=>`Run ${e==null?void 0:e.id}`,bJ=e=>`运行 ${e==null?void 0:e.id}`,yJ=e=>`اجرای ${e==null?void 0:e.id}`,xJ=e=>`تشغيل ${e==null?void 0:e.id}`,wJ=e=>`Ejecución ${e==null?void 0:e.id}`,kJ=e=>`रन ${e==null?void 0:e.id}`,SJ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?bJ(e):t==="fa"?yJ(e):t==="ar"?xJ(e):t==="es"?wJ(e):t==="hi"?kJ(e):vJ(e)}),CJ=e=>`Show error details for ${e==null?void 0:e.activity}`,EJ=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,NJ=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,zJ=e=>`عرض تفاصيل الخطأ لـ ${e==null?void 0:e.activity}`,jJ=e=>`Mostrar los detalles del error de ${e==null?void 0:e.activity}`,TJ=e=>`${e==null?void 0:e.activity} के लिए त्रुटि विवरण दिखाएं`,AJ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?EJ(e):t==="fa"?NJ(e):t==="ar"?zJ(e):t==="es"?jJ(e):t==="hi"?TJ(e):CJ(e)}),RJ=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,MJ=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,OJ=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,DJ=e=>`عرض المزيد من ${e==null?void 0:e.target} (${e==null?void 0:e.count})`,LJ=e=>`Mostrar ${e==null?void 0:e.count} ${e==null?void 0:e.target} más`,IJ=e=>`${e==null?void 0:e.count} और ${e==null?void 0:e.target} दिखाएं`,$J=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?MJ(e):t==="fa"?OJ(e):t==="ar"?DJ(e):t==="es"?LJ(e):t==="hi"?IJ(e):RJ(e)}),BJ=e=>`${e==null?void 0:e.name} skill`,PJ=e=>`${e==null?void 0:e.name} 技能`,FJ=e=>`مهارت ${e==null?void 0:e.name}`,HJ=e=>`مهارة ${e==null?void 0:e.name}`,qJ=e=>`Skill ${e==null?void 0:e.name}`,UJ=e=>`${e==null?void 0:e.name} स्किल`,GJ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?PJ(e):t==="fa"?FJ(e):t==="ar"?HJ(e):t==="es"?qJ(e):t==="hi"?UJ(e):BJ(e)}),VJ=e=>`Value for ${e==null?void 0:e.name}`,KJ=e=>`${e==null?void 0:e.name} 的值`,WJ=e=>`مقدار ${e==null?void 0:e.name}`,QJ=e=>`قيمة ${e==null?void 0:e.name}`,XJ=e=>`Valor de ${e==null?void 0:e.name}`,YJ=e=>`${e==null?void 0:e.name} के लिए वैल्यू`,ZJ=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?KJ(e):t==="fa"?WJ(e):t==="ar"?QJ(e):t==="es"?XJ(e):t==="hi"?YJ(e):VJ(e)}),JJ=()=>"Agent reported back",eee=()=>"智能体已返回结果",tee=()=>"عامل نتیجه را گزارش کرد",nee=()=>"أبلغ الوكيل بالنتيجة",ree=()=>"El agente informó de los resultados",see=()=>"एजेंट ने रिपोर्ट भेजी",iee=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?eee():t==="fa"?tee():t==="ar"?nee():t==="es"?ree():t==="hi"?see():JJ()}),aee=()=>"Browse",oee=()=>"浏览",cee=()=>"مرور",lee=()=>"تصفّح",uee=()=>"Navegar",_ee=()=>"ब्राउज़ करें",fee=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?oee():t==="fa"?cee():t==="ar"?lee():t==="es"?uee():t==="hi"?_ee():aee()}),dee=()=>"Browsing…",hee=()=>"正在浏览…",pee=()=>"در حال مرور…",mee=()=>"جارٍ التصفّح…",gee=()=>"Navegando…",vee=()=>"ब्राउज़ कर रहा है…",bee=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hee():t==="fa"?pee():t==="ar"?mee():t==="es"?gee():t==="hi"?vee():dee()}),yee=()=>"Checked experiment status and updated notes",xee=()=>"已检查实验状态并更新笔记",wee=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",kee=()=>"فحص حالة التجربة وحدّث الملاحظات",See=()=>"Consultó el estado del experimento y actualizó las notas",Cee=()=>"प्रयोग की स्थिति जाँची और नोट्स अपडेट किए",Eee=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xee():t==="fa"?wee():t==="ar"?kee():t==="es"?See():t==="hi"?Cee():yee()}),Nee=()=>"Closed an agent",zee=()=>"已关闭智能体",jee=()=>"عامل بسته شد",Tee=()=>"أغلق وكيلًا",Aee=()=>"Cerró un agente",Ree=()=>"एक एजेंट बंद किया",Mee=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zee():t==="fa"?jee():t==="ar"?Tee():t==="es"?Aee():t==="hi"?Ree():Nee()}),Oee=()=>"Context compacted",Dee=()=>"上下文已压缩",Lee=()=>"زمینه فشرده شد",Iee=()=>"تم ضغط السياق",$ee=()=>"Contexto comprimido",Bee=()=>"कॉन्टेक्स्ट छोटा किया गया",Pee=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Dee():t==="fa"?Lee():t==="ar"?Iee():t==="es"?$ee():t==="hi"?Bee():Oee()}),Fee=()=>"Compacting conversation…",Hee=()=>"正在压缩对话…",qee=()=>"در حال فشرده‌سازی گفت‌وگو…",Uee=()=>"جارٍ ضغط المحادثة…",Gee=()=>"Comprimiendo la conversación…",Vee=()=>"बातचीत छोटी की जा रही है…",qE=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Hee():t==="fa"?qee():t==="ar"?Uee():t==="es"?Gee():t==="hi"?Vee():Fee()}),Kee=()=>"Compacting failed",Wee=()=>"压缩失败",Qee=()=>"فشرده‌سازی ناموفق بود",Xee=()=>"فشل الضغط",Yee=()=>"Error al comprimir",Zee=()=>"छोटा करना विफल",Jee=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Wee():t==="fa"?Qee():t==="ar"?Xee():t==="es"?Yee():t==="hi"?Zee():Kee()}),ete=e=>`Created ${e==null?void 0:e.target}`,tte=e=>`已创建 ${e==null?void 0:e.target}`,nte=e=>`${e==null?void 0:e.target} ایجاد شد`,rte=e=>`أنشأ ${e==null?void 0:e.target}`,ste=e=>`Creó ${e==null?void 0:e.target}`,ite=e=>`${e==null?void 0:e.target} बनाया`,ate=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?tte(e):t==="fa"?nte(e):t==="ar"?rte(e):t==="es"?ste(e):t==="hi"?ite(e):ete(e)}),ote=()=>"Delegate",cte=()=>"委派",lte=()=>"واگذاری",ute=()=>"تفويض",_te=()=>"Delegar",fte=()=>"सौंपें",dte=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cte():t==="fa"?lte():t==="ar"?ute():t==="es"?_te():t==="hi"?fte():ote()}),hte=()=>"Delegating…",pte=()=>"正在委派…",mte=()=>"در حال واگذاری…",gte=()=>"جارٍ التفويض…",vte=()=>"Delegando…",bte=()=>"सौंप रहा है…",yte=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pte():t==="fa"?mte():t==="ar"?gte():t==="es"?vte():t==="hi"?bte():hte()}),xte=e=>`Deleted ${e==null?void 0:e.target}`,wte=e=>`已删除 ${e==null?void 0:e.target}`,kte=e=>`${e==null?void 0:e.target} حذف شد`,Ste=e=>`حذف ${e==null?void 0:e.target}`,Cte=e=>`Eliminó ${e==null?void 0:e.target}`,Ete=e=>`${e==null?void 0:e.target} हटाया`,Nte=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?wte(e):t==="fa"?kte(e):t==="ar"?Ste(e):t==="es"?Cte(e):t==="hi"?Ete(e):xte(e)}),zte=()=>"Edit",jte=()=>"编辑",Tte=()=>"ویرایش",Ate=()=>"تعديل",Rte=()=>"Editar",Mte=()=>"संपादित करें",Ote=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jte():t==="fa"?Tte():t==="ar"?Ate():t==="es"?Rte():t==="hi"?Mte():zte()}),Dte=e=>`Edited ${e==null?void 0:e.target}`,Lte=e=>`已编辑 ${e==null?void 0:e.target}`,Ite=e=>`${e==null?void 0:e.target} ویرایش شد`,$te=e=>`عدّل ${e==null?void 0:e.target}`,Bte=e=>`Editó ${e==null?void 0:e.target}`,Pte=e=>`${e==null?void 0:e.target} संपादित किया`,Fte=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Lte(e):t==="fa"?Ite(e):t==="ar"?$te(e):t==="es"?Bte(e):t==="hi"?Pte(e):Dte(e)}),Hte=()=>"Editing…",qte=()=>"正在编辑…",Ute=()=>"در حال ویرایش…",Gte=()=>"جارٍ التعديل…",Vte=()=>"Editando…",Kte=()=>"संपादित कर रहा है…",Wte=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qte():t==="fa"?Ute():t==="ar"?Gte():t==="es"?Vte():t==="hi"?Kte():Hte()}),Qte=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,Xte=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,Yte=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,Zte=e=>`${e==null?void 0:e.activity} عن «${e==null?void 0:e.query}»`,Jte=e=>`${e==null?void 0:e.activity}: “${e==null?void 0:e.query}”`,ene=e=>`“${e==null?void 0:e.query}” के लिए ${e==null?void 0:e.activity}`,tne=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Xte(e):t==="fa"?Yte(e):t==="ar"?Zte(e):t==="es"?Jte(e):t==="hi"?ene(e):Qte(e)}),nne=()=>"Imported from your terminal — new turns continue in the agent's own history",rne=()=>"从你的终端导入 — 新的回合将在智能体自己的历史中继续",sne=()=>"از ترمینال شما وارد شد — نوبت‌های جدید در تاریخچهٔ خود عامل ادامه می‌یابند",ine=()=>"مستورد من طرفيتك — الجولات الجديدة تتابع في سجل الوكيل نفسه",ane=()=>"Importado desde tu terminal — los turnos nuevos continúan en el historial del agente",one=()=>"आपके टर्मिनल से इम्पोर्ट किया गया — नए टर्न एजेंट के अपने इतिहास में जारी रहेंगे",cne=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rne():t==="fa"?sne():t==="ar"?ine():t==="es"?ane():t==="hi"?one():nne()}),lne=e=>`Listed files matching ${e==null?void 0:e.pattern}`,une=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,_ne=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,fne=e=>`سرد الملفات المطابقة لـ ${e==null?void 0:e.pattern}`,dne=e=>`Listó archivos que coinciden con ${e==null?void 0:e.pattern}`,hne=e=>`${e==null?void 0:e.pattern} से मेल खाती फ़ाइलों की सूची बनाई`,pne=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?une(e):t==="fa"?_ne(e):t==="ar"?fne(e):t==="es"?dne(e):t==="hi"?hne(e):lne(e)}),mne=()=>"Load",gne=()=>"加载",vne=()=>"بارگیری",bne=()=>"تحميل",yne=()=>"Cargar",xne=()=>"लोड करें",wne=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gne():t==="fa"?vne():t==="ar"?bne():t==="es"?yne():t==="hi"?xne():mne()}),kne=()=>"Loaded a skill",Sne=()=>"已加载技能",Cne=()=>"یک مهارت بارگیری شد",Ene=()=>"حمّل مهارة",Nne=()=>"Cargó una skill",zne=()=>"एक स्किल लोड की",jne=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Sne():t==="fa"?Cne():t==="ar"?Ene():t==="es"?Nne():t==="hi"?zne():kne()}),Tne=e=>`Loaded ${e==null?void 0:e.name} skill`,Ane=e=>`已加载技能 ${e==null?void 0:e.name}`,Rne=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,Mne=e=>`حمّل مهارة ${e==null?void 0:e.name}`,One=e=>`Cargó la skill ${e==null?void 0:e.name}`,Dne=e=>`${e==null?void 0:e.name} स्किल लोड की`,Lne=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Ane(e):t==="fa"?Rne(e):t==="ar"?Mne(e):t==="es"?One(e):t==="hi"?Dne(e):Tne(e)}),Ine=()=>"Loading…",$ne=()=>"正在加载…",Bne=()=>"در حال بارگیری…",Pne=()=>"جارٍ التحميل…",Fne=()=>"Cargando…",Hne=()=>"लोड हो रहा है…",qne=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$ne():t==="fa"?Bne():t==="ar"?Pne():t==="es"?Fne():t==="hi"?Hne():Ine()}),Une=e=>`Opened ${e==null?void 0:e.target}`,Gne=e=>`已打开 ${e==null?void 0:e.target}`,Vne=e=>`${e==null?void 0:e.target} باز شد`,Kne=e=>`فتح ${e==null?void 0:e.target}`,Wne=e=>`Abrió ${e==null?void 0:e.target}`,Qne=e=>`${e==null?void 0:e.target} खोला`,Xne=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Gne(e):t==="fa"?Vne(e):t==="ar"?Kne(e):t==="es"?Wne(e):t==="hi"?Qne(e):Une(e)}),Yne=e=>`Ran ${e==null?void 0:e.command}`,Zne=e=>`已运行 ${e==null?void 0:e.command}`,Jne=e=>`${e==null?void 0:e.command} اجرا شد`,ere=e=>`نفّذ ${e==null?void 0:e.command}`,tre=e=>`Ejecutó ${e==null?void 0:e.command}`,nre=e=>`${e==null?void 0:e.command} चलाया`,rre=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Zne(e):t==="fa"?Jne(e):t==="ar"?ere(e):t==="es"?tre(e):t==="hi"?nre(e):Yne(e)}),sre=()=>"Ran a sub-agent",ire=()=>"已运行子智能体",are=()=>"یک عامل فرعی اجرا شد",ore=()=>"شغّل وكيلًا فرعيًا",cre=()=>"Ejecutó un subagente",lre=()=>"एक सब-एजेंट चलाया",ure=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ire():t==="fa"?are():t==="ar"?ore():t==="es"?cre():t==="hi"?lre():sre()}),_re=()=>"Read",fre=()=>"读取",dre=()=>"خواندن",hre=()=>"قراءة",pre=()=>"Leer",mre=()=>"पढ़ें",gre=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fre():t==="fa"?dre():t==="ar"?hre():t==="es"?pre():t==="hi"?mre():_re()}),vre=()=>"Read experiment notes",bre=()=>"已读取实验笔记",yre=()=>"یادداشت‌های آزمایش خوانده شد",xre=()=>"قرأ ملاحظات التجربة",wre=()=>"Leyó las notas del experimento",kre=()=>"प्रयोग के नोट्स पढ़े",Sre=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bre():t==="fa"?yre():t==="ar"?xre():t==="es"?wre():t==="hi"?kre():vre()}),Cre=()=>"Read a paper",Ere=()=>"已读取论文",Nre=()=>"یک مقاله خوانده شد",zre=()=>"قرأ ورقة",jre=()=>"Leyó un paper",Tre=()=>"एक पेपर पढ़ा",Are=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ere():t==="fa"?Nre():t==="ar"?zre():t==="es"?jre():t==="hi"?Tre():Cre()}),Rre=e=>`Read ${e==null?void 0:e.name} skill`,Mre=e=>`已读取技能 ${e==null?void 0:e.name}`,Ore=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,Dre=e=>`قرأ مهارة ${e==null?void 0:e.name}`,Lre=e=>`Leyó la skill ${e==null?void 0:e.name}`,Ire=e=>`${e==null?void 0:e.name} स्किल पढ़ी`,X2=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Mre(e):t==="fa"?Ore(e):t==="ar"?Dre(e):t==="es"?Lre(e):t==="hi"?Ire(e):Rre(e)}),$re=e=>`Read ${e==null?void 0:e.target}`,Bre=e=>`已读取 ${e==null?void 0:e.target}`,Pre=e=>`${e==null?void 0:e.target} خوانده شد`,Fre=e=>`قرأ ${e==null?void 0:e.target}`,Hre=e=>`Leyó ${e==null?void 0:e.target}`,qre=e=>`${e==null?void 0:e.target} पढ़ा`,Pp=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Bre(e):t==="fa"?Pre(e):t==="ar"?Fre(e):t==="es"?Hre(e):t==="hi"?qre(e):$re(e)}),Ure=()=>"Read a web page",Gre=()=>"已读取网页",Vre=()=>"یک صفحهٔ وب خوانده شد",Kre=()=>"قرأ صفحة ويب",Wre=()=>"Leyó una página web",Qre=()=>"एक वेब पेज पढ़ा",Xre=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Gre():t==="fa"?Vre():t==="ar"?Kre():t==="es"?Wre():t==="hi"?Qre():Ure()}),Yre=()=>"Reading…",Zre=()=>"正在读取…",Jre=()=>"در حال خواندن…",ese=()=>"جارٍ القراءة…",tse=()=>"Leyendo…",nse=()=>"पढ़ रहा है…",rse=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Zre():t==="fa"?Jre():t==="ar"?ese():t==="es"?tse():t==="hi"?nse():Yre()}),sse=()=>"Resumed an agent",ise=()=>"已恢复智能体",ase=()=>"عامل از سر گرفته شد",ose=()=>"استأنف عمل وكيل",cse=()=>"Reanudó un agente",lse=()=>"एक एजेंट फिर से शुरू किया",use=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ise():t==="fa"?ase():t==="ar"?ose():t==="es"?cse():t==="hi"?lse():sse()}),_se=()=>"Review",fse=()=>"查看",dse=()=>"بازبینی",hse=()=>"مراجعة",pse=()=>"Revisar",mse=()=>"समीक्षा करें",gse=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fse():t==="fa"?dse():t==="ar"?hse():t==="es"?pse():t==="hi"?mse():_se()}),vse=()=>"Reviewed run log",bse=()=>"已查看运行日志",yse=()=>"گزارش اجرا بازبینی شد",xse=()=>"راجع سجل التشغيل",wse=()=>"Revisó el log de la ejecución",kse=()=>"रन लॉग की समीक्षा की",Sse=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bse():t==="fa"?yse():t==="ar"?xse():t==="es"?wse():t==="hi"?kse():vse()}),Cse=()=>"Reviewed run logs",Ese=()=>"已查看运行日志",Nse=()=>"گزارش‌های اجرا بازبینی شد",zse=()=>"راجع سجلات التشغيل",jse=()=>"Revisó los logs de las ejecuciones",Tse=()=>"रन लॉग की समीक्षा की",Ase=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ese():t==="fa"?Nse():t==="ar"?zse():t==="es"?jse():t==="hi"?Tse():Cse()}),Rse=()=>"Reviewed experiment status and notes",Mse=()=>"已查看实验状态和笔记",Ose=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",Dse=()=>"راجع حالة التجربة وملاحظاتها",Lse=()=>"Revisó el estado y las notas del experimento",Ise=()=>"प्रयोग की स्थिति और नोट्स की समीक्षा की",$se=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Mse():t==="fa"?Ose():t==="ar"?Dse():t==="es"?Lse():t==="hi"?Ise():Rse()}),Bse=()=>"Reviewing…",Pse=()=>"正在查看…",Fse=()=>"در حال بازبینی…",Hse=()=>"جارٍ المراجعة…",qse=()=>"Revisando…",Use=()=>"समीक्षा कर रहा है…",Gse=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Pse():t==="fa"?Fse():t==="ar"?Hse():t==="es"?qse():t==="hi"?Use():Bse()}),Vse=()=>"Run",Kse=()=>"运行",Wse=()=>"اجرا",Qse=()=>"تشغيل",Xse=()=>"Ejecutar",Yse=()=>"चलाएं",Zse=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Kse():t==="fa"?Wse():t==="ar"?Qse():t==="es"?Xse():t==="hi"?Yse():Vse()}),Jse=()=>"Running…",eie=()=>"正在运行…",tie=()=>"در حال اجرا…",nie=()=>"جارٍ التشغيل…",rie=()=>"Ejecutando…",sie=()=>"चल रहा है…",xD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?eie():t==="fa"?tie():t==="ar"?nie():t==="es"?rie():t==="hi"?sie():Jse()}),iie=()=>"Search",aie=()=>"搜索",oie=()=>"جست‌وجو",cie=()=>"بحث",lie=()=>"Buscar",uie=()=>"खोजें",_ie=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?aie():t==="fa"?oie():t==="ar"?cie():t==="es"?lie():t==="hi"?uie():iie()}),fie=()=>"Searched alphaXiv full text",die=()=>"已搜索 alphaXiv 全文",hie=()=>"متن کامل alphaXiv جست‌وجو شد",pie=()=>"بحث في نص alphaXiv الكامل",mie=()=>"Buscó en el texto completo de alphaXiv",gie=()=>"alphaXiv का पूरा टेक्स्ट खोजा",vie=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?die():t==="fa"?hie():t==="ar"?pie():t==="es"?mie():t==="hi"?gie():fie()}),bie=()=>"Searched alphaXiv semantically",yie=()=>"已对 alphaXiv 进行语义搜索",xie=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",wie=()=>"أجرى بحثًا دلاليًا في alphaXiv",kie=()=>"Hizo una búsqueda semántica en alphaXiv",Sie=()=>"alphaXiv को सिमेंटिक रूप से खोजा",Cie=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yie():t==="fa"?xie():t==="ar"?wie():t==="es"?kie():t==="hi"?Sie():bie()}),Eie=()=>"Searched bioRxiv",Nie=()=>"已搜索 bioRxiv",zie=()=>"bioRxiv جست‌وجو شد",jie=()=>"بحث في bioRxiv",Tie=()=>"Buscó en bioRxiv",Aie=()=>"bioRxiv खोजा",Rie=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Nie():t==="fa"?zie():t==="ar"?jie():t==="es"?Tie():t==="hi"?Aie():Eie()}),Mie=()=>"Searched code",Oie=()=>"已搜索代码",Die=()=>"کد جست‌وجو شد",Lie=()=>"بحث في الشيفرة",Iie=()=>"Buscó en el código",$ie=()=>"कोड खोजा",Y2=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Oie():t==="fa"?Die():t==="ar"?Lie():t==="es"?Iie():t==="hi"?$ie():Mie()}),Bie=e=>`Searched code for “${e==null?void 0:e.pattern}”`,Pie=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,Fie=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,Hie=e=>`بحث في الشيفرة عن «${e==null?void 0:e.pattern}»`,qie=e=>`Buscó “${e==null?void 0:e.pattern}” en el código`,Uie=e=>`“${e==null?void 0:e.pattern}” के लिए कोड खोजा`,Z2=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Pie(e):t==="fa"?Fie(e):t==="ar"?Hie(e):t==="es"?qie(e):t==="hi"?Uie(e):Bie(e)}),Gie=e=>`Searched images for “${e==null?void 0:e.query}”`,Vie=e=>`已搜索图片“${e==null?void 0:e.query}”`,Kie=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,Wie=e=>`بحث في الصور عن «${e==null?void 0:e.query}»`,Qie=e=>`Buscó imágenes de “${e==null?void 0:e.query}”`,Xie=e=>`“${e==null?void 0:e.query}” के लिए इमेज खोजीं`,Yie=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Vie(e):t==="fa"?Kie(e):t==="ar"?Wie(e):t==="es"?Qie(e):t==="hi"?Xie(e):Gie(e)}),Zie=()=>"Searched the literature",Jie=()=>"已搜索文献",eae=()=>"منابع علمی جست‌وجو شد",tae=()=>"بحث في الأدبيات",nae=()=>"Buscó en la literatura",rae=()=>"साहित्य खोजा",UE=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Jie():t==="fa"?eae():t==="ar"?tae():t==="es"?nae():t==="hi"?rae():Zie()}),sae=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,iae=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,aae=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,oae=e=>`بحث عن «${e==null?void 0:e.pattern}» في صفحة`,cae=e=>`Buscó “${e==null?void 0:e.pattern}” en una página`,lae=e=>`पेज पर “${e==null?void 0:e.pattern}” खोजा`,uae=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?iae(e):t==="fa"?aae(e):t==="ar"?oae(e):t==="es"?cae(e):t==="hi"?lae(e):sae(e)}),_ae=()=>"Searched OpenAlex",fae=()=>"已搜索 OpenAlex",dae=()=>"OpenAlex جست‌وجو شد",hae=()=>"بحث في OpenAlex",pae=()=>"Buscó en OpenAlex",mae=()=>"OpenAlex खोजा",gae=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fae():t==="fa"?dae():t==="ar"?hae():t==="es"?pae():t==="hi"?mae():_ae()}),vae=()=>"Searched PubMed",bae=()=>"已搜索 PubMed",yae=()=>"PubMed جست‌وجو شد",xae=()=>"بحث في PubMed",wae=()=>"Buscó en PubMed",kae=()=>"PubMed खोजा",Sae=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bae():t==="fa"?yae():t==="ar"?xae():t==="es"?wae():t==="hi"?kae():vae()}),Cae=e=>`Searched the web for “${e==null?void 0:e.query}”`,Eae=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,Nae=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,zae=e=>`بحث في الويب عن «${e==null?void 0:e.query}»`,jae=e=>`Buscó “${e==null?void 0:e.query}” en la web`,Tae=e=>`“${e==null?void 0:e.query}” के लिए वेब खोजा`,GE=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Eae(e):t==="fa"?Nae(e):t==="ar"?zae(e):t==="es"?jae(e):t==="hi"?Tae(e):Cae(e)}),Aae=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,Rae=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,Mae=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,Oae=e=>`بحث في صفحة ويب عن «${e==null?void 0:e.pattern}»`,Dae=e=>`Buscó “${e==null?void 0:e.pattern}” en una página web`,Lae=e=>`“${e==null?void 0:e.pattern}” के लिए एक वेब पेज खोजा`,Iae=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Rae(e):t==="fa"?Mae(e):t==="ar"?Oae(e):t==="es"?Dae(e):t==="hi"?Lae(e):Aae(e)}),$ae=()=>"Searching…",Bae=()=>"正在搜索…",Pae=()=>"در حال جست‌وجو…",Fae=()=>"جارٍ البحث…",Hae=()=>"Buscando…",qae=()=>"खोज रहा है…",Uae=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bae():t==="fa"?Pae():t==="ar"?Fae():t==="es"?Hae():t==="hi"?qae():$ae()}),Gae=()=>"Sent input to an agent",Vae=()=>"已向智能体发送输入",Kae=()=>"ورودی به عامل فرستاده شد",Wae=()=>"أرسل مدخلًا إلى وكيل",Qae=()=>"Envió información a un agente",Xae=()=>"एक एजेंट को इनपुट भेजा",Yae=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vae():t==="fa"?Kae():t==="ar"?Wae():t==="es"?Qae():t==="hi"?Xae():Gae()}),Zae=()=>"Spawned an agent",Jae=()=>"已创建智能体",eoe=()=>"یک عامل ساخته شد",toe=()=>"أنشأ وكيلًا",noe=()=>"Creó un agente",roe=()=>"एक एजेंट शुरू किया",soe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Jae():t==="fa"?eoe():t==="ar"?toe():t==="es"?noe():t==="hi"?roe():Zae()}),ioe=()=>"Sub-agent",aoe=()=>"子智能体",ooe=()=>"عامل فرعی",coe=()=>"وكيل فرعي",loe=()=>"Subagente",uoe=()=>"सब-एजेंट",_oe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?aoe():t==="fa"?ooe():t==="ar"?coe():t==="es"?loe():t==="hi"?uoe():ioe()}),foe=()=>"Sub-agent interrupted",doe=()=>"子智能体已中断",hoe=()=>"عامل فرعی متوقف شد",poe=()=>"قُوطع الوكيل الفرعي",moe=()=>"Subagente interrumpido",goe=()=>"सब-एजेंट बाधित हुआ",voe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?doe():t==="fa"?hoe():t==="ar"?poe():t==="es"?moe():t==="hi"?goe():foe()}),boe=()=>"Sub-agent started",yoe=()=>"子智能体已启动",xoe=()=>"عامل فرعی آغاز شد",woe=()=>"بدأ الوكيل الفرعي",koe=()=>"Subagente iniciado",Soe=()=>"सब-एजेंट शुरू हुआ",Coe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yoe():t==="fa"?xoe():t==="ar"?woe():t==="es"?koe():t==="hi"?Soe():boe()}),Eoe=()=>"Updated experiment notes",Noe=()=>"已更新实验笔记",zoe=()=>"یادداشت‌های آزمایش به‌روز شد",joe=()=>"حدّث ملاحظات التجربة",Toe=()=>"Actualizó las notas del experimento",Aoe=()=>"प्रयोग के नोट्स अपडेट किए",Roe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Noe():t==="fa"?zoe():t==="ar"?joe():t==="es"?Toe():t==="hi"?Aoe():Eoe()}),Moe=()=>"Waiting on an agent",Ooe=()=>"正在等待智能体",Doe=()=>"در انتظار عامل",Loe=()=>"في انتظار وكيل",Ioe=()=>"Esperando a un agente",$oe=()=>"एजेंट का इंतज़ार है",Boe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ooe():t==="fa"?Doe():t==="ar"?Loe():t==="es"?Ioe():t==="hi"?$oe():Moe()}),Poe=e=>`Approval required: ${e==null?void 0:e.label}`,Foe=e=>`需要批准:${e==null?void 0:e.label}`,Hoe=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,qoe=e=>`الموافقة مطلوبة: ${e==null?void 0:e.label}`,Uoe=e=>`Aprobación necesaria: ${e==null?void 0:e.label}`,Goe=e=>`स्वीकृति ज़रूरी है: ${e==null?void 0:e.label}`,VE=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Foe(e):t==="fa"?Hoe(e):t==="ar"?qoe(e):t==="es"?Uoe(e):t==="hi"?Goe(e):Poe(e)}),Voe=()=>"The CLI is retrying the turn.",Koe=()=>"CLI 正在重试本轮。",Woe=()=>"CLI در حال تلاش دوباره برای این نوبت است.",Qoe=()=>"تحاول واجهة سطر الأوامر تنفيذ الجولة مجددًا.",Xoe=()=>"La CLI está reintentando el turno.",Yoe=()=>"CLI टर्न फिर से कोशिश कर रहा है।",Zoe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Koe():t==="fa"?Woe():t==="ar"?Qoe():t==="es"?Xoe():t==="hi"?Yoe():Voe()}),Joe=()=>"Continue is available.",ece=()=>"可以继续。",tce=()=>"ادامه در دسترس است.",nce=()=>"المتابعة متاحة.",rce=()=>"Puedes continuar.",sce=()=>"जारी रखना उपलब्ध है।",ice=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ece():t==="fa"?tce():t==="ar"?nce():t==="es"?rce():t==="hi"?sce():Joe()}),ace=()=>"Retry is available.",oce=()=>"可以重试。",cce=()=>"تلاش دوباره در دسترس است.",lce=()=>"إعادة المحاولة متاحة.",uce=()=>"Puedes reintentarlo.",_ce=()=>"फिर से कोशिश करना उपलब्ध है।",fce=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?oce():t==="fa"?cce():t==="ar"?lce():t==="es"?uce():t==="hi"?_ce():ace()}),dce=()=>"Running a tool",hce=()=>"正在运行工具",pce=()=>"در حال اجرای ابزار",mce=()=>"جارٍ تشغيل أداة",gce=()=>"Ejecutando una herramienta",vce=()=>"एक टूल चल रहा है",bce=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hce():t==="fa"?pce():t==="ar"?mce():t==="es"?gce():t==="hi"?vce():dce()}),yce=()=>"Tool activity completed",xce=()=>"工具活动已完成",wce=()=>"فعالیت ابزار کامل شد",kce=()=>"اكتمل نشاط الأداة",Sce=()=>"Actividad de la herramienta completada",Cce=()=>"टूल गतिविधि पूरी हुई",Ece=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xce():t==="fa"?wce():t==="ar"?kce():t==="es"?Sce():t==="hi"?Cce():yce()}),Nce=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,zce=e=>`工具活动失败:${e==null?void 0:e.labels}`,jce=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,Tce=e=>`فشل نشاط الأداة: ${e==null?void 0:e.labels}`,Ace=e=>`Error en la actividad de la herramienta: ${e==null?void 0:e.labels}`,Rce=e=>`टूल गतिविधि विफल: ${e==null?void 0:e.labels}`,Mce=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?zce(e):t==="fa"?jce(e):t==="ar"?Tce(e):t==="es"?Ace(e):t==="hi"?Rce(e):Nce(e)}),Oce=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,Dce=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,Lce=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,Ice=e=>`فشل ${e==null?void 0:e.count} من أنشطة الأدوات: ${e==null?void 0:e.labels}`,$ce=e=>`Actividades de herramientas con error (${e==null?void 0:e.count}): ${e==null?void 0:e.labels}`,Bce=e=>`${e==null?void 0:e.count} टूल गतिविधियाँ विफल: ${e==null?void 0:e.labels}`,Pce=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Dce(e):t==="fa"?Lce(e):t==="ar"?Ice(e):t==="es"?$ce(e):t==="hi"?Bce(e):Oce(e)}),Fce=()=>"Turn did not finish.",Hce=()=>"本轮未完成。",qce=()=>"این نوبت کامل نشد.",Uce=()=>"لم تكتمل الجولة.",Gce=()=>"El turno no terminó.",Vce=()=>"यह टर्न पूरा नहीं हुआ।",Kce=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Hce():t==="fa"?qce():t==="ar"?Uce():t==="es"?Gce():t==="hi"?Vce():Fce()}),Wce=()=>"Artifacts",Qce=()=>"产物",Xce=()=>"خروجی‌ها",Yce=()=>"المُخرَجات",Zce=()=>"Artefactos",Jce=()=>"आर्टिफ़ैक्ट",wD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Qce():t==="fa"?Xce():t==="ar"?Yce():t==="es"?Zce():t==="hi"?Jce():Wce()}),ele=()=>"Close panel",tle=()=>"关闭面板",nle=()=>"بستن پنل",rle=()=>"إغلاق اللوحة",sle=()=>"Cerrar panel",ile=()=>"पैनल बंद करें",A0=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tle():t==="fa"?nle():t==="ar"?rle():t==="es"?sle():t==="hi"?ile():ele()}),ale=()=>"Current task",ole=()=>"当前任务",cle=()=>"وظیفهٔ فعلی",lle=()=>"المهمة الحالية",ule=()=>"Tarea actual",_le=()=>"मौजूदा टास्क",KE=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ole():t==="fa"?cle():t==="ar"?lle():t==="es"?ule():t==="hi"?_le():ale()}),fle=()=>"Drag to resize panel",dle=()=>"拖动以调整面板大小",hle=()=>"برای تغییر اندازهٔ پنل بکشید",ple=()=>"اسحب لتغيير حجم اللوحة",mle=()=>"Arrastra para cambiar el tamaño del panel",gle=()=>"पैनल का आकार बदलने के लिए खींचें",vle=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dle():t==="fa"?hle():t==="ar"?ple():t==="es"?mle():t==="hi"?gle():fle()}),ble=()=>"Drag toward the center to restore panel",yle=()=>"向中央拖动以恢复面板",xle=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",wle=()=>"اسحب نحو المنتصف لاستعادة اللوحة",kle=()=>"Arrastra hacia el centro para restaurar el panel",Sle=()=>"पैनल वापस लाने के लिए बीच की ओर खींचें",Cle=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yle():t==="fa"?xle():t==="ar"?wle():t==="es"?kle():t==="hi"?Sle():ble()}),Ele=()=>"Entire project",Nle=()=>"整个项目",zle=()=>"کل پروژه",jle=()=>"المشروع بالكامل",Tle=()=>"Todo el proyecto",Ale=()=>"पूरा प्रोजेक्ट",WE=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Nle():t==="fa"?zle():t==="ar"?jle():t==="es"?Tle():t==="hi"?Ale():Ele()}),Rle=()=>"Expand panel",Mle=()=>"展开面板",Ole=()=>"گسترش پنل",Dle=()=>"توسيع اللوحة",Lle=()=>"Expandir panel",Ile=()=>"पैनल फैलाएं",QE=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Mle():t==="fa"?Ole():t==="ar"?Dle():t==="es"?Lle():t==="hi"?Ile():Rle()}),$le=e=>`Experiment filter: ${e==null?void 0:e.scope}`,Ble=e=>`实验筛选:${e==null?void 0:e.scope}`,Ple=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,Fle=e=>`تصفية التجارب: ${e==null?void 0:e.scope}`,Hle=e=>`Filtro de experimentos: ${e==null?void 0:e.scope}`,qle=e=>`प्रयोग फ़िल्टर: ${e==null?void 0:e.scope}`,Ule=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Ble(e):t==="fa"?Ple(e):t==="ar"?Fle(e):t==="es"?Hle(e):t==="hi"?qle(e):$le(e)}),Gle=()=>"Experiment view",Vle=()=>"实验视图",Kle=()=>"نمای آزمایش",Wle=()=>"عرض التجربة",Qle=()=>"Vista de experimento",Xle=()=>"प्रयोग व्यू",Yle=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vle():t==="fa"?Kle():t==="ar"?Wle():t==="es"?Qle():t==="hi"?Xle():Gle()}),Zle=()=>"Experiments",Jle=()=>"实验",eue=()=>"آزمایش‌ها",tue=()=>"التجارب",nue=()=>"Experimentos",rue=()=>"प्रयोग",kD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Jle():t==="fa"?eue():t==="ar"?tue():t==="es"?nue():t==="hi"?rue():Zle()}),sue=()=>"Files",iue=()=>"文件",aue=()=>"فایل‌ها",oue=()=>"الملفات",cue=()=>"Archivos",lue=()=>"फ़ाइलें",c3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?iue():t==="fa"?aue():t==="ar"?oue():t==="es"?cue():t==="hi"?lue():sue()}),uue=()=>"Filter experiments",_ue=()=>"筛选实验",fue=()=>"فیلتر آزمایش‌ها",due=()=>"تصفية التجارب",hue=()=>"Filtrar experimentos",pue=()=>"प्रयोग फ़िल्टर करें",mue=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_ue():t==="fa"?fue():t==="ar"?due():t==="es"?hue():t==="hi"?pue():uue()}),gue=()=>"Current task filtering is unavailable for unattributed experiments",vue=()=>"存在无法归属的实验时,不能按当前任务筛选",bue=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",yue=()=>"تصفية المهمة الحالية غير متاحة للتجارب غير المنسوبة",xue=()=>"No se puede filtrar por la tarea actual en experimentos sin tarea asignada",wue=()=>"बिना श्रेय वाले प्रयोगों के लिए मौजूदा टास्क फ़िल्टरिंग उपलब्ध नहीं है",kue=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vue():t==="fa"?bue():t==="ar"?yue():t==="es"?xue():t==="hi"?wue():gue()}),Sue=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",Cue=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",Eue=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",Nue=()=>"لا توجد تجارب من المهمة الحالية بعد. بدّل إلى «المشروع بالكامل» لرؤية جميع التجارب.",zue=()=>"Aún no hay experimentos de la tarea actual. Cambia a Todo el proyecto para ver todos los experimentos.",jue=()=>"मौजूदा टास्क से अभी तक कोई प्रयोग नहीं। सभी प्रयोग देखने के लिए पूरा प्रोजेक्ट पर स्विच करें।",Tue=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Cue():t==="fa"?Eue():t==="ar"?Nue():t==="es"?zue():t==="hi"?jue():Sue()}),Aue=()=>"Open a task to filter to its experiments",Rue=()=>"请打开一个任务以筛选其实验",Mue=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",Oue=()=>"افتح مهمة لعرض تجاربها فقط",Due=()=>"Abre una tarea para filtrar por sus experimentos",Lue=()=>"इसके प्रयोगों तक फ़िल्टर करने के लिए एक टास्क खोलें",Iue=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rue():t==="fa"?Mue():t==="ar"?Oue():t==="es"?Due():t==="hi"?Lue():Aue()}),$ue=()=>"projects",Bue=()=>"项目",Pue=()=>"پروژه‌ها",Fue=()=>"المشاريع",Hue=()=>"los proyectos",que=()=>"प्रोजेक्ट",f0=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bue():t==="fa"?Pue():t==="ar"?Fue():t==="es"?Hue():t==="hi"?que():$ue()}),Uue=()=>"Restore panel",Gue=()=>"还原面板",Vue=()=>"بازگرداندن اندازهٔ پنل",Kue=()=>"استعادة اللوحة",Wue=()=>"Restaurar panel",Que=()=>"पैनल वापस लाएं",XE=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Gue():t==="fa"?Vue():t==="ar"?Kue():t==="es"?Wue():t==="hi"?Que():Uue()}),Xue=()=>"Retry",Yue=()=>"重试",Zue=()=>"تلاش دوباره",Jue=()=>"إعادة المحاولة",e_e=()=>"Reintentar",t_e=()=>"फिर से कोशिश करें",Ys=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Yue():t==="fa"?Zue():t==="ar"?Jue():t==="es"?e_e():t==="hi"?t_e():Xue()}),n_e=()=>"Select a project to browse its files.",r_e=()=>"选择一个项目以浏览其文件。",s_e=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",i_e=()=>"اختر مشروعًا لتصفح ملفاته.",a_e=()=>"Selecciona un proyecto para explorar sus archivos.",o_e=()=>"फ़ाइलें ब्राउज़ करने के लिए एक प्रोजेक्ट चुनें।",c_e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?r_e():t==="fa"?s_e():t==="ar"?i_e():t==="es"?a_e():t==="hi"?o_e():n_e()}),l_e=()=>"settings",u_e=()=>"设置",__e=()=>"تنظیمات",f_e=()=>"الإعدادات",d_e=()=>"la configuración",h_e=()=>"सेटिंग्स",p_e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?u_e():t==="fa"?__e():t==="ar"?f_e():t==="es"?d_e():t==="hi"?h_e():l_e()}),m_e=()=>"Show archived",g_e=()=>"显示已归档",v_e=()=>"نمایش بایگانی‌شده‌ها",b_e=()=>"إظهار المؤرشف",y_e=()=>"Mostrar archivados",x_e=()=>"संग्रहीत दिखाएँ",w_e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?g_e():t==="fa"?v_e():t==="ar"?b_e():t==="es"?y_e():t==="hi"?x_e():m_e()}),k_e=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,S_e=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,C_e=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,E_e=e=>`تعذّر تحميل ${e==null?void 0:e.items} في OpenResearch.`,N_e=e=>`Error al cargar ${e==null?void 0:e.items} de OpenResearch.`,z_e=e=>`OpenResearch ${e==null?void 0:e.items} लोड नहीं हो सके।`,j_e=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?S_e(e):t==="fa"?C_e(e):t==="ar"?E_e(e):t==="es"?N_e(e):t==="hi"?z_e(e):k_e(e)}),T_e=()=>"Sub-agent",A_e=()=>"子智能体",R_e=()=>"عامل فرعی",M_e=()=>"وكيل فرعي",O_e=()=>"Subagente",D_e=()=>"सब-एजेंट",L_e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?A_e():t==="fa"?R_e():t==="ar"?M_e():t==="es"?O_e():t==="hi"?D_e():T_e()}),I_e=()=>"Table",$_e=()=>"表格",B_e=()=>"جدول",P_e=()=>"جدول",F_e=()=>"Tabla",H_e=()=>"टेबल",q_e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$_e():t==="fa"?B_e():t==="ar"?P_e():t==="es"?F_e():t==="hi"?H_e():I_e()}),U_e=()=>"Tree",G_e=()=>"树状图",V_e=()=>"درخت",K_e=()=>"شجرة",W_e=()=>"Árbol",Q_e=()=>"ट्री",X_e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?G_e():t==="fa"?V_e():t==="ar"?K_e():t==="es"?W_e():t==="hi"?Q_e():U_e()}),Y_e=e=>`Collapse ${e==null?void 0:e.name}`,Z_e=e=>`折叠 ${e==null?void 0:e.name}`,J_e=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,efe=e=>`طيّ ${e==null?void 0:e.name}`,tfe=e=>`Contraer ${e==null?void 0:e.name}`,nfe=e=>`${e==null?void 0:e.name} समेटें`,rfe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Z_e(e):t==="fa"?J_e(e):t==="ar"?efe(e):t==="es"?tfe(e):t==="hi"?nfe(e):Y_e(e)}),sfe=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,ife=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,afe=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,ofe=e=>`حذف «${e==null?void 0:e.path}» من دليل المُخرَجات؟`,cfe=e=>`¿Eliminar “${e==null?void 0:e.path}” del directorio de artefactos?`,lfe=e=>`“${e==null?void 0:e.path}” को आर्टिफ़ैक्ट डायरेक्टरी से हटाएं?`,Gk=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?ife(e):t==="fa"?afe(e):t==="ar"?ofe(e):t==="es"?cfe(e):t==="hi"?lfe(e):sfe(e)}),ufe=e=>`Delete folder ${e==null?void 0:e.name}`,_fe=e=>`删除文件夹 ${e==null?void 0:e.name}`,ffe=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,dfe=e=>`حذف المجلد ${e==null?void 0:e.name}`,hfe=e=>`Eliminar la carpeta ${e==null?void 0:e.name}`,pfe=e=>`${e==null?void 0:e.name} फ़ोल्डर हटाएं`,mfe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?_fe(e):t==="fa"?ffe(e):t==="ar"?dfe(e):t==="es"?hfe(e):t==="hi"?pfe(e):ufe(e)}),gfe=e=>`Expand ${e==null?void 0:e.name}`,vfe=e=>`展开 ${e==null?void 0:e.name}`,bfe=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,yfe=e=>`توسيع ${e==null?void 0:e.name}`,xfe=e=>`Expandir ${e==null?void 0:e.name}`,wfe=e=>`${e==null?void 0:e.name} फैलाएं`,kfe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?vfe(e):t==="fa"?bfe(e):t==="ar"?yfe(e):t==="es"?xfe(e):t==="hi"?wfe(e):gfe(e)}),Sfe=()=>"Binary or unsupported file — no inline preview.",Cfe=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",Efe=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",Nfe=()=>"ملف ثنائي أو غير مدعوم — لا توجد معاينة مضمّنة.",zfe=()=>"Archivo binario o no compatible — sin vista previa.",jfe=()=>"बाइनरी या असमर्थित फ़ाइल — इनलाइन प्रीव्यू नहीं है।",Tfe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Cfe():t==="fa"?Efe():t==="ar"?Nfe():t==="es"?zfe():t==="hi"?jfe():Sfe()}),Afe=()=>"Copy path",Rfe=()=>"复制路径",Mfe=()=>"کپی مسیر",Ofe=()=>"نسخ المسار",Dfe=()=>"Copiar ruta",Lfe=()=>"पथ कॉपी करें",Ife=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rfe():t==="fa"?Mfe():t==="ar"?Ofe():t==="es"?Dfe():t==="hi"?Lfe():Afe()}),$fe=()=>"Artifact not found",Bfe=()=>"找不到产物",Pfe=()=>"خروجی پیدا نشد",Ffe=()=>"لم يُعثر على المُخرَج",Hfe=()=>"No se encontró el artefacto",qfe=()=>"आर्टिफ़ैक्ट नहीं मिला",Ufe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bfe():t==="fa"?Pfe():t==="ar"?Ffe():t==="es"?Hfe():t==="hi"?qfe():$fe()}),Gfe=()=>"Open raw",Vfe=()=>"打开原始文件",Kfe=()=>"باز کردن فایل خام",Wfe=()=>"فتح الملف الخام",Qfe=()=>"Abrir sin formato",Xfe=()=>"रॉ खोलें",Yfe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vfe():t==="fa"?Kfe():t==="ar"?Wfe():t==="es"?Qfe():t==="hi"?Xfe():Gfe()}),Zfe=()=>"Click an artifact to view it",Jfe=()=>"点击产物即可查看",ede=()=>"برای مشاهده، یک خروجی را انتخاب کنید",tde=()=>"انقر على مُخرَج لعرضه",nde=()=>"Selecciona un artefacto para verlo",rde=()=>"देखने के लिए किसी आर्टिफ़ैक्ट पर क्लिक करें",sde=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Jfe():t==="fa"?ede():t==="ar"?tde():t==="es"?nde():t==="hi"?rde():Zfe()}),ide=()=>"Delete artifact",ade=()=>"删除产物",ode=()=>"حذف خروجی",cde=()=>"حذف المُخرَج",lde=()=>"Eliminar artefacto",ude=()=>"आर्टिफ़ैक्ट हटाएं",YE=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ade():t==="fa"?ode():t==="ar"?cde():t==="es"?lde():t==="hi"?ude():ide()}),_de=()=>"Delete folder",fde=()=>"删除文件夹",dde=()=>"حذف پوشه",hde=()=>"حذف المجلد",pde=()=>"Eliminar carpeta",mde=()=>"फ़ोल्डर हटाएं",gde=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fde():t==="fa"?dde():t==="ar"?hde():t==="es"?pde():t==="hi"?mde():_de()}),vde=()=>"Failed to load:",bde=()=>"加载失败:",yde=()=>"بارگیری ناموفق بود:",xde=()=>"تعذّر التحميل:",wde=()=>"Error al cargar:",kde=()=>"लोड नहीं हो सका:",Sde=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bde():t==="fa"?yde():t==="ar"?xde():t==="es"?wde():t==="hi"?kde():vde()}),Cde=()=>"File truncated — showing the first 512 KB.",Ede=()=>"文件已截断——仅显示前 512 KB。",Nde=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",zde=()=>"تم اقتطاع الملف — عرض أول 512 كيلوبايت.",jde=()=>"Archivo truncado — se muestran los primeros 512 KB.",Tde=()=>"फ़ाइल छोटी की गई — पहले 512 KB दिखाए जा रहे हैं।",Ade=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ede():t==="fa"?Nde():t==="ar"?zde():t==="es"?jde():t==="hi"?Tde():Cde()}),Rde=()=>"Listing truncated — the folder has more artifacts.",Mde=()=>"列表已截断——文件夹中还有更多产物。",Ode=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",Dde=()=>"تم اقتطاع القائمة — يحتوي المجلد على مُخرَجات أخرى.",Lde=()=>"Listado truncado — la carpeta tiene más artefactos.",Ide=()=>"सूची छोटी की गई — इस फ़ोल्डर में और भी आर्टिफ़ैक्ट हैं।",$de=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Mde():t==="fa"?Ode():t==="ar"?Dde():t==="es"?Lde():t==="hi"?Ide():Rde()}),Bde=()=>"Loading…",Pde=()=>"正在加载…",Fde=()=>"در حال بارگیری…",Hde=()=>"جارٍ التحميل…",qde=()=>"Cargando…",Ude=()=>"लोड हो रहा है…",SD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Pde():t==="fa"?Fde():t==="ar"?Hde():t==="es"?qde():t==="hi"?Ude():Bde()}),Gde=()=>"Loading artifacts…",Vde=()=>"正在加载产物…",Kde=()=>"در حال بارگیری خروجی‌ها…",Wde=()=>"جارٍ تحميل المُخرَجات…",Qde=()=>"Cargando artefactos…",Xde=()=>"आर्टिफ़ैक्ट लोड हो रहे हैं…",Yde=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vde():t==="fa"?Kde():t==="ar"?Wde():t==="es"?Qde():t==="hi"?Xde():Gde()}),Zde=()=>"Modified",Jde=()=>"修改时间",ehe=()=>"ویرایش‌شده",the=()=>"عُدّل",nhe=()=>"Modificado",rhe=()=>"बदला गया",she=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Jde():t==="fa"?ehe():t==="ar"?the():t==="es"?nhe():t==="hi"?rhe():Zde()}),ihe=()=>"No artifacts yet",ahe=()=>"尚无产物",ohe=()=>"هنوز خروجی‌ای وجود ندارد",che=()=>"لا توجد مُخرَجات بعد",lhe=()=>"Aún no hay artefactos",uhe=()=>"अभी तक कोई आर्टिफ़ैक्ट नहीं",_he=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ahe():t==="fa"?ohe():t==="ar"?che():t==="es"?lhe():t==="hi"?uhe():ihe()}),fhe=()=>"Open raw in new tab",dhe=()=>"在新标签页中打开原始文件",hhe=()=>"باز کردن فایل خام در زبانهٔ جدید",phe=()=>"فتح الملف الخام في تبويب جديد",mhe=()=>"Abrir sin formato en una pestaña nueva",ghe=()=>"नए टैब में रॉ खोलें",ZE=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dhe():t==="fa"?hhe():t==="ar"?phe():t==="es"?mhe():t==="hi"?ghe():fhe()}),vhe=()=>"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.",bhe=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件。",yhe=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید.",xhe=()=>"هذه هي مساحة المُخرَجات الدائمة للمشروع، للتقارير والأشكال والصور وملفات CSV وملفات PDF وغيرها من مُخرَجات البحث. اطلب من الوكيل كتابة تقرير أو أضِف ملفاتك الخاصة.",whe=()=>"Este es el espacio de resultados permanente del proyecto: informes, figuras, imágenes, CSV, PDF y otros artefactos de investigación. Pídele al agente un informe o añade tus propios archivos.",khe=()=>"यह प्रोजेक्ट का स्थायी आउटपुट स्थान है — रिपोर्ट, फ़िगर, इमेज, CSV, PDF और अन्य शोध आर्टिफ़ैक्ट के लिए। एजेंट से कोई लेख लिखने को कहें या अपनी फ़ाइलें खुद जोड़ें।",She=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bhe():t==="fa"?yhe():t==="ar"?xhe():t==="es"?whe():t==="hi"?khe():vhe()}),Che=()=>"File too large to preview inline.",Ehe=()=>"文件太大,无法内嵌预览。",Nhe=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",zhe=()=>"الملف كبير جدًا للمعاينة المضمّنة.",jhe=()=>"El archivo es demasiado grande para previsualizarlo.",The=()=>"फ़ाइल इनलाइन प्रीव्यू के लिए बहुत बड़ी है।",Ahe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ehe():t==="fa"?Nhe():t==="ar"?zhe():t==="es"?jhe():t==="hi"?The():Che()}),Rhe=()=>"This is the baseline branch, so there is no parent comparison.",Mhe=()=>"这是基线分支,因此没有父分支可供比较。",Ohe=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",Dhe=()=>"هذا هو الفرع الأساس، فلا يوجد فرع أصل للمقارنة.",Lhe=()=>"Esta es la rama base, así que no hay comparación con una rama padre.",Ihe=()=>"यह बेसलाइन ब्रांच है, इसलिए कोई पैरेंट तुलना नहीं है।",$he=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Mhe():t==="fa"?Ohe():t==="ar"?Dhe():t==="es"?Lhe():t==="hi"?Ihe():Rhe()}),Bhe=()=>"Failed to load changes:",Phe=()=>"加载更改失败:",Fhe=()=>"بارگیری تغییرات ناموفق بود:",Hhe=()=>"تعذّر تحميل التغييرات:",qhe=()=>"Error al cargar los cambios:",Uhe=()=>"बदलाव लोड नहीं हो सके:",Ghe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Phe():t==="fa"?Fhe():t==="ar"?Hhe():t==="es"?qhe():t==="hi"?Uhe():Bhe()}),Vhe=()=>"Loading changes…",Khe=()=>"正在加载更改…",Whe=()=>"در حال بارگیری تغییرات…",Qhe=()=>"جارٍ تحميل التغييرات…",Xhe=()=>"Cargando cambios…",Yhe=()=>"बदलाव लोड हो रहे हैं…",Zhe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Khe():t==="fa"?Whe():t==="ar"?Qhe():t==="es"?Xhe():t==="hi"?Yhe():Vhe()}),Jhe=()=>"No committed changes from the parent branch.",epe=()=>"与父分支相比没有已提交的更改。",tpe=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",npe=()=>"لا توجد تغييرات مودعة عن الفرع الأصل.",rpe=()=>"No hay cambios confirmados respecto a la rama padre.",spe=()=>"पैरेंट ब्रांच से कोई कमिट किए गए बदलाव नहीं।",ipe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?epe():t==="fa"?tpe():t==="ar"?npe():t==="es"?rpe():t==="hi"?spe():Jhe()}),ape=e=>`agent ${e==null?void 0:e.number}`,ope=e=>`智能体 ${e==null?void 0:e.number}`,cpe=e=>`عامل ${e==null?void 0:e.number}`,lpe=e=>`وكيل ${e==null?void 0:e.number}`,upe=e=>`agente ${e==null?void 0:e.number}`,_pe=e=>`एजेंट ${e==null?void 0:e.number}`,JE=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?ope(e):t==="fa"?cpe(e):t==="ar"?lpe(e):t==="es"?upe(e):t==="hi"?_pe(e):ape(e)}),fpe=()=>"agent sessions",dpe=()=>"智能体会话",hpe=()=>"نشست‌های عامل‌ها",ppe=()=>"جلسات الوكلاء",mpe=()=>"sesiones de agente",gpe=()=>"एजेंट सेशन",vpe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dpe():t==="fa"?hpe():t==="ar"?ppe():t==="es"?mpe():t==="hi"?gpe():fpe()}),bpe=()=>"All sessions",ype=()=>"所有会话",xpe=()=>"همهٔ نشست‌ها",wpe=()=>"كل الجلسات",kpe=()=>"Todas las sesiones",Spe=()=>"सभी सेशन",CD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ype():t==="fa"?xpe():t==="ar"?wpe():t==="es"?kpe():t==="hi"?Spe():bpe()}),Cpe=e=>`${e==null?void 0:e.count} annotations`,Epe=e=>`${e==null?void 0:e.count} 条批注`,Npe=e=>`${e==null?void 0:e.count} یادداشت`,zpe=e=>`التعليقات: ${e==null?void 0:e.count}`,jpe=e=>`${e==null?void 0:e.count} anotaciones`,Tpe=e=>`${e==null?void 0:e.count} एनोटेशन`,Ape=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Epe(e):t==="fa"?Npe(e):t==="ar"?zpe(e):t==="es"?jpe(e):t==="hi"?Tpe(e):Cpe(e)}),Rpe=()=>"Archive",Mpe=()=>"归档",Ope=()=>"بایگانی",Dpe=()=>"أرشفة",Lpe=()=>"Archivar",Ipe=()=>"आर्काइव करें",$pe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Mpe():t==="fa"?Ope():t==="ar"?Dpe():t==="es"?Lpe():t==="hi"?Ipe():Rpe()}),Bpe=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",Ppe=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",Fpe=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",Hpe=()=>"اسأل وكيل البحث… (/ للأوامر والمهارات، ! للطرفية)",qpe=()=>"Pregunta al agente de investigación… (/ para comandos y skills, ! para la shell)",Upe=()=>"शोध एजेंट से पूछें… (कमांड और स्किल के लिए /, शेल के लिए !)",Gpe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ppe():t==="fa"?Fpe():t==="ar"?Hpe():t==="es"?qpe():t==="hi"?Upe():Bpe()}),Vpe=()=>"Asked about selected text",Kpe=()=>"已询问所选文本",Wpe=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",Qpe=()=>"سأل عن النص المحدد",Xpe=()=>"Preguntó sobre el texto seleccionado",Ype=()=>"चयनित टेक्स्ट के बारे में पूछा",Zpe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Kpe():t==="fa"?Wpe():t==="ar"?Qpe():t==="es"?Xpe():t==="hi"?Ype():Vpe()}),Jpe=()=>"Attachment",e0e=()=>"附件",t0e=()=>"پیوست",n0e=()=>"مرفق",r0e=()=>"Adjunto",s0e=()=>"अटैचमेंट",i0e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?e0e():t==="fa"?t0e():t==="ar"?n0e():t==="es"?r0e():t==="hi"?s0e():Jpe()}),a0e=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,o0e=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,c0e=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,l0e=e=>`${e==null?void 0:e.name} كبير جدًا — يجب أن يكون كل مرفق أقل من 30 ميغابايت.`,u0e=e=>`${e==null?void 0:e.name} es demasiado grande — cada adjunto debe ocupar menos de 30 MB.`,_0e=e=>`${e==null?void 0:e.name} बहुत बड़ी है — हर अटैचमेंट 30 MB से कम होनी चाहिए।`,f0e=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?o0e(e):t==="fa"?c0e(e):t==="ar"?l0e(e):t==="es"?u0e(e):t==="hi"?_0e(e):a0e(e)}),d0e=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",h0e=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",p0e=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",m0e=()=>"تتجاوز المرفقات الحد الإجمالي 40 ميغابايت — أزِل واحدًا وحاول مجددًا.",g0e=()=>"Los adjuntos superan el límite total de 40 MB — quita uno y vuelve a intentarlo.",v0e=()=>"अटैचमेंट 40 MB की कुल सीमा से ज़्यादा हैं — एक हटाएं और फिर से कोशिश करें।",b0e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?h0e():t==="fa"?p0e():t==="ar"?m0e():t==="es"?g0e():t==="hi"?v0e():d0e()}),y0e=()=>"Wait for the turn to finish before running a command.",x0e=()=>"请等待本轮结束后再运行命令。",w0e=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",k0e=()=>"انتظر انتهاء الجولة قبل تنفيذ أمر.",S0e=()=>"Espera a que termine el turno antes de ejecutar un comando.",C0e=()=>"कमांड चलाने से पहले टर्न खत्म होने का इंतज़ार करें।",E0e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?x0e():t==="fa"?w0e():t==="ar"?k0e():t==="es"?S0e():t==="hi"?C0e():y0e()}),N0e=e=>`Exited with code ${e==null?void 0:e.code}`,z0e=e=>`退出码 ${e==null?void 0:e.code}`,j0e=e=>`با کد ${e==null?void 0:e.code} خارج شد`,T0e=e=>`خرج برمز ${e==null?void 0:e.code}`,A0e=e=>`Terminó con el código ${e==null?void 0:e.code}`,R0e=e=>`कोड ${e==null?void 0:e.code} के साथ बाहर निकला`,M0e=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?z0e(e):t==="fa"?j0e(e):t==="ar"?T0e(e):t==="es"?A0e(e):t==="hi"?R0e(e):N0e(e)}),O0e=e=>`Command not run: ${e==null?void 0:e.error}`,D0e=e=>`命令未运行:${e==null?void 0:e.error}`,L0e=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,I0e=e=>`لم يُنفَّذ الأمر: ${e==null?void 0:e.error}`,$0e=e=>`No se ejecutó el comando: ${e==null?void 0:e.error}`,B0e=e=>`कमांड नहीं चलाई गई: ${e==null?void 0:e.error}`,eN=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?D0e(e):t==="fa"?L0e(e):t==="ar"?I0e(e):t==="es"?$0e(e):t==="hi"?B0e(e):O0e(e)}),P0e=()=>"Collapse tool activity",F0e=()=>"折叠工具活动",H0e=()=>"بستن فعالیت ابزارها",q0e=()=>"طيّ نشاط الأداة",U0e=()=>"Contraer actividad de herramientas",G0e=()=>"टूल गतिविधि समेटें",V0e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?F0e():t==="fa"?H0e():t==="ar"?q0e():t==="es"?U0e():t==="hi"?G0e():P0e()}),K0e=()=>"Wait for the turn to finish before compacting.",W0e=()=>"请等待本轮结束后再压缩。",Q0e=()=>"پیش از فشرده‌سازی، منتظر پایان نوبت بمانید.",X0e=()=>"انتظر انتهاء الجولة قبل الضغط.",Y0e=()=>"Espera a que termine el turno antes de comprimir.",Z0e=()=>"छोटा करने से पहले टर्न पूरा होने का इंतज़ार करें।",J0e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?W0e():t==="fa"?Q0e():t==="ar"?X0e():t==="es"?Y0e():t==="hi"?Z0e():K0e()}),eme=e=>`Compacting failed: ${e==null?void 0:e.error}`,tme=e=>`压缩失败:${e==null?void 0:e.error}`,nme=e=>`فشرده‌سازی ناموفق بود: ${e==null?void 0:e.error}`,rme=e=>`فشل الضغط: ${e==null?void 0:e.error}`,sme=e=>`Error al comprimir: ${e==null?void 0:e.error}`,ime=e=>`छोटा करना विफल: ${e==null?void 0:e.error}`,ame=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?tme(e):t==="fa"?nme(e):t==="ar"?rme(e):t==="es"?sme(e):t==="hi"?ime(e):eme(e)}),ome=()=>"Continue",cme=()=>"继续",lme=()=>"ادامه",ume=()=>"متابعة",_me=()=>"Continuar",fme=()=>"जारी रखें",dme=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cme():t==="fa"?lme():t==="ar"?ume():t==="es"?_me():t==="hi"?fme():ome()}),hme=()=>"Copy response",pme=()=>"复制回复",mme=()=>"کپی پاسخ",gme=()=>"نسخ الرد",vme=()=>"Copiar respuesta",bme=()=>"जवाब कॉपी करें",tN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pme():t==="fa"?mme():t==="ar"?gme():t==="es"?vme():t==="hi"?bme():hme()}),yme=e=>`Delete “${e==null?void 0:e.title}”? -Its transcript will be permanently removed.`,ume=e=>`删除“${e==null?void 0:e.title}”? +Its transcript will be permanently removed.`,xme=e=>`删除“${e==null?void 0:e.title}”? -其对话记录将被永久移除。`,_me=e=>`«${e==null?void 0:e.title}» حذف شود؟ +其对话记录将被永久移除。`,wme=e=>`«${e==null?void 0:e.title}» حذف شود؟ -رونوشت آن برای همیشه حذف خواهد شد.`,fme=e=>`حذف «${e==null?void 0:e.title}»؟ +رونوشت آن برای همیشه حذف خواهد شد.`,kme=e=>`حذف «${e==null?void 0:e.title}»؟ -سيُحذف سجل المحادثة نهائيًا.`,dme=e=>`¿Eliminar “${e==null?void 0:e.title}”? +سيُحذف سجل المحادثة نهائيًا.`,Sme=e=>`¿Eliminar “${e==null?void 0:e.title}”? -Su transcripción se eliminará de forma permanente.`,hme=e=>`“${e==null?void 0:e.title}” हटाएं? +Su transcripción se eliminará de forma permanente.`,Cme=e=>`“${e==null?void 0:e.title}” हटाएं? -इसका ट्रांसक्रिप्ट स्थायी रूप से हट जाएगा।`,pme=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ume(e):t==="fa"?_me(e):t==="ar"?fme(e):t==="es"?dme(e):t==="hi"?hme(e):lme(e)}),mme=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,gme=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,vme=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,bme=e=>`تعذّر حذف «${e==null?void 0:e.title}»: ${e==null?void 0:e.error}`,yme=e=>`No se pudo eliminar “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,xme=e=>`“${e==null?void 0:e.title}” हटाने में विफल: ${e==null?void 0:e.error}`,wme=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?gme(e):t==="fa"?vme(e):t==="ar"?bme(e):t==="es"?yme(e):t==="hi"?xme(e):mme(e)}),kme=()=>"Could not exit Plan mode. Try again.",Sme=()=>"无法退出计划模式。请重试。",Cme=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",Eme=()=>"تعذّر الخروج من وضع التخطيط. حاول مجددًا.",Nme=()=>"No se pudo salir del modo Plan. Inténtalo de nuevo.",zme=()=>"प्लान मोड से बाहर नहीं निकला जा सका। फिर से कोशिश करें।",jme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sme():t==="fa"?Cme():t==="ar"?Eme():t==="es"?Nme():t==="hi"?zme():kme()}),Tme=()=>"Expand tool activity",Ame=()=>"展开工具活动",Rme=()=>"باز کردن فعالیت ابزارها",Mme=()=>"توسيع نشاط الأداة",Ome=()=>"Expandir actividad de herramientas",Dme=()=>"टूल गतिविधि फैलाएं",Lme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ame():t==="fa"?Rme():t==="ar"?Mme():t==="es"?Ome():t==="hi"?Dme():Tme()}),Ime=()=>"experiments",$me=()=>"实验",Bme=()=>"آزمایش‌ها",Pme=()=>"التجارب",Fme=()=>"experimentos",Hme=()=>"प्रयोग",qme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$me():t==="fa"?Bme():t==="ar"?Pme():t==="es"?Fme():t==="hi"?Hme():Ime()}),Ume=()=>"You",Gme=()=>"你",Vme=()=>"شما",Kme=()=>"أنت",Wme=()=>"Tú",Qme=()=>"आप",Xme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gme():t==="fa"?Vme():t==="ar"?Kme():t==="es"?Wme():t==="hi"?Qme():Ume()}),Yme=()=>"Goal cleared",Zme=()=>"已清除目标",Jme=()=>"هدف پاک شد",ege=()=>"تم مسح الهدف",tge=()=>"Objetivo borrado",nge=()=>"लक्ष्य हटाया गया",rge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zme():t==="fa"?Jme():t==="ar"?ege():t==="es"?tge():t==="hi"?nge():Yme()}),sge=e=>`Current goal: ${e==null?void 0:e.goal}`,ige=e=>`当前目标:${e==null?void 0:e.goal}`,age=e=>`هدف فعلی: ${e==null?void 0:e.goal}`,oge=e=>`الهدف الحالي: ${e==null?void 0:e.goal}`,cge=e=>`Objetivo actual: ${e==null?void 0:e.goal}`,lge=e=>`मौजूदा लक्ष्य: ${e==null?void 0:e.goal}`,uge=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ige(e):t==="fa"?age(e):t==="ar"?oge(e):t==="es"?cge(e):t==="hi"?lge(e):sge(e)}),_ge=e=>`Setting the goal failed: ${e==null?void 0:e.error}`,fge=e=>`设置目标失败:${e==null?void 0:e.error}`,dge=e=>`تنظیم هدف ناموفق بود: ${e==null?void 0:e.error}`,hge=e=>`فشل تعيين الهدف: ${e==null?void 0:e.error}`,pge=e=>`Error al definir el objetivo: ${e==null?void 0:e.error}`,mge=e=>`लक्ष्य सेट करना विफल: ${e==null?void 0:e.error}`,tN=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?fge(e):t==="fa"?dge(e):t==="ar"?hge(e):t==="es"?pge(e):t==="hi"?mge(e):_ge(e)}),gge=()=>"No goal set — add one after /goal",vge=()=>"尚未设置目标 — 在 /goal 后面写一个",bge=()=>"هدفی تنظیم نشده — یکی را بعد از /goal بنویسید",yge=()=>"لا يوجد هدف — أضف واحدًا بعد /goal",xge=()=>"Sin objetivo — añade uno después de /goal",wge=()=>"कोई लक्ष्य नहीं — /goal के बाद एक जोड़ें",kge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vge():t==="fa"?bge():t==="ar"?yge():t==="es"?xge():t==="hi"?wge():gge()}),Sge=()=>"Goal set",Cge=()=>"已设置目标",Ege=()=>"هدف تنظیم شد",Nge=()=>"تم تعيين الهدف",zge=()=>"Objetivo definido",jge=()=>"लक्ष्य सेट किया गया",Tge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cge():t==="fa"?Ege():t==="ar"?Nge():t==="es"?zge():t==="hi"?jge():Sge()}),Age=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,Rge=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,Mge=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,Oge=e=>`${e==null?void 0:e.harness} غير متاح — افتح مُنتقي النماذج`,Dge=e=>`${e==null?void 0:e.harness} no está disponible — abre el selector de modelos`,Lge=e=>`${e==null?void 0:e.harness} उपलब्ध नहीं है — मॉडल पिकर खोलें`,Ige=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Rge(e):t==="fa"?Mge(e):t==="ar"?Oge(e):t==="es"?Dge(e):t==="hi"?Lge(e):Age(e)}),$ge=e=>`Importing that chat failed: ${e==null?void 0:e.error}`,Bge=e=>`导入该聊天失败:${e==null?void 0:e.error}`,Pge=e=>`وارد کردن آن گفت‌وگو ناموفق بود: ${e==null?void 0:e.error}`,Fge=e=>`فشل استيراد تلك المحادثة: ${e==null?void 0:e.error}`,Hge=e=>`Error al importar ese chat: ${e==null?void 0:e.error}`,qge=e=>`उस चैट को इम्पोर्ट करना विफल: ${e==null?void 0:e.error}`,Uge=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Bge(e):t==="fa"?Pge(e):t==="ar"?Fge(e):t==="es"?Hge(e):t==="hi"?qge(e):$ge(e)}),Gge=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills, ! for shell)`,Vge=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能,输入 ! 运行 shell)`,Kge=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)`,Wge=e=>`راسِل ${e==null?void 0:e.harness}… (/ للأوامر والمهارات، ! للطرفية)`,Qge=e=>`Escribe a ${e==null?void 0:e.harness}… (/ para comandos y skills, ! para la shell)`,Xge=e=>`${e==null?void 0:e.harness} को संदेश भेजें… (कमांड और स्किल के लिए /, शेल के लिए !)`,Yge=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Vge(e):t==="fa"?Kge(e):t==="ar"?Wge(e):t==="es"?Qge(e):t==="hi"?Xge(e):Gge(e)}),Zge=e=>`Message not sent: ${e==null?void 0:e.error}`,Jge=e=>`消息未发送:${e==null?void 0:e.error}`,e1e=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,t1e=e=>`لم تُرسل الرسالة: ${e==null?void 0:e.error}`,n1e=e=>`Mensaje no enviado: ${e==null?void 0:e.error}`,r1e=e=>`संदेश नहीं भेजा गया: ${e==null?void 0:e.error}`,s1e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Jge(e):t==="fa"?e1e(e):t==="ar"?t1e(e):t==="es"?n1e(e):t==="hi"?r1e(e):Zge(e)}),i1e=()=>"Model unavailable",a1e=()=>"模型不可用",o1e=()=>"مدل در دسترس نیست",c1e=()=>"النموذج غير متاح",l1e=()=>"Modelo no disponible",u1e=()=>"मॉडल उपलब्ध नहीं",_1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a1e():t==="fa"?o1e():t==="ar"?c1e():t==="es"?l1e():t==="hi"?u1e():i1e()}),f1e=()=>"New session",d1e=()=>"新会话",h1e=()=>"نشست جدید",p1e=()=>"جلسة جديدة",m1e=()=>"Nueva sesión",g1e=()=>"नया सेशन",nN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?d1e():t==="fa"?h1e():t==="ar"?p1e():t==="es"?m1e():t==="hi"?g1e():f1e()}),v1e=()=>"No active sessions",b1e=()=>"没有活跃会话",y1e=()=>"نشست فعالی وجود ندارد",x1e=()=>"لا توجد جلسات نشطة",w1e=()=>"No hay sesiones activas",k1e=()=>"कोई सक्रिय सेशन नहीं",S1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b1e():t==="fa"?y1e():t==="ar"?x1e():t==="es"?w1e():t==="hi"?k1e():v1e()}),C1e=()=>"No activity",E1e=()=>"无活动",N1e=()=>"بدون فعالیت",z1e=()=>"لا يوجد نشاط",j1e=()=>"Sin actividad",T1e=()=>"कोई गतिविधि नहीं",A1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?E1e():t==="fa"?N1e():t==="ar"?z1e():t==="es"?j1e():t==="hi"?T1e():C1e()}),R1e=()=>"No archived sessions",M1e=()=>"没有已归档的会话",O1e=()=>"نشست بایگانی‌شده‌ای وجود ندارد",D1e=()=>"لا توجد جلسات مؤرشفة",L1e=()=>"No hay sesiones archivadas",I1e=()=>"कोई आर्काइव किया गया सेशन नहीं",$1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M1e():t==="fa"?O1e():t==="ar"?D1e():t==="es"?L1e():t==="hi"?I1e():R1e()}),B1e=()=>"No sessions yet",P1e=()=>"还没有会话",F1e=()=>"هنوز نشستی وجود ندارد",H1e=()=>"لا توجد جلسات بعد",q1e=()=>"Aún no hay sesiones",U1e=()=>"अभी तक कोई सेशन नहीं",G1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P1e():t==="fa"?F1e():t==="ar"?H1e():t==="es"?q1e():t==="hi"?U1e():B1e()}),V1e=()=>"There is nothing to compact yet",K1e=()=>"还没有可压缩的内容",W1e=()=>"هنوز چیزی برای فشرده‌سازی وجود ندارد",Q1e=()=>"لا يوجد شيء لضغطه بعد",X1e=()=>"Aún no hay nada que comprimir",Y1e=()=>"छोटा करने के लिए अभी कुछ नहीं है",Z1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K1e():t==="fa"?W1e():t==="ar"?Q1e():t==="es"?X1e():t==="hi"?Y1e():V1e()}),J1e=()=>"No response to copy yet",eve=()=>"还没有可复制的回复",tve=()=>"هنوز پاسخی برای کپی وجود ندارد",nve=()=>"لا يوجد رد لنسخه بعد",rve=()=>"Aún no hay ninguna respuesta que copiar",sve=()=>"कॉपी करने के लिए अभी कोई जवाब नहीं है",ive=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eve():t==="fa"?tve():t==="ar"?nve():t==="es"?rve():t==="hi"?sve():J1e()}),ave=()=>"Nothing to export yet",ove=()=>"还没有可导出的内容",cve=()=>"هنوز چیزی برای خروجی گرفتن وجود ندارد",lve=()=>"لا يوجد شيء لتصديره بعد",uve=()=>"Aún no hay nada que exportar",_ve=()=>"एक्सपोर्ट करने के लिए अभी कुछ नहीं है",fve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ove():t==="fa"?cve():t==="ar"?lve():t==="es"?uve():t==="hi"?_ve():ave()}),dve=()=>"1 annotation",hve=()=>"1 条批注",pve=()=>"۱ یادداشت",mve=()=>"تعليق واحد",gve=()=>"1 anotación",vve=()=>"1 एनोटेशन",bve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hve():t==="fa"?pve():t==="ar"?mve():t==="es"?gve():t==="hi"?vve():dve()}),yve=()=>"Open sub-agent transcript",xve=()=>"打开子智能体记录",wve=()=>"باز کردن متن گفت‌وگوی عامل فرعی",kve=()=>"فتح سجل محادثة الوكيل الفرعي",Sve=()=>"Abrir la transcripción del subagente",Cve=()=>"सब-एजेंट ट्रांसक्रिप्ट खोलें",Eve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xve():t==="fa"?wve():t==="ar"?kve():t==="es"?Sve():t==="hi"?Cve():yve()}),Nve=()=>"About this demo",zve=()=>"关于此演示",jve=()=>"دربارهٔ این نسخهٔ نمایشی",Tve=()=>"حول هذا العرض التوضيحي",Ave=()=>"Acerca de esta demo",Rve=()=>"इस डेमो के बारे में",rN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zve():t==="fa"?jve():t==="ar"?Tve():t==="es"?Ave():t==="hi"?Rve():Nve()}),Mve=()=>"Accept and auto mode",Ove=()=>"接受并使用自动模式",Dve=()=>"پذیرش و حالت خودکار",Lve=()=>"قبول وتفعيل الوضع التلقائي",Ive=()=>"Aceptar en modo automático",$ve=()=>"स्वीकार करें और ऑटो मोड",Bve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ove():t==="fa"?Dve():t==="ar"?Lve():t==="es"?Ive():t==="hi"?$ve():Mve()}),Pve=()=>"Accept and bypass all",Fve=()=>"接受并跳过所有审批",Hve=()=>"پذیرش و عبور از همهٔ تأییدها",qve=()=>"القبول وتجاوز الكل",Uve=()=>"Aceptar y omitir permisos",Gve=()=>"स्वीकार करें और सब बायपास करें",Vve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fve():t==="fa"?Hve():t==="ar"?qve():t==="es"?Uve():t==="hi"?Gve():Pve()}),Kve=()=>"Active",Wve=()=>"活跃",Qve=()=>"فعال",Xve=()=>"نشط",Yve=()=>"Activas",Zve=()=>"सक्रिय",Jve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wve():t==="fa"?Qve():t==="ar"?Xve():t==="es"?Yve():t==="hi"?Zve():Kve()}),ebe=()=>"All",tbe=()=>"全部",nbe=()=>"همه",rbe=()=>"الكل",sbe=()=>"Todas",ibe=()=>"सभी",abe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tbe():t==="fa"?nbe():t==="ar"?rbe():t==="es"?sbe():t==="hi"?ibe():ebe()}),obe=()=>"Allow",cbe=()=>"允许",lbe=()=>"اجازه دادن",ube=()=>"السماح",_be=()=>"Permitir",fbe=()=>"अनुमति दें",dbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cbe():t==="fa"?lbe():t==="ar"?ube():t==="es"?_be():t==="hi"?fbe():obe()}),hbe=()=>"Approval required",pbe=()=>"需要批准",mbe=()=>"نیازمند تأیید",gbe=()=>"الموافقة مطلوبة",vbe=()=>"Aprobación necesaria",bbe=()=>"स्वीकृति ज़रूरी है",ybe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pbe():t==="fa"?mbe():t==="ar"?gbe():t==="es"?vbe():t==="hi"?bbe():hbe()}),xbe=()=>"Archived",wbe=()=>"已归档",kbe=()=>"بایگانی‌شده",Sbe=()=>"مؤرشف",Cbe=()=>"Archivadas",Ebe=()=>"आर्काइव किया गया",sN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wbe():t==="fa"?kbe():t==="ar"?Sbe():t==="es"?Cbe():t==="hi"?Ebe():xbe()}),Nbe=()=>"Ask about this",zbe=()=>"询问此内容",jbe=()=>"دربارهٔ این بپرسید",Tbe=()=>"اسأل عن هذا",Abe=()=>"Preguntar sobre esto",Rbe=()=>"इसके बारे में पूछें",Mbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zbe():t==="fa"?jbe():t==="ar"?Tbe():t==="es"?Abe():t==="hi"?Rbe():Nbe()}),Obe=()=>"Attach a PDF or image",Dbe=()=>"附加 PDF 或图片",Lbe=()=>"پیوست PDF یا تصویر",Ibe=()=>"إرفاق ملف PDF أو صورة",$be=()=>"Adjuntar un PDF o una imagen",Bbe=()=>"PDF या इमेज अटैच करें",iN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dbe():t==="fa"?Lbe():t==="ar"?Ibe():t==="es"?$be():t==="hi"?Bbe():Obe()}),Pbe=()=>"Bash",Fbe=()=>"Bash",Hbe=()=>"Bash",qbe=()=>"Bash",Ube=()=>"Bash",Gbe=()=>"Bash",SD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fbe():t==="fa"?Hbe():t==="ar"?qbe():t==="es"?Ube():t==="hi"?Gbe():Pbe()}),Vbe=()=>"Browsed the web",Kbe=()=>"已浏览网页",Wbe=()=>"وب مرور شد",Qbe=()=>"تصفّح الويب",Xbe=()=>"Navegó por la web",Ybe=()=>"वेब ब्राउज़ किया",aN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kbe():t==="fa"?Wbe():t==="ar"?Qbe():t==="es"?Xbe():t==="hi"?Ybe():Vbe()}),Zbe=()=>"Built the project",Jbe=()=>"已构建项目",eye=()=>"پروژه ساخته شد",tye=()=>"بنى المشروع",nye=()=>"Compiló el proyecto",rye=()=>"प्रोजेक्ट बिल्ड किया",sye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jbe():t==="fa"?eye():t==="ar"?tye():t==="es"?nye():t==="hi"?rye():Zbe()}),iye=()=>"Cancel",aye=()=>"取消",oye=()=>"لغو",cye=()=>"إلغاء",lye=()=>"Cancelar",uye=()=>"रद्द करें",_ye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aye():t==="fa"?oye():t==="ar"?cye():t==="es"?lye():t==="hi"?uye():iye()}),fye=()=>"Cancelled an experiment run",dye=()=>"已取消实验运行",hye=()=>"اجرای آزمایش لغو شد",pye=()=>"ألغى تشغيل تجربة",mye=()=>"Canceló una ejecución de experimento",gye=()=>"एक प्रयोग रन रद्द किया",vye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dye():t==="fa"?hye():t==="ar"?pye():t==="es"?mye():t==="hi"?gye():fye()}),bye=()=>"Checked code style",yye=()=>"已检查代码风格",xye=()=>"سبک کد بررسی شد",wye=()=>"فحص نمط الشيفرة",kye=()=>"Revisó el estilo del código",Sye=()=>"कोड स्टाइल जाँची",Cye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yye():t==="fa"?xye():t==="ar"?wye():t==="es"?kye():t==="hi"?Sye():bye()}),Eye=()=>"Checked compute options",Nye=()=>"已检查算力选项",zye=()=>"گزینه‌های رایانشی بررسی شد",jye=()=>"فحص خيارات الحوسبة",Tye=()=>"Consultó las opciones de cómputo",Aye=()=>"कंप्यूट विकल्प जाँचे",Rye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nye():t==="fa"?zye():t==="ar"?jye():t==="es"?Tye():t==="hi"?Aye():Eye()}),Mye=()=>"Checked experiment status",Oye=()=>"已检查实验状态",Dye=()=>"وضعیت آزمایش بررسی شد",Lye=()=>"فحص حالة التجربة",Iye=()=>"Consultó el estado del experimento",$ye=()=>"प्रयोग की स्थिति जाँची",oN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Oye():t==="fa"?Dye():t==="ar"?Lye():t==="es"?Iye():t==="hi"?$ye():Mye()}),Bye=()=>"Checked Git status",Pye=()=>"已检查 Git 状态",Fye=()=>"وضعیت Git بررسی شد",Hye=()=>"فحص حالة Git",qye=()=>"Consultó el estado de Git",Uye=()=>"Git स्थिति जाँची",Gye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pye():t==="fa"?Fye():t==="ar"?Hye():t==="es"?qye():t==="hi"?Uye():Bye()}),Vye=()=>"Checked local times",Kye=()=>"已查询当地时间",Wye=()=>"زمان‌های محلی بررسی شد",Qye=()=>"فحص التوقيتات المحلية",Xye=()=>"Consultó horas locales",Yye=()=>"स्थानीय समय जाँचे",Zye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kye():t==="fa"?Wye():t==="ar"?Qye():t==="es"?Xye():t==="hi"?Yye():Vye()}),Jye=()=>"Checked market data",exe=()=>"已查询市场数据",txe=()=>"داده‌های بازار بررسی شد",nxe=()=>"فحص بيانات السوق",rxe=()=>"Consultó datos de mercado",sxe=()=>"बाज़ार डेटा जाँचा",ixe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?exe():t==="fa"?txe():t==="ar"?nxe():t==="es"?rxe():t==="hi"?sxe():Jye()}),axe=()=>"Checked sports data",oxe=()=>"已查询体育数据",cxe=()=>"داده‌های ورزشی بررسی شد",lxe=()=>"فحص البيانات الرياضية",uxe=()=>"Consultó datos deportivos",_xe=()=>"खेल डेटा जाँचा",fxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oxe():t==="fa"?cxe():t==="ar"?lxe():t==="es"?uxe():t==="hi"?_xe():axe()}),dxe=()=>"Checked the weather",hxe=()=>"已查询天气",pxe=()=>"آب‌وهوا بررسی شد",mxe=()=>"فحص حالة الطقس",gxe=()=>"Consultó el tiempo",vxe=()=>"मौसम जाँचा",bxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hxe():t==="fa"?pxe():t==="ar"?mxe():t==="es"?gxe():t==="hi"?vxe():dxe()}),yxe=()=>"Checked types",xxe=()=>"已检查类型",wxe=()=>"نوع‌ها بررسی شد",kxe=()=>"فحص الأنواع",Sxe=()=>"Comprobó los tipos",Cxe=()=>"टाइप जाँचे",Exe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xxe():t==="fa"?wxe():t==="ar"?kxe():t==="es"?Sxe():t==="hi"?Cxe():yxe()}),Nxe=()=>"Clear annotations",zxe=()=>"清除批注",jxe=()=>"پاک کردن یادداشت‌ها",Txe=()=>"مسح التعليقات",Axe=()=>"Borrar anotaciones",Rxe=()=>"एनोटेशन साफ़ करें",cN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zxe():t==="fa"?jxe():t==="ar"?Txe():t==="es"?Axe():t==="hi"?Rxe():Nxe()}),Mxe=e=>`Clear the goal: ${e==null?void 0:e.goal}`,Oxe=e=>`清除目标:${e==null?void 0:e.goal}`,Dxe=e=>`پاک‌کردن هدف: ${e==null?void 0:e.goal}`,Lxe=e=>`مسح الهدف: ${e==null?void 0:e.goal}`,Ixe=e=>`Borrar el objetivo: ${e==null?void 0:e.goal}`,$xe=e=>`लक्ष्य हटाएँ: ${e==null?void 0:e.goal}`,lN=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Oxe(e):t==="fa"?Dxe(e):t==="ar"?Lxe(e):t==="es"?Ixe(e):t==="hi"?$xe(e):Mxe(e)}),Bxe=()=>"Customize",Pxe=()=>"自定义",Fxe=()=>"سفارشی‌سازی",Hxe=()=>"تخصيص",qxe=()=>"Personalizar",Uxe=()=>"कस्टमाइज़ करें",Gxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pxe():t==="fa"?Fxe():t==="ar"?Hxe():t==="es"?qxe():t==="hi"?Uxe():Bxe()}),Vxe=()=>"Data sources",Kxe=()=>"数据源",Wxe=()=>"منابع داده",Qxe=()=>"مصادر البيانات",Xxe=()=>"Fuentes de datos",Yxe=()=>"डेटा स्रोत",Y2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kxe():t==="fa"?Wxe():t==="ar"?Qxe():t==="es"?Xxe():t==="hi"?Yxe():Vxe()}),Zxe=()=>"Delegated a task to a new agent",Jxe=()=>"已将任务委派给新智能体",e2e=()=>"وظیفه به عامل جدید واگذار شد",t2e=()=>"فوّض مهمة إلى وكيل جديد",n2e=()=>"Delegó una tarea a un nuevo agente",r2e=()=>"एक नए एजेंट को टास्क सौंपा",s2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jxe():t==="fa"?e2e():t==="ar"?t2e():t==="es"?n2e():t==="hi"?r2e():Zxe()}),i2e=()=>"Delete",a2e=()=>"删除",o2e=()=>"حذف",c2e=()=>"حذف",l2e=()=>"Eliminar",u2e=()=>"हटाएं",CD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a2e():t==="fa"?o2e():t==="ar"?c2e():t==="es"?l2e():t==="hi"?u2e():i2e()}),_2e=()=>"This prompt runs a small 200-step training probe on your machine. Hit enter to get started.",f2e=()=>"这条提示会在你的机器上运行一个小型 200 步训练探测。按 Enter 开始。",d2e=()=>"این پیام یک کاوش آموزشی کوچک ۲۰۰ مرحله‌ای روی دستگاه شما اجرا می‌کند. برای شروع Enter را بزنید.",h2e=()=>"يشغّل هذا الطلب اختبار تدريب صغيرًا من 200 خطوة على جهازك. اضغط Enter للبدء.",p2e=()=>"Este prompt ejecuta en tu equipo una pequeña prueba de entrenamiento de 200 pasos. Pulsa Intro para empezar.",m2e=()=>"यह प्रॉम्प्ट आपकी मशीन पर एक छोटा 200-स्टेप ट्रेनिंग परीक्षण चलाता है। शुरू करने के लिए एंटर दबाएं।",g2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f2e():t==="fa"?d2e():t==="ar"?h2e():t==="es"?p2e():t==="hi"?m2e():_2e()}),v2e=()=>"to monitor it.",b2e=()=>"以查看进度。",y2e=()=>"بزنید.",x2e=()=>"لمتابعتها.",w2e=()=>"para seguirlo.",k2e=()=>"इस पर नज़र रखने के लिए।",uN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b2e():t==="fa"?y2e():t==="ar"?x2e():t==="es"?w2e():t==="hi"?k2e():v2e()}),S2e=()=>"The experiment is now running. Tap",C2e=()=>"实验正在运行。点按",E2e=()=>"آزمایش اکنون در حال اجراست. برای پیگیری روی",N2e=()=>"التجربة قيد التشغيل الآن. اضغط على",z2e=()=>"El experimento ya se está ejecutando. Pulsa",j2e=()=>"प्रयोग अब चल रहा है। टैप करें",_N=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C2e():t==="fa"?E2e():t==="ar"?N2e():t==="es"?z2e():t==="hi"?j2e():S2e()}),T2e=()=>"Deny",A2e=()=>"拒绝",R2e=()=>"رد کردن",M2e=()=>"رفض",O2e=()=>"Denegar",D2e=()=>"अस्वीकार करें",L2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?A2e():t==="fa"?R2e():t==="ar"?M2e():t==="es"?O2e():t==="hi"?D2e():T2e()}),I2e=()=>"Dismiss",$2e=()=>"关闭",B2e=()=>"بستن",P2e=()=>"إغلاق",F2e=()=>"Cerrar",H2e=()=>"खारिज करें",Xg=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$2e():t==="fa"?B2e():t==="ar"?P2e():t==="es"?F2e():t==="hi"?H2e():I2e()}),q2e=()=>"Edit and re-send",U2e=()=>"编辑并重新发送",G2e=()=>"ویرایش و ارسال دوباره",V2e=()=>"تعديل وإعادة الإرسال",K2e=()=>"Editar y reenviar",W2e=()=>"संपादित करें और फिर भेजें",fN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?U2e():t==="fa"?G2e():t==="ar"?V2e():t==="es"?K2e():t==="hi"?W2e():q2e()}),Q2e=()=>"Edit message",X2e=()=>"编辑消息",Y2e=()=>"ویرایش پیام",Z2e=()=>"تعديل الرسالة",J2e=()=>"Editar mensaje",ewe=()=>"संदेश संपादित करें",twe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?X2e():t==="fa"?Y2e():t==="ar"?Z2e():t==="es"?J2e():t==="hi"?ewe():Q2e()}),nwe=()=>"Edited a file",rwe=()=>"已编辑文件",swe=()=>"فایل ویرایش شد",iwe=()=>"عدّل ملفًا",awe=()=>"Editó un archivo",owe=()=>"एक फ़ाइल संपादित की",dN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rwe():t==="fa"?swe():t==="ar"?iwe():t==="es"?awe():t==="hi"?owe():nwe()}),cwe=()=>"Exit Bash mode",lwe=()=>"退出 Bash 模式",uwe=()=>"خروج از حالت Bash",_we=()=>"الخروج من وضع Bash",fwe=()=>"Salir del modo Bash",dwe=()=>"Bash मोड से बाहर निकलें",hN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lwe():t==="fa"?uwe():t==="ar"?_we():t==="es"?fwe():t==="hi"?dwe():cwe()}),hwe=()=>"Exit Plan mode",pwe=()=>"退出计划模式",mwe=()=>"خروج از حالت طرح",gwe=()=>"الخروج من وضع التخطيط",vwe=()=>"Salir del modo Plan",bwe=()=>"प्लान मोड से बाहर निकलें",pN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pwe():t==="fa"?mwe():t==="ar"?gwe():t==="es"?vwe():t==="hi"?bwe():hwe()}),ywe=()=>"Failed:",xwe=()=>"失败:",wwe=()=>"ناموفق:",kwe=()=>"فشل:",Swe=()=>"Error:",Cwe=()=>"विफल:",Uk=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xwe():t==="fa"?wwe():t==="ar"?kwe():t==="es"?Swe():t==="hi"?Cwe():ywe()}),Ewe=()=>"Filter sessions",Nwe=()=>"筛选会话",zwe=()=>"فیلتر نشست‌ها",jwe=()=>"تصفية الجلسات",Twe=()=>"Filtrar sesiones",Awe=()=>"सेशन फ़िल्टर करें",mN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nwe():t==="fa"?zwe():t==="ar"?jwe():t==="es"?Twe():t==="hi"?Awe():Ewe()}),Rwe=()=>"Goal",Mwe=()=>"目标",Owe=()=>"هدف",Dwe=()=>"الهدف",Lwe=()=>"Objetivo",Iwe=()=>"लक्ष्य",$we=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mwe():t==="fa"?Owe():t==="ar"?Dwe():t==="es"?Lwe():t==="hi"?Iwe():Rwe()}),Bwe=()=>"is unavailable.",Pwe=()=>"不可用。",Fwe=()=>"در دسترس نیست.",Hwe=()=>"غير متاح.",qwe=()=>"no está disponible.",Uwe=()=>"उपलब्ध नहीं है।",Gwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pwe():t==="fa"?Fwe():t==="ar"?Hwe():t==="es"?qwe():t==="hi"?Uwe():Bwe()}),Vwe=()=>"Later queued messages will wait until this is retried or removed.",Kwe=()=>"后续排队的消息会等待此消息重试或移除。",Wwe=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",Qwe=()=>"ستنتظر الرسائل التالية في قائمة الانتظار حتى تُعاد المحاولة أو تُزال هذه الرسالة.",Xwe=()=>"Los mensajes que están después en la cola esperarán hasta que este se reintente o se quite.",Ywe=()=>"बाद में कतार में लगे संदेश तब तक रुके रहेंगे जब तक इसे फिर से कोशिश न किया जाए या हटाया न जाए।",Zwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kwe():t==="fa"?Wwe():t==="ar"?Qwe():t==="es"?Xwe():t==="hi"?Ywe():Vwe()}),Jwe=()=>"Listed files",e4e=()=>"已列出文件",t4e=()=>"فایل‌ها فهرست شد",n4e=()=>"سرد الملفات",r4e=()=>"Listó archivos",s4e=()=>"फ़ाइलों की सूची बनाई",gN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?e4e():t==="fa"?t4e():t==="ar"?n4e():t==="es"?r4e():t==="hi"?s4e():Jwe()}),i4e=()=>"Listed project runs",a4e=()=>"已列出项目运行",o4e=()=>"اجراهای پروژه فهرست شد",c4e=()=>"سرد عمليات تشغيل المشروع",l4e=()=>"Listó las ejecuciones del proyecto",u4e=()=>"प्रोजेक्ट रन की सूची बनाई",_4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a4e():t==="fa"?o4e():t==="ar"?c4e():t==="es"?l4e():t==="hi"?u4e():i4e()}),f4e=()=>"Listed projects",d4e=()=>"已列出项目",h4e=()=>"پروژه‌ها فهرست شد",p4e=()=>"سرد المشاريع",m4e=()=>"Listó proyectos",g4e=()=>"प्रोजेक्ट की सूची बनाई",v4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?d4e():t==="fa"?h4e():t==="ar"?p4e():t==="es"?m4e():t==="hi"?g4e():f4e()}),b4e=()=>"Loading conversation…",y4e=()=>"正在加载对话…",x4e=()=>"در حال بارگیری گفتگو…",w4e=()=>"جارٍ تحميل المحادثة…",k4e=()=>"Cargando conversación…",S4e=()=>"बातचीत लोड हो रही है…",C4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y4e():t==="fa"?x4e():t==="ar"?w4e():t==="es"?k4e():t==="hi"?S4e():b4e()}),E4e=()=>"New Chat",N4e=()=>"新对话",z4e=()=>"گفتگوی جدید",j4e=()=>"محادثة جديدة",T4e=()=>"Nuevo chat",A4e=()=>"नई चैट",R4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N4e():t==="fa"?z4e():t==="ar"?j4e():t==="es"?T4e():t==="hi"?A4e():E4e()}),M4e=()=>"Next version",O4e=()=>"下一版本",D4e=()=>"نسخهٔ بعدی",L4e=()=>"النسخة التالية",I4e=()=>"Siguiente versión",$4e=()=>"अगला वर्शन",vN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?O4e():t==="fa"?D4e():t==="ar"?L4e():t==="es"?I4e():t==="hi"?$4e():M4e()}),B4e=()=>"Open the session this agent spawned",P4e=()=>"打开此智能体创建的会话",F4e=()=>"باز کردن نشست ساخته‌شده توسط این عامل",H4e=()=>"فتح الجلسة التي أنشأها هذا الوكيل",q4e=()=>"Abrir la sesión que creó este agente",U4e=()=>"इस एजेंट द्वारा शुरू किया गया सेशन खोलें",G4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P4e():t==="fa"?F4e():t==="ar"?H4e():t==="es"?q4e():t==="hi"?U4e():B4e()}),V4e=()=>"Opened web pages",K4e=()=>"已打开网页",W4e=()=>"صفحه‌های وب باز شد",Q4e=()=>"فتح صفحات ويب",X4e=()=>"Abrió páginas web",Y4e=()=>"वेब पेज खोले",Z4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K4e():t==="fa"?W4e():t==="ar"?Q4e():t==="es"?X4e():t==="hi"?Y4e():V4e()}),J4e=()=>"Plan",e3e=()=>"计划",t3e=()=>"طرح",n3e=()=>"خطة",r3e=()=>"Plan",s3e=()=>"प्लान",i3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?e3e():t==="fa"?t3e():t==="ar"?n3e():t==="es"?r3e():t==="hi"?s3e():J4e()}),a3e=()=>"Plan approved",o3e=()=>"计划已批准",c3e=()=>"طرح تأیید شد",l3e=()=>"تمت الموافقة على الخطة",u3e=()=>"Plan aprobado",_3e=()=>"प्लान स्वीकृत",f3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?o3e():t==="fa"?c3e():t==="ar"?l3e():t==="es"?u3e():t==="hi"?_3e():a3e()}),d3e=()=>"Plan rejected",h3e=()=>"计划已拒绝",p3e=()=>"طرح رد شد",m3e=()=>"رُفضت الخطة",g3e=()=>"Plan rechazado",v3e=()=>"प्लान अस्वीकृत",b3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?h3e():t==="fa"?p3e():t==="ar"?m3e():t==="es"?g3e():t==="hi"?v3e():d3e()}),y3e=()=>"Plan resolved",x3e=()=>"计划已处理",w3e=()=>"طرح تعیین تکلیف شد",k3e=()=>"تمت معالجة الخطة",S3e=()=>"Plan resuelto",C3e=()=>"प्लान सुलझाया गया",E3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x3e():t==="fa"?w3e():t==="ar"?k3e():t==="es"?S3e():t==="hi"?C3e():y3e()}),N3e=()=>"Plan revision requested",z3e=()=>"已请求修改计划",j3e=()=>"درخواست بازنگری طرح ثبت شد",T3e=()=>"طُلب تعديل الخطة",A3e=()=>"Cambios en el plan solicitados",R3e=()=>"प्लान में बदलाव का अनुरोध",M3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z3e():t==="fa"?j3e():t==="ar"?T3e():t==="es"?A3e():t==="hi"?R3e():N3e()}),O3e=()=>"Previous version",D3e=()=>"上一版本",L3e=()=>"نسخهٔ قبلی",I3e=()=>"النسخة السابقة",$3e=()=>"Versión anterior",B3e=()=>"पिछला वर्शन",bN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D3e():t==="fa"?L3e():t==="ar"?I3e():t==="es"?$3e():t==="hi"?B3e():O3e()}),P3e=()=>"Ran a command",F3e=()=>"已运行命令",H3e=()=>"فرمان اجرا شد",q3e=()=>"نفّذ أمرًا",U3e=()=>"Ejecutó un comando",G3e=()=>"एक कमांड चलाई",V3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?F3e():t==="fa"?H3e():t==="ar"?q3e():t==="es"?U3e():t==="hi"?G3e():P3e()}),K3e=()=>"Ran tests",W3e=()=>"已运行测试",Q3e=()=>"آزمون‌ها اجرا شد",X3e=()=>"شغّل الاختبارات",Y3e=()=>"Ejecutó tests",Z3e=()=>"टेस्ट चलाए",J3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W3e():t==="fa"?Q3e():t==="ar"?X3e():t==="es"?Y3e():t==="hi"?Z3e():K3e()}),e5e=()=>"Read a file",t5e=()=>"已读取文件",n5e=()=>"فایل خوانده شد",r5e=()=>"قرأ ملفًا",s5e=()=>"Leyó un archivo",i5e=()=>"एक फ़ाइल पढ़ी",a5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?t5e():t==="fa"?n5e():t==="ar"?r5e():t==="es"?s5e():t==="hi"?i5e():e5e()}),o5e=()=>"Read Git history",c5e=()=>"已读取 Git 历史",l5e=()=>"تاریخچهٔ Git خوانده شد",u5e=()=>"قرأ سجل Git",_5e=()=>"Leyó el historial de Git",f5e=()=>"Git इतिहास पढ़ा",d5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?c5e():t==="fa"?l5e():t==="ar"?u5e():t==="es"?_5e():t==="hi"?f5e():o5e()}),h5e=()=>"Read project details",p5e=()=>"已读取项目详情",m5e=()=>"جزئیات پروژه خوانده شد",g5e=()=>"قرأ تفاصيل المشروع",v5e=()=>"Leyó los detalles del proyecto",b5e=()=>"प्रोजेक्ट विवरण पढ़ा",y5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?p5e():t==="fa"?m5e():t==="ar"?g5e():t==="es"?v5e():t==="hi"?b5e():h5e()}),x5e=()=>"Reject",w5e=()=>"拒绝",k5e=()=>"رد کردن",S5e=()=>"رفض",C5e=()=>"Rechazar",E5e=()=>"अस्वीकार करें",N5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?w5e():t==="fa"?k5e():t==="ar"?S5e():t==="es"?C5e():t==="hi"?E5e():x5e()}),z5e=()=>"Remove",j5e=()=>"移除",T5e=()=>"حذف",A5e=()=>"إزالة",R5e=()=>"Quitar",M5e=()=>"हटाएं",O5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?j5e():t==="fa"?T5e():t==="ar"?A5e():t==="es"?R5e():t==="hi"?M5e():z5e()}),D5e=()=>"Remove annotation",L5e=()=>"移除批注",I5e=()=>"حذف یادداشت",$5e=()=>"إزالة التعليق",B5e=()=>"Quitar anotación",P5e=()=>"एनोटेशन हटाएं",F5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?L5e():t==="fa"?I5e():t==="ar"?$5e():t==="es"?B5e():t==="hi"?P5e():D5e()}),H5e=()=>"Remove file",q5e=()=>"移除文件",U5e=()=>"حذف فایل",G5e=()=>"إزالة الملف",V5e=()=>"Quitar archivo",K5e=()=>"फ़ाइल हटाएं",yN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?q5e():t==="fa"?U5e():t==="ar"?G5e():t==="es"?V5e():t==="hi"?K5e():H5e()}),W5e=()=>"Remove image",Q5e=()=>"移除图片",X5e=()=>"حذف تصویر",Y5e=()=>"إزالة الصورة",Z5e=()=>"Quitar imagen",J5e=()=>"इमेज हटाएं",xN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Q5e():t==="fa"?X5e():t==="ar"?Y5e():t==="es"?Z5e():t==="hi"?J5e():W5e()}),eke=()=>"Remove queued message",tke=()=>"移除排队消息",nke=()=>"حذف پیام صف",rke=()=>"إزالة الرسالة من قائمة الانتظار",ske=()=>"Quitar mensaje en cola",ike=()=>"कतार में लगा संदेश हटाएं",wN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tke():t==="fa"?nke():t==="ar"?rke():t==="es"?ske():t==="hi"?ike():eke()}),ake=()=>"Rename",oke=()=>"重命名",cke=()=>"تغییر نام",lke=()=>"إعادة تسمية",uke=()=>"Renombrar",_ke=()=>"नाम बदलें",ED=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oke():t==="fa"?cke():t==="ar"?lke():t==="es"?uke():t==="hi"?_ke():ake()}),fke=()=>"Reviewed code changes",dke=()=>"已审查代码更改",hke=()=>"تغییرات کد بازبینی شد",pke=()=>"راجع تغييرات الشيفرة",mke=()=>"Revisó cambios en el código",gke=()=>"कोड में बदलावों की समीक्षा की",vke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dke():t==="fa"?hke():t==="ar"?pke():t==="es"?mke():t==="hi"?gke():fke()}),bke=()=>"Run",yke=()=>"运行",xke=()=>"اجرا",wke=()=>"تشغيل",kke=()=>"Ejecutar",Ske=()=>"रन",kN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yke():t==="fa"?xke():t==="ar"?wke():t==="es"?kke():t==="hi"?Ske():bke()}),Cke=()=>"Selected chat text",Eke=()=>"已选聊天文本",Nke=()=>"متن انتخاب‌شدهٔ گفتگو",zke=()=>"النص المحدد من المحادثة",jke=()=>"Texto seleccionado del chat",Tke=()=>"चयनित चैट टेक्स्ट",Ake=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eke():t==="fa"?Nke():t==="ar"?zke():t==="es"?jke():t==="hi"?Tke():Cke()}),Rke=()=>"Selected text:",Mke=()=>"已选文本:",Oke=()=>"متن انتخاب‌شده:",Dke=()=>"النص المحدد:",Lke=()=>"Texto seleccionado:",Ike=()=>"चयनित टेक्स्ट:",$ke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mke():t==="fa"?Oke():t==="ar"?Dke():t==="es"?Lke():t==="hi"?Ike():Rke()}),Bke=()=>"Send",Pke=()=>"发送",Fke=()=>"ارسال",Hke=()=>"إرسال رسالة",qke=()=>"Enviar",Uke=()=>"भेजें",o3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pke():t==="fa"?Fke():t==="ar"?Hke():t==="es"?qke():t==="hi"?Uke():Bke()}),Gke=()=>"Session options",Vke=()=>"会话选项",Kke=()=>"گزینه‌های نشست",Wke=()=>"خيارات الجلسة",Qke=()=>"Opciones de la sesión",Xke=()=>"सेशन विकल्प",SN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vke():t==="fa"?Kke():t==="ar"?Wke():t==="es"?Qke():t==="hi"?Xke():Gke()}),Yke=()=>"Session title",Zke=()=>"会话标题",Jke=()=>"عنوان نشست",eSe=()=>"عنوان الجلسة",tSe=()=>"Título de la sesión",nSe=()=>"सेशन शीर्षक",rSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zke():t==="fa"?Jke():t==="ar"?eSe():t==="es"?tSe():t==="hi"?nSe():Yke()}),sSe=()=>"Show sidebar",iSe=()=>"显示侧边栏",aSe=()=>"نمایش نوار کناری",oSe=()=>"إظهار الشريط الجانبي",cSe=()=>"Mostrar barra lateral",lSe=()=>"साइडबार दिखाएं",CN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iSe():t==="fa"?aSe():t==="ar"?oSe():t==="es"?cSe():t==="hi"?lSe():sSe()}),uSe=()=>"Started an experiment run",_Se=()=>"已启动实验运行",fSe=()=>"اجرای آزمایش آغاز شد",dSe=()=>"بدأ تشغيل تجربة",hSe=()=>"Inició una ejecución de experimento",pSe=()=>"एक प्रयोग रन शुरू किया",mSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Se():t==="fa"?fSe():t==="ar"?dSe():t==="es"?hSe():t==="hi"?pSe():uSe()}),gSe=()=>"I have a rough idea I want to explore. Ask me questions until we have a concrete, testable research question and a plan for the first experiment.",vSe=()=>"我有一个想探索的粗略想法。请不断向我提问,直到我们得到一个具体、可检验的研究问题和第一个实验的计划。",bSe=()=>"یک ایدهٔ خام دارم که می‌خواهم بررسی کنم. از من سؤال بپرس تا به یک پرسش پژوهشی مشخص و قابل آزمون و یک برنامه برای اولین آزمایش برسیم.",ySe=()=>"لديّ فكرة أولية أريد استكشافها. اطرح عليّ أسئلة حتى نصل إلى سؤال بحثي محدد وقابل للاختبار وخطة للتجربة الأولى.",xSe=()=>"Tengo una idea inicial que quiero explorar. Hazme preguntas hasta que tengamos una pregunta de investigación concreta y comprobable y un plan para el primer experimento.",wSe=()=>"मेरे पास एक अस्पष्ट विचार है जिसे मैं खोजना चाहता/चाहती हूँ। तब तक मुझसे सवाल पूछें जब तक हमारे पास एक ठोस, जाँचने-योग्य शोध प्रश्न और पहले प्रयोग की योजना न बन जाए।",kSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vSe():t==="fa"?bSe():t==="ar"?ySe():t==="es"?xSe():t==="hi"?wSe():gSe()}),SSe=()=>"Shape a research question",CSe=()=>"明确研究问题",ESe=()=>"شکل دادن به پرسش پژوهشی",NSe=()=>"صياغة سؤال بحثي",zSe=()=>"Definir una pregunta de investigación",jSe=()=>"एक शोध प्रश्न तैयार करें",TSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CSe():t==="fa"?ESe():t==="ar"?NSe():t==="es"?zSe():t==="hi"?jSe():SSe()}),ASe=()=>"Ask me for a topic, then search the literature on it, summarize the strongest baselines and open problems, and suggest where a small experiment could contribute.",RSe=()=>"先问我要研究的主题,然后检索相关文献,总结最强的基线方法和尚未解决的问题,并建议一个小实验可以在哪里做出贡献。",MSe=()=>"اول موضوع را از من بپرس، سپس ادبیات آن را جست‌وجو کن، قوی‌ترین خط‌های مبنا و مسائل باز را خلاصه کن و پیشنهاد بده یک آزمایش کوچک کجا می‌تواند مفید باشد.",OSe=()=>"اسألني عن الموضوع أولًا، ثم ابحث في الأدبيات حوله، ولخّص أقوى خطوط الأساس والمسائل المفتوحة، واقترح أين يمكن لتجربة صغيرة أن تسهم.",DSe=()=>"Pregúntame por un tema, busca publicaciones sobre él, resume los métodos de referencia más sólidos y los problemas abiertos, y sugiere dónde podría aportar un pequeño experimento.",LSe=()=>"पहले मुझसे एक विषय पूछें, फिर उस पर साहित्य खोजें, सबसे मज़बूत बेसलाइन और खुली समस्याओं का सार दें, और सुझाएं कि एक छोटा प्रयोग कहाँ योगदान दे सकता है।",ISe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RSe():t==="fa"?MSe():t==="ar"?OSe():t==="es"?DSe():t==="hi"?LSe():ASe()}),$Se=()=>"Survey related work",BSe=()=>"调研相关工作",PSe=()=>"مرور کارهای مرتبط",FSe=()=>"استعراض الأعمال ذات الصلة",HSe=()=>"Revisar trabajos relacionados",qSe=()=>"संबंधित कार्य का सर्वेक्षण करें",USe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BSe():t==="fa"?PSe():t==="ar"?FSe():t==="es"?HSe():t==="hi"?qSe():$Se()}),GSe=()=>"Set up a minimal training script with a config, dependencies, and a run command that trains a small model end to end in a few minutes on one GPU.",VSe=()=>"搭建一个最小的训练脚本,包含配置、依赖和运行命令,能在单张 GPU 上几分钟内端到端训练一个小模型。",KSe=()=>"یک اسکریپت آموزش حداقلی با پیکربندی، وابستگی‌ها و دستور اجرا آماده کن که یک مدل کوچک را در چند دقیقه روی یک GPU به‌طور کامل آموزش دهد.",WSe=()=>"أنشئ أصغر سكربت تدريب ممكن مع إعدادات واعتماديات وأمر تشغيل يدرّب نموذجًا صغيرًا من البداية إلى النهاية في دقائق على وحدة GPU واحدة.",QSe=()=>"Prepara un script de entrenamiento mínimo con configuración, dependencias y un comando de ejecución que entrene un modelo pequeño de principio a fin en unos minutos con una GPU.",XSe=()=>"एक न्यूनतम ट्रेनिंग स्क्रिप्ट सेट अप करें, जिसमें एक कॉन्फ़िग, डिपेंडेंसी और एक रन कमांड हो, जो एक GPU पर कुछ ही मिनटों में एक छोटे मॉडल को पूरी तरह ट्रेन कर दे।",YSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VSe():t==="fa"?KSe():t==="ar"?WSe():t==="es"?QSe():t==="hi"?XSe():GSe()}),ZSe=()=>"Scaffold a baseline",JSe=()=>"搭建基线",e6e=()=>"ساخت خط مبنا",t6e=()=>"بناء خط أساس",n6e=()=>"Crear un modelo de referencia",r6e=()=>"एक बेसलाइन तैयार करें",s6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JSe():t==="fa"?e6e():t==="ar"?t6e():t==="es"?n6e():t==="hi"?r6e():ZSe()}),i6e=()=>"Pick one cheap, well-defined hypothesis from our plan, implement it as a variant of the baseline, and launch a first run to compare the two.",a6e=()=>"从我们的计划中选一个成本低、定义明确的假设,把它实现为基线的一个变体,并启动第一次运行来比较两者。",o6e=()=>"یک فرضیهٔ کم‌هزینه و مشخص از برنامه‌مان انتخاب کن، آن را به‌صورت یک نسخهٔ تغییریافته از خط مبنا پیاده کن و اولین اجرا را برای مقایسهٔ این دو شروع کن.",c6e=()=>"اختر فرضية واحدة منخفضة التكلفة ومحددة جيدًا من خطتنا، ونفّذها كنسخة معدّلة من خط الأساس، وابدأ أول تشغيل لمقارنة الاثنين.",l6e=()=>"Elige una hipótesis de nuestro plan que sea económica de probar y esté bien definida, impleméntala como una variante del modelo de referencia e inicia una primera ejecución para comparar ambas versiones.",u6e=()=>"हमारी योजना से एक सस्ती, स्पष्ट रूप से परिभाषित परिकल्पना चुनें, इसे बेसलाइन के एक वेरिएंट के रूप में लागू करें, और दोनों की तुलना के लिए पहला रन शुरू करें।",_6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a6e():t==="fa"?o6e():t==="ar"?c6e():t==="es"?l6e():t==="hi"?u6e():i6e()}),f6e=()=>"Run a first experiment",d6e=()=>"运行第一个实验",h6e=()=>"اجرای اولین آزمایش",p6e=()=>"تشغيل التجربة الأولى",m6e=()=>"Ejecutar un primer experimento",g6e=()=>"पहला प्रयोग चलाएं",v6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?d6e():t==="fa"?h6e():t==="ar"?p6e():t==="es"?m6e():t==="hi"?g6e():f6e()}),b6e=()=>"Reading the project to suggest where to start…",y6e=()=>"正在阅读项目以建议从哪里开始…",x6e=()=>"در حال خواندن پروژه برای پیشنهاد نقطهٔ شروع…",w6e=()=>"جارٍ قراءة المشروع لاقتراح نقطة البدء…",k6e=()=>"Leyendo el proyecto para sugerir por dónde empezar…",S6e=()=>"कहाँ से शुरू करें यह सुझाने के लिए प्रोजेक्ट पढ़ा जा रहा है…",C6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y6e():t==="fa"?x6e():t==="ar"?w6e():t==="es"?k6e():t==="hi"?S6e():b6e()}),E6e=()=>"Starter prompts",N6e=()=>"入门提示",z6e=()=>"پیشنهادهای شروع",j6e=()=>"اقتراحات للبدء",T6e=()=>"Prompts para empezar",A6e=()=>"शुरुआती प्रॉम्प्ट",R6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N6e():t==="fa"?z6e():t==="ar"?j6e():t==="es"?T6e():t==="hi"?A6e():E6e()}),M6e=()=>"Stop",O6e=()=>"停止",D6e=()=>"توقف",L6e=()=>"إيقاف",I6e=()=>"Detener",$6e=()=>"रोकें",EN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?O6e():t==="fa"?D6e():t==="ar"?L6e():t==="es"?I6e():t==="hi"?$6e():M6e()}),B6e=()=>"Submit",P6e=()=>"提交",F6e=()=>"ارسال",H6e=()=>"إرسال",q6e=()=>"Enviar",U6e=()=>"सबमिट करें",G6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P6e():t==="fa"?F6e():t==="ar"?H6e():t==="es"?q6e():t==="hi"?U6e():B6e()}),V6e=()=>"Tool failed",K6e=()=>"工具失败",W6e=()=>"ابزار ناموفق بود",Q6e=()=>"فشلت الأداة",X6e=()=>"Error en la herramienta",Y6e=()=>"टूल विफल",Z6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K6e():t==="fa"?W6e():t==="ar"?Q6e():t==="es"?X6e():t==="hi"?Y6e():V6e()}),J6e=()=>"Used tools",eCe=()=>"已使用工具",tCe=()=>"ابزارها استفاده شد",nCe=()=>"استخدم الأدوات",rCe=()=>"Usó herramientas",sCe=()=>"टूल इस्तेमाल किए",ND=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eCe():t==="fa"?tCe():t==="ar"?nCe():t==="es"?rCe():t==="hi"?sCe():J6e()}),iCe=()=>"View full plan",aCe=()=>"查看完整计划",oCe=()=>"مشاهدهٔ طرح کامل",cCe=()=>"عرض الخطة كاملة",lCe=()=>"Ver plan completo",uCe=()=>"पूरा प्लान देखें",_Ce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aCe():t==="fa"?oCe():t==="ar"?cCe():t==="es"?lCe():t==="hi"?uCe():iCe()}),fCe=()=>"Waited for an experiment run",dCe=()=>"已等待实验运行",hCe=()=>"برای اجرای آزمایش صبر شد",pCe=()=>"انتظر تشغيل تجربة",mCe=()=>"Esperó a una ejecución de experimento",gCe=()=>"एक प्रयोग रन का इंतज़ार किया",vCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dCe():t==="fa"?hCe():t==="ar"?pCe():t==="es"?mCe():t==="hi"?gCe():fCe()}),bCe=()=>"Waiting for your input…",yCe=()=>"正在等待你的输入…",xCe=()=>"منتظر ورودی شما…",wCe=()=>"في انتظار إدخالك…",kCe=()=>"Esperando tu respuesta…",SCe=()=>"आपके इनपुट का इंतज़ार है…",CCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yCe():t==="fa"?xCe():t==="ar"?wCe():t==="es"?kCe():t==="hi"?SCe():bCe()}),ECe=()=>"What should we research?",NCe=()=>"我们应该研究什么?",zCe=()=>"چه چیزی را پژوهش کنیم؟",jCe=()=>"ما الذي نبحثه؟",TCe=()=>"¿Qué investigamos?",ACe=()=>"हमें क्या शोध करना चाहिए?",RCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NCe():t==="fa"?zCe():t==="ar"?jCe():t==="es"?TCe():t==="hi"?ACe():ECe()}),MCe=()=>"You, mid-task",OCe=()=>"你(任务进行中)",DCe=()=>"شما، هنگام انجام وظیفه",LCe=()=>"أنت، أثناء المهمة",ICe=()=>"Tú, durante la tarea",$Ce=()=>"आप, टास्क के बीच में",BCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OCe():t==="fa"?DCe():t==="ar"?LCe():t==="es"?ICe():t==="hi"?$Ce():MCe()}),PCe=()=>"Pasted image",FCe=()=>"粘贴的图片",HCe=()=>"تصویر جای‌گذاری‌شده",qCe=()=>"صورة ملصقة",UCe=()=>"Imagen pegada",GCe=()=>"पेस्ट की गई इमेज",zD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FCe():t==="fa"?HCe():t==="ar"?qCe():t==="es"?UCe():t==="hi"?GCe():PCe()}),VCe=()=>"Plan",KCe=()=>"计划",WCe=()=>"طرح",QCe=()=>"خطة",XCe=()=>"Plan",YCe=()=>"प्लान",jD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KCe():t==="fa"?WCe():t==="ar"?QCe():t==="es"?XCe():t==="hi"?YCe():VCe()}),ZCe=()=>"Plan mode — ready to proceed?",JCe=()=>"计划模式 — 准备好继续了吗?",e7e=()=>"حالت طرح — آماده‌اید ادامه دهید؟",t7e=()=>"وضع التخطيط — جاهز للمتابعة؟",n7e=()=>"Modo Plan — ¿listo para continuar?",r7e=()=>"प्लान मोड — आगे बढ़ने के लिए तैयार?",s7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JCe():t==="fa"?e7e():t==="ar"?t7e():t==="es"?n7e():t==="hi"?r7e():ZCe()}),i7e=()=>"Proposed plan",a7e=()=>"提议的计划",o7e=()=>"طرح پیشنهادی",c7e=()=>"خطة مقترحة",l7e=()=>"Plan propuesto",u7e=()=>"प्रस्तावित प्लान",NN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a7e():t==="fa"?o7e():t==="ar"?c7e():t==="es"?l7e():t==="hi"?u7e():i7e()}),_7e=()=>"Question",f7e=()=>"问题",d7e=()=>"پرسش",h7e=()=>"سؤال",p7e=()=>"Pregunta",m7e=()=>"प्रश्न",g7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f7e():t==="fa"?d7e():t==="ar"?h7e():t==="es"?p7e():t==="hi"?m7e():_7e()}),v7e=()=>"Queued",b7e=()=>"已排队",y7e=()=>"در صف",x7e=()=>"في قائمة الانتظار",w7e=()=>"En cola",k7e=()=>"कतार में",S7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b7e():t==="fa"?y7e():t==="ar"?x7e():t==="es"?w7e():t==="hi"?k7e():v7e()}),C7e=()=>"Recents",E7e=()=>"最近",N7e=()=>"اخیر",z7e=()=>"الأخيرة",j7e=()=>"Recientes",T7e=()=>"हाल की",TD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?E7e():t==="fa"?N7e():t==="ar"?z7e():t==="es"?j7e():t==="hi"?T7e():C7e()}),A7e=()=>"Re-check its setup.",R7e=()=>"请重新检查其设置。",M7e=()=>"راه‌اندازی آن را دوباره بررسی کنید.",O7e=()=>"أعد فحص إعداده.",D7e=()=>"Vuelve a comprobar su configuración.",L7e=()=>"इसका सेटअप फिर से जाँचें।",I7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?R7e():t==="fa"?M7e():t==="ar"?O7e():t==="es"?D7e():t==="hi"?L7e():A7e()}),$7e=()=>"Could not recover this turn. Try again.",B7e=()=>"无法恢复本轮。请重试。",P7e=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",F7e=()=>"تعذّرت استعادة هذه الجولة. حاول مجددًا.",H7e=()=>"No se pudo recuperar este turno. Inténtalo de nuevo.",q7e=()=>"यह टर्न रिकवर नहीं हो सका। फिर से कोशिश करें।",U7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?B7e():t==="fa"?P7e():t==="ar"?F7e():t==="es"?H7e():t==="hi"?q7e():$7e()}),G7e=()=>"Could not remove the queued message. Try again.",V7e=()=>"无法移除排队消息。请重试。",K7e=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",W7e=()=>"تعذّرت إزالة الرسالة من قائمة الانتظار. حاول مجددًا.",Q7e=()=>"No se pudo quitar el mensaje en cola. Inténtalo de nuevo.",X7e=()=>"कतार में लगा संदेश हटाया नहीं जा सका। फिर से कोशिश करें।",Y7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?V7e():t==="fa"?K7e():t==="ar"?W7e():t==="es"?Q7e():t==="hi"?X7e():G7e()}),Z7e=e=>`Could not re-send: ${e==null?void 0:e.error}`,J7e=e=>`无法重新发送:${e==null?void 0:e.error}`,e8e=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,t8e=e=>`تعذّرت إعادة الإرسال: ${e==null?void 0:e.error}`,n8e=e=>`No se pudo reenviar: ${e==null?void 0:e.error}`,r8e=e=>`फिर से नहीं भेजा जा सका: ${e==null?void 0:e.error}`,s8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?J7e(e):t==="fa"?e8e(e):t==="ar"?t8e(e):t==="es"?n8e(e):t==="hi"?r8e(e):Z7e(e)}),i8e=()=>"Resolved",a8e=()=>"已处理",o8e=()=>"رسیدگی شد",c8e=()=>"مُعالَج",l8e=()=>"Resuelto",u8e=()=>"सुलझाया गया",_8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a8e():t==="fa"?o8e():t==="ar"?c8e():t==="es"?l8e():t==="hi"?u8e():i8e()}),f8e=()=>"Could not retry the queued message. Try again.",d8e=()=>"无法重试排队消息。请重试。",h8e=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",p8e=()=>"تعذّرت إعادة محاولة إرسال الرسالة في قائمة الانتظار. حاول مجددًا.",m8e=()=>"No se pudo reintentar el mensaje en cola. Inténtalo de nuevo.",g8e=()=>"कतार में लगा संदेश फिर से नहीं भेजा जा सका। फिर से कोशिश करें।",v8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?d8e():t==="fa"?h8e():t==="ar"?p8e():t==="es"?m8e():t==="hi"?g8e():f8e()}),b8e=()=>"run logs",y8e=()=>"运行日志",x8e=()=>"گزارش‌های اجرا",w8e=()=>"سجلات التشغيل",k8e=()=>"logs de ejecución",S8e=()=>"रन लॉग",C8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y8e():t==="fa"?x8e():t==="ar"?w8e():t==="es"?k8e():t==="hi"?S8e():b8e()}),E8e=()=>"Scroll to bottom",N8e=()=>"滚动到底部",z8e=()=>"رفتن به پایین گفتگو",j8e=()=>"التمرير إلى الأسفل",T8e=()=>"Ir al final",A8e=()=>"नीचे तक स्क्रॉल करें",zN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N8e():t==="fa"?z8e():t==="ar"?j8e():t==="es"?T8e():t==="hi"?A8e():E8e()}),R8e=()=>"The selected harness is unavailable",M8e=()=>"所选智能体工具不可用",O8e=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",D8e=()=>"أداة البرمجة المحددة غير متاحة",L8e=()=>"El agente seleccionado no está disponible",I8e=()=>"चुना गया हार्नेस उपलब्ध नहीं है",Yg=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M8e():t==="fa"?O8e():t==="ar"?D8e():t==="es"?L8e():t==="hi"?I8e():R8e()}),$8e=()=>"Session limit reached",B8e=()=>"已达到会话使用限额",P8e=()=>"به سقف مصرف نشست رسیده‌اید",F8e=()=>"تم بلوغ حد الاستخدام",H8e=()=>"Límite de la sesión alcanzado",q8e=()=>"सेशन सीमा पूरी हो गई",U8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?B8e():t==="fa"?P8e():t==="ar"?F8e():t==="es"?H8e():t==="hi"?q8e():$8e()}),G8e=()=>"The chat session was not created",V8e=()=>"未能创建聊天会话",K8e=()=>"نشست گفت‌وگو ایجاد نشد",W8e=()=>"لم تُنشأ جلسة المحادثة",Q8e=()=>"No se creó la sesión de chat",X8e=()=>"चैट सेशन नहीं बनाया गया",Y8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?V8e():t==="fa"?K8e():t==="ar"?W8e():t==="es"?Q8e():t==="hi"?X8e():G8e()}),Z8e=()=>"Show full conversation",J8e=()=>"显示完整对话",e9e=()=>"نمایش کامل گفتگو",t9e=()=>"عرض المحادثة كاملة",n9e=()=>"Mostrar la conversación completa",r9e=()=>"पूरी बातचीत दिखाएं",s9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J8e():t==="fa"?e9e():t==="ar"?t9e():t==="es"?n9e():t==="hi"?r9e():Z8e()}),i9e=()=>" · Spawned by another agent",a9e=()=>" · 由另一个智能体创建",o9e=()=>" · ساخته‌شده به‌دست عامل دیگر",c9e=()=>" · أنشأه وكيل آخر",l9e=()=>" · Creada por otro agente",u9e=()=>" · किसी और एजेंट द्वारा शुरू किया गया",_9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a9e():t==="fa"?o9e():t==="ar"?c9e():t==="es"?l9e():t==="hi"?u9e():i9e()}),f9e=()=>"Starting…",d9e=()=>"正在启动…",h9e=()=>"در حال شروع…",p9e=()=>"جارٍ البدء…",m9e=()=>"Iniciando…",g9e=()=>"शुरू हो रहा है…",v9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?d9e():t==="fa"?h9e():t==="ar"?p9e():t==="es"?m9e():t==="hi"?g9e():f9e()}),b9e=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,y9e=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,x9e=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,w9e=e=>`وجّه ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} للإضافة إلى قائمة الانتظار)`,k9e=e=>`Guía a ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} para poner en cola)`,S9e=e=>`${e==null?void 0:e.harness} को दिशा दें… (कतार में लगाने के लिए ${e==null?void 0:e.shortcut})`,C9e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?y9e(e):t==="fa"?x9e(e):t==="ar"?w9e(e):t==="es"?k9e(e):t==="hi"?S9e(e):b9e(e)}),E9e=()=>"Could not stop the turn. Try again.",N9e=()=>"无法停止本轮。请重试。",z9e=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",j9e=()=>"تعذّر إيقاف الجولة. حاول مجددًا.",T9e=()=>"No se pudo detener el turno. Inténtalo de nuevo.",A9e=()=>"टर्न रोका नहीं जा सका। फिर से कोशिश करें।",R9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N9e():t==="fa"?z9e():t==="ar"?j9e():t==="es"?T9e():t==="hi"?A9e():E9e()}),M9e=e=>`Could not switch fork: ${e==null?void 0:e.error}`,O9e=e=>`无法切换分支:${e==null?void 0:e.error}`,D9e=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,L9e=e=>`تعذّر تبديل التفرّع: ${e==null?void 0:e.error}`,I9e=e=>`No se pudo cambiar de bifurcación: ${e==null?void 0:e.error}`,$9e=e=>`फ़ोर्क नहीं बदला जा सका: ${e==null?void 0:e.error}`,B9e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?O9e(e):t==="fa"?D9e(e):t==="ar"?L9e(e):t==="es"?I9e(e):t==="hi"?$9e(e):M9e(e)}),P9e=()=>"The agent",F9e=()=>"智能体",H9e=()=>"عامل",q9e=()=>"الوكيل",U9e=()=>"El agente",G9e=()=>"एजेंट",V9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?F9e():t==="fa"?H9e():t==="ar"?q9e():t==="es"?U9e():t==="hi"?G9e():P9e()}),K9e=()=>"Thinking",W9e=()=>"正在思考",Q9e=()=>"در حال فکر کردن",X9e=()=>"جارٍ التفكير",Y9e=()=>"Pensando",Z9e=()=>"सोच रहा है",J9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W9e():t==="fa"?Q9e():t==="ar"?X9e():t==="es"?Y9e():t==="hi"?Z9e():K9e()}),eEe=()=>"Could not toggle Plan mode. Try again.",tEe=()=>"无法切换计划模式。请重试。",nEe=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",rEe=()=>"تعذّر تبديل وضع التخطيط. حاول مجددًا.",sEe=()=>"No se pudo cambiar el modo Plan. Inténtalo de nuevo.",iEe=()=>"प्लान मोड टॉगल नहीं हो सका। फिर से कोशिश करें।",jN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tEe():t==="fa"?nEe():t==="ar"?rEe():t==="es"?sEe():t==="hi"?iEe():eEe()}),aEe=()=>"This turn did not finish.",oEe=()=>"本轮未完成。",cEe=()=>"این نوبت کامل نشد.",lEe=()=>"لم تكتمل هذه الجولة.",uEe=()=>"Este turno no terminó.",_Ee=()=>"यह टर्न पूरा नहीं हुआ।",TN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oEe():t==="fa"?cEe():t==="ar"?lEe():t==="es"?uEe():t==="hi"?_Ee():aEe()}),fEe=()=>"Type a custom answer…",dEe=()=>"输入自定义回答…",hEe=()=>"پاسخ دلخواه را بنویسید…",pEe=()=>"اكتب إجابة مخصصة…",mEe=()=>"Escribe una respuesta personalizada…",gEe=()=>"अपना जवाब टाइप करें…",vEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dEe():t==="fa"?hEe():t==="ar"?pEe():t==="es"?mEe():t==="hi"?gEe():fEe()}),bEe=()=>"Unarchive",yEe=()=>"取消归档",xEe=()=>"خارج کردن از بایگانی",wEe=()=>"إلغاء الأرشفة",kEe=()=>"Desarchivar",SEe=()=>"आर्काइव से निकालें",CEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yEe():t==="fa"?xEe():t==="ar"?wEe():t==="es"?kEe():t==="hi"?SEe():bEe()}),EEe=()=>"Untitled",NEe=()=>"未命名",zEe=()=>"بدون عنوان",jEe=()=>"بدون عنوان",TEe=()=>"Sin título",AEe=()=>"बिना शीर्षक",yd=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NEe():t==="fa"?zEe():t==="ar"?jEe():t==="es"?TEe():t==="hi"?AEe():EEe()}),REe=()=>"Could not update permissions. Try again.",MEe=()=>"无法更新权限。请重试。",OEe=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",DEe=()=>"تعذّر تحديث الأذونات. حاول مجددًا.",LEe=()=>"No se pudieron actualizar los permisos. Inténtalo de nuevo.",IEe=()=>"अनुमतियाँ अपडेट नहीं हो सकीं। फिर से कोशिश करें।",$Ee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MEe():t==="fa"?OEe():t==="ar"?DEe():t==="es"?LEe():t==="hi"?IEe():REe()}),BEe=()=>"Work details",PEe=()=>"工作详情",FEe=()=>"جزئیات کار",HEe=()=>"تفاصيل العمل",qEe=()=>"Detalles del trabajo",UEe=()=>"काम का विवरण",GEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PEe():t==="fa"?FEe():t==="ar"?HEe():t==="es"?qEe():t==="hi"?UEe():BEe()}),VEe=e=>`${e==null?void 0:e.minutes}m ${e==null?void 0:e.seconds}s`,KEe=e=>`${e==null?void 0:e.minutes}分${e==null?void 0:e.seconds}秒`,WEe=e=>`${e==null?void 0:e.minutes} دقیقه ${e==null?void 0:e.seconds} ثانیه`,QEe=e=>`${e==null?void 0:e.minutes}د ${e==null?void 0:e.seconds}ث`,XEe=e=>`${e==null?void 0:e.minutes} min ${e==null?void 0:e.seconds} s`,YEe=e=>`${e==null?void 0:e.minutes}मि ${e==null?void 0:e.seconds}से`,ZEe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?KEe(e):t==="fa"?WEe(e):t==="ar"?QEe(e):t==="es"?XEe(e):t==="hi"?YEe(e):VEe(e)}),JEe=e=>`Worked for ${e==null?void 0:e.duration}`,eNe=e=>`已工作 ${e==null?void 0:e.duration}`,tNe=e=>`به‌مدت ${e==null?void 0:e.duration} کار کرد`,nNe=e=>`عمل لمدة ${e==null?void 0:e.duration}`,rNe=e=>`Trabajó durante ${e==null?void 0:e.duration}`,sNe=e=>`${e==null?void 0:e.duration} तक काम किया`,iNe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?eNe(e):t==="fa"?tNe(e):t==="ar"?nNe(e):t==="es"?rNe(e):t==="hi"?sNe(e):JEe(e)}),aNe=()=>"Working…",oNe=()=>"正在工作…",cNe=()=>"در حال کار…",lNe=()=>"جارٍ العمل…",uNe=()=>"Trabajando…",_Ne=()=>"काम हो रहा है…",Gk=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oNe():t==="fa"?cNe():t==="ar"?lNe():t==="es"?uNe():t==="hi"?_Ne():aNe()}),fNe=()=>"Close tab",dNe=()=>"关闭标签页",hNe=()=>"بستن زبانه",pNe=()=>"إغلاق التبويب",mNe=()=>"Cerrar pestaña",gNe=()=>"टैब बंद करें",vNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dNe():t==="fa"?hNe():t==="ar"?pNe():t==="es"?mNe():t==="hi"?gNe():fNe()}),bNe=()=>"Changes",yNe=()=>"更改",xNe=()=>"تغییرات",wNe=()=>"التغييرات",kNe=()=>"Cambios",SNe=()=>"बदलाव",AD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yNe():t==="fa"?xNe():t==="ar"?wNe():t==="es"?kNe():t==="hi"?SNe():bNe()}),CNe=()=>"Code browser view",ENe=()=>"代码浏览器视图",NNe=()=>"نمای مرورگر کد",zNe=()=>"عرض متصفح الشيفرة",jNe=()=>"Vista del explorador de código",TNe=()=>"कोड ब्राउज़र व्यू",ANe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ENe():t==="fa"?NNe():t==="ar"?zNe():t==="es"?jNe():t==="hi"?TNe():CNe()}),RNe=()=>"Files",MNe=()=>"文件",ONe=()=>"فایل‌ها",DNe=()=>"الملفات",LNe=()=>"Archivos",INe=()=>"फ़ाइलें",$Ne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MNe():t==="fa"?ONe():t==="ar"?DNe():t==="es"?LNe():t==="hi"?INe():RNe()}),BNe=()=>"Refresh",PNe=()=>"刷新",FNe=()=>"تازه‌سازی",HNe=()=>"تحديث",qNe=()=>"Actualizar",UNe=()=>"रीफ़्रेश करें",AN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PNe():t==="fa"?FNe():t==="ar"?HNe():t==="es"?qNe():t==="hi"?UNe():BNe()}),GNe=()=>"listing truncated",VNe=()=>"列表已截断",KNe=()=>"فهرست کوتاه شده است",WNe=()=>"القائمة مقتطعة",QNe=()=>"listado truncado",XNe=()=>"सूची छोटी की गई",YNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VNe():t==="fa"?KNe():t==="ar"?WNe():t==="es"?QNe():t==="hi"?XNe():GNe()}),ZNe=()=>"No files.",JNe=()=>"没有文件。",eze=()=>"فایلی وجود ندارد.",tze=()=>"لا توجد ملفات.",nze=()=>"No hay archivos.",rze=()=>"कोई फ़ाइल नहीं।",sze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JNe():t==="fa"?eze():t==="ar"?tze():t==="es"?nze():t==="hi"?rze():ZNe()}),ize=()=>"Refresh failed:",aze=()=>"刷新失败:",oze=()=>"تازه‌سازی ناموفق بود:",cze=()=>"فشل التحديث:",lze=()=>"Error al actualizar:",uze=()=>"रीफ़्रेश विफल:",_ze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aze():t==="fa"?oze():t==="ar"?cze():t==="es"?lze():t==="hi"?uze():ize()}),fze=()=>"Cancelling…",dze=()=>"正在取消…",hze=()=>"در حال لغو…",pze=()=>"جارٍ الإلغاء…",mze=()=>"Cancelando…",gze=()=>"रद्द हो रहा है…",vze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dze():t==="fa"?hze():t==="ar"?pze():t==="es"?mze():t==="hi"?gze():fze()}),bze=()=>"Checking…",yze=()=>"正在检查…",xze=()=>"در حال بررسی…",wze=()=>"جارٍ التحقق…",kze=()=>"Comprobando…",Sze=()=>"जाँचा जा रहा है…",ra=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yze():t==="fa"?xze():t==="ar"?wze():t==="es"?kze():t==="hi"?Sze():bze()}),Cze=()=>"Copied",Eze=()=>"已复制",Nze=()=>"کپی شد",zze=()=>"تم النسخ",jze=()=>"Copiado",Tze=()=>"कॉपी हो गया",K_=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eze():t==="fa"?Nze():t==="ar"?zze():t==="es"?jze():t==="hi"?Tze():Cze()}),Aze=e=>`Failed to load: ${e==null?void 0:e.error}`,Rze=e=>`加载失败:${e==null?void 0:e.error}`,Mze=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,Oze=e=>`تعذّر التحميل: ${e==null?void 0:e.error}`,Dze=e=>`Error al cargar: ${e==null?void 0:e.error}`,Lze=e=>`लोड नहीं हो सका: ${e==null?void 0:e.error}`,Vk=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Rze(e):t==="fa"?Mze(e):t==="ar"?Oze(e):t==="es"?Dze(e):t==="hi"?Lze(e):Aze(e)}),Ize=()=>"Loading…",$ze=()=>"正在加载…",Bze=()=>"در حال بارگیری…",Pze=()=>"جارٍ التحميل…",Fze=()=>"Cargando…",Hze=()=>"लोड हो रहा है…",Kk=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$ze():t==="fa"?Bze():t==="ar"?Pze():t==="es"?Fze():t==="hi"?Hze():Ize()}),qze=e=>`+ ${e==null?void 0:e.count} more`,Uze=e=>`另有 ${e==null?void 0:e.count} 项`,Gze=e=>`${e==null?void 0:e.count}+ مورد دیگر`,Vze=e=>`المزيد (+${e==null?void 0:e.count})`,Kze=e=>`+ ${e==null?void 0:e.count} más`,Wze=e=>`+ ${e==null?void 0:e.count} और`,Qze=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Uze(e):t==="fa"?Gze(e):t==="ar"?Vze(e):t==="es"?Kze(e):t==="hi"?Wze(e):qze(e)}),Xze=()=>"Rendered view",Yze=()=>"渲染视图",Zze=()=>"نمای رندرشده",Jze=()=>"العرض المُنسَّق",eje=()=>"Vista renderizada",tje=()=>"रेंडर किया गया व्यू",Ev=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yze():t==="fa"?Zze():t==="ar"?Jze():t==="es"?eje():t==="hi"?tje():Xze()}),nje=()=>"Save",rje=()=>"保存",sje=()=>"ذخیره",ije=()=>"حفظ",aje=()=>"Guardar",oje=()=>"सेव करें",nc=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rje():t==="fa"?sje():t==="ar"?ije():t==="es"?aje():t==="hi"?oje():nje()}),cje=()=>"Saving…",lje=()=>"正在保存…",uje=()=>"در حال ذخیره…",_je=()=>"جارٍ الحفظ…",fje=()=>"Guardando…",dje=()=>"सेव हो रहा है…",oa=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lje():t==="fa"?uje():t==="ar"?_je():t==="es"?fje():t==="hi"?dje():cje()}),hje=()=>"Show less",pje=()=>"收起",mje=()=>"نمایش کمتر",gje=()=>"عرض أقل",vje=()=>"Mostrar menos",bje=()=>"कम दिखाएं",RD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pje():t==="fa"?mje():t==="ar"?gje():t==="es"?vje():t==="hi"?bje():hje()}),yje=()=>"Show more",xje=()=>"展开",wje=()=>"نمایش بیشتر",kje=()=>"عرض المزيد",Sje=()=>"Mostrar más",Cje=()=>"और दिखाएं",Eje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xje():t==="fa"?wje():t==="ar"?kje():t==="es"?Sje():t==="hi"?Cje():yje()}),Nje=()=>"Stop",zje=()=>"停止",jje=()=>"توقف",Tje=()=>"إيقاف",Aje=()=>"Detener",Rje=()=>"रोकें",MD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zje():t==="fa"?jje():t==="ar"?Tje():t==="es"?Aje():t==="hi"?Rje():Nje()}),Mje=()=>"Stopping…",Oje=()=>"正在停止…",Dje=()=>"در حال توقف…",Lje=()=>"جارٍ الإيقاف…",Ije=()=>"Deteniendo…",$je=()=>"रोका जा रहा है…",Bje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Oje():t==="fa"?Dje():t==="ar"?Lje():t==="es"?Ije():t==="hi"?$je():Mje()}),Pje=()=>"View source",Fje=()=>"查看源代码",Hje=()=>"نمایش متن منبع",qje=()=>"عرض المصدر",Uje=()=>"Ver código fuente",Gje=()=>"स्रोत देखें",Nd=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fje():t==="fa"?Hje():t==="ar"?qje():t==="es"?Uje():t==="hi"?Gje():Pje()}),Vje=()=>"Shorten this chat's context",Kje=()=>"压缩此聊天的上下文",Wje=()=>"کوتاه‌کردن زمینهٔ این گفت‌وگو",Qje=()=>"اختصار سياق هذه المحادثة",Xje=()=>"Comprime el contexto de este chat",Yje=()=>"इस चैट का कॉन्टेक्स्ट छोटा करें",Zje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kje():t==="fa"?Wje():t==="ar"?Qje():t==="es"?Xje():t==="hi"?Yje():Vje()}),Jje=()=>"Runs as a remote Hugging Face Job",eTe=()=>"作为远程 Hugging Face Job 运行",tTe=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",nTe=()=>"يعمل كمهمة Hugging Face بعيدة",rTe=()=>"Se ejecuta como un Job remoto de Hugging Face",sTe=()=>"एक रिमोट Hugging Face Job के रूप में चलता है",iTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eTe():t==="fa"?tTe():t==="ar"?nTe():t==="es"?rTe():t==="hi"?sTe():Jje()}),aTe=()=>"Runs as a Job on your Kubernetes cluster",oTe=()=>"作为 Kubernetes 集群上的 Job 运行",cTe=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",lTe=()=>"يعمل كمهمة على عنقود Kubernetes الخاص بك",uTe=()=>"Se ejecuta como un Job en tu clúster de Kubernetes",_Te=()=>"आपके Kubernetes क्लस्टर पर एक Job के रूप में चलता है",fTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oTe():t==="fa"?cTe():t==="ar"?lTe():t==="es"?uTe():t==="hi"?_Te():aTe()}),dTe=()=>"Runs directly on this computer",hTe=()=>"直接在此计算机上运行",pTe=()=>"مستقیماً روی این رایانه اجرا می‌شود",mTe=()=>"يعمل مباشرة على هذا الحاسوب",gTe=()=>"Se ejecuta directamente en este equipo",vTe=()=>"सीधे इस कंप्यूटर पर चलता है",bTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hTe():t==="fa"?pTe():t==="ar"?mTe():t==="es"?gTe():t==="hi"?vTe():dTe()}),yTe=()=>"Runs in a remote Modal sandbox",xTe=()=>"在远程 Modal 沙箱中运行",wTe=()=>"در sandbox دوردست Modal اجرا می‌شود",kTe=()=>"يعمل في بيئة Modal معزولة عن بُعد",STe=()=>"Se ejecuta en un sandbox remoto de Modal",CTe=()=>"एक रिमोट Modal सैंडबॉक्स में चलता है",ETe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xTe():t==="fa"?wTe():t==="ar"?kTe():t==="es"?STe():t==="hi"?CTe():yTe()}),NTe=()=>"Runs on an ephemeral OpenResearch box",zTe=()=>"在临时 OpenResearch 主机上运行",jTe=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",TTe=()=>"يعمل على صندوق OpenResearch مؤقت",ATe=()=>"Se ejecuta en una máquina efímera de OpenResearch",RTe=()=>"एक अस्थायी OpenResearch बॉक्स पर चलता है",MTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zTe():t==="fa"?jTe():t==="ar"?TTe():t==="es"?ATe():t==="hi"?RTe():NTe()}),OTe=()=>"Runs on the connected Ray cluster",DTe=()=>"在已连接的 Ray 集群上运行",LTe=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",ITe=()=>"يعمل على عنقود Ray المتصل",$Te=()=>"Se ejecuta en el clúster de Ray conectado",BTe=()=>"कनेक्टेड Ray क्लस्टर पर चलता है",PTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DTe():t==="fa"?LTe():t==="ar"?ITe():t==="es"?$Te():t==="hi"?BTe():OTe()}),FTe=()=>"Runs as a scheduled job on your Slurm cluster",HTe=()=>"作为 Slurm 集群上的调度作业运行",qTe=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",UTe=()=>"يعمل كمهمة مجدولة على عنقود Slurm الخاص بك",GTe=()=>"Se ejecuta como un job programado en tu clúster de Slurm",VTe=()=>"आपके Slurm क्लस्टर पर एक शेड्यूल्ड जॉब के रूप में चलता है",KTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HTe():t==="fa"?qTe():t==="ar"?UTe():t==="es"?GTe():t==="hi"?VTe():FTe()}),WTe=()=>"Runs on a host from your SSH config",QTe=()=>"在 SSH 配置中的主机上运行",XTe=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",YTe=()=>"يعمل على مضيف من إعداد SSH الخاص بك",ZTe=()=>"Se ejecuta en un host de tu configuración SSH",JTe=()=>"आपके SSH कॉन्फ़िग के किसी होस्ट पर चलता है",eAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QTe():t==="fa"?XTe():t==="ar"?YTe():t==="es"?ZTe():t==="hi"?JTe():WTe()}),tAe=()=>"Runs through Tinker’s remote compute",nAe=()=>"通过 Tinker 远程算力运行",rAe=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",sAe=()=>"يعمل عبر حوسبة Tinker البعيدة",iAe=()=>"Se ejecuta en el cómputo remoto de Tinker",aAe=()=>"Tinker के रिमोट कंप्यूट के ज़रिए चलता है",oAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nAe():t==="fa"?rAe():t==="ar"?sAe():t==="es"?iAe():t==="hi"?aAe():tAe()}),cAe=()=>"HF Jobs",lAe=()=>"HF Jobs",uAe=()=>"HF Jobs",_Ae=()=>"HF Jobs",fAe=()=>"HF Jobs",dAe=()=>"HF Jobs",hAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lAe():t==="fa"?uAe():t==="ar"?_Ae():t==="es"?fAe():t==="hi"?dAe():cAe()}),pAe=()=>"Kubernetes",mAe=()=>"Kubernetes",gAe=()=>"Kubernetes",vAe=()=>"Kubernetes",bAe=()=>"Kubernetes",yAe=()=>"Kubernetes",xAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mAe():t==="fa"?gAe():t==="ar"?vAe():t==="es"?bAe():t==="hi"?yAe():pAe()}),wAe=()=>"This machine",kAe=()=>"此计算机",SAe=()=>"این رایانه",CAe=()=>"هذا الجهاز",EAe=()=>"Este equipo",NAe=()=>"यह मशीन",OD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kAe():t==="fa"?SAe():t==="ar"?CAe():t==="es"?EAe():t==="hi"?NAe():wAe()}),zAe=()=>"Modal",jAe=()=>"Modal",TAe=()=>"Modal",AAe=()=>"Modal",RAe=()=>"Modal",MAe=()=>"Modal",OAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jAe():t==="fa"?TAe():t==="ar"?AAe():t==="es"?RAe():t==="hi"?MAe():zAe()}),DAe=()=>"OpenResearch",LAe=()=>"OpenResearch",IAe=()=>"OpenResearch",$Ae=()=>"OpenResearch",BAe=()=>"OpenResearch",PAe=()=>"OpenResearch",FAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LAe():t==="fa"?IAe():t==="ar"?$Ae():t==="es"?BAe():t==="hi"?PAe():DAe()}),HAe=()=>"Ray",qAe=()=>"Ray",UAe=()=>"Ray",GAe=()=>"Ray",VAe=()=>"Ray",KAe=()=>"Ray",WAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qAe():t==="fa"?UAe():t==="ar"?GAe():t==="es"?VAe():t==="hi"?KAe():HAe()}),QAe=()=>"Slurm",XAe=()=>"Slurm",YAe=()=>"Slurm",ZAe=()=>"Slurm",JAe=()=>"Slurm",eRe=()=>"Slurm",tRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XAe():t==="fa"?YAe():t==="ar"?ZAe():t==="es"?JAe():t==="hi"?eRe():QAe()}),nRe=()=>"SSH",rRe=()=>"SSH",sRe=()=>"SSH",iRe=()=>"SSH",aRe=()=>"SSH",oRe=()=>"SSH",cRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rRe():t==="fa"?sRe():t==="ar"?iRe():t==="es"?aRe():t==="hi"?oRe():nRe()}),lRe=()=>"Tinker",uRe=()=>"Tinker",_Re=()=>"Tinker",fRe=()=>"Tinker",dRe=()=>"Tinker",hRe=()=>"Tinker",pRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uRe():t==="fa"?_Re():t==="ar"?fRe():t==="es"?dRe():t==="hi"?hRe():lRe()}),mRe=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",gRe=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",vRe=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",bRe=()=>"تعمل مهمة Hugging Face عن بُعد في حسابك باستخدام العتاد المحدد. تتولى Hugging Face احتساب رسوم الاستخدام.",yRe=()=>"Un Hugging Face Job se ejecuta de forma remota en tu cuenta con el hardware seleccionado. Hugging Face factura el uso.",xRe=()=>"एक Hugging Face Job चुने गए हार्डवेयर का इस्तेमाल करते हुए आपके खाते में रिमोट रूप से चलता है। इस्तेमाल का बिल Hugging Face करता है।",wRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gRe():t==="fa"?vRe():t==="ar"?bRe():t==="es"?yRe():t==="hi"?xRe():mRe()}),kRe=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",SRe=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",CRe=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",ERe=()=>"تعمل بيئة Modal معزولة عن بُعد في حسابك باستخدام العتاد المحدد، وتُخفَّض مواردها إلى الصفر بعد انتهاء التشغيل.",NRe=()=>"Un sandbox de Modal se ejecuta de forma remota en tu cuenta con el hardware seleccionado y escala a cero al terminar la ejecución.",zRe=()=>"एक Modal सैंडबॉक्स चुने गए हार्डवेयर का इस्तेमाल करते हुए आपके खाते में रिमोट रूप से चलता है और रन के बाद शून्य पर स्केल हो जाता है।",jRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SRe():t==="fa"?CRe():t==="ar"?ERe():t==="es"?NRe():t==="hi"?zRe():kRe()}),TRe=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",ARe=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",RRe=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",MRe=()=>"تعمل التجربة على جهاز OpenResearch مؤقت، وتتحمل مؤسستك تكلفته، ويُحذف الجهاز عند انتهاء التشغيل.",ORe=()=>"Una máquina efímera de OpenResearch ejecuta el experimento, se factura a tu organización y se elimina al terminar la ejecución.",DRe=()=>"एक अस्थायी OpenResearch बॉक्स प्रयोग चलाता है, आपके संगठन को बिल किया जाता है, और रन खत्म होने पर हटा दिया जाता है।",LRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ARe():t==="fa"?RRe():t==="ar"?MRe():t==="es"?ORe():t==="hi"?DRe():TRe()}),IRe=()=>"This computer must stay awake and online while Tinker runs.",$Re=()=>"Tinker 运行时,此计算机必须保持唤醒和联网。",BRe=()=>"هنگام اجرای Tinker، این رایانه باید روشن و آنلاین بماند.",PRe=()=>"يجب أن يبقى هذا الحاسوب مستيقظًا ومتصلًا أثناء تشغيل Tinker.",FRe=()=>"Este equipo debe permanecer encendido y conectado mientras Tinker se ejecuta.",HRe=()=>"जब तक Tinker चल रहा है, इस कंप्यूटर को जागते और ऑनलाइन रहना होगा।",qRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Re():t==="fa"?BRe():t==="ar"?PRe():t==="es"?FRe():t==="hi"?HRe():IRe()}),URe=()=>"Context window",GRe=()=>"上下文窗口",VRe=()=>"پنجرهٔ زمینه",KRe=()=>"نافذة السياق",WRe=()=>"Ventana de contexto",QRe=()=>"कॉन्टेक्स्ट विंडो",XRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GRe():t==="fa"?VRe():t==="ar"?KRe():t==="es"?WRe():t==="hi"?QRe():URe()}),YRe=()=>"Context window used",ZRe=()=>"已使用的上下文窗口",JRe=()=>"پنجرهٔ زمینهٔ استفاده‌شده",eMe=()=>"المستخدَم من نافذة السياق",tMe=()=>"Ventana de contexto usada",nMe=()=>"इस्तेमाल हुई कॉन्टेक्स्ट विंडो",rMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZRe():t==="fa"?JRe():t==="ar"?eMe():t==="es"?tMe():t==="hi"?nMe():YRe()}),sMe=e=>`${e==null?void 0:e.value} tokens`,iMe=e=>`${e==null?void 0:e.value} 个 token`,aMe=e=>`${e==null?void 0:e.value} توکن`,oMe=e=>`${e==null?void 0:e.value} رمز`,cMe=e=>`${e==null?void 0:e.value} tokens`,lMe=e=>`${e==null?void 0:e.value} टोकन`,uMe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?iMe(e):t==="fa"?aMe(e):t==="ar"?oMe(e):t==="es"?cMe(e):t==="hi"?lMe(e):sMe(e)}),_Me=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,fMe=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,dMe=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,hMe=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,pMe=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,mMe=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,gMe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?fMe(e):t==="fa"?dMe(e):t==="ar"?hMe(e):t==="es"?pMe(e):t==="hi"?mMe(e):_Me(e)}),vMe=()=>"Copy the last response",bMe=()=>"复制最新回复",yMe=()=>"کپی آخرین پاسخ",xMe=()=>"نسخ آخر رد",wMe=()=>"Copia la última respuesta",kMe=()=>"आखिरी जवाब कॉपी करें",SMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bMe():t==="fa"?yMe():t==="ar"?xMe():t==="es"?wMe():t==="hi"?kMe():vMe()}),CMe=()=>"No runs yet — ask the agent to launch one.",EMe=()=>"尚无运行——让智能体启动一个。",NMe=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",zMe=()=>"لا توجد عمليات تشغيل بعد — اطلب من الوكيل بدء واحدة.",jMe=()=>"Aún no hay ejecuciones — pídele al agente que lance una.",TMe=()=>"अभी तक कोई रन नहीं — एजेंट से एक शुरू करने को कहें।",AMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EMe():t==="fa"?NMe():t==="ar"?zMe():t==="es"?jMe():t==="hi"?TMe():CMe()}),RMe=()=>"Run",MMe=()=>"运行",OMe=()=>"اجرا",DMe=()=>"تشغيل",LMe=()=>"Ejecución",IMe=()=>"रन",RN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MMe():t==="fa"?OMe():t==="ar"?DMe():t==="es"?LMe():t==="hi"?IMe():RMe()}),$Me=()=>"Switch run",BMe=()=>"切换运行",PMe=()=>"تغییر اجرا",FMe=()=>"تبديل التشغيل",HMe=()=>"Cambiar de ejecución",qMe=()=>"रन बदलें",UMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BMe():t==="fa"?PMe():t==="ar"?FMe():t==="es"?HMe():t==="hi"?qMe():$Me()}),GMe=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,VMe=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,KMe=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,WMe=e=>`${e==null?void 0:e.days}ي ${e==null?void 0:e.hours}س`,QMe=e=>`${e==null?void 0:e.days} d ${e==null?void 0:e.hours} h`,XMe=e=>`${e==null?void 0:e.days}दि ${e==null?void 0:e.hours}घं`,YMe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?VMe(e):t==="fa"?KMe(e):t==="ar"?WMe(e):t==="es"?QMe(e):t==="hi"?XMe(e):GMe(e)}),ZMe=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,JMe=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,eOe=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,tOe=e=>`${e==null?void 0:e.hours}س ${e==null?void 0:e.minutes}د`,nOe=e=>`${e==null?void 0:e.hours} h ${e==null?void 0:e.minutes} min`,rOe=e=>`${e==null?void 0:e.hours}घं ${e==null?void 0:e.minutes}मि`,sOe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?JMe(e):t==="fa"?eOe(e):t==="ar"?tOe(e):t==="es"?nOe(e):t==="hi"?rOe(e):ZMe(e)}),iOe=e=>`${e==null?void 0:e.value}m`,aOe=e=>`${e==null?void 0:e.value} 分钟`,oOe=e=>`${e==null?void 0:e.value} دقیقه`,cOe=e=>`${e==null?void 0:e.value}د`,lOe=e=>`${e==null?void 0:e.value} min`,uOe=e=>`${e==null?void 0:e.value}मि`,_Oe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?aOe(e):t==="fa"?oOe(e):t==="ar"?cOe(e):t==="es"?lOe(e):t==="hi"?uOe(e):iOe(e)}),fOe=e=>`${e==null?void 0:e.value}s`,dOe=e=>`${e==null?void 0:e.value} 秒`,hOe=e=>`${e==null?void 0:e.value} ثانیه`,pOe=e=>`${e==null?void 0:e.value}ث`,mOe=e=>`${e==null?void 0:e.value} s`,gOe=e=>`${e==null?void 0:e.value}से`,vOe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?dOe(e):t==="fa"?hOe(e):t==="ar"?pOe(e):t==="es"?mOe(e):t==="hi"?gOe(e):fOe(e)}),bOe=()=>"Code",yOe=()=>"代码",xOe=()=>"کد",wOe=()=>"الشيفرة",kOe=()=>"Código",SOe=()=>"कोड",COe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yOe():t==="fa"?xOe():t==="ar"?wOe():t==="es"?kOe():t==="hi"?SOe():bOe()}),EOe=()=>"created",NOe=()=>"创建于",zOe=()=>"ایجادشده",jOe=()=>"أُنشئ",TOe=()=>"creado",AOe=()=>"बनाया गया",ROe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NOe():t==="fa"?zOe():t==="ar"?jOe():t==="es"?TOe():t==="hi"?AOe():EOe()}),MOe=()=>"from",OOe=()=>"来自",DOe=()=>"از",LOe=()=>"من",IOe=()=>"desde",$Oe=()=>"से",BOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OOe():t==="fa"?DOe():t==="ar"?LOe():t==="es"?IOe():t==="hi"?$Oe():MOe()}),POe=()=>"Logs",FOe=()=>"日志",HOe=()=>"گزارش‌ها",qOe=()=>"السجلات",UOe=()=>"Logs",GOe=()=>"लॉग",VOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FOe():t==="fa"?HOe():t==="ar"?qOe():t==="es"?UOe():t==="hi"?GOe():POe()}),KOe=()=>"Latest run",WOe=()=>"最新运行",QOe=()=>"آخرین اجرا",XOe=()=>"أحدث تشغيل",YOe=()=>"Última ejecución",ZOe=()=>"नवीनतम रन",JOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WOe():t==="fa"?QOe():t==="ar"?XOe():t==="es"?YOe():t==="hi"?ZOe():KOe()}),eDe=()=>"Code",tDe=()=>"代码",nDe=()=>"کد",rDe=()=>"الشيفرة",sDe=()=>"Código",iDe=()=>"कोड",aDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tDe():t==="fa"?nDe():t==="ar"?rDe():t==="es"?sDe():t==="hi"?iDe():eDe()}),oDe=()=>"Commit",cDe=()=>"提交",lDe=()=>"کامیت",uDe=()=>"إيداع",_De=()=>"Commit",fDe=()=>"कमिट",dDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cDe():t==="fa"?lDe():t==="ar"?uDe():t==="es"?_De():t==="hi"?fDe():oDe()}),hDe=()=>"created",pDe=()=>"创建于",mDe=()=>"ایجادشده",gDe=()=>"أُنشئ",vDe=()=>"creado",bDe=()=>"बनाया गया",yDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pDe():t==="fa"?mDe():t==="ar"?gDe():t==="es"?vDe():t==="hi"?bDe():hDe()}),xDe=()=>"Description",wDe=()=>"说明",kDe=()=>"توضیحات",SDe=()=>"الوصف",CDe=()=>"Descripción",EDe=()=>"विवरण",NDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wDe():t==="fa"?kDe():t==="ar"?SDe():t==="es"?CDe():t==="hi"?EDe():xDe()}),zDe=()=>"Duration",jDe=()=>"时长",TDe=()=>"مدت",ADe=()=>"المدة",RDe=()=>"Duración",MDe=()=>"अवधि",ODe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jDe():t==="fa"?TDe():t==="ar"?ADe():t==="es"?RDe():t==="hi"?MDe():zDe()}),DDe=()=>"exit",LDe=()=>"退出码",IDe=()=>"خروج",$De=()=>"رمز الخروج",BDe=()=>"salida",PDe=()=>"एग्ज़िट",FDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LDe():t==="fa"?IDe():t==="ar"?$De():t==="es"?BDe():t==="hi"?PDe():DDe()}),HDe=()=>"from",qDe=()=>"来自",UDe=()=>"از",GDe=()=>"من",VDe=()=>"desde",KDe=()=>"से",WDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qDe():t==="fa"?UDe():t==="ar"?GDe():t==="es"?VDe():t==="hi"?KDe():HDe()}),QDe=()=>"Logs",XDe=()=>"日志",YDe=()=>"گزارش‌ها",ZDe=()=>"السجلات",JDe=()=>"Logs",eLe=()=>"लॉग",tLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XDe():t==="fa"?YDe():t==="ar"?ZDe():t==="es"?JDe():t==="hi"?eLe():QDe()}),nLe=()=>"Run",rLe=()=>"运行",sLe=()=>"اجرا",iLe=()=>"تشغيل",aLe=()=>"Ejecución",oLe=()=>"रन",cLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rLe():t==="fa"?sLe():t==="ar"?iLe():t==="es"?aLe():t==="hi"?oLe():nLe()}),lLe=()=>"Run history",uLe=()=>"运行历史",_Le=()=>"تاریخچهٔ اجرا",fLe=()=>"سجل التشغيل",dLe=()=>"Historial de ejecuciones",hLe=()=>"रन इतिहास",pLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uLe():t==="fa"?_Le():t==="ar"?fLe():t==="es"?dLe():t==="hi"?hLe():lLe()}),mLe=()=>"Started",gLe=()=>"开始时间",vLe=()=>"آغاز",bLe=()=>"بدأ",yLe=()=>"Inicio",xLe=()=>"शुरू हुआ",wLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gLe():t==="fa"?vLe():t==="ar"?bLe():t==="es"?yLe():t==="hi"?xLe():mLe()}),kLe=()=>"Runs",SLe=()=>"运行",CLe=()=>"اجراها",ELe=()=>"عمليات التشغيل",NLe=()=>"Ejecuciones",zLe=()=>"रन",jLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SLe():t==="fa"?CLe():t==="ar"?ELe():t==="es"?NLe():t==="hi"?zLe():kLe()}),TLe=()=>"Experiments and their runs will appear here. Ask the agent to set up an experiment to get started.",ALe=()=>"实验及其运行会显示在这里。让智能体设置一个实验即可开始。",RLe=()=>"آزمایش‌ها و اجراهای آن‌ها اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید آزمایشی راه‌اندازی کند.",MLe=()=>"ستظهر التجارب وعمليات تشغيلها هنا. اطلب من الوكيل إعداد تجربة للبدء.",OLe=()=>"Los experimentos y sus ejecuciones aparecerán aquí. Pídele al agente que configure un experimento para empezar.",DLe=()=>"प्रयोग और उनके रन यहाँ दिखेंगे। शुरू करने के लिए एजेंट से एक प्रयोग सेट अप करने को कहें।",LLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ALe():t==="fa"?RLe():t==="ar"?MLe():t==="es"?OLe():t==="hi"?DLe():TLe()}),ILe=()=>"No runs yet",$Le=()=>"还没有运行",BLe=()=>"هنوز اجرایی وجود ندارد",PLe=()=>"لا عمليات تشغيل بعد",FLe=()=>"Aún no hay ejecuciones",HLe=()=>"अभी तक कोई रन नहीं",qLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Le():t==="fa"?BLe():t==="ar"?PLe():t==="es"?FLe():t==="hi"?HLe():ILe()}),ULe=()=>"No experiments yet.",GLe=()=>"还没有实验。",VLe=()=>"هنوز آزمایشی وجود ندارد.",KLe=()=>"لا توجد تجارب بعد.",WLe=()=>"Aún no hay experimentos.",QLe=()=>"अभी तक कोई प्रयोग नहीं।",XLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GLe():t==="fa"?VLe():t==="ar"?KLe():t==="es"?WLe():t==="hi"?QLe():ULe()}),YLe=()=>"Not run yet",ZLe=()=>"尚未运行",JLe=()=>"هنوز اجرا نشده",eIe=()=>"لم تُشغَّل بعد",tIe=()=>"Aún sin ejecutar",nIe=()=>"अभी तक नहीं चलाया गया",rIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZLe():t==="fa"?JLe():t==="ar"?eIe():t==="es"?tIe():t==="hi"?nIe():YLe()}),sIe=()=>"1 run",iIe=()=>"1 次运行",aIe=()=>"۱ اجرا",oIe=()=>"تشغيل واحد",cIe=()=>"1 ejecución",lIe=()=>"1 रन",uIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iIe():t==="fa"?aIe():t==="ar"?oIe():t==="es"?cIe():t==="hi"?lIe():sIe()}),_Ie=()=>"Open logs",fIe=()=>"打开日志",dIe=()=>"باز کردن گزارش‌ها",hIe=()=>"فتح السجلات",pIe=()=>"Abrir logs",mIe=()=>"लॉग खोलें",gIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fIe():t==="fa"?dIe():t==="ar"?hIe():t==="es"?pIe():t==="hi"?mIe():_Ie()}),vIe=e=>`${e==null?void 0:e.count} runs`,bIe=e=>`${e==null?void 0:e.count} 次运行`,yIe=e=>`${e==null?void 0:e.count} اجرا`,xIe=e=>`عمليات التشغيل: ${e==null?void 0:e.count}`,wIe=e=>`${e==null?void 0:e.count} ejecuciones`,kIe=e=>`${e==null?void 0:e.count} रन`,SIe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?bIe(e):t==="fa"?yIe(e):t==="ar"?xIe(e):t==="es"?wIe(e):t==="hi"?kIe(e):vIe(e)}),CIe=()=>"Stop requested",EIe=()=>"已请求停止",NIe=()=>"درخواست توقف ثبت شد",zIe=()=>"طُلب الإيقاف",jIe=()=>"Detención solicitada",TIe=()=>"रोकने का अनुरोध किया गया",AIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EIe():t==="fa"?NIe():t==="ar"?zIe():t==="es"?jIe():t==="hi"?TIe():CIe()}),RIe=()=>"Stop run",MIe=()=>"停止运行",OIe=()=>"توقف اجرا",DIe=()=>"إيقاف التشغيل",LIe=()=>"Detener ejecución",IIe=()=>"रन रोकें",$Ie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MIe():t==="fa"?OIe():t==="ar"?DIe():t==="es"?LIe():t==="hi"?IIe():RIe()}),BIe=()=>"Code",PIe=()=>"代码",FIe=()=>"کد",HIe=()=>"الشيفرة",qIe=()=>"Código",UIe=()=>"कोड",GIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PIe():t==="fa"?FIe():t==="ar"?HIe():t==="es"?qIe():t==="hi"?UIe():BIe()}),VIe=()=>"Experiments",KIe=()=>"实验",WIe=()=>"آزمایش‌ها",QIe=()=>"التجارب",XIe=()=>"Experimentos",YIe=()=>"प्रयोग",ZIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KIe():t==="fa"?WIe():t==="ar"?QIe():t==="es"?XIe():t==="hi"?YIe():VIe()}),JIe=()=>"Logs",e$e=()=>"日志",t$e=()=>"گزارش‌ها",n$e=()=>"السجلات",r$e=()=>"Logs",s$e=()=>"लॉग",c3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?e$e():t==="fa"?t$e():t==="ar"?n$e():t==="es"?r$e():t==="hi"?s$e():JIe()}),i$e=()=>"Stop failed:",a$e=()=>"停止失败:",o$e=()=>"توقف ناموفق بود:",c$e=()=>"فشل الإيقاف:",l$e=()=>"Error al detener:",u$e=()=>"रोकना विफल:",_$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a$e():t==="fa"?o$e():t==="ar"?c$e():t==="es"?l$e():t==="hi"?u$e():i$e()}),f$e=()=>"Download this chat as Markdown",d$e=()=>"将此聊天下载为 Markdown",h$e=()=>"دانلود این گفت‌وگو به‌صورت Markdown",p$e=()=>"تنزيل هذه المحادثة بتنسيق Markdown",m$e=()=>"Descarga este chat en Markdown",g$e=()=>"इस चैट को Markdown के रूप में डाउनलोड करें",v$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?d$e():t==="fa"?h$e():t==="ar"?p$e():t==="es"?m$e():t==="hi"?g$e():f$e()}),b$e=()=>"Clipboard access is unavailable.",y$e=()=>"无法访问剪贴板。",x$e=()=>"دسترسی به کلیپ‌بورد در دسترس نیست.",w$e=()=>"الوصول إلى الحافظة غير متاح.",k$e=()=>"El acceso al portapapeles no está disponible.",S$e=()=>"क्लिपबोर्ड एक्सेस उपलब्ध नहीं है।",DD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y$e():t==="fa"?x$e():t==="ar"?w$e():t==="es"?k$e():t==="hi"?S$e():b$e()}),C$e=e=>`Delete “${e==null?void 0:e.path}”? This cannot be undone.`,E$e=e=>`删除“${e==null?void 0:e.path}”?此操作无法撤销。`,N$e=e=>`«${e==null?void 0:e.path}» حذف شود؟ این کار قابل بازگشت نیست.`,z$e=e=>`حذف «${e==null?void 0:e.path}»؟ لا يمكن التراجع عن هذا الإجراء.`,j$e=e=>`¿Eliminar “${e==null?void 0:e.path}”? Esta acción no se puede deshacer.`,T$e=e=>`“${e==null?void 0:e.path}” हटाएं? इसे वापस नहीं लाया जा सकता।`,A$e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?E$e(e):t==="fa"?N$e(e):t==="ar"?z$e(e):t==="es"?j$e(e):t==="hi"?T$e(e):C$e(e)}),R$e=()=>"Duplicate",M$e=()=>"创建副本",O$e=()=>"ایجاد نسخهٔ تکراری",D$e=()=>"تكرار",L$e=()=>"Duplicar",I$e=()=>"डुप्लिकेट करें",$$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M$e():t==="fa"?O$e():t==="ar"?D$e():t==="es"?L$e():t==="hi"?I$e():R$e()}),B$e=e=>`File actions for ${e==null?void 0:e.path}`,P$e=e=>`${e==null?void 0:e.path} 的文件操作`,F$e=e=>`عملیات فایل برای ${e==null?void 0:e.path}`,H$e=e=>`إجراءات الملف لـ ${e==null?void 0:e.path}`,q$e=e=>`Acciones de archivo para ${e==null?void 0:e.path}`,U$e=e=>`${e==null?void 0:e.path} के लिए फ़ाइल क्रियाएं`,G$e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?P$e(e):t==="fa"?F$e(e):t==="ar"?H$e(e):t==="es"?q$e(e):t==="hi"?U$e(e):B$e(e)}),V$e=()=>"Open",K$e=()=>"打开",W$e=()=>"باز کردن",Q$e=()=>"فتح",X$e=()=>"Abrir",Y$e=()=>"खोलें",Z$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K$e():t==="fa"?W$e():t==="ar"?Q$e():t==="es"?X$e():t==="hi"?Y$e():V$e()}),J$e=e=>`Rename ${e==null?void 0:e.path}`,eBe=e=>`重命名 ${e==null?void 0:e.path}`,tBe=e=>`تغییر نام ${e==null?void 0:e.path}`,nBe=e=>`إعادة تسمية ${e==null?void 0:e.path}`,rBe=e=>`Renombrar ${e==null?void 0:e.path}`,sBe=e=>`${e==null?void 0:e.path} का नाम बदलें`,iBe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?eBe(e):t==="fa"?tBe(e):t==="ar"?nBe(e):t==="es"?rBe(e):t==="hi"?sBe(e):J$e(e)}),aBe=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,oBe=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,cBe=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,lBe=e=>`ليس في ${e==null?void 0:e.root} — عرض النسخة من مُخرَجات المشروع.`,uBe=e=>`No está en ${e==null?void 0:e.root} — se muestra la copia de los artefactos del proyecto.`,_Be=e=>`${e==null?void 0:e.root} में नहीं — प्रोजेक्ट के आर्टिफ़ैक्ट से कॉपी दिखाई जा रही है।`,fBe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?oBe(e):t==="fa"?cBe(e):t==="ar"?lBe(e):t==="es"?uBe(e):t==="hi"?_Be(e):aBe(e)}),dBe=()=>"Binary file — no inline preview.",hBe=()=>"二进制文件——无法内嵌预览。",pBe=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",mBe=()=>"ملف ثنائي — لا توجد معاينة مضمّنة.",gBe=()=>"Archivo binario — sin vista previa.",vBe=()=>"बाइनरी फ़ाइल — इनलाइन प्रीव्यू नहीं है।",bBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hBe():t==="fa"?pBe():t==="ar"?mBe():t==="es"?gBe():t==="hi"?vBe():dBe()}),yBe=()=>"This file changed on disk. Your edits have not been overwritten.",xBe=()=>"此文件已在磁盘上更改。您的编辑未被覆盖。",wBe=()=>"این فایل روی دیسک تغییر کرده است. ویرایش‌های شما جایگزین نشده‌اند.",kBe=()=>"تغيّر هذا الملف على القرص. لم تُستبدل تعديلاتك.",SBe=()=>"Este archivo cambió en disco. Tus cambios no se han sobrescrito.",CBe=()=>"यह फ़ाइल डिस्क पर बदल गई है। आपके बदलाव अधिलेखित नहीं हुए हैं।",MN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xBe():t==="fa"?wBe():t==="ar"?kBe():t==="es"?SBe():t==="hi"?CBe():yBe()}),EBe=()=>"Compile failed",NBe=()=>"编译失败",zBe=()=>"کامپایل ناموفق بود",jBe=()=>"فشل التجميع",TBe=()=>"Error al compilar",ABe=()=>"कंपाइल विफल",RBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NBe():t==="fa"?zBe():t==="ar"?jBe():t==="es"?TBe():t==="hi"?ABe():EBe()}),MBe=()=>"Compile PDF",OBe=()=>"编译 PDF",DBe=()=>"کامپایل PDF",LBe=()=>"تجميع PDF",IBe=()=>"Compilar PDF",$Be=()=>"PDF कंपाइल करें",ON=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OBe():t==="fa"?DBe():t==="ar"?LBe():t==="es"?IBe():t==="hi"?$Be():MBe()}),BBe=()=>"Compiled, but the engine reported errors — check the output below.",PBe=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",FBe=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",HBe=()=>"اكتمل التجميع، لكن المحرك أبلغ عن أخطاء — راجع المُخرَجات أدناه.",qBe=()=>"Compilado, pero el motor informó de errores — revisa la salida de abajo.",UBe=()=>"कंपाइल हुआ, पर इंजन ने त्रुटियाँ बताईं — नीचे आउटपुट जाँचें।",GBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PBe():t==="fa"?FBe():t==="ar"?HBe():t==="es"?qBe():t==="hi"?UBe():BBe()}),VBe=()=>"Copy command",KBe=()=>"复制命令",WBe=()=>"کپی فرمان",QBe=()=>"نسخ الأمر",XBe=()=>"Copiar comando",YBe=()=>"कमांड कॉपी करें",ZBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KBe():t==="fa"?WBe():t==="ar"?QBe():t==="es"?XBe():t==="hi"?YBe():VBe()}),JBe=()=>"Copy file contents",ePe=()=>"复制文件内容",tPe=()=>"کپی محتوای فایل",nPe=()=>"نسخ محتوى الملف",rPe=()=>"Copiar contenido del archivo",sPe=()=>"फ़ाइल की सामग्री कॉपी करें",DN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ePe():t==="fa"?tPe():t==="ar"?nPe():t==="es"?rPe():t==="hi"?sPe():JBe()}),iPe=()=>"Could not copy file contents",aPe=()=>"无法复制文件内容",oPe=()=>"کپی محتوای فایل ممکن نشد",cPe=()=>"تعذّر نسخ محتوى الملف",lPe=()=>"No se pudo copiar el contenido del archivo",uPe=()=>"फ़ाइल की सामग्री कॉपी नहीं हो सकी",_Pe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aPe():t==="fa"?oPe():t==="ar"?cPe():t==="es"?lPe():t==="hi"?uPe():iPe()}),fPe=()=>"Copy install command",dPe=()=>"复制安装命令",hPe=()=>"کپی فرمان نصب",pPe=()=>"نسخ أمر التثبيت",mPe=()=>"Copiar comando de instalación",gPe=()=>"इंस्टॉल कमांड कॉपी करें",vPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dPe():t==="fa"?hPe():t==="ar"?pPe():t==="es"?mPe():t==="hi"?gPe():fPe()}),bPe=()=>"This file was deleted on disk. Your edits have not been discarded.",yPe=()=>"此文件已从磁盘删除。您的编辑未被丢弃。",xPe=()=>"این فایل از روی دیسک حذف شده است. ویرایش‌های شما حذف نشده‌اند.",wPe=()=>"حُذف هذا الملف من القرص. لم تُتجاهل تعديلاتك.",kPe=()=>"Este archivo se eliminó del disco. Tus cambios no se han descartado.",SPe=()=>"यह फ़ाइल डिस्क से हटा दी गई थी। आपके बदलाव मिटाए नहीं गए हैं।",LN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yPe():t==="fa"?xPe():t==="ar"?wPe():t==="es"?kPe():t==="hi"?SPe():bPe()}),CPe=()=>"Discard my edits and reload",EPe=()=>"放弃我的编辑并重新加载",NPe=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",zPe=()=>"تجاهل تعديلاتي وإعادة التحميل",jPe=()=>"Descartar mis cambios y recargar",TPe=()=>"मेरे बदलाव छोड़ें और फिर से लोड करें",APe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EPe():t==="fa"?NPe():t==="ar"?zPe():t==="es"?jPe():t==="hi"?TPe():CPe()}),RPe=()=>"Discard unsaved changes and close this file?",MPe=()=>"要丢弃未保存的更改并关闭此文件吗?",OPe=()=>"تغییرات ذخیره‌نشده حذف و فایل بسته شود؟",DPe=()=>"تجاهل التغييرات غير المحفوظة وإغلاق هذا الملف؟",LPe=()=>"¿Descartar los cambios sin guardar y cerrar este archivo?",IPe=()=>"सेव न किए गए बदलाव छोड़ें और यह फ़ाइल बंद करें?",IN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MPe():t==="fa"?OPe():t==="ar"?DPe():t==="es"?LPe():t==="hi"?IPe():RPe()}),$Pe=()=>"Dismiss",BPe=()=>"关闭",PPe=()=>"بستن",FPe=()=>"تجاهل",HPe=()=>"Cerrar",qPe=()=>"खारिज करें",UPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BPe():t==="fa"?PPe():t==="ar"?FPe():t==="es"?HPe():t==="hi"?qPe():$Pe()}),GPe=()=>"Dismiss compile message",VPe=()=>"关闭编译消息",KPe=()=>"بستن پیام کامپایل",WPe=()=>"تجاهل رسالة التجميع",QPe=()=>"Cerrar mensaje de compilación",XPe=()=>"कंपाइल संदेश खारिज करें",YPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VPe():t==="fa"?KPe():t==="ar"?WPe():t==="es"?QPe():t==="hi"?XPe():GPe()}),ZPe=()=>"Dismiss Overleaf message",JPe=()=>"关闭 Overleaf 消息",eFe=()=>"بستن پیام Overleaf",tFe=()=>"تجاهل رسالة Overleaf",nFe=()=>"Cerrar mensaje de Overleaf",rFe=()=>"Overleaf संदेश खारिज करें",sFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JPe():t==="fa"?eFe():t==="ar"?tFe():t==="es"?nFe():t==="hi"?rFe():ZPe()}),iFe=()=>"Download",aFe=()=>"下载",oFe=()=>"بارگیری",cFe=()=>"تنزيل",lFe=()=>"Descargar",uFe=()=>"डाउनलोड करें",LD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aFe():t==="fa"?oFe():t==="ar"?cFe():t==="es"?lFe():t==="hi"?uFe():iFe()}),_Fe=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,fFe=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,dFe=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,hFe=e=>`تنزيل ${e==null?void 0:e.name} (غير محدَّث — أعِد التجميع أولًا)`,pFe=e=>`Descargar ${e==null?void 0:e.name} (desactualizado — vuelve a compilar antes)`,mFe=e=>`${e==null?void 0:e.name} डाउनलोड करें (पुरानी — पहले फिर से कंपाइल करें)`,gFe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?fFe(e):t==="fa"?dFe(e):t==="ar"?hFe(e):t==="es"?pFe(e):t==="hi"?mFe(e):_Fe(e)}),vFe=()=>"Failed to load file:",bFe=()=>"加载文件失败:",yFe=()=>"بارگیری فایل ناموفق بود:",xFe=()=>"تعذّر تحميل الملف:",wFe=()=>"Error al cargar el archivo:",kFe=()=>"फ़ाइल लोड नहीं हो सकी:",$N=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bFe():t==="fa"?yFe():t==="ar"?xFe():t==="es"?wFe():t==="hi"?kFe():vFe()}),SFe=()=>"File truncated — showing the first 512 KB.",CFe=()=>"文件已截断——仅显示前 512 KB。",EFe=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",NFe=()=>"تم اقتطاع الملف — عرض أول 512 كيلوبايت.",zFe=()=>"Archivo truncado — se muestran los primeros 512 KB.",jFe=()=>"फ़ाइल छोटी की गई — पहले 512 KB दिखाए जा रहे हैं।",TFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CFe():t==="fa"?EFe():t==="ar"?NFe():t==="es"?zFe():t==="hi"?jFe():SFe()}),AFe=()=>"The page below stops partway — the full file could not be loaded.",RFe=()=>"下方页面在中途结束——无法加载完整文件。",MFe=()=>"صفحهٔ زیر در میانه متوقف می‌شود — فایل کامل بارگیری نشد.",OFe=()=>"عرض الصفحة أدناه غير مكتمل — تعذّر تحميل الملف كاملًا.",DFe=()=>"La página se corta a mitad — no se pudo cargar el archivo completo.",LFe=()=>"नीचे का पेज बीच में रुक जाता है — पूरी फ़ाइल लोड नहीं हो सकी।",IFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RFe():t==="fa"?MFe():t==="ar"?OFe():t==="es"?DFe():t==="hi"?LFe():AFe()}),$Fe=e=>`Rendered HTML: ${e==null?void 0:e.name}`,BFe=e=>`已渲染的 HTML:${e==null?void 0:e.name}`,PFe=e=>`HTML رندرشده: ${e==null?void 0:e.name}`,FFe=e=>`HTML المعروض: ${e==null?void 0:e.name}`,HFe=e=>`HTML renderizado: ${e==null?void 0:e.name}`,qFe=e=>`रेंडर किया गया HTML: ${e==null?void 0:e.name}`,UFe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?BFe(e):t==="fa"?PFe(e):t==="ar"?FFe(e):t==="es"?HFe(e):t==="hi"?qFe(e):$Fe(e)}),GFe=()=>"Loading…",VFe=()=>"正在加载…",KFe=()=>"در حال بارگیری…",WFe=()=>"جارٍ التحميل…",QFe=()=>"Cargando…",XFe=()=>"लोड हो रहा है…",ID=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VFe():t==="fa"?KFe():t==="ar"?WFe():t==="es"?QFe():t==="hi"?XFe():GFe()}),YFe=()=>"File not found.",ZFe=()=>"找不到文件。",JFe=()=>"فایل پیدا نشد.",eHe=()=>"لم يُعثر على الملف.",tHe=()=>"No se encontró el archivo.",nHe=()=>"फ़ाइल नहीं मिली।",BN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZFe():t==="fa"?JFe():t==="ar"?eHe():t==="es"?tHe():t==="hi"?nHe():YFe()}),rHe=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,sHe=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,iHe=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,aHe=e=>`لم يُعثر على الملف في مُخرَجات المشروع أو في ${e==null?void 0:e.root}.`,oHe=e=>`No se encontró el archivo en los artefactos del proyecto ni en ${e==null?void 0:e.root}.`,cHe=e=>`फ़ाइल प्रोजेक्ट के आर्टिफ़ैक्ट या ${e==null?void 0:e.root} में नहीं मिली।`,lHe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?sHe(e):t==="fa"?iHe(e):t==="ar"?aHe(e):t==="es"?oHe(e):t==="hi"?cHe(e):rHe(e)}),uHe=e=>`File not found on branch ${e==null?void 0:e.branch}.`,_He=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,fHe=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,dHe=e=>`لم يُعثر على الملف في الفرع ${e==null?void 0:e.branch}.`,hHe=e=>`No se encontró el archivo en la rama ${e==null?void 0:e.branch}.`,pHe=e=>`फ़ाइल ${e==null?void 0:e.branch} ब्रांच पर नहीं मिली।`,mHe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_He(e):t==="fa"?fHe(e):t==="ar"?dHe(e):t==="es"?hHe(e):t==="hi"?pHe(e):uHe(e)}),gHe=()=>"File not found on disk.",vHe=()=>"磁盘上找不到此文件。",bHe=()=>"فایل روی دیسک پیدا نشد.",yHe=()=>"لم يُعثر على الملف على القرص.",xHe=()=>"No se encontró el archivo en disco.",wHe=()=>"फ़ाइल डिस्क पर नहीं मिली।",kHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vHe():t==="fa"?bHe():t==="ar"?yHe():t==="es"?xHe():t==="hi"?wHe():gHe()}),SHe=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,CHe=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,EHe=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,NHe=e=>`لم يُعثر على الملف في ${e==null?void 0:e.root} ولا في مُخرَجات المشروع.`,zHe=e=>`No se encontró el archivo en ${e==null?void 0:e.root} ni en los artefactos del proyecto.`,jHe=e=>`फ़ाइल ${e==null?void 0:e.root} या प्रोजेक्ट के आर्टिफ़ैक्ट में नहीं मिली।`,THe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?CHe(e):t==="fa"?EHe(e):t==="ar"?NHe(e):t==="es"?zHe(e):t==="hi"?jHe(e):SHe(e)}),AHe=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,RHe=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,MHe=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,OHe=e=>`ليس في مُخرَجات المشروع — عرض النسخة من ${e==null?void 0:e.root}.`,DHe=e=>`No está en los artefactos del proyecto — se muestra la copia que hay en ${e==null?void 0:e.root}.`,LHe=e=>`प्रोजेक्ट के आर्टिफ़ैक्ट में नहीं — ${e==null?void 0:e.root} से कॉपी दिखाई जा रही है।`,IHe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?RHe(e):t==="fa"?MHe(e):t==="ar"?OHe(e):t==="es"?DHe(e):t==="hi"?LHe(e):AHe(e)}),$He=()=>"Open in default editor",BHe=()=>"在默认编辑器中打开",PHe=()=>"باز کردن در ویرایشگر پیش‌فرض",FHe=()=>"فتح في المحرر الافتراضي",HHe=()=>"Abrir en el editor predeterminado",qHe=()=>"डिफ़ॉल्ट एडिटर में खोलें",PN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BHe():t==="fa"?PHe():t==="ar"?FHe():t==="es"?HHe():t==="hi"?qHe():$He()}),UHe=e=>`Committed copy from ${e==null?void 0:e.branch}, not on disk`,GHe=e=>`${e==null?void 0:e.branch} 上已提交的副本,不在磁盘上`,VHe=e=>`نسخهٔ کامیت‌شده از ${e==null?void 0:e.branch}، نه روی دیسک`,KHe=e=>`نسخة مودعة من ${e==null?void 0:e.branch}، ليست على القرص`,WHe=e=>`Copia confirmada de ${e==null?void 0:e.branch}, no en disco`,QHe=e=>`${e==null?void 0:e.branch} की कमिट की गई कॉपी, डिस्क पर नहीं`,XHe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?GHe(e):t==="fa"?VHe(e):t==="ar"?KHe(e):t==="es"?WHe(e):t==="hi"?QHe(e):UHe(e)}),YHe=()=>"Only for projects on this computer",ZHe=()=>"仅适用于此电脑上的项目",JHe=()=>"فقط برای پروژه‌های این رایانه",eqe=()=>"فقط للمشاريع على هذا الكمبيوتر",tqe=()=>"Solo para proyectos en este equipo",nqe=()=>"केवल इस कंप्यूटर के प्रोजेक्ट के लिए",rqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZHe():t==="fa"?JHe():t==="ar"?eqe():t==="es"?tqe():t==="hi"?nqe():YHe()}),sqe=()=>"Only for files in the project folder",iqe=()=>"仅适用于项目文件夹中的文件",aqe=()=>"فقط برای فایل‌های پوشهٔ پروژه",oqe=()=>"فقط لملفات مجلد المشروع",cqe=()=>"Solo para archivos de la carpeta del proyecto",lqe=()=>"केवल प्रोजेक्ट फ़ोल्डर की फ़ाइलों के लिए",uqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iqe():t==="fa"?aqe():t==="ar"?oqe():t==="es"?cqe():t==="hi"?lqe():sqe()}),_qe=()=>"Overleaf's copy of this file was pulled while you had unsaved edits, so what you see is no longer what is on disk. Saving now sends this draft to Overleaf instead.",fqe=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",dqe=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",hqe=()=>"تم سحب نسخة Overleaf من هذا الملف بينما كانت لديك تعديلات غير محفوظة، لذا ما تراه لم يعد مطابقًا لما هو على القرص. الحفظ الآن يرسل هذه المسودة إلى Overleaf بدلًا من ذلك.",pqe=()=>"Se descargó la copia de Overleaf de este archivo mientras tenías cambios sin guardar, así que lo que ves ya no coincide con lo que hay en disco. Si guardas ahora, este borrador se enviará a Overleaf.",mqe=()=>"इस फ़ाइल की Overleaf कॉपी तब खींची गई जब आपके पास सेव न किए गए बदलाव थे, इसलिए जो आप देख रहे हैं वह अब डिस्क पर मौजूद चीज़ नहीं है। अभी सेव करने पर यह ड्राफ़्ट सीधे Overleaf को भेज दिया जाएगा।",gqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fqe():t==="fa"?dqe():t==="ar"?hqe():t==="es"?pqe():t==="hi"?mqe():_qe()}),vqe=()=>"Overwrite disk file",bqe=()=>"覆盖磁盘文件",yqe=()=>"بازنویسی فایل روی دیسک",xqe=()=>"استبدال الملف على القرص",wqe=()=>"Sobrescribir el archivo en disco",kqe=()=>"डिस्क फ़ाइल अधिलेखित करें",Sqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bqe():t==="fa"?yqe():t==="ar"?xqe():t==="es"?wqe():t==="hi"?kqe():vqe()}),Cqe=()=>"Compiled PDF is out of date",Eqe=()=>"已编译的 PDF 不是最新版本",Nqe=()=>"PDF کامپایل‌شده به‌روز نیست",zqe=()=>"ملف PDF المُجمَّع غير محدَّث",jqe=()=>"El PDF compilado está desactualizado",Tqe=()=>"कंपाइल की गई PDF पुरानी है",Aqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eqe():t==="fa"?Nqe():t==="ar"?zqe():t==="es"?jqe():t==="hi"?Tqe():Cqe()}),Rqe=()=>"project clone",Mqe=()=>"项目克隆",Oqe=()=>"کلون پروژه",Dqe=()=>"نسخة المشروع المستنسخة",Lqe=()=>"el clon del proyecto",Iqe=()=>"प्रोजेक्ट क्लोन",Zg=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mqe():t==="fa"?Oqe():t==="ar"?Dqe():t==="es"?Lqe():t==="hi"?Iqe():Rqe()}),$qe=()=>"Recompile PDF",Bqe=()=>"重新编译 PDF",Pqe=()=>"کامپایل دوبارهٔ PDF",Fqe=()=>"إعادة تجميع PDF",Hqe=()=>"Volver a compilar el PDF",qqe=()=>"PDF फिर से कंपाइल करें",FN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bqe():t==="fa"?Pqe():t==="ar"?Fqe():t==="es"?Hqe():t==="hi"?qqe():$qe()}),Uqe=()=>"Reload from disk",Gqe=()=>"从磁盘重新加载",Vqe=()=>"بارگذاری مجدد از دیسک",Kqe=()=>"إعادة التحميل من القرص",Wqe=()=>"Recargar desde el disco",Qqe=()=>"डिस्क से फिर से लोड करें",Xqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gqe():t==="fa"?Vqe():t==="ar"?Kqe():t==="es"?Wqe():t==="hi"?Qqe():Uqe()}),Yqe=()=>"Reveal in file manager",Zqe=()=>"在文件管理器中显示",Jqe=()=>"نمایش در مدیر فایل",eUe=()=>"إظهار في مدير الملفات",tUe=()=>"Mostrar en el administrador de archivos",nUe=()=>"फ़ाइल मैनेजर में दिखाएँ",HN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zqe():t==="fa"?Jqe():t==="ar"?eUe():t==="es"?tUe():t==="hi"?nUe():Yqe()}),rUe=()=>"Save failed",sUe=()=>"保存失败",iUe=()=>"ذخیره ناموفق بود",aUe=()=>"فشل الحفظ",oUe=()=>"Error al guardar",cUe=()=>"सेव विफल",lUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sUe():t==="fa"?iUe():t==="ar"?aUe():t==="es"?oUe():t==="hi"?cUe():rUe()}),uUe=()=>"Saving…",_Ue=()=>"正在保存…",fUe=()=>"در حال ذخیره…",dUe=()=>"جارٍ الحفظ…",hUe=()=>"Guardando…",pUe=()=>"सेव हो रहा है…",mUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Ue():t==="fa"?fUe():t==="ar"?dUe():t==="es"?hUe():t==="hi"?pUe():uUe()}),gUe=()=>"Selected — press ⌘C",vUe=()=>"已选中 — 按 ⌘C 复制",bUe=()=>"انتخاب شد — برای کپی ⌘C را بزنید",yUe=()=>"محدد — اضغط ⌘C",xUe=()=>"Seleccionado — pulsa ⌘C",wUe=()=>"चयनित — ⌘C दबाएं",kUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vUe():t==="fa"?bUe():t==="ar"?yUe():t==="es"?xUe():t==="hi"?wUe():gUe()}),SUe=()=>"session’s worktree",CUe=()=>"会话工作树",EUe=()=>"درخت کاری نشست",NUe=()=>"شجرة عمل الجلسة",zUe=()=>"el árbol de trabajo de la sesión",jUe=()=>"सेशन की वर्कट्री",Jg=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CUe():t==="fa"?EUe():t==="ar"?NUe():t==="es"?zUe():t==="hi"?jUe():SUe()}),TUe=()=>"Show compiled PDF",AUe=()=>"显示已编译的 PDF",RUe=()=>"نمایش PDF کامپایل‌شده",MUe=()=>"عرض ملف PDF المُجمَّع",OUe=()=>"Mostrar el PDF compilado",DUe=()=>"कंपाइल की गई PDF दिखाएं",qN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AUe():t==="fa"?RUe():t==="ar"?MUe():t==="es"?OUe():t==="hi"?DUe():TUe()}),LUe=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",IUe=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",$Ue=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",BUe=()=>"أُنشئ ملف PDF هذا من نسخة أقدم من المصدر — أعِد تجميعه لتحديثه.",PUe=()=>"Este PDF se compiló a partir de una versión anterior del código fuente — vuelve a compilar para actualizarlo.",FUe=()=>"यह PDF सोर्स के पुराने वर्शन से कंपाइल हुआ था — अपडेट करने के लिए फिर से कंपाइल करें।",HUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IUe():t==="fa"?$Ue():t==="ar"?BUe():t==="es"?PUe():t==="hi"?FUe():LUe()}),qUe=()=>"This session's worktree isn't available — showing the project clone's copy.",UUe=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",GUe=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",VUe=()=>"شجرة عمل هذه الجلسة غير متاحة — عرض الملف من نسخة المشروع المستنسخة.",KUe=()=>"El árbol de trabajo de esta sesión no está disponible — se muestra la copia del clon del proyecto.",WUe=()=>"इस सेशन की वर्कट्री उपलब्ध नहीं है — प्रोजेक्ट क्लोन की कॉपी दिखाई जा रही है।",QUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UUe():t==="fa"?GUe():t==="ar"?VUe():t==="es"?KUe():t==="hi"?WUe():qUe()}),XUe=()=>"Unsaved",YUe=()=>"未保存",ZUe=()=>"ذخیره نشده",JUe=()=>"غير محفوظ",eGe=()=>"Sin guardar",tGe=()=>"सेव नहीं हुआ",$D=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YUe():t==="fa"?ZUe():t==="ar"?JUe():t==="es"?eGe():t==="hi"?tGe():XUe()}),nGe=()=>"Unsaved — ⌘S to save",rGe=()=>"未保存 — 按 ⌘S 保存",sGe=()=>"ذخیره نشده — برای ذخیره ⌘S را بزنید",iGe=()=>"غير محفوظ — ⌘S للحفظ",aGe=()=>"Sin guardar — ⌘S para guardar",oGe=()=>"सेव नहीं हुआ — सेव करने के लिए ⌘S दबाएं",cGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rGe():t==="fa"?sGe():t==="ar"?iGe():t==="es"?aGe():t==="hi"?oGe():nGe()}),lGe=()=>"Update orx on the remote machine to edit this file safely.",uGe=()=>"请更新远程计算机上的 orx,以安全编辑此文件。",_Ge=()=>"برای ویرایش ایمن این فایل، orx را روی دستگاه ریموت به‌روز کنید.",fGe=()=>"حدّث orx على الجهاز البعيد لتعديل هذا الملف بأمان.",dGe=()=>"Actualiza orx en la máquina remota para editar este archivo de forma segura.",hGe=()=>"इस फ़ाइल को सुरक्षित रूप से संपादित करने के लिए रिमोट मशीन पर orx अपडेट करें।",pGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uGe():t==="fa"?_Ge():t==="ar"?fGe():t==="es"?dGe():t==="hi"?hGe():lGe()}),mGe=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",gGe=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",vGe=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",bGe=()=>"شجرة عمل هذه الجلسة غير متاحة، والملف ليس في نسخة المشروع المستنسخة ولا في مُخرَجاته.",yGe=()=>"El árbol de trabajo de esta sesión no está disponible y el archivo no está en el clon del proyecto ni en sus artefactos.",xGe=()=>"इस सेशन की वर्कट्री उपलब्ध नहीं है, और फ़ाइल प्रोजेक्ट क्लोन या उसके आर्टिफ़ैक्ट में नहीं है।",wGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gGe():t==="fa"?vGe():t==="ar"?bGe():t==="es"?yGe():t==="hi"?xGe():mGe()}),kGe=()=>"Files in this workspace will appear here. Ask the agent to create a file to get started.",SGe=()=>"此工作区中的文件会显示在这里。让智能体创建一个文件即可开始。",CGe=()=>"فایل‌های این فضای کاری اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید فایلی ایجاد کند.",EGe=()=>"ستظهر ملفات مساحة العمل هنا. اطلب من الوكيل إنشاء ملف للبدء.",NGe=()=>"Los archivos de este espacio de trabajo aparecerán aquí. Pídele al agente que cree un archivo para empezar.",zGe=()=>"इस वर्कस्पेस की फ़ाइलें यहाँ दिखेंगी। शुरू करने के लिए एजेंट से एक फ़ाइल बनाने को कहें।",jGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SGe():t==="fa"?CGe():t==="ar"?EGe():t==="es"?NGe():t==="hi"?zGe():kGe()}),TGe=()=>"Back to preview",AGe=()=>"返回预览",RGe=()=>"بازگشت به پیش‌نمایش",MGe=()=>"العودة إلى المعاينة",OGe=()=>"Volver a la vista previa",DGe=()=>"प्रीव्यू पर वापस जाएं",LGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AGe():t==="fa"?RGe():t==="ar"?MGe():t==="es"?OGe():t==="hi"?DGe():TGe()}),IGe=e=>`${e==null?void 0:e.count} changed files`,$Ge=e=>`${e==null?void 0:e.count} 个已更改文件`,BGe=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,PGe=e=>`الملفات المعدَّلة: ${e==null?void 0:e.count}`,FGe=e=>`${e==null?void 0:e.count} archivos modificados`,HGe=e=>`${e==null?void 0:e.count} बदली गई फ़ाइलें`,BD=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?$Ge(e):t==="fa"?BGe(e):t==="ar"?PGe(e):t==="es"?FGe(e):t==="hi"?HGe(e):IGe(e)}),qGe=()=>"Changed files",UGe=()=>"已更改文件",GGe=()=>"فایل‌های تغییرکرده",VGe=()=>"الملفات المتغيّرة",KGe=()=>"Archivos modificados",WGe=()=>"बदली गई फ़ाइलें",QGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UGe():t==="fa"?GGe():t==="ar"?VGe():t==="es"?KGe():t==="hi"?WGe():qGe()}),XGe=()=>"Diff preview truncated",YGe=()=>"差异预览已截断",ZGe=()=>"پیش‌نمایش تفاوت کوتاه شده است",JGe=()=>"معاينة الفروق مقتطعة",eVe=()=>"Vista previa del diff truncada",tVe=()=>"डिफ़ प्रीव्यू छोटा किया गया",nVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YGe():t==="fa"?ZGe():t==="ar"?JGe():t==="es"?eVe():t==="hi"?tVe():XGe()}),rVe=e=>`${e==null?void 0:e.count} files shown (partial)`,sVe=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,iVe=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,aVe=e=>`الملفات المعروضة: ${e==null?void 0:e.count} (عرض جزئي)`,oVe=e=>`${e==null?void 0:e.count} archivos mostrados (parcial)`,cVe=e=>`${e==null?void 0:e.count} फ़ाइलें दिखाई गईं (आंशिक)`,lVe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?sVe(e):t==="fa"?iVe(e):t==="ar"?aVe(e):t==="es"?oVe(e):t==="hi"?cVe(e):rVe(e)}),uVe=()=>"No changes.",_Ve=()=>"没有更改。",fVe=()=>"تغییری وجود ندارد.",dVe=()=>"لا توجد تغييرات.",hVe=()=>"No hay cambios.",pVe=()=>"कोई बदलाव नहीं।",mVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Ve():t==="fa"?fVe():t==="ar"?dVe():t==="es"?hVe():t==="hi"?pVe():uVe()}),gVe=()=>"No complete file preview was available before the cutoff.",vVe=()=>"在截断位置之前没有完整的文件预览。",bVe=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",yVe=()=>"لم تتوفر معاينة كاملة للملف قبل الحد الأقصى.",xVe=()=>"No se pudo previsualizar ningún archivo completo antes del límite.",wVe=()=>"कटऑफ़ से पहले कोई पूरा फ़ाइल प्रीव्यू उपलब्ध नहीं था।",kVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vVe():t==="fa"?bVe():t==="ar"?yVe():t==="es"?xVe():t==="hi"?wVe():gVe()}),SVe=()=>"No textual diff for this file.",CVe=()=>"此文件没有文本差异。",EVe=()=>"برای این فایل تفاوت متنی وجود ندارد.",NVe=()=>"لا يوجد فرق نصّي لهذا الملف.",zVe=()=>"No hay diff de texto para este archivo.",jVe=()=>"इस फ़ाइल के लिए कोई टेक्स्ट डिफ़ नहीं है।",TVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CVe():t==="fa"?EVe():t==="ar"?NVe():t==="es"?zVe():t==="hi"?jVe():SVe()}),AVe=()=>"1 changed file",RVe=()=>"1 个已更改文件",MVe=()=>"۱ فایل تغییرکرده",OVe=()=>"ملف واحد معدَّل",DVe=()=>"1 archivo modificado",LVe=()=>"1 बदली गई फ़ाइल",PD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RVe():t==="fa"?MVe():t==="ar"?OVe():t==="es"?DVe():t==="hi"?LVe():AVe()}),IVe=()=>"1 file shown (partial)",$Ve=()=>"显示 1 个文件(部分)",BVe=()=>"۱ فایل نمایش داده شده (ناقص)",PVe=()=>"عُرض ملف واحد (جزئيًا)",FVe=()=>"1 archivo mostrado (parcial)",HVe=()=>"1 फ़ाइल दिखाई गई (आंशिक)",qVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Ve():t==="fa"?BVe():t==="ar"?PVe():t==="es"?FVe():t==="hi"?HVe():IVe()}),UVe=()=>"Unable to parse this diff.",GVe=()=>"无法解析此差异。",VVe=()=>"خواندن این تفاوت ممکن نبود.",KVe=()=>"تعذّر تحليل هذا الفرق.",WVe=()=>"No se pudo interpretar este diff.",QVe=()=>"यह डिफ़ पार्स नहीं हो सका।",XVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GVe():t==="fa"?VVe():t==="ar"?KVe():t==="es"?WVe():t==="hi"?QVe():UVe()}),YVe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,ZVe=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,JVe=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,eKe=e=>`عرض أول ${e==null?void 0:e.limit} (قُرئ ${e==null?void 0:e.read}). اطّلع على الفرق الكامل محليًا عبر git.`,tKe=e=>`Se muestran los primeros ${e==null?void 0:e.limit} (${e==null?void 0:e.read} leídos). Consulta el diff completo en local con git.`,nKe=e=>`पहले ${e==null?void 0:e.limit} दिखाए जा रहे हैं (${e==null?void 0:e.read} पढ़े गए)। git के साथ लोकल रूप से पूरा डिफ़ देखें।`,rKe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ZVe(e):t==="fa"?JVe(e):t==="ar"?eKe(e):t==="es"?tKe(e):t==="hi"?nKe(e):YVe(e)}),sKe=()=>"View full diff",iKe=()=>"查看完整差异",aKe=()=>"نمایش تفاوت کامل",oKe=()=>"عرض الفرق الكامل",cKe=()=>"Ver diff completo",lKe=()=>"पूरा डिफ़ देखें",uKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iKe():t==="fa"?aKe():t==="ar"?oKe():t==="es"?cKe():t==="hi"?lKe():sKe()}),_Ke=()=>"Create a token ↗",fKe=()=>"创建令牌 ↗",dKe=()=>"ساخت توکن ↗",hKe=()=>"إنشاء رمز ↗",pKe=()=>"Crear un token ↗",mKe=()=>"एक टोकन बनाएं ↗",gKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fKe():t==="fa"?dKe():t==="ar"?hKe():t==="es"?pKe():t==="hi"?mKe():_Ke()}),vKe=()=>"Keep the agent working toward a goal",bKe=()=>"让智能体持续朝目标推进",yKe=()=>"عامل را در مسیر یک هدف نگه دارید",xKe=()=>"اجعل الوكيل يعمل نحو هدف",wKe=()=>"Mantén al agente trabajando hacia un objetivo",kKe=()=>"एजेंट को एक लक्ष्य की ओर काम पर रखें",SKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bKe():t==="fa"?yKe():t==="ar"?xKe():t==="es"?wKe():t==="hi"?kKe():vKe()}),CKe=()=>"Approve and run",EKe=()=>"批准并运行",NKe=()=>"تأیید و اجرا",zKe=()=>"الموافقة والتشغيل",jKe=()=>"Aprobar y ejecutar",TKe=()=>"स्वीकार करें और चलाएं",AKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EKe():t==="fa"?NKe():t==="ar"?zKe():t==="es"?jKe():t==="hi"?TKe():CKe()}),RKe=()=>"Cancel setup",MKe=()=>"取消设置",OKe=()=>"لغو راه‌اندازی",DKe=()=>"إلغاء الإعداد",LKe=()=>"Cancelar configuración",IKe=()=>"सेटअप रद्द करें",$Ke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MKe():t==="fa"?OKe():t==="ar"?DKe():t==="es"?LKe():t==="hi"?IKe():RKe()}),BKe=()=>"Checking connection…",PKe=()=>"正在检查连接…",FKe=()=>"در حال بررسی اتصال…",HKe=()=>"جارٍ التحقق من الإعداد…",qKe=()=>"Comprobando conexión…",UKe=()=>"कनेक्शन जाँचा जा रहा है…",GKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PKe():t==="fa"?FKe():t==="ar"?HKe():t==="es"?qKe():t==="hi"?UKe():BKe()}),VKe=e=>`${e==null?void 0:e.agent} is connected.`,KKe=e=>`${e==null?void 0:e.agent} 已连接。`,WKe=e=>`${e==null?void 0:e.agent} متصل است.`,QKe=e=>`أصبح ${e==null?void 0:e.agent} جاهزًا.`,XKe=e=>`${e==null?void 0:e.agent} está conectado.`,YKe=e=>`${e==null?void 0:e.agent} कनेक्टेड है।`,ZKe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?KKe(e):t==="fa"?WKe(e):t==="ar"?QKe(e):t==="es"?XKe(e):t==="hi"?YKe(e):VKe(e)}),JKe=()=>"Setup needs attention.",eWe=()=>"设置需要处理。",tWe=()=>"راه‌اندازی نیاز به بررسی دارد.",nWe=()=>"تعذّر إكمال الإعداد.",rWe=()=>"La configuración requiere atención.",sWe=()=>"सेटअप पर ध्यान देने की ज़रूरत है।",FD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eWe():t==="fa"?tWe():t==="ar"?nWe():t==="es"?rWe():t==="hi"?sWe():JKe()}),iWe=()=>"Install",aWe=()=>"安装",oWe=()=>"نصب",cWe=()=>"تثبيت",lWe=()=>"Instalar",uWe=()=>"इंस्टॉल करें",_We=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aWe():t==="fa"?oWe():t==="ar"?cWe():t==="es"?lWe():t==="hi"?uWe():iWe()}),fWe=e=>`Approve the command below to download and install ${e==null?void 0:e.agent} on your computer.`,dWe=e=>`批准以下命令以在您的电脑上下载并安装 ${e==null?void 0:e.agent}。`,hWe=e=>`برای دانلود و نصب ${e==null?void 0:e.agent} روی رایانه خود، دستور زیر را تأیید کنید.`,pWe=e=>`سيؤدي هذا إلى تنزيل ${e==null?void 0:e.agent} وتثبيته على جهازك. وافق لتشغيل الأمر أدناه.`,mWe=e=>`Aprueba el siguiente comando para descargar e instalar ${e==null?void 0:e.agent} en tu equipo.`,gWe=e=>`अपने कंप्यूटर पर ${e==null?void 0:e.agent} डाउनलोड और इंस्टॉल करने के लिए नीचे दी गई कमांड को स्वीकार करें।`,vWe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?dWe(e):t==="fa"?hWe(e):t==="ar"?pWe(e):t==="es"?mWe(e):t==="hi"?gWe(e):fWe(e)}),bWe=()=>"Could not load setup commands.",yWe=()=>"无法加载设置命令。",xWe=()=>"بارگیری دستورهای راه‌اندازی ناموفق بود.",wWe=()=>"تعذّر تحميل أوامر الإعداد.",kWe=()=>"No se pudieron cargar los comandos de configuración.",SWe=()=>"सेटअप कमांड लोड नहीं हो सके।",CWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yWe():t==="fa"?xWe():t==="ar"?wWe():t==="es"?kWe():t==="hi"?SWe():bWe()}),EWe=()=>"Sign in",NWe=()=>"登录",zWe=()=>"ورود",jWe=()=>"تسجيل الدخول",TWe=()=>"Iniciar sesión",AWe=()=>"साइन इन करें",HD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NWe():t==="fa"?zWe():t==="ar"?jWe():t==="es"?TWe():t==="hi"?AWe():EWe()}),RWe=()=>"The agent is not ready yet. Re-check or retry sign-in.",MWe=()=>"代理尚未就绪。请重新检查或重试登录。",OWe=()=>"عامل هنوز آماده نیست. دوباره بررسی کنید یا ورود را تکرار کنید.",DWe=()=>"وكيل البرمجة غير جاهز بعد. أعد التحقق ثم حاول مجددًا.",LWe=()=>"El agente aún no está listo. Vuelve a comprobarlo o intenta iniciar sesión de nuevo.",IWe=()=>"एजेंट अभी तैयार नहीं है। फिर से जाँचें या साइन-इन फिर से कोशिश करें।",qD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MWe():t==="fa"?OWe():t==="ar"?DWe():t==="es"?LWe():t==="hi"?IWe():RWe()}),$We=()=>"Install, update, and sign-in buttons open a terminal here in OpenResearch.",BWe=()=>"安装、更新和登录按钮会在 OpenResearch 内打开终端。",PWe=()=>"دکمه‌های نصب، به‌روزرسانی و ورود، ترمینالی در همین OpenResearch باز می‌کنند.",FWe=()=>"يفتح طرفية هنا",HWe=()=>"Los botones de instalación, actualización e inicio de sesión abren un terminal aquí, en OpenResearch.",qWe=()=>"इंस्टॉल, अपडेट और साइन-इन बटन OpenResearch में यहीं एक टर्मिनल खोलते हैं।",UWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BWe():t==="fa"?PWe():t==="ar"?FWe():t==="es"?HWe():t==="hi"?qWe():$We()}),GWe=()=>"This install command requires Node.js and npm.",VWe=()=>"此安装命令需要 Node.js 和 npm。",KWe=()=>"این دستور نصب به Node.js و npm نیاز دارد.",WWe=()=>"يلزم تثبيت Node.js وnpm لتشغيل هذا الأمر.",QWe=()=>"Este comando de instalación requiere Node.js y npm.",XWe=()=>"इस इंस्टॉल कमांड के लिए Node.js और npm ज़रूरी हैं।",YWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VWe():t==="fa"?KWe():t==="ar"?WWe():t==="es"?QWe():t==="hi"?XWe():GWe()}),ZWe=e=>`Running \`${e==null?void 0:e.command}\` in the terminal:`,JWe=e=>`正在终端中运行 \`${e==null?void 0:e.command}\`:`,eQe=e=>`در حال اجرای \`${e==null?void 0:e.command}\` در ترمینال:`,tQe=e=>`جارٍ تشغيل \`${e==null?void 0:e.command}\` في الطرفية:`,nQe=e=>`Ejecutando \`${e==null?void 0:e.command}\` en el terminal:`,rQe=e=>`टर्मिनल में \`${e==null?void 0:e.command}\` चलाया जा रहा है:`,sQe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?JWe(e):t==="fa"?eQe(e):t==="ar"?tQe(e):t==="es"?nQe(e):t==="hi"?rQe(e):ZWe(e)}),iQe=e=>`Set up ${e==null?void 0:e.agent}`,aQe=e=>`设置 ${e==null?void 0:e.agent}`,oQe=e=>`راه‌اندازی ${e==null?void 0:e.agent}`,cQe=e=>`إعداد ${e==null?void 0:e.agent}`,lQe=e=>`Configurar ${e==null?void 0:e.agent}`,uQe=e=>`${e==null?void 0:e.agent} सेट अप करें`,UN=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?aQe(e):t==="fa"?oQe(e):t==="ar"?cQe(e):t==="es"?lQe(e):t==="hi"?uQe(e):iQe(e)}),_Qe=()=>"Update",fQe=()=>"更新",dQe=()=>"به‌روزرسانی",hQe=()=>"تحديث",pQe=()=>"Actualizar",mQe=()=>"अपडेट करें",gQe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fQe():t==="fa"?dQe():t==="ar"?hQe():t==="es"?pQe():t==="hi"?mQe():_Qe()}),vQe=e=>`Approve the command below to update ${e==null?void 0:e.agent} on your computer.`,bQe=e=>`批准以下命令以在您的电脑上更新 ${e==null?void 0:e.agent}。`,yQe=e=>`برای به‌روزرسانی ${e==null?void 0:e.agent} روی رایانه خود، دستور زیر را تأیید کنید.`,xQe=e=>`سيؤدي هذا إلى تحديث ${e==null?void 0:e.agent} على جهازك. وافق لتشغيل الأمر أدناه.`,wQe=e=>`Aprueba el siguiente comando para actualizar ${e==null?void 0:e.agent} en tu equipo.`,kQe=e=>`अपने कंप्यूटर पर ${e==null?void 0:e.agent} अपडेट करने के लिए नीचे दी गई कमांड को स्वीकार करें।`,SQe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?bQe(e):t==="fa"?yQe(e):t==="ar"?xQe(e):t==="es"?wQe(e):t==="hi"?kQe(e):vQe(e)}),CQe=()=>"All projects",EQe=()=>"所有项目",NQe=()=>"همهٔ پروژه‌ها",zQe=()=>"كل المشاريع",jQe=()=>"Todos los proyectos",TQe=()=>"सभी प्रोजेक्ट",GN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EQe():t==="fa"?NQe():t==="ar"?zQe():t==="es"?jQe():t==="hi"?TQe():CQe()}),AQe=()=>"Configure Repository",RQe=()=>"配置仓库",MQe=()=>"پیکربندی مخزن",OQe=()=>"إعداد المستودع",DQe=()=>"Configurar repositorio",LQe=()=>"रिपॉज़िटरी कॉन्फ़िगर करें",IQe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RQe():t==="fa"?MQe():t==="ar"?OQe():t==="es"?DQe():t==="hi"?LQe():AQe()}),$Qe=()=>"Create a new project",BQe=()=>"新建项目",PQe=()=>"ایجاد پروژهٔ جدید",FQe=()=>"إنشاء مشروع جديد",HQe=()=>"Crear un proyecto nuevo",qQe=()=>"नया प्रोजेक्ट बनाएं",UQe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BQe():t==="fa"?PQe():t==="ar"?FQe():t==="es"?HQe():t==="hi"?qQe():$Qe()}),GQe=()=>"Hide sidebar",VQe=()=>"隐藏侧边栏",KQe=()=>"پنهان کردن نوار کناری",WQe=()=>"إخفاء الشريط الجانبي",QQe=()=>"Ocultar barra lateral",XQe=()=>"साइडबार छिपाएं",VN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VQe():t==="fa"?KQe():t==="ar"?WQe():t==="es"?QQe():t==="hi"?XQe():GQe()}),YQe=()=>"Project",ZQe=()=>"项目",JQe=()=>"پروژه",eXe=()=>"المشروع",tXe=()=>"Proyecto",nXe=()=>"प्रोजेक्ट",rXe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZQe():t==="fa"?JQe():t==="ar"?eXe():t==="es"?tXe():t==="hi"?nXe():YQe()}),sXe=e=>`${e==null?void 0:e.count} cancelled`,iXe=e=>`${e==null?void 0:e.count} 次取消`,aXe=e=>`${e==null?void 0:e.count} لغوشده`,oXe=e=>`الملغاة: ${e==null?void 0:e.count}`,cXe=e=>`${e==null?void 0:e.count} canceladas`,lXe=e=>`${e==null?void 0:e.count} रद्द`,uXe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?iXe(e):t==="fa"?aXe(e):t==="ar"?oXe(e):t==="es"?cXe(e):t==="hi"?lXe(e):sXe(e)}),_Xe=e=>`${e==null?void 0:e.count} done`,fXe=e=>`${e==null?void 0:e.count} 次完成`,dXe=e=>`${e==null?void 0:e.count} تمام‌شده`,hXe=e=>`المكتملة: ${e==null?void 0:e.count}`,pXe=e=>`${e==null?void 0:e.count} completadas`,mXe=e=>`${e==null?void 0:e.count} पूरे`,gXe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?fXe(e):t==="fa"?dXe(e):t==="ar"?hXe(e):t==="es"?pXe(e):t==="hi"?mXe(e):_Xe(e)}),vXe=e=>`${e==null?void 0:e.count} failed`,bXe=e=>`${e==null?void 0:e.count} 次失败`,yXe=e=>`${e==null?void 0:e.count} ناموفق`,xXe=e=>`الفاشلة: ${e==null?void 0:e.count}`,wXe=e=>`${e==null?void 0:e.count} con error`,kXe=e=>`${e==null?void 0:e.count} विफल`,SXe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?bXe(e):t==="fa"?yXe(e):t==="ar"?xXe(e):t==="es"?wXe(e):t==="hi"?kXe(e):vXe(e)}),CXe=e=>`${e==null?void 0:e.count} files`,EXe=e=>`${e==null?void 0:e.count} 个文件`,NXe=e=>`${e==null?void 0:e.count} فایل`,zXe=e=>`الملفات: ${e==null?void 0:e.count}`,jXe=e=>`${e==null?void 0:e.count} archivos`,TXe=e=>`${e==null?void 0:e.count} फ़ाइलें`,AXe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?EXe(e):t==="fa"?NXe(e):t==="ar"?zXe(e):t==="es"?jXe(e):t==="hi"?TXe(e):CXe(e)}),RXe=e=>`${e==null?void 0:e.count}+ files`,MXe=e=>`至少 ${e==null?void 0:e.count} 个文件`,OXe=e=>`بیش از ${e==null?void 0:e.count} فایل`,DXe=e=>`الملفات: ${e==null?void 0:e.count} على الأقل`,LXe=e=>`${e==null?void 0:e.count}+ archivos`,IXe=e=>`${e==null?void 0:e.count}+ फ़ाइलें`,$Xe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?MXe(e):t==="fa"?OXe(e):t==="ar"?DXe(e):t==="es"?LXe(e):t==="hi"?IXe(e):RXe(e)}),BXe=e=>`${e==null?void 0:e.count} live`,PXe=e=>`${e==null?void 0:e.count} 次进行中`,FXe=e=>`${e==null?void 0:e.count} فعال`,HXe=e=>`النشطة: ${e==null?void 0:e.count}`,qXe=e=>`${e==null?void 0:e.count} en curso`,UXe=e=>`${e==null?void 0:e.count} लाइव`,GXe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?PXe(e):t==="fa"?FXe(e):t==="ar"?HXe(e):t==="es"?qXe(e):t==="hi"?UXe(e):BXe(e)}),VXe=()=>"1 file",KXe=()=>"1 个文件",WXe=()=>"۱ فایل",QXe=()=>"ملف واحد",XXe=()=>"1 archivo",YXe=()=>"1 फ़ाइल",ZXe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KXe():t==="fa"?WXe():t==="ar"?QXe():t==="es"?XXe():t==="hi"?YXe():VXe()}),JXe=()=>"1 run",eYe=()=>"1 次运行",tYe=()=>"۱ اجرا",nYe=()=>"تشغيل واحد",rYe=()=>"1 ejecución",sYe=()=>"1 रन",iYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eYe():t==="fa"?tYe():t==="ar"?nYe():t==="es"?rYe():t==="hi"?sYe():JXe()}),aYe=e=>`${e==null?void 0:e.count} runs`,oYe=e=>`${e==null?void 0:e.count} 次运行`,cYe=e=>`${e==null?void 0:e.count} اجرا`,lYe=e=>`عمليات التشغيل: ${e==null?void 0:e.count}`,uYe=e=>`${e==null?void 0:e.count} ejecuciones`,_Ye=e=>`${e==null?void 0:e.count} रन`,fYe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?oYe(e):t==="fa"?cYe(e):t==="ar"?lYe(e):t==="es"?uYe(e):t==="hi"?_Ye(e):aYe(e)}),dYe=()=>"Zoom in",hYe=()=>"放大",pYe=()=>"بزرگ‌نمایی",mYe=()=>"تكبير",gYe=()=>"Acercar",vYe=()=>"ज़ूम इन",KN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hYe():t==="fa"?pYe():t==="ar"?mYe():t==="es"?gYe():t==="hi"?vYe():dYe()}),bYe=()=>"Zoom out",yYe=()=>"缩小",xYe=()=>"کوچک‌نمایی",wYe=()=>"تصغير",kYe=()=>"Alejar",SYe=()=>"ज़ूम आउट",WN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yYe():t==="fa"?xYe():t==="ar"?wYe():t==="es"?kYe():t==="hi"?SYe():bYe()}),CYe=()=>"Reset zoom to fit",EYe=()=>"重置为适合窗口",NYe=()=>"بازنشانی بزرگ‌نمایی برای جا شدن",zYe=()=>"إعادة ضبط التكبير للملاءمة",jYe=()=>"Restablecer zoom para ajustar",TYe=()=>"फ़िट करने के लिए ज़ूम रीसेट करें",QN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EYe():t==="fa"?NYe():t==="ar"?zYe():t==="es"?jYe():t==="hi"?TYe():CYe()}),AYe=()=>"No instances yet.",RYe=()=>"还没有实例。",MYe=()=>"هنوز نمونه‌ای وجود ندارد.",OYe=()=>"لا توجد مثيلات بعد.",DYe=()=>"Aún no hay instancias.",LYe=()=>"अभी तक कोई इंस्टेंस नहीं।",IYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RYe():t==="fa"?MYe():t==="ar"?OYe():t==="es"?DYe():t==="hi"?LYe():AYe()}),$Ye=()=>"Nothing running right now.",BYe=()=>"当前没有运行中的实例。",PYe=()=>"اکنون چیزی در حال اجرا نیست.",FYe=()=>"لا شيء قيد التشغيل الآن.",HYe=()=>"No hay nada en ejecución ahora mismo.",qYe=()=>"अभी कुछ नहीं चल रहा।",UYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BYe():t==="fa"?PYe():t==="ar"?FYe():t==="es"?HYe():t==="hi"?qYe():$Ye()}),GYe=()=>"Select a project to see its history.",VYe=()=>"请选择一个项目以查看其历史记录。",KYe=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",WYe=()=>"اختر مشروعًا لرؤية سجله.",QYe=()=>"Selecciona un proyecto para ver su historial.",XYe=()=>"इसका इतिहास देखने के लिए एक प्रोजेक्ट चुनें।",YYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VYe():t==="fa"?KYe():t==="ar"?WYe():t==="es"?QYe():t==="hi"?XYe():GYe()}),ZYe=()=>"Select a project to see its runs.",JYe=()=>"请选择一个项目以查看其运行。",eZe=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",tZe=()=>"اختر مشروعًا لرؤية عمليات تشغيله.",nZe=()=>"Selecciona un proyecto para ver sus ejecuciones.",rZe=()=>"इसके रन देखने के लिए एक प्रोजेक्ट चुनें।",sZe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JYe():t==="fa"?eZe():t==="ar"?tZe():t==="es"?nZe():t==="hi"?rZe():ZYe()}),iZe=()=>"View history",aZe=()=>"查看历史记录",oZe=()=>"مشاهدهٔ تاریخچه",cZe=()=>"عرض السجل",lZe=()=>"Ver historial",uZe=()=>"इतिहास देखें",_Ze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aZe():t==="fa"?oZe():t==="ar"?cZe():t==="es"?lZe():t==="hi"?uZe():iZe()}),fZe=e=>`View history (${e==null?void 0:e.count})`,dZe=e=>`查看历史记录(${e==null?void 0:e.count})`,hZe=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,pZe=e=>`عرض السجل (${e==null?void 0:e.count})`,mZe=e=>`Ver historial (${e==null?void 0:e.count})`,gZe=e=>`इतिहास देखें (${e==null?void 0:e.count})`,vZe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?dZe(e):t==="fa"?hZe(e):t==="ar"?pZe(e):t==="es"?mZe(e):t==="hi"?gZe(e):fZe(e)}),bZe=()=>"The engine exited without producing a PDF or a log.",yZe=()=>"引擎已退出,但没有生成 PDF 或日志。",xZe=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",wZe=()=>"خرج المحرك دون إنتاج ملف PDF أو سجل.",kZe=()=>"El motor terminó sin generar un PDF ni un log.",SZe=()=>"इंजन बिना PDF या लॉग बनाए बाहर निकल गया।",CZe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yZe():t==="fa"?xZe():t==="ar"?wZe():t==="es"?kZe():t==="hi"?SZe():bZe()}),EZe=()=>"Loading…",NZe=()=>"正在加载…",zZe=()=>"در حال بارگیری…",jZe=()=>"جارٍ التحميل…",TZe=()=>"Cargando…",AZe=()=>"लोड हो रहा है…",RZe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NZe():t==="fa"?zZe():t==="ar"?jZe():t==="es"?TZe():t==="hi"?AZe():EZe()}),MZe=()=>"Add local model",OZe=()=>"添加本地模型",DZe=()=>"افزودن مدل محلی",LZe=()=>"إضافة نموذج محلي",IZe=()=>"Añadir modelo local",$Ze=()=>"लोकल मॉडल जोड़ें",UD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OZe():t==="fa"?DZe():t==="ar"?LZe():t==="es"?IZe():t==="hi"?$Ze():MZe()}),BZe=()=>"Local server address",PZe=()=>"本地服务器地址",FZe=()=>"نشانی سرور محلی",HZe=()=>"عنوان الخادم المحلي",qZe=()=>"Dirección del servidor local",UZe=()=>"लोकल सर्वर पता",GZe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PZe():t==="fa"?FZe():t==="ar"?HZe():t==="es"?qZe():t==="hi"?UZe():BZe()}),VZe=()=>"Find models",KZe=()=>"查找模型",WZe=()=>"یافتن مدل‌ها",QZe=()=>"العثور على النماذج",XZe=()=>"Buscar modelos",YZe=()=>"मॉडल खोजें",ZZe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KZe():t==="fa"?WZe():t==="ar"?QZe():t==="es"?XZe():t==="hi"?YZe():VZe()}),JZe=()=>"(OpenAI compatible)",eJe=()=>"(兼容 OpenAI)",tJe=()=>"(سازگار با OpenAI)",nJe=()=>"(متوافق مع OpenAI)",rJe=()=>"(compatible con OpenAI)",sJe=()=>"(OpenAI संगत)",GD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eJe():t==="fa"?tJe():t==="ar"?nJe():t==="es"?rJe():t==="hi"?sJe():JZe()}),iJe=()=>"Saved, but OpenCode did not list this model. Check installed agents again. If your OpenCode config restricts enabled providers, allow this connection before using it.",aJe=()=>"已保存,但 OpenCode 未列出该模型。请重新检查已安装的智能体。如果 OpenCode 配置限制了启用的提供商,请先允许此连接。",oJe=()=>"ذخیره شد، اما OpenCode این مدل را فهرست نکرد. عامل‌های نصب‌شده را دوباره بررسی کنید. اگر پیکربندی OpenCode ارائه‌دهندگان فعال را محدود کرده، ابتدا این اتصال را مجاز کنید.",cJe=()=>"تم الحفظ، لكن OpenCode لم يُدرج هذا النموذج. تحقق من الوكلاء المثبّتين مجددًا. إذا كان إعداد OpenCode يقيّد المزوّدين المفعّلين، فاسمح بهذا الاتصال قبل استخدامه.",lJe=()=>"Guardado, pero OpenCode no mostró este modelo. Vuelve a comprobar los agentes instalados. Si tu configuración de OpenCode limita los proveedores habilitados, permite esta conexión antes de usarla.",uJe=()=>"सेव हो गया, पर OpenCode ने इस मॉडल की सूची नहीं दी। इंस्टॉल किए गए एजेंट फिर से जाँचें। अगर आपका OpenCode कॉन्फ़िग चालू प्रोवाइडर सीमित करता है, तो इस्तेमाल से पहले इस कनेक्शन की अनुमति दें।",_Je=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aJe():t==="fa"?oJe():t==="ar"?cJe():t==="es"?lJe():t==="hi"?uJe():iJe()}),fJe=()=>"Connected",dJe=()=>"已连接",hJe=()=>"متصل شد",pJe=()=>"متصل",mJe=()=>"Conectado",gJe=()=>"कनेक्टेड",vJe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dJe():t==="fa"?hJe():t==="ar"?pJe():t==="es"?mJe():t==="hi"?gJe():fJe()}),bJe=()=>"Context window",yJe=()=>"上下文窗口",xJe=()=>"پنجرهٔ زمینه",wJe=()=>"نافذة السياق",kJe=()=>"Ventana de contexto",SJe=()=>"कॉन्टेक्स्ट विंडो",CJe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yJe():t==="fa"?xJe():t==="ar"?wJe():t==="es"?kJe():t==="hi"?SJe():bJe()}),EJe=()=>"Match the context window loaded in your model app. 32K is a useful starting point for tools; larger contexts use more memory.",NJe=()=>"请与模型应用中加载的上下文窗口保持一致。使用工具时可从 32K 开始;更大的上下文需要更多内存。",zJe=()=>"اندازهٔ زمینه را با تنظیم بارگذاری‌شده در برنامهٔ مدل هماهنگ کنید. ۳۲هزار توکن نقطهٔ شروع مناسبی برای ابزارهاست؛ زمینهٔ بزرگ‌تر حافظهٔ بیشتری مصرف می‌کند.",jJe=()=>"استخدم حجم نافذة السياق نفسه المحدد في تطبيق النموذج. يُعدّ 32 ألف رمز نقطة بداية مناسبة لاستخدام الأدوات؛ وتستهلك النوافذ الأكبر ذاكرة أكثر.",TJe=()=>"Usa la misma ventana de contexto que tengas cargada en tu app de modelos. 32K es un buen punto de partida para herramientas; los contextos más grandes usan más memoria.",AJe=()=>"अपने मॉडल ऐप में लोड कॉन्टेक्स्ट विंडो से मेल खाएं। टूल के लिए 32K एक अच्छा शुरुआती बिंदु है; बड़े कॉन्टेक्स्ट ज़्यादा मेमोरी इस्तेमाल करते हैं।",RJe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NJe():t==="fa"?zJe():t==="ar"?jJe():t==="es"?TJe():t==="hi"?AJe():EJe()}),MJe=()=>"Custom Endpoint",OJe=()=>"自定义端点",DJe=()=>"نقطهٔ اتصال سفارشی",LJe=()=>"نقطة نهاية مخصصة",IJe=()=>"Endpoint personalizado",$Je=()=>"कस्टम एंडपॉइंट",Wk=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OJe():t==="fa"?DJe():t==="ar"?LJe():t==="es"?IJe():t==="hi"?$Je():MJe()}),BJe=e=>`Disconnect ${e==null?void 0:e.name}`,PJe=e=>`断开 ${e==null?void 0:e.name}`,FJe=e=>`قطع اتصال ${e==null?void 0:e.name}`,HJe=e=>`قطع اتصال ${e==null?void 0:e.name}`,qJe=e=>`Desconectar ${e==null?void 0:e.name}`,UJe=e=>`${e==null?void 0:e.name} डिस्कनेक्ट करें`,GJe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?PJe(e):t==="fa"?FJe(e):t==="ar"?HJe(e):t==="es"?qJe(e):t==="hi"?UJe(e):BJe(e)}),VJe=()=>"Get OpenCode",KJe=()=>"获取 OpenCode",WJe=()=>"دریافت OpenCode",QJe=()=>"الحصول على OpenCode",XJe=()=>"Obtener OpenCode",YJe=()=>"OpenCode लें",ZJe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KJe():t==="fa"?WJe():t==="ar"?QJe():t==="es"?XJe():t==="hi"?YJe():VJe()}),JJe=()=>"Install OpenCode to run tools with your local model, then re-check installed agents. No cloud account is required.",eet=()=>"安装 OpenCode 以使用本地模型执行工具,然后重新检查已安装的智能体。无需云端账户。",tet=()=>"برای اجرای ابزارها با مدل محلی، OpenCode را نصب کنید و عامل‌های نصب‌شده را دوباره بررسی کنید. حساب ابری لازم نیست.",net=()=>"ثبّت OpenCode لتشغيل الأدوات مع نموذجك المحلي، ثم أعد فحص الوكلاء المثبّتين. لا يلزم حساب سحابي.",ret=()=>"Instala OpenCode para usar herramientas con tu modelo local y vuelve a comprobar los agentes instalados. No necesitas una cuenta en la nube.",set=()=>"अपने लोकल मॉडल से टूल चलाने के लिए OpenCode इंस्टॉल करें, फिर इंस्टॉल किए गए एजेंट फिर से जाँचें। किसी क्लाउड खाते की ज़रूरत नहीं है।",iet=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eet():t==="fa"?tet():t==="ar"?net():t==="es"?ret():t==="hi"?set():JJe()}),aet=()=>"API key (optional)",oet=()=>"API 密钥(可选)",cet=()=>"کلید API (اختیاری)",uet=()=>"مفتاح API (اختياري)",_et=()=>"Clave de API (opcional)",fet=()=>"API की (वैकल्पिक)",det=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oet():t==="fa"?cet():t==="ar"?uet():t==="es"?_et():t==="hi"?fet():aet()}),het=()=>"Save model",pet=()=>"保存模型",met=()=>"ذخیرهٔ مدل",get=()=>"حفظ النموذج",vet=()=>"Guardar modelo",bet=()=>"मॉडल सेव करें",yet=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pet():t==="fa"?met():t==="ar"?get():t==="es"?vet():t==="hi"?bet():het()}),xet=()=>"Model server",wet=()=>"模型服务器",ket=()=>"سرور مدل",Cet=()=>"خادم النموذج",Eet=()=>"Servidor del modelo",Net=()=>"मॉडल सर्वर",XN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wet():t==="fa"?ket():t==="ar"?Cet():t==="es"?Eet():t==="hi"?Net():xet()}),zet=()=>"Local models",jet=()=>"本地模型",Tet=()=>"مدل‌های محلی",Aet=()=>"النماذج المحلية",Ret=()=>"Modelos locales",Met=()=>"लोकल मॉडल",YN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jet():t==="fa"?Tet():t==="ar"?Aet():t==="es"?Ret():t==="hi"?Met():zet()}),Oet=()=>"API token (optional)",Det=()=>"API 令牌(可选)",Let=()=>"توکن API (اختیاری)",Iet=()=>"رمز API (اختياري)",$et=()=>"Token de API (opcional)",Bet=()=>"API टोकन (वैकल्पिक)",Pet=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Det():t==="fa"?Let():t==="ar"?Iet():t==="es"?$et():t==="hi"?Bet():Oet()}),Fet=()=>"Copy",Het=()=>"复制",qet=()=>"کپی",Uet=()=>"نسخ",Get=()=>"Copiar",Vet=()=>"कॉपी करें",Qk=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Het():t==="fa"?qet():t==="ar"?Uet():t==="es"?Get():t==="hi"?Vet():Fet()}),Ket=()=>"Copy code",Wet=()=>"复制代码",Qet=()=>"کپی کد",Xet=()=>"نسخ الشيفرة",Yet=()=>"Copiar código",Zet=()=>"कोड कॉपी करें",Jet=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wet():t==="fa"?Qet():t==="ar"?Xet():t==="es"?Yet():t==="hi"?Zet():Ket()}),ett=()=>"Download",ttt=()=>"下载",ntt=()=>"بارگیری",rtt=()=>"تنزيل",stt=()=>"Descargar",itt=()=>"डाउनलोड करें",l3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ttt():t==="fa"?ntt():t==="ar"?rtt():t==="es"?stt():t==="hi"?itt():ett()}),att=()=>"This browser can’t preview this media format.",ott=()=>"此浏览器无法预览该媒体格式。",ctt=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",ltt=()=>"لا يستطيع هذا المتصفح معاينة صيغة الوسائط هذه.",utt=()=>"Este navegador no puede mostrar este formato multimedia.",_tt=()=>"यह ब्राउज़र इस मीडिया फ़ॉर्मैट का प्रीव्यू नहीं दिखा सकता।",ftt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ott():t==="fa"?ctt():t==="ar"?ltt():t==="es"?utt():t==="hi"?_tt():att()}),dtt=()=>"Choose the model for this chat",htt=()=>"选择此聊天的模型",ptt=()=>"انتخاب مدل این گفت‌وگو",mtt=()=>"اختيار نموذج هذه المحادثة",gtt=()=>"Elige el modelo de este chat",vtt=()=>"इस चैट के लिए मॉडल चुनें",btt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?htt():t==="fa"?ptt():t==="ar"?mtt():t==="es"?gtt():t==="hi"?vtt():dtt()}),ytt=()=>"Add Local Model",xtt=()=>"添加本地模型",wtt=()=>"افزودن مدل محلی",ktt=()=>"إضافة نموذج محلي",Stt=()=>"Añadir modelo local",Ctt=()=>"लोकल मॉडल जोड़ें",Ett=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xtt():t==="fa"?wtt():t==="ar"?ktt():t==="es"?Stt():t==="hi"?Ctt():ytt()}),Ntt=()=>" · CLI configuration",ztt=()=>" · CLI 配置",jtt=()=>" · پیکربندی CLI",Ttt=()=>" · إعداد واجهة سطر الأوامر",Att=()=>" · Configuración de la CLI",Rtt=()=>" · CLI कॉन्फ़िगरेशन",VD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ztt():t==="fa"?jtt():t==="ar"?Ttt():t==="es"?Att():t==="hi"?Rtt():Ntt()}),Mtt=()=>"· Default",Ott=()=>"· 默认",Dtt=()=>"· پیش‌فرض",Ltt=()=>"· الافتراضي",Itt=()=>"· Predeterminado",$tt=()=>"· डिफ़ॉल्ट",KD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ott():t==="fa"?Dtt():t==="ar"?Ltt():t==="es"?Itt():t==="hi"?$tt():Mtt()}),Btt=()=>"Default model",Ptt=()=>"默认模型",Ftt=()=>"مدل پیش‌فرض",Htt=()=>"النموذج الافتراضي",qtt=()=>"Modelo predeterminado",Utt=()=>"डिफ़ॉल्ट मॉडल",ZN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ptt():t==="fa"?Ftt():t==="ar"?Htt():t==="es"?qtt():t==="hi"?Utt():Btt()}),Gtt=()=>"Detecting harnesses…",Vtt=()=>"正在检测智能体工具…",Ktt=()=>"در حال شناسایی ابزارهای عامل…",Wtt=()=>"جارٍ اكتشاف أدوات البرمجة…",Qtt=()=>"Detectando agentes…",Xtt=()=>"हार्नेस पहचाने जा रहे हैं…",Ytt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vtt():t==="fa"?Ktt():t==="ar"?Wtt():t==="es"?Qtt():t==="hi"?Xtt():Gtt()}),Ztt=()=>"Effort",Jtt=()=>"推理强度",ent=()=>"میزان استدلال",tnt=()=>"الجهد",nnt=()=>"Esfuerzo",rnt=()=>"प्रयास स्तर",snt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jtt():t==="fa"?ent():t==="ar"?tnt():t==="es"?nnt():t==="hi"?rnt():Ztt()}),int=()=>"Fast speed ·",ant=()=>"快速 ·",ont=()=>"سرعت بالا ·",cnt=()=>"سرعة عالية ·",lnt=()=>"Modo rápido ·",unt=()=>"तेज़ गति ·",_nt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ant():t==="fa"?ont():t==="ar"?cnt():t==="es"?lnt():t==="hi"?unt():int()}),fnt=()=>"Mode",dnt=()=>"模式",hnt=()=>"حالت",pnt=()=>"الوضع",mnt=()=>"Modo",gnt=()=>"मोड",JN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dnt():t==="fa"?hnt():t==="ar"?pnt():t==="es"?mnt():t==="hi"?gnt():fnt()}),vnt=()=>"Model",bnt=()=>"模型",ynt=()=>"مدل",xnt=()=>"النموذج",wnt=()=>"Modelo",knt=()=>"मॉडल",f0=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bnt():t==="fa"?ynt():t==="ar"?xnt():t==="es"?wnt():t==="hi"?knt():vnt()}),Snt=e=>`${e==null?void 0:e.count} more — search to find`,Cnt=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,Ent=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,Nnt=e=>`نماذج إضافية: ${e==null?void 0:e.count} — ابحث للعثور عليها`,znt=e=>`${e==null?void 0:e.count} más — busca para encontrarlos`,jnt=e=>`${e==null?void 0:e.count} और — खोजने के लिए टाइप करें`,Tnt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Cnt(e):t==="fa"?Ent(e):t==="ar"?Nnt(e):t==="es"?znt(e):t==="hi"?jnt(e):Snt(e)}),Ant=()=>"Not available",Rnt=()=>"不可用",Mnt=()=>"در دسترس نیست",Ont=()=>"غير متاح",Dnt=()=>"No disponible",Lnt=()=>"उपलब्ध नहीं",Int=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rnt():t==="fa"?Mnt():t==="ar"?Ont():t==="es"?Dnt():t==="hi"?Lnt():Ant()}),$nt=()=>"Search models…",Bnt=()=>"搜索模型…",Pnt=()=>"جست‌وجوی مدل‌ها…",Fnt=()=>"البحث في النماذج…",Hnt=()=>"Buscar modelos…",qnt=()=>"मॉडल खोजें…",WD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bnt():t==="fa"?Pnt():t==="ar"?Fnt():t==="es"?Hnt():t==="hi"?qnt():$nt()}),Unt=()=>"Sessions keep their harness. Start a new chat to switch.",Gnt=()=>"会话将沿用当前的智能体工具。新建聊天即可切换。",Vnt=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند. برای تغییر، گفتگوی جدیدی بسازید",Knt=()=>"تحتفظ كل جلسة بأداة البرمجة الخاصة بها. ابدأ محادثة جديدة للتبديل.",Wnt=()=>"Cada sesión mantiene su agente. Inicia un chat nuevo para cambiarlo.",Qnt=()=>"सेशन अपना हार्नेस बनाए रखते हैं। बदलने के लिए नई चैट शुरू करें।",Xnt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gnt():t==="fa"?Vnt():t==="ar"?Knt():t==="es"?Wnt():t==="hi"?Qnt():Unt()}),Ynt=()=>"Speed",Znt=()=>"速度",Jnt=()=>"سرعت",ert=()=>"السرعة",trt=()=>"Velocidad",nrt=()=>"गति",ez=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Znt():t==="fa"?Jnt():t==="ar"?ert():t==="es"?trt():t==="hi"?nrt():Ynt()}),rrt=()=>"Unavailable",srt=()=>"不可用",irt=()=>"در دسترس نیست",art=()=>"غير متاح",ort=()=>"No disponible",crt=()=>"उपलब्ध नहीं",ro=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?srt():t==="fa"?irt():t==="ar"?art():t==="es"?ort():t==="hi"?crt():rrt()}),lrt=e=>`Use “${e==null?void 0:e.id}” as the model ID`,urt=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,_rt=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,frt=e=>`استخدام «${e==null?void 0:e.id}» معرّفًا للنموذج`,drt=e=>`Usar “${e==null?void 0:e.id}” como ID del modelo`,hrt=e=>`मॉडल ID के रूप में “${e==null?void 0:e.id}” इस्तेमाल करें`,prt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?urt(e):t==="fa"?_rt(e):t==="ar"?frt(e):t==="es"?drt(e):t==="hi"?hrt(e):lrt(e)}),mrt=()=>"Variant",grt=()=>"变体",vrt=()=>"گونه",brt=()=>"الصنف",yrt=()=>"Variante",xrt=()=>"वेरिएंट",wrt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?grt():t==="fa"?vrt():t==="ar"?brt():t==="es"?yrt():t==="hi"?xrt():mrt()}),krt=()=>"Start a new chat",Srt=()=>"开始新聊天",Crt=()=>"شروع گفت‌وگوی جدید",Ert=()=>"بدء محادثة جديدة",Nrt=()=>"Inicia un chat nuevo",zrt=()=>"नई चैट शुरू करें",jrt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Srt():t==="fa"?Crt():t==="ar"?Ert():t==="es"?Nrt():t==="hi"?zrt():krt()}),Trt=()=>"Advanced",Art=()=>"高级",Rrt=()=>"پیشرفته",Mrt=()=>"متقدم",Ort=()=>"Avanzado",Drt=()=>"उन्नत",QD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Art():t==="fa"?Rrt():t==="ar"?Mrt():t==="es"?Ort():t==="hi"?Drt():Trt()}),Lrt=()=>"Advanced · Connect GitHub",Irt=()=>"高级 · 连接 GitHub",$rt=()=>"پیشرفته · اتصال GitHub",Brt=()=>"متقدم · ربط GitHub",Prt=()=>"Avanzado · Conectar GitHub",Frt=()=>"उन्नत · GitHub कनेक्ट करें",Hrt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Irt():t==="fa"?$rt():t==="ar"?Brt():t==="es"?Prt():t==="hi"?Frt():Lrt()}),qrt=()=>"Advanced · GitHub sync on",Urt=()=>"高级 · GitHub 同步已开启",Grt=()=>"پیشرفته · همگام‌سازی GitHub روشن است",Vrt=()=>"متقدم · مزامنة GitHub مفعّلة",Krt=()=>"Avanzado · Sincronización con GitHub activada",Wrt=()=>"उन्नत · GitHub सिंक चालू",Qrt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Urt():t==="fa"?Grt():t==="ar"?Vrt():t==="es"?Krt():t==="hi"?Wrt():qrt()}),Xrt=()=>"Choose a different destination. A paper project needs a new or empty folder of its own.",Yrt=()=>"请选择其他位置。论文项目需要拥有独立的新文件夹或空文件夹。",Zrt=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",Jrt=()=>"اختر وجهة مختلفة. يحتاج مشروع الورقة إلى مجلد جديد أو فارغ خاص به.",est=()=>"Elige otro destino. Un proyecto de paper necesita su propia carpeta nueva o vacía.",tst=()=>"अलग गंतव्य चुनें। पेपर प्रोजेक्ट को अपना एक नया या खाली फ़ोल्डर चाहिए।",nst=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yrt():t==="fa"?Zrt():t==="ar"?Jrt():t==="es"?est():t==="hi"?tst():Xrt()}),rst=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,sst=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,ist=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,ast=e=>`تغيير مجلد المشروع؛ المجلد الحالي: ${e==null?void 0:e.path}`,ost=e=>`Cambiar la carpeta del proyecto; carpeta actual: ${e==null?void 0:e.path}`,cst=e=>`प्रोजेक्ट फ़ोल्डर बदलें; मौजूदा फ़ोल्डर: ${e==null?void 0:e.path}`,lst=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?sst(e):t==="fa"?ist(e):t==="ar"?ast(e):t==="es"?ost(e):t==="hi"?cst(e):rst(e)}),ust=()=>"Choose an existing project folder",_st=()=>"选择现有项目文件夹",fst=()=>"انتخاب پوشهٔ موجود پروژه",dst=()=>"اختر مجلد مشروع موجود",hst=()=>"Elige una carpeta de proyecto existente",pst=()=>"एक मौजूदा प्रोजेक्ट फ़ोल्डर चुनें",tz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_st():t==="fa"?fst():t==="ar"?dst():t==="es"?hst():t==="hi"?pst():ust()}),mst=()=>"Choosing…",gst=()=>"正在选择…",vst=()=>"در حال انتخاب…",bst=()=>"جارٍ الاختيار…",yst=()=>"Eligiendo…",xst=()=>"चुना जा रहा है…",wst=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gst():t==="fa"?vst():t==="ar"?bst():t==="es"?yst():t==="hi"?xst():mst()}),kst=()=>"Clone destination",Sst=()=>"克隆位置",Cst=()=>"مقصد کلون",Est=()=>"وجهة الاستنساخ",Nst=()=>"Destino del clon",zst=()=>"क्लोन गंतव्य",jst=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sst():t==="fa"?Cst():t==="ar"?Est():t==="es"?Nst():t==="hi"?zst():kst()}),Tst=()=>"Clone paper project",Ast=()=>"克隆论文项目",Rst=()=>"کلون پروژهٔ مقاله",Mst=()=>"استنساخ مشروع الورقة",Ost=()=>"Clonar proyecto del paper",Dst=()=>"पेपर प्रोजेक्ट क्लोन करें",Lst=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ast():t==="fa"?Rst():t==="ar"?Mst():t==="es"?Ost():t==="hi"?Dst():Tst()}),Ist=()=>"Create project",$st=()=>"创建项目",Bst=()=>"ایجاد پروژه",Pst=()=>"إنشاء المشروع",Fst=()=>"Crear proyecto",Hst=()=>"प्रोजेक्ट बनाएं",nz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$st():t==="fa"?Bst():t==="ar"?Pst():t==="es"?Fst():t==="hi"?Hst():Ist()}),qst=()=>"Creating…",Ust=()=>"正在创建…",Gst=()=>"در حال ایجاد…",Vst=()=>"جارٍ الإنشاء…",Kst=()=>"Creando…",Wst=()=>"बनाया जा रहा है…",Qst=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ust():t==="fa"?Gst():t==="ar"?Vst():t==="es"?Kst():t==="hi"?Wst():qst()}),Xst=()=>"Choose a different destination. This path is a file, not a folder.",Yst=()=>"请选择其他位置。此路径是文件,不是文件夹。",Zst=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",Jst=()=>"اختر وجهة مختلفة. هذا المسار ملف وليس مجلدًا.",eit=()=>"Elige otro destino. Esta ruta es un archivo, no una carpeta.",tit=()=>"अलग गंतव्य चुनें। यह पथ एक फ़ाइल है, फ़ोल्डर नहीं।",Z2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yst():t==="fa"?Zst():t==="ar"?Jst():t==="es"?eit():t==="hi"?tit():Xst()}),nit=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",rit=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",sit=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",iit=()=>"يوجد مجلد هنا بالفعل. اختر اسمًا أو موقعًا مختلفًا، أو استخدم «مجلد موجود».",ait=()=>"Ya existe una carpeta aquí. Elige otro nombre u otra ubicación, o usa Carpeta existente.",oit=()=>"यहाँ पहले से एक फ़ोल्डर मौजूद है। अलग नाम या स्थान चुनें, या मौजूदा फ़ोल्डर का इस्तेमाल करें।",rz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rit():t==="fa"?sit():t==="ar"?iit():t==="es"?ait():t==="hi"?oit():nit()}),cit=()=>"Blank project",lit=()=>"空白项目",uit=()=>"پروژهٔ خالی",_it=()=>"مشروع فارغ",fit=()=>"Proyecto en blanco",dit=()=>"खाली प्रोजेक्ट",hit=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lit():t==="fa"?uit():t==="ar"?_it():t==="es"?fit():t==="hi"?dit():cit()}),pit=()=>"Cancel",mit=()=>"取消",git=()=>"لغو",vit=()=>"إلغاء",bit=()=>"Cancelar",yit=()=>"रद्द करें",xit=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mit():t==="fa"?git():t==="ar"?vit():t==="es"?bit():t==="hi"?yit():pit()}),wit=()=>"Change",kit=()=>"更改",Sit=()=>"تغییر",Cit=()=>"تغيير",Eit=()=>"Cambiar",Nit=()=>"बदलें",zit=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kit():t==="fa"?Sit():t==="ar"?Cit():t==="es"?Eit():t==="hi"?Nit():wit()}),jit=()=>"Change selected paper",Tit=()=>"更改所选论文",Ait=()=>"تغییر مقالهٔ انتخاب‌شده",Rit=()=>"تغيير الورقة المحددة",Mit=()=>"Cambiar el paper seleccionado",Oit=()=>"चयनित पेपर बदलें",Dit=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tit():t==="fa"?Ait():t==="ar"?Rit():t==="es"?Mit():t==="hi"?Oit():jit()}),Lit=()=>"Check out a Git branch before using this folder.",Iit=()=>"使用此文件夹前,请先检出一个 Git 分支。",$it=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",Bit=()=>"انتقل إلى فرع Git قبل استخدام هذا المجلد.",Pit=()=>"Haz checkout de una rama de Git antes de usar esta carpeta.",Fit=()=>"इस फ़ोल्डर का उपयोग करने से पहले एक Git ब्रांच चेक आउट करें।",Hit=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Iit():t==="fa"?$it():t==="ar"?Bit():t==="es"?Pit():t==="hi"?Fit():Lit()}),qit=()=>"Checking project location.",Uit=()=>"正在检查项目位置。",Git=()=>"در حال بررسی محل پروژه.",Vit=()=>"جارٍ التحقق من موقع المشروع.",Kit=()=>"Comprobando la ubicación del proyecto.",Wit=()=>"प्रोजेक्ट स्थान जाँचा जा रहा है।",sz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uit():t==="fa"?Git():t==="ar"?Vit():t==="es"?Kit():t==="hi"?Wit():qit()}),Qit=()=>"Existing folder",Xit=()=>"现有文件夹",Yit=()=>"پوشهٔ موجود",Zit=()=>"مجلد موجود",Jit=()=>"Carpeta existente",eat=()=>"मौजूदा फ़ोल्डर",tat=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xit():t==="fa"?Yit():t==="ar"?Zit():t==="es"?Jit():t==="hi"?eat():Qit()}),nat=()=>"Experiment branches will be pushed to the remote GitHub repository.",rat=()=>"实验分支将推送到远程 GitHub 仓库。",sat=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",iat=()=>"ستُرفع فروع التجارب إلى مستودع GitHub البعيد.",aat=()=>"Las ramas de los experimentos se subirán al repositorio remoto de GitHub.",oat=()=>"प्रयोग ब्रांच रिमोट GitHub रिपॉज़िटरी पर पुश की जाएंगी।",cat=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rat():t==="fa"?sat():t==="ar"?iat():t==="es"?aat():t==="hi"?oat():nat()}),lat=()=>"From a paper",uat=()=>"从论文创建",_at=()=>"از یک مقاله",fat=()=>"من ورقة بحثية",dat=()=>"A partir de un paper",hat=()=>"एक पेपर से",pat=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uat():t==="fa"?_at():t==="ar"?fat():t==="es"?dat():t==="hi"?hat():lat()}),mat=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",gat=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",vat=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",bat=()=>"‏Git مطلوب للتجارب لكنه غير مثبّت. ثبّت Git ثم أعد تشغيل OpenResearch.",yat=()=>"Git es necesario para los experimentos, pero no está instalado. Instala Git y reinicia OpenResearch.",xat=()=>"प्रयोगों के लिए Git ज़रूरी है पर इंस्टॉल नहीं है। Git इंस्टॉल करें, फिर OpenResearch फिर से शुरू करें।",wat=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gat():t==="fa"?vat():t==="ar"?bat():t==="es"?yat():t==="hi"?xat():mat()}),kat=()=>"my-research",Sat=()=>"my-research",Cat=()=>"my-research",Eat=()=>"my-research",Nat=()=>"mi-investigacion",zat=()=>"मेरा-शोध",iz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sat():t==="fa"?Cat():t==="ar"?Eat():t==="es"?Nat():t==="hi"?zat():kat()}),jat=()=>"No papers found. Try an arXiv ID, URL, or a different title.",Tat=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",Aat=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",Rat=()=>"لم يُعثر على أوراق. جرّب معرّف arXiv أو رابطًا أو عنوانًا مختلفًا.",Mat=()=>"No se encontraron papers. Prueba con un ID de arXiv, una URL u otro título.",Oat=()=>"कोई पेपर नहीं मिला। एक arXiv ID, URL, या अलग शीर्षक आज़माएं।",Dat=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tat():t==="fa"?Aat():t==="ar"?Rat():t==="es"?Mat():t==="hi"?Oat():jat()}),Lat=()=>"No public repository found on alphaXiv",Iat=()=>"在 alphaXiv 上未找到公开仓库",$at=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",Bat=()=>"لم يُعثر على مستودع عام على alphaXiv",Pat=()=>"No se encontró ningún repositorio público en alphaXiv",Fat=()=>"alphaXiv पर कोई सार्वजनिक रिपॉज़िटरी नहीं मिली",Hat=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Iat():t==="fa"?$at():t==="ar"?Bat():t==="es"?Pat():t==="hi"?Fat():Lat()}),qat=()=>"OpenResearch will start a blank project with this paper's PDF.",Uat=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",Gat=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",Vat=()=>"سيبدأ OpenResearch مشروعًا فارغًا مع ملف PDF لهذه الورقة.",Kat=()=>"OpenResearch creará un proyecto en blanco con el PDF de este paper.",Wat=()=>"OpenResearch इस पेपर की PDF के साथ एक खाली प्रोजेक्ट शुरू करेगा।",Qat=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uat():t==="fa"?Gat():t==="ar"?Vat():t==="es"?Kat():t==="hi"?Wat():qat()}),Xat=()=>"Paper",Yat=()=>"论文",Zat=()=>"مقاله",Jat=()=>"ورقة بحثية",eot=()=>"Paper",tot=()=>"पेपर",not=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yat():t==="fa"?Zat():t==="ar"?Jat():t==="es"?eot():t==="hi"?tot():Xat()}),rot=()=>"Project location",sot=()=>"项目位置",iot=()=>"محل پروژه",aot=()=>"موقع المشروع",oot=()=>"Ubicación del proyecto",cot=()=>"प्रोजेक्ट स्थान",J2=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sot():t==="fa"?iot():t==="ar"?aot():t==="es"?oot():t==="hi"?cot():rot()}),lot=()=>"Project name",uot=()=>"项目名称",_ot=()=>"نام پروژه",fot=()=>"اسم المشروع",dot=()=>"Nombre del proyecto",hot=()=>"प्रोजेक्ट नाम",az=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uot():t==="fa"?_ot():t==="ar"?fot():t==="es"?dot():t==="hi"?hot():lot()}),pot=()=>"Search for a paper by arXiv ID, URL, or title",mot=()=>"按 arXiv ID、网址或标题搜索论文",got=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",vot=()=>"ابحث عن ورقة بمعرّف arXiv أو رابط أو عنوان",bot=()=>"Busca un paper por ID de arXiv, URL o título",yot=()=>"arXiv ID, URL, या शीर्षक से पेपर खोजें",xot=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mot():t==="fa"?got():t==="ar"?vot():t==="es"?bot():t==="hi"?yot():pot()}),wot=()=>"Sync experiments to GitHub",kot=()=>"将实验同步到 GitHub",Sot=()=>"همگام‌سازی آزمایش‌ها با GitHub",Cot=()=>"مزامنة التجارب مع GitHub",Eot=()=>"Sincronizar experimentos con GitHub",Not=()=>"प्रयोग GitHub पर सिंक करें",zot=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kot():t==="fa"?Sot():t==="ar"?Cot():t==="es"?Eot():t==="hi"?Not():wot()}),jot=()=>"That folder no longer exists. Choose it again.",Tot=()=>"该文件夹已不存在。请重新选择。",Aot=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",Rot=()=>"لم يعد ذلك المجلد موجودًا. اختره مجددًا.",Mot=()=>"Esa carpeta ya no existe. Vuelve a elegirla.",Oot=()=>"वह फ़ोल्डर अब मौजूद नहीं है। इसे फिर से चुनें।",Dot=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tot():t==="fa"?Aot():t==="ar"?Rot():t==="es"?Mot():t==="hi"?Oot():jot()}),Lot=()=>"The selected folder contains an invalid Git repository.",Iot=()=>"所选文件夹包含无效的 Git 仓库。",$ot=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",Bot=()=>"يحتوي المجلد المحدد على مستودع Git غير صالح.",Pot=()=>"La carpeta seleccionada contiene un repositorio de Git no válido.",Fot=()=>"चयनित फ़ोल्डर में एक अमान्य Git रिपॉज़िटरी है।",Hot=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Iot():t==="fa"?$ot():t==="ar"?Bot():t==="es"?Pot():t==="hi"?Fot():Lot()}),qot=()=>"The selected path is not a folder.",Uot=()=>"所选路径不是文件夹。",Got=()=>"مسیر انتخاب‌شده پوشه نیست.",Vot=()=>"المسار المحدد ليس مجلدًا.",Kot=()=>"La ruta seleccionada no es una carpeta.",Wot=()=>"चयनित पथ एक फ़ोल्डर नहीं है।",Qot=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uot():t==="fa"?Got():t==="ar"?Vot():t==="es"?Kot():t==="hi"?Wot():qot()}),Xot=e=>`Checking ${e==null?void 0:e.repository}.`,Yot=e=>`正在检查 ${e==null?void 0:e.repository}。`,Zot=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,Jot=e=>`جارٍ التحقق من ${e==null?void 0:e.repository}.`,ect=e=>`Comprobando ${e==null?void 0:e.repository}.`,tct=e=>`${e==null?void 0:e.repository} जाँची जा रही है।`,nct=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Yot(e):t==="fa"?Zot(e):t==="ar"?Jot(e):t==="es"?ect(e):t==="hi"?tct(e):Xot(e)}),rct=e=>`Creates ${e==null?void 0:e.repository}.`,sct=e=>`将创建 ${e==null?void 0:e.repository}。`,ict=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,act=e=>`ينشئ ${e==null?void 0:e.repository}.`,oct=e=>`Crea ${e==null?void 0:e.repository}.`,cct=e=>`${e==null?void 0:e.repository} बनाता है।`,lct=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?sct(e):t==="fa"?ict(e):t==="ar"?act(e):t==="es"?oct(e):t==="hi"?cct(e):rct(e)}),uct=e=>`Pushes to ${e==null?void 0:e.repository}.`,_ct=e=>`将推送到 ${e==null?void 0:e.repository}。`,fct=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,dct=e=>`يرفع التغييرات إلى ${e==null?void 0:e.repository}.`,hct=e=>`Sube los cambios a ${e==null?void 0:e.repository}.`,pct=e=>`${e==null?void 0:e.repository} पर पुश करता है।`,mct=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_ct(e):t==="fa"?fct(e):t==="ar"?dct(e):t==="es"?hct(e):t==="hi"?pct(e):uct(e)}),gct=()=>"Project location is required.",vct=()=>"必须填写项目位置。",bct=()=>"محل پروژه الزامی است.",yct=()=>"موقع المشروع مطلوب.",xct=()=>"La ubicación del proyecto es obligatoria.",wct=()=>"प्रोजेक्ट स्थान ज़रूरी है।",oz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vct():t==="fa"?bct():t==="ar"?yct():t==="es"?xct():t==="hi"?wct():gct()}),kct=()=>"Choose a different destination. The paper repository needs a new or empty folder.",Sct=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",Cct=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",Ect=()=>"اختر وجهة مختلفة. يحتاج مستودع الورقة إلى مجلد جديد أو فارغ.",Nct=()=>"Elige otro destino. El repositorio del paper necesita una carpeta nueva o vacía.",zct=()=>"अलग गंतव्य चुनें। पेपर रिपॉज़िटरी को एक नए या खाली फ़ोल्डर की ज़रूरत है।",cz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sct():t==="fa"?Cct():t==="ar"?Ect():t==="es"?Nct():t==="hi"?zct():kct()}),jct=()=>"A linked public code repository is cloned without credentials.",Tct=()=>"关联的公开代码仓库无需凭据即可克隆。",Act=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",Rct=()=>"يُستنسخ مستودع شيفرة عام مرتبط دون بيانات اعتماد.",Mct=()=>"El repositorio de código público vinculado se clona sin credenciales.",Oct=()=>"एक लिंक की गई सार्वजनिक कोड रिपॉज़िटरी बिना क्रेडेंशियल के क्लोन की जाती है।",Dct=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tct():t==="fa"?Act():t==="ar"?Rct():t==="es"?Mct():t==="hi"?Oct():jct()}),Lct=e=>`Run ${e==null?void 0:e.command} before creating the project.`,Ict=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,$ct=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,Bct=e=>`نفّذ ${e==null?void 0:e.command} قبل إنشاء المشروع.`,Pct=e=>`Ejecuta ${e==null?void 0:e.command} antes de crear el proyecto.`,Fct=e=>`प्रोजेक्ट बनाने से पहले ${e==null?void 0:e.command} चलाएं।`,Hct=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ict(e):t==="fa"?$ct(e):t==="ar"?Bct(e):t==="es"?Pct(e):t==="hi"?Fct(e):Lct(e)}),qct=()=>"Searching alphaXiv…",Uct=()=>"正在搜索 alphaXiv…",Gct=()=>"در حال جست‌وجوی alphaXiv…",Vct=()=>"جارٍ البحث في alphaXiv…",Kct=()=>"Buscando en alphaXiv…",Wct=()=>"alphaXiv खोजा जा रहा है…",Qct=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uct():t==="fa"?Gct():t==="ar"?Vct():t==="es"?Kct():t==="hi"?Wct():qct()}),Xct=()=>"Use folder",Yct=()=>"使用文件夹",Zct=()=>"استفاده از پوشه",Jct=()=>"استخدام المجلد",elt=()=>"Usar carpeta",tlt=()=>"फ़ोल्डर इस्तेमाल करें",nlt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yct():t==="fa"?Zct():t==="ar"?Jct():t==="es"?elt():t==="hi"?tlt():Xct()}),rlt=()=>"Can’t reach OpenResearch. This page is no longer live.",slt=()=>"无法连接 OpenResearch。此页面已不再实时同步。",ilt=()=>"دسترسی به OpenResearch ممکن نیست. این صفحه دیگر همگام نیست.",alt=()=>"تعذّر الاتصال بـ OpenResearch. لم تعد هذه الصفحة تُحدَّث تلقائيًا.",olt=()=>"No se puede conectar con OpenResearch. Esta página ya no se actualiza.",clt=()=>"OpenResearch तक नहीं पहुँच सके। यह पेज अब लाइव नहीं है।",u3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?slt():t==="fa"?ilt():t==="ar"?alt():t==="es"?olt():t==="hi"?clt():rlt()}),llt=()=>"A workspace for your research agents",ult=()=>"面向研究智能体的工作空间",_lt=()=>"فضای کاری برای عامل‌های پژوهشی شما",flt=()=>"مساحة عمل لوكلاء بحثك",dlt=()=>"Un espacio de trabajo para tus agentes de investigación",hlt=()=>"आपके शोध एजेंटों के लिए एक वर्कस्पेस",plt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ult():t==="fa"?_lt():t==="ar"?flt():t==="es"?dlt():t==="hi"?hlt():llt()}),mlt=()=>"Add papers that represent your research interests, including papers by other authors.",glt=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",vlt=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",blt=()=>"أضِف أوراقًا تمثّل اهتماماتك البحثية، بما في ذلك أوراق لمؤلفين آخرين.",ylt=()=>"Añade papers que representen tus intereses de investigación, incluidos papers de otros autores.",xlt=()=>"ऐसे पेपर जोड़ें जो आपकी शोध रुचियों को दर्शाते हों, चाहे वे किसी और लेखक के ही क्यों न हों।",wlt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?glt():t==="fa"?vlt():t==="ar"?blt():t==="es"?ylt():t==="hi"?xlt():mlt()}),klt=()=>"API key",Slt=()=>"API 密钥",Clt=()=>"کلید API",Elt=()=>"مفتاح API",Nlt=()=>"Clave de API",zlt=()=>"API की",Xk=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Slt():t==="fa"?Clt():t==="ar"?Elt():t==="es"?Nlt():t==="hi"?zlt():klt()}),jlt=()=>"AI/ML",Tlt=()=>"人工智能与机器学习",Alt=()=>"هوش مصنوعی و یادگیری ماشین",Rlt=()=>"الذكاء الاصطناعي/تعلّم الآلة",Mlt=()=>"IA/ML",Olt=()=>"AI/ML",Dlt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tlt():t==="fa"?Alt():t==="ar"?Rlt():t==="es"?Mlt():t==="hi"?Olt():jlt()}),Llt=()=>"Biology",Ilt=()=>"生物学",$lt=()=>"زیست‌شناسی",Blt=()=>"الأحياء",Plt=()=>"Biología",Flt=()=>"जीव विज्ञान",Hlt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ilt():t==="fa"?$lt():t==="ar"?Blt():t==="es"?Plt():t==="hi"?Flt():Llt()}),qlt=()=>"Other",Ult=()=>"其他",Glt=()=>"سایر",Vlt=()=>"أخرى",Klt=()=>"Otra",Wlt=()=>"अन्य",Qlt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ult():t==="fa"?Glt():t==="ar"?Vlt():t==="es"?Klt():t==="hi"?Wlt():qlt()}),Xlt=()=>"Physics",Ylt=()=>"物理学",Zlt=()=>"فیزیک",Jlt=()=>"الفيزياء",eut=()=>"Física",tut=()=>"भौतिकी",nut=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ylt():t==="fa"?Zlt():t==="ar"?Jlt():t==="es"?eut():t==="hi"?tut():Xlt()}),rut=()=>"Back",sut=()=>"返回",iut=()=>"بازگشت",aut=()=>"رجوع",out=()=>"Atrás",cut=()=>"वापस",lz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sut():t==="fa"?iut():t==="ar"?aut():t==="es"?out():t==="hi"?cut():rut()}),lut=()=>"Check failed",uut=()=>"检查失败",_ut=()=>"بررسی ناموفق بود",fut=()=>"فشل الفحص",dut=()=>"Error en la comprobación",hut=()=>"जाँच विफल",put=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uut():t==="fa"?_ut():t==="ar"?fut():t==="es"?dut():t==="hi"?hut():lut()}),mut=()=>"Checking",gut=()=>"正在检查",vut=()=>"در حال بررسی",but=()=>"جارٍ الفحص",yut=()=>"Comprobando",xut=()=>"जाँचा जा रहा है",W_=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gut():t==="fa"?vut():t==="ar"?but():t==="es"?yut():t==="hi"?xut():mut()}),wut=()=>"Checking Git…",kut=()=>"正在检查 Git…",Sut=()=>"در حال بررسی Git…",Cut=()=>"جارٍ فحص Git…",Eut=()=>"Comprobando Git…",Nut=()=>"Git जाँचा जा रहा है…",zut=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kut():t==="fa"?Sut():t==="ar"?Cut():t==="es"?Eut():t==="hi"?Nut():wut()}),jut=()=>"Choose a coding agent",Tut=()=>"选择编程智能体",Aut=()=>"یک عامل کدنویسی انتخاب کنید",Rut=()=>"اختر وكيل برمجة",Mut=()=>"Elige un agente de programación",Out=()=>"एक कोडिंग एजेंट चुनें",Dut=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tut():t==="fa"?Aut():t==="ar"?Rut():t==="es"?Mut():t==="hi"?Out():jut()}),Lut=()=>"Choose a coding agent to continue.",Iut=()=>"选择一个编程智能体以继续。",$ut=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",But=()=>"اختر وكيل برمجة للمتابعة.",Put=()=>"Elige un agente de programación para continuar.",Fut=()=>"जारी रखने के लिए एक कोडिंग एजेंट चुनें।",Hut=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Iut():t==="fa"?$ut():t==="ar"?But():t==="es"?Put():t==="hi"?Fut():Lut()}),qut=()=>"Choose another coding agent",Uut=()=>"选择其他编程智能体",Gut=()=>"انتخاب یک عامل برنامه‌نویسی دیگر",Vut=()=>"اختيار وكيل برمجة آخر",Kut=()=>"Elegir otro agente de programación",Wut=()=>"दूसरा कोडिंग एजेंट चुनें",Qut=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uut():t==="fa"?Gut():t==="ar"?Vut():t==="es"?Kut():t==="hi"?Wut():qut()}),Xut=()=>"Choose at least one research area to continue.",Yut=()=>"请至少选择一个研究领域后再继续。",Zut=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",Jut=()=>"اختر مجالًا بحثيًا واحدًا على الأقل للمتابعة.",e_t=()=>"Elige al menos un área de investigación para continuar.",t_t=()=>"जारी रखने के लिए कम से कम एक शोध क्षेत्र चुनें।",n_t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yut():t==="fa"?Zut():t==="ar"?Jut():t==="es"?e_t():t==="hi"?t_t():Xut()}),r_t=()=>"Choose one or more.",s_t=()=>"请选择一项或多项。",i_t=()=>"یک یا چند مورد را انتخاب کنید.",a_t=()=>"اختر واحدًا أو أكثر.",o_t=()=>"Elige una o varias.",c_t=()=>"एक या अधिक चुनें।",l_t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?s_t():t==="fa"?i_t():t==="ar"?a_t():t==="es"?o_t():t==="hi"?c_t():r_t()}),u_t=()=>"Choose your preferred coding agent",__t=()=>"请选择首选编程智能体",f_t=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",d_t=()=>"اختر وكيل البرمجة المفضّل لديك",h_t=()=>"Elige tu agente de programación preferido",p_t=()=>"अपना पसंदीदा कोडिंग एजेंट चुनें",m_t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?__t():t==="fa"?f_t():t==="ar"?d_t():t==="es"?h_t():t==="hi"?p_t():u_t()}),g_t=()=>"Consolidate your research",v_t=()=>"集中管理研究",b_t=()=>"پژوهش خود را یکپارچه کنید",y_t=()=>"وحّد أبحاثك",x_t=()=>"Consolida tu investigación",w_t=()=>"अपने शोध को एक जगह लाएं",k_t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v_t():t==="fa"?b_t():t==="ar"?y_t():t==="es"?x_t():t==="hi"?w_t():g_t()}),S_t=()=>"Continue",C_t=()=>"继续",E_t=()=>"ادامه",N_t=()=>"متابعة",z_t=()=>"Continuar",j_t=()=>"जारी रखें",uz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C_t():t==="fa"?E_t():t==="ar"?N_t():t==="es"?z_t():t==="hi"?j_t():S_t()}),T_t=()=>"Describe your research area to continue.",A_t=()=>"请描述你的研究领域后再继续。",R_t=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",M_t=()=>"صِف مجالك البحثي للمتابعة.",O_t=()=>"Describe tu área de investigación para continuar.",D_t=()=>"जारी रखने के लिए अपना शोध क्षेत्र बताएं।",L_t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?A_t():t==="fa"?R_t():t==="ar"?M_t():t==="es"?O_t():t==="hi"?D_t():T_t()}),I_t=()=>"Detecting Claude Code, Codex, OpenCode, Cursor, Antigravity…",$_t=()=>"正在检测 Claude Code、Codex、OpenCode、Cursor、Antigravity…",B_t=()=>"در حال شناسایی Claude Code، Codex، OpenCode و Cursor و Antigravity…",P_t=()=>"جارٍ اكتشاف Claude Code وCodex وOpenCode وCursor وAntigravity…",F_t=()=>"Detectando Claude Code, Codex, OpenCode, Cursor, Google Antigravity…",H_t=()=>"Claude Code, Codex, OpenCode, Cursor, Google Antigravity पहचाने जा रहे हैं…",q_t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$_t():t==="fa"?B_t():t==="ar"?P_t():t==="es"?F_t():t==="hi"?H_t():I_t()}),U_t=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",G_t=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",V_t=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",K_t=()=>"مثال: أعمل على تعلّم معزّز عالي الكفاءة في العيّنات لِما بعد تدريب نماذج اللغة الكبيرة، مع التركيز على الطرق التي لا تعتمد على نماذج المكافأة.",W_t=()=>"p. ej., trabajo en RL eficiente en muestras para el post-entrenamiento de LLM, centrado en métodos sin modelo de recompensa.",Q_t=()=>"जैसे: मैं LLM पोस्ट-ट्रेनिंग के लिए सैंपल-एफ़िशिएंट RL पर काम करता/करती हूँ, रिवॉर्ड-मॉडल-फ्री तरीकों पर ध्यान केंद्रित करते हुए।",X_t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?G_t():t==="fa"?V_t():t==="ar"?K_t():t==="es"?W_t():t==="hi"?Q_t():U_t()}),Y_t=()=>"Error details",Z_t=()=>"错误详情",J_t=()=>"جزئیات خطا",eft=()=>"تفاصيل الخطأ",tft=()=>"Detalles del error",nft=()=>"त्रुटि विवरण",rft=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Z_t():t==="fa"?J_t():t==="ar"?eft():t==="es"?tft():t==="hi"?nft():Y_t()}),sft=()=>"Everything stays local",ift=()=>"一切都保留在本地",aft=()=>"همه‌چیز محلی می‌ماند",oft=()=>"كل شيء يبقى محليًا",cft=()=>"Todo se queda en local",lft=()=>"सब कुछ लोकल ही रहता है",uft=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ift():t==="fa"?aft():t==="ar"?oft():t==="es"?cft():t==="hi"?lft():sft()}),_ft=()=>"Get started",fft=()=>"开始使用",dft=()=>"شروع",hft=()=>"ابدأ الآن",pft=()=>"Empezar",mft=()=>"शुरू करें",gft=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fft():t==="fa"?dft():t==="ar"?hft():t==="es"?pft():t==="hi"?mft():_ft()}),vft=()=>"Git is required for local experiments. Install Git, then re-check.",bft=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",yft=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",xft=()=>"‏Git مطلوب للتجارب المحلية. ثبّت Git ثم أعد الفحص.",wft=()=>"Git es necesario para los experimentos locales. Instala Git y vuelve a comprobarlo.",kft=()=>"स्थानीय प्रयोगों के लिए Git ज़रूरी है। Git इंस्टॉल करें, फिर फिर से जाँचें।",_z=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bft():t==="fa"?yft():t==="ar"?xft():t==="es"?wft():t==="hi"?kft():vft()}),Sft=()=>"Ground your agents",Cft=()=>"为智能体提供可靠依据",Eft=()=>"عامل‌هایتان را به منابع متصل کنید",Nft=()=>"زوّد وكلاءك بأساس بحثي",zft=()=>"Dale contexto a tus agentes",jft=()=>"अपने एजेंटों को आधार दें",Tft=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cft():t==="fa"?Eft():t==="ar"?Nft():t==="es"?zft():t==="hi"?jft():Sft()}),Aft=()=>"Install broken",Rft=()=>"安装损坏",Mft=()=>"نصب خراب است",Oft=()=>"التثبيت معطوب",Dft=()=>"Instalación dañada",Lft=()=>"इंस्टॉल खराब है",Ift=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rft():t==="fa"?Mft():t==="ar"?Oft():t==="es"?Dft():t==="hi"?Lft():Aft()}),$ft=()=>"Install Git to continue",Bft=()=>"请安装 Git 后再继续",Pft=()=>"برای ادامه Git را نصب کنید",Fft=()=>"ثبّت Git للمتابعة",Hft=()=>"Instala Git para continuar",qft=()=>"जारी रखने के लिए Git इंस्टॉल करें",Uft=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bft():t==="fa"?Pft():t==="ar"?Fft():t==="es"?Hft():t==="hi"?qft():$ft()}),Gft=()=>"Loading account details…",Vft=()=>"正在加载账户信息…",Kft=()=>"در حال بارگذاری اطلاعات حساب…",Wft=()=>"جارٍ تحميل تفاصيل الحساب…",Qft=()=>"Cargando los datos de la cuenta…",Xft=()=>"खाता विवरण लोड हो रहा है…",Yft=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vft():t==="fa"?Kft():t==="ar"?Wft():t==="es"?Qft():t==="hi"?Xft():Gft()}),Zft=()=>"Local Git",Jft=()=>"本地 Git",edt=()=>"Git محلی",tdt=()=>"Git محلي",ndt=()=>"Git local",rdt=()=>"लोकल Git",sdt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jft():t==="fa"?edt():t==="ar"?tdt():t==="es"?ndt():t==="hi"?rdt():Zft()}),idt=()=>"Install needed",adt=()=>"需要安装",odt=()=>"نیاز به نصب",cdt=()=>"التثبيت مطلوب",ldt=()=>"No detectado",udt=()=>"इंस्टॉल ज़रूरी है",fz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?adt():t==="fa"?odt():t==="ar"?cdt():t==="es"?ldt():t==="hi"?udt():idt()}),_dt=()=>"Not found",fdt=()=>"未找到",ddt=()=>"پیدا نشد",hdt=()=>"غير موجود",pdt=()=>"No encontrado",mdt=()=>"नहीं मिला",XD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fdt():t==="fa"?ddt():t==="ar"?hdt():t==="es"?pdt():t==="hi"?mdt():_dt()}),gdt=()=>"Signed out",vdt=()=>"未登录",bdt=()=>"وارد نشده",ydt=()=>"غير مسجل الدخول",xdt=()=>"Sin iniciar sesión",wdt=()=>"साइन आउट",YD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vdt():t==="fa"?bdt():t==="ar"?ydt():t==="es"?xdt():t==="hi"?wdt():gdt()}),kdt=()=>"OpenResearch uses a coding agent already installed on this machine.",Sdt=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",Cdt=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",Edt=()=>"يستخدم OpenResearch وكيل برمجة مثبّتًا مسبقًا على هذا الجهاز.",Ndt=()=>"OpenResearch usa un agente de programación que ya esté instalado en este equipo.",zdt=()=>"OpenResearch इस मशीन पर पहले से इंस्टॉल किसी कोडिंग एजेंट का उपयोग करता है।",jdt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sdt():t==="fa"?Cdt():t==="ar"?Edt():t==="es"?Ndt():t==="hi"?zdt():kdt()}),Tdt=()=>"Couldn’t verify OpenCode is ready. Retry to check its installation and models.",Adt=()=>"无法确认 OpenCode 已就绪。请重试以检查安装和模型。",Rdt=()=>"آماده بودن OpenCode تأیید نشد. برای بررسی نصب و مدل‌ها دوباره تلاش کنید.",Mdt=()=>"تعذّر التحقق من جاهزية OpenCode. أعد المحاولة للتحقق من التثبيت والنماذج.",Odt=()=>"No se pudo verificar que OpenCode esté listo. Vuelve a intentarlo para comprobar su instalación y sus modelos.",Ddt=()=>"यह सत्यापित नहीं हो सका कि OpenCode तैयार है। इसके इंस्टॉलेशन और मॉडल जाँचने के लिए फिर से कोशिश करें।",Ldt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Adt():t==="fa"?Rdt():t==="ar"?Mdt():t==="es"?Odt():t==="hi"?Ddt():Tdt()}),Idt=()=>"Other research area",$dt=()=>"其他研究领域",Bdt=()=>"حوزهٔ پژوهشی دیگر",Pdt=()=>"مجال بحثي آخر",Fdt=()=>"Otra área de investigación",Hdt=()=>"अन्य शोध क्षेत्र",qdt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$dt():t==="fa"?Bdt():t==="ar"?Pdt():t==="es"?Fdt():t==="hi"?Hdt():Idt()}),Udt=()=>"Re-check",Gdt=()=>"重新检查",Vdt=()=>"بررسی دوباره",Kdt=()=>"إعادة الفحص",Wdt=()=>"Volver a comprobar",Qdt=()=>"फिर से जाँचें",Nv=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gdt():t==="fa"?Vdt():t==="ar"?Kdt():t==="es"?Wdt():t==="hi"?Qdt():Udt()}),Xdt=()=>"Ready",Ydt=()=>"已就绪",Zdt=()=>"آماده",Jdt=()=>"جاهز",eht=()=>"Listo",tht=()=>"तैयार",Yk=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ydt():t==="fa"?Zdt():t==="ar"?Jdt():t==="es"?eht():t==="hi"?tht():Xdt()}),nht=()=>"Re-check Git before continuing",rht=()=>"请重新检查 Git 后再继续",sht=()=>"پیش از ادامه Git را دوباره بررسی کنید",iht=()=>"أعد فحص Git قبل المتابعة",aht=()=>"Vuelve a comprobar Git antes de continuar",oht=()=>"जारी रखने से पहले Git फिर से जाँचें",cht=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rht():t==="fa"?sht():t==="ar"?iht():t==="es"?aht():t==="hi"?oht():nht()}),lht=()=>"Representative papers",uht=()=>"代表性论文",_ht=()=>"مقاله‌های شاخص",fht=()=>"أوراق تمثّل اهتماماتك البحثية",dht=()=>"Papers representativos",hht=()=>"प्रतिनिधि पेपर",pht=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uht():t==="fa"?_ht():t==="ar"?fht():t==="es"?dht():t==="hi"?hht():lht()}),mht=()=>"Research background",ght=()=>"研究背景",vht=()=>"پیشینهٔ پژوهشی",bht=()=>"الخلفية البحثية",yht=()=>"Trayectoria de investigación",xht=()=>"शोध पृष्ठभूमि",wht=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ght():t==="fa"?vht():t==="ar"?bht():t==="es"?yht():t==="hi"?xht():mht()}),kht=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",Sht=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",Cht=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",Eht=()=>"تعذّر الوصول إلى orx. تأكد من أنه لا يزال يعمل، ثم أعد الفحص.",Nht=()=>"No se pudo conectar con orx. Comprueba que sigue en ejecución y vuelve a comprobarlo.",zht=()=>"orx तक नहीं पहुँच सके। जाँचें कि यह अभी भी चल रहा है, फिर फिर से जाँचें।",ew=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sht():t==="fa"?Cht():t==="ar"?Eht():t==="es"?Nht():t==="hi"?zht():kht()}),jht=()=>"Search alphaXiv by title to link a paper…",Tht=()=>"按标题搜索 alphaXiv 以关联论文…",Aht=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",Rht=()=>"ابحث في alphaXiv بالعنوان لربط ورقة…",Mht=()=>"Busca en alphaXiv por título para vincular un paper…",Oht=()=>"एक पेपर लिंक करने के लिए शीर्षक से alphaXiv खोजें…",Dht=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tht():t==="fa"?Aht():t==="ar"?Rht():t==="es"?Mht():t==="hi"?Oht():jht()}),Lht=()=>"Searching alphaXiv…",Iht=()=>"正在搜索 alphaXiv…",$ht=()=>"در حال جست‌وجوی alphaXiv…",Bht=()=>"جارٍ البحث في alphaXiv…",Pht=()=>"Buscando en alphaXiv…",Fht=()=>"alphaXiv खोजा जा रहा है…",Hht=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Iht():t==="fa"?$ht():t==="ar"?Bht():t==="es"?Pht():t==="hi"?Fht():Lht()}),qht=()=>"Selected",Uht=()=>"已选择",Ght=()=>"انتخاب‌شده",Vht=()=>"محدد",Kht=()=>"Seleccionado",Wht=()=>"चयनित",Qht=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uht():t==="fa"?Ght():t==="ar"?Vht():t==="es"?Kht():t==="hi"?Wht():qht()}),Xht=()=>"Local model unavailable",Yht=()=>"本地模型不可用",Zht=()=>"مدل محلی در دسترس نیست",Jht=()=>"النموذج المحلي غير متاح",ept=()=>"Modelo local no disponible",tpt=()=>"लोकल मॉडल उपलब्ध नहीं",ZD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yht():t==="fa"?Zht():t==="ar"?Jht():t==="es"?ept():t==="hi"?tpt():Xht()}),npt=()=>"Setting things up…",rpt=()=>"正在设置…",spt=()=>"در حال راه‌اندازی…",ipt=()=>"جارٍ التهيئة…",apt=()=>"Preparando todo…",opt=()=>"सेट अप किया जा रहा है…",cpt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rpt():t==="fa"?spt():t==="ar"?ipt():t==="es"?apt():t==="hi"?opt():npt()}),lpt=()=>"Connect a local model or sign in to a coding agent to continue",upt=()=>"连接本地模型或登录编码智能体以继续",_pt=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل کدنویسی وارد شوید",fpt=()=>"اربط نموذجًا محليًا أو سجّل الدخول إلى وكيل برمجة للمتابعة",dpt=()=>"Conecta un modelo local o inicia sesión en un agente de programación para continuar",hpt=()=>"जारी रखने के लिए एक लोकल मॉडल कनेक्ट करें या किसी कोडिंग एजेंट में साइन इन करें",ppt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?upt():t==="fa"?_pt():t==="ar"?fpt():t==="es"?dpt():t==="hi"?hpt():lpt()}),mpt=()=>"Connect a local model or sign in to an agent to continue.",gpt=()=>"连接本地模型或登录一个智能体以继续。",vpt=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل وارد شوید.",bpt=()=>"اربط نموذجًا محليًا أو سجّل الدخول إلى وكيل للمتابعة.",ypt=()=>"Conecta un modelo local o inicia sesión en un agente para continuar.",xpt=()=>"जारी रखने के लिए एक लोकल मॉडल कनेक्ट करें या किसी एजेंट में साइन इन करें।",wpt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gpt():t==="fa"?vpt():t==="ar"?bpt():t==="es"?ypt():t==="hi"?xpt():mpt()}),kpt=()=>"Signed in",Spt=()=>"已登录",Cpt=()=>"وارد شده",Ept=()=>"تم تسجيل الدخول",Npt=()=>"Sesión iniciada",zpt=()=>"साइन इन",jpt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Spt():t==="fa"?Cpt():t==="ar"?Ept():t==="es"?Npt():t==="hi"?zpt():kpt()}),Tpt=()=>"Connected to alphaXiv, bioRxiv, OpenAlex, and PubMed to ground your agents in the latest research.",Apt=()=>"已连接 alphaXiv、bioRxiv、OpenAlex 和 PubMed,让智能体以最新研究为依据。",Rpt=()=>"به alphaXiv، bioRxiv، OpenAlex و PubMed متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",Mpt=()=>"متصل بـ alphaXiv وbioRxiv وOpenAlex وPubMed ليستند وكلاؤك إلى أحدث الأبحاث.",Opt=()=>"Conectado a alphaXiv, bioRxiv, OpenAlex y PubMed para que tus agentes trabajen con la investigación más reciente.",Dpt=()=>"आपके एजेंटों को नवीनतम शोध पर आधारित रखने के लिए alphaXiv, bioRxiv, OpenAlex और PubMed से कनेक्ट किया गया।",Lpt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Apt():t==="fa"?Rpt():t==="ar"?Mpt():t==="es"?Opt():t==="hi"?Dpt():Tpt()}),Ipt=()=>"· Step 1 of 2",$pt=()=>"· 第 1 步,共 2 步",Bpt=()=>"· مرحلهٔ ۱ از ۲",Ppt=()=>"· الخطوة 1 من 2",Fpt=()=>"· Paso 1 de 2",Hpt=()=>"· चरण 1 / 2",qpt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$pt():t==="fa"?Bpt():t==="ar"?Ppt():t==="es"?Fpt():t==="hi"?Hpt():Ipt()}),Upt=()=>"· Step 2 of 2",Gpt=()=>"· 第 2 步,共 2 步",Vpt=()=>"· مرحلهٔ ۲ از ۲",Kpt=()=>"· الخطوة 2 من 2",Wpt=()=>"· Paso 2 de 2",Qpt=()=>"· चरण 2 / 2",Xpt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gpt():t==="fa"?Vpt():t==="ar"?Kpt():t==="es"?Wpt():t==="hi"?Qpt():Upt()}),Ypt=()=>"Tell us about your research",Zpt=()=>"介绍一下你的研究",Jpt=()=>"از پژوهش خود بگویید",e0t=()=>"أخبرنا عن بحثك",t0t=()=>"Cuéntanos sobre tu investigación",n0t=()=>"हमें अपने शोध के बारे में बताएं",r0t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zpt():t==="fa"?Jpt():t==="ar"?e0t():t==="es"?t0t():t==="hi"?n0t():Ypt()}),s0t=()=>"Tell us your other research area",i0t=()=>"告诉我们你的其他研究领域",a0t=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",o0t=()=>"أخبرنا عن مجالك البحثي الآخر",c0t=()=>"Cuéntanos cuál es tu otra área de investigación",l0t=()=>"हमें अपना अन्य शोध क्षेत्र बताएं",u0t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?i0t():t==="fa"?a0t():t==="ar"?o0t():t==="es"?c0t():t==="hi"?l0t():s0t()}),_0t=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",f0t=()=>"在一处跟踪实验、产物、算力、技能和代码。",d0t=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",h0t=()=>"تتبّع التجارب والمُخرَجات والحوسبة والمهارات والشيفرة في مكان واحد.",p0t=()=>"Gestiona experimentos, artefactos, cómputo, skills y código en un solo lugar.",m0t=()=>"प्रयोग, आर्टिफ़ैक्ट, कंप्यूट, स्किल और कोड — सब एक ही जगह ट्रैक करें।",g0t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f0t():t==="fa"?d0t():t==="ar"?h0t():t==="es"?p0t():t==="hi"?m0t():_0t()}),v0t=()=>"Unable to verify",b0t=()=>"无法验证",y0t=()=>"تأیید ممکن نیست",x0t=()=>"تعذّر التحقق",w0t=()=>"No se pudo verificar",k0t=()=>"सत्यापित नहीं हो सका",S0t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b0t():t==="fa"?y0t():t==="ar"?x0t():t==="es"?w0t():t==="hi"?k0t():v0t()}),C0t=()=>"Update required",E0t=()=>"需要更新",N0t=()=>"نیازمند به‌روزرسانی",z0t=()=>"مطلوب تحديث",j0t=()=>"Actualización necesaria",T0t=()=>"अपडेट ज़रूरी है",A0t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?E0t():t==="fa"?N0t():t==="ar"?z0t():t==="es"?j0t():t==="hi"?T0t():C0t()}),R0t=()=>"Waiting for the Git check",M0t=()=>"正在等待 Git 检查",O0t=()=>"در انتظار بررسی Git",D0t=()=>"في انتظار فحص Git",L0t=()=>"Esperando la comprobación de Git",I0t=()=>"Git जाँच का इंतज़ार है",$0t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M0t():t==="fa"?O0t():t==="ar"?D0t():t==="es"?L0t():t==="hi"?I0t():R0t()}),B0t=()=>"Waiting for the local tool checks",P0t=()=>"正在等待本地工具检查",F0t=()=>"در انتظار بررسی ابزارهای محلی",H0t=()=>"في انتظار فحوص الأدوات المحلية",q0t=()=>"Esperando las comprobaciones de las herramientas locales",U0t=()=>"लोकल टूल जाँच का इंतज़ार है",G0t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P0t():t==="fa"?F0t():t==="ar"?H0t():t==="es"?q0t():t==="hi"?U0t():B0t()}),V0t=()=>"What areas are you interested in?",K0t=()=>"你对哪些领域感兴趣?",W0t=()=>"به چه حوزه‌هایی علاقه دارید؟",Q0t=()=>"ما المجالات التي تهتم بها؟",X0t=()=>"¿Qué áreas te interesan?",Y0t=()=>"आपकी रुचि किन क्षेत्रों में है?",Z0t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K0t():t==="fa"?W0t():t==="ar"?Q0t():t==="es"?X0t():t==="hi"?Y0t():V0t()}),J0t=()=>"Your code, data, and experiment history stay on your machine.",emt=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",tmt=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",nmt=()=>"تبقى شيفرتك وبياناتك وسجل تجاربك على جهازك.",rmt=()=>"Tu código, tus datos y tu historial de experimentos se quedan en tu equipo.",smt=()=>"आपका कोड, डेटा और प्रयोग इतिहास आपकी मशीन पर ही रहता है।",imt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?emt():t==="fa"?tmt():t==="ar"?nmt():t==="es"?rmt():t==="hi"?smt():J0t()}),amt=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",omt=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",cmt=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",lmt=()=>"لم يعد الوكيل الذي اخترته جاهزًا. ارجع إلى الخطوة 1 واختر غيره.",umt=()=>"El agente que elegiste ya no está listo. Vuelve al paso 1 y elige otro.",_mt=()=>"आपका चुना हुआ एजेंट अब तैयार नहीं है। चरण 1 पर वापस जाएं और दूसरा चुनें।",fmt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?omt():t==="fa"?cmt():t==="ar"?lmt():t==="es"?umt():t==="hi"?_mt():amt()}),dmt=()=>"Add cookie",hmt=()=>"添加 cookie",pmt=()=>"افزودن کوکی",mmt=()=>"إضافة ملف تعريف الارتباط",gmt=()=>"Añadir cookie",vmt=()=>"कुकी जोड़ें",bmt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hmt():t==="fa"?pmt():t==="ar"?mmt():t==="es"?gmt():t==="hi"?vmt():dmt()}),ymt=()=>"Changed here and on Overleaf — choose which copy to keep",xmt=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",wmt=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",kmt=()=>"تغيّر هنا وعلى Overleaf — اختر أي نسخة تحتفظ بها",Smt=()=>"Cambió aquí y en Overleaf — elige qué copia conservar",Cmt=()=>"यहाँ और Overleaf दोनों जगह बदला गया — चुनें कि कौन सी कॉपी रखनी है",Emt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xmt():t==="fa"?wmt():t==="ar"?kmt():t==="es"?Smt():t==="hi"?Cmt():ymt()}),Nmt=()=>"Create a token ↗",zmt=()=>"创建令牌 ↗",jmt=()=>"ساخت توکن ↗",Tmt=()=>"إنشاء رمز ↗",Amt=()=>"Crear un token ↗",Rmt=()=>"एक टोकन बनाएं ↗",Mmt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zmt():t==="fa"?jmt():t==="ar"?Tmt():t==="es"?Amt():t==="hi"?Rmt():Nmt()}),Omt=()=>"Overleaf Git token",Dmt=()=>"Overleaf Git 令牌",Lmt=()=>"توکن Git در Overleaf",Imt=()=>"رمز Git لـ Overleaf",$mt=()=>"Token de Git de Overleaf",Bmt=()=>"Overleaf Git टोकन",dz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dmt():t==="fa"?Lmt():t==="ar"?Imt():t==="es"?$mt():t==="hi"?Bmt():Omt()}),Pmt=()=>"Follow Overleaf as people type by adding your Overleaf session cookie.",Fmt=()=>"添加 Overleaf 会话 cookie,即可在他人输入时实时跟随 Overleaf。",Hmt=()=>"با افزودن کوکی نشست Overleaf، هنگام تایپ دیگران Overleaf را زنده دنبال کنید.",qmt=()=>"تابِع Overleaf أثناء كتابة الآخرين بإضافة ملف تعريف ارتباط جلسة Overleaf.",Umt=()=>"Sigue los cambios de Overleaf mientras se escribe añadiendo tu cookie de sesión de Overleaf.",Gmt=()=>"अपनी Overleaf सेशन कुकी जोड़कर लोगों के टाइप करते ही Overleaf को फ़ॉलो करें।",Vmt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fmt():t==="fa"?Hmt():t==="ar"?qmt():t==="es"?Umt():t==="hi"?Gmt():Pmt()}),Kmt=()=>"Import from browser",Wmt=()=>"从浏览器导入",Qmt=()=>"وارد کردن از مرورگر",Xmt=()=>"الاستيراد من المتصفح",Ymt=()=>"Importar desde el navegador",Zmt=()=>"ब्राउज़र से इंपोर्ट करें",Jmt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wmt():t==="fa"?Qmt():t==="ar"?Xmt():t==="es"?Ymt():t==="hi"?Zmt():Kmt()}),egt=()=>"In step with Overleaf",tgt=()=>"已与 Overleaf 同步",ngt=()=>"با Overleaf همگام است",rgt=()=>"متزامن مع Overleaf",sgt=()=>"Sincronizado con Overleaf",igt=()=>"Overleaf के साथ मेल में",JD=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tgt():t==="fa"?ngt():t==="ar"?rgt():t==="es"?sgt():t==="hi"?igt():egt()}),agt=()=>"The last sync did not finish.",ogt=()=>"上次同步未完成。",cgt=()=>"آخرین همگام‌سازی کامل نشد.",lgt=()=>"لم تكتمل آخر مزامنة.",ugt=()=>"La última sincronización no terminó.",_gt=()=>"पिछला सिंक पूरा नहीं हुआ।",fgt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ogt():t==="fa"?cgt():t==="ar"?lgt():t==="es"?ugt():t==="hi"?_gt():agt()}),dgt=()=>"Link and sync",hgt=()=>"关联并同步",pgt=()=>"پیوند و همگام‌سازی",mgt=()=>"الربط والمزامنة",ggt=()=>"Vincular y sincronizar",vgt=()=>"लिंक करें और सिंक करें",bgt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hgt():t==="fa"?pgt():t==="ar"?mgt():t==="es"?ggt():t==="hi"?vgt():dgt()}),ygt=()=>"Connecting to Overleaf…",xgt=()=>"正在连接 Overleaf…",wgt=()=>"در حال اتصال به Overleaf…",kgt=()=>"جارٍ الاتصال بـ Overleaf…",Sgt=()=>"Conectando con Overleaf…",Cgt=()=>"Overleaf से कनेक्ट हो रहा है…",Egt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xgt():t==="fa"?wgt():t==="ar"?kgt():t==="es"?Sgt():t==="hi"?Cgt():ygt()}),Ngt=()=>"Edits are live on Overleaf",zgt=()=>"编辑已在 Overleaf 实时同步",jgt=()=>"ویرایش‌ها روی Overleaf زنده‌اند",Tgt=()=>"تظهر التعديلات فورًا على Overleaf",Agt=()=>"Los cambios se sincronizan en directo con Overleaf",Rgt=()=>"बदलाव Overleaf पर लाइव हैं",Mgt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zgt():t==="fa"?jgt():t==="ar"?Tgt():t==="es"?Agt():t==="hi"?Rgt():Ngt()}),Ogt=()=>"Retry",Dgt=()=>"重试",Lgt=()=>"تلاش دوباره",Igt=()=>"إعادة المحاولة",$gt=()=>"Reintentar",Bgt=()=>"फिर से कोशिश करें",Pgt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dgt():t==="fa"?Lgt():t==="ar"?Igt():t==="es"?$gt():t==="hi"?Bgt():Ogt()}),Fgt=()=>"Live sync stopped.",Hgt=()=>"实时同步已停止。",qgt=()=>"همگام‌سازی زنده متوقف شد.",Ugt=()=>"توقفت المزامنة المباشرة.",Ggt=()=>"Sincronización en directo detenida.",Vgt=()=>"लाइव सिंक रुक गया।",Kgt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hgt():t==="fa"?qgt():t==="ar"?Ugt():t==="es"?Ggt():t==="hi"?Vgt():Fgt()}),Wgt=()=>"Live sync starts once the paper is in step with Overleaf.",Qgt=()=>"论文与 Overleaf 同步后,实时同步即会开始。",Xgt=()=>"همگام‌سازی زنده پس از هم‌گام شدن مقاله با Overleaf آغاز می‌شود.",Ygt=()=>"تبدأ المزامنة المباشرة بمجرد أن تتزامن الورقة مع Overleaf.",Zgt=()=>"La sincronización en directo empieza cuando el paper esté sincronizado con Overleaf.",Jgt=()=>"पेपर Overleaf के साथ मेल में आते ही लाइव सिंक शुरू होगा।",e1t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qgt():t==="fa"?Xgt():t==="ar"?Ygt():t==="es"?Zgt():t==="hi"?Jgt():Wgt()}),t1t=()=>"My projects ↗",n1t=()=>"我的项目 ↗",r1t=()=>"پروژه‌های من ↗",s1t=()=>"مشاريعي ↗",i1t=()=>"Mis proyectos ↗",a1t=()=>"मेरे प्रोजेक्ट ↗",hz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n1t():t==="fa"?r1t():t==="ar"?s1t():t==="es"?i1t():t==="hi"?a1t():t1t()}),o1t=()=>"Nothing could be synced.",c1t=()=>"没有内容可以同步。",l1t=()=>"هیچ موردی قابل همگام‌سازی نبود.",u1t=()=>"تعذّرت مزامنة أي شيء.",_1t=()=>"No se pudo sincronizar nada.",f1t=()=>"कुछ भी सिंक नहीं हो सका।",d1t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?c1t():t==="fa"?l1t():t==="ar"?u1t():t==="es"?_1t():t==="hi"?f1t():o1t()}),h1t=()=>"Open Overleaf ↗",p1t=()=>"打开 Overleaf ↗",m1t=()=>"باز کردن Overleaf ↗",g1t=()=>"فتح Overleaf ↗",v1t=()=>"Abrir Overleaf ↗",b1t=()=>"Overleaf खोलें ↗",y1t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?p1t():t==="fa"?m1t():t==="ar"?g1t():t==="es"?v1t():t==="hi"?b1t():h1t()}),x1t=()=>"Cancel",w1t=()=>"取消",k1t=()=>"لغو",S1t=()=>"إلغاء",C1t=()=>"Cancelar",E1t=()=>"रद्द करें",eL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?w1t():t==="fa"?k1t():t==="ar"?S1t():t==="es"?C1t():t==="hi"?E1t():x1t()}),N1t=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",z1t=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",j1t=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",T1t=()=>"تغيّر هنا وعلى Overleaf. كلا النسختين لم تُمسّا — اختر أيّهما تحتفظ به.",A1t=()=>"cambió aquí y en Overleaf. No se ha tocado ninguna de las dos copias — elige cuál conservar.",R1t=()=>"यहाँ और Overleaf दोनों जगह बदला गया। दोनों कॉपी सुरक्षित हैं — चुनें कि कौन सी रखनी है।",M1t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z1t():t==="fa"?j1t():t==="ar"?T1t():t==="es"?A1t():t==="hi"?R1t():N1t()}),O1t=()=>"Keep this copy",D1t=()=>"保留此副本",L1t=()=>"نگه داشتن این نسخه",I1t=()=>"الاحتفاظ بهذه النسخة",$1t=()=>"Conservar esta copia",B1t=()=>"यह कॉपी रखें",P1t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D1t():t==="fa"?L1t():t==="ar"?I1t():t==="es"?$1t():t==="hi"?B1t():O1t()}),F1t=()=>"Open in Overleaf",H1t=()=>"在 Overleaf 中打开",q1t=()=>"باز کردن در Overleaf",U1t=()=>"فتح في Overleaf",G1t=()=>"Abrir en Overleaf",V1t=()=>"Overleaf में खोलें",K1t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H1t():t==="fa"?q1t():t==="ar"?U1t():t==="es"?G1t():t==="hi"?V1t():F1t()}),W1t=()=>"Replace the Overleaf token",Q1t=()=>"替换 Overleaf 令牌",X1t=()=>"جایگزینی توکن Overleaf",Y1t=()=>"استبدال رمز Overleaf",Z1t=()=>"Reemplazar el token de Overleaf",J1t=()=>"Overleaf टोकन बदलें",pz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Q1t():t==="fa"?X1t():t==="ar"?Y1t():t==="es"?Z1t():t==="hi"?J1t():W1t()}),evt=()=>"Sync files",tvt=()=>"同步文件",nvt=()=>"همگام‌سازی فایل‌ها",rvt=()=>"مزامنة الملفات",svt=()=>"Sincronizar archivos",ivt=()=>"फ़ाइलें सिंक करें",avt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tvt():t==="fa"?nvt():t==="ar"?rvt():t==="es"?svt():t==="hi"?ivt():evt()}),ovt=()=>"Unlink",cvt=()=>"取消关联",lvt=()=>"قطع پیوند",uvt=()=>"إلغاء الربط",_vt=()=>"Desvincular",fvt=()=>"लिंक हटाएं",dvt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cvt():t==="fa"?lvt():t==="ar"?uvt():t==="es"?_vt():t==="hi"?fvt():ovt()}),hvt=()=>"Upload a copy as a new project ↗",pvt=()=>"上传副本作为新项目 ↗",mvt=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",gvt=()=>"رفع نسخة كمشروع جديد ↗",vvt=()=>"Subir una copia como proyecto nuevo ↗",bvt=()=>"नए प्रोजेक्ट के रूप में एक कॉपी अपलोड करें ↗",tL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pvt():t==="fa"?mvt():t==="ar"?gvt():t==="es"?vvt():t==="hi"?bvt():hvt()}),yvt=()=>"Use Overleaf's",xvt=()=>"使用 Overleaf 的副本",wvt=()=>"استفاده از نسخهٔ Overleaf",kvt=()=>"استخدام نسخة Overleaf",Svt=()=>"Usar la de Overleaf",Cvt=()=>"Overleaf का इस्तेमाल करें",Evt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xvt():t==="fa"?wvt():t==="ar"?kvt():t==="es"?Svt():t==="hi"?Cvt():yvt()}),Nvt=()=>"This paper stays in step with Overleaf.",zvt=()=>"此论文将与 Overleaf 保持同步。",jvt=()=>"این مقاله با Overleaf همگام می‌ماند.",Tvt=()=>"تبقى هذه الورقة متزامنة مع Overleaf.",Avt=()=>"Este paper se mantiene sincronizado con Overleaf.",Rvt=()=>"यह पेपर Overleaf के साथ मेल में रहता है।",Mvt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zvt():t==="fa"?jvt():t==="ar"?Tvt():t==="es"?Avt():t==="hi"?Rvt():Nvt()}),Ovt=()=>"Paste it instead",Dvt=()=>"改为粘贴",Lvt=()=>"به‌جایش بچسبانید",Ivt=()=>"الصقه بدلًا من ذلك",$vt=()=>"Pegarla manualmente",Bvt=()=>"इसके बजाय पेस्ट करें",Pvt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dvt():t==="fa"?Lvt():t==="ar"?Ivt():t==="es"?$vt():t==="hi"?Bvt():Ovt()}),Fvt=e=>`Pulled ${e==null?void 0:e.paths}.`,Hvt=e=>`已拉取 ${e==null?void 0:e.paths}。`,qvt=e=>`${e==null?void 0:e.paths} دریافت شد.`,Uvt=e=>`سُحب ${e==null?void 0:e.paths}.`,Gvt=e=>`Descargado: ${e==null?void 0:e.paths}.`,Vvt=e=>`${e==null?void 0:e.paths} पुल किया।`,Kvt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Hvt(e):t==="fa"?qvt(e):t==="ar"?Uvt(e):t==="es"?Gvt(e):t==="hi"?Vvt(e):Fvt(e)}),Wvt=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,Qvt=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,Xvt=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,Yvt=e=>`سُحب ${e==null?void 0:e.pulled}؛ ورُفع ${e==null?void 0:e.pushed}.`,Zvt=e=>`Descargado: ${e==null?void 0:e.pulled}; subido: ${e==null?void 0:e.pushed}.`,Jvt=e=>`${e==null?void 0:e.pulled} पुल किया; ${e==null?void 0:e.pushed} पुश किया।`,ebt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Qvt(e):t==="fa"?Xvt(e):t==="ar"?Yvt(e):t==="es"?Zvt(e):t==="hi"?Jvt(e):Wvt(e)}),tbt=e=>`Pushed ${e==null?void 0:e.paths}.`,nbt=e=>`已推送 ${e==null?void 0:e.paths}。`,rbt=e=>`${e==null?void 0:e.paths} ارسال شد.`,sbt=e=>`رُفع ${e==null?void 0:e.paths}.`,ibt=e=>`Subido: ${e==null?void 0:e.paths}.`,abt=e=>`${e==null?void 0:e.paths} पुश किया।`,obt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nbt(e):t==="fa"?rbt(e):t==="ar"?sbt(e):t==="es"?ibt(e):t==="hi"?abt(e):tbt(e)}),cbt=()=>"Add a fresh Overleaf session cookie to start following again.",lbt=()=>"添加新的 Overleaf 会话 cookie 即可继续实时跟随。",ubt=()=>"برای ادامهٔ دنبال کردن، کوکی نشست تازه‌ای از Overleaf اضافه کنید.",_bt=()=>"أضِف ملف تعريف ارتباط جلسة Overleaf جديدًا لبدء المتابعة مجددًا.",fbt=()=>"Añade una nueva cookie de sesión de Overleaf para volver a seguir los cambios.",dbt=()=>"फिर से फ़ॉलो करना शुरू करने के लिए एक नई Overleaf सेशन कुकी जोड़ें।",hbt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lbt():t==="fa"?ubt():t==="ar"?_bt():t==="es"?fbt():t==="hi"?dbt():cbt()}),pbt=()=>"Save the file first",mbt=()=>"请先保存文件",gbt=()=>"ابتدا فایل را ذخیره کنید",vbt=()=>"احفظ الملف أولًا",bbt=()=>"Guarda el archivo primero",ybt=()=>"पहले फ़ाइल सेव करें",xbt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mbt():t==="fa"?gbt():t==="ar"?vbt():t==="es"?bbt():t==="hi"?ybt():pbt()}),wbt=()=>"Save this file to sync it with Overleaf",kbt=()=>"保存此文件以与 Overleaf 同步",Sbt=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",Cbt=()=>"احفظ هذا الملف لمزامنته مع Overleaf",Ebt=()=>"Guarda este archivo para sincronizarlo con Overleaf",Nbt=()=>"Overleaf के साथ सिंक करने के लिए इस फ़ाइल को सेव करें",nL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kbt():t==="fa"?Sbt():t==="ar"?Cbt():t==="es"?Ebt():t==="hi"?Nbt():wbt()}),zbt=()=>"Save token",jbt=()=>"保存令牌",Tbt=()=>"ذخیرهٔ توکن",Abt=()=>"حفظ الرمز",Rbt=()=>"Guardar token",Mbt=()=>"टोकन सेव करें",Obt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jbt():t==="fa"?Tbt():t==="ar"?Abt():t==="es"?Rbt():t==="hi"?Mbt():zbt()}),Dbt=()=>"Send this paper to Overleaf",Lbt=()=>"将此论文发送到 Overleaf",Ibt=()=>"ارسال مقاله به Overleaf",$bt=()=>"أرسل هذه الورقة إلى Overleaf",Bbt=()=>"Enviar este paper a Overleaf",Pbt=()=>"यह पेपर Overleaf को भेजें",Fbt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lbt():t==="fa"?Ibt():t==="ar"?$bt():t==="es"?Bbt():t==="hi"?Pbt():Dbt()}),Hbt=()=>"Overleaf session cookie",qbt=()=>"Overleaf 会话 cookie",Ubt=()=>"کوکی نشست Overleaf",Gbt=()=>"ملف تعريف ارتباط جلسة Overleaf",Vbt=()=>"Cookie de sesión de Overleaf",Kbt=()=>"Overleaf सेशन कुकी",_3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qbt():t==="fa"?Ubt():t==="ar"?Gbt():t==="es"?Vbt():t==="hi"?Kbt():Hbt()}),Wbt=()=>"To follow Overleaf as people type, paste your Overleaf session cookie: in a browser signed in to Overleaf, open the developer tools, find the overleaf_session2 cookie, and copy its value. It stays on this machine.",Qbt=()=>"要在他人输入时实时跟随 Overleaf,请粘贴你的 Overleaf 会话 cookie:在已登录 Overleaf 的浏览器中打开开发者工具,找到 overleaf_session2 cookie 并复制其值。它只保存在这台机器上。",Xbt=()=>"برای دنبال کردن Overleaf هنگام تایپ دیگران، کوکی نشست Overleaf خود را بچسبانید: در مرورگری که به Overleaf وارد شده‌اید، ابزارهای توسعه‌دهنده را باز کنید، کوکی overleaf_session2 را پیدا کنید و مقدار آن را کپی کنید. این مقدار روی همین دستگاه می‌ماند.",Ybt=()=>"لمتابعة Overleaf أثناء كتابة الآخرين، الصق ملف تعريف ارتباط جلسة Overleaf: في متصفح مسجّل الدخول إلى Overleaf، افتح أدوات المطوّر، وابحث عن ملف تعريف الارتباط overleaf_session2، وانسخ قيمته. يبقى على هذا الجهاز.",Zbt=()=>"Para seguir los cambios de Overleaf mientras se escribe, pega tu cookie de sesión de Overleaf: en un navegador con la sesión de Overleaf iniciada, abre las herramientas de desarrollo, busca la cookie overleaf_session2 y copia su valor. Se queda en este equipo.",Jbt=()=>"लोगों के टाइप करते ही Overleaf को फ़ॉलो करने के लिए, अपनी Overleaf सेशन कुकी पेस्ट करें: Overleaf में साइन इन ब्राउज़र में, डेवलपर टूल खोलें, overleaf_session2 कुकी खोजें, और उसकी वैल्यू कॉपी करें। यह इसी मशीन पर रहती है।",eyt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qbt():t==="fa"?Xbt():t==="ar"?Ybt():t==="es"?Zbt():t==="hi"?Jbt():Wbt()}),tyt=()=>"Overleaf sync failed",nyt=()=>"Overleaf 同步失败",ryt=()=>"همگام‌سازی با Overleaf ناموفق بود",syt=()=>"فشلت مزامنة Overleaf",iyt=()=>"Error al sincronizar con Overleaf",ayt=()=>"Overleaf सिंक विफल",f3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nyt():t==="fa"?ryt():t==="ar"?syt():t==="es"?iyt():t==="hi"?ayt():tyt()}),oyt=()=>"Text syncs live. This moves figures and other files, and settles conflicts.",cyt=()=>"文本会实时同步。此操作用于同步图片等其他文件,并解决冲突。",lyt=()=>"متن زنده همگام می‌شود. این کار تصویرها و دیگر فایل‌ها را جابه‌جا می‌کند و تعارض‌ها را حل می‌کند.",uyt=()=>"يتزامن النص مباشرةً. ينقل هذا الأشكال والملفات الأخرى، ويحسم التعارضات.",_yt=()=>"El texto se sincroniza en directo. Esto mueve las figuras y otros archivos, y resuelve conflictos.",fyt=()=>"टेक्स्ट लाइव सिंक होता है। यह फ़िगर और अन्य फ़ाइलें ले जाता है, और टकराव सुलझाता है।",dyt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cyt():t==="fa"?lyt():t==="ar"?uyt():t==="es"?_yt():t==="hi"?fyt():oyt()}),hyt=()=>"Syncing with Overleaf…",pyt=()=>"正在与 Overleaf 同步…",myt=()=>"در حال همگام‌سازی با Overleaf…",gyt=()=>"جارٍ المزامنة مع Overleaf…",vyt=()=>"Sincronizando con Overleaf…",byt=()=>"Overleaf के साथ सिंक हो रहा है…",rL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pyt():t==="fa"?myt():t==="ar"?gyt():t==="es"?vyt():t==="hi"?byt():hyt()}),yyt=()=>"Paste an Overleaf Git authentication token to keep this paper in step with an Overleaf project. Create one in Overleaf under Account Settings — Git integration comes with a paid Overleaf plan.",xyt=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",wyt=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",kyt=()=>"الصق رمز مصادقة Git لـ Overleaf لإبقاء هذه الورقة متزامنة مع مشروع Overleaf. أنشئ واحدًا في Overleaf ضمن إعدادات الحساب — يأتي تكامل Git مع خطة Overleaf مدفوعة.",Syt=()=>"Pega un token de autenticación de Git de Overleaf para mantener este paper sincronizado con un proyecto de Overleaf. Créalo en Overleaf, en Account Settings — la integración con Git requiere un plan de pago de Overleaf.",Cyt=()=>"इस पेपर को किसी Overleaf प्रोजेक्ट के साथ मेल में रखने के लिए एक Overleaf Git प्रमाणीकरण टोकन पेस्ट करें। इसे Overleaf में Account Settings के तहत बनाएं — Git इंटीग्रेशन एक पेड Overleaf प्लान के साथ आता है।",Eyt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xyt():t==="fa"?wyt():t==="ar"?kyt():t==="es"?Syt():t==="hi"?Cyt():yyt()}),Nyt=()=>"Paste the URL of the Overleaf project this paper belongs to. Overleaf cannot create one over Git, so open or create the project there first.",zyt=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",jyt=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",Tyt=()=>"الصق رابط مشروع Overleaf الذي تنتمي إليه هذه الورقة. لا يستطيع Overleaf إنشاء مشروع عبر Git، لذا افتح المشروع أو أنشئه هناك أولًا.",Ayt=()=>"Pega la URL del proyecto de Overleaf al que pertenece este paper. Overleaf no puede crear proyectos por Git, así que abre o crea el proyecto allí primero.",Ryt=()=>"उस Overleaf प्रोजेक्ट का URL पेस्ट करें जिससे यह पेपर संबंधित है। Overleaf Git के ज़रिए एक नहीं बना सकता, इसलिए पहले वहाँ प्रोजेक्ट खोलें या बनाएं।",Myt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zyt():t==="fa"?jyt():t==="ar"?Tyt():t==="es"?Ayt():t==="hi"?Ryt():Nyt()}),Oyt=()=>"Toggle Plan mode for this chat",Dyt=()=>"切换此聊天的计划模式",Lyt=()=>"تغییر حالت طرح این گفت‌وگو",Iyt=()=>"تبديل وضع التخطيط لهذه المحادثة",$yt=()=>"Activa o desactiva el modo Plan en este chat",Byt=()=>"इस चैट के लिए प्लान मोड टॉगल करें",Pyt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dyt():t==="fa"?Lyt():t==="ar"?Iyt():t==="es"?$yt():t==="hi"?Byt():Oyt()}),Fyt=()=>"Accept and auto mode",Hyt=()=>"接受并使用自动模式",qyt=()=>"پذیرش و حالت خودکار",Uyt=()=>"قبول وتفعيل الوضع التلقائي",Gyt=()=>"Aceptar en modo automático",Vyt=()=>"स्वीकार करें और ऑटो मोड",Kyt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hyt():t==="fa"?qyt():t==="ar"?Uyt():t==="es"?Gyt():t==="hi"?Vyt():Fyt()}),Wyt=()=>"Accept and bypass all",Qyt=()=>"接受并跳过所有审批",Xyt=()=>"پذیرش و عبور از همهٔ تأییدها",Yyt=()=>"القبول وتجاوز الكل",Zyt=()=>"Aceptar y omitir permisos",Jyt=()=>"स्वीकार करें और सब बायपास करें",ext=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qyt():t==="fa"?Xyt():t==="ar"?Yyt():t==="es"?Zyt():t==="hi"?Jyt():Wyt()}),txt=()=>"Accept plan",nxt=()=>"接受计划",rxt=()=>"پذیرش طرح",sxt=()=>"قبول الخطة",ixt=()=>"Aceptar plan",axt=()=>"प्लान स्वीकार करें",oxt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nxt():t==="fa"?rxt():t==="ar"?sxt():t==="es"?ixt():t==="hi"?axt():txt()}),cxt=e=>`${e==null?void 0:e.agent} proposed a plan`,lxt=e=>`${e==null?void 0:e.agent} 提出了一个计划`,uxt=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,_xt=e=>`${e==null?void 0:e.agent} اقترح خطة`,fxt=e=>`${e==null?void 0:e.agent} propuso un plan`,dxt=e=>`${e==null?void 0:e.agent} ने एक प्लान प्रस्तावित किया`,hxt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?lxt(e):t==="fa"?uxt(e):t==="ar"?_xt(e):t==="es"?fxt(e):t==="hi"?dxt(e):cxt(e)}),pxt=e=>`${e==null?void 0:e.agent} is ready to proceed`,mxt=e=>`${e==null?void 0:e.agent} 已准备好继续`,gxt=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,vxt=e=>`${e==null?void 0:e.agent} جاهز للمتابعة`,bxt=e=>`${e==null?void 0:e.agent} está listo para continuar`,yxt=e=>`${e==null?void 0:e.agent} आगे बढ़ने के लिए तैयार है`,xxt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?mxt(e):t==="fa"?gxt(e):t==="ar"?vxt(e):t==="es"?bxt(e):t==="hi"?yxt(e):pxt(e)}),wxt=()=>"Back",kxt=()=>"返回",Sxt=()=>"بازگشت",Cxt=()=>"رجوع",Ext=()=>"Atrás",Nxt=()=>"वापस",sL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kxt():t==="fa"?Sxt():t==="ar"?Cxt():t==="es"?Ext():t==="hi"?Nxt():wxt()}),zxt=()=>"More approval options",jxt=()=>"更多批准选项",Txt=()=>"گزینه‌های تأیید بیشتر",Axt=()=>"خيارات موافقة إضافية",Rxt=()=>"Más opciones de aprobación",Mxt=()=>"और स्वीकृति विकल्प",Oxt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jxt():t==="fa"?Txt():t==="ar"?Axt():t==="es"?Rxt():t==="hi"?Mxt():zxt()}),Dxt=()=>"Open plan",Lxt=()=>"打开计划",Ixt=()=>"باز کردن طرح",$xt=()=>"فتح الخطة",Bxt=()=>"Abrir plan",Pxt=()=>"प्लान खोलें",Fxt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lxt():t==="fa"?Ixt():t==="ar"?$xt():t==="es"?Bxt():t==="hi"?Pxt():Dxt()}),Hxt=()=>"Reject",qxt=()=>"拒绝",Uxt=()=>"رد کردن",Gxt=()=>"رفض",Vxt=()=>"Rechazar",Kxt=()=>"अस्वीकार करें",Wxt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qxt():t==="fa"?Uxt():t==="ar"?Gxt():t==="es"?Vxt():t==="hi"?Kxt():Hxt()}),Qxt=()=>"Revise",Xxt=()=>"修改",Yxt=()=>"بازنگری",Zxt=()=>"طلب تعديل",Jxt=()=>"Pedir cambios",e2t=()=>"संशोधित करें",t2t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xxt():t==="fa"?Yxt():t==="ar"?Zxt():t==="es"?Jxt():t==="hi"?e2t():Qxt()}),n2t=()=>"Revise…",r2t=()=>"修改…",s2t=()=>"بازنگری…",i2t=()=>"طلب تعديل…",a2t=()=>"Pedir cambios…",o2t=()=>"संशोधित करें…",c2t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?r2t():t==="fa"?s2t():t==="ar"?i2t():t==="es"?a2t():t==="hi"?o2t():n2t()}),l2t=()=>"What should change? (optional)",u2t=()=>"需要更改什么?(可选)",_2t=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",f2t=()=>"ما الذي ينبغي تغييره؟ (اختياري)",d2t=()=>"¿Qué debería cambiar? (opcional)",h2t=()=>"क्या बदलना चाहिए? (वैकल्पिक)",p2t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u2t():t==="fa"?_2t():t==="ar"?f2t():t==="es"?d2t():t==="hi"?h2t():l2t()}),m2t=e=>`${e==null?void 0:e.count} active`,g2t=e=>`${e==null?void 0:e.count} 个活跃`,v2t=e=>`${e==null?void 0:e.count} فعال`,b2t=e=>`الوكلاء النشطون: ${e==null?void 0:e.count}`,y2t=e=>`${e==null?void 0:e.count} activos`,x2t=e=>`${e==null?void 0:e.count} सक्रिय`,w2t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?g2t(e):t==="fa"?v2t(e):t==="ar"?b2t(e):t==="es"?y2t(e):t==="hi"?x2t(e):m2t(e)}),k2t=e=>`${e==null?void 0:e.count} total agents`,S2t=e=>`共 ${e==null?void 0:e.count} 个智能体`,C2t=e=>`در مجموع ${e==null?void 0:e.count} عامل`,E2t=e=>`إجمالي الوكلاء: ${e==null?void 0:e.count}`,N2t=e=>`${e==null?void 0:e.count} agentes en total`,z2t=e=>`${e==null?void 0:e.count} कुल एजेंट`,j2t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?S2t(e):t==="fa"?C2t(e):t==="ar"?E2t(e):t==="es"?N2t(e):t==="hi"?z2t(e):k2t(e)}),T2t=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,A2t=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,R2t=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,M2t=e=>`حذف ${e==null?void 0:e.name} من OpenResearch؟ ستُزال تجاربه وعمليات تشغيله ومحادثاته نهائيًا.`,O2t=e=>`¿Eliminar ${e==null?void 0:e.name} de OpenResearch? Sus experimentos, ejecuciones y chats se eliminarán de forma permanente.`,D2t=e=>`${e==null?void 0:e.name} को OpenResearch से हटाएं? इसके प्रयोग, रन और चैट स्थायी रूप से हट जाएंगे।`,L2t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?A2t(e):t==="fa"?R2t(e):t==="ar"?M2t(e):t==="es"?O2t(e):t==="hi"?D2t(e):T2t(e)}),I2t=()=>"Agents",$2t=()=>"智能体",B2t=()=>"عامل‌ها",P2t=()=>"الوكلاء",F2t=()=>"Agentes",H2t=()=>"एजेंट",mz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$2t():t==="fa"?B2t():t==="ar"?P2t():t==="es"?F2t():t==="hi"?H2t():I2t()}),q2t=()=>"arXiv paper ID:",U2t=()=>"arXiv 论文 ID:",G2t=()=>"شناسهٔ مقالهٔ arXiv:",V2t=()=>"معرّف ورقة arXiv:",K2t=()=>"ID del paper en arXiv:",W2t=()=>"arXiv पेपर ID:",Q2t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?U2t():t==="fa"?G2t():t==="ar"?V2t():t==="es"?K2t():t==="hi"?W2t():q2t()}),X2t=()=>"Cancel",Y2t=()=>"取消",Z2t=()=>"لغو",J2t=()=>"إلغاء",ewt=()=>"Cancelar",twt=()=>"रद्द करें",nwt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y2t():t==="fa"?Z2t():t==="ar"?J2t():t==="es"?ewt():t==="hi"?twt():X2t()}),rwt=()=>"Created",swt=()=>"创建时间",iwt=()=>"ایجادشده",awt=()=>"أُنشئ",owt=()=>"Creado",cwt=()=>"बनाया गया",lwt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?swt():t==="fa"?iwt():t==="ar"?awt():t==="es"?owt():t==="hi"?cwt():rwt()}),uwt=()=>"Delete project?",_wt=()=>"删除项目?",fwt=()=>"پروژه حذف شود؟",dwt=()=>"حذف المشروع؟",hwt=()=>"¿Eliminar el proyecto?",pwt=()=>"प्रोजेक्ट हटाएं?",mwt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_wt():t==="fa"?fwt():t==="ar"?dwt():t==="es"?hwt():t==="hi"?pwt():uwt()}),gwt=()=>"Delete project",vwt=()=>"删除项目",bwt=()=>"حذف پروژه",ywt=()=>"حذف المشروع",xwt=()=>"Eliminar proyecto",wwt=()=>"प्रोजेक्ट हटाएं",kwt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vwt():t==="fa"?bwt():t==="ar"?ywt():t==="es"?xwt():t==="hi"?wwt():gwt()}),Swt=()=>"Deleting…",Cwt=()=>"正在删除…",Ewt=()=>"در حال حذف…",Nwt=()=>"جارٍ الحذف…",zwt=()=>"Eliminando…",jwt=()=>"हटाया जा रहा है…",Twt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cwt():t==="fa"?Ewt():t==="ar"?Nwt():t==="es"?zwt():t==="hi"?jwt():Swt()}),Awt=()=>"Experiments",Rwt=()=>"实验",Mwt=()=>"آزمایش‌ها",Owt=()=>"التجارب",Dwt=()=>"Experimentos",Lwt=()=>"प्रयोग",gz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rwt():t==="fa"?Mwt():t==="ar"?Owt():t==="es"?Dwt():t==="hi"?Lwt():Awt()}),Iwt=()=>"The local folder and linked GitHub repository are kept.",$wt=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",Bwt=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",Pwt=()=>"يُحتفظ بالمجلد المحلي ومستودع GitHub المرتبط.",Fwt=()=>"Se conservan la carpeta local y el repositorio de GitHub vinculado.",Hwt=()=>"लोकल फ़ोल्डर और लिंक की गई GitHub रिपॉज़िटरी दोनों सुरक्षित रहती हैं।",qwt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$wt():t==="fa"?Bwt():t==="ar"?Pwt():t==="es"?Fwt():t==="hi"?Hwt():Iwt()}),Uwt=()=>"The local folder is kept.",Gwt=()=>"本地文件夹会保留。",Vwt=()=>"پوشهٔ محلی نگه داشته می‌شود.",Kwt=()=>"يُحتفظ بالمجلد المحلي.",Wwt=()=>"La carpeta local se conserva.",Qwt=()=>"लोकल फ़ोल्डर सुरक्षित रहता है।",Xwt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gwt():t==="fa"?Vwt():t==="ar"?Kwt():t==="es"?Wwt():t==="hi"?Qwt():Uwt()}),Ywt=()=>"New project",Zwt=()=>"新建项目",Jwt=()=>"پروژهٔ جدید",e4t=()=>"مشروع جديد",t4t=()=>"Nuevo proyecto",n4t=()=>"नया प्रोजेक्ट",iL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zwt():t==="fa"?Jwt():t==="ar"?e4t():t==="es"?t4t():t==="hi"?n4t():Ywt()}),r4t=()=>"No projects yet — create one to get started.",s4t=()=>"尚无项目——新建一个即可开始。",i4t=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",a4t=()=>"لا توجد مشاريع بعد — أنشئ واحدًا للبدء.",o4t=()=>"Aún no hay proyectos — crea uno para empezar.",c4t=()=>"अभी तक कोई प्रोजेक्ट नहीं — शुरू करने के लिए एक बनाएं।",l4t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?s4t():t==="fa"?i4t():t==="ar"?a4t():t==="es"?o4t():t==="hi"?c4t():r4t()}),u4t=()=>"Project",_4t=()=>"项目",f4t=()=>"پروژه",d4t=()=>"المشروع",h4t=()=>"Proyecto",p4t=()=>"प्रोजेक्ट",m4t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_4t():t==="fa"?f4t():t==="ar"?d4t():t==="es"?h4t():t==="hi"?p4t():u4t()}),g4t=()=>"Projects",v4t=()=>"项目",b4t=()=>"پروژه‌ها",y4t=()=>"المشاريع",x4t=()=>"Proyectos",w4t=()=>"प्रोजेक्ट",k4t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v4t():t==="fa"?b4t():t==="ar"?y4t():t==="es"?x4t():t==="hi"?w4t():g4t()}),S4t=()=>"Repository",C4t=()=>"仓库",E4t=()=>"مخزن",N4t=()=>"المستودع",z4t=()=>"Repositorio",j4t=()=>"रिपॉज़िटरी",vz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C4t():t==="fa"?E4t():t==="ar"?N4t():t==="es"?z4t():t==="hi"?j4t():S4t()}),T4t=()=>"Idle",A4t=()=>"空闲",R4t=()=>"بیکار",M4t=()=>"خامل",O4t=()=>"Inactivo",D4t=()=>"निष्क्रिय",L4t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?A4t():t==="fa"?R4t():t==="ar"?M4t():t==="es"?O4t():t==="hi"?D4t():T4t()}),I4t=()=>"Local",$4t=()=>"本地",B4t=()=>"محلی",P4t=()=>"محلي",F4t=()=>"Local",H4t=()=>"लोकल",zv=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$4t():t==="fa"?B4t():t==="ar"?P4t():t==="es"?F4t():t==="hi"?H4t():I4t()}),q4t=()=>"1 total agent",U4t=()=>"共 1 个智能体",G4t=()=>"در مجموع ۱ عامل",V4t=()=>"وكيل واحد إجمالًا",K4t=()=>"1 agente en total",W4t=()=>"1 कुल एजेंट",Q4t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?U4t():t==="fa"?G4t():t==="ar"?V4t():t==="es"?K4t():t==="hi"?W4t():q4t()}),X4t=e=>`${e==null?void 0:e.count} running`,Y4t=e=>`${e==null?void 0:e.count} 个运行中`,Z4t=e=>`${e==null?void 0:e.count} در حال اجرا`,J4t=e=>`${e==null?void 0:e.count} قيد التشغيل`,e3t=e=>`${e==null?void 0:e.count} en ejecución`,t3t=e=>`${e==null?void 0:e.count} चल रहे`,n3t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Y4t(e):t==="fa"?Z4t(e):t==="ar"?J4t(e):t==="es"?e3t(e):t==="hi"?t3t(e):X4t(e)}),r3t=e=>`${e==null?void 0:e.count} total`,s3t=e=>`共 ${e==null?void 0:e.count} 个`,i3t=e=>`در مجموع ${e==null?void 0:e.count}`,a3t=e=>`${e==null?void 0:e.count} إجمالًا`,o3t=e=>`${e==null?void 0:e.count} en total`,c3t=e=>`${e==null?void 0:e.count} कुल`,bz=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?s3t(e):t==="fa"?i3t(e):t==="ar"?a3t(e):t==="es"?o3t(e):t==="hi"?c3t(e):r3t(e)}),l3t=()=>"Installing the compatible binary. This may take a few minutes.",u3t=()=>"正在安装兼容的二进制文件。这可能需要几分钟。",_3t=()=>"در حال نصب فایل اجرایی سازگار. این کار ممکن است چند دقیقه طول بکشد.",f3t=()=>"جارٍ تثبيت الملف التنفيذي المتوافق. قد يستغرق هذا بضع دقائق.",d3t=()=>"Instalando el binario compatible. Puede tardar unos minutos.",h3t=()=>"संगत बाइनरी इंस्टॉल हो रही है। इसमें कुछ मिनट लग सकते हैं।",p3t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u3t():t==="fa"?_3t():t==="ar"?f3t():t==="es"?d3t():t==="hi"?h3t():l3t()}),m3t=e=>`Setting up OpenResearch on ${e==null?void 0:e.host}`,g3t=e=>`正在设置 ${e==null?void 0:e.host} 上的 OpenResearch`,v3t=e=>`در حال راه‌اندازی OpenResearch روی ${e==null?void 0:e.host}`,b3t=e=>`جارٍ إعداد OpenResearch على ${e==null?void 0:e.host}`,y3t=e=>`Configurando OpenResearch en ${e==null?void 0:e.host}`,x3t=e=>`${e==null?void 0:e.host} पर OpenResearch सेट अप हो रहा है`,w3t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?g3t(e):t==="fa"?v3t(e):t==="ar"?b3t(e):t==="es"?y3t(e):t==="hi"?x3t(e):m3t(e)}),k3t=()=>"Check again",S3t=()=>"再次检查",C3t=()=>"بررسی دوباره",E3t=()=>"تحقق مجددًا",N3t=()=>"Volver a comprobar",z3t=()=>"फिर से जाँचें",yz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?S3t():t==="fa"?C3t():t==="ar"?E3t():t==="es"?N3t():t==="hi"?z3t():k3t()}),j3t=()=>"Closing…",T3t=()=>"正在关闭…",A3t=()=>"در حال بستن…",R3t=()=>"جارٍ الإغلاق…",M3t=()=>"Cerrando…",O3t=()=>"बंद हो रहा है…",D3t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?T3t():t==="fa"?A3t():t==="ar"?R3t():t==="es"?M3t():t==="hi"?O3t():j3t()}),L3t=e=>`Connected to ${e==null?void 0:e.host} as ${e==null?void 0:e.user}`,I3t=e=>`已以 ${e==null?void 0:e.user} 身份连接到 ${e==null?void 0:e.host}`,$3t=e=>`اتصال به ${e==null?void 0:e.host} با کاربر ${e==null?void 0:e.user}`,B3t=e=>`متصل بـ ${e==null?void 0:e.host} باسم ${e==null?void 0:e.user}`,P3t=e=>`Conectado a ${e==null?void 0:e.host} como ${e==null?void 0:e.user}`,F3t=e=>`${e==null?void 0:e.host} से ${e==null?void 0:e.user} के रूप में कनेक्टेड`,H3t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?I3t(e):t==="fa"?$3t(e):t==="ar"?B3t(e):t==="es"?P3t(e):t==="hi"?F3t(e):L3t(e)}),q3t=()=>"Preparing your remote workspace…",U3t=()=>"正在准备远程工作区…",G3t=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",V3t=()=>"جارٍ تحضير مساحة عملك البعيدة…",K3t=()=>"Preparando tu espacio de trabajo remoto…",W3t=()=>"आपका रिमोट वर्कस्पेस तैयार किया जा रहा है…",Q3t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?U3t():t==="fa"?G3t():t==="ar"?V3t():t==="es"?K3t():t==="hi"?W3t():q3t()}),X3t=e=>`Connecting to ${e==null?void 0:e.host}`,Y3t=e=>`正在连接到 ${e==null?void 0:e.host}`,Z3t=e=>`در حال اتصال به ${e==null?void 0:e.host}`,J3t=e=>`جارٍ الاتصال بـ ${e==null?void 0:e.host}`,e5t=e=>`Conectando a ${e==null?void 0:e.host}`,t5t=e=>`${e==null?void 0:e.host} से कनेक्ट हो रहा है`,n5t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Y3t(e):t==="fa"?Z3t(e):t==="ar"?J3t(e):t==="es"?e5t(e):t==="hi"?t5t(e):X3t(e)}),r5t=()=>"Close remote host picker",s5t=()=>"关闭远程主机选择器",i5t=()=>"بستن انتخاب‌گر میزبان راه‌دور",a5t=()=>"إغلاق مُنتقي المضيف البعيد",o5t=()=>"Cerrar el selector de hosts remotos",c5t=()=>"रिमोट होस्ट पिकर बंद करें",l5t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?s5t():t==="fa"?i5t():t==="ar"?a5t():t==="es"?o5t():t==="hi"?c5t():r5t()}),u5t=()=>"Choose a configured SSH host.",_5t=()=>"选择已配置的 SSH 主机。",f5t=()=>"یک میزبان SSH پیکربندی‌شده انتخاب کنید.",d5t=()=>"اختر مضيف SSH مُعدًّا.",h5t=()=>"Elige un host SSH configurado.",p5t=()=>"एक कॉन्फ़िगर किया गया SSH होस्ट चुनें।",m5t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_5t():t==="fa"?f5t():t==="ar"?d5t():t==="es"?h5t():t==="hi"?p5t():u5t()}),g5t=()=>"Connect to remote",v5t=()=>"连接到远程主机",b5t=()=>"اتصال به میزبان راه‌دور",y5t=()=>"الاتصال بجهاز بعيد",x5t=()=>"Conectar a un host remoto",w5t=()=>"रिमोट से कनेक्ट करें",d3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v5t():t==="fa"?b5t():t==="ar"?y5t():t==="es"?x5t():t==="hi"?w5t():g5t()}),k5t=()=>"Disconnect",S5t=()=>"断开连接",C5t=()=>"قطع اتصال",E5t=()=>"قطع الاتصال",N5t=()=>"Desconectar",z5t=()=>"डिस्कनेक्ट करें",h3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?S5t():t==="fa"?C5t():t==="ar"?E5t():t==="es"?N5t():t==="hi"?z5t():k5t()}),j5t=()=>"Your remote work is still running. Reconnect when you’re ready.",T5t=()=>"你的远程工作仍在运行。准备好后可以重新连接。",A5t=()=>"کار راه‌دور شما همچنان در حال اجرا است. هر زمان آماده بودید دوباره متصل شوید.",R5t=()=>"لا يزال عملك البعيد قيد التشغيل. أعد الاتصال عندما تكون جاهزًا.",M5t=()=>"Tu trabajo remoto sigue en ejecución. Vuelve a conectarte cuando quieras.",O5t=()=>"आपका रिमोट काम अभी भी चल रहा है। तैयार होने पर फिर से कनेक्ट करें।",D5t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?T5t():t==="fa"?A5t():t==="ar"?R5t():t==="es"?M5t():t==="hi"?O5t():j5t()}),L5t=e=>`Disconnected from ${e==null?void 0:e.host}`,I5t=e=>`已断开与 ${e==null?void 0:e.host} 的连接`,$5t=e=>`اتصال به ${e==null?void 0:e.host} قطع شد`,B5t=e=>`انقطع الاتصال بـ ${e==null?void 0:e.host}`,P5t=e=>`Desconectado de ${e==null?void 0:e.host}`,F5t=e=>`${e==null?void 0:e.host} से डिस्कनेक्ट हो गया`,aL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?I5t(e):t==="fa"?$5t(e):t==="ar"?B5t(e):t==="es"?P5t(e):t==="hi"?F5t(e):L5t(e)}),H5t=e=>`Could not connect to ${e==null?void 0:e.host}`,q5t=e=>`无法连接到 ${e==null?void 0:e.host}`,U5t=e=>`اتصال به ${e==null?void 0:e.host} ممکن نشد`,G5t=e=>`تعذّر الاتصال بـ ${e==null?void 0:e.host}`,V5t=e=>`No se pudo conectar a ${e==null?void 0:e.host}`,K5t=e=>`${e==null?void 0:e.host} से कनेक्ट नहीं हो सका`,W5t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?q5t(e):t==="fa"?U5t(e):t==="ar"?G5t(e):t==="es"?V5t(e):t==="hi"?K5t(e):H5t(e)}),Q5t=()=>"Restart local OpenResearch and select this SSH host again. Work on the remote host continues.",X5t=()=>"请重新启动本地 OpenResearch 并再次选择此 SSH 主机。远程主机上的工作仍在继续。",Y5t=()=>"OpenResearch محلی را دوباره راه‌اندازی کنید و این میزبان SSH را دوباره انتخاب کنید. کار روی میزبان راه‌دور ادامه دارد.",Z5t=()=>"أعد تشغيل OpenResearch المحلي واختر مضيف SSH هذا مجددًا. يستمر العمل على المضيف البعيد.",J5t=()=>"Reinicia OpenResearch en local y vuelve a seleccionar este host SSH. El trabajo en el host remoto continúa.",ekt=()=>"लोकल OpenResearch फिर से शुरू करें और इस SSH होस्ट को फिर से चुनें। रिमोट होस्ट पर काम जारी रहता है।",tkt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?X5t():t==="fa"?Y5t():t==="ar"?Z5t():t==="es"?J5t():t==="hi"?ekt():Q5t()}),nkt=()=>"OpenResearch agents have stopped. Submitted experiments may still be running.",rkt=()=>"OpenResearch 智能体已停止。已提交的实验可能仍在运行。",skt=()=>"عامل‌های OpenResearch متوقف شده‌اند. آزمایش‌های ارسال‌شده ممکن است همچنان در حال اجرا باشند.",ikt=()=>"توقّف وكلاء OpenResearch. قد تظل التجارب المُرسَلة قيد التشغيل.",akt=()=>"Los agentes de OpenResearch se han detenido. Puede que los experimentos enviados sigan en ejecución.",okt=()=>"OpenResearch एजेंट रुक गए हैं। सबमिट किए गए प्रयोग अभी भी चल सकते हैं।",ckt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rkt():t==="fa"?skt():t==="ar"?ikt():t==="es"?akt():t==="hi"?okt():nkt()}),lkt=e=>`OpenResearch is not running on ${e==null?void 0:e.host}`,ukt=e=>`OpenResearch 未在 ${e==null?void 0:e.host} 上运行`,_kt=e=>`OpenResearch روی ${e==null?void 0:e.host} در حال اجرا نیست`,fkt=e=>`‏OpenResearch لا يعمل على ${e==null?void 0:e.host}`,dkt=e=>`OpenResearch no se está ejecutando en ${e==null?void 0:e.host}`,hkt=e=>`${e==null?void 0:e.host} पर OpenResearch नहीं चल रहा`,pkt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ukt(e):t==="fa"?_kt(e):t==="ar"?fkt(e):t==="es"?dkt(e):t==="hi"?hkt(e):lkt(e)}),mkt=()=>"OpenResearch binary",gkt=()=>"OpenResearch 二进制文件",vkt=()=>"فایل اجرایی OpenResearch",bkt=()=>"الملف التنفيذي لـ OpenResearch",ykt=()=>"Binario de OpenResearch",xkt=()=>"OpenResearch बाइनरी",wkt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gkt():t==="fa"?vkt():t==="ar"?bkt():t==="es"?ykt():t==="hi"?xkt():mkt()}),kkt=()=>"OpenResearch Database",Skt=()=>"OpenResearch 数据库",Ckt=()=>"پایگاه دادهٔ OpenResearch",Ekt=()=>"قاعدة بيانات OpenResearch",Nkt=()=>"Base de datos de OpenResearch",zkt=()=>"OpenResearch डेटाबेस",jkt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Skt():t==="fa"?Ckt():t==="ar"?Ekt():t==="es"?Nkt():t==="hi"?zkt():kkt()}),Tkt=()=>"OpenResearch will use these locations for your remote SSH user and does not require sudo.",Akt=()=>"OpenResearch 将为你的远程 SSH 用户使用以下位置,无需 sudo。",Rkt=()=>"OpenResearch از این مسیرها برای کاربر SSH راه‌دور شما استفاده می‌کند و به sudo نیاز ندارد.",Mkt=()=>"سيستخدم OpenResearch هذه المواقع لمستخدم SSH البعيد ولا يتطلب sudo.",Okt=()=>"OpenResearch usará estas ubicaciones para tu usuario SSH remoto y no necesita sudo.",Dkt=()=>"OpenResearch आपके रिमोट SSH यूज़र के लिए इन स्थानों का इस्तेमाल करेगा और sudo की ज़रूरत नहीं है।",Lkt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Akt():t==="fa"?Rkt():t==="ar"?Mkt():t==="es"?Okt():t==="hi"?Dkt():Tkt()}),Ikt=()=>"Install OpenResearch?",$kt=()=>"安装 OpenResearch?",Bkt=()=>"OpenResearch نصب شود؟",Pkt=()=>"تثبيت OpenResearch؟",Fkt=()=>"¿Instalar OpenResearch?",Hkt=()=>"OpenResearch इंस्टॉल करें?",qkt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$kt():t==="fa"?Bkt():t==="ar"?Pkt():t==="es"?Fkt():t==="hi"?Hkt():Ikt()}),Ukt=()=>"Installing…",Gkt=()=>"正在安装…",Vkt=()=>"در حال نصب…",Kkt=()=>"جارٍ التثبيت…",Wkt=()=>"Instalando…",Qkt=()=>"इंस्टॉल हो रहा है…",Xkt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gkt():t==="fa"?Vkt():t==="ar"?Kkt():t==="es"?Wkt():t==="hi"?Qkt():Ukt()}),Ykt=()=>"No matching SSH hosts",Zkt=()=>"没有匹配的 SSH 主机",Jkt=()=>"میزبان SSH منطبقی پیدا نشد",eSt=()=>"لا توجد مضيفات SSH مطابقة",tSt=()=>"No hay hosts SSH que coincidan",nSt=()=>"कोई मेल खाता SSH होस्ट नहीं",rSt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zkt():t==="fa"?Jkt():t==="ar"?eSt():t==="es"?tSt():t==="hi"?nSt():Ykt()}),sSt=e=>`OpenResearch is not installed for ${e==null?void 0:e.user} on ${e==null?void 0:e.host}. Install it now?`,iSt=e=>`${e==null?void 0:e.user} 尚未在 ${e==null?void 0:e.host} 上安装 OpenResearch。现在安装吗?`,aSt=e=>`OpenResearch برای ${e==null?void 0:e.user} روی ${e==null?void 0:e.host} نصب نیست. اکنون نصب شود؟`,oSt=e=>`‏OpenResearch غير مثبّت للمستخدم ${e==null?void 0:e.user} على ${e==null?void 0:e.host}. هل تريد تثبيته الآن؟`,cSt=e=>`OpenResearch no está instalado para ${e==null?void 0:e.user} en ${e==null?void 0:e.host}. ¿Instalarlo ahora?`,lSt=e=>`${e==null?void 0:e.host} पर ${e==null?void 0:e.user} के लिए OpenResearch इंस्टॉल नहीं है। अभी इंस्टॉल करें?`,uSt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?iSt(e):t==="fa"?aSt(e):t==="ar"?oSt(e):t==="es"?cSt(e):t==="hi"?lSt(e):sSt(e)}),_St=()=>"Open remote",fSt=()=>"打开远程工作区",dSt=()=>"باز کردن راه‌دور",hSt=()=>"فتح مساحة العمل البعيدة",pSt=()=>"Abrir remoto",mSt=()=>"रिमोट खोलें",gSt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fSt():t==="fa"?dSt():t==="ar"?hSt():t==="es"?pSt():t==="hi"?mSt():_St()}),vSt=()=>"Closing this tab or disconnecting leaves agents and experiments running. Approval requests remain pending for up to 55 minutes. A host restart or administrator policy may stop OpenResearch.",bSt=()=>"关闭此标签页或断开连接后,代理和实验仍会继续运行。审批请求最多保持待处理 55 分钟。主机重启或管理员策略可能会停止 OpenResearch。",ySt=()=>"بستن این زبانه یا قطع اتصال، عامل‌ها و آزمایش‌ها را در حال اجرا نگه می‌دارد. درخواست‌های تأیید تا ۵۵ دقیقه در انتظار می‌مانند. راه‌اندازی مجدد میزبان یا سیاست مدیر ممکن است OpenResearch را متوقف کند.",xSt=()=>"إغلاق هذا التبويب أو قطع الاتصال يُبقي الوكلاء والتجارب قيد التشغيل. تبقى طلبات الموافقة معلّقة لمدة تصل إلى 55 دقيقة. قد تتسبب إعادة تشغيل المضيف أو سياسة المسؤول في إيقاف OpenResearch.",wSt=()=>"Si cierras esta pestaña o te desconectas, los agentes y experimentos siguen en ejecución. Las solicitudes de aprobación quedan pendientes hasta 55 minutos. Un reinicio del host o una política del administrador pueden detener OpenResearch.",kSt=()=>"यह टैब बंद करने या डिस्कनेक्ट करने पर भी एजेंट और प्रयोग चलते रहते हैं। स्वीकृति अनुरोध 55 मिनट तक लंबित रहते हैं। होस्ट रीस्टार्ट या एडमिन नीति OpenResearch को रोक सकती है।",SSt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bSt():t==="fa"?ySt():t==="ar"?xSt():t==="es"?wSt():t==="hi"?kSt():vSt()}),CSt=()=>"Your browser blocked the remote workspace tab. Allow pop-ups and try again.",ESt=()=>"浏览器阻止了远程工作区标签页。请允许弹出窗口后重试。",NSt=()=>"مرورگر زبانهٔ فضای کاری راه‌دور را مسدود کرد. پنجره‌های بازشو را مجاز کنید و دوباره تلاش کنید.",zSt=()=>"حجب متصفحك تبويب مساحة العمل البعيدة. اسمح بالنوافذ المنبثقة وحاول مجددًا.",jSt=()=>"Tu navegador bloqueó la pestaña del espacio de trabajo remoto. Permite las ventanas emergentes y vuelve a intentarlo.",TSt=()=>"आपके ब्राउज़र ने रिमोट वर्कस्पेस टैब को ब्लॉक कर दिया। पॉप-अप की अनुमति दें और फिर से कोशिश करें।",ASt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ESt():t==="fa"?NSt():t==="ar"?zSt():t==="es"?jSt():t==="hi"?TSt():CSt()}),RSt=()=>"Preparing remote workspace…",MSt=()=>"正在准备远程工作区…",OSt=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",DSt=()=>"جارٍ تحضير مساحة العمل البعيدة…",LSt=()=>"Preparando el espacio de trabajo remoto…",ISt=()=>"रिमोट वर्कस्पेस तैयार हो रहा है…",$St=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MSt():t==="fa"?OSt():t==="ar"?DSt():t==="es"?LSt():t==="hi"?ISt():RSt()}),BSt=()=>"Reconnect",PSt=()=>"重新连接",FSt=()=>"اتصال دوباره",HSt=()=>"إعادة الاتصال",qSt=()=>"Reconectar",USt=()=>"फिर से कनेक्ट करें",xz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PSt():t==="fa"?FSt():t==="ar"?HSt():t==="es"?qSt():t==="hi"?USt():BSt()}),GSt=()=>"The connection dropped. Your remote work remains running while OpenResearch reconnects.",VSt=()=>"连接已中断。OpenResearch 重新连接期间,你的远程工作仍会继续运行。",KSt=()=>"اتصال قطع شد. هنگام اتصال دوبارهٔ OpenResearch، کار راه‌دور شما همچنان اجرا می‌شود.",WSt=()=>"انقطع الاتصال. يبقى عملك البعيد قيد التشغيل بينما يعيد OpenResearch الاتصال.",QSt=()=>"Se perdió la conexión. Tu trabajo remoto sigue en ejecución mientras OpenResearch se reconecta.",XSt=()=>"कनेक्शन टूट गया। OpenResearch के फिर से कनेक्ट होने के दौरान आपका रिमोट काम चलता रहता है।",YSt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VSt():t==="fa"?KSt():t==="ar"?WSt():t==="es"?QSt():t==="hi"?XSt():GSt()}),ZSt=e=>`Reconnecting to ${e==null?void 0:e.host}`,JSt=e=>`正在重新连接到 ${e==null?void 0:e.host}`,e6t=e=>`در حال اتصال دوباره به ${e==null?void 0:e.host}`,t6t=e=>`جارٍ إعادة الاتصال بـ ${e==null?void 0:e.host}`,n6t=e=>`Reconectando a ${e==null?void 0:e.host}`,r6t=e=>`${e==null?void 0:e.host} से फिर से कनेक्ट हो रहा है`,s6t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?JSt(e):t==="fa"?e6t(e):t==="ar"?t6t(e):t==="es"?n6t(e):t==="hi"?r6t(e):ZSt(e)}),i6t=()=>"Search SSH hosts",a6t=()=>"搜索 SSH 主机",o6t=()=>"جستجوی میزبان‌های SSH",c6t=()=>"البحث في مضيفات SSH",l6t=()=>"Buscar hosts SSH",u6t=()=>"SSH होस्ट खोजें",wz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a6t():t==="fa"?o6t():t==="ar"?c6t():t==="es"?l6t():t==="hi"?u6t():i6t()}),_6t=e=>`SSH: ${e==null?void 0:e.host}`,f6t=e=>`SSH:${e==null?void 0:e.host}`,d6t=e=>`SSH: ${e==null?void 0:e.host}`,h6t=e=>`SSH: ${e==null?void 0:e.host}`,p6t=e=>`SSH: ${e==null?void 0:e.host}`,m6t=e=>`SSH: ${e==null?void 0:e.host}`,tw=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?f6t(e):t==="fa"?d6t(e):t==="ar"?h6t(e):t==="es"?p6t(e):t==="hi"?m6t(e):_6t(e)}),g6t=()=>"Start a new OpenResearch host",v6t=()=>"启动新的 OpenResearch 主机",b6t=()=>"راه‌اندازی میزبان جدید OpenResearch",y6t=()=>"بدء مضيف OpenResearch جديد",x6t=()=>"Iniciar un nuevo host de OpenResearch",w6t=()=>"एक नया OpenResearch होस्ट शुरू करें",k6t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v6t():t==="fa"?b6t():t==="ar"?y6t():t==="es"?x6t():t==="hi"?w6t():g6t()}),S6t=e=>`End ${e==null?void 0:e.count} pending approvals.`,C6t=e=>`结束 ${e==null?void 0:e.count} 个待审批请求。`,E6t=e=>`${e==null?void 0:e.count} تأیید در انتظار را پایان می‌دهد.`,N6t=e=>`إنهاء طلبات الموافقة المعلّقة (${e==null?void 0:e.count}).`,z6t=e=>`Cancelará ${e==null?void 0:e.count} aprobaciones pendientes.`,j6t=e=>`${e==null?void 0:e.count} लंबित स्वीकृतियाँ खत्म होंगी।`,T6t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?C6t(e):t==="fa"?E6t(e):t==="ar"?N6t(e):t==="es"?z6t(e):t==="hi"?j6t(e):S6t(e)}),A6t=()=>"Stop OpenResearch",R6t=()=>"停止 OpenResearch",M6t=()=>"توقف OpenResearch",O6t=()=>"إيقاف OpenResearch",D6t=()=>"Detener OpenResearch",L6t=()=>"OpenResearch रोकें",I6t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?R6t():t==="fa"?M6t():t==="ar"?O6t():t==="es"?D6t():t==="hi"?L6t():A6t()}),$6t=e=>`Stop OpenResearch on ${e==null?void 0:e.host}?`,B6t=e=>`停止 ${e==null?void 0:e.host} 上的 OpenResearch?`,P6t=e=>`OpenResearch روی ${e==null?void 0:e.host} متوقف شود؟`,F6t=e=>`إيقاف OpenResearch على ${e==null?void 0:e.host}؟`,H6t=e=>`¿Detener OpenResearch en ${e==null?void 0:e.host}?`,q6t=e=>`${e==null?void 0:e.host} पर OpenResearch रोकें?`,U6t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?B6t(e):t==="fa"?P6t(e):t==="ar"?F6t(e):t==="es"?H6t(e):t==="hi"?q6t(e):$6t(e)}),G6t=e=>`Leave ${e==null?void 0:e.count} submitted experiments running.`,V6t=e=>`让 ${e==null?void 0:e.count} 个已提交实验继续运行。`,K6t=e=>`${e==null?void 0:e.count} آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.`,W6t=e=>`إبقاء التجارب المُرسَلة قيد التشغيل (${e==null?void 0:e.count}).`,Q6t=e=>`Dejará ${e==null?void 0:e.count} experimentos enviados en ejecución.`,X6t=e=>`${e==null?void 0:e.count} सबमिट किए गए प्रयोग चलते रहेंगे।`,Y6t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?V6t(e):t==="fa"?K6t(e):t==="ar"?W6t(e):t==="es"?Q6t(e):t==="hi"?X6t(e):G6t(e)}),Z6t=()=>"Stop OpenResearch on host",J6t=()=>"停止主机上的 OpenResearch",eCt=()=>"توقف OpenResearch روی میزبان",tCt=()=>"إيقاف OpenResearch على المضيف",nCt=()=>"Detener OpenResearch en el host",rCt=()=>"होस्ट पर OpenResearch रोकें",oL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J6t():t==="fa"?eCt():t==="ar"?tCt():t==="es"?nCt():t==="hi"?rCt():Z6t()}),sCt=()=>"This will also:",iCt=()=>"这还将:",aCt=()=>"این کار همچنین:",oCt=()=>"سيؤدي هذا أيضًا إلى:",cCt=()=>"Esto también:",lCt=()=>"इससे यह भी होगा:",uCt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iCt():t==="fa"?aCt():t==="ar"?oCt():t==="es"?cCt():t==="hi"?lCt():sCt()}),_Ct=()=>"End 1 pending approval.",fCt=()=>"结束 1 个待审批请求。",dCt=()=>"۱ تأیید در انتظار را پایان می‌دهد.",hCt=()=>"إنهاء طلب موافقة معلّق واحد.",pCt=()=>"Cancelará 1 aprobación pendiente.",mCt=()=>"1 लंबित स्वीकृति खत्म होगी।",gCt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fCt():t==="fa"?dCt():t==="ar"?hCt():t==="es"?pCt():t==="hi"?mCt():_Ct()}),vCt=()=>"Leave 1 submitted experiment running.",bCt=()=>"让 1 个已提交实验继续运行。",yCt=()=>"۱ آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.",xCt=()=>"ترك تجربة مُرسَلة واحدة قيد التشغيل.",wCt=()=>"Dejará 1 experimento enviado en ejecución.",kCt=()=>"1 सबमिट किया गया प्रयोग चलता रहेगा।",SCt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bCt():t==="fa"?yCt():t==="ar"?xCt():t==="es"?wCt():t==="hi"?kCt():vCt()}),CCt=()=>"Disconnect 1 other client.",ECt=()=>"断开 1 个其他客户端。",NCt=()=>"اتصال ۱ کارخواه دیگر را قطع می‌کند.",zCt=()=>"قطع اتصال عميل آخر واحد.",jCt=()=>"Desconectará a otro cliente.",TCt=()=>"1 अन्य क्लाइंट डिस्कनेक्ट होगा।",ACt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ECt():t==="fa"?NCt():t==="ar"?zCt():t==="es"?jCt():t==="hi"?TCt():CCt()}),RCt=()=>"Keep 1 queued message saved.",MCt=()=>"保留 1 条排队消息。",OCt=()=>"۱ پیام در صف را ذخیره نگه می‌دارد.",DCt=()=>"إبقاء رسالة واحدة محفوظة في قائمة الانتظار.",LCt=()=>"Conservará 1 mensaje en cola.",ICt=()=>"1 कतार में लगा संदेश सुरक्षित रहेगा।",$Ct=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MCt():t==="fa"?OCt():t==="ar"?DCt():t==="es"?LCt():t==="hi"?ICt():RCt()}),BCt=()=>"Interrupt 1 active agent turn.",PCt=()=>"中断 1 个活动代理任务。",FCt=()=>"۱ نوبت فعال عامل را قطع می‌کند.",HCt=()=>"مقاطعة جولة وكيل نشطة واحدة.",qCt=()=>"Interrumpirá 1 turno activo de un agente.",UCt=()=>"1 सक्रिय एजेंट टर्न बाधित होगा।",GCt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PCt():t==="fa"?FCt():t==="ar"?HCt():t==="es"?qCt():t==="hi"?UCt():BCt()}),VCt=e=>`Disconnect ${e==null?void 0:e.count} other clients.`,KCt=e=>`断开 ${e==null?void 0:e.count} 个其他客户端。`,WCt=e=>`اتصال ${e==null?void 0:e.count} کارخواه دیگر را قطع می‌کند.`,QCt=e=>`قطع اتصال العملاء الآخرين (${e==null?void 0:e.count}).`,XCt=e=>`Desconectará otros ${e==null?void 0:e.count} clientes.`,YCt=e=>`${e==null?void 0:e.count} अन्य क्लाइंट डिस्कनेक्ट होंगे।`,ZCt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?KCt(e):t==="fa"?WCt(e):t==="ar"?QCt(e):t==="es"?XCt(e):t==="hi"?YCt(e):VCt(e)}),JCt=e=>`Keep ${e==null?void 0:e.count} queued messages saved.`,e7t=e=>`保留 ${e==null?void 0:e.count} 条排队消息。`,t7t=e=>`${e==null?void 0:e.count} پیام در صف را ذخیره نگه می‌دارد.`,n7t=e=>`إبقاء الرسائل في قائمة الانتظار محفوظة (${e==null?void 0:e.count}).`,r7t=e=>`Conservará ${e==null?void 0:e.count} mensajes en cola.`,s7t=e=>`${e==null?void 0:e.count} कतार में लगे संदेश सुरक्षित रहेंगे।`,i7t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?e7t(e):t==="fa"?t7t(e):t==="ar"?n7t(e):t==="es"?r7t(e):t==="hi"?s7t(e):JCt(e)}),a7t=e=>`Interrupt ${e==null?void 0:e.count} active agent turns.`,o7t=e=>`中断 ${e==null?void 0:e.count} 个活动代理任务。`,c7t=e=>`${e==null?void 0:e.count} نوبت فعال عامل را قطع می‌کند.`,l7t=e=>`مقاطعة جولات الوكلاء النشطة (${e==null?void 0:e.count}).`,u7t=e=>`Interrumpirá ${e==null?void 0:e.count} turnos activos de agentes.`,_7t=e=>`${e==null?void 0:e.count} सक्रिय एजेंट टर्न बाधित होंगे।`,f7t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?o7t(e):t==="fa"?c7t(e):t==="ar"?l7t(e):t==="es"?u7t(e):t==="hi"?_7t(e):a7t(e)}),d7t=()=>"Stopping host…",h7t=()=>"正在停止主机…",p7t=()=>"در حال توقف میزبان…",m7t=()=>"جارٍ إيقاف المضيف…",g7t=()=>"Deteniendo el host…",v7t=()=>"होस्ट रोका जा रहा है…",b7t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?h7t():t==="fa"?p7t():t==="ar"?m7t():t==="es"?g7t():t==="hi"?v7t():d7t()}),y7t=()=>"Update",x7t=()=>"更新",w7t=()=>"به‌روزرسانی",k7t=()=>"تحديث",S7t=()=>"Actualizar",C7t=()=>"अपडेट करें",kz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x7t():t==="fa"?w7t():t==="ar"?k7t():t==="es"?S7t():t==="hi"?C7t():y7t()}),E7t=e=>`The OpenResearch installation on ${e==null?void 0:e.host} is not compatible with this dashboard. Update it now?`,N7t=e=>`${e==null?void 0:e.host} 上的 OpenResearch 与此仪表板不兼容。现在更新吗?`,z7t=e=>`نسخهٔ OpenResearch روی ${e==null?void 0:e.host} با این داشبورد سازگار نیست. اکنون به‌روزرسانی شود؟`,j7t=e=>`نسخة OpenResearch المثبّتة على ${e==null?void 0:e.host} غير متوافقة مع هذه اللوحة. هل تريد تحديثها الآن؟`,T7t=e=>`La instalación de OpenResearch en ${e==null?void 0:e.host} no es compatible con este dashboard. ¿Actualizarla ahora?`,A7t=e=>`${e==null?void 0:e.host} पर OpenResearch इंस्टॉलेशन इस डैशबोर्ड के साथ संगत नहीं है। अभी अपडेट करें?`,R7t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?N7t(e):t==="fa"?z7t(e):t==="ar"?j7t(e):t==="es"?T7t(e):t==="hi"?A7t(e):E7t(e)}),M7t=()=>"Update OpenResearch?",O7t=()=>"更新 OpenResearch?",D7t=()=>"OpenResearch به‌روزرسانی شود؟",L7t=()=>"تحديث OpenResearch؟",I7t=()=>"¿Actualizar OpenResearch?",$7t=()=>"OpenResearch अपडेट करें?",B7t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?O7t():t==="fa"?D7t():t==="ar"?L7t():t==="es"?I7t():t==="hi"?$7t():M7t()}),P7t=()=>"Updating…",F7t=()=>"正在更新…",H7t=()=>"در حال به‌روزرسانی…",q7t=()=>"جارٍ التحديث…",U7t=()=>"Actualizando…",G7t=()=>"अपडेट हो रहा है…",V7t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?F7t():t==="fa"?H7t():t==="ar"?q7t():t==="es"?U7t():t==="hi"?G7t():P7t()}),K7t=()=>"Disable syncing",W7t=()=>"关闭同步",Q7t=()=>"غیرفعال کردن همگام‌سازی",X7t=()=>"تعطيل المزامنة",Y7t=()=>"Desactivar sincronización",Z7t=()=>"सिंकिंग बंद करें",J7t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W7t():t==="fa"?Q7t():t==="ar"?X7t():t==="es"?Y7t():t==="hi"?Z7t():K7t()}),e8t=()=>"Enable GitHub syncing",t8t=()=>"启用 GitHub 同步",n8t=()=>"فعال‌سازی همگام‌سازی GitHub",r8t=()=>"تفعيل مزامنة GitHub",s8t=()=>"Activar sincronización con GitHub",i8t=()=>"GitHub सिंकिंग चालू करें",a8t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?t8t():t==="fa"?n8t():t==="ar"?r8t():t==="es"?s8t():t==="hi"?i8t():e8t()}),o8t=()=>"Enabling…",c8t=()=>"正在启用…",l8t=()=>"در حال فعال‌سازی…",u8t=()=>"جارٍ التفعيل…",_8t=()=>"Activando…",f8t=()=>"चालू हो रहा है…",d8t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?c8t():t==="fa"?l8t():t==="ar"?u8t():t==="es"?_8t():t==="hi"?f8t():o8t()}),h8t=()=>"Updating…",p8t=()=>"正在更新…",m8t=()=>"در حال به‌روزرسانی…",g8t=()=>"جارٍ التحديث…",v8t=()=>"Actualizando…",b8t=()=>"अपडेट हो रहा है…",y8t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?p8t():t==="fa"?m8t():t==="ar"?g8t():t==="es"?v8t():t==="hi"?b8t():h8t()}),x8t=()=>"Reopen a previous chat",w8t=()=>"重新打开之前的聊天",k8t=()=>"بازکردن دوبارهٔ گفت‌وگوی قبلی",S8t=()=>"إعادة فتح محادثة سابقة",C8t=()=>"Vuelve a abrir un chat anterior",E8t=()=>"पिछली चैट फिर से खोलें",N8t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?w8t():t==="fa"?k8t():t==="ar"?S8t():t==="es"?C8t():t==="hi"?E8t():x8t()}),z8t=()=>"No chats to resume",j8t=()=>"没有可恢复的聊天",T8t=()=>"گفت‌وگویی برای ادامه وجود ندارد",A8t=()=>"لا توجد محادثات لاستئنافها",R8t=()=>"No hay chats que reanudar",M8t=()=>"फिर से शुरू करने के लिए कोई चैट नहीं है",O8t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?j8t():t==="fa"?T8t():t==="ar"?A8t():t==="es"?R8t():t==="hi"?M8t():z8t()}),D8t=()=>"From your terminal — adopting copies the transcript, and new turns continue there",L8t=()=>"来自你的终端 — 采用会复制记录,新的回合将在那里继续",I8t=()=>"از ترمینال شما — با پذیرفتن، رونوشت گفت‌وگو کپی می‌شود و نوبت‌های جدید همان‌جا ادامه می‌یابند",$8t=()=>"من طرفيتك — التبنّي ينسخ النص، والجولات الجديدة تتابع هناك",B8t=()=>"Desde tu terminal — al adoptarlo se copia la transcripción y los turnos nuevos continúan allí",P8t=()=>"आपके टर्मिनल से — अपनाने पर ट्रांसक्रिप्ट कॉपी होती है और नए टर्न वहीं जारी रहते हैं",Sz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?L8t():t==="fa"?I8t():t==="ar"?$8t():t==="es"?B8t():t==="hi"?P8t():D8t()}),F8t=()=>"Search chats",H8t=()=>"搜索聊天",q8t=()=>"جست‌وجوی گفت‌وگوها",U8t=()=>"البحث في المحادثات",G8t=()=>"Buscar chats",V8t=()=>"चैट खोजें",Cz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H8t():t==="fa"?q8t():t==="ar"?U8t():t==="es"?G8t():t==="hi"?V8t():F8t()}),K8t=()=>"Resume a chat",W8t=()=>"恢复聊天",Q8t=()=>"ادامهٔ یک گفت‌وگو",X8t=()=>"استئناف محادثة",Y8t=()=>"Reanudar un chat",Z8t=()=>"चैट फिर से शुरू करें",Ez=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W8t():t==="fa"?Q8t():t==="ar"?X8t():t==="es"?Y8t():t==="hi"?Z8t():K8t()}),J8t=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,e9t=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,t9t=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,n9t=e=>`إعادة المحاولة · المحاولة ${e==null?void 0:e.attempt}`,r9t=e=>`Reintentando · intento ${e==null?void 0:e.attempt}`,s9t=e=>`फिर से कोशिश · प्रयास ${e==null?void 0:e.attempt}`,i9t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?e9t(e):t==="fa"?t9t(e):t==="ar"?n9t(e):t==="es"?r9t(e):t==="hi"?s9t(e):J8t(e)}),a9t=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,o9t=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,c9t=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,l9t=e=>`إعادة المحاولة · المحاولة ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,u9t=e=>`Reintentando · intento ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,_9t=e=>`फिर से कोशिश · प्रयास ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,f9t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?o9t(e):t==="fa"?c9t(e):t==="ar"?l9t(e):t==="es"?u9t(e):t==="hi"?_9t(e):a9t(e)}),d9t=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · next attempt in ${e==null?void 0:e.seconds}s`,h9t=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,p9t=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,m9t=e=>`إعادة المحاولة · المحاولة ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · المحاولة التالية بعد ${e==null?void 0:e.seconds}ث`,g9t=e=>`Reintentando · intento ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · siguiente intento en ${e==null?void 0:e.seconds} s`,v9t=e=>`फिर से कोशिश · प्रयास ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · अगला प्रयास ${e==null?void 0:e.seconds}से में`,b9t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?h9t(e):t==="fa"?p9t(e):t==="ar"?m9t(e):t==="es"?g9t(e):t==="hi"?v9t(e):d9t(e)}),y9t=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,x9t=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,w9t=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,k9t=e=>`إعادة المحاولة · المحاولة ${e==null?void 0:e.attempt} · المحاولة التالية بعد ${e==null?void 0:e.seconds}ث`,S9t=e=>`Reintentando · intento ${e==null?void 0:e.attempt} · siguiente intento en ${e==null?void 0:e.seconds} s`,C9t=e=>`फिर से कोशिश · प्रयास ${e==null?void 0:e.attempt} · अगला प्रयास ${e==null?void 0:e.seconds}से में`,E9t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?x9t(e):t==="fa"?w9t(e):t==="ar"?k9t(e):t==="es"?S9t(e):t==="hi"?C9t(e):y9t(e)}),N9t=()=>"CLI is retrying…",z9t=()=>"CLI 正在重试…",j9t=()=>"CLI در حال تلاش دوباره است…",T9t=()=>"تعيد واجهة سطر الأوامر المحاولة…",A9t=()=>"La CLI está reintentando…",R9t=()=>"CLI फिर से कोशिश कर रहा है…",M9t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z9t():t==="fa"?j9t():t==="ar"?T9t():t==="es"?A9t():t==="hi"?R9t():N9t()}),O9t=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,D9t=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,L9t=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,I9t=e=>`إعادة المحاولة · المحاولة التالية بعد ${e==null?void 0:e.seconds}ث`,$9t=e=>`Reintentando · siguiente intento en ${e==null?void 0:e.seconds} s`,B9t=e=>`फिर से कोशिश · अगला प्रयास ${e==null?void 0:e.seconds}से में`,P9t=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?D9t(e):t==="fa"?L9t(e):t==="ar"?I9t(e):t==="es"?$9t(e):t==="hi"?B9t(e):O9t(e)}),F9t=()=>"Sending again…",H9t=()=>"正在重新发送…",q9t=()=>"در حال ارسال دوباره…",U9t=()=>"جارٍ إعادة الإرسال…",G9t=()=>"Reenviando…",V9t=()=>"फिर से भेजा जा रहा है…",K9t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H9t():t==="fa"?q9t():t==="ar"?U9t():t==="es"?G9t():t==="hi"?V9t():F9t()}),W9t=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,Q9t=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,X9t=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,Y9t=e=>`إعادة الإرسال بعد ${e==null?void 0:e.seconds}ث…`,Z9t=e=>`Reenviando en ${e==null?void 0:e.seconds} s…`,J9t=e=>`${e==null?void 0:e.seconds}से में फिर से भेजा जाएगा…`,eEt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Q9t(e):t==="fa"?X9t(e):t==="ar"?Y9t(e):t==="es"?Z9t(e):t==="hi"?J9t(e):W9t(e)}),tEt=()=>"Retrying…",nEt=()=>"正在重试…",rEt=()=>"در حال تلاش دوباره…",sEt=()=>"جارٍ إعادة المحاولة…",iEt=()=>"Reintentando…",aEt=()=>"फिर से कोशिश हो रही है…",cL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nEt():t==="fa"?rEt():t==="ar"?sEt():t==="es"?iEt():t==="hi"?aEt():tEt()}),oEt=()=>"Default speed",cEt=()=>"默认速度",lEt=()=>"سرعت پیش‌فرض",uEt=()=>"السرعة الافتراضية",_Et=()=>"Velocidad predeterminada",fEt=()=>"डिफ़ॉल्ट गति",dEt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cEt():t==="fa"?lEt():t==="ar"?uEt():t==="es"?_Et():t==="hi"?fEt():oEt()}),hEt=()=>"Standard",pEt=()=>"标准",mEt=()=>"استاندارد",gEt=()=>"قياسي",vEt=()=>"Estándar",bEt=()=>"स्टैंडर्ड",yEt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pEt():t==="fa"?mEt():t==="ar"?gEt():t==="es"?vEt():t==="hi"?bEt():hEt()}),xEt=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,wEt=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,kEt=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,SEt=e=>` أضِف ${e==null?void 0:e.directory} إلى PATH لاستخدامه.`,CEt=e=>` Añade ${e==null?void 0:e.directory} a tu PATH para usarlo.`,EEt=e=>` इसे इस्तेमाल करने के लिए ${e==null?void 0:e.directory} को अपने PATH में जोड़ें।`,NEt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wEt(e):t==="fa"?kEt(e):t==="ar"?SEt(e):t==="es"?CEt(e):t==="hi"?EEt(e):xEt(e)}),zEt=()=>"Appearance",jEt=()=>"外观",TEt=()=>"ظاهر",AEt=()=>"المظهر",REt=()=>"Apariencia",MEt=()=>"रूप-रंग",OEt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jEt():t==="fa"?TEt():t==="ar"?AEt():t==="es"?REt():t==="hi"?MEt():zEt()}),DEt=()=>"Check",LEt=()=>"检查",IEt=()=>"بررسی",$Et=()=>"فحص",BEt=()=>"Comprobar",PEt=()=>"जाँचें",FEt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LEt():t==="fa"?IEt():t==="ar"?$Et():t==="es"?BEt():t==="hi"?PEt():DEt()}),HEt=()=>"Check again",qEt=()=>"再次检查",UEt=()=>"بررسی دوباره",GEt=()=>"تحقق مجددًا",VEt=()=>"Volver a comprobar",KEt=()=>"फिर से जाँचें",wm=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qEt():t==="fa"?UEt():t==="ar"?GEt():t==="es"?VEt():t==="hi"?KEt():HEt()}),WEt=()=>"Check for updates",QEt=()=>"检查更新",XEt=()=>"بررسی به‌روزرسانی",YEt=()=>"التحقق من التحديثات",ZEt=()=>"Buscar actualizaciones",JEt=()=>"अपडेट के लिए जाँचें",eNt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QEt():t==="fa"?XEt():t==="ar"?YEt():t==="es"?ZEt():t==="hi"?JEt():WEt()}),tNt=()=>"Check now",nNt=()=>"立即检查",rNt=()=>"اکنون بررسی کن",sNt=()=>"التحقق الآن",iNt=()=>"Comprobar ahora",aNt=()=>"अभी जाँचें",oNt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nNt():t==="fa"?rNt():t==="ar"?sNt():t==="es"?iNt():t==="hi"?aNt():tNt()}),cNt=()=>"Check setup",lNt=()=>"检查设置",uNt=()=>"بررسی راه‌اندازی",_Nt=()=>"فحص الإعداد",fNt=()=>"Comprobar configuración",dNt=()=>"सेटअप जाँचें",hNt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lNt():t==="fa"?uNt():t==="ar"?_Nt():t==="es"?fNt():t==="hi"?dNt():cNt()}),pNt=()=>"orx checks a few times a day on its own.",mNt=()=>"orx 每天会自动检查几次。",gNt=()=>"orx روزی چند بار خودکار بررسی می‌کند.",vNt=()=>"يتحقق orx بضع مرات يوميًا تلقائيًا.",bNt=()=>"orx lo comprueba por sí solo varias veces al día.",yNt=()=>"orx खुद दिन में कुछ बार जाँच करता है।",xNt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mNt():t==="fa"?gNt():t==="ar"?vNt():t==="es"?bNt():t==="hi"?yNt():pNt()}),wNt=()=>"Choose a flavor",kNt=()=>"选择配置",SNt=()=>"انتخاب پیکربندی",CNt=()=>"اختر تكوين الموارد",ENt=()=>"Elige una opción",NNt=()=>"एक फ़्लेवर चुनें",zNt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kNt():t==="fa"?SNt():t==="ar"?CNt():t==="es"?ENt():t==="hi"?NNt():wNt()}),jNt=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,TNt=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,ANt=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,RNt=e=>`اختر تكوين الموارد لاستخدام ${e==null?void 0:e.destination} في عمليات التشغيل الجديدة.`,MNt=e=>`Elige una opción para usar ${e==null?void 0:e.destination} en las nuevas ejecuciones.`,ONt=e=>`नए रन के लिए ${e==null?void 0:e.destination} इस्तेमाल करने के लिए एक फ़्लेवर चुनें।`,DNt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?TNt(e):t==="fa"?ANt(e):t==="ar"?RNt(e):t==="es"?MNt(e):t==="hi"?ONt(e):jNt(e)}),LNt=()=>"clean",INt=()=>"无更改",$Nt=()=>"بدون تغییر",BNt=()=>"نظيف",PNt=()=>"sin cambios",FNt=()=>"साफ़",HNt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?INt():t==="fa"?$Nt():t==="ar"?BNt():t==="es"?PNt():t==="hi"?FNt():LNt()}),qNt=e=>`Already linked at ${e==null?void 0:e.link}.`,UNt=e=>`已链接到 ${e==null?void 0:e.link}。`,GNt=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,VNt=e=>`مرتبط بالفعل في ${e==null?void 0:e.link}.`,KNt=e=>`Ya está enlazado en ${e==null?void 0:e.link}.`,WNt=e=>`पहले से ${e==null?void 0:e.link} पर लिंक है।`,QNt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?UNt(e):t==="fa"?GNt(e):t==="ar"?VNt(e):t==="es"?KNt(e):t==="hi"?WNt(e):qNt(e)}),XNt=e=>`Linked ${e==null?void 0:e.link}.`,YNt=e=>`已链接 ${e==null?void 0:e.link}。`,ZNt=e=>`${e==null?void 0:e.link} پیوند شد.`,JNt=e=>`تم إنشاء الرابط ${e==null?void 0:e.link}.`,ezt=e=>`Enlazado en ${e==null?void 0:e.link}.`,tzt=e=>`${e==null?void 0:e.link} लिंक किया गया।`,nzt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?YNt(e):t==="fa"?ZNt(e):t==="ar"?JNt(e):t==="es"?ezt(e):t==="hi"?tzt(e):XNt(e)}),rzt=()=>"Close terminal",szt=()=>"关闭终端",izt=()=>"بستن ترمینال",azt=()=>"إغلاق الطرفية",ozt=()=>"Cerrar la terminal",czt=()=>"टर्मिनल बंद करें",Nz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?szt():t==="fa"?izt():t==="ar"?azt():t==="es"?ozt():t==="hi"?czt():rzt()}),lzt=()=>"Terminal closed",uzt=()=>"终端已关闭",_zt=()=>"ترمینال بسته شد",fzt=()=>"أُغلقت الطرفية",dzt=()=>"Terminal cerrada",hzt=()=>"टर्मिनल बंद हो गया",pzt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uzt():t==="fa"?_zt():t==="ar"?fzt():t==="es"?dzt():t==="hi"?hzt():lzt()}),mzt=()=>"Finished",gzt=()=>"已完成",vzt=()=>"انجام شد",bzt=()=>"اكتمل",yzt=()=>"Finalizado",xzt=()=>"पूर्ण",wzt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gzt():t==="fa"?vzt():t==="ar"?bzt():t==="es"?yzt():t==="hi"?xzt():mzt()}),kzt=()=>"Command failed",Szt=()=>"命令失败",Czt=()=>"دستور ناموفق بود",Ezt=()=>"فشل الأمر",Nzt=()=>"El comando falló",zzt=()=>"कमांड विफल रही",jzt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Szt():t==="fa"?Czt():t==="ar"?Ezt():t==="es"?Nzt():t==="hi"?zzt():kzt()}),Tzt=()=>"Running…",Azt=()=>"运行中…",Rzt=()=>"در حال اجرا…",Mzt=()=>"قيد التشغيل…",Ozt=()=>"Ejecutando…",Dzt=()=>"चल रहा है…",Lzt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Azt():t==="fa"?Rzt():t==="ar"?Mzt():t==="es"?Ozt():t==="hi"?Dzt():Tzt()}),Izt=()=>"Connect",$zt=()=>"连接",Bzt=()=>"اتصال",Pzt=()=>"اتصال",Fzt=()=>"Conectar",Hzt=()=>"कनेक्ट करें",Zk=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$zt():t==="fa"?Bzt():t==="ar"?Pzt():t==="es"?Fzt():t==="hi"?Hzt():Izt()}),qzt=()=>"Connected via GitHub CLI",Uzt=()=>"已通过 GitHub CLI 连接",Gzt=()=>"از طریق GitHub CLI متصل است",Vzt=()=>"متصل عبر واجهة GitHub لسطر الأوامر",Kzt=()=>"Conectado mediante GitHub CLI",Wzt=()=>"GitHub CLI के ज़रिए कनेक्टेड",lL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uzt():t==="fa"?Gzt():t==="ar"?Vzt():t==="es"?Kzt():t==="hi"?Wzt():qzt()}),Qzt=()=>"Connecting…",Xzt=()=>"正在连接…",Yzt=()=>"در حال اتصال…",Zzt=()=>"جارٍ الاتصال…",Jzt=()=>"Conectando…",ejt=()=>"कनेक्ट हो रहा है…",uL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xzt():t==="fa"?Yzt():t==="ar"?Zzt():t==="es"?Jzt():t==="hi"?ejt():Qzt()}),tjt=e=>`CPU cores: ${e==null?void 0:e.count}`,njt=e=>`${e==null?void 0:e.count} 个 CPU 核心`,rjt=e=>`${e==null?void 0:e.count} هستهٔ CPU`,sjt=e=>`أنوية المعالج: ${e==null?void 0:e.count}`,ijt=e=>`Núcleos de CPU: ${e==null?void 0:e.count}`,ajt=e=>`CPU कोर: ${e==null?void 0:e.count}`,ojt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?njt(e):t==="fa"?rjt(e):t==="ar"?sjt(e):t==="es"?ijt(e):t==="hi"?ajt(e):tjt(e)}),cjt=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",ljt=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",ujt=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",_jt=()=>"أنشئ مستودعًا خاصًا وارفع فروع التجارب تلقائيًا ليطّلع عليها المتعاونون.",fjt=()=>"Crear un repositorio privado y subir automáticamente las ramas de los experimentos para que las vean tus colaboradores.",djt=()=>"एक निजी रिपॉज़िटरी बनाएं और सहयोगी दृश्यता के लिए प्रयोग ब्रांच अपने आप पुश करें।",hjt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ljt():t==="fa"?ujt():t==="ar"?_jt():t==="es"?fjt():t==="hi"?djt():cjt()}),pjt=()=>"the current project",mjt=()=>"当前项目",gjt=()=>"پروژهٔ فعلی",vjt=()=>"المشروع الحالي",bjt=()=>"el proyecto actual",yjt=()=>"मौजूदा प्रोजेक्ट",xjt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mjt():t==="fa"?gjt():t==="ar"?vjt():t==="es"?bjt():t==="hi"?yjt():pjt()}),wjt=e=>`${e==null?void 0:e.value} (custom)`,kjt=e=>`${e==null?void 0:e.value}(自定义)`,Sjt=e=>`${e==null?void 0:e.value} (سفارشی)`,Cjt=e=>`${e==null?void 0:e.value} (مخصص)`,Ejt=e=>`${e==null?void 0:e.value} (personalizado)`,Njt=e=>`${e==null?void 0:e.value} (कस्टम)`,zjt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?kjt(e):t==="fa"?Sjt(e):t==="ar"?Cjt(e):t==="es"?Ejt(e):t==="hi"?Njt(e):wjt(e)}),jjt=()=>"detached",Tjt=()=>"分离头指针",Ajt=()=>"جدا از شاخه",Rjt=()=>"منفصل",Mjt=()=>"desacoplado",Ojt=()=>"डिटैच्ड",Jk=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tjt():t==="fa"?Ajt():t==="ar"?Rjt():t==="es"?Mjt():t==="hi"?Ojt():jjt()}),Djt=()=>"Disconnected",Ljt=()=>"已断开连接",Ijt=()=>"قطع اتصال",$jt=()=>"غير متصل",Bjt=()=>"Desconectado",Pjt=()=>"डिस्कनेक्ट हो गया",_L=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ljt():t==="fa"?Ijt():t==="ar"?$jt():t==="es"?Bjt():t==="hi"?Pjt():Djt()}),Fjt=()=>"Environment tab",Hjt=()=>"环境标签页",qjt=()=>"زبانهٔ محیط",Ujt=()=>"تبويب البيئة",Gjt=()=>"pestaña Entorno",Vjt=()=>"एनवायरनमेंट टैब",Kjt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hjt():t==="fa"?qjt():t==="ar"?Ujt():t==="es"?Gjt():t==="hi"?Vjt():Fjt()}),Wjt=()=>"Free models · No sign-in required",Qjt=()=>"免费模型 · 无需登录",Xjt=()=>"مدل‌های رایگان · بدون نیاز به ورود",Yjt=()=>"نماذج مجانية · لا يلزم تسجيل الدخول",Zjt=()=>"Modelos gratuitos · No es necesario iniciar sesión",Jjt=()=>"मुफ़्त मॉडल · साइन-इन ज़रूरी नहीं",eTt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qjt():t==="fa"?Xjt():t==="ar"?Yjt():t==="es"?Zjt():t==="hi"?Jjt():Wjt()}),tTt=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,nTt=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,rTt=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,sTt=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,iTt=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,aTt=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,oTt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nTt(e):t==="fa"?rTt(e):t==="ar"?sTt(e):t==="es"?iTt(e):t==="hi"?aTt(e):tTt(e)}),cTt=()=>"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.",lTt=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",uTt=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",_Tt=()=>"رفض GitHub رفع التغييرات لأن هذا المستودع مؤرشف وللقراءة فقط. لا يزال المشروع المحلي متاحًا. ألغِ أرشفة المستودع على GitHub، ثم فعّل المزامنة هنا.",fTt=()=>"GitHub rechazó el push porque este repositorio está archivado y es de solo lectura. El proyecto local sigue disponible. Desarchiva el repositorio en GitHub y vuelve a activar la sincronización aquí.",dTt=()=>"GitHub ने पुश अस्वीकार कर दिया क्योंकि यह रिपॉज़िटरी आर्काइव और रीड-ओनली है। लोकल प्रोजेक्ट अब भी उपलब्ध है। GitHub पर रिपॉज़िटरी को अनआर्काइव करें, फिर यहाँ सिंकिंग चालू करें।",hTt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lTt():t==="fa"?uTt():t==="ar"?_Tt():t==="es"?fTt():t==="hi"?dTt():cTt()}),pTt=()=>"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.",mTt=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",gTt=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",vTt=()=>"يحتوي GitHub على تغييرات ليست في هذا المشروع المحلي. اسحب أحدث تغييرات GitHub وحُلّ أي تعارضات في Git، ثم أعد محاولة تفعيل المزامنة.",bTt=()=>"GitHub tiene cambios que no están en este proyecto local. Descarga los últimos cambios de GitHub, resuelve los conflictos en Git y vuelve a intentar activar la sincronización.",yTt=()=>"GitHub में ऐसे बदलाव हैं जो इस लोकल प्रोजेक्ट में नहीं हैं। नवीनतम GitHub बदलाव पुल करें और Git में किसी भी टकराव को सुलझाएं, फिर सिंकिंग फिर से चालू करने की कोशिश करें।",xTt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mTt():t==="fa"?gTt():t==="ar"?vTt():t==="es"?bTt():t==="hi"?yTt():pTt()}),wTt=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",kTt=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",STt=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",CTt=()=>"رفض GitHub رفع التغييرات. تأكد من أن حسابك المتصل يملك صلاحية الكتابة على هذا المستودع، ثم حاول مجددًا.",ETt=()=>"GitHub rechazó el push. Asegúrate de que tu cuenta conectada tiene permiso de escritura en este repositorio y vuelve a intentarlo.",NTt=()=>"GitHub ने पुश अस्वीकार कर दिया। सुनिश्चित करें कि आपके कनेक्टेड खाते के पास इस रिपॉज़िटरी में राइट एक्सेस है, फिर फिर से कोशिश करें।",zTt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kTt():t==="fa"?STt():t==="ar"?CTt():t==="es"?ETt():t==="hi"?NTt():wTt()}),jTt=e=>`GPU × ${e==null?void 0:e.count}`,TTt=e=>`${e==null?void 0:e.count} 个 GPU`,ATt=e=>`${e==null?void 0:e.count} پردازندهٔ گرافیکی`,RTt=e=>`معالج رسومات × ${e==null?void 0:e.count}`,MTt=e=>`GPU × ${e==null?void 0:e.count}`,OTt=e=>`GPU × ${e==null?void 0:e.count}`,DTt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?TTt(e):t==="fa"?ATt(e):t==="ar"?RTt(e):t==="es"?MTt(e):t==="hi"?OTt(e):jTt(e)}),LTt=()=>"has changes",ITt=()=>"有更改",$Tt=()=>"دارای تغییر",BTt=()=>"به تغييرات",PTt=()=>"con cambios",FTt=()=>"बदलाव हैं",HTt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ITt():t==="fa"?$Tt():t==="ar"?BTt():t==="es"?PTt():t==="hi"?FTt():LTt()}),qTt=e=>`This token is valid but does not report whether it can launch Jobs; OAuth tokens from ${e==null?void 0:e.login} never do. Launches may still work. For a definitive check, save a write-scoped token from ${e==null?void 0:e.url}.`,UTt=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,GTt=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,VTt=e=>`هذا الرمز صالح لكنه لا يبيّن ما إن كان قادرًا على إطلاق المهام؛ ورموز OAuth من ${e==null?void 0:e.login} لا تبيّن ذلك أبدًا. قد ينجح الإطلاق رغم ذلك. للتحقق القاطع، احفظ رمزًا بصلاحية الكتابة من ${e==null?void 0:e.url}.`,KTt=e=>`Este token es válido, pero no indica si puede lanzar Jobs; los tokens OAuth de ${e==null?void 0:e.login} nunca lo indican. Puede que los lanzamientos funcionen igualmente. Para comprobarlo con seguridad, guarda un token con permiso de escritura desde ${e==null?void 0:e.url}.`,WTt=e=>`यह टोकन मान्य है पर यह नहीं बताता कि यह Jobs लॉन्च कर सकता है या नहीं; ${e==null?void 0:e.login} से मिले OAuth टोकन कभी नहीं बताते। लॉन्च फिर भी काम कर सकता है। निश्चित जाँच के लिए, ${e==null?void 0:e.url} से एक राइट-स्कोप्ड टोकन सेव करें।`,QTt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?UTt(e):t==="fa"?GTt(e):t==="ar"?VTt(e):t==="es"?KTt(e):t==="hi"?WTt(e):qTt(e)}),XTt=()=>"This token is valid, but cannot submit Hugging Face Jobs. Create a token with Jobs write permission in Hugging Face token settings, then replace it here.",YTt=()=>"此令牌有效,但无法提交 Hugging Face 任务。请在 Hugging Face 令牌设置中创建具有 Jobs 写入权限的令牌,然后在此处替换。",ZTt=()=>"این توکن معتبر است، اما اجازهٔ ارسال کار به Hugging Face را ندارد. در تنظیمات توکن Hugging Face، توکنی با مجوز نوشتن Jobs بسازید و آن را اینجا جایگزین کنید.",JTt=()=>"هذا الرمز صالح لكنه لا يستطيع إرسال مهام Hugging Face. أنشئ رمزًا بصلاحية كتابة المهام في إعدادات رموز Hugging Face، ثم استبدله هنا.",eAt=()=>"Este token es válido, pero no puede enviar Hugging Face Jobs. Crea un token con permiso de escritura en Jobs desde la configuración de tokens de Hugging Face y reemplázalo aquí.",tAt=()=>"यह टोकन मान्य है, पर Hugging Face Jobs सबमिट नहीं कर सकता। Hugging Face टोकन सेटिंग्स में Jobs राइट अनुमति वाला टोकन बनाएं, फिर इसे यहाँ बदलें।",nAt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YTt():t==="fa"?ZTt():t==="ar"?JTt():t==="es"?eAt():t==="hi"?tAt():XTt()}),rAt=()=>"Install",sAt=()=>"安装",iAt=()=>"نصب",aAt=()=>"تثبيت",oAt=()=>"Instalar",cAt=()=>"इंस्टॉल करें",lAt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sAt():t==="fa"?iAt():t==="ar"?aAt():t==="es"?oAt():t==="hi"?cAt():rAt()}),uAt=e=>`Adds ${e==null?void 0:e.command} to your terminal, pointing at this app, so the CLI and app are always the same version.`,_At=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,fAt=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,dAt=e=>`يضيف ${e==null?void 0:e.command} إلى طرفيتك موجّهًا إلى هذا التطبيق، بحيث تكون واجهة سطر الأوامر والتطبيق دائمًا بالإصدار نفسه.`,hAt=e=>`Añade ${e==null?void 0:e.command} a tu terminal, apuntando a esta app, para que la CLI y la app tengan siempre la misma versión.`,pAt=e=>`आपके टर्मिनल में ${e==null?void 0:e.command} जोड़ता है, जो इसी ऐप की ओर इशारा करता है, ताकि CLI और ऐप हमेशा एक ही वर्शन के रहें।`,mAt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_At(e):t==="fa"?fAt(e):t==="ar"?dAt(e):t==="es"?hAt(e):t==="hi"?pAt(e):uAt(e)}),gAt=e=>`Install the ${e==null?void 0:e.command} command`,vAt=e=>`安装 ${e==null?void 0:e.command} 命令`,bAt=e=>`نصب فرمان ${e==null?void 0:e.command}`,yAt=e=>`تثبيت أمر ${e==null?void 0:e.command}`,xAt=e=>`Instalar el comando ${e==null?void 0:e.command}`,wAt=e=>`${e==null?void 0:e.command} कमांड इंस्टॉल करें`,kAt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?vAt(e):t==="fa"?bAt(e):t==="ar"?yAt(e):t==="es"?xAt(e):t==="hi"?wAt(e):gAt(e)}),SAt=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",CAt=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",EAt=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",NAt=()=>"ثبّت واجهة GitHub لسطر الأوامر، ثم نفّذ `gh auth login` في طرفيتك.",zAt=()=>"Instala GitHub CLI y ejecuta `gh auth login` en tu terminal.",jAt=()=>"GitHub CLI इंस्टॉल करें, फिर अपने टर्मिनल में `gh auth login` चलाएं।",TAt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CAt():t==="fa"?EAt():t==="ar"?NAt():t==="es"?zAt():t==="hi"?jAt():SAt()}),AAt=()=>"Install the new release now instead of waiting for the background update.",RAt=()=>"立即安装新版本,无需等待后台更新。",MAt=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",OAt=()=>"ثبّت الإصدار الجديد الآن بدلًا من انتظار التحديث في الخلفية.",DAt=()=>"Instala la nueva versión ahora en lugar de esperar a la actualización en segundo plano.",LAt=()=>"बैकग्राउंड अपडेट का इंतज़ार करने की बजाय अभी नया रिलीज़ इंस्टॉल करें।",IAt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RAt():t==="fa"?MAt():t==="ar"?OAt():t==="es"?DAt():t==="hi"?LAt():AAt()}),$At=()=>"Discard your unsaved Kubernetes changes?",BAt=()=>"要放弃未保存的 Kubernetes 更改吗?",PAt=()=>"تغییرات ذخیره‌نشدهٔ Kubernetes کنار گذاشته شود؟",FAt=()=>"تجاهل تغييرات Kubernetes غير المحفوظة؟",HAt=()=>"¿Descartar los cambios sin guardar de Kubernetes?",qAt=()=>"आपके सेव न किए गए Kubernetes बदलाव छोड़ें?",UAt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BAt():t==="fa"?PAt():t==="ar"?FAt():t==="es"?HAt():t==="hi"?qAt():$At()}),GAt=()=>"Key from",VAt=()=>"密钥来自",KAt=()=>"کلید از",WAt=()=>"المفتاح من",QAt=()=>"Clave tomada de la",XAt=()=>"की स्रोत",YAt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VAt():t==="fa"?KAt():t==="ar"?WAt():t==="es"?QAt():t==="hi"?XAt():GAt()}),ZAt=()=>"Use current kubectl context",JAt=()=>"使用当前 kubectl 上下文",eRt=()=>"استفاده از کانتکست فعلی kubectl",tRt=()=>"استخدام سياق kubectl الحالي",nRt=()=>"Usar el contexto actual de kubectl",rRt=()=>"मौजूदा kubectl कॉन्टेक्स्ट इस्तेमाल करें",sRt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JAt():t==="fa"?eRt():t==="ar"?tRt():t==="es"?nRt():t==="hi"?rRt():ZAt()}),iRt=e=>`Use current context (${e==null?void 0:e.context})`,aRt=e=>`使用当前上下文(${e==null?void 0:e.context})`,oRt=e=>`استفاده از کانتکست فعلی (${e==null?void 0:e.context})`,cRt=e=>`استخدام السياق الحالي (${e==null?void 0:e.context})`,lRt=e=>`Usar el contexto actual (${e==null?void 0:e.context})`,uRt=e=>`मौजूदा कॉन्टेक्स्ट इस्तेमाल करें (${e==null?void 0:e.context})`,_Rt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?aRt(e):t==="fa"?oRt(e):t==="ar"?cRt(e):t==="es"?lRt(e):t==="hi"?uRt(e):iRt(e)}),fRt=()=>"Language",dRt=()=>"语言",hRt=()=>"زبان",pRt=()=>"اللغة",mRt=()=>"Idioma",gRt=()=>"भाषा",vRt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dRt():t==="fa"?hRt():t==="ar"?pRt():t==="es"?mRt():t==="hi"?gRt():fRt()}),bRt=e=>`Run ${e==null?void 0:e.command} in a terminal to sign in.`,yRt=e=>`在终端中运行 ${e==null?void 0:e.command} 以登录。`,xRt=e=>`برای ورود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,wRt=e=>`نفّذ ${e==null?void 0:e.command} في الطرفية لتسجيل الدخول.`,kRt=e=>`Ejecuta ${e==null?void 0:e.command} en una terminal para iniciar sesión.`,SRt=e=>`साइन इन करने के लिए टर्मिनल में ${e==null?void 0:e.command} चलाएं।`,CRt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?yRt(e):t==="fa"?xRt(e):t==="ar"?wRt(e):t==="es"?kRt(e):t==="hi"?SRt(e):bRt(e)}),ERt=()=>"Make default",NRt=()=>"设为默认值",zRt=()=>"پیش‌فرض شود",jRt=()=>"جعله افتراضيًا",TRt=()=>"Establecer como predeterminado",ARt=()=>"डिफ़ॉल्ट बनाएं",RRt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NRt():t==="fa"?zRt():t==="ar"?jRt():t==="es"?TRt():t==="hi"?ARt():ERt()}),MRt=()=>"Modal credentials are set in the process environment. Remove those overrides before replacing the token here.",ORt=()=>"Modal 凭据已在进程环境中设置。请先移除这些覆盖设置,再在此处替换令牌。",DRt=()=>"اعتبارنامه‌های Modal در محیط فرایند تنظیم شده‌اند. پیش از جایگزینی توکن در اینجا، این تنظیمات را حذف کنید.",LRt=()=>"بيانات اعتماد Modal مضبوطة في بيئة العملية. أزِل تلك التجاوزات قبل استبدال الرمز هنا.",IRt=()=>"Las credenciales de Modal están definidas en el entorno del proceso. Elimínalas antes de reemplazar el token aquí.",$Rt=()=>"Modal क्रेडेंशियल प्रोसेस एनवायरनमेंट में सेट हैं। यहाँ सेव टोकन बदलने से पहले उन ओवरराइड को हटाएं।",BRt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ORt():t==="fa"?DRt():t==="ar"?LRt():t==="es"?IRt():t==="hi"?$Rt():MRt()}),PRt=()=>"Replace token ID",FRt=()=>"替换令牌 ID",HRt=()=>"جایگزینی شناسهٔ توکن",qRt=()=>"استبدال معرّف الرمز",URt=()=>"Reemplazar ID del token",GRt=()=>"टोकन ID बदलें",VRt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FRt():t==="fa"?HRt():t==="ar"?qRt():t==="es"?URt():t==="hi"?GRt():PRt()}),KRt=()=>"Replace token secret",WRt=()=>"替换令牌密钥",QRt=()=>"جایگزینی رمز توکن",XRt=()=>"استبدال سرّ الرمز",YRt=()=>"Reemplazar secreto del token",ZRt=()=>"टोकन सीक्रेट बदलें",JRt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WRt():t==="fa"?QRt():t==="ar"?XRt():t==="es"?YRt():t==="hi"?ZRt():KRt()}),eMt=()=>"How to get a Modal token",tMt=()=>"如何获取 Modal 令牌",nMt=()=>"روش دریافت توکن Modal",rMt=()=>"كيفية الحصول على رمز Modal",sMt=()=>"Cómo obtener un token de Modal",iMt=()=>"Modal टोकन कैसे लें",aMt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tMt():t==="fa"?nMt():t==="ar"?rMt():t==="es"?sMt():t==="hi"?iMt():eMt()}),oMt=()=>"Token ID",cMt=()=>"令牌 ID",lMt=()=>"شناسهٔ توکن",uMt=()=>"معرّف الرمز",_Mt=()=>"ID del token",fMt=()=>"टोकन ID",dMt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cMt():t==="fa"?lMt():t==="ar"?uMt():t==="es"?_Mt():t==="hi"?fMt():oMt()}),hMt=()=>"Token secret",pMt=()=>"令牌密钥",mMt=()=>"رمز توکن",gMt=()=>"سرّ الرمز",vMt=()=>"Secreto del token",bMt=()=>"टोकन सीक्रेट",yMt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pMt():t==="fa"?mMt():t==="ar"?gMt():t==="es"?vMt():t==="hi"?bMt():hMt()}),xMt=e=>`${e==null?void 0:e.count} models available — ${e==null?void 0:e.models}`,wMt=e=>`${e==null?void 0:e.count} 个模型可用 — ${e==null?void 0:e.models}`,kMt=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,SMt=e=>`النماذج المتاحة: ${e==null?void 0:e.count} — ${e==null?void 0:e.models}`,CMt=e=>`Modelos disponibles (${e==null?void 0:e.count}): ${e==null?void 0:e.models}`,EMt=e=>`${e==null?void 0:e.count} मॉडल उपलब्ध — ${e==null?void 0:e.models}`,NMt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wMt(e):t==="fa"?kMt(e):t==="ar"?SMt(e):t==="es"?CMt(e):t==="hi"?EMt(e):xMt(e)}),zMt=e=>`Needs ${e==null?void 0:e.tool}`,jMt=e=>`需要 ${e==null?void 0:e.tool}`,TMt=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,AMt=e=>`يحتاج إلى ${e==null?void 0:e.tool}`,RMt=e=>`Requiere ${e==null?void 0:e.tool}`,MMt=e=>`${e==null?void 0:e.tool} की ज़रूरत है`,OMt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?jMt(e):t==="fa"?TMt(e):t==="ar"?AMt(e):t==="es"?RMt(e):t==="hi"?MMt(e):zMt(e)}),DMt=()=>"Needs tools",LMt=()=>"缺少工具",IMt=()=>"به ابزارها نیاز دارد",$Mt=()=>"يحتاج إلى أدوات",BMt=()=>"Requiere herramientas",PMt=()=>"टूल की ज़रूरत है",FMt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LMt():t==="fa"?IMt():t==="ar"?$Mt():t==="es"?BMt():t==="hi"?PMt():DMt()}),HMt=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,qMt=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,UMt=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,GMt=e=>`تستخدم عمليات التشغيل الجديدة ${e==null?void 0:e.destination} ما لم تُحدَّد بيئة تنفيذ أخرى.`,VMt=e=>`Las nuevas ejecuciones usan ${e==null?void 0:e.destination}, salvo que se indique otro backend.`,KMt=e=>`जब तक कोई और बैकएंड न बताया जाए, नए रन ${e==null?void 0:e.destination} इस्तेमाल करते हैं।`,WMt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?qMt(e):t==="fa"?UMt(e):t==="ar"?GMt(e):t==="es"?VMt(e):t==="hi"?KMt(e):HMt(e)}),QMt=()=>"New runs use SSH; choose a host when launching.",XMt=()=>"新运行将使用 SSH;启动时请选择主机。",YMt=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",ZMt=()=>"تستخدم عمليات التشغيل الجديدة SSH؛ اختر مضيفًا عند الإطلاق.",JMt=()=>"Las nuevas ejecuciones usan SSH; elige un host al lanzarlas.",eOt=()=>"नए रन SSH इस्तेमाल करते हैं; लॉन्च करते समय एक होस्ट चुनें।",tOt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XMt():t==="fa"?YMt():t==="ar"?ZMt():t==="es"?JMt():t==="hi"?eOt():QMt()}),nOt=()=>"New token",rOt=()=>"新令牌",sOt=()=>"توکن جدید",iOt=()=>"رمز جديد",aOt=()=>"Nuevo token",oOt=()=>"नया टोकन",cOt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rOt():t==="fa"?sOt():t==="ar"?iOt():t==="es"?aOt():t==="hi"?oOt():nOt()}),lOt=()=>"No default flavor",uOt=()=>"不设默认配置",_Ot=()=>"بدون پیکربندی پیش‌فرض",fOt=()=>"لا يوجد تكوين افتراضي للموارد",dOt=()=>"Sin opción predeterminada",hOt=()=>"कोई डिफ़ॉल्ट फ़्लेवर नहीं",pOt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uOt():t==="fa"?_Ot():t==="ar"?fOt():t==="es"?dOt():t==="hi"?hOt():lOt()}),mOt=()=>"none",gOt=()=>"无",vOt=()=>"هیچ‌کدام",bOt=()=>"لا شيء",yOt=()=>"ninguno",xOt=()=>"कोई नहीं",eS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gOt():t==="fa"?vOt():t==="ar"?bOt():t==="es"?yOt():t==="hi"?xOt():mOt()}),wOt=()=>"Not connected",kOt=()=>"未连接",SOt=()=>"متصل نیست",COt=()=>"غير متصل",EOt=()=>"No conectado",NOt=()=>"कनेक्टेड नहीं",fL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kOt():t==="fa"?SOt():t==="ar"?COt():t==="es"?EOt():t==="hi"?NOt():wOt()}),zOt=()=>"not found on PATH",jOt=()=>"在 PATH 中未找到",TOt=()=>"در PATH پیدا نشد",AOt=()=>"غير موجود في PATH",ROt=()=>"no se encontró en el PATH",MOt=()=>"PATH पर नहीं मिला",OOt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jOt():t==="fa"?TOt():t==="ar"?AOt():t==="es"?ROt():t==="hi"?MOt():zOt()}),DOt=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,LOt=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,IOt=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,$Ot=e=>`${e==null?void 0:e.context} (ليس في kubeconfig)`,BOt=e=>`${e==null?void 0:e.context} (no está en kubeconfig)`,POt=e=>`${e==null?void 0:e.context} (kubeconfig में नहीं)`,FOt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?LOt(e):t==="fa"?IOt(e):t==="ar"?$Ot(e):t==="es"?BOt(e):t==="hi"?POt(e):DOt(e)}),HOt=()=>"not initialized",qOt=()=>"尚未初始化",UOt=()=>"راه‌اندازی نشده",GOt=()=>"غير مهيّأ",VOt=()=>"sin inicializar",KOt=()=>"शुरू नहीं किया गया",WOt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qOt():t==="fa"?UOt():t==="ar"?GOt():t==="es"?VOt():t==="hi"?KOt():HOt()}),QOt=()=>"Not set",XOt=()=>"未设置",YOt=()=>"تنظیم نشده",ZOt=()=>"غير مضبوط",JOt=()=>"Sin definir",eDt=()=>"सेट नहीं",p3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XOt():t==="fa"?YOt():t==="ar"?ZOt():t==="es"?JOt():t==="hi"?eDt():QOt()}),tDt=()=>"OAuth (subscription login)",nDt=()=>"OAuth(订阅登录)",rDt=()=>"OAuth (ورود با اشتراک)",sDt=()=>"OAuth (تسجيل دخول الاشتراك)",iDt=()=>"OAuth (inicio de sesión con suscripción)",aDt=()=>"OAuth (सब्सक्रिप्शन लॉगिन)",oDt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nDt():t==="fa"?rDt():t==="ar"?sDt():t==="es"?iDt():t==="hi"?aDt():tDt()}),cDt=e=>`The old copy was left at ${e==null?void 0:e.path} on a different disk. You can delete it after confirming everything works.`,lDt=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,uDt=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,_Dt=e=>`تُركت النسخة القديمة في ${e==null?void 0:e.path} على قرص مختلف. يمكنك حذفها بعد التأكد من أن كل شيء يعمل.`,fDt=e=>`La copia anterior se dejó en ${e==null?void 0:e.path}, en otro disco. Puedes eliminarla cuando confirmes que todo funciona.`,dDt=e=>`पुरानी कॉपी एक अलग डिस्क पर ${e==null?void 0:e.path} पर छोड़ दी गई थी। सब कुछ ठीक होने की पुष्टि के बाद आप इसे हटा सकते हैं।`,hDt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?lDt(e):t==="fa"?uDt(e):t==="ar"?_Dt(e):t==="es"?fDt(e):t==="hi"?dDt(e):cDt(e)}),pDt=()=>"Setting up…",mDt=()=>"正在设置…",gDt=()=>"در حال راه‌اندازی…",vDt=()=>"جارٍ الإعداد…",bDt=()=>"Configurando…",yDt=()=>"सेट अप हो रहा है…",xDt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mDt():t==="fa"?gDt():t==="ar"?vDt():t==="es"?bDt():t==="hi"?yDt():pDt()}),wDt=()=>"Account",kDt=()=>"账户",SDt=()=>"حساب",CDt=()=>"الحساب",EDt=()=>"Cuenta",NDt=()=>"खाता",tS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kDt():t==="fa"?SDt():t==="ar"?CDt():t==="es"?EDt():t==="hi"?NDt():wDt()}),zDt=()=>"Add one with",jDt=()=>"使用以下命令添加:",TDt=()=>"یکی با این فرمان اضافه کنید:",ADt=()=>"أضِف واحدًا عبر",RDt=()=>"Añade una con",MDt=()=>"इसके साथ एक जोड़ें",ODt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jDt():t==="fa"?TDt():t==="ar"?ADt():t==="es"?RDt():t==="hi"?MDt():zDt()}),DDt=()=>"Add variable",LDt=()=>"添加变量",IDt=()=>"افزودن متغیر",$Dt=()=>"إضافة متغيّر",BDt=()=>"Añadir variable",PDt=()=>"वेरिएबल जोड़ें",FDt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LDt():t==="fa"?IDt():t==="ar"?$Dt():t==="es"?BDt():t==="hi"?PDt():DDt()}),HDt=()=>"Agent models",qDt=()=>"智能体模型",UDt=()=>"مدل‌های عامل",GDt=()=>"نماذج الوكيل",VDt=()=>"Modelos de los agentes",KDt=()=>"एजेंट मॉडल",WDt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qDt():t==="fa"?UDt():t==="ar"?GDt():t==="es"?VDt():t==="hi"?KDt():HDt()}),QDt=()=>"Anonymous usage analytics",XDt=()=>"匿名使用情况分析",YDt=()=>"تحلیل ناشناس استفاده",ZDt=()=>"تحليلات استخدام مجهولة الهوية",JDt=()=>"Estadísticas de uso anónimas",eLt=()=>"अनाम उपयोग एनालिटिक्स",zz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XDt():t==="fa"?YDt():t==="ar"?ZDt():t==="es"?JDt():t==="hi"?eLt():QDt()}),tLt=()=>"Auth",nLt=()=>"身份验证",rLt=()=>"احراز هویت",sLt=()=>"المصادقة",iLt=()=>"Autenticación",aLt=()=>"ऑथ",oLt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nLt():t==="fa"?rLt():t==="ar"?sLt():t==="es"?iLt():t==="hi"?aLt():tLt()}),cLt=()=>"Authentication",lLt=()=>"身份验证",uLt=()=>"احراز هویت",_Lt=()=>"المصادقة",fLt=()=>"Autenticación",dLt=()=>"प्रमाणीकरण",dL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lLt():t==="fa"?uLt():t==="ar"?_Lt():t==="es"?fLt():t==="hi"?dLt():cLt()}),hLt=()=>"Back to Compute",pLt=()=>"返回算力设置",mLt=()=>"بازگشت به رایانش",gLt=()=>"العودة إلى الحوسبة",vLt=()=>"Volver a Cómputo",bLt=()=>"कंप्यूट पर वापस जाएं",hL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pLt():t==="fa"?mLt():t==="ar"?gLt():t==="es"?vLt():t==="hi"?bLt():hLt()}),yLt=()=>"Backend",xLt=()=>"后端",wLt=()=>"بک‌اند",kLt=()=>"بيئة التنفيذ",SLt=()=>"Backend",CLt=()=>"बैकएंड",ELt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xLt():t==="fa"?wLt():t==="ar"?kLt():t==="es"?SLt():t==="hi"?CLt():yLt()}),NLt=()=>"Baseline",zLt=()=>"基线",jLt=()=>"خط مبنا",TLt=()=>"الأساس المرجعي",ALt=()=>"Rama base",RLt=()=>"बेसलाइन",MLt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zLt():t==="fa"?jLt():t==="ar"?TLt():t==="es"?ALt():t==="hi"?RLt():NLt()}),OLt=()=>"Binary",DLt=()=>"可执行文件",LLt=()=>"فایل اجرایی",ILt=()=>"الملف التنفيذي",$Lt=()=>"Binario",BLt=()=>"बाइनरी",PLt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DLt():t==="fa"?LLt():t==="ar"?ILt():t==="es"?$Lt():t==="hi"?BLt():OLt()}),FLt=()=>"Cancel",HLt=()=>"取消",qLt=()=>"لغو",ULt=()=>"إلغاء",GLt=()=>"Cancelar",VLt=()=>"रद्द करें",Q_=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HLt():t==="fa"?qLt():t==="ar"?ULt():t==="es"?GLt():t==="hi"?VLt():FLt()}),KLt=()=>"Cancel new variable",WLt=()=>"取消新变量",QLt=()=>"لغو متغیر جدید",XLt=()=>"إلغاء المتغيّر الجديد",YLt=()=>"Cancelar nueva variable",ZLt=()=>"नया वेरिएबल रद्द करें",JLt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WLt():t==="fa"?QLt():t==="ar"?XLt():t==="es"?YLt():t==="hi"?ZLt():KLt()}),eIt=()=>"Checking compute targets…",tIt=()=>"正在检查算力目标…",nIt=()=>"در حال بررسی مقصدهای رایانشی…",rIt=()=>"جارٍ التحقق من أهداف الحوسبة…",sIt=()=>"Comprobando destinos de cómputo…",iIt=()=>"कंप्यूट टारगेट जाँचे जा रहे हैं…",aIt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tIt():t==="fa"?nIt():t==="ar"?rIt():t==="es"?sIt():t==="hi"?iIt():eIt()}),oIt=()=>"Checking kubectl…",cIt=()=>"正在检查 kubectl…",lIt=()=>"در حال بررسی kubectl…",uIt=()=>"جارٍ التحقق من kubectl…",_It=()=>"Comprobando kubectl…",fIt=()=>"kubectl जाँचा जा रहा है…",dIt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cIt():t==="fa"?lIt():t==="ar"?uIt():t==="es"?_It():t==="hi"?fIt():oIt()}),hIt=()=>"Checking Modal…",pIt=()=>"正在检查 Modal…",mIt=()=>"در حال بررسی Modal…",gIt=()=>"جارٍ التحقق من Modal…",vIt=()=>"Comprobando Modal…",bIt=()=>"Modal जाँचा जा रहा है…",yIt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pIt():t==="fa"?mIt():t==="ar"?gIt():t==="es"?vIt():t==="hi"?bIt():hIt()}),xIt=()=>"Choose a preset flavor",wIt=()=>"选择预设规格",kIt=()=>"یک پیکربندی آماده انتخاب کنید",SIt=()=>"اختر تكوينًا محددًا مسبقًا للموارد",CIt=()=>"Elige una opción predefinida",EIt=()=>"एक प्रीसेट फ़्लेवर चुनें",jz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wIt():t==="fa"?kIt():t==="ar"?SIt():t==="es"?CIt():t==="hi"?EIt():xIt()}),NIt=()=>"cluster default",zIt=()=>"集群默认值",jIt=()=>"پیش‌فرض خوشه",TIt=()=>"افتراضي العنقود",AIt=()=>"valor predeterminado del clúster",RIt=()=>"क्लस्टर डिफ़ॉल्ट",Tz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zIt():t==="fa"?jIt():t==="ar"?TIt():t==="es"?AIt():t==="hi"?RIt():NIt()}),MIt=()=>"cluster default (e.g. 4h, 30m)",OIt=()=>"集群默认值(例如 4h、30m)",DIt=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",LIt=()=>"افتراضي العنقود (مثل 4h أو 30m)",IIt=()=>"valor predeterminado del clúster (p. ej., 4h, 30m)",$It=()=>"क्लस्टर डिफ़ॉल्ट (जैसे 4h, 30m)",BIt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OIt():t==="fa"?DIt():t==="ar"?LIt():t==="es"?IIt():t==="hi"?$It():MIt()}),PIt=()=>"Cluster unreachable",FIt=()=>"无法连接集群",HIt=()=>"خوشه در دسترس نیست",qIt=()=>"تعذّر الوصول إلى العنقود",UIt=()=>"Clúster inaccesible",GIt=()=>"क्लस्टर तक नहीं पहुँचा जा सका",VIt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FIt():t==="fa"?HIt():t==="ar"?qIt():t==="es"?UIt():t==="hi"?GIt():PIt()}),KIt=()=>"Compute",WIt=()=>"算力",QIt=()=>"رایانش",XIt=()=>"الحوسبة",YIt=()=>"Cómputo",ZIt=()=>"कंप्यूट",pL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WIt():t==="fa"?QIt():t==="ar"?XIt():t==="es"?YIt():t==="hi"?ZIt():KIt()}),JIt=()=>"Connect compute backends and choose where new runs execute.",e$t=()=>"连接算力后端,并选择新运行的执行位置。",t$t=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",n$t=()=>"اربط بيئات التنفيذ واختر أين تُنفَّذ عمليات التشغيل الجديدة.",r$t=()=>"Conecta backends de cómputo y elige dónde se lanzan las nuevas ejecuciones.",s$t=()=>"कंप्यूट बैकएंड कनेक्ट करें और चुनें कि नए रन कहाँ चलेंगे।",i$t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?e$t():t==="fa"?t$t():t==="ar"?n$t():t==="es"?r$t():t==="hi"?s$t():JIt()}),a$t=()=>"Connected",o$t=()=>"已连接",c$t=()=>"متصل",l$t=()=>"متصل",u$t=()=>"Conectado",_$t=()=>"कनेक्टेड",f$t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?o$t():t==="fa"?c$t():t==="ar"?l$t():t==="es"?u$t():t==="hi"?_$t():a$t()}),d$t=()=>"Context",h$t=()=>"上下文",p$t=()=>"زمینه",m$t=()=>"السياق",g$t=()=>"Contexto",v$t=()=>"कॉन्टेक्स्ट",b$t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?h$t():t==="fa"?p$t():t==="ar"?m$t():t==="es"?g$t():t==="hi"?v$t():d$t()}),y$t=()=>"Current",x$t=()=>"当前",w$t=()=>"فعلی",k$t=()=>"الحالي",S$t=()=>"Actual",C$t=()=>"मौजूदा",E$t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x$t():t==="fa"?w$t():t==="ar"?k$t():t==="es"?S$t():t==="hi"?C$t():y$t()}),N$t=()=>"Currently off:",z$t=()=>"当前已关闭:",j$t=()=>"اکنون خاموش است:",T$t=()=>"معطّل حاليًا:",A$t=()=>"Desactivado actualmente:",R$t=()=>"फ़िलहाल बंद:",M$t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z$t():t==="fa"?j$t():t==="ar"?T$t():t==="es"?A$t():t==="hi"?R$t():N$t()}),O$t=()=>"Custom flavor",D$t=()=>"自定义规格",L$t=()=>"پیکربندی سفارشی",I$t=()=>"تكوين موارد مخصّص",$$t=()=>"Opción personalizada",B$t=()=>"कस्टम फ़्लेवर",P$t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D$t():t==="fa"?L$t():t==="ar"?I$t():t==="es"?$$t():t==="hi"?B$t():O$t()}),F$t=()=>"Custom flavor…",H$t=()=>"自定义规格…",q$t=()=>"پیکربندی سفارشی…",U$t=()=>"تكوين موارد مخصّص…",G$t=()=>"Opción personalizada…",V$t=()=>"कस्टम फ़्लेवर…",K$t=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H$t():t==="fa"?q$t():t==="ar"?U$t():t==="es"?G$t():t==="hi"?V$t():F$t()}),W$t=()=>"Data directory",Q$t=()=>"数据目录",X$t=()=>"پوشهٔ داده",Y$t=()=>"دليل البيانات",Z$t=()=>"Directorio de datos",J$t=()=>"डेटा डायरेक्टरी",eBt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Q$t():t==="fa"?X$t():t==="ar"?Y$t():t==="es"?Z$t():t==="hi"?J$t():W$t()}),tBt=()=>"default",nBt=()=>"默认",rBt=()=>"پیش‌فرض",sBt=()=>"افتراضي",iBt=()=>"predeterminado",aBt=()=>"डिफ़ॉल्ट",oBt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nBt():t==="fa"?rBt():t==="ar"?sBt():t==="es"?iBt():t==="hi"?aBt():tBt()}),cBt=()=>"Default",lBt=()=>"默认",uBt=()=>"پیش‌فرض",_Bt=()=>"الافتراضي",fBt=()=>"Predeterminado",dBt=()=>"डिफ़ॉल्ट",mL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lBt():t==="fa"?uBt():t==="ar"?_Bt():t==="es"?fBt():t==="hi"?dBt():cBt()}),hBt=()=>"Default destination",pBt=()=>"默认目标",mBt=()=>"مقصد پیش‌فرض",gBt=()=>"الوجهة الافتراضية",vBt=()=>"Destino predeterminado",bBt=()=>"डिफ़ॉल्ट गंतव्य",yBt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pBt():t==="fa"?mBt():t==="ar"?gBt():t==="es"?vBt():t==="hi"?bBt():hBt()}),xBt=()=>"Detecting hardware…",wBt=()=>"正在检测硬件…",kBt=()=>"در حال شناسایی سخت‌افزار…",SBt=()=>"جارٍ اكتشاف العتاد…",CBt=()=>"Detectando hardware…",EBt=()=>"हार्डवेयर पहचाना जा रहा है…",NBt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wBt():t==="fa"?kBt():t==="ar"?SBt():t==="es"?CBt():t==="hi"?EBt():xBt()}),zBt=()=>"Detecting harnesses…",jBt=()=>"正在检测智能体工具…",TBt=()=>"در حال شناسایی ابزارهای عامل…",ABt=()=>"جارٍ اكتشاف أدوات البرمجة…",RBt=()=>"Detectando agentes…",MBt=()=>"हार्नेस पहचाने जा रहे हैं…",OBt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jBt():t==="fa"?TBt():t==="ar"?ABt():t==="es"?RBt():t==="hi"?MBt():zBt()}),DBt=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",LBt=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",IBt=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",$Bt=()=>"يوقف تعطيل المزامنة عمليات الرفع التلقائية. تواصل الحوسبة استخدام لقطات المصدر المباشرة. لا يحذف هذا مستودع GitHub أو الشيفرة التي رُفعت إليه مسبقًا.",BBt=()=>"Desactivar la sincronización detiene los push automáticos. El cómputo sigue usando snapshots directos del código fuente. No se elimina el repositorio de GitHub ni el código que ya se subió.",PBt=()=>"सिंकिंग बंद करने से ऑटोमैटिक पुश रुक जाते हैं। कंप्यूट सीधे सोर्स स्नैपशॉट का इस्तेमाल करता रहेगा। इससे GitHub रिपॉज़िटरी या पहले से पुश किया गया कोड नहीं मिटता।",FBt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LBt():t==="fa"?IBt():t==="ar"?$Bt():t==="es"?BBt():t==="hi"?PBt():DBt()}),HBt=()=>"Effective URL",qBt=()=>"实际使用的网址",UBt=()=>"نشانی مؤثر",GBt=()=>"الرابط الفعّال",VBt=()=>"URL efectiva",KBt=()=>"प्रभावी URL",WBt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qBt():t==="fa"?UBt():t==="ar"?GBt():t==="es"?VBt():t==="hi"?KBt():HBt()}),QBt=()=>"Enable GitHub syncing for new projects",XBt=()=>"为新项目启用 GitHub 同步",YBt=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",ZBt=()=>"تفعيل مزامنة GitHub للمشاريع الجديدة",JBt=()=>"Activar la sincronización con GitHub en proyectos nuevos",ePt=()=>"नए प्रोजेक्ट के लिए GitHub सिंकिंग चालू करें",Az=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XBt():t==="fa"?YBt():t==="ar"?ZBt():t==="es"?JBt():t==="hi"?ePt():QBt()}),tPt=()=>"Environment",nPt=()=>"环境",rPt=()=>"محیط",sPt=()=>"البيئة",iPt=()=>"Entorno",aPt=()=>"एनवायरनमेंट",gL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nPt():t==="fa"?rPt():t==="ar"?sPt():t==="es"?iPt():t==="hi"?aPt():tPt()}),oPt=()=>"Failed",cPt=()=>"失败",lPt=()=>"ناموفق",uPt=()=>"فشل",_Pt=()=>"Error",fPt=()=>"विफल",nS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cPt():t==="fa"?lPt():t==="ar"?uPt():t==="es"?_Pt():t==="hi"?fPt():oPt()}),dPt=()=>"General",hPt=()=>"常规",pPt=()=>"عمومی",mPt=()=>"عام",gPt=()=>"General",vPt=()=>"सामान्य",bPt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hPt():t==="fa"?pPt():t==="ar"?mPt():t==="es"?gPt():t==="hi"?vPt():dPt()}),yPt=()=>"GitHub publishing",xPt=()=>"GitHub 发布",wPt=()=>"انتشار در GitHub",kPt=()=>"النشر على GitHub",SPt=()=>"Publicación en GitHub",CPt=()=>"GitHub प्रकाशन",EPt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xPt():t==="fa"?wPt():t==="ar"?kPt():t==="es"?SPt():t==="hi"?CPt():yPt()}),NPt=()=>"Git token",zPt=()=>"Git 令牌",jPt=()=>"توکن Git",TPt=()=>"رمز Git",APt=()=>"Token de Git",RPt=()=>"Git टोकन",MPt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zPt():t==="fa"?jPt():t==="ar"?TPt():t==="es"?APt():t==="hi"?RPt():NPt()}),OPt=()=>"Harnesses",DPt=()=>"智能体工具",LPt=()=>"ابزارهای عامل",IPt=()=>"أدوات البرمجة",$Pt=()=>"Agentes",BPt=()=>"हार्नेस",m3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DPt():t==="fa"?LPt():t==="ar"?IPt():t==="es"?$Pt():t==="hi"?BPt():OPt()}),PPt=()=>"hf_…",FPt=()=>"hf_…",HPt=()=>"hf_…",qPt=()=>"hf_…",UPt=()=>"hf_…",GPt=()=>"hf_…",VPt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FPt():t==="fa"?HPt():t==="ar"?qPt():t==="es"?UPt():t==="hi"?GPt():PPt()}),KPt=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",WPt=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",QPt=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",XPt=()=>"‏HF_TOKEN مضبوط في البيئة ويتجاوز أي رمز محفوظ هنا.",YPt=()=>"HF_TOKEN está definido en el entorno y tiene prioridad sobre cualquier token guardado aquí.",ZPt=()=>"HF_TOKEN एनवायरनमेंट में सेट है और यहाँ सेव किसी भी टोकन को ओवरराइड करता है।",JPt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WPt():t==="fa"?QPt():t==="ar"?XPt():t==="es"?YPt():t==="hi"?ZPt():KPt()}),eFt=()=>"Initialize Git",tFt=()=>"初始化 Git",nFt=()=>"راه‌اندازی Git",rFt=()=>"تهيئة Git",sFt=()=>"Inicializar Git",iFt=()=>"Git शुरू करें",aFt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tFt():t==="fa"?nFt():t==="ar"?rFt():t==="es"?sFt():t==="hi"?iFt():eFt()}),oFt=()=>"Install",cFt=()=>"安装",lFt=()=>"نصب",uFt=()=>"تثبيت",_Ft=()=>"Instalar",fFt=()=>"इंस्टॉल करें",vL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cFt():t==="fa"?lFt():t==="ar"?uFt():t==="es"?_Ft():t==="hi"?fFt():oFt()}),dFt=()=>"Install broken",hFt=()=>"安装损坏",pFt=()=>"نصب خراب است",mFt=()=>"التثبيت معطوب",gFt=()=>"Instalación dañada",vFt=()=>"इंस्टॉल खराब है",bFt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hFt():t==="fa"?pFt():t==="ar"?mFt():t==="es"?gFt():t==="hi"?vFt():dFt()}),yFt=()=>"Install GitHub CLI",xFt=()=>"安装 GitHub CLI",wFt=()=>"نصب GitHub CLI",kFt=()=>"تثبيت واجهة GitHub لسطر الأوامر",SFt=()=>"Instalar GitHub CLI",CFt=()=>"GitHub CLI इंस्टॉल करें",EFt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xFt():t==="fa"?wFt():t==="ar"?kFt():t==="es"?SFt():t==="hi"?CFt():yFt()}),NFt=()=>"Install updates automatically",zFt=()=>"自动安装更新",jFt=()=>"نصب خودکار به‌روزرسانی‌ها",TFt=()=>"تثبيت التحديثات تلقائيًا",AFt=()=>"Instalar actualizaciones automáticamente",RFt=()=>"अपडेट अपने आप इंस्टॉल करें",Rz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zFt():t==="fa"?jFt():t==="ar"?TFt():t==="es"?AFt():t==="hi"?RFt():NFt()}),MFt=()=>"Instance history",OFt=()=>"实例历史",DFt=()=>"تاریخچهٔ نمونه‌ها",LFt=()=>"سجل المثيلات",IFt=()=>"Historial de instancias",$Ft=()=>"इंस्टेंस इतिहास",BFt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OFt():t==="fa"?DFt():t==="ar"?LFt():t==="es"?IFt():t==="hi"?$Ft():MFt()}),PFt=()=>"Invalid Token",FFt=()=>"令牌无效",HFt=()=>"توکن نامعتبر",qFt=()=>"رمز غير صالح",UFt=()=>"Token no válido",GFt=()=>"अमान्य टोकन",VFt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FFt():t==="fa"?HFt():t==="ar"?qFt():t==="es"?UFt():t==="hi"?GFt():PFt()}),KFt=()=>"Jobs / Dashboard URL",WFt=()=>"Jobs / 控制台网址",QFt=()=>"نشانی Jobs / داشبورد",XFt=()=>"رابط المهام / لوحة التحكم",YFt=()=>"URL de jobs / dashboard",ZFt=()=>"Jobs / डैशबोर्ड URL",JFt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WFt():t==="fa"?QFt():t==="ar"?XFt():t==="es"?YFt():t==="hi"?ZFt():KFt()}),eHt=()=>"kubectl not found",tHt=()=>"未找到 kubectl",nHt=()=>"kubectl پیدا نشد",rHt=()=>"لم يُعثر على kubectl",sHt=()=>"No se encontró kubectl",iHt=()=>"kubectl नहीं मिला",aHt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tHt():t==="fa"?nHt():t==="ar"?rHt():t==="es"?sHt():t==="hi"?iHt():eHt()}),oHt=()=>"Latest",cHt=()=>"最新版本",lHt=()=>"جدیدترین",uHt=()=>"الأحدث",_Ht=()=>"Última",fHt=()=>"नवीनतम",dHt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cHt():t==="fa"?lHt():t==="ar"?uHt():t==="es"?_Ht():t==="hi"?fHt():oHt()}),hHt=()=>"Loading…",pHt=()=>"正在加载…",mHt=()=>"در حال بارگیری…",gHt=()=>"جارٍ التحميل…",vHt=()=>"Cargando…",bHt=()=>"लोड हो रहा है…",Ru=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pHt():t==="fa"?mHt():t==="ar"?gHt():t==="es"?vHt():t==="hi"?bHt():hHt()}),yHt=()=>"Loading Ray settings…",xHt=()=>"正在加载 Ray 设置…",wHt=()=>"در حال بارگیری تنظیمات Ray…",kHt=()=>"جارٍ تحميل إعدادات Ray…",SHt=()=>"Cargando configuración de Ray…",CHt=()=>"Ray सेटिंग्स लोड हो रही हैं…",EHt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xHt():t==="fa"?wHt():t==="ar"?kHt():t==="es"?SHt():t==="hi"?CHt():yHt()}),NHt=()=>"Loading slurm settings…",zHt=()=>"正在加载 Slurm 设置…",jHt=()=>"در حال بارگیری تنظیمات Slurm…",THt=()=>"جارٍ تحميل إعدادات slurm…",AHt=()=>"Cargando configuración de Slurm…",RHt=()=>"Slurm सेटिंग्स लोड हो रही हैं…",MHt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zHt():t==="fa"?jHt():t==="ar"?THt():t==="es"?AHt():t==="hi"?RHt():NHt()}),OHt=()=>"Loading status…",DHt=()=>"正在加载状态…",LHt=()=>"در حال بارگیری وضعیت…",IHt=()=>"جارٍ تحميل الحالة…",$Ht=()=>"Cargando estado…",BHt=()=>"स्थिति लोड हो रही है…",PHt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DHt():t==="fa"?LHt():t==="ar"?IHt():t==="es"?$Ht():t==="hi"?BHt():OHt()}),FHt=()=>"Local only",HHt=()=>"仅本地",qHt=()=>"فقط محلی",UHt=()=>"محلي فقط",GHt=()=>"Solo local",VHt=()=>"केवल लोकल",KHt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HHt():t==="fa"?qHt():t==="ar"?UHt():t==="es"?GHt():t==="hi"?VHt():FHt()}),WHt=()=>"Local repository",QHt=()=>"本地仓库",XHt=()=>"مخزن محلی",YHt=()=>"مستودع محلي",ZHt=()=>"Repositorio local",JHt=()=>"लोकल रिपॉज़िटरी",eqt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QHt():t==="fa"?XHt():t==="ar"?YHt():t==="es"?ZHt():t==="hi"?JHt():WHt()}),tqt=()=>"Login node",nqt=()=>"登录节点",rqt=()=>"گرهٔ ورود",sqt=()=>"عقدة الدخول",iqt=()=>"Nodo de acceso",aqt=()=>"लॉगिन नोड",oqt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nqt():t==="fa"?rqt():t==="ar"?sqt():t==="es"?iqt():t==="hi"?aqt():tqt()}),cqt=()=>"Make GitHub syncing the default?",lqt=()=>"将 GitHub 同步设为默认值?",uqt=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",_qt=()=>"جعل مزامنة GitHub افتراضية؟",fqt=()=>"¿Activar la sincronización con GitHub de forma predeterminada?",dqt=()=>"GitHub सिंकिंग को डिफ़ॉल्ट बनाएं?",hqt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lqt():t==="fa"?uqt():t==="ar"?_qt():t==="es"?fqt():t==="hi"?dqt():cqt()}),pqt=()=>"Missing bash/tar",mqt=()=>"缺少 bash/tar",gqt=()=>"bash/tar موجود نیست",vqt=()=>"‏bash/tar مفقودان",bqt=()=>"Falta bash/tar",yqt=()=>"bash/tar गुम है",xqt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mqt():t==="fa"?gqt():t==="ar"?vqt():t==="es"?bqt():t==="hi"?yqt():pqt()}),wqt=()=>"More compute options",kqt=()=>"更多算力选项",Sqt=()=>"گزینه‌های رایانشی بیشتر",Cqt=()=>"خيارات حوسبة إضافية",Eqt=()=>"Más opciones de cómputo",Nqt=()=>"और कंप्यूट विकल्प",zqt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kqt():t==="fa"?Sqt():t==="ar"?Cqt():t==="es"?Eqt():t==="hi"?Nqt():wqt()}),jqt=()=>"Move failed:",Tqt=()=>"移动失败:",Aqt=()=>"انتقال ناموفق بود:",Rqt=()=>"فشل النقل:",Mqt=()=>"Error al mover:",Oqt=()=>"स्थानांतरण विफल:",Dqt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tqt():t==="fa"?Aqt():t==="ar"?Rqt():t==="es"?Mqt():t==="hi"?Oqt():jqt()}),Lqt=()=>"Moved. orx is now using the new location.",Iqt=()=>"已移动。orx 现在使用新位置。",$qt=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",Bqt=()=>"تم النقل. يستخدم orx الآن الموقع الجديد.",Pqt=()=>"Movido. orx ya usa la nueva ubicación.",Fqt=()=>"स्थानांतरित हो गया। orx अब नए स्थान का उपयोग कर रहा है।",Hqt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Iqt():t==="fa"?$qt():t==="ar"?Bqt():t==="es"?Pqt():t==="hi"?Fqt():Lqt()}),qqt=()=>"Namespace",Uqt=()=>"命名空间",Gqt=()=>"فضای نام",Vqt=()=>"مساحة الأسماء",Kqt=()=>"Namespace",Wqt=()=>"नेमस्पेस",Qqt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uqt():t==="fa"?Gqt():t==="ar"?Vqt():t==="es"?Kqt():t==="hi"?Wqt():qqt()}),Xqt=()=>"New location",Yqt=()=>"新位置",Zqt=()=>"محل جدید",Jqt=()=>"الموقع الجديد",eUt=()=>"Nueva ubicación",tUt=()=>"नया स्थान",nUt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yqt():t==="fa"?Zqt():t==="ar"?Jqt():t==="es"?eUt():t==="hi"?tUt():Xqt()}),rUt=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",sUt=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",iUt=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",aUt=()=>"تُنزَّل الإصدارات الجديدة وتُثبَّت في الخلفية. إيقاف هذا يبقي الإشعار لكنه يترك التثبيت لك.",oUt=()=>"Las nuevas versiones se descargan e instalan en segundo plano. Si lo desactivas, verás el aviso, pero tendrás que instalarlas tú.",cUt=()=>"नए रिलीज़ बैकग्राउंड में डाउनलोड और इंस्टॉल होते हैं। इसे बंद करने पर सूचना बनी रहेगी, पर इंस्टॉल करना आप पर निर्भर होगा।",lUt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sUt():t==="fa"?iUt():t==="ar"?aUt():t==="es"?oUt():t==="hi"?cUt():rUt()}),uUt=()=>"New variable key",_Ut=()=>"新变量键名",fUt=()=>"کلید متغیر جدید",dUt=()=>"مفتاح المتغيّر الجديد",hUt=()=>"Nombre de la nueva variable",pUt=()=>"नई वेरिएबल की",mUt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Ut():t==="fa"?fUt():t==="ar"?dUt():t==="es"?hUt():t==="hi"?pUt():uUt()}),gUt=()=>"New variable value",vUt=()=>"新变量值",bUt=()=>"مقدار متغیر جدید",yUt=()=>"قيمة المتغيّر الجديد",xUt=()=>"Valor de la nueva variable",wUt=()=>"नई वेरिएबल वैल्यू",kUt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vUt():t==="fa"?bUt():t==="ar"?yUt():t==="es"?xUt():t==="hi"?wUt():gUt()}),SUt=()=>"No code, prompts, file contents, or account identifiers are sent.",CUt=()=>"不会发送代码、提示词、文件内容或账户标识符。",EUt=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",NUt=()=>"لا تُرسَل أي شيفرة أو طلبات أو محتويات ملفات أو معرّفات حسابات.",zUt=()=>"No se envía código, prompts, contenido de archivos ni identificadores de cuenta.",jUt=()=>"कोई कोड, प्रॉम्प्ट, फ़ाइल सामग्री, या खाता पहचानकर्ता नहीं भेजे जाते।",TUt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CUt():t==="fa"?EUt():t==="ar"?NUt():t==="es"?zUt():t==="hi"?jUt():SUt()}),AUt=()=>"No hosts found in ~/.ssh/config.",RUt=()=>"在 ~/.ssh/config 中未找到主机。",MUt=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",OUt=()=>"لم يُعثر على مضيفين في ‎~/.ssh/config.",DUt=()=>"No se encontraron hosts en ~/.ssh/config.",LUt=()=>"~/.ssh/config में कोई होस्ट नहीं मिला।",IUt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RUt():t==="fa"?MUt():t==="ar"?OUt():t==="es"?DUt():t==="hi"?LUt():AUt()}),$Ut=()=>"No job-create permission",BUt=()=>"没有创建 Job 的权限",PUt=()=>"مجوز ساخت Job وجود ندارد",FUt=()=>"لا صلاحية لإنشاء المهام",HUt=()=>"Sin permiso para crear jobs",qUt=()=>"जॉब बनाने की अनुमति नहीं",UUt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BUt():t==="fa"?PUt():t==="ar"?FUt():t==="es"?HUt():t==="hi"?qUt():$Ut()}),GUt=()=>"No Write Permissions",VUt=()=>"无写入权限",KUt=()=>"بدون مجوز نوشتن",WUt=()=>"لا صلاحيات كتابة",QUt=()=>"Sin permisos de escritura",XUt=()=>"लिखने की अनुमति नहीं",YUt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VUt():t==="fa"?KUt():t==="ar"?WUt():t==="es"?QUt():t==="hi"?XUt():GUt()}),ZUt=()=>"No key on this computer to register — load a registered key with",JUt=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",eGt=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",tGt=()=>"لا مفتاح على هذا الحاسوب لتسجيله — حمّل مفتاحًا مسجّلًا عبر",nGt=()=>"No hay ninguna clave en este equipo para registrar — carga una clave registrada con",rGt=()=>"इस कंप्यूटर पर रजिस्टर करने के लिए कोई की नहीं है — इसके साथ एक रजिस्टर्ड की लोड करें",sGt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JUt():t==="fa"?eGt():t==="ar"?tGt():t==="es"?nGt():t==="hi"?rGt():ZUt()}),iGt=()=>"No key on this computer yet — create one with",aGt=()=>"此计算机上还没有密钥——使用以下命令创建:",oGt=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",cGt=()=>"لا مفتاح على هذا الحاسوب بعد — أنشئ واحدًا عبر",lGt=()=>"Aún no hay ninguna clave en este equipo — crea una con",uGt=()=>"इस कंप्यूटर पर अभी तक कोई की नहीं है — इसके साथ एक बनाएं",_Gt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aGt():t==="fa"?oGt():t==="ar"?cGt():t==="es"?lGt():t==="hi"?uGt():iGt()}),fGt=()=>"No Slurm CLI",dGt=()=>"无 Slurm CLI",hGt=()=>"بدون CLI اسلورم",pGt=()=>"لا توجد واجهة Slurm لسطر الأوامر",mGt=()=>"Sin CLI de Slurm",gGt=()=>"कोई Slurm CLI नहीं",vGt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dGt():t==="fa"?hGt():t==="ar"?pGt():t==="es"?mGt():t==="hi"?gGt():fGt()}),bGt=()=>"None registered",yGt=()=>"未注册任何密钥",xGt=()=>"هیچ‌کدام ثبت نشده",wGt=()=>"لا شيء مسجّل",kGt=()=>"Ninguna registrada",SGt=()=>"कोई रजिस्टर्ड नहीं",CGt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yGt():t==="fa"?xGt():t==="ar"?wGt():t==="es"?kGt():t==="hi"?SGt():bGt()}),EGt=()=>"Not checked",NGt=()=>"未检查",zGt=()=>"بررسی نشده",jGt=()=>"لم يُفحص",TGt=()=>"Sin comprobar",AGt=()=>"जाँचा नहीं गया",bL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NGt():t==="fa"?zGt():t==="ar"?jGt():t==="es"?TGt():t==="hi"?AGt():EGt()}),RGt=()=>"Not configured",MGt=()=>"未配置",OGt=()=>"پیکربندی نشده",DGt=()=>"غير مُعَد",LGt=()=>"Sin configurar",IGt=()=>"कॉन्फ़िगर नहीं किया गया",Tb=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MGt():t==="fa"?OGt():t==="ar"?DGt():t==="es"?LGt():t==="hi"?IGt():RGt()}),$Gt=()=>"Not installed",BGt=()=>"未安装",PGt=()=>"نصب نیست",FGt=()=>"غير مثبّت",HGt=()=>"No instalado",qGt=()=>"इंस्टॉल नहीं है",UGt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BGt():t==="fa"?PGt():t==="ar"?FGt():t==="es"?HGt():t==="hi"?qGt():$Gt()}),GGt=()=>"Not now",VGt=()=>"暂不",KGt=()=>"اکنون نه",WGt=()=>"ليس الآن",QGt=()=>"Ahora no",XGt=()=>"अभी नहीं",YGt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VGt():t==="fa"?KGt():t==="ar"?WGt():t==="es"?QGt():t==="hi"?XGt():GGt()}),ZGt=()=>"Not on this computer",JGt=()=>"不在此计算机上",eVt=()=>"روی این رایانه نیست",tVt=()=>"ليس على هذا الحاسوب",nVt=()=>"No en este equipo",rVt=()=>"इस कंप्यूटर पर नहीं",sVt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JGt():t==="fa"?eVt():t==="ar"?tVt():t==="es"?nVt():t==="hi"?rVt():ZGt()}),iVt=()=>"Not set (pass --host per launch)",aVt=()=>"未设置(每次启动时传入 --host)",oVt=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",cVt=()=>"غير مضبوط (مرّر ‎--host‎ عند كل تشغيل)",lVt=()=>"Sin definir (pasa --host en cada lanzamiento)",uVt=()=>"सेट नहीं (हर लॉन्च पर --host दें)",yL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aVt():t==="fa"?oVt():t==="ar"?cVt():t==="es"?lVt():t==="hi"?uVt():iVt()}),_Vt=()=>"Not signed in",fVt=()=>"未登录",dVt=()=>"وارد نشده",hVt=()=>"لم يتم تسجيل الدخول",pVt=()=>"Sin iniciar sesión",mVt=()=>"साइन इन नहीं है",xL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fVt():t==="fa"?dVt():t==="ar"?hVt():t==="es"?pVt():t==="hi"?mVt():_Vt()}),gVt=()=>"On this computer",vVt=()=>"在此计算机上",bVt=()=>"روی این رایانه",yVt=()=>"على هذا الحاسوب",xVt=()=>"En este equipo",wVt=()=>"इस कंप्यूटर पर",kVt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vVt():t==="fa"?bVt():t==="ar"?yVt():t==="es"?xVt():t==="hi"?wVt():gVt()}),SVt=()=>"Open a project to inspect its repository and GitHub publication state.",CVt=()=>"打开项目以查看其仓库和 GitHub 发布状态。",EVt=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",NVt=()=>"افتح مشروعًا لفحص مستودعه وحالة نشره على GitHub.",zVt=()=>"Abre un proyecto para ver su repositorio y su estado de publicación en GitHub.",jVt=()=>"इसकी रिपॉज़िटरी और GitHub प्रकाशन स्थिति देखने के लिए एक प्रोजेक्ट खोलें।",TVt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CVt():t==="fa"?EVt():t==="ar"?NVt():t==="es"?zVt():t==="hi"?jVt():SVt()}),AVt=()=>"Open job page",RVt=()=>"打开作业页面",MVt=()=>"باز کردن صفحهٔ کار",OVt=()=>"فتح صفحة المهمة",DVt=()=>"Abrir página del job",LVt=()=>"जॉब पेज खोलें",Mz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RVt():t==="fa"?MVt():t==="ar"?OVt():t==="es"?DVt():t==="hi"?LVt():AVt()}),IVt=()=>"Open on GitHub",$Vt=()=>"在 GitHub 上打开",BVt=()=>"باز کردن در GitHub",PVt=()=>"فتح على GitHub",FVt=()=>"Abrir en GitHub",HVt=()=>"GitHub पर खोलें",Oz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Vt():t==="fa"?BVt():t==="ar"?PVt():t==="es"?FVt():t==="hi"?HVt():IVt()}),qVt=()=>", or create one with",UVt=()=>",或使用以下命令创建:",GVt=()=>"، یا با این فرمان یکی بسازید:",VVt=()=>"، أو أنشئ واحدًا عبر",KVt=()=>", o crea una con",WVt=()=>", या इसके साथ एक बनाएं",QVt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UVt():t==="fa"?GVt():t==="ar"?VVt():t==="es"?KVt():t==="hi"?WVt():qVt()}),XVt=()=>"Org",YVt=()=>"组织",ZVt=()=>"سازمان",JVt=()=>"المؤسسة",eKt=()=>"Org.",tKt=()=>"संगठन",nKt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YVt():t==="fa"?ZVt():t==="ar"?JVt():t==="es"?eKt():t==="hi"?tKt():XVt()}),rKt=()=>"Orgs",sKt=()=>"组织",iKt=()=>"سازمان‌ها",aKt=()=>"المؤسسات",oKt=()=>"Orgs.",cKt=()=>"संगठन",lKt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sKt():t==="fa"?iKt():t==="ar"?aKt():t==="es"?oKt():t==="hi"?cKt():rKt()}),uKt=()=>"orx can't update this install",_Kt=()=>"orx 无法更新此安装",fKt=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",dKt=()=>"لا يستطيع orx تحديث هذا التثبيت",hKt=()=>"orx no puede actualizar esta instalación",pKt=()=>"orx इस इंस्टॉल को अपडेट नहीं कर सकता",mKt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Kt():t==="fa"?fKt():t==="ar"?dKt():t==="es"?hKt():t==="hi"?pKt():uKt()}),gKt=()=>"Overleaf",vKt=()=>"Overleaf",bKt=()=>"Overleaf",yKt=()=>"Overleaf",xKt=()=>"Overleaf",wKt=()=>"Overleaf",wL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vKt():t==="fa"?bKt():t==="ar"?yKt():t==="es"?xKt():t==="hi"?wKt():gKt()}),kKt=()=>"Overleaf Git authentication token",SKt=()=>"Overleaf Git 身份验证令牌",CKt=()=>"توکن احراز هویت Git در Overleaf",EKt=()=>"رمز مصادقة Git لـ Overleaf",NKt=()=>"Token de autenticación de Git de Overleaf",zKt=()=>"Overleaf Git प्रमाणीकरण टोकन",jKt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SKt():t==="fa"?CKt():t==="ar"?EKt():t==="es"?NKt():t==="hi"?zKt():kKt()}),TKt=()=>"Overridden by env",AKt=()=>"已被环境变量覆盖",RKt=()=>"بازنویسی‌شده توسط محیط",MKt=()=>"متجاوَز عبر متغيّر البيئة",OKt=()=>"Sobrescrito por el entorno",DKt=()=>"env द्वारा ओवरराइड किया गया",LKt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AKt():t==="fa"?RKt():t==="ar"?MKt():t==="es"?OKt():t==="hi"?DKt():TKt()}),IKt=()=>"Partition",$Kt=()=>"分区",BKt=()=>"پارتیشن",PKt=()=>"القسم",FKt=()=>"Partición",HKt=()=>"पार्टीशन",qKt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Kt():t==="fa"?BKt():t==="ar"?PKt():t==="es"?FKt():t==="hi"?HKt():IKt()}),UKt=()=>"Path",GKt=()=>"路径",VKt=()=>"مسیر",KKt=()=>"المسار",WKt=()=>"Ruta",QKt=()=>"पथ",XKt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GKt():t==="fa"?VKt():t==="ar"?KKt():t==="es"?WKt():t==="hi"?QKt():UKt()}),YKt=()=>"Plan",ZKt=()=>"方案",JKt=()=>"سطح اشتراک",eWt=()=>"الخطة",tWt=()=>"Plan",nWt=()=>"प्लान",rWt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZKt():t==="fa"?JKt():t==="ar"?eWt():t==="es"?tWt():t==="hi"?nWt():YKt()}),sWt=()=>"Project",iWt=()=>"项目",aWt=()=>"پروژه",oWt=()=>"المشروع",cWt=()=>"Proyecto",lWt=()=>"प्रोजेक्ट",uWt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iWt():t==="fa"?aWt():t==="ar"?oWt():t==="es"?cWt():t==="hi"?lWt():sWt()}),_Wt=()=>"Ray version",fWt=()=>"Ray 版本",dWt=()=>"نسخهٔ Ray",hWt=()=>"إصدار Ray",pWt=()=>"Versión de Ray",mWt=()=>"Ray वर्शन",gWt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fWt():t==="fa"?dWt():t==="ar"?hWt():t==="es"?pWt():t==="hi"?mWt():_Wt()}),vWt=()=>"Reachable",bWt=()=>"可访问",yWt=()=>"در دسترس",xWt=()=>"يمكن الوصول إليه",wWt=()=>"Accesible",kWt=()=>"पहुँच योग्य",SWt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bWt():t==="fa"?yWt():t==="ar"?xWt():t==="es"?wWt():t==="hi"?kWt():vWt()}),CWt=()=>"Reading ~/.ssh/config…",EWt=()=>"正在读取 ~/.ssh/config…",NWt=()=>"در حال خواندن ‎~/.ssh/config…",zWt=()=>"جارٍ قراءة ‎~/.ssh/config…",jWt=()=>"Leyendo ~/.ssh/config…",TWt=()=>"~/.ssh/config पढ़ा जा रहा है…",kL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EWt():t==="fa"?NWt():t==="ar"?zWt():t==="es"?jWt():t==="hi"?TWt():CWt()}),AWt=()=>"Ready",RWt=()=>"就绪",MWt=()=>"آماده",OWt=()=>"جاهز",DWt=()=>"Listo",LWt=()=>"तैयार",km=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RWt():t==="fa"?MWt():t==="ar"?OWt():t==="es"?DWt():t==="hi"?LWt():AWt()}),IWt=()=>"Ready to move",$Wt=()=>"可以移动",BWt=()=>"آمادهٔ انتقال",PWt=()=>"جاهز للنقل",FWt=()=>"Listo para mover",HWt=()=>"स्थानांतरण के लिए तैयार",qWt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Wt():t==="fa"?BWt():t==="ar"?PWt():t==="es"?FWt():t==="hi"?HWt():IWt()}),UWt=()=>"Configured",GWt=()=>"已配置",VWt=()=>"پیکربندی‌شده",KWt=()=>"مُعَد",WWt=()=>"Configurado",QWt=()=>"कॉन्फ़िगर किया गया",rS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GWt():t==="fa"?VWt():t==="ar"?KWt():t==="es"?WWt():t==="hi"?QWt():UWt()}),XWt=()=>"Refresh",YWt=()=>"刷新",ZWt=()=>"تازه‌سازی",JWt=()=>"تحديث",eQt=()=>"Actualizar",tQt=()=>"रीफ़्रेश करें",Sm=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YWt():t==="fa"?ZWt():t==="ar"?JWt():t==="es"?eQt():t==="hi"?tQt():XWt()}),nQt=()=>"Remotes",rQt=()=>"远程仓库",sQt=()=>"مخزن‌های دوردست",iQt=()=>"المستودعات البعيدة",aQt=()=>"Remotos",oQt=()=>"रिमोट",cQt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rQt():t==="fa"?sQt():t==="ar"?iQt():t==="es"?aQt():t==="hi"?oQt():nQt()}),lQt=()=>"Repository",uQt=()=>"仓库",_Qt=()=>"مخزن",fQt=()=>"المستودع",dQt=()=>"Repositorio",hQt=()=>"रिपॉज़िटरी",pQt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uQt():t==="fa"?_Qt():t==="ar"?fQt():t==="es"?dQt():t==="hi"?hQt():lQt()}),mQt=()=>"Restart to finish updating",gQt=()=>"重新启动以完成更新",vQt=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",bQt=()=>"أعد التشغيل لإكمال التحديث",yQt=()=>"Reinicia para terminar la actualización",xQt=()=>"अपडेट पूरा करने के लिए फिर से शुरू करें",wQt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gQt():t==="fa"?vQt():t==="ar"?bQt():t==="es"?yQt():t==="hi"?xQt():mQt()}),kQt=()=>"Running instances",SQt=()=>"正在运行的实例",CQt=()=>"نمونه‌های در حال اجرا",EQt=()=>"المثيلات قيد التشغيل",NQt=()=>"Instancias en ejecución",zQt=()=>"चल रहे इंस्टेंस",jQt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SQt():t==="fa"?CQt():t==="ar"?EQt():t==="es"?NQt():t==="hi"?zQt():kQt()}),TQt=()=>"Runtime",AQt=()=>"运行时间",RQt=()=>"زمان اجرا",MQt=()=>"مدة التشغيل",OQt=()=>"Runtime",DQt=()=>"रनटाइम",LQt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AQt():t==="fa"?RQt():t==="ar"?MQt():t==="es"?OQt():t==="hi"?DQt():TQt()}),IQt=()=>". Save it under that key if it's meant for HF Jobs.",$Qt=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",BQt=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",PQt=()=>"‏. احفظه تحت ذلك المفتاح إن كان مخصصًا لمهام HF.",FQt=()=>". Guárdalo con ese nombre si es para HF Jobs.",HQt=()=>"। यदि यह HF Jobs के लिए है तो इसे उस की के तहत सेव करें।",qQt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Qt():t==="fa"?BQt():t==="ar"?PQt():t==="es"?FQt():t==="hi"?HQt():IQt()}),UQt=()=>"Session cookie",GQt=()=>"会话 cookie",VQt=()=>"کوکی نشست",KQt=()=>"ملف تعريف ارتباط الجلسة",WQt=()=>"Cookie de sesión",QQt=()=>"सेशन कुकी",XQt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GQt():t==="fa"?VQt():t==="ar"?KQt():t==="es"?WQt():t==="hi"?QQt():UQt()}),YQt=()=>"With a session cookie saved, a linked paper follows Overleaf as people type and sends saves straight back. Figures still move on the slower Git sync. Copy the overleaf_session2 cookie from a browser signed in to Overleaf; it stops working when that sign-in does.",ZQt=()=>"保存会话 cookie 后,已关联的论文会在他人输入时实时跟随 Overleaf,并立即回传保存;图片仍通过较慢的 Git 同步传输。请从已登录 Overleaf 的浏览器复制 overleaf_session2 cookie;该登录失效后它也会失效。",JQt=()=>"با ذخیرهٔ کوکی نشست، مقالهٔ پیوندشده هنگام تایپ دیگران Overleaf را زنده دنبال می‌کند و ذخیره‌ها را مستقیماً برمی‌گرداند؛ تصویرها همچنان با همگام‌سازی کندتر Git جابه‌جا می‌شوند. کوکی overleaf_session2 را از مرورگری که به Overleaf وارد شده کپی کنید؛ با پایان آن ورود، کوکی هم از کار می‌افتد.",eXt=()=>"مع حفظ ملف تعريف ارتباط الجلسة، تتابع الورقة المرتبطة Overleaf أثناء كتابة الآخرين وترسل عمليات الحفظ مباشرةً. لا تزال الأشكال تُنقَل عبر مزامنة Git الأبطأ. انسخ ملف تعريف الارتباط overleaf_session2 من متصفح مسجّل الدخول إلى Overleaf؛ ويتوقف عن العمل عند انتهاء ذلك الدخول.",tXt=()=>"Con una cookie de sesión guardada, un paper vinculado sigue los cambios de Overleaf mientras se escribe y envía los guardados directamente. Las figuras siguen usando la sincronización por Git, más lenta. Copia la cookie overleaf_session2 de un navegador con la sesión de Overleaf iniciada; deja de funcionar cuando esa sesión termine.",nXt=()=>"सेशन कुकी सेव होने पर, एक लिंक किया गया पेपर लोगों के टाइप करते ही Overleaf को फ़ॉलो करता है और सेव सीधे वापस भेजता है। फ़िगर अभी भी धीमे Git सिंक पर चलती हैं। Overleaf में साइन इन ब्राउज़र से overleaf_session2 कुकी कॉपी करें; वह साइन-इन खत्म होने पर काम करना बंद कर देती है।",rXt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZQt():t==="fa"?JQt():t==="ar"?eXt():t==="es"?tXt():t==="hi"?nXt():YQt()}),sXt=()=>"Settings",iXt=()=>"设置",aXt=()=>"تنظیمات",oXt=()=>"الإعدادات",cXt=()=>"Configuración",lXt=()=>"सेटिंग्स",sS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iXt():t==="fa"?aXt():t==="ar"?oXt():t==="es"?cXt():t==="hi"?lXt():sXt()}),uXt=()=>"Signed in",_Xt=()=>"已登录",fXt=()=>"وارد شده",dXt=()=>"تم تسجيل الدخول",hXt=()=>"Sesión iniciada",pXt=()=>"साइन इन है",mXt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Xt():t==="fa"?fXt():t==="ar"?dXt():t==="es"?hXt():t==="hi"?pXt():uXt()}),gXt=()=>"Source",vXt=()=>"来源",bXt=()=>"منبع",yXt=()=>"المصدر",xXt=()=>"Origen",wXt=()=>"स्रोत",SL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vXt():t==="fa"?bXt():t==="ar"?yXt():t==="es"?xXt():t==="hi"?wXt():gXt()}),kXt=()=>"SSH Key",SXt=()=>"SSH 密钥",CXt=()=>"کلید SSH",EXt=()=>"مفتاح SSH",NXt=()=>"Clave SSH",zXt=()=>"SSH की",jXt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SXt():t==="fa"?CXt():t==="ar"?EXt():t==="es"?NXt():t==="hi"?zXt():kXt()}),TXt=()=>"Started",AXt=()=>"开始时间",RXt=()=>"آغاز",MXt=()=>"بدأ",OXt=()=>"Inicio",DXt=()=>"शुरू हुआ",LXt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AXt():t==="fa"?RXt():t==="ar"?MXt():t==="es"?OXt():t==="hi"?DXt():TXt()}),IXt=()=>"State",$Xt=()=>"状态",BXt=()=>"وضعیت",PXt=()=>"الحالة",FXt=()=>"Estado",HXt=()=>"स्थिति",qXt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Xt():t==="fa"?BXt():t==="ar"?PXt():t==="es"?FXt():t==="hi"?HXt():IXt()}),UXt=()=>"Status",GXt=()=>"状态",VXt=()=>"وضعیت",KXt=()=>"الحالة",WXt=()=>"Estado",QXt=()=>"स्थिति",Dh=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GXt():t==="fa"?VXt():t==="ar"?KXt():t==="es"?WXt():t==="hi"?QXt():UXt()}),XXt=()=>"Storage",YXt=()=>"存储",ZXt=()=>"ذخیره‌سازی",JXt=()=>"التخزين",eYt=()=>"Almacenamiento",tYt=()=>"स्टोरेज",nYt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YXt():t==="fa"?ZXt():t==="ar"?JXt():t==="es"?eYt():t==="hi"?tYt():XXt()}),rYt=()=>"Sync",sYt=()=>"同步",iYt=()=>"همگام‌سازی",aYt=()=>"مزامنة",oYt=()=>"Sincronización",cYt=()=>"सिंक",lYt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sYt():t==="fa"?iYt():t==="ar"?aYt():t==="es"?oYt():t==="hi"?cYt():rYt()}),uYt=()=>"Syncing off",_Yt=()=>"同步已关闭",fYt=()=>"همگام‌سازی خاموش",dYt=()=>"المزامنة معطّلة",hYt=()=>"Sincronización desactivada",pYt=()=>"सिंकिंग बंद है",mYt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Yt():t==="fa"?fYt():t==="ar"?dYt():t==="es"?hYt():t==="hi"?pYt():uYt()}),gYt=()=>"Test connection",vYt=()=>"测试连接",bYt=()=>"آزمایش اتصال",yYt=()=>"اختبار الاتصال",xYt=()=>"Probar conexión",wYt=()=>"कनेक्शन जाँचें",kYt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vYt():t==="fa"?bYt():t==="ar"?yYt():t==="es"?xYt():t==="hi"?wYt():gYt()}),SYt=()=>"Testing…",CYt=()=>"正在测试…",EYt=()=>"در حال آزمایش…",NYt=()=>"جارٍ الاختبار…",zYt=()=>"Probando…",jYt=()=>"जाँचा जा रहा है…",TYt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CYt():t==="fa"?EYt():t==="ar"?NYt():t==="es"?zYt():t==="hi"?jYt():SYt()}),AYt=()=>", then add it with",RYt=()=>",然后使用以下命令添加:",MYt=()=>"، سپس با این فرمان اضافه‌اش کنید:",OYt=()=>"، ثم أضِفه عبر",DYt=()=>" y luego añádela con",LYt=()=>", फिर इसे इसके साथ जोड़ें",IYt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RYt():t==="fa"?MYt():t==="ar"?OYt():t==="es"?DYt():t==="hi"?LYt():AYt()}),$Yt=()=>"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.",BYt=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",PYt=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",FYt=()=>"هذا مفيد عندما يتابع المتعاونون تغييرات المشروع على GitHub. ستفعّل المشاريع الجديدة المزامنة تلقائيًا، مع إنشاء مستودع خاص عند الحاجة ورفع فروع التجارب لإتاحة الاطلاع عليها.",HYt=()=>"Es útil cuando tus colaboradores siguen los cambios del proyecto en GitHub. Los proyectos nuevos activarán la sincronización automáticamente: se creará un repositorio privado cuando haga falta y se subirán las ramas de los experimentos para que sean visibles.",qYt=()=>"यह तब उपयोगी है जब सहयोगी GitHub पर प्रोजेक्ट के बदलावों को फ़ॉलो करते हों। नए प्रोजेक्ट में सिंकिंग अपने आप चालू हो जाएगी, ज़रूरत पड़ने पर एक निजी रिपॉज़िटरी बनेगी और प्रयोग ब्रांच दृश्यता के लिए पुश की जाएंगी।",UYt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BYt():t==="fa"?PYt():t==="ar"?FYt():t==="es"?HYt():t==="hi"?qYt():$Yt()}),GYt=()=>"This saved destination is not configured. Set it up below or choose another backend.",VYt=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",KYt=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",WYt=()=>"هذه الوجهة المحفوظة غير مُعدّة. أعِدّها أدناه أو اختر بيئة تنفيذ أخرى.",QYt=()=>"Este destino guardado no está configurado. Configúralo abajo o elige otro backend.",XYt=()=>"यह सेव किया गया गंतव्य कॉन्फ़िगर नहीं है। इसे नीचे सेट अप करें या कोई और बैकएंड चुनें।",YYt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VYt():t==="fa"?KYt():t==="ar"?WYt():t==="es"?QYt():t==="hi"?XYt():GYt()}),ZYt=()=>"This value looks like a Hugging Face token — compute runs only read it from",JYt=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",eZt=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",tZt=()=>"تبدو هذه القيمة كرمز Hugging Face — لا تقرؤه عمليات التشغيل الحوسبية إلا من",nZt=()=>"Este valor parece un token de Hugging Face — las ejecuciones de cómputo solo lo leen de",rZt=()=>"यह वैल्यू एक Hugging Face टोकन जैसी लगती है — कंप्यूट रन इसे केवल यहाँ से पढ़ते हैं",sZt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JYt():t==="fa"?eZt():t==="ar"?tZt():t==="es"?nZt():t==="hi"?rZt():ZYt()}),iZt=()=>"Time limit",aZt=()=>"时间限制",oZt=()=>"محدودیت زمانی",cZt=()=>"الحد الزمني",lZt=()=>"Límite de tiempo",uZt=()=>"समय सीमा",_Zt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aZt():t==="fa"?oZt():t==="ar"?cZt():t==="es"?lZt():t==="hi"?uZt():iZt()}),fZt=()=>"Unable to verify",dZt=()=>"无法验证",hZt=()=>"تأیید ممکن نیست",pZt=()=>"تعذّر التحقق",mZt=()=>"No se pudo verificar",gZt=()=>"सत्यापित नहीं हो सका",g3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dZt():t==="fa"?hZt():t==="ar"?pZt():t==="es"?mZt():t==="hi"?gZt():fZt()}),vZt=()=>"Unknown",bZt=()=>"未知",yZt=()=>"نامشخص",xZt=()=>"غير معروف",wZt=()=>"Desconocido",kZt=()=>"अज्ञात",CL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bZt():t==="fa"?yZt():t==="ar"?xZt():t==="es"?wZt():t==="hi"?kZt():vZt()}),SZt=()=>"Update required",CZt=()=>"需要更新",EZt=()=>"نیازمند به‌روزرسانی",NZt=()=>"مطلوب تحديث",zZt=()=>"Actualización necesaria",jZt=()=>"अपडेट ज़रूरी है",TZt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CZt():t==="fa"?EZt():t==="ar"?NZt():t==="es"?zZt():t==="hi"?jZt():SZt()}),AZt=()=>"Updates",RZt=()=>"更新",MZt=()=>"به‌روزرسانی‌ها",OZt=()=>"التحديثات",DZt=()=>"Actualizaciones",LZt=()=>"अपडेट",Dz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RZt():t==="fa"?MZt():t==="ar"?OZt():t==="es"?DZt():t==="hi"?LZt():AZt()}),IZt=()=>"Usage analytics",$Zt=()=>"使用情况分析",BZt=()=>"تحلیل استفاده",PZt=()=>"تحليلات الاستخدام",FZt=()=>"Estadísticas de uso",HZt=()=>"उपयोग एनालिटिक्स",qZt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Zt():t==="fa"?BZt():t==="ar"?PZt():t==="es"?FZt():t==="hi"?HZt():IZt()}),UZt=()=>"value",GZt=()=>"值",VZt=()=>"مقدار",KZt=()=>"القيمة",WZt=()=>"valor",QZt=()=>"वैल्यू",EL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GZt():t==="fa"?VZt():t==="ar"?KZt():t==="es"?WZt():t==="hi"?QZt():UZt()}),XZt=()=>"Variables available to runs and the research agent (API keys, tokens).",YZt=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",ZZt=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API، توکن‌ها).",JZt=()=>"متغيّرات متاحة لعمليات التشغيل ولوكيل البحث (مفاتيح API والرموز).",eJt=()=>"Variables disponibles para las ejecuciones y el agente de investigación (claves de API, tokens).",tJt=()=>"रन और शोध एजेंट के लिए उपलब्ध वेरिएबल (API की, टोकन)।",nJt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YZt():t==="fa"?ZZt():t==="ar"?JZt():t==="es"?eJt():t==="hi"?tJt():XZt()}),rJt=()=>"Version",sJt=()=>"版本",iJt=()=>"نسخه",aJt=()=>"الإصدار",oJt=()=>"Versión",cJt=()=>"वर्शन",NL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sJt():t==="fa"?iJt():t==="ar"?aJt():t==="es"?oJt():t==="hi"?cJt():rJt()}),lJt=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",uJt=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",_Jt=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",fJt=()=>"عند التفعيل، يحصل كل مشروع جديد على مستودع GitHub خاص. تُرفع فروع التجارب تلقائيًا ليطّلع عليها المتعاونون. تستخدم الحوسبة دائمًا لقطات المصدر المباشرة.",dJt=()=>"Si se activa, cada proyecto nuevo tendrá un repositorio privado en GitHub. Las ramas de los experimentos se suben automáticamente para que las vean tus colaboradores. El cómputo siempre usa snapshots directos del código fuente.",hJt=()=>"चालू होने पर, हर नए प्रोजेक्ट को एक निजी GitHub रिपॉज़िटरी मिलती है। सहयोगी दृश्यता के लिए प्रयोग ब्रांच अपने आप पुश होती हैं। कंप्यूट हमेशा सीधे सोर्स स्नैपशॉट का उपयोग करता है।",pJt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uJt():t==="fa"?_Jt():t==="ar"?fJt():t==="es"?dJt():t==="hi"?hJt():lJt()}),mJt=()=>"With a token saved, a paper opened in the dashboard can be kept in step with an Overleaf project, in both directions. Overleaf's Git integration comes with a paid Overleaf plan; without one, a paper can still be uploaded to Overleaf as a new project. The token stays on this machine and is not sent to compute backends.",gJt=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",vJt=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",bJt=()=>"مع حفظ رمز، يمكن إبقاء ورقة مفتوحة في لوحة التحكم متزامنة مع مشروع Overleaf في الاتجاهين. يأتي تكامل Git في Overleaf مع خطة Overleaf مدفوعة؛ وبدونها لا يزال بالإمكان رفع ورقة إلى Overleaf كمشروع جديد. يبقى الرمز على هذا الجهاز ولا يُرسَل إلى بيئات التنفيذ.",yJt=()=>"Con un token guardado, un paper abierto en el dashboard puede mantenerse sincronizado con un proyecto de Overleaf en ambas direcciones. La integración con Git de Overleaf requiere un plan de pago; sin él, puedes seguir subiendo un paper a Overleaf como proyecto nuevo. El token se queda en este equipo y no se envía a los backends de cómputo.",xJt=()=>"टोकन सेव होने पर, डैशबोर्ड में खुला कोई पेपर दोनों दिशाओं में Overleaf प्रोजेक्ट के साथ मेल खाता रहता है। Overleaf का Git इंटीग्रेशन एक पेड Overleaf प्लान के साथ आता है; उसके बिना, एक पेपर को अब भी नए प्रोजेक्ट के रूप में Overleaf पर अपलोड किया जा सकता है। टोकन इसी मशीन पर रहता है और कंप्यूट बैकएंड को नहीं भेजा जाता।",wJt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gJt():t==="fa"?vJt():t==="ar"?bJt():t==="es"?yJt():t==="hi"?xJt():mJt()}),kJt=()=>"Pick a login node first",SJt=()=>"请先选择登录节点",CJt=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",EJt=()=>"اختر عقدة دخول أولًا",NJt=()=>"Elige primero un nodo de acceso",zJt=()=>"पहले एक लॉगिन नोड चुनें",jJt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SJt():t==="fa"?CJt():t==="ar"?EJt():t==="es"?NJt():t==="hi"?zJt():kJt()}),TJt=()=>"Providers",AJt=()=>"提供商",RJt=()=>"ارائه‌دهندگان",MJt=()=>"المزوّدون",OJt=()=>"Proveedores",DJt=()=>"प्रोवाइडर",LJt=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AJt():t==="fa"?RJt():t==="ar"?MJt():t==="es"?OJt():t==="hi"?DJt():TJt()}),IJt=()=>"Reconnect",$Jt=()=>"重新连接",BJt=()=>"اتصال دوباره",PJt=()=>"إعادة الاتصال",FJt=()=>"Reconectar",HJt=()=>"फिर से कनेक्ट करें",zL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Jt():t==="fa"?BJt():t==="ar"?PJt():t==="es"?FJt():t==="hi"?HJt():IJt()}),qJt=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,UJt=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,GJt=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,VJt=e=>`سجّل هذا الحاسوب عبر ${e==null?void 0:e.register}، أو حمّل مفتاحًا مسجّلًا عبر ${e==null?void 0:e.load}.`,KJt=e=>`Registra este equipo con ${e==null?void 0:e.register} o carga una clave registrada con ${e==null?void 0:e.load}.`,WJt=e=>`इस कंप्यूटर को ${e==null?void 0:e.register} से रजिस्टर करें, या ${e==null?void 0:e.load} से एक रजिस्टर्ड की लोड करें।`,QJt=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?UJt(e):t==="fa"?GJt(e):t==="ar"?VJt(e):t==="es"?KJt(e):t==="hi"?WJt(e):qJt(e)}),XJt=()=>"Reinstall with the orx installer to get automatic updates.",YJt=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",ZJt=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",JJt=()=>"أعد التثبيت عبر مُثبّت orx للحصول على التحديثات التلقائية.",een=()=>"Reinstala con el instalador de orx para recibir actualizaciones automáticas.",ten=()=>"ऑटोमैटिक अपडेट पाने के लिए orx इंस्टॉलर से फिर से इंस्टॉल करें।",nen=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YJt():t==="fa"?ZJt():t==="ar"?JJt():t==="es"?een():t==="hi"?ten():XJt()}),ren=()=>"Re-link",sen=()=>"重新链接",ien=()=>"پیوند دوباره",aen=()=>"إعادة الربط",oen=()=>"Volver a enlazar",cen=()=>"फिर से लिंक करें",len=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sen():t==="fa"?ien():t==="ar"?aen():t==="es"?oen():t==="hi"?cen():ren()}),uen=()=>"Remove cookie",_en=()=>"移除 cookie",fen=()=>"حذف کوکی",den=()=>"إزالة ملف تعريف الارتباط",hen=()=>"Quitar cookie",pen=()=>"कुकी हटाएं",men=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_en():t==="fa"?fen():t==="ar"?den():t==="es"?hen():t==="hi"?pen():uen()}),gen=()=>"Remove token",ven=()=>"移除令牌",ben=()=>"حذف توکن",yen=()=>"إزالة الرمز",xen=()=>"Quitar token",wen=()=>"टोकन हटाएं",ken=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ven():t==="fa"?ben():t==="ar"?yen():t==="es"?xen():t==="hi"?wen():gen()}),Sen=()=>"Removing…",Cen=()=>"正在移除…",Een=()=>"در حال حذف…",Nen=()=>"جارٍ الإزالة…",zen=()=>"Quitando…",jen=()=>"हटाया जा रहा है…",Lz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cen():t==="fa"?Een():t==="ar"?Nen():t==="es"?zen():t==="hi"?jen():Sen()}),Ten=()=>"Replace anyway",Aen=()=>"仍要替换",Ren=()=>"به‌هرحال جایگزین کن",Men=()=>"الاستبدال على أي حال",Oen=()=>"Reemplazar de todos modos",Den=()=>"फिर भी बदलें",Len=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Aen():t==="fa"?Ren():t==="ar"?Men():t==="es"?Oen():t==="hi"?Den():Ten()}),Ien=()=>"Replace key",$en=()=>"替换密钥",Ben=()=>"جایگزینی کلید",Pen=()=>"استبدال المفتاح",Fen=()=>"Reemplazar clave",Hen=()=>"की बदलें",qen=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$en():t==="fa"?Ben():t==="ar"?Pen():t==="es"?Fen():t==="hi"?Hen():Ien()}),Uen=()=>"Replace token",Gen=()=>"替换令牌",Ven=()=>"جایگزینی توکن",Ken=()=>"استبدال الرمز",Wen=()=>"Reemplazar token",Qen=()=>"टोकन बदलें",Xen=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gen():t==="fa"?Ven():t==="ar"?Ken():t==="es"?Wen():t==="hi"?Qen():Uen()}),Yen=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,Zen=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,Jen=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,etn=e=>`إعدادات Git وGitHub لـ ${e==null?void 0:e.project}. تعتمد التجارب على Git المحلي؛ والنشر اختياري.`,ttn=e=>`Configuración de Git y GitHub de ${e==null?void 0:e.project}. Git local hace posibles los experimentos; publicar es opcional.`,ntn=e=>`${e==null?void 0:e.project} के लिए Git और GitHub सेटिंग्स। लोकल Git प्रयोगों को चलाता है; प्रकाशन वैकल्पिक है।`,rtn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Zen(e):t==="fa"?Jen(e):t==="ar"?etn(e):t==="es"?ttn(e):t==="hi"?ntn(e):Yen(e)}),stn=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,itn=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,atn=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,otn=e=>`الإصدار ${e==null?void 0:e.installed} مثبّت. لا تزال هذه النافذة تعمل بالإصدار ${e==null?void 0:e.current}.`,ctn=e=>`La versión ${e==null?void 0:e.installed} está instalada. Esta ventana sigue ejecutando la ${e==null?void 0:e.current}.`,ltn=e=>`वर्शन ${e==null?void 0:e.installed} इंस्टॉल है। यह विंडो अभी भी ${e==null?void 0:e.current} चला रही है।`,utn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?itn(e):t==="fa"?atn(e):t==="ar"?otn(e):t==="es"?ctn(e):t==="hi"?ltn(e):stn(e)}),_tn=()=>"Run `gh auth login` in your terminal.",ftn=()=>"请在终端中运行 `gh auth login`。",dtn=()=>"در پایانه `gh auth login` را اجرا کنید.",htn=()=>"نفّذ `gh auth login` في طرفيتك.",ptn=()=>"Ejecuta `gh auth login` en tu terminal.",mtn=()=>"अपने टर्मिनल में `gh auth login` चलाएं।",gtn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ftn():t==="fa"?dtn():t==="ar"?htn():t==="es"?ptn():t==="hi"?mtn():_tn()}),vtn=()=>"Saved",btn=()=>"已保存",ytn=()=>"ذخیره شده",xtn=()=>"تم الحفظ",wtn=()=>"Guardado",ktn=()=>"सेव हो गया",Iz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?btn():t==="fa"?ytn():t==="ar"?xtn():t==="es"?wtn():t==="hi"?ktn():vtn()}),Stn=()=>"Set up",Ctn=()=>"设置",Etn=()=>"راه‌اندازی",Ntn=()=>"إعداد",ztn=()=>"Configurar",jtn=()=>"सेट अप करें",Ttn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ctn():t==="fa"?Etn():t==="ar"?Ntn():t==="es"?ztn():t==="hi"?jtn():Stn()}),Atn=()=>"Set up SSH key",Rtn=()=>"设置 SSH 密钥",Mtn=()=>"راه‌اندازی کلید SSH",Otn=()=>"إعداد مفتاح SSH",Dtn=()=>"Configurar clave SSH",Ltn=()=>"SSH की सेट अप करें",Itn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rtn():t==="fa"?Mtn():t==="ar"?Otn():t==="es"?Dtn():t==="hi"?Ltn():Atn()}),$tn=()=>"Sign in",Btn=()=>"登录",Ptn=()=>"ورود",Ftn=()=>"تسجيل الدخول",Htn=()=>"Iniciar sesión",qtn=()=>"साइन इन करें",jL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Btn():t==="fa"?Ptn():t==="ar"?Ftn():t==="es"?Htn():t==="hi"?qtn():$tn()}),Utn=e=>`SSH connection terminal for ${e==null?void 0:e.host}`,Gtn=e=>`${e==null?void 0:e.host} 的 SSH 连接终端`,Vtn=e=>`پایانهٔ اتصال SSH برای ${e==null?void 0:e.host}`,Ktn=e=>`طرفية اتصال SSH لـ ${e==null?void 0:e.host}`,Wtn=e=>`Terminal de conexión SSH para ${e==null?void 0:e.host}`,Qtn=e=>`${e==null?void 0:e.host} के लिए SSH कनेक्शन टर्मिनल`,TL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Gtn(e):t==="fa"?Vtn(e):t==="ar"?Ktn(e):t==="es"?Wtn(e):t==="hi"?Qtn(e):Utn(e)}),Xtn=()=>"The local database, run logs, artifacts, and chat attachments. Moving this directory copies the entire store.",Ytn=()=>"本地数据库、运行日志、产物和聊天附件。移动此目录会复制整个存储。",Ztn=()=>"پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگو. انتقال این پوشه، کل مخزن داده را کپی می‌کند.",Jtn=()=>"قاعدة البيانات المحلية وسجلات التشغيل والمُخرَجات ومرفقات المحادثة. نقل هذا الدليل ينسخ المخزن بالكامل.",enn=()=>"La base de datos local, los logs de las ejecuciones, los artefactos y los adjuntos de los chats. Mover este directorio copia todo el almacén.",tnn=()=>"लोकल डेटाबेस, रन लॉग, आर्टिफ़ैक्ट और चैट अटैचमेंट। इस डायरेक्टरी को स्थानांतरित करने पर पूरा स्टोर कॉपी होता है।",nnn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ytn():t==="fa"?Ztn():t==="ar"?Jtn():t==="es"?enn():t==="hi"?tnn():Xtn()}),rnn=()=>"The terminal disconnected before setup completed. Try again.",snn=()=>"设置完成前终端连接已断开。请重试。",inn=()=>"ارتباط ترمینال پیش از تکمیل راه‌اندازی قطع شد. دوباره تلاش کنید.",ann=()=>"انقطعت الطرفية قبل اكتمال الإعداد. حاول مجددًا.",onn=()=>"La terminal se desconectó antes de completar la configuración. Inténtalo de nuevo.",cnn=()=>"सेटअप पूरा होने से पहले टर्मिनल डिस्कनेक्ट हो गया। फिर से कोशिश करें।",jv=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?snn():t==="fa"?inn():t==="ar"?ann():t==="es"?onn():t==="hi"?cnn():rnn()}),lnn=()=>"Dark",unn=()=>"深色",_nn=()=>"تیره",fnn=()=>"داكن",dnn=()=>"Oscuro",hnn=()=>"डार्क",pnn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?unn():t==="fa"?_nn():t==="ar"?fnn():t==="es"?dnn():t==="hi"?hnn():lnn()}),mnn=()=>"Theme",gnn=()=>"主题",vnn=()=>"پوسته",bnn=()=>"السمة",ynn=()=>"Tema",xnn=()=>"थीम",$z=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gnn():t==="fa"?vnn():t==="ar"?bnn():t==="es"?ynn():t==="hi"?xnn():mnn()}),wnn=()=>"Light",knn=()=>"浅色",Snn=()=>"روشن",Cnn=()=>"فاتح",Enn=()=>"Claro",Nnn=()=>"लाइट",znn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?knn():t==="fa"?Snn():t==="ar"?Cnn():t==="es"?Enn():t==="hi"?Nnn():wnn()}),jnn=()=>"System",Tnn=()=>"系统",Ann=()=>"سیستم",Rnn=()=>"النظام",Mnn=()=>"Sistema",Onn=()=>"सिस्टम",Dnn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tnn():t==="fa"?Ann():t==="ar"?Rnn():t==="es"?Mnn():t==="hi"?Onn():jnn()}),Lnn=()=>"Set up billing in the Tinker console",Inn=()=>"在 Tinker 控制台设置账单",$nn=()=>"تنظیم پرداخت در کنسول Tinker",Bnn=()=>"أعِدّ الفوترة في وحدة تحكم Tinker",Pnn=()=>"Configura la facturación en la consola de Tinker",Fnn=()=>"Tinker कंसोल में बिलिंग सेट अप करें",Hnn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Inn():t==="fa"?$nn():t==="ar"?Bnn():t==="es"?Pnn():t==="hi"?Fnn():Lnn()}),qnn=()=>"Billing setup required",Unn=()=>"需要设置账单",Gnn=()=>"تنظیم پرداخت لازم است",Vnn=()=>"مطلوب إعداد الفوترة",Knn=()=>"Hay que configurar la facturación",Wnn=()=>"बिलिंग सेटअप ज़रूरी है",Qnn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Unn():t==="fa"?Gnn():t==="ar"?Vnn():t==="es"?Knn():t==="hi"?Wnn():qnn()}),Xnn=()=>"TINKER_API_KEY is set in the process environment and overrides keys saved here. The status reflects that key.",Ynn=()=>"进程环境中已设置 TINKER_API_KEY,它会覆盖此处保存的密钥。状态显示的是该密钥的检查结果。",Znn=()=>"متغیر TINKER_API_KEY در محیط فرایند تنظیم شده و بر کلیدهای ذخیره‌شده در اینجا اولویت دارد. وضعیت مربوط به همان کلید است.",Jnn=()=>"‏TINKER_API_KEY مضبوط في بيئة العملية ويتجاوز المفاتيح المحفوظة هنا. تعكس الحالة ذلك المفتاح.",ern=()=>"TINKER_API_KEY está definida en el entorno del proceso y tiene prioridad sobre las claves guardadas aquí. El estado corresponde a esa clave.",trn=()=>"TINKER_API_KEY प्रोसेस एनवायरनमेंट में सेट है और यहाँ सेव की को ओवरराइड करता है। स्थिति उसी की को दर्शाती है।",nrn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ynn():t==="fa"?Znn():t==="ar"?Jnn():t==="es"?ern():t==="hi"?trn():Xnn()}),rrn=()=>"Invalid Key",srn=()=>"密钥无效",irn=()=>"کلید نامعتبر",arn=()=>"مفتاح غير صالح",orn=()=>"Clave no válida",crn=()=>"अमान्य की",lrn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?srn():t==="fa"?irn():t==="ar"?arn():t==="es"?orn():t==="hi"?crn():rrn()}),urn=()=>"Token from",_rn=()=>"令牌来自",frn=()=>"توکن از",drn=()=>"الرمز من",hrn=()=>"Token tomado de la",prn=()=>"टोकन स्रोत",mrn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_rn():t==="fa"?frn():t==="ar"?drn():t==="es"?hrn():t==="hi"?prn():urn()}),grn=()=>"Update now",vrn=()=>"立即更新",brn=()=>"اکنون به‌روزرسانی کن",yrn=()=>"التحديث الآن",xrn=()=>"Actualizar ahora",wrn=()=>"अभी अपडेट करें",krn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vrn():t==="fa"?brn():t==="ar"?yrn():t==="es"?xrn():t==="hi"?wrn():grn()}),Srn=e=>`Update to ${e==null?void 0:e.version}`,Crn=e=>`更新到 ${e==null?void 0:e.version}`,Ern=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,Nrn=e=>`التحديث إلى ${e==null?void 0:e.version}`,zrn=e=>`Actualizar a ${e==null?void 0:e.version}`,jrn=e=>`वर्शन ${e==null?void 0:e.version} पर अपडेट करें`,Trn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Crn(e):t==="fa"?Ern(e):t==="ar"?Nrn(e):t==="es"?zrn(e):t==="hi"?jrn(e):Srn(e)}),Arn=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",Rrn=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",Mrn=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",Orn=()=>" التحديثات معطّلة لهذه البيئة عبر ORX_NO_UPDATE_CHECK، لذا ليس لهذا الإعداد أثر.",Drn=()=>" ORX_NO_UPDATE_CHECK desactiva las actualizaciones en este entorno, así que este ajuste no tiene efecto.",Lrn=()=>" इस एनवायरनमेंट के लिए ORX_NO_UPDATE_CHECK द्वारा अपडेट बंद कर दिए गए हैं, इसलिए इस सेटिंग का कोई असर नहीं है।",Irn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rrn():t==="fa"?Mrn():t==="ar"?Orn():t==="es"?Drn():t==="hi"?Lrn():Arn()}),$rn=()=>"Updating default destination…",Brn=()=>"正在更新默认运行位置…",Prn=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",Frn=()=>"جارٍ تحديث الوجهة الافتراضية…",Hrn=()=>"Actualizando el destino predeterminado…",qrn=()=>"डिफ़ॉल्ट गंतव्य अपडेट हो रहा है…",Urn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Brn():t==="fa"?Prn():t==="ar"?Frn():t==="es"?Hrn():t==="hi"?qrn():$rn()}),Grn=()=>"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.",Vrn=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",Krn=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",Wrn=()=>"استخدم هذا المستودع لرفع فروع التجارب تلقائيًا عندما يملك حسابك المتصل صلاحية الكتابة فيه. وإلا، ينشئ OpenResearch مستودعًا خاصًا منفصلًا للتعاون.",Qrn=()=>"Usar este repositorio para subir automáticamente las ramas de los experimentos si tu cuenta conectada tiene permiso de escritura. Si no, OpenResearch crea un repositorio privado aparte para colaborar.",Xrn=()=>"जब आपका कनेक्टेड खाता इसमें लिख सकता है तो ऑटोमैटिक प्रयोग-ब्रांच पुश के लिए इस रिपॉज़िटरी का इस्तेमाल करें। नहीं तो, OpenResearch सहयोग के लिए एक अलग निजी रिपॉज़िटरी बनाता है।",Yrn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vrn():t==="fa"?Krn():t==="ar"?Wrn():t==="es"?Qrn():t==="hi"?Xrn():Grn()}),Zrn=()=>"Validating…",Jrn=()=>"正在验证…",esn=()=>"در حال اعتبارسنجی…",tsn=()=>"جارٍ التحقق…",nsn=()=>"Validando…",rsn=()=>"सत्यापित हो रहा है…",AL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jrn():t==="fa"?esn():t==="ar"?tsn():t==="es"?nsn():t==="hi"?rsn():Zrn()}),ssn=()=>"View settings",isn=()=>"查看设置",asn=()=>"مشاهدهٔ تنظیمات",osn=()=>"عرض الإعدادات",csn=()=>"Ver configuración",lsn=()=>"सेटिंग्स देखें",usn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?isn():t==="fa"?asn():t==="ar"?osn():t==="es"?csn():t==="hi"?lsn():ssn()}),_sn=()=>"Skill",fsn=()=>"技能",dsn=()=>"مهارت",hsn=()=>"مهارة",psn=()=>"Skill",msn=()=>"स्किल",gsn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fsn():t==="fa"?dsn():t==="ar"?hsn():t==="es"?psn():t==="hi"?msn():_sn()}),vsn=()=>"Loading skill…",bsn=()=>"正在加载技能…",ysn=()=>"در حال بارگیری مهارت…",xsn=()=>"جارٍ تحميل المهارة…",wsn=()=>"Cargando skill…",ksn=()=>"स्किल लोड हो रही है…",Ssn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bsn():t==="fa"?ysn():t==="ar"?xsn():t==="es"?wsn():t==="hi"?ksn():vsn()}),Csn=()=>"Personal",Esn=()=>"个人",Nsn=()=>"شخصی",zsn=()=>"شخصي",jsn=()=>"Personal",Tsn=()=>"व्यक्तिगत",Asn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Esn():t==="fa"?Nsn():t==="ar"?zsn():t==="es"?jsn():t==="hi"?Tsn():Csn()}),Rsn=()=>"Alternatively, tell your agent to save a reusable skill for you.",Msn=()=>"或者,请你的智能体为你保存可重复使用的技能。",Osn=()=>"یا از عامل خود بخواهید یک مهارت قابل استفادهٔ مجدد برایتان ذخیره کند.",Dsn=()=>"أو بدلًا من ذلك، اطلب من وكيلك حفظ مهارة قابلة لإعادة الاستخدام لك.",Lsn=()=>"También puedes pedirle a tu agente que guarde una skill reutilizable por ti.",Isn=()=>"या अपने एजेंट से आपके लिए एक पुनः-प्रयोग करने योग्य स्किल सेव करने को कहें।",$sn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Msn():t==="fa"?Osn():t==="ar"?Dsn():t==="es"?Lsn():t==="hi"?Isn():Rsn()}),Bsn=e=>`Delete the “${e==null?void 0:e.name}” skill?`,Psn=e=>`删除技能“${e==null?void 0:e.name}”?`,Fsn=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,Hsn=e=>`حذف مهارة «${e==null?void 0:e.name}»؟`,qsn=e=>`¿Eliminar la skill “${e==null?void 0:e.name}”?`,Usn=e=>`“${e==null?void 0:e.name}” स्किल हटाएं?`,Gsn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Psn(e):t==="fa"?Fsn(e):t==="ar"?Hsn(e):t==="es"?qsn(e):t==="hi"?Usn(e):Bsn(e)}),Vsn=e=>`Delete skill ${e==null?void 0:e.name}`,Ksn=e=>`删除技能 ${e==null?void 0:e.name}`,Wsn=e=>`حذف مهارت ${e==null?void 0:e.name}`,Qsn=e=>`حذف المهارة ${e==null?void 0:e.name}`,Xsn=e=>`Eliminar la skill ${e==null?void 0:e.name}`,Ysn=e=>`${e==null?void 0:e.name} स्किल हटाएं`,Zsn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ksn(e):t==="fa"?Wsn(e):t==="ar"?Qsn(e):t==="es"?Xsn(e):t==="hi"?Ysn(e):Vsn(e)}),Jsn=e=>`Delete the “${e==null?void 0:e.name}” template?`,ein=e=>`删除模板“${e==null?void 0:e.name}”?`,tin=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,nin=e=>`حذف قالب «${e==null?void 0:e.name}»؟`,rin=e=>`¿Eliminar la plantilla “${e==null?void 0:e.name}”?`,sin=e=>`“${e==null?void 0:e.name}” टेम्पलेट हटाएं?`,iin=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ein(e):t==="fa"?tin(e):t==="ar"?nin(e):t==="es"?rin(e):t==="hi"?sin(e):Jsn(e)}),ain=e=>`Delete template ${e==null?void 0:e.name}`,oin=e=>`删除模板 ${e==null?void 0:e.name}`,cin=e=>`حذف قالب ${e==null?void 0:e.name}`,lin=e=>`حذف القالب ${e==null?void 0:e.name}`,uin=e=>`Eliminar la plantilla ${e==null?void 0:e.name}`,_in=e=>`${e==null?void 0:e.name} टेम्पलेट हटाएं`,fin=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?oin(e):t==="fa"?cin(e):t==="ar"?lin(e):t==="es"?uin(e):t==="hi"?_in(e):ain(e)}),din=()=>"Invoke skills with /name in chat. Skills from your coding agents are screened for research relevance before importing. Upload a skill to include it yourself. Alternatively, tell your OpenResearch agent to create and add a reusable skill for you.",hin=()=>"在聊天中使用 /name 调用技能。来自编程代理的技能会先经过研究相关性筛选,再导入。您也可以自行上传技能,或让 OpenResearch 代理为您创建并添加可复用技能。",pin=()=>"مهارت‌ها را با /name در گفتگو فراخوانی کنید. مهارت‌های عامل‌های برنامه‌نویسی پیش از وارد شدن از نظر ارتباط با پژوهش بررسی می‌شوند. می‌توانید مهارت را خودتان بارگذاری کنید یا از عامل OpenResearch بخواهید یک مهارت قابل استفادهٔ مجدد بسازد و اضافه کند.",min=()=>"استدعِ المهارات عبر ‎/name‎ في المحادثة. تُفحَص مهارات وكلاء البرمجة لديك للتأكد من صلتها بالبحث قبل استيرادها. ارفع مهارة لتضمينها بنفسك. أو بدلًا من ذلك، اطلب من وكيل OpenResearch إنشاء مهارة قابلة لإعادة الاستخدام وإضافتها لك.",gin=()=>"Usa las skills con /nombre en el chat. Las skills de tus agentes de programación se filtran según su relevancia para la investigación antes de importarlas. Sube una skill para incluirla tú mismo. También puedes pedirle a tu agente de OpenResearch que cree y añada una skill reutilizable por ti.",vin=()=>"चैट में /नाम से स्किल इस्तेमाल करें। आपके कोडिंग एजेंटों की स्किल इंपोर्ट करने से पहले शोध प्रासंगिकता के लिए जाँची जाती हैं। खुद स्किल शामिल करने के लिए एक अपलोड करें। या अपने OpenResearch एजेंट से आपके लिए एक पुनः-प्रयोग करने योग्य स्किल बनाने और जोड़ने को कहें।",bin=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hin():t==="fa"?pin():t==="ar"?min():t==="es"?gin():t==="hi"?vin():din()}),yin=()=>"Drop a SKILL.md or .zip here, or click to choose",xin=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",win=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",kin=()=>"أفلِت ملف ‎SKILL.md‎ أو ‎.zip‎ هنا، أو انقر للاختيار",Sin=()=>"Suelta aquí un SKILL.md o un .zip, o haz clic para elegirlo",Cin=()=>"यहाँ एक SKILL.md या .zip छोड़ें, या चुनने के लिए क्लिक करें",Ein=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xin():t==="fa"?win():t==="ar"?kin():t==="es"?Sin():t==="hi"?Cin():yin()}),Nin=()=>"Drop a .tex or .zip here, or click to choose",zin=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",jin=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Tin=()=>"أفلِت ملف ‎.tex‎ أو ‎.zip‎ هنا، أو انقر للاختيار",Ain=()=>"Suelta aquí un .tex o un .zip, o haz clic para elegirlo",Rin=()=>"यहाँ एक .tex या .zip छोड़ें, या चुनने के लिए क्लिक करें",Min=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zin():t==="fa"?jin():t==="ar"?Tin():t==="es"?Ain():t==="hi"?Rin():Nin()}),Oin=()=>"File too large (max 20 MB).",Din=()=>"文件过大(最大 20 MB)。",Lin=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",Iin=()=>"الملف كبير جدًا (بحد أقصى 20 ميغابايت).",$in=()=>"Archivo demasiado grande (máx. 20 MB).",Bin=()=>"फ़ाइल बहुत बड़ी है (अधिकतम 20 MB)।",RL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Din():t==="fa"?Lin():t==="ar"?Iin():t==="es"?$in():t==="hi"?Bin():Oin()}),Pin=()=>" + 1 file",Fin=()=>" + 1 个文件",Hin=()=>" + ۱ فایل",qin=()=>" + ملف واحد",Uin=()=>" + 1 archivo",Gin=()=>" + 1 फ़ाइल",Vin=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fin():t==="fa"?Hin():t==="ar"?qin():t==="es"?Uin():t==="hi"?Gin():Pin()}),Kin=()=>"Customize the skills and LaTeX templates available across your projects. Upload them here, or ask an OpenResearch agent to create and add them for you.",Win=()=>"自定义所有项目中可用的技能和 LaTeX 模板。在此上传,或让 OpenResearch 代理为您创建并添加。",Qin=()=>"مهارت‌ها و قالب‌های LaTeX قابل استفاده در همهٔ پروژه‌ها را سفارشی کنید. آن‌ها را اینجا بارگذاری کنید یا از عامل OpenResearch بخواهید برایتان بسازد و اضافه کند.",Xin=()=>"خصّص المهارات وقوالب LaTeX المتاحة عبر مشاريعك. ارفعها هنا، أو اطلب من وكيل OpenResearch إنشاءها وإضافتها لك.",Yin=()=>"Personaliza las skills y plantillas de LaTeX disponibles en todos tus proyectos. Súbelas aquí o pídele a un agente de OpenResearch que las cree y las añada por ti.",Zin=()=>"अपने प्रोजेक्ट में उपलब्ध स्किल और LaTeX टेम्पलेट कस्टमाइज़ करें। उन्हें यहाँ अपलोड करें, या किसी OpenResearch एजेंट से आपके लिए उन्हें बनाने और जोड़ने को कहें।",Jin=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Win():t==="fa"?Qin():t==="ar"?Xin():t==="es"?Yin():t==="hi"?Zin():Kin()}),ean=()=>"Remove from OpenResearch",tan=()=>"从 OpenResearch 移除",nan=()=>"حذف از OpenResearch",ran=()=>"إزالة من OpenResearch",san=()=>"Quitar de OpenResearch",ian=()=>"OpenResearch से हटाएं",aan=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tan():t==="fa"?nan():t==="ar"?ran():t==="es"?san():t==="hi"?ian():ean()}),oan=e=>`Remove “${e==null?void 0:e.name}” from OpenResearch? Its source files will remain in your coding agent.`,can=e=>`从 OpenResearch 移除“${e==null?void 0:e.name}”?源文件将保留在你的编程智能体中。`,lan=e=>`«${e==null?void 0:e.name}» از OpenResearch حذف شود؟ فایل‌های اصلی در عامل برنامه‌نویسی شما باقی می‌مانند.`,uan=e=>`إزالة «${e==null?void 0:e.name}» من OpenResearch؟ ستبقى ملفاتها المصدرية في وكيل البرمجة الخاص بك.`,_an=e=>`¿Quitar “${e==null?void 0:e.name}” de OpenResearch? Sus archivos originales se conservarán en tu agente de programación.`,fan=e=>`“${e==null?void 0:e.name}” को OpenResearch से हटाएं? इसकी सोर्स फ़ाइलें आपके कोडिंग एजेंट में बनी रहेंगी।`,dan=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?can(e):t==="fa"?lan(e):t==="ar"?uan(e):t==="es"?_an(e):t==="hi"?fan(e):oan(e)}),han=e=>`Remove ${e==null?void 0:e.name} from OpenResearch`,pan=e=>`从 OpenResearch 移除 ${e==null?void 0:e.name}`,man=e=>`حذف ${e==null?void 0:e.name} از OpenResearch`,gan=e=>`إزالة ${e==null?void 0:e.name} من OpenResearch`,van=e=>`Quitar ${e==null?void 0:e.name} de OpenResearch`,ban=e=>`${e==null?void 0:e.name} को OpenResearch से हटाएं`,yan=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?pan(e):t==="fa"?man(e):t==="ar"?gan(e):t==="es"?van(e):t==="hi"?ban(e):han(e)}),xan=e=>` + ${e==null?void 0:e.count} files`,wan=e=>` + ${e==null?void 0:e.count} 个文件`,kan=e=>` + ${e==null?void 0:e.count} فایل`,San=e=>` + ملفات (${e==null?void 0:e.count})`,Can=e=>` + ${e==null?void 0:e.count} archivos`,Ean=e=>` + ${e==null?void 0:e.count} फ़ाइलें`,Nan=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wan(e):t==="fa"?kan(e):t==="ar"?San(e):t==="es"?Can(e):t==="hi"?Ean(e):xan(e)}),zan=()=>"Could not load skills:",jan=()=>"无法加载技能:",Tan=()=>"بارگیری مهارت‌ها ممکن نشد:",Aan=()=>"تعذّر تحميل المهارات:",Ran=()=>"No se pudieron cargar las skills:",Man=()=>"स्किल लोड नहीं हो सकीं:",Oan=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jan():t==="fa"?Tan():t==="ar"?Aan():t==="es"?Ran():t==="hi"?Man():zan()}),Dan=()=>"Could not load templates:",Lan=()=>"无法加载模板:",Ian=()=>"بارگیری قالب‌ها ممکن نشد:",$an=()=>"تعذّر تحميل القوالب:",Ban=()=>"No se pudieron cargar las plantillas:",Pan=()=>"टेम्पलेट लोड नहीं हो सके:",Fan=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lan():t==="fa"?Ian():t==="ar"?$an():t==="es"?Ban():t==="hi"?Pan():Dan()}),Han=()=>"Customize",qan=()=>"自定义",Uan=()=>"سفارشی‌سازی",Gan=()=>"تخصيص",Van=()=>"Personalizar",Kan=()=>"कस्टमाइज़ करें",Wan=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qan():t==="fa"?Uan():t==="ar"?Gan():t==="es"?Van():t==="hi"?Kan():Han()}),Qan=()=>"Delete skill",Xan=()=>"删除技能",Yan=()=>"حذف مهارت",Zan=()=>"حذف المهارة",Jan=()=>"Eliminar skill",eon=()=>"स्किल हटाएं",ton=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xan():t==="fa"?Yan():t==="ar"?Zan():t==="es"?Jan():t==="hi"?eon():Qan()}),non=()=>"Delete template",ron=()=>"删除模板",son=()=>"حذف قالب",ion=()=>"حذف القالب",aon=()=>"Eliminar plantilla",oon=()=>"टेम्पलेट हटाएं",con=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ron():t==="fa"?son():t==="ar"?ion():t==="es"?aon():t==="hi"?oon():non()}),lon=()=>"LaTeX templates",uon=()=>"LaTeX 模板",_on=()=>"قالب‌های LaTeX",fon=()=>"قوالب LaTeX",don=()=>"Plantillas de LaTeX",hon=()=>"LaTeX टेम्पलेट",pon=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uon():t==="fa"?_on():t==="ar"?fon():t==="es"?don():t==="hi"?hon():lon()}),mon=()=>"Loading skills…",gon=()=>"正在加载技能…",von=()=>"در حال بارگیری مهارت‌ها…",bon=()=>"جارٍ تحميل المهارات…",yon=()=>"Cargando skills…",xon=()=>"स्किल लोड हो रही हैं…",won=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gon():t==="fa"?von():t==="ar"?bon():t==="es"?yon():t==="hi"?xon():mon()}),kon=()=>"Loading templates…",Son=()=>"正在加载模板…",Con=()=>"در حال بارگیری قالب‌ها…",Eon=()=>"جارٍ تحميل القوالب…",Non=()=>"Cargando plantillas…",zon=()=>"टेम्पलेट लोड हो रहे हैं…",jon=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Son():t==="fa"?Con():t==="ar"?Eon():t==="es"?Non():t==="hi"?zon():kon()}),Ton=()=>"No skills yet.",Aon=()=>"尚无技能。",Ron=()=>"هنوز مهارتی وجود ندارد.",Mon=()=>"لا توجد مهارات بعد.",Oon=()=>"Aún no hay skills.",Don=()=>"अभी तक कोई स्किल नहीं।",Lon=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Aon():t==="fa"?Ron():t==="ar"?Mon():t==="es"?Oon():t==="hi"?Don():Ton()}),Ion=()=>"No templates yet.",$on=()=>"尚无模板。",Bon=()=>"هنوز قالبی وجود ندارد.",Pon=()=>"لا توجد قوالب بعد.",Fon=()=>"Aún no hay plantillas.",Hon=()=>"अभी तक कोई टेम्पलेट नहीं।",qon=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$on():t==="fa"?Bon():t==="ar"?Pon():t==="es"?Fon():t==="hi"?Hon():Ion()}),Uon=()=>"Skills",Gon=()=>"技能",Von=()=>"مهارت‌ها",Kon=()=>"المهارات",Won=()=>"Skills",Qon=()=>"स्किल",Xon=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gon():t==="fa"?Von():t==="ar"?Kon():t==="es"?Won():t==="hi"?Qon():Uon()}),Yon=()=>"Uploading…",Zon=()=>"正在上传…",Jon=()=>"در حال بارگذاری…",ecn=()=>"جارٍ الرفع…",tcn=()=>"Subiendo…",ncn=()=>"अपलोड हो रहा है…",rcn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zon():t==="fa"?Jon():t==="ar"?ecn():t==="es"?tcn():t==="hi"?ncn():Yon()}),scn=()=>"A conference class or house style the agent writes papers into instead of its default preamble. Upload a .tex file or a .zip containing its .cls and .sty files. Alternatively, tell your OpenResearch agent to create and add a LaTeX template for you. With exactly one template available, the agent uses it without asking.",icn=()=>"代理撰写论文时使用的会议格式或自定义样式,用于替代默认导言区。上传 .tex 文件或包含 .cls 和 .sty 文件的 .zip 压缩包,也可以让 OpenResearch 代理为您创建并添加 LaTeX 模板。只有一个模板可用时,代理会直接使用,无需询问。",acn=()=>"قالب کنفرانس یا سبک اختصاصی که عامل به‌جای پیش‌گفتار پیش‌فرض برای نوشتن مقاله استفاده می‌کند. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید، یا از عامل OpenResearch بخواهید قالب LaTeX بسازد و اضافه کند. اگر تنها یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",ocn=()=>"قالب مؤتمر أو تنسيق خاص بالمؤسسة يستخدمه الوكيل لكتابة الأوراق بدلًا من إعدادات LaTeX الافتراضية. ارفع ملف ‎.tex‎ أو ملف ‎.zip‎ يحتوي على ملفات ‎.cls‎ و‎.sty‎ الخاصة به. أو اطلب من وكيل OpenResearch إنشاء قالب LaTeX وإضافته لك. عند توفّر قالب واحد فقط، يستخدمه الوكيل دون سؤال.",ccn=()=>"Un estilo de congreso o de la casa en el que el agente escribe los papers en lugar de usar su preámbulo predeterminado. Sube un archivo .tex o un .zip con sus archivos .cls y .sty. También puedes pedirle a tu agente de OpenResearch que cree y añada una plantilla de LaTeX por ti. Si solo hay una plantilla disponible, el agente la usa sin preguntar.",lcn=()=>"एक कॉन्फ़्रेंस क्लास या हाउस स्टाइल जिसमें एजेंट अपने डिफ़ॉल्ट प्रीएंबल की बजाय पेपर लिखता है। एक .tex फ़ाइल या उसकी .cls और .sty फ़ाइलों वाली .zip अपलोड करें। या अपने OpenResearch एजेंट से आपके लिए एक LaTeX टेम्पलेट बनाने और जोड़ने को कहें। ठीक एक टेम्पलेट उपलब्ध होने पर, एजेंट बिना पूछे उसी का इस्तेमाल करता है।",ucn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?icn():t==="fa"?acn():t==="ar"?ocn():t==="es"?ccn():t==="hi"?lcn():scn()}),_cn=()=>"Upload a SKILL.md file or a .zip of a skill folder.",fcn=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",dcn=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",hcn=()=>"ارفع ملف ‎SKILL.md‎ أو ملف ‎.zip‎ لمجلد مهارة.",pcn=()=>"Sube un archivo SKILL.md o un .zip con la carpeta de la skill.",mcn=()=>"एक SKILL.md फ़ाइल या स्किल फ़ोल्डर की .zip अपलोड करें।",gcn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fcn():t==="fa"?dcn():t==="ar"?hcn():t==="es"?pcn():t==="hi"?mcn():_cn()}),vcn=()=>"Upload a .tex file or a .zip of a template folder.",bcn=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",ycn=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",xcn=()=>"ارفع ملف ‎.tex‎ أو ملف ‎.zip‎ لمجلد قالب.",wcn=()=>"Sube un archivo .tex o un .zip con la carpeta de la plantilla.",kcn=()=>"एक .tex फ़ाइल या टेम्पलेट फ़ोल्डर की .zip अपलोड करें।",Scn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bcn():t==="fa"?ycn():t==="ar"?xcn():t==="es"?wcn():t==="hi"?kcn():vcn()}),Ccn=()=>"Close SSH config",Ecn=()=>"关闭 SSH 配置",Ncn=()=>"بستن پیکربندی SSH",zcn=()=>"إغلاق إعداد SSH",jcn=()=>"Cerrar la configuración SSH",Tcn=()=>"SSH कॉन्फ़िग बंद करें",Acn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ecn():t==="fa"?Ncn():t==="ar"?zcn():t==="es"?jcn():t==="hi"?Tcn():Ccn()}),Rcn=()=>"Discard your unsaved SSH config changes?",Mcn=()=>"要放弃未保存的 SSH 配置更改吗?",Ocn=()=>"تغییرات ذخیره‌نشدهٔ پیکربندی SSH کنار گذاشته شود؟",Dcn=()=>"تجاهل تغييرات إعداد SSH غير المحفوظة؟",Lcn=()=>"¿Descartar los cambios sin guardar en la configuración SSH?",Icn=()=>"आपके सेव न किए गए SSH कॉन्फ़िग बदलाव छोड़ें?",$cn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mcn():t==="fa"?Ocn():t==="ar"?Dcn():t==="es"?Lcn():t==="hi"?Icn():Rcn()}),Bcn=()=>"Loading SSH config…",Pcn=()=>"正在加载 SSH 配置…",Fcn=()=>"در حال بارگیری پیکربندی SSH…",Hcn=()=>"جارٍ تحميل إعداد SSH…",qcn=()=>"Cargando la configuración SSH…",Ucn=()=>"SSH कॉन्फ़िग लोड हो रहा है…",Gcn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pcn():t==="fa"?Fcn():t==="ar"?Hcn():t==="es"?qcn():t==="hi"?Ucn():Bcn()}),Vcn=()=>"SSH config saved",Kcn=()=>"SSH 配置已保存",Wcn=()=>"پیکربندی SSH ذخیره شد",Qcn=()=>"تم حفظ إعداد SSH",Xcn=()=>"Configuración SSH guardada",Ycn=()=>"SSH कॉन्फ़िग सेव हो गया",Zcn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kcn():t==="fa"?Wcn():t==="ar"?Qcn():t==="es"?Xcn():t==="hi"?Ycn():Vcn()}),Jcn=()=>"SSH config",eln=()=>"SSH 配置",tln=()=>"پیکربندی SSH",nln=()=>"إعداد SSH",rln=()=>"Configuración SSH",sln=()=>"SSH कॉन्फ़िग",iln=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eln():t==="fa"?tln():t==="ar"?nln():t==="es"?rln():t==="hi"?sln():Jcn()}),aln=()=>"Configure SSH hosts…",oln=()=>"配置 SSH 主机…",cln=()=>"پیکربندی میزبان‌های SSH…",lln=()=>"إعداد مضيفات SSH…",uln=()=>"Configurar hosts SSH…",_ln=()=>"SSH होस्ट कॉन्फ़िगर करें…",ML=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oln():t==="fa"?cln():t==="ar"?lln():t==="es"?uln():t==="hi"?_ln():aln()}),fln=()=>"Container name or ID",dln=()=>"容器名称或 ID",hln=()=>"نام یا شناسهٔ کانتینر",pln=()=>"اسم الحاوية أو معرّفها",mln=()=>"Nombre o ID del contenedor",gln=()=>"कंटेनर का नाम या ID",vln=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dln():t==="fa"?hln():t==="ar"?pln():t==="es"?mln():t==="hi"?gln():fln()}),bln=()=>"Default SSH host",yln=()=>"默认 SSH 主机",xln=()=>"میزبان پیش‌فرض SSH",wln=()=>"مضيف SSH الافتراضي",kln=()=>"Servidor SSH predeterminado",Sln=()=>"डिफ़ॉल्ट SSH होस्ट",Cln=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yln():t==="fa"?xln():t==="ar"?wln():t==="es"?kln():t==="hi"?Sln():bln()}),Eln=()=>"Direct host",Nln=()=>"直接在主机上",zln=()=>"مستقیماً روی میزبان",jln=()=>"المضيف مباشرة",Tln=()=>"Servidor directamente",Aln=()=>"सीधे होस्ट पर",Rln=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nln():t==="fa"?zln():t==="ar"?jln():t==="es"?Tln():t==="hi"?Aln():Eln()}),Mln=()=>"Existing container",Oln=()=>"现有容器",Dln=()=>"کانتینر موجود",Lln=()=>"حاوية موجودة",Iln=()=>"Contenedor existente",$ln=()=>"मौजूदा कंटेनर",Bln=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Oln():t==="fa"?Dln():t==="ar"?Lln():t==="es"?Iln():t==="hi"?$ln():Mln()}),Pln=()=>"Run in",Fln=()=>"运行位置",Hln=()=>"اجرا در",qln=()=>"التشغيل في",Uln=()=>"Ejecutar en",Gln=()=>"यहाँ चलाएँ",Vln=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fln():t==="fa"?Hln():t==="ar"?qln():t==="es"?Uln():t==="hi"?Gln():Pln()}),Kln=()=>"Cancelled",Wln=()=>"已取消",Qln=()=>"لغوشده",Xln=()=>"ملغى",Yln=()=>"Cancelado",Zln=()=>"रद्द किया गया",Jln=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wln():t==="fa"?Qln():t==="ar"?Xln():t==="es"?Yln():t==="hi"?Zln():Kln()}),eun=()=>"Cancelling",tun=()=>"正在取消",nun=()=>"در حال لغو",run=()=>"جارٍ الإلغاء",sun=()=>"Cancelando",iun=()=>"रद्द हो रहा है",aun=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tun():t==="fa"?nun():t==="ar"?run():t==="es"?sun():t==="hi"?iun():eun()}),oun=()=>"Done",cun=()=>"已完成",lun=()=>"انجام‌شده",uun=()=>"تم",_un=()=>"Completado",fun=()=>"पूरा हुआ",OL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cun():t==="fa"?lun():t==="ar"?uun():t==="es"?_un():t==="hi"?fun():oun()}),dun=()=>"Editing",hun=()=>"正在编辑",pun=()=>"در حال ویرایش",mun=()=>"قيد التعديل",gun=()=>"Editando",vun=()=>"संपादित हो रहा है",bun=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hun():t==="fa"?pun():t==="ar"?mun():t==="es"?gun():t==="hi"?vun():dun()}),yun=()=>"Failed",xun=()=>"失败",wun=()=>"ناموفق",kun=()=>"فشل",Sun=()=>"Error",Cun=()=>"विफल",Eun=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xun():t==="fa"?wun():t==="ar"?kun():t==="es"?Sun():t==="hi"?Cun():yun()}),Nun=()=>"Idle",zun=()=>"空闲",jun=()=>"بی‌کار",Tun=()=>"خامل",Aun=()=>"Inactivo",Run=()=>"निष्क्रिय",Mun=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zun():t==="fa"?jun():t==="ar"?Tun():t==="es"?Aun():t==="hi"?Run():Nun()}),Oun=()=>"Running",Dun=()=>"运行中",Lun=()=>"در حال اجرا",Iun=()=>"قيد التشغيل",$un=()=>"En ejecución",Bun=()=>"चल रहा है",Pun=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dun():t==="fa"?Lun():t==="ar"?Iun():t==="es"?$un():t==="hi"?Bun():Oun()}),Fun=()=>"Starting",Hun=()=>"正在启动",qun=()=>"در حال آغاز",Uun=()=>"جارٍ البدء",Gun=()=>"Iniciando",Vun=()=>"शुरू हो रहा है",Kun=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hun():t==="fa"?qun():t==="ar"?Uun():t==="es"?Gun():t==="hi"?Vun():Fun()}),Wun=()=>"Copying…",Qun=()=>"正在复制…",Xun=()=>"در حال کپی…",Yun=()=>"جارٍ النسخ…",Zun=()=>"Copiando…",Jun=()=>"कॉपी हो रहा है…",e_n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qun():t==="fa"?Xun():t==="ar"?Yun():t==="es"?Zun():t==="hi"?Jun():Wun()}),t_n=()=>"Finalizing…",n_n=()=>"正在完成…",r_n=()=>"در حال نهایی‌سازی…",s_n=()=>"جارٍ الإنهاء…",i_n=()=>"Finalizando…",a_n=()=>"अंतिम रूप दिया जा रहा है…",o_n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n_n():t==="fa"?r_n():t==="ar"?s_n():t==="es"?i_n():t==="hi"?a_n():t_n()}),c_n=e=>`${e==null?void 0:e.size} free at target`,l_n=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,u_n=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,__n=e=>`${e==null?void 0:e.size} متاح في الوجهة`,f_n=e=>`${e==null?void 0:e.size} libres en el destino`,d_n=e=>`गंतव्य पर ${e==null?void 0:e.size} खाली`,h_n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?l_n(e):t==="fa"?u_n(e):t==="ar"?__n(e):t==="es"?f_n(e):t==="hi"?d_n(e):c_n(e)}),p_n=e=>`Move all orx data to: +इसका ट्रांसक्रिप्ट स्थायी रूप से हट जाएगा।`,Eme=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?xme(e):t==="fa"?wme(e):t==="ar"?kme(e):t==="es"?Sme(e):t==="hi"?Cme(e):yme(e)}),Nme=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,zme=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,jme=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,Tme=e=>`تعذّر حذف «${e==null?void 0:e.title}»: ${e==null?void 0:e.error}`,Ame=e=>`No se pudo eliminar “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,Rme=e=>`“${e==null?void 0:e.title}” हटाने में विफल: ${e==null?void 0:e.error}`,Mme=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?zme(e):t==="fa"?jme(e):t==="ar"?Tme(e):t==="es"?Ame(e):t==="hi"?Rme(e):Nme(e)}),Ome=()=>"Could not exit Plan mode. Try again.",Dme=()=>"无法退出计划模式。请重试。",Lme=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",Ime=()=>"تعذّر الخروج من وضع التخطيط. حاول مجددًا.",$me=()=>"No se pudo salir del modo Plan. Inténtalo de nuevo.",Bme=()=>"प्लान मोड से बाहर नहीं निकला जा सका। फिर से कोशिश करें।",Pme=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Dme():t==="fa"?Lme():t==="ar"?Ime():t==="es"?$me():t==="hi"?Bme():Ome()}),Fme=()=>"Expand tool activity",Hme=()=>"展开工具活动",qme=()=>"باز کردن فعالیت ابزارها",Ume=()=>"توسيع نشاط الأداة",Gme=()=>"Expandir actividad de herramientas",Vme=()=>"टूल गतिविधि फैलाएं",Kme=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Hme():t==="fa"?qme():t==="ar"?Ume():t==="es"?Gme():t==="hi"?Vme():Fme()}),Wme=()=>"experiments",Qme=()=>"实验",Xme=()=>"آزمایش‌ها",Yme=()=>"التجارب",Zme=()=>"experimentos",Jme=()=>"प्रयोग",ege=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Qme():t==="fa"?Xme():t==="ar"?Yme():t==="es"?Zme():t==="hi"?Jme():Wme()}),tge=()=>"You",nge=()=>"你",rge=()=>"شما",sge=()=>"أنت",ige=()=>"Tú",age=()=>"आप",oge=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nge():t==="fa"?rge():t==="ar"?sge():t==="es"?ige():t==="hi"?age():tge()}),cge=()=>"Goal cleared",lge=()=>"已清除目标",uge=()=>"هدف پاک شد",_ge=()=>"تم مسح الهدف",fge=()=>"Objetivo borrado",dge=()=>"लक्ष्य हटाया गया",hge=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lge():t==="fa"?uge():t==="ar"?_ge():t==="es"?fge():t==="hi"?dge():cge()}),pge=e=>`Current goal: ${e==null?void 0:e.goal}`,mge=e=>`当前目标:${e==null?void 0:e.goal}`,gge=e=>`هدف فعلی: ${e==null?void 0:e.goal}`,vge=e=>`الهدف الحالي: ${e==null?void 0:e.goal}`,bge=e=>`Objetivo actual: ${e==null?void 0:e.goal}`,yge=e=>`मौजूदा लक्ष्य: ${e==null?void 0:e.goal}`,xge=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?mge(e):t==="fa"?gge(e):t==="ar"?vge(e):t==="es"?bge(e):t==="hi"?yge(e):pge(e)}),wge=e=>`Setting the goal failed: ${e==null?void 0:e.error}`,kge=e=>`设置目标失败:${e==null?void 0:e.error}`,Sge=e=>`تنظیم هدف ناموفق بود: ${e==null?void 0:e.error}`,Cge=e=>`فشل تعيين الهدف: ${e==null?void 0:e.error}`,Ege=e=>`Error al definir el objetivo: ${e==null?void 0:e.error}`,Nge=e=>`लक्ष्य सेट करना विफल: ${e==null?void 0:e.error}`,nN=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?kge(e):t==="fa"?Sge(e):t==="ar"?Cge(e):t==="es"?Ege(e):t==="hi"?Nge(e):wge(e)}),zge=()=>"No goal set — add one after /goal",jge=()=>"尚未设置目标 — 在 /goal 后面写一个",Tge=()=>"هدفی تنظیم نشده — یکی را بعد از /goal بنویسید",Age=()=>"لا يوجد هدف — أضف واحدًا بعد /goal",Rge=()=>"Sin objetivo — añade uno después de /goal",Mge=()=>"कोई लक्ष्य नहीं — /goal के बाद एक जोड़ें",Oge=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jge():t==="fa"?Tge():t==="ar"?Age():t==="es"?Rge():t==="hi"?Mge():zge()}),Dge=()=>"Goal set",Lge=()=>"已设置目标",Ige=()=>"هدف تنظیم شد",$ge=()=>"تم تعيين الهدف",Bge=()=>"Objetivo definido",Pge=()=>"लक्ष्य सेट किया गया",Fge=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Lge():t==="fa"?Ige():t==="ar"?$ge():t==="es"?Bge():t==="hi"?Pge():Dge()}),Hge=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,qge=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,Uge=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,Gge=e=>`${e==null?void 0:e.harness} غير متاح — افتح مُنتقي النماذج`,Vge=e=>`${e==null?void 0:e.harness} no está disponible — abre el selector de modelos`,Kge=e=>`${e==null?void 0:e.harness} उपलब्ध नहीं है — मॉडल पिकर खोलें`,Wge=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?qge(e):t==="fa"?Uge(e):t==="ar"?Gge(e):t==="es"?Vge(e):t==="hi"?Kge(e):Hge(e)}),Qge=e=>`Importing that chat failed: ${e==null?void 0:e.error}`,Xge=e=>`导入该聊天失败:${e==null?void 0:e.error}`,Yge=e=>`وارد کردن آن گفت‌وگو ناموفق بود: ${e==null?void 0:e.error}`,Zge=e=>`فشل استيراد تلك المحادثة: ${e==null?void 0:e.error}`,Jge=e=>`Error al importar ese chat: ${e==null?void 0:e.error}`,e1e=e=>`उस चैट को इम्पोर्ट करना विफल: ${e==null?void 0:e.error}`,t1e=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Xge(e):t==="fa"?Yge(e):t==="ar"?Zge(e):t==="es"?Jge(e):t==="hi"?e1e(e):Qge(e)}),n1e=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills, ! for shell)`,r1e=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能,输入 ! 运行 shell)`,s1e=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)`,i1e=e=>`راسِل ${e==null?void 0:e.harness}… (/ للأوامر والمهارات، ! للطرفية)`,a1e=e=>`Escribe a ${e==null?void 0:e.harness}… (/ para comandos y skills, ! para la shell)`,o1e=e=>`${e==null?void 0:e.harness} को संदेश भेजें… (कमांड और स्किल के लिए /, शेल के लिए !)`,c1e=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?r1e(e):t==="fa"?s1e(e):t==="ar"?i1e(e):t==="es"?a1e(e):t==="hi"?o1e(e):n1e(e)}),l1e=e=>`Message not sent: ${e==null?void 0:e.error}`,u1e=e=>`消息未发送:${e==null?void 0:e.error}`,_1e=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,f1e=e=>`لم تُرسل الرسالة: ${e==null?void 0:e.error}`,d1e=e=>`Mensaje no enviado: ${e==null?void 0:e.error}`,h1e=e=>`संदेश नहीं भेजा गया: ${e==null?void 0:e.error}`,p1e=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?u1e(e):t==="fa"?_1e(e):t==="ar"?f1e(e):t==="es"?d1e(e):t==="hi"?h1e(e):l1e(e)}),m1e=()=>"Model unavailable",g1e=()=>"模型不可用",v1e=()=>"مدل در دسترس نیست",b1e=()=>"النموذج غير متاح",y1e=()=>"Modelo no disponible",x1e=()=>"मॉडल उपलब्ध नहीं",w1e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?g1e():t==="fa"?v1e():t==="ar"?b1e():t==="es"?y1e():t==="hi"?x1e():m1e()}),k1e=()=>"New session",S1e=()=>"新会话",C1e=()=>"نشست جدید",E1e=()=>"جلسة جديدة",N1e=()=>"Nueva sesión",z1e=()=>"नया सेशन",rN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?S1e():t==="fa"?C1e():t==="ar"?E1e():t==="es"?N1e():t==="hi"?z1e():k1e()}),j1e=()=>"No active sessions",T1e=()=>"没有活跃会话",A1e=()=>"نشست فعالی وجود ندارد",R1e=()=>"لا توجد جلسات نشطة",M1e=()=>"No hay sesiones activas",O1e=()=>"कोई सक्रिय सेशन नहीं",D1e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?T1e():t==="fa"?A1e():t==="ar"?R1e():t==="es"?M1e():t==="hi"?O1e():j1e()}),L1e=()=>"No activity",I1e=()=>"无活动",$1e=()=>"بدون فعالیت",B1e=()=>"لا يوجد نشاط",P1e=()=>"Sin actividad",F1e=()=>"कोई गतिविधि नहीं",H1e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?I1e():t==="fa"?$1e():t==="ar"?B1e():t==="es"?P1e():t==="hi"?F1e():L1e()}),q1e=()=>"No archived sessions",U1e=()=>"没有已归档的会话",G1e=()=>"نشست بایگانی‌شده‌ای وجود ندارد",V1e=()=>"لا توجد جلسات مؤرشفة",K1e=()=>"No hay sesiones archivadas",W1e=()=>"कोई आर्काइव किया गया सेशन नहीं",Q1e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?U1e():t==="fa"?G1e():t==="ar"?V1e():t==="es"?K1e():t==="hi"?W1e():q1e()}),X1e=()=>"No sessions yet",Y1e=()=>"还没有会话",Z1e=()=>"هنوز نشستی وجود ندارد",J1e=()=>"لا توجد جلسات بعد",eve=()=>"Aún no hay sesiones",tve=()=>"अभी तक कोई सेशन नहीं",nve=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Y1e():t==="fa"?Z1e():t==="ar"?J1e():t==="es"?eve():t==="hi"?tve():X1e()}),rve=()=>"There is nothing to compact yet",sve=()=>"还没有可压缩的内容",ive=()=>"هنوز چیزی برای فشرده‌سازی وجود ندارد",ave=()=>"لا يوجد شيء لضغطه بعد",ove=()=>"Aún no hay nada que comprimir",cve=()=>"छोटा करने के लिए अभी कुछ नहीं है",lve=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?sve():t==="fa"?ive():t==="ar"?ave():t==="es"?ove():t==="hi"?cve():rve()}),uve=()=>"No response to copy yet",_ve=()=>"还没有可复制的回复",fve=()=>"هنوز پاسخی برای کپی وجود ندارد",dve=()=>"لا يوجد رد لنسخه بعد",hve=()=>"Aún no hay ninguna respuesta que copiar",pve=()=>"कॉपी करने के लिए अभी कोई जवाब नहीं है",mve=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_ve():t==="fa"?fve():t==="ar"?dve():t==="es"?hve():t==="hi"?pve():uve()}),gve=()=>"Nothing to export yet",vve=()=>"还没有可导出的内容",bve=()=>"هنوز چیزی برای خروجی گرفتن وجود ندارد",yve=()=>"لا يوجد شيء لتصديره بعد",xve=()=>"Aún no hay nada que exportar",wve=()=>"एक्सपोर्ट करने के लिए अभी कुछ नहीं है",kve=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vve():t==="fa"?bve():t==="ar"?yve():t==="es"?xve():t==="hi"?wve():gve()}),Sve=()=>"1 annotation",Cve=()=>"1 条批注",Eve=()=>"۱ یادداشت",Nve=()=>"تعليق واحد",zve=()=>"1 anotación",jve=()=>"1 एनोटेशन",Tve=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Cve():t==="fa"?Eve():t==="ar"?Nve():t==="es"?zve():t==="hi"?jve():Sve()}),Ave=()=>"Open sub-agent transcript",Rve=()=>"打开子智能体记录",Mve=()=>"باز کردن متن گفت‌وگوی عامل فرعی",Ove=()=>"فتح سجل محادثة الوكيل الفرعي",Dve=()=>"Abrir la transcripción del subagente",Lve=()=>"सब-एजेंट ट्रांसक्रिप्ट खोलें",Ive=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rve():t==="fa"?Mve():t==="ar"?Ove():t==="es"?Dve():t==="hi"?Lve():Ave()}),$ve=()=>"About this demo",Bve=()=>"关于此演示",Pve=()=>"دربارهٔ این نسخهٔ نمایشی",Fve=()=>"حول هذا العرض التوضيحي",Hve=()=>"Acerca de esta demo",qve=()=>"इस डेमो के बारे में",sN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bve():t==="fa"?Pve():t==="ar"?Fve():t==="es"?Hve():t==="hi"?qve():$ve()}),Uve=()=>"Accept and auto mode",Gve=()=>"接受并使用自动模式",Vve=()=>"پذیرش و حالت خودکار",Kve=()=>"قبول وتفعيل الوضع التلقائي",Wve=()=>"Aceptar en modo automático",Qve=()=>"स्वीकार करें और ऑटो मोड",Xve=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Gve():t==="fa"?Vve():t==="ar"?Kve():t==="es"?Wve():t==="hi"?Qve():Uve()}),Yve=()=>"Accept and bypass all",Zve=()=>"接受并跳过所有审批",Jve=()=>"پذیرش و عبور از همهٔ تأییدها",ebe=()=>"القبول وتجاوز الكل",tbe=()=>"Aceptar y omitir permisos",nbe=()=>"स्वीकार करें और सब बायपास करें",rbe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Zve():t==="fa"?Jve():t==="ar"?ebe():t==="es"?tbe():t==="hi"?nbe():Yve()}),sbe=()=>"Active",ibe=()=>"活跃",abe=()=>"فعال",obe=()=>"نشط",cbe=()=>"Activas",lbe=()=>"सक्रिय",ube=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ibe():t==="fa"?abe():t==="ar"?obe():t==="es"?cbe():t==="hi"?lbe():sbe()}),_be=()=>"All",fbe=()=>"全部",dbe=()=>"همه",hbe=()=>"الكل",pbe=()=>"Todas",mbe=()=>"सभी",gbe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fbe():t==="fa"?dbe():t==="ar"?hbe():t==="es"?pbe():t==="hi"?mbe():_be()}),vbe=()=>"Allow",bbe=()=>"允许",ybe=()=>"اجازه دادن",xbe=()=>"السماح",wbe=()=>"Permitir",kbe=()=>"अनुमति दें",Sbe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bbe():t==="fa"?ybe():t==="ar"?xbe():t==="es"?wbe():t==="hi"?kbe():vbe()}),Cbe=()=>"Approval required",Ebe=()=>"需要批准",Nbe=()=>"نیازمند تأیید",zbe=()=>"الموافقة مطلوبة",jbe=()=>"Aprobación necesaria",Tbe=()=>"स्वीकृति ज़रूरी है",Abe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ebe():t==="fa"?Nbe():t==="ar"?zbe():t==="es"?jbe():t==="hi"?Tbe():Cbe()}),Rbe=()=>"Archived",Mbe=()=>"已归档",Obe=()=>"بایگانی‌شده",Dbe=()=>"مؤرشف",Lbe=()=>"Archivadas",Ibe=()=>"आर्काइव किया गया",iN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Mbe():t==="fa"?Obe():t==="ar"?Dbe():t==="es"?Lbe():t==="hi"?Ibe():Rbe()}),$be=()=>"Ask about this",Bbe=()=>"询问此内容",Pbe=()=>"دربارهٔ این بپرسید",Fbe=()=>"اسأل عن هذا",Hbe=()=>"Preguntar sobre esto",qbe=()=>"इसके बारे में पूछें",Ube=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bbe():t==="fa"?Pbe():t==="ar"?Fbe():t==="es"?Hbe():t==="hi"?qbe():$be()}),Gbe=()=>"Attach a PDF or image",Vbe=()=>"附加 PDF 或图片",Kbe=()=>"پیوست PDF یا تصویر",Wbe=()=>"إرفاق ملف PDF أو صورة",Qbe=()=>"Adjuntar un PDF o una imagen",Xbe=()=>"PDF या इमेज अटैच करें",aN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vbe():t==="fa"?Kbe():t==="ar"?Wbe():t==="es"?Qbe():t==="hi"?Xbe():Gbe()}),Ybe=()=>"Bash",Zbe=()=>"Bash",Jbe=()=>"Bash",eye=()=>"Bash",tye=()=>"Bash",nye=()=>"Bash",ED=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Zbe():t==="fa"?Jbe():t==="ar"?eye():t==="es"?tye():t==="hi"?nye():Ybe()}),rye=()=>"Browsed the web",sye=()=>"已浏览网页",iye=()=>"وب مرور شد",aye=()=>"تصفّح الويب",oye=()=>"Navegó por la web",cye=()=>"वेब ब्राउज़ किया",oN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?sye():t==="fa"?iye():t==="ar"?aye():t==="es"?oye():t==="hi"?cye():rye()}),lye=()=>"Built the project",uye=()=>"已构建项目",_ye=()=>"پروژه ساخته شد",fye=()=>"بنى المشروع",dye=()=>"Compiló el proyecto",hye=()=>"प्रोजेक्ट बिल्ड किया",pye=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?uye():t==="fa"?_ye():t==="ar"?fye():t==="es"?dye():t==="hi"?hye():lye()}),mye=()=>"Cancel",gye=()=>"取消",vye=()=>"لغو",bye=()=>"إلغاء",yye=()=>"Cancelar",xye=()=>"रद्द करें",wye=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gye():t==="fa"?vye():t==="ar"?bye():t==="es"?yye():t==="hi"?xye():mye()}),kye=()=>"Cancelled an experiment run",Sye=()=>"已取消实验运行",Cye=()=>"اجرای آزمایش لغو شد",Eye=()=>"ألغى تشغيل تجربة",Nye=()=>"Canceló una ejecución de experimento",zye=()=>"एक प्रयोग रन रद्द किया",jye=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Sye():t==="fa"?Cye():t==="ar"?Eye():t==="es"?Nye():t==="hi"?zye():kye()}),Tye=()=>"Checked code style",Aye=()=>"已检查代码风格",Rye=()=>"سبک کد بررسی شد",Mye=()=>"فحص نمط الشيفرة",Oye=()=>"Revisó el estilo del código",Dye=()=>"कोड स्टाइल जाँची",Lye=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Aye():t==="fa"?Rye():t==="ar"?Mye():t==="es"?Oye():t==="hi"?Dye():Tye()}),Iye=()=>"Checked compute options",$ye=()=>"已检查算力选项",Bye=()=>"گزینه‌های رایانشی بررسی شد",Pye=()=>"فحص خيارات الحوسبة",Fye=()=>"Consultó las opciones de cómputo",Hye=()=>"कंप्यूट विकल्प जाँचे",qye=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$ye():t==="fa"?Bye():t==="ar"?Pye():t==="es"?Fye():t==="hi"?Hye():Iye()}),Uye=()=>"Checked experiment status",Gye=()=>"已检查实验状态",Vye=()=>"وضعیت آزمایش بررسی شد",Kye=()=>"فحص حالة التجربة",Wye=()=>"Consultó el estado del experimento",Qye=()=>"प्रयोग की स्थिति जाँची",cN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Gye():t==="fa"?Vye():t==="ar"?Kye():t==="es"?Wye():t==="hi"?Qye():Uye()}),Xye=()=>"Checked Git status",Yye=()=>"已检查 Git 状态",Zye=()=>"وضعیت Git بررسی شد",Jye=()=>"فحص حالة Git",exe=()=>"Consultó el estado de Git",txe=()=>"Git स्थिति जाँची",nxe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Yye():t==="fa"?Zye():t==="ar"?Jye():t==="es"?exe():t==="hi"?txe():Xye()}),rxe=()=>"Checked local times",sxe=()=>"已查询当地时间",ixe=()=>"زمان‌های محلی بررسی شد",axe=()=>"فحص التوقيتات المحلية",oxe=()=>"Consultó horas locales",cxe=()=>"स्थानीय समय जाँचे",lxe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?sxe():t==="fa"?ixe():t==="ar"?axe():t==="es"?oxe():t==="hi"?cxe():rxe()}),uxe=()=>"Checked market data",_xe=()=>"已查询市场数据",fxe=()=>"داده‌های بازار بررسی شد",dxe=()=>"فحص بيانات السوق",hxe=()=>"Consultó datos de mercado",pxe=()=>"बाज़ार डेटा जाँचा",mxe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_xe():t==="fa"?fxe():t==="ar"?dxe():t==="es"?hxe():t==="hi"?pxe():uxe()}),gxe=()=>"Checked sports data",vxe=()=>"已查询体育数据",bxe=()=>"داده‌های ورزشی بررسی شد",yxe=()=>"فحص البيانات الرياضية",xxe=()=>"Consultó datos deportivos",wxe=()=>"खेल डेटा जाँचा",kxe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vxe():t==="fa"?bxe():t==="ar"?yxe():t==="es"?xxe():t==="hi"?wxe():gxe()}),Sxe=()=>"Checked the weather",Cxe=()=>"已查询天气",Exe=()=>"آب‌وهوا بررسی شد",Nxe=()=>"فحص حالة الطقس",zxe=()=>"Consultó el tiempo",jxe=()=>"मौसम जाँचा",Txe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Cxe():t==="fa"?Exe():t==="ar"?Nxe():t==="es"?zxe():t==="hi"?jxe():Sxe()}),Axe=()=>"Checked types",Rxe=()=>"已检查类型",Mxe=()=>"نوع‌ها بررسی شد",Oxe=()=>"فحص الأنواع",Dxe=()=>"Comprobó los tipos",Lxe=()=>"टाइप जाँचे",Ixe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rxe():t==="fa"?Mxe():t==="ar"?Oxe():t==="es"?Dxe():t==="hi"?Lxe():Axe()}),$xe=()=>"Clear annotations",Bxe=()=>"清除批注",Pxe=()=>"پاک کردن یادداشت‌ها",Fxe=()=>"مسح التعليقات",Hxe=()=>"Borrar anotaciones",qxe=()=>"एनोटेशन साफ़ करें",lN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bxe():t==="fa"?Pxe():t==="ar"?Fxe():t==="es"?Hxe():t==="hi"?qxe():$xe()}),Uxe=e=>`Clear the goal: ${e==null?void 0:e.goal}`,Gxe=e=>`清除目标:${e==null?void 0:e.goal}`,Vxe=e=>`پاک‌کردن هدف: ${e==null?void 0:e.goal}`,Kxe=e=>`مسح الهدف: ${e==null?void 0:e.goal}`,Wxe=e=>`Borrar el objetivo: ${e==null?void 0:e.goal}`,Qxe=e=>`लक्ष्य हटाएँ: ${e==null?void 0:e.goal}`,uN=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Gxe(e):t==="fa"?Vxe(e):t==="ar"?Kxe(e):t==="es"?Wxe(e):t==="hi"?Qxe(e):Uxe(e)}),Xxe=()=>"Customize",Yxe=()=>"自定义",Zxe=()=>"سفارشی‌سازی",Jxe=()=>"تخصيص",e2e=()=>"Personalizar",t2e=()=>"कस्टमाइज़ करें",n2e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Yxe():t==="fa"?Zxe():t==="ar"?Jxe():t==="es"?e2e():t==="hi"?t2e():Xxe()}),r2e=()=>"Data sources",s2e=()=>"数据源",i2e=()=>"منابع داده",a2e=()=>"مصادر البيانات",o2e=()=>"Fuentes de datos",c2e=()=>"डेटा स्रोत",J2=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?s2e():t==="fa"?i2e():t==="ar"?a2e():t==="es"?o2e():t==="hi"?c2e():r2e()}),l2e=()=>"Delegated a task to a new agent",u2e=()=>"已将任务委派给新智能体",_2e=()=>"وظیفه به عامل جدید واگذار شد",f2e=()=>"فوّض مهمة إلى وكيل جديد",d2e=()=>"Delegó una tarea a un nuevo agente",h2e=()=>"एक नए एजेंट को टास्क सौंपा",p2e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?u2e():t==="fa"?_2e():t==="ar"?f2e():t==="es"?d2e():t==="hi"?h2e():l2e()}),m2e=()=>"Delete",g2e=()=>"删除",v2e=()=>"حذف",b2e=()=>"حذف",y2e=()=>"Eliminar",x2e=()=>"हटाएं",ND=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?g2e():t==="fa"?v2e():t==="ar"?b2e():t==="es"?y2e():t==="hi"?x2e():m2e()}),w2e=()=>"This prompt runs a small 200-step training probe on your machine. Hit enter to get started.",k2e=()=>"这条提示会在你的机器上运行一个小型 200 步训练探测。按 Enter 开始。",S2e=()=>"این پیام یک کاوش آموزشی کوچک ۲۰۰ مرحله‌ای روی دستگاه شما اجرا می‌کند. برای شروع Enter را بزنید.",C2e=()=>"يشغّل هذا الطلب اختبار تدريب صغيرًا من 200 خطوة على جهازك. اضغط Enter للبدء.",E2e=()=>"Este prompt ejecuta en tu equipo una pequeña prueba de entrenamiento de 200 pasos. Pulsa Intro para empezar.",N2e=()=>"यह प्रॉम्प्ट आपकी मशीन पर एक छोटा 200-स्टेप ट्रेनिंग परीक्षण चलाता है। शुरू करने के लिए एंटर दबाएं।",z2e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?k2e():t==="fa"?S2e():t==="ar"?C2e():t==="es"?E2e():t==="hi"?N2e():w2e()}),j2e=()=>"to monitor it.",T2e=()=>"以查看进度。",A2e=()=>"بزنید.",R2e=()=>"لمتابعتها.",M2e=()=>"para seguirlo.",O2e=()=>"इस पर नज़र रखने के लिए।",_N=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?T2e():t==="fa"?A2e():t==="ar"?R2e():t==="es"?M2e():t==="hi"?O2e():j2e()}),D2e=()=>"The experiment is now running. Tap",L2e=()=>"实验正在运行。点按",I2e=()=>"آزمایش اکنون در حال اجراست. برای پیگیری روی",$2e=()=>"التجربة قيد التشغيل الآن. اضغط على",B2e=()=>"El experimento ya se está ejecutando. Pulsa",P2e=()=>"प्रयोग अब चल रहा है। टैप करें",fN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?L2e():t==="fa"?I2e():t==="ar"?$2e():t==="es"?B2e():t==="hi"?P2e():D2e()}),F2e=()=>"Deny",H2e=()=>"拒绝",q2e=()=>"رد کردن",U2e=()=>"رفض",G2e=()=>"Denegar",V2e=()=>"अस्वीकार करें",K2e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?H2e():t==="fa"?q2e():t==="ar"?U2e():t==="es"?G2e():t==="hi"?V2e():F2e()}),W2e=()=>"Dismiss",Q2e=()=>"关闭",X2e=()=>"بستن",Y2e=()=>"إغلاق",Z2e=()=>"Cerrar",J2e=()=>"खारिज करें",Xg=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Q2e():t==="fa"?X2e():t==="ar"?Y2e():t==="es"?Z2e():t==="hi"?J2e():W2e()}),ewe=()=>"Edit and re-send",twe=()=>"编辑并重新发送",nwe=()=>"ویرایش و ارسال دوباره",rwe=()=>"تعديل وإعادة الإرسال",swe=()=>"Editar y reenviar",iwe=()=>"संपादित करें और फिर भेजें",dN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?twe():t==="fa"?nwe():t==="ar"?rwe():t==="es"?swe():t==="hi"?iwe():ewe()}),awe=()=>"Edit message",owe=()=>"编辑消息",cwe=()=>"ویرایش پیام",lwe=()=>"تعديل الرسالة",uwe=()=>"Editar mensaje",_we=()=>"संदेश संपादित करें",fwe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?owe():t==="fa"?cwe():t==="ar"?lwe():t==="es"?uwe():t==="hi"?_we():awe()}),dwe=()=>"Edited a file",hwe=()=>"已编辑文件",pwe=()=>"فایل ویرایش شد",mwe=()=>"عدّل ملفًا",gwe=()=>"Editó un archivo",vwe=()=>"एक फ़ाइल संपादित की",hN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hwe():t==="fa"?pwe():t==="ar"?mwe():t==="es"?gwe():t==="hi"?vwe():dwe()}),bwe=()=>"Exit Bash mode",ywe=()=>"退出 Bash 模式",xwe=()=>"خروج از حالت Bash",wwe=()=>"الخروج من وضع Bash",kwe=()=>"Salir del modo Bash",Swe=()=>"Bash मोड से बाहर निकलें",pN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ywe():t==="fa"?xwe():t==="ar"?wwe():t==="es"?kwe():t==="hi"?Swe():bwe()}),Cwe=()=>"Exit Plan mode",Ewe=()=>"退出计划模式",Nwe=()=>"خروج از حالت طرح",zwe=()=>"الخروج من وضع التخطيط",jwe=()=>"Salir del modo Plan",Twe=()=>"प्लान मोड से बाहर निकलें",mN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ewe():t==="fa"?Nwe():t==="ar"?zwe():t==="es"?jwe():t==="hi"?Twe():Cwe()}),Awe=()=>"Failed:",Rwe=()=>"失败:",Mwe=()=>"ناموفق:",Owe=()=>"فشل:",Dwe=()=>"Error:",Lwe=()=>"विफल:",Vk=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rwe():t==="fa"?Mwe():t==="ar"?Owe():t==="es"?Dwe():t==="hi"?Lwe():Awe()}),Iwe=()=>"Filter sessions",$we=()=>"筛选会话",Bwe=()=>"فیلتر نشست‌ها",Pwe=()=>"تصفية الجلسات",Fwe=()=>"Filtrar sesiones",Hwe=()=>"सेशन फ़िल्टर करें",gN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$we():t==="fa"?Bwe():t==="ar"?Pwe():t==="es"?Fwe():t==="hi"?Hwe():Iwe()}),qwe=()=>"Goal",Uwe=()=>"目标",Gwe=()=>"هدف",Vwe=()=>"الهدف",Kwe=()=>"Objetivo",Wwe=()=>"लक्ष्य",Qwe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Uwe():t==="fa"?Gwe():t==="ar"?Vwe():t==="es"?Kwe():t==="hi"?Wwe():qwe()}),Xwe=()=>"is unavailable.",Ywe=()=>"不可用。",Zwe=()=>"در دسترس نیست.",Jwe=()=>"غير متاح.",e4e=()=>"no está disponible.",t4e=()=>"उपलब्ध नहीं है।",n4e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ywe():t==="fa"?Zwe():t==="ar"?Jwe():t==="es"?e4e():t==="hi"?t4e():Xwe()}),r4e=()=>"Later queued messages will wait until this is retried or removed.",s4e=()=>"后续排队的消息会等待此消息重试或移除。",i4e=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",a4e=()=>"ستنتظر الرسائل التالية في قائمة الانتظار حتى تُعاد المحاولة أو تُزال هذه الرسالة.",o4e=()=>"Los mensajes que están después en la cola esperarán hasta que este se reintente o se quite.",c4e=()=>"बाद में कतार में लगे संदेश तब तक रुके रहेंगे जब तक इसे फिर से कोशिश न किया जाए या हटाया न जाए।",l4e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?s4e():t==="fa"?i4e():t==="ar"?a4e():t==="es"?o4e():t==="hi"?c4e():r4e()}),u4e=()=>"Listed files",_4e=()=>"已列出文件",f4e=()=>"فایل‌ها فهرست شد",d4e=()=>"سرد الملفات",h4e=()=>"Listó archivos",p4e=()=>"फ़ाइलों की सूची बनाई",vN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_4e():t==="fa"?f4e():t==="ar"?d4e():t==="es"?h4e():t==="hi"?p4e():u4e()}),m4e=()=>"Listed project runs",g4e=()=>"已列出项目运行",v4e=()=>"اجراهای پروژه فهرست شد",b4e=()=>"سرد عمليات تشغيل المشروع",y4e=()=>"Listó las ejecuciones del proyecto",x4e=()=>"प्रोजेक्ट रन की सूची बनाई",w4e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?g4e():t==="fa"?v4e():t==="ar"?b4e():t==="es"?y4e():t==="hi"?x4e():m4e()}),k4e=()=>"Listed projects",S4e=()=>"已列出项目",C4e=()=>"پروژه‌ها فهرست شد",E4e=()=>"سرد المشاريع",N4e=()=>"Listó proyectos",z4e=()=>"प्रोजेक्ट की सूची बनाई",j4e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?S4e():t==="fa"?C4e():t==="ar"?E4e():t==="es"?N4e():t==="hi"?z4e():k4e()}),T4e=()=>"Loading conversation…",A4e=()=>"正在加载对话…",R4e=()=>"در حال بارگیری گفتگو…",M4e=()=>"جارٍ تحميل المحادثة…",O4e=()=>"Cargando conversación…",D4e=()=>"बातचीत लोड हो रही है…",L4e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?A4e():t==="fa"?R4e():t==="ar"?M4e():t==="es"?O4e():t==="hi"?D4e():T4e()}),I4e=()=>"New Chat",$4e=()=>"新对话",B4e=()=>"گفتگوی جدید",P4e=()=>"محادثة جديدة",F4e=()=>"Nuevo chat",H4e=()=>"नई चैट",q4e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$4e():t==="fa"?B4e():t==="ar"?P4e():t==="es"?F4e():t==="hi"?H4e():I4e()}),U4e=()=>"Next version",G4e=()=>"下一版本",V4e=()=>"نسخهٔ بعدی",K4e=()=>"النسخة التالية",W4e=()=>"Siguiente versión",Q4e=()=>"अगला वर्शन",bN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?G4e():t==="fa"?V4e():t==="ar"?K4e():t==="es"?W4e():t==="hi"?Q4e():U4e()}),X4e=()=>"Open the session this agent spawned",Y4e=()=>"打开此智能体创建的会话",Z4e=()=>"باز کردن نشست ساخته‌شده توسط این عامل",J4e=()=>"فتح الجلسة التي أنشأها هذا الوكيل",e3e=()=>"Abrir la sesión que creó este agente",t3e=()=>"इस एजेंट द्वारा शुरू किया गया सेशन खोलें",n3e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Y4e():t==="fa"?Z4e():t==="ar"?J4e():t==="es"?e3e():t==="hi"?t3e():X4e()}),r3e=()=>"Opened web pages",s3e=()=>"已打开网页",i3e=()=>"صفحه‌های وب باز شد",a3e=()=>"فتح صفحات ويب",o3e=()=>"Abrió páginas web",c3e=()=>"वेब पेज खोले",l3e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?s3e():t==="fa"?i3e():t==="ar"?a3e():t==="es"?o3e():t==="hi"?c3e():r3e()}),u3e=()=>"Plan",_3e=()=>"计划",f3e=()=>"طرح",d3e=()=>"خطة",h3e=()=>"Plan",p3e=()=>"प्लान",m3e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_3e():t==="fa"?f3e():t==="ar"?d3e():t==="es"?h3e():t==="hi"?p3e():u3e()}),g3e=()=>"Plan approved",v3e=()=>"计划已批准",b3e=()=>"طرح تأیید شد",y3e=()=>"تمت الموافقة على الخطة",x3e=()=>"Plan aprobado",w3e=()=>"प्लान स्वीकृत",k3e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?v3e():t==="fa"?b3e():t==="ar"?y3e():t==="es"?x3e():t==="hi"?w3e():g3e()}),S3e=()=>"Plan rejected",C3e=()=>"计划已拒绝",E3e=()=>"طرح رد شد",N3e=()=>"رُفضت الخطة",z3e=()=>"Plan rechazado",j3e=()=>"प्लान अस्वीकृत",T3e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?C3e():t==="fa"?E3e():t==="ar"?N3e():t==="es"?z3e():t==="hi"?j3e():S3e()}),A3e=()=>"Plan resolved",R3e=()=>"计划已处理",M3e=()=>"طرح تعیین تکلیف شد",O3e=()=>"تمت معالجة الخطة",D3e=()=>"Plan resuelto",L3e=()=>"प्लान सुलझाया गया",I3e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?R3e():t==="fa"?M3e():t==="ar"?O3e():t==="es"?D3e():t==="hi"?L3e():A3e()}),$3e=()=>"Plan revision requested",B3e=()=>"已请求修改计划",P3e=()=>"درخواست بازنگری طرح ثبت شد",F3e=()=>"طُلب تعديل الخطة",H3e=()=>"Cambios en el plan solicitados",q3e=()=>"प्लान में बदलाव का अनुरोध",U3e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?B3e():t==="fa"?P3e():t==="ar"?F3e():t==="es"?H3e():t==="hi"?q3e():$3e()}),G3e=()=>"Previous version",V3e=()=>"上一版本",K3e=()=>"نسخهٔ قبلی",W3e=()=>"النسخة السابقة",Q3e=()=>"Versión anterior",X3e=()=>"पिछला वर्शन",yN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?V3e():t==="fa"?K3e():t==="ar"?W3e():t==="es"?Q3e():t==="hi"?X3e():G3e()}),Y3e=()=>"Ran a command",Z3e=()=>"已运行命令",J3e=()=>"فرمان اجرا شد",e5e=()=>"نفّذ أمرًا",t5e=()=>"Ejecutó un comando",n5e=()=>"एक कमांड चलाई",r5e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Z3e():t==="fa"?J3e():t==="ar"?e5e():t==="es"?t5e():t==="hi"?n5e():Y3e()}),s5e=()=>"Ran tests",i5e=()=>"已运行测试",a5e=()=>"آزمون‌ها اجرا شد",o5e=()=>"شغّل الاختبارات",c5e=()=>"Ejecutó tests",l5e=()=>"टेस्ट चलाए",u5e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?i5e():t==="fa"?a5e():t==="ar"?o5e():t==="es"?c5e():t==="hi"?l5e():s5e()}),_5e=()=>"Read a file",f5e=()=>"已读取文件",d5e=()=>"فایل خوانده شد",h5e=()=>"قرأ ملفًا",p5e=()=>"Leyó un archivo",m5e=()=>"एक फ़ाइल पढ़ी",g5e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?f5e():t==="fa"?d5e():t==="ar"?h5e():t==="es"?p5e():t==="hi"?m5e():_5e()}),v5e=()=>"Read Git history",b5e=()=>"已读取 Git 历史",y5e=()=>"تاریخچهٔ Git خوانده شد",x5e=()=>"قرأ سجل Git",w5e=()=>"Leyó el historial de Git",k5e=()=>"Git इतिहास पढ़ा",S5e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?b5e():t==="fa"?y5e():t==="ar"?x5e():t==="es"?w5e():t==="hi"?k5e():v5e()}),C5e=()=>"Read project details",E5e=()=>"已读取项目详情",N5e=()=>"جزئیات پروژه خوانده شد",z5e=()=>"قرأ تفاصيل المشروع",j5e=()=>"Leyó los detalles del proyecto",T5e=()=>"प्रोजेक्ट विवरण पढ़ा",A5e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?E5e():t==="fa"?N5e():t==="ar"?z5e():t==="es"?j5e():t==="hi"?T5e():C5e()}),R5e=()=>"Reject",M5e=()=>"拒绝",O5e=()=>"رد کردن",D5e=()=>"رفض",L5e=()=>"Rechazar",I5e=()=>"अस्वीकार करें",$5e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?M5e():t==="fa"?O5e():t==="ar"?D5e():t==="es"?L5e():t==="hi"?I5e():R5e()}),B5e=()=>"Remove",P5e=()=>"移除",F5e=()=>"حذف",H5e=()=>"إزالة",q5e=()=>"Quitar",U5e=()=>"हटाएं",G5e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?P5e():t==="fa"?F5e():t==="ar"?H5e():t==="es"?q5e():t==="hi"?U5e():B5e()}),V5e=()=>"Remove annotation",K5e=()=>"移除批注",W5e=()=>"حذف یادداشت",Q5e=()=>"إزالة التعليق",X5e=()=>"Quitar anotación",Y5e=()=>"एनोटेशन हटाएं",Z5e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?K5e():t==="fa"?W5e():t==="ar"?Q5e():t==="es"?X5e():t==="hi"?Y5e():V5e()}),J5e=()=>"Remove file",eke=()=>"移除文件",tke=()=>"حذف فایل",nke=()=>"إزالة الملف",rke=()=>"Quitar archivo",ske=()=>"फ़ाइल हटाएं",xN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?eke():t==="fa"?tke():t==="ar"?nke():t==="es"?rke():t==="hi"?ske():J5e()}),ike=()=>"Remove image",ake=()=>"移除图片",oke=()=>"حذف تصویر",cke=()=>"إزالة الصورة",lke=()=>"Quitar imagen",uke=()=>"इमेज हटाएं",wN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ake():t==="fa"?oke():t==="ar"?cke():t==="es"?lke():t==="hi"?uke():ike()}),_ke=()=>"Remove queued message",fke=()=>"移除排队消息",dke=()=>"حذف پیام صف",hke=()=>"إزالة الرسالة من قائمة الانتظار",pke=()=>"Quitar mensaje en cola",mke=()=>"कतार में लगा संदेश हटाएं",kN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fke():t==="fa"?dke():t==="ar"?hke():t==="es"?pke():t==="hi"?mke():_ke()}),gke=()=>"Rename",vke=()=>"重命名",bke=()=>"تغییر نام",yke=()=>"إعادة تسمية",xke=()=>"Renombrar",wke=()=>"नाम बदलें",zD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vke():t==="fa"?bke():t==="ar"?yke():t==="es"?xke():t==="hi"?wke():gke()}),kke=()=>"Reviewed code changes",Ske=()=>"已审查代码更改",Cke=()=>"تغییرات کد بازبینی شد",Eke=()=>"راجع تغييرات الشيفرة",Nke=()=>"Revisó cambios en el código",zke=()=>"कोड में बदलावों की समीक्षा की",jke=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ske():t==="fa"?Cke():t==="ar"?Eke():t==="es"?Nke():t==="hi"?zke():kke()}),Tke=()=>"Run",Ake=()=>"运行",Rke=()=>"اجرا",Mke=()=>"تشغيل",Oke=()=>"Ejecutar",Dke=()=>"रन",SN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ake():t==="fa"?Rke():t==="ar"?Mke():t==="es"?Oke():t==="hi"?Dke():Tke()}),Lke=()=>"Selected chat text",Ike=()=>"已选聊天文本",$ke=()=>"متن انتخاب‌شدهٔ گفتگو",Bke=()=>"النص المحدد من المحادثة",Pke=()=>"Texto seleccionado del chat",Fke=()=>"चयनित चैट टेक्स्ट",Hke=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ike():t==="fa"?$ke():t==="ar"?Bke():t==="es"?Pke():t==="hi"?Fke():Lke()}),qke=()=>"Selected text:",Uke=()=>"已选文本:",Gke=()=>"متن انتخاب‌شده:",Vke=()=>"النص المحدد:",Kke=()=>"Texto seleccionado:",Wke=()=>"चयनित टेक्स्ट:",Qke=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Uke():t==="fa"?Gke():t==="ar"?Vke():t==="es"?Kke():t==="hi"?Wke():qke()}),Xke=()=>"Send",Yke=()=>"发送",Zke=()=>"ارسال",Jke=()=>"إرسال رسالة",eSe=()=>"Enviar",tSe=()=>"भेजें",l3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Yke():t==="fa"?Zke():t==="ar"?Jke():t==="es"?eSe():t==="hi"?tSe():Xke()}),nSe=()=>"Session options",rSe=()=>"会话选项",sSe=()=>"گزینه‌های نشست",iSe=()=>"خيارات الجلسة",aSe=()=>"Opciones de la sesión",oSe=()=>"सेशन विकल्प",CN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rSe():t==="fa"?sSe():t==="ar"?iSe():t==="es"?aSe():t==="hi"?oSe():nSe()}),cSe=()=>"Session title",lSe=()=>"会话标题",uSe=()=>"عنوان نشست",_Se=()=>"عنوان الجلسة",fSe=()=>"Título de la sesión",dSe=()=>"सेशन शीर्षक",hSe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lSe():t==="fa"?uSe():t==="ar"?_Se():t==="es"?fSe():t==="hi"?dSe():cSe()}),pSe=()=>"Show sidebar",mSe=()=>"显示侧边栏",gSe=()=>"نمایش نوار کناری",vSe=()=>"إظهار الشريط الجانبي",bSe=()=>"Mostrar barra lateral",ySe=()=>"साइडबार दिखाएं",EN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?mSe():t==="fa"?gSe():t==="ar"?vSe():t==="es"?bSe():t==="hi"?ySe():pSe()}),xSe=()=>"Started an experiment run",wSe=()=>"已启动实验运行",kSe=()=>"اجرای آزمایش آغاز شد",SSe=()=>"بدأ تشغيل تجربة",CSe=()=>"Inició una ejecución de experimento",ESe=()=>"एक प्रयोग रन शुरू किया",NSe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?wSe():t==="fa"?kSe():t==="ar"?SSe():t==="es"?CSe():t==="hi"?ESe():xSe()}),zSe=()=>"I have a rough idea I want to explore. Ask me questions until we have a concrete, testable research question and a plan for the first experiment.",jSe=()=>"我有一个想探索的粗略想法。请不断向我提问,直到我们得到一个具体、可检验的研究问题和第一个实验的计划。",TSe=()=>"یک ایدهٔ خام دارم که می‌خواهم بررسی کنم. از من سؤال بپرس تا به یک پرسش پژوهشی مشخص و قابل آزمون و یک برنامه برای اولین آزمایش برسیم.",ASe=()=>"لديّ فكرة أولية أريد استكشافها. اطرح عليّ أسئلة حتى نصل إلى سؤال بحثي محدد وقابل للاختبار وخطة للتجربة الأولى.",RSe=()=>"Tengo una idea inicial que quiero explorar. Hazme preguntas hasta que tengamos una pregunta de investigación concreta y comprobable y un plan para el primer experimento.",MSe=()=>"मेरे पास एक अस्पष्ट विचार है जिसे मैं खोजना चाहता/चाहती हूँ। तब तक मुझसे सवाल पूछें जब तक हमारे पास एक ठोस, जाँचने-योग्य शोध प्रश्न और पहले प्रयोग की योजना न बन जाए।",OSe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jSe():t==="fa"?TSe():t==="ar"?ASe():t==="es"?RSe():t==="hi"?MSe():zSe()}),DSe=()=>"Shape a research question",LSe=()=>"明确研究问题",ISe=()=>"شکل دادن به پرسش پژوهشی",$Se=()=>"صياغة سؤال بحثي",BSe=()=>"Definir una pregunta de investigación",PSe=()=>"एक शोध प्रश्न तैयार करें",FSe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?LSe():t==="fa"?ISe():t==="ar"?$Se():t==="es"?BSe():t==="hi"?PSe():DSe()}),HSe=()=>"Ask me for a topic, then search the literature on it, summarize the strongest baselines and open problems, and suggest where a small experiment could contribute.",qSe=()=>"先问我要研究的主题,然后检索相关文献,总结最强的基线方法和尚未解决的问题,并建议一个小实验可以在哪里做出贡献。",USe=()=>"اول موضوع را از من بپرس، سپس ادبیات آن را جست‌وجو کن، قوی‌ترین خط‌های مبنا و مسائل باز را خلاصه کن و پیشنهاد بده یک آزمایش کوچک کجا می‌تواند مفید باشد.",GSe=()=>"اسألني عن الموضوع أولًا، ثم ابحث في الأدبيات حوله، ولخّص أقوى خطوط الأساس والمسائل المفتوحة، واقترح أين يمكن لتجربة صغيرة أن تسهم.",VSe=()=>"Pregúntame por un tema, busca publicaciones sobre él, resume los métodos de referencia más sólidos y los problemas abiertos, y sugiere dónde podría aportar un pequeño experimento.",KSe=()=>"पहले मुझसे एक विषय पूछें, फिर उस पर साहित्य खोजें, सबसे मज़बूत बेसलाइन और खुली समस्याओं का सार दें, और सुझाएं कि एक छोटा प्रयोग कहाँ योगदान दे सकता है।",WSe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qSe():t==="fa"?USe():t==="ar"?GSe():t==="es"?VSe():t==="hi"?KSe():HSe()}),QSe=()=>"Survey related work",XSe=()=>"调研相关工作",YSe=()=>"مرور کارهای مرتبط",ZSe=()=>"استعراض الأعمال ذات الصلة",JSe=()=>"Revisar trabajos relacionados",e6e=()=>"संबंधित कार्य का सर्वेक्षण करें",t6e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?XSe():t==="fa"?YSe():t==="ar"?ZSe():t==="es"?JSe():t==="hi"?e6e():QSe()}),n6e=()=>"Set up a minimal training script with a config, dependencies, and a run command that trains a small model end to end in a few minutes on one GPU.",r6e=()=>"搭建一个最小的训练脚本,包含配置、依赖和运行命令,能在单张 GPU 上几分钟内端到端训练一个小模型。",s6e=()=>"یک اسکریپت آموزش حداقلی با پیکربندی، وابستگی‌ها و دستور اجرا آماده کن که یک مدل کوچک را در چند دقیقه روی یک GPU به‌طور کامل آموزش دهد.",i6e=()=>"أنشئ أصغر سكربت تدريب ممكن مع إعدادات واعتماديات وأمر تشغيل يدرّب نموذجًا صغيرًا من البداية إلى النهاية في دقائق على وحدة GPU واحدة.",a6e=()=>"Prepara un script de entrenamiento mínimo con configuración, dependencias y un comando de ejecución que entrene un modelo pequeño de principio a fin en unos minutos con una GPU.",o6e=()=>"एक न्यूनतम ट्रेनिंग स्क्रिप्ट सेट अप करें, जिसमें एक कॉन्फ़िग, डिपेंडेंसी और एक रन कमांड हो, जो एक GPU पर कुछ ही मिनटों में एक छोटे मॉडल को पूरी तरह ट्रेन कर दे।",c6e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?r6e():t==="fa"?s6e():t==="ar"?i6e():t==="es"?a6e():t==="hi"?o6e():n6e()}),l6e=()=>"Scaffold a baseline",u6e=()=>"搭建基线",_6e=()=>"ساخت خط مبنا",f6e=()=>"بناء خط أساس",d6e=()=>"Crear un modelo de referencia",h6e=()=>"एक बेसलाइन तैयार करें",p6e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?u6e():t==="fa"?_6e():t==="ar"?f6e():t==="es"?d6e():t==="hi"?h6e():l6e()}),m6e=()=>"Pick one cheap, well-defined hypothesis from our plan, implement it as a variant of the baseline, and launch a first run to compare the two.",g6e=()=>"从我们的计划中选一个成本低、定义明确的假设,把它实现为基线的一个变体,并启动第一次运行来比较两者。",v6e=()=>"یک فرضیهٔ کم‌هزینه و مشخص از برنامه‌مان انتخاب کن، آن را به‌صورت یک نسخهٔ تغییریافته از خط مبنا پیاده کن و اولین اجرا را برای مقایسهٔ این دو شروع کن.",b6e=()=>"اختر فرضية واحدة منخفضة التكلفة ومحددة جيدًا من خطتنا، ونفّذها كنسخة معدّلة من خط الأساس، وابدأ أول تشغيل لمقارنة الاثنين.",y6e=()=>"Elige una hipótesis de nuestro plan que sea económica de probar y esté bien definida, impleméntala como una variante del modelo de referencia e inicia una primera ejecución para comparar ambas versiones.",x6e=()=>"हमारी योजना से एक सस्ती, स्पष्ट रूप से परिभाषित परिकल्पना चुनें, इसे बेसलाइन के एक वेरिएंट के रूप में लागू करें, और दोनों की तुलना के लिए पहला रन शुरू करें।",w6e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?g6e():t==="fa"?v6e():t==="ar"?b6e():t==="es"?y6e():t==="hi"?x6e():m6e()}),k6e=()=>"Run a first experiment",S6e=()=>"运行第一个实验",C6e=()=>"اجرای اولین آزمایش",E6e=()=>"تشغيل التجربة الأولى",N6e=()=>"Ejecutar un primer experimento",z6e=()=>"पहला प्रयोग चलाएं",j6e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?S6e():t==="fa"?C6e():t==="ar"?E6e():t==="es"?N6e():t==="hi"?z6e():k6e()}),T6e=()=>"Reading the project to suggest where to start…",A6e=()=>"正在阅读项目以建议从哪里开始…",R6e=()=>"در حال خواندن پروژه برای پیشنهاد نقطهٔ شروع…",M6e=()=>"جارٍ قراءة المشروع لاقتراح نقطة البدء…",O6e=()=>"Leyendo el proyecto para sugerir por dónde empezar…",D6e=()=>"कहाँ से शुरू करें यह सुझाने के लिए प्रोजेक्ट पढ़ा जा रहा है…",L6e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?A6e():t==="fa"?R6e():t==="ar"?M6e():t==="es"?O6e():t==="hi"?D6e():T6e()}),I6e=()=>"Starter prompts",$6e=()=>"入门提示",B6e=()=>"پیشنهادهای شروع",P6e=()=>"اقتراحات للبدء",F6e=()=>"Prompts para empezar",H6e=()=>"शुरुआती प्रॉम्प्ट",q6e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$6e():t==="fa"?B6e():t==="ar"?P6e():t==="es"?F6e():t==="hi"?H6e():I6e()}),U6e=()=>"Stop",G6e=()=>"停止",V6e=()=>"توقف",K6e=()=>"إيقاف",W6e=()=>"Detener",Q6e=()=>"रोकें",NN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?G6e():t==="fa"?V6e():t==="ar"?K6e():t==="es"?W6e():t==="hi"?Q6e():U6e()}),X6e=()=>"Submit",Y6e=()=>"提交",Z6e=()=>"ارسال",J6e=()=>"إرسال",eCe=()=>"Enviar",tCe=()=>"सबमिट करें",nCe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Y6e():t==="fa"?Z6e():t==="ar"?J6e():t==="es"?eCe():t==="hi"?tCe():X6e()}),rCe=()=>"Tool failed",sCe=()=>"工具失败",iCe=()=>"ابزار ناموفق بود",aCe=()=>"فشلت الأداة",oCe=()=>"Error en la herramienta",cCe=()=>"टूल विफल",lCe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?sCe():t==="fa"?iCe():t==="ar"?aCe():t==="es"?oCe():t==="hi"?cCe():rCe()}),uCe=()=>"Used tools",_Ce=()=>"已使用工具",fCe=()=>"ابزارها استفاده شد",dCe=()=>"استخدم الأدوات",hCe=()=>"Usó herramientas",pCe=()=>"टूल इस्तेमाल किए",jD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_Ce():t==="fa"?fCe():t==="ar"?dCe():t==="es"?hCe():t==="hi"?pCe():uCe()}),mCe=()=>"View full plan",gCe=()=>"查看完整计划",vCe=()=>"مشاهدهٔ طرح کامل",bCe=()=>"عرض الخطة كاملة",yCe=()=>"Ver plan completo",xCe=()=>"पूरा प्लान देखें",wCe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gCe():t==="fa"?vCe():t==="ar"?bCe():t==="es"?yCe():t==="hi"?xCe():mCe()}),kCe=()=>"Waited for an experiment run",SCe=()=>"已等待实验运行",CCe=()=>"برای اجرای آزمایش صبر شد",ECe=()=>"انتظر تشغيل تجربة",NCe=()=>"Esperó a una ejecución de experimento",zCe=()=>"एक प्रयोग रन का इंतज़ार किया",jCe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?SCe():t==="fa"?CCe():t==="ar"?ECe():t==="es"?NCe():t==="hi"?zCe():kCe()}),TCe=()=>"Waiting for your input…",ACe=()=>"正在等待你的输入…",RCe=()=>"منتظر ورودی شما…",MCe=()=>"في انتظار إدخالك…",OCe=()=>"Esperando tu respuesta…",DCe=()=>"आपके इनपुट का इंतज़ार है…",LCe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ACe():t==="fa"?RCe():t==="ar"?MCe():t==="es"?OCe():t==="hi"?DCe():TCe()}),ICe=()=>"What should we research?",$Ce=()=>"我们应该研究什么?",BCe=()=>"چه چیزی را پژوهش کنیم؟",PCe=()=>"ما الذي نبحثه؟",FCe=()=>"¿Qué investigamos?",HCe=()=>"हमें क्या शोध करना चाहिए?",qCe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$Ce():t==="fa"?BCe():t==="ar"?PCe():t==="es"?FCe():t==="hi"?HCe():ICe()}),UCe=()=>"You, mid-task",GCe=()=>"你(任务进行中)",VCe=()=>"شما، هنگام انجام وظیفه",KCe=()=>"أنت، أثناء المهمة",WCe=()=>"Tú, durante la tarea",QCe=()=>"आप, टास्क के बीच में",XCe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?GCe():t==="fa"?VCe():t==="ar"?KCe():t==="es"?WCe():t==="hi"?QCe():UCe()}),YCe=()=>"Pasted image",ZCe=()=>"粘贴的图片",JCe=()=>"تصویر جای‌گذاری‌شده",e7e=()=>"صورة ملصقة",t7e=()=>"Imagen pegada",n7e=()=>"पेस्ट की गई इमेज",TD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ZCe():t==="fa"?JCe():t==="ar"?e7e():t==="es"?t7e():t==="hi"?n7e():YCe()}),r7e=()=>"Plan",s7e=()=>"计划",i7e=()=>"طرح",a7e=()=>"خطة",o7e=()=>"Plan",c7e=()=>"प्लान",AD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?s7e():t==="fa"?i7e():t==="ar"?a7e():t==="es"?o7e():t==="hi"?c7e():r7e()}),l7e=()=>"Plan mode — ready to proceed?",u7e=()=>"计划模式 — 准备好继续了吗?",_7e=()=>"حالت طرح — آماده‌اید ادامه دهید؟",f7e=()=>"وضع التخطيط — جاهز للمتابعة؟",d7e=()=>"Modo Plan — ¿listo para continuar?",h7e=()=>"प्लान मोड — आगे बढ़ने के लिए तैयार?",p7e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?u7e():t==="fa"?_7e():t==="ar"?f7e():t==="es"?d7e():t==="hi"?h7e():l7e()}),m7e=()=>"Proposed plan",g7e=()=>"提议的计划",v7e=()=>"طرح پیشنهادی",b7e=()=>"خطة مقترحة",y7e=()=>"Plan propuesto",x7e=()=>"प्रस्तावित प्लान",zN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?g7e():t==="fa"?v7e():t==="ar"?b7e():t==="es"?y7e():t==="hi"?x7e():m7e()}),w7e=()=>"Question",k7e=()=>"问题",S7e=()=>"پرسش",C7e=()=>"سؤال",E7e=()=>"Pregunta",N7e=()=>"प्रश्न",z7e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?k7e():t==="fa"?S7e():t==="ar"?C7e():t==="es"?E7e():t==="hi"?N7e():w7e()}),j7e=()=>"Queued",T7e=()=>"已排队",A7e=()=>"در صف",R7e=()=>"في قائمة الانتظار",M7e=()=>"En cola",O7e=()=>"कतार में",D7e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?T7e():t==="fa"?A7e():t==="ar"?R7e():t==="es"?M7e():t==="hi"?O7e():j7e()}),L7e=()=>"Recents",I7e=()=>"最近",$7e=()=>"اخیر",B7e=()=>"الأخيرة",P7e=()=>"Recientes",F7e=()=>"हाल की",RD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?I7e():t==="fa"?$7e():t==="ar"?B7e():t==="es"?P7e():t==="hi"?F7e():L7e()}),H7e=()=>"Re-check its setup.",q7e=()=>"请重新检查其设置。",U7e=()=>"راه‌اندازی آن را دوباره بررسی کنید.",G7e=()=>"أعد فحص إعداده.",V7e=()=>"Vuelve a comprobar su configuración.",K7e=()=>"इसका सेटअप फिर से जाँचें।",W7e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?q7e():t==="fa"?U7e():t==="ar"?G7e():t==="es"?V7e():t==="hi"?K7e():H7e()}),Q7e=()=>"Could not recover this turn. Try again.",X7e=()=>"无法恢复本轮。请重试。",Y7e=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",Z7e=()=>"تعذّرت استعادة هذه الجولة. حاول مجددًا.",J7e=()=>"No se pudo recuperar este turno. Inténtalo de nuevo.",e8e=()=>"यह टर्न रिकवर नहीं हो सका। फिर से कोशिश करें।",t8e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?X7e():t==="fa"?Y7e():t==="ar"?Z7e():t==="es"?J7e():t==="hi"?e8e():Q7e()}),n8e=()=>"Could not remove the queued message. Try again.",r8e=()=>"无法移除排队消息。请重试。",s8e=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",i8e=()=>"تعذّرت إزالة الرسالة من قائمة الانتظار. حاول مجددًا.",a8e=()=>"No se pudo quitar el mensaje en cola. Inténtalo de nuevo.",o8e=()=>"कतार में लगा संदेश हटाया नहीं जा सका। फिर से कोशिश करें।",c8e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?r8e():t==="fa"?s8e():t==="ar"?i8e():t==="es"?a8e():t==="hi"?o8e():n8e()}),l8e=e=>`Could not re-send: ${e==null?void 0:e.error}`,u8e=e=>`无法重新发送:${e==null?void 0:e.error}`,_8e=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,f8e=e=>`تعذّرت إعادة الإرسال: ${e==null?void 0:e.error}`,d8e=e=>`No se pudo reenviar: ${e==null?void 0:e.error}`,h8e=e=>`फिर से नहीं भेजा जा सका: ${e==null?void 0:e.error}`,p8e=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?u8e(e):t==="fa"?_8e(e):t==="ar"?f8e(e):t==="es"?d8e(e):t==="hi"?h8e(e):l8e(e)}),m8e=()=>"Resolved",g8e=()=>"已处理",v8e=()=>"رسیدگی شد",b8e=()=>"مُعالَج",y8e=()=>"Resuelto",x8e=()=>"सुलझाया गया",w8e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?g8e():t==="fa"?v8e():t==="ar"?b8e():t==="es"?y8e():t==="hi"?x8e():m8e()}),k8e=()=>"Could not retry the queued message. Try again.",S8e=()=>"无法重试排队消息。请重试。",C8e=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",E8e=()=>"تعذّرت إعادة محاولة إرسال الرسالة في قائمة الانتظار. حاول مجددًا.",N8e=()=>"No se pudo reintentar el mensaje en cola. Inténtalo de nuevo.",z8e=()=>"कतार में लगा संदेश फिर से नहीं भेजा जा सका। फिर से कोशिश करें।",j8e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?S8e():t==="fa"?C8e():t==="ar"?E8e():t==="es"?N8e():t==="hi"?z8e():k8e()}),T8e=()=>"run logs",A8e=()=>"运行日志",R8e=()=>"گزارش‌های اجرا",M8e=()=>"سجلات التشغيل",O8e=()=>"logs de ejecución",D8e=()=>"रन लॉग",L8e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?A8e():t==="fa"?R8e():t==="ar"?M8e():t==="es"?O8e():t==="hi"?D8e():T8e()}),I8e=()=>"Scroll to bottom",$8e=()=>"滚动到底部",B8e=()=>"رفتن به پایین گفتگو",P8e=()=>"التمرير إلى الأسفل",F8e=()=>"Ir al final",H8e=()=>"नीचे तक स्क्रॉल करें",jN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$8e():t==="fa"?B8e():t==="ar"?P8e():t==="es"?F8e():t==="hi"?H8e():I8e()}),q8e=()=>"The selected harness is unavailable",U8e=()=>"所选智能体工具不可用",G8e=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",V8e=()=>"أداة البرمجة المحددة غير متاحة",K8e=()=>"El agente seleccionado no está disponible",W8e=()=>"चुना गया हार्नेस उपलब्ध नहीं है",Yg=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?U8e():t==="fa"?G8e():t==="ar"?V8e():t==="es"?K8e():t==="hi"?W8e():q8e()}),Q8e=()=>"Session limit reached",X8e=()=>"已达到会话使用限额",Y8e=()=>"به سقف مصرف نشست رسیده‌اید",Z8e=()=>"تم بلوغ حد الاستخدام",J8e=()=>"Límite de la sesión alcanzado",e9e=()=>"सेशन सीमा पूरी हो गई",t9e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?X8e():t==="fa"?Y8e():t==="ar"?Z8e():t==="es"?J8e():t==="hi"?e9e():Q8e()}),n9e=()=>"The chat session was not created",r9e=()=>"未能创建聊天会话",s9e=()=>"نشست گفت‌وگو ایجاد نشد",i9e=()=>"لم تُنشأ جلسة المحادثة",a9e=()=>"No se creó la sesión de chat",o9e=()=>"चैट सेशन नहीं बनाया गया",c9e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?r9e():t==="fa"?s9e():t==="ar"?i9e():t==="es"?a9e():t==="hi"?o9e():n9e()}),l9e=()=>"Show full conversation",u9e=()=>"显示完整对话",_9e=()=>"نمایش کامل گفتگو",f9e=()=>"عرض المحادثة كاملة",d9e=()=>"Mostrar la conversación completa",h9e=()=>"पूरी बातचीत दिखाएं",p9e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?u9e():t==="fa"?_9e():t==="ar"?f9e():t==="es"?d9e():t==="hi"?h9e():l9e()}),m9e=()=>" · Spawned by another agent",g9e=()=>" · 由另一个智能体创建",v9e=()=>" · ساخته‌شده به‌دست عامل دیگر",b9e=()=>" · أنشأه وكيل آخر",y9e=()=>" · Creada por otro agente",x9e=()=>" · किसी और एजेंट द्वारा शुरू किया गया",w9e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?g9e():t==="fa"?v9e():t==="ar"?b9e():t==="es"?y9e():t==="hi"?x9e():m9e()}),k9e=()=>"Starting…",S9e=()=>"正在启动…",C9e=()=>"در حال شروع…",E9e=()=>"جارٍ البدء…",N9e=()=>"Iniciando…",z9e=()=>"शुरू हो रहा है…",j9e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?S9e():t==="fa"?C9e():t==="ar"?E9e():t==="es"?N9e():t==="hi"?z9e():k9e()}),T9e=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,A9e=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,R9e=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,M9e=e=>`وجّه ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} للإضافة إلى قائمة الانتظار)`,O9e=e=>`Guía a ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} para poner en cola)`,D9e=e=>`${e==null?void 0:e.harness} को दिशा दें… (कतार में लगाने के लिए ${e==null?void 0:e.shortcut})`,L9e=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?A9e(e):t==="fa"?R9e(e):t==="ar"?M9e(e):t==="es"?O9e(e):t==="hi"?D9e(e):T9e(e)}),I9e=()=>"Could not stop the turn. Try again.",$9e=()=>"无法停止本轮。请重试。",B9e=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",P9e=()=>"تعذّر إيقاف الجولة. حاول مجددًا.",F9e=()=>"No se pudo detener el turno. Inténtalo de nuevo.",H9e=()=>"टर्न रोका नहीं जा सका। फिर से कोशिश करें।",q9e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$9e():t==="fa"?B9e():t==="ar"?P9e():t==="es"?F9e():t==="hi"?H9e():I9e()}),U9e=e=>`Could not switch fork: ${e==null?void 0:e.error}`,G9e=e=>`无法切换分支:${e==null?void 0:e.error}`,V9e=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,K9e=e=>`تعذّر تبديل التفرّع: ${e==null?void 0:e.error}`,W9e=e=>`No se pudo cambiar de bifurcación: ${e==null?void 0:e.error}`,Q9e=e=>`फ़ोर्क नहीं बदला जा सका: ${e==null?void 0:e.error}`,X9e=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?G9e(e):t==="fa"?V9e(e):t==="ar"?K9e(e):t==="es"?W9e(e):t==="hi"?Q9e(e):U9e(e)}),Y9e=()=>"The agent",Z9e=()=>"智能体",J9e=()=>"عامل",eEe=()=>"الوكيل",tEe=()=>"El agente",nEe=()=>"एजेंट",rEe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Z9e():t==="fa"?J9e():t==="ar"?eEe():t==="es"?tEe():t==="hi"?nEe():Y9e()}),sEe=()=>"Thinking",iEe=()=>"正在思考",aEe=()=>"در حال فکر کردن",oEe=()=>"جارٍ التفكير",cEe=()=>"Pensando",lEe=()=>"सोच रहा है",uEe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?iEe():t==="fa"?aEe():t==="ar"?oEe():t==="es"?cEe():t==="hi"?lEe():sEe()}),_Ee=()=>"Could not toggle Plan mode. Try again.",fEe=()=>"无法切换计划模式。请重试。",dEe=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",hEe=()=>"تعذّر تبديل وضع التخطيط. حاول مجددًا.",pEe=()=>"No se pudo cambiar el modo Plan. Inténtalo de nuevo.",mEe=()=>"प्लान मोड टॉगल नहीं हो सका। फिर से कोशिश करें।",TN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fEe():t==="fa"?dEe():t==="ar"?hEe():t==="es"?pEe():t==="hi"?mEe():_Ee()}),gEe=()=>"This turn did not finish.",vEe=()=>"本轮未完成。",bEe=()=>"این نوبت کامل نشد.",yEe=()=>"لم تكتمل هذه الجولة.",xEe=()=>"Este turno no terminó.",wEe=()=>"यह टर्न पूरा नहीं हुआ।",AN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vEe():t==="fa"?bEe():t==="ar"?yEe():t==="es"?xEe():t==="hi"?wEe():gEe()}),kEe=()=>"Type a custom answer…",SEe=()=>"输入自定义回答…",CEe=()=>"پاسخ دلخواه را بنویسید…",EEe=()=>"اكتب إجابة مخصصة…",NEe=()=>"Escribe una respuesta personalizada…",zEe=()=>"अपना जवाब टाइप करें…",jEe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?SEe():t==="fa"?CEe():t==="ar"?EEe():t==="es"?NEe():t==="hi"?zEe():kEe()}),TEe=()=>"Unarchive",AEe=()=>"取消归档",REe=()=>"خارج کردن از بایگانی",MEe=()=>"إلغاء الأرشفة",OEe=()=>"Desarchivar",DEe=()=>"आर्काइव से निकालें",LEe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?AEe():t==="fa"?REe():t==="ar"?MEe():t==="es"?OEe():t==="hi"?DEe():TEe()}),IEe=()=>"Untitled",$Ee=()=>"未命名",BEe=()=>"بدون عنوان",PEe=()=>"بدون عنوان",FEe=()=>"Sin título",HEe=()=>"बिना शीर्षक",xd=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$Ee():t==="fa"?BEe():t==="ar"?PEe():t==="es"?FEe():t==="hi"?HEe():IEe()}),qEe=()=>"Could not update permissions. Try again.",UEe=()=>"无法更新权限。请重试。",GEe=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",VEe=()=>"تعذّر تحديث الأذونات. حاول مجددًا.",KEe=()=>"No se pudieron actualizar los permisos. Inténtalo de nuevo.",WEe=()=>"अनुमतियाँ अपडेट नहीं हो सकीं। फिर से कोशिश करें।",QEe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?UEe():t==="fa"?GEe():t==="ar"?VEe():t==="es"?KEe():t==="hi"?WEe():qEe()}),XEe=()=>"Work details",YEe=()=>"工作详情",ZEe=()=>"جزئیات کار",JEe=()=>"تفاصيل العمل",eNe=()=>"Detalles del trabajo",tNe=()=>"काम का विवरण",nNe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?YEe():t==="fa"?ZEe():t==="ar"?JEe():t==="es"?eNe():t==="hi"?tNe():XEe()}),rNe=e=>`${e==null?void 0:e.minutes}m ${e==null?void 0:e.seconds}s`,sNe=e=>`${e==null?void 0:e.minutes}分${e==null?void 0:e.seconds}秒`,iNe=e=>`${e==null?void 0:e.minutes} دقیقه ${e==null?void 0:e.seconds} ثانیه`,aNe=e=>`${e==null?void 0:e.minutes}د ${e==null?void 0:e.seconds}ث`,oNe=e=>`${e==null?void 0:e.minutes} min ${e==null?void 0:e.seconds} s`,cNe=e=>`${e==null?void 0:e.minutes}मि ${e==null?void 0:e.seconds}से`,lNe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?sNe(e):t==="fa"?iNe(e):t==="ar"?aNe(e):t==="es"?oNe(e):t==="hi"?cNe(e):rNe(e)}),uNe=e=>`Worked for ${e==null?void 0:e.duration}`,_Ne=e=>`已工作 ${e==null?void 0:e.duration}`,fNe=e=>`به‌مدت ${e==null?void 0:e.duration} کار کرد`,dNe=e=>`عمل لمدة ${e==null?void 0:e.duration}`,hNe=e=>`Trabajó durante ${e==null?void 0:e.duration}`,pNe=e=>`${e==null?void 0:e.duration} तक काम किया`,mNe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?_Ne(e):t==="fa"?fNe(e):t==="ar"?dNe(e):t==="es"?hNe(e):t==="hi"?pNe(e):uNe(e)}),gNe=()=>"Working…",vNe=()=>"正在工作…",bNe=()=>"در حال کار…",yNe=()=>"جارٍ العمل…",xNe=()=>"Trabajando…",wNe=()=>"काम हो रहा है…",Kk=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vNe():t==="fa"?bNe():t==="ar"?yNe():t==="es"?xNe():t==="hi"?wNe():gNe()}),kNe=()=>"Close tab",SNe=()=>"关闭标签页",CNe=()=>"بستن زبانه",ENe=()=>"إغلاق التبويب",NNe=()=>"Cerrar pestaña",zNe=()=>"टैब बंद करें",jNe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?SNe():t==="fa"?CNe():t==="ar"?ENe():t==="es"?NNe():t==="hi"?zNe():kNe()}),TNe=()=>"Changes",ANe=()=>"更改",RNe=()=>"تغییرات",MNe=()=>"التغييرات",ONe=()=>"Cambios",DNe=()=>"बदलाव",MD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ANe():t==="fa"?RNe():t==="ar"?MNe():t==="es"?ONe():t==="hi"?DNe():TNe()}),LNe=()=>"Code browser view",INe=()=>"代码浏览器视图",$Ne=()=>"نمای مرورگر کد",BNe=()=>"عرض متصفح الشيفرة",PNe=()=>"Vista del explorador de código",FNe=()=>"कोड ब्राउज़र व्यू",HNe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?INe():t==="fa"?$Ne():t==="ar"?BNe():t==="es"?PNe():t==="hi"?FNe():LNe()}),qNe=()=>"Files",UNe=()=>"文件",GNe=()=>"فایل‌ها",VNe=()=>"الملفات",KNe=()=>"Archivos",WNe=()=>"फ़ाइलें",QNe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?UNe():t==="fa"?GNe():t==="ar"?VNe():t==="es"?KNe():t==="hi"?WNe():qNe()}),XNe=()=>"Refresh",YNe=()=>"刷新",ZNe=()=>"تازه‌سازی",JNe=()=>"تحديث",eze=()=>"Actualizar",tze=()=>"रीफ़्रेश करें",RN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?YNe():t==="fa"?ZNe():t==="ar"?JNe():t==="es"?eze():t==="hi"?tze():XNe()}),nze=()=>"listing truncated",rze=()=>"列表已截断",sze=()=>"فهرست کوتاه شده است",ize=()=>"القائمة مقتطعة",aze=()=>"listado truncado",oze=()=>"सूची छोटी की गई",cze=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rze():t==="fa"?sze():t==="ar"?ize():t==="es"?aze():t==="hi"?oze():nze()}),lze=()=>"No files.",uze=()=>"没有文件。",_ze=()=>"فایلی وجود ندارد.",fze=()=>"لا توجد ملفات.",dze=()=>"No hay archivos.",hze=()=>"कोई फ़ाइल नहीं।",pze=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?uze():t==="fa"?_ze():t==="ar"?fze():t==="es"?dze():t==="hi"?hze():lze()}),mze=()=>"Refresh failed:",gze=()=>"刷新失败:",vze=()=>"تازه‌سازی ناموفق بود:",bze=()=>"فشل التحديث:",yze=()=>"Error al actualizar:",xze=()=>"रीफ़्रेश विफल:",wze=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gze():t==="fa"?vze():t==="ar"?bze():t==="es"?yze():t==="hi"?xze():mze()}),kze=()=>"Cancelling…",Sze=()=>"正在取消…",Cze=()=>"در حال لغو…",Eze=()=>"جارٍ الإلغاء…",Nze=()=>"Cancelando…",zze=()=>"रद्द हो रहा है…",jze=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Sze():t==="fa"?Cze():t==="ar"?Eze():t==="es"?Nze():t==="hi"?zze():kze()}),Tze=()=>"Checking…",Aze=()=>"正在检查…",Rze=()=>"در حال بررسی…",Mze=()=>"جارٍ التحقق…",Oze=()=>"Comprobando…",Dze=()=>"जाँचा जा रहा है…",ha=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Aze():t==="fa"?Rze():t==="ar"?Mze():t==="es"?Oze():t==="hi"?Dze():Tze()}),Lze=()=>"Copied",Ize=()=>"已复制",$ze=()=>"کپی شد",Bze=()=>"تم النسخ",Pze=()=>"Copiado",Fze=()=>"कॉपी हो गया",tf=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ize():t==="fa"?$ze():t==="ar"?Bze():t==="es"?Pze():t==="hi"?Fze():Lze()}),Hze=e=>`Failed to load: ${e==null?void 0:e.error}`,qze=e=>`加载失败:${e==null?void 0:e.error}`,Uze=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,Gze=e=>`تعذّر التحميل: ${e==null?void 0:e.error}`,Vze=e=>`Error al cargar: ${e==null?void 0:e.error}`,Kze=e=>`लोड नहीं हो सका: ${e==null?void 0:e.error}`,Wk=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?qze(e):t==="fa"?Uze(e):t==="ar"?Gze(e):t==="es"?Vze(e):t==="hi"?Kze(e):Hze(e)}),Wze=()=>"Loading…",Qze=()=>"正在加载…",Xze=()=>"در حال بارگیری…",Yze=()=>"جارٍ التحميل…",Zze=()=>"Cargando…",Jze=()=>"लोड हो रहा है…",Qk=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Qze():t==="fa"?Xze():t==="ar"?Yze():t==="es"?Zze():t==="hi"?Jze():Wze()}),eje=e=>`+ ${e==null?void 0:e.count} more`,tje=e=>`另有 ${e==null?void 0:e.count} 项`,nje=e=>`${e==null?void 0:e.count}+ مورد دیگر`,rje=e=>`المزيد (+${e==null?void 0:e.count})`,sje=e=>`+ ${e==null?void 0:e.count} más`,ije=e=>`+ ${e==null?void 0:e.count} और`,aje=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?tje(e):t==="fa"?nje(e):t==="ar"?rje(e):t==="es"?sje(e):t==="hi"?ije(e):eje(e)}),oje=()=>"Rendered view",cje=()=>"渲染视图",lje=()=>"نمای رندرشده",uje=()=>"العرض المُنسَّق",_je=()=>"Vista renderizada",fje=()=>"रेंडर किया गया व्यू",Ev=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cje():t==="fa"?lje():t==="ar"?uje():t==="es"?_je():t==="hi"?fje():oje()}),dje=()=>"Save",hje=()=>"保存",pje=()=>"ذخیره",mje=()=>"حفظ",gje=()=>"Guardar",vje=()=>"सेव करें",ic=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hje():t==="fa"?pje():t==="ar"?mje():t==="es"?gje():t==="hi"?vje():dje()}),bje=()=>"Saving…",yje=()=>"正在保存…",xje=()=>"در حال ذخیره…",wje=()=>"جارٍ الحفظ…",kje=()=>"Guardando…",Sje=()=>"सेव हो रहा है…",va=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yje():t==="fa"?xje():t==="ar"?wje():t==="es"?kje():t==="hi"?Sje():bje()}),Cje=()=>"Show less",Eje=()=>"收起",Nje=()=>"نمایش کمتر",zje=()=>"عرض أقل",jje=()=>"Mostrar menos",Tje=()=>"कम दिखाएं",OD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Eje():t==="fa"?Nje():t==="ar"?zje():t==="es"?jje():t==="hi"?Tje():Cje()}),Aje=()=>"Show more",Rje=()=>"展开",Mje=()=>"نمایش بیشتر",Oje=()=>"عرض المزيد",Dje=()=>"Mostrar más",Lje=()=>"और दिखाएं",Ije=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rje():t==="fa"?Mje():t==="ar"?Oje():t==="es"?Dje():t==="hi"?Lje():Aje()}),$je=()=>"Stop",Bje=()=>"停止",Pje=()=>"توقف",Fje=()=>"إيقاف",Hje=()=>"Detener",qje=()=>"रोकें",DD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bje():t==="fa"?Pje():t==="ar"?Fje():t==="es"?Hje():t==="hi"?qje():$je()}),Uje=()=>"Stopping…",Gje=()=>"正在停止…",Vje=()=>"در حال توقف…",Kje=()=>"جارٍ الإيقاف…",Wje=()=>"Deteniendo…",Qje=()=>"रोका जा रहा है…",Xje=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Gje():t==="fa"?Vje():t==="ar"?Kje():t==="es"?Wje():t==="hi"?Qje():Uje()}),Yje=()=>"View source",Zje=()=>"查看源代码",Jje=()=>"نمایش متن منبع",eTe=()=>"عرض المصدر",tTe=()=>"Ver código fuente",nTe=()=>"स्रोत देखें",zd=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Zje():t==="fa"?Jje():t==="ar"?eTe():t==="es"?tTe():t==="hi"?nTe():Yje()}),rTe=()=>"Shorten this chat's context",sTe=()=>"压缩此聊天的上下文",iTe=()=>"کوتاه‌کردن زمینهٔ این گفت‌وگو",aTe=()=>"اختصار سياق هذه المحادثة",oTe=()=>"Comprime el contexto de este chat",cTe=()=>"इस चैट का कॉन्टेक्स्ट छोटा करें",lTe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?sTe():t==="fa"?iTe():t==="ar"?aTe():t==="es"?oTe():t==="hi"?cTe():rTe()}),uTe=()=>"Runs as a remote Hugging Face Job",_Te=()=>"作为远程 Hugging Face Job 运行",fTe=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",dTe=()=>"يعمل كمهمة Hugging Face بعيدة",hTe=()=>"Se ejecuta como un Job remoto de Hugging Face",pTe=()=>"एक रिमोट Hugging Face Job के रूप में चलता है",mTe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_Te():t==="fa"?fTe():t==="ar"?dTe():t==="es"?hTe():t==="hi"?pTe():uTe()}),gTe=()=>"Runs as a Job on your Kubernetes cluster",vTe=()=>"作为 Kubernetes 集群上的 Job 运行",bTe=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",yTe=()=>"يعمل كمهمة على عنقود Kubernetes الخاص بك",xTe=()=>"Se ejecuta como un Job en tu clúster de Kubernetes",wTe=()=>"आपके Kubernetes क्लस्टर पर एक Job के रूप में चलता है",kTe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vTe():t==="fa"?bTe():t==="ar"?yTe():t==="es"?xTe():t==="hi"?wTe():gTe()}),STe=()=>"Runs directly on this computer",CTe=()=>"直接在此计算机上运行",ETe=()=>"مستقیماً روی این رایانه اجرا می‌شود",NTe=()=>"يعمل مباشرة على هذا الحاسوب",zTe=()=>"Se ejecuta directamente en este equipo",jTe=()=>"सीधे इस कंप्यूटर पर चलता है",TTe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?CTe():t==="fa"?ETe():t==="ar"?NTe():t==="es"?zTe():t==="hi"?jTe():STe()}),ATe=()=>"Runs in a remote Modal sandbox",RTe=()=>"在远程 Modal 沙箱中运行",MTe=()=>"در sandbox دوردست Modal اجرا می‌شود",OTe=()=>"يعمل في بيئة Modal معزولة عن بُعد",DTe=()=>"Se ejecuta en un sandbox remoto de Modal",LTe=()=>"एक रिमोट Modal सैंडबॉक्स में चलता है",ITe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?RTe():t==="fa"?MTe():t==="ar"?OTe():t==="es"?DTe():t==="hi"?LTe():ATe()}),$Te=()=>"Runs on an ephemeral OpenResearch box",BTe=()=>"在临时 OpenResearch 主机上运行",PTe=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",FTe=()=>"يعمل على صندوق OpenResearch مؤقت",HTe=()=>"Se ejecuta en una máquina efímera de OpenResearch",qTe=()=>"एक अस्थायी OpenResearch बॉक्स पर चलता है",UTe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?BTe():t==="fa"?PTe():t==="ar"?FTe():t==="es"?HTe():t==="hi"?qTe():$Te()}),GTe=()=>"Runs on the connected Ray cluster",VTe=()=>"在已连接的 Ray 集群上运行",KTe=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",WTe=()=>"يعمل على عنقود Ray المتصل",QTe=()=>"Se ejecuta en el clúster de Ray conectado",XTe=()=>"कनेक्टेड Ray क्लस्टर पर चलता है",YTe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?VTe():t==="fa"?KTe():t==="ar"?WTe():t==="es"?QTe():t==="hi"?XTe():GTe()}),ZTe=()=>"Runs as a scheduled job on your Slurm cluster",JTe=()=>"作为 Slurm 集群上的调度作业运行",eAe=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",tAe=()=>"يعمل كمهمة مجدولة على عنقود Slurm الخاص بك",nAe=()=>"Se ejecuta como un job programado en tu clúster de Slurm",rAe=()=>"आपके Slurm क्लस्टर पर एक शेड्यूल्ड जॉब के रूप में चलता है",sAe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?JTe():t==="fa"?eAe():t==="ar"?tAe():t==="es"?nAe():t==="hi"?rAe():ZTe()}),iAe=()=>"Runs on a host from your SSH config",aAe=()=>"在 SSH 配置中的主机上运行",oAe=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",cAe=()=>"يعمل على مضيف من إعداد SSH الخاص بك",lAe=()=>"Se ejecuta en un host de tu configuración SSH",uAe=()=>"आपके SSH कॉन्फ़िग के किसी होस्ट पर चलता है",_Ae=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?aAe():t==="fa"?oAe():t==="ar"?cAe():t==="es"?lAe():t==="hi"?uAe():iAe()}),fAe=()=>"Runs through Tinker’s remote compute",dAe=()=>"通过 Tinker 远程算力运行",hAe=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",pAe=()=>"يعمل عبر حوسبة Tinker البعيدة",mAe=()=>"Se ejecuta en el cómputo remoto de Tinker",gAe=()=>"Tinker के रिमोट कंप्यूट के ज़रिए चलता है",vAe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dAe():t==="fa"?hAe():t==="ar"?pAe():t==="es"?mAe():t==="hi"?gAe():fAe()}),bAe=()=>"HF Jobs",yAe=()=>"HF Jobs",xAe=()=>"HF Jobs",wAe=()=>"HF Jobs",kAe=()=>"HF Jobs",SAe=()=>"HF Jobs",CAe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yAe():t==="fa"?xAe():t==="ar"?wAe():t==="es"?kAe():t==="hi"?SAe():bAe()}),EAe=()=>"Kubernetes",NAe=()=>"Kubernetes",zAe=()=>"Kubernetes",jAe=()=>"Kubernetes",TAe=()=>"Kubernetes",AAe=()=>"Kubernetes",RAe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?NAe():t==="fa"?zAe():t==="ar"?jAe():t==="es"?TAe():t==="hi"?AAe():EAe()}),MAe=()=>"This machine",OAe=()=>"此计算机",DAe=()=>"این رایانه",LAe=()=>"هذا الجهاز",IAe=()=>"Este equipo",$Ae=()=>"यह मशीन",LD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?OAe():t==="fa"?DAe():t==="ar"?LAe():t==="es"?IAe():t==="hi"?$Ae():MAe()}),BAe=()=>"Modal",PAe=()=>"Modal",FAe=()=>"Modal",HAe=()=>"Modal",qAe=()=>"Modal",UAe=()=>"Modal",GAe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?PAe():t==="fa"?FAe():t==="ar"?HAe():t==="es"?qAe():t==="hi"?UAe():BAe()}),VAe=()=>"OpenResearch",KAe=()=>"OpenResearch",WAe=()=>"OpenResearch",QAe=()=>"OpenResearch",XAe=()=>"OpenResearch",YAe=()=>"OpenResearch",ZAe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?KAe():t==="fa"?WAe():t==="ar"?QAe():t==="es"?XAe():t==="hi"?YAe():VAe()}),JAe=()=>"Ray",eRe=()=>"Ray",tRe=()=>"Ray",nRe=()=>"Ray",rRe=()=>"Ray",sRe=()=>"Ray",iRe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?eRe():t==="fa"?tRe():t==="ar"?nRe():t==="es"?rRe():t==="hi"?sRe():JAe()}),aRe=()=>"Slurm",oRe=()=>"Slurm",cRe=()=>"Slurm",lRe=()=>"Slurm",uRe=()=>"Slurm",_Re=()=>"Slurm",fRe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?oRe():t==="fa"?cRe():t==="ar"?lRe():t==="es"?uRe():t==="hi"?_Re():aRe()}),dRe=()=>"SSH",hRe=()=>"SSH",pRe=()=>"SSH",mRe=()=>"SSH",gRe=()=>"SSH",vRe=()=>"SSH",bRe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hRe():t==="fa"?pRe():t==="ar"?mRe():t==="es"?gRe():t==="hi"?vRe():dRe()}),yRe=()=>"Tinker",xRe=()=>"Tinker",wRe=()=>"Tinker",kRe=()=>"Tinker",SRe=()=>"Tinker",CRe=()=>"Tinker",ERe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xRe():t==="fa"?wRe():t==="ar"?kRe():t==="es"?SRe():t==="hi"?CRe():yRe()}),NRe=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",zRe=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",jRe=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",TRe=()=>"تعمل مهمة Hugging Face عن بُعد في حسابك باستخدام العتاد المحدد. تتولى Hugging Face احتساب رسوم الاستخدام.",ARe=()=>"Un Hugging Face Job se ejecuta de forma remota en tu cuenta con el hardware seleccionado. Hugging Face factura el uso.",RRe=()=>"एक Hugging Face Job चुने गए हार्डवेयर का इस्तेमाल करते हुए आपके खाते में रिमोट रूप से चलता है। इस्तेमाल का बिल Hugging Face करता है।",MRe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zRe():t==="fa"?jRe():t==="ar"?TRe():t==="es"?ARe():t==="hi"?RRe():NRe()}),ORe=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",DRe=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",LRe=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",IRe=()=>"تعمل بيئة Modal معزولة عن بُعد في حسابك باستخدام العتاد المحدد، وتُخفَّض مواردها إلى الصفر بعد انتهاء التشغيل.",$Re=()=>"Un sandbox de Modal se ejecuta de forma remota en tu cuenta con el hardware seleccionado y escala a cero al terminar la ejecución.",BRe=()=>"एक Modal सैंडबॉक्स चुने गए हार्डवेयर का इस्तेमाल करते हुए आपके खाते में रिमोट रूप से चलता है और रन के बाद शून्य पर स्केल हो जाता है।",PRe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?DRe():t==="fa"?LRe():t==="ar"?IRe():t==="es"?$Re():t==="hi"?BRe():ORe()}),FRe=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",HRe=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",qRe=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",URe=()=>"تعمل التجربة على جهاز OpenResearch مؤقت، وتتحمل مؤسستك تكلفته، ويُحذف الجهاز عند انتهاء التشغيل.",GRe=()=>"Una máquina efímera de OpenResearch ejecuta el experimento, se factura a tu organización y se elimina al terminar la ejecución.",VRe=()=>"एक अस्थायी OpenResearch बॉक्स प्रयोग चलाता है, आपके संगठन को बिल किया जाता है, और रन खत्म होने पर हटा दिया जाता है।",KRe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?HRe():t==="fa"?qRe():t==="ar"?URe():t==="es"?GRe():t==="hi"?VRe():FRe()}),WRe=()=>"This computer must stay awake and online while Tinker runs.",QRe=()=>"Tinker 运行时,此计算机必须保持唤醒和联网。",XRe=()=>"هنگام اجرای Tinker، این رایانه باید روشن و آنلاین بماند.",YRe=()=>"يجب أن يبقى هذا الحاسوب مستيقظًا ومتصلًا أثناء تشغيل Tinker.",ZRe=()=>"Este equipo debe permanecer encendido y conectado mientras Tinker se ejecuta.",JRe=()=>"जब तक Tinker चल रहा है, इस कंप्यूटर को जागते और ऑनलाइन रहना होगा।",eMe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?QRe():t==="fa"?XRe():t==="ar"?YRe():t==="es"?ZRe():t==="hi"?JRe():WRe()}),tMe=()=>"Context window",nMe=()=>"上下文窗口",rMe=()=>"پنجرهٔ زمینه",sMe=()=>"نافذة السياق",iMe=()=>"Ventana de contexto",aMe=()=>"कॉन्टेक्स्ट विंडो",oMe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nMe():t==="fa"?rMe():t==="ar"?sMe():t==="es"?iMe():t==="hi"?aMe():tMe()}),cMe=()=>"Context window used",lMe=()=>"已使用的上下文窗口",uMe=()=>"پنجرهٔ زمینهٔ استفاده‌شده",_Me=()=>"المستخدَم من نافذة السياق",fMe=()=>"Ventana de contexto usada",dMe=()=>"इस्तेमाल हुई कॉन्टेक्स्ट विंडो",hMe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lMe():t==="fa"?uMe():t==="ar"?_Me():t==="es"?fMe():t==="hi"?dMe():cMe()}),pMe=e=>`${e==null?void 0:e.value} tokens`,mMe=e=>`${e==null?void 0:e.value} 个 token`,gMe=e=>`${e==null?void 0:e.value} توکن`,vMe=e=>`${e==null?void 0:e.value} رمز`,bMe=e=>`${e==null?void 0:e.value} tokens`,yMe=e=>`${e==null?void 0:e.value} टोकन`,xMe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?mMe(e):t==="fa"?gMe(e):t==="ar"?vMe(e):t==="es"?bMe(e):t==="hi"?yMe(e):pMe(e)}),wMe=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,kMe=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,SMe=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,CMe=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,EMe=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,NMe=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,zMe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?kMe(e):t==="fa"?SMe(e):t==="ar"?CMe(e):t==="es"?EMe(e):t==="hi"?NMe(e):wMe(e)}),jMe=()=>"Copy the last response",TMe=()=>"复制最新回复",AMe=()=>"کپی آخرین پاسخ",RMe=()=>"نسخ آخر رد",MMe=()=>"Copia la última respuesta",OMe=()=>"आखिरी जवाब कॉपी करें",DMe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?TMe():t==="fa"?AMe():t==="ar"?RMe():t==="es"?MMe():t==="hi"?OMe():jMe()}),LMe=()=>"No runs yet — ask the agent to launch one.",IMe=()=>"尚无运行——让智能体启动一个。",$Me=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",BMe=()=>"لا توجد عمليات تشغيل بعد — اطلب من الوكيل بدء واحدة.",PMe=()=>"Aún no hay ejecuciones — pídele al agente que lance una.",FMe=()=>"अभी तक कोई रन नहीं — एजेंट से एक शुरू करने को कहें।",HMe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?IMe():t==="fa"?$Me():t==="ar"?BMe():t==="es"?PMe():t==="hi"?FMe():LMe()}),qMe=()=>"Run",UMe=()=>"运行",GMe=()=>"اجرا",VMe=()=>"تشغيل",KMe=()=>"Ejecución",WMe=()=>"रन",MN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?UMe():t==="fa"?GMe():t==="ar"?VMe():t==="es"?KMe():t==="hi"?WMe():qMe()}),QMe=()=>"Switch run",XMe=()=>"切换运行",YMe=()=>"تغییر اجرا",ZMe=()=>"تبديل التشغيل",JMe=()=>"Cambiar de ejecución",eOe=()=>"रन बदलें",tOe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?XMe():t==="fa"?YMe():t==="ar"?ZMe():t==="es"?JMe():t==="hi"?eOe():QMe()}),nOe=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,rOe=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,sOe=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,iOe=e=>`${e==null?void 0:e.days}ي ${e==null?void 0:e.hours}س`,aOe=e=>`${e==null?void 0:e.days} d ${e==null?void 0:e.hours} h`,oOe=e=>`${e==null?void 0:e.days}दि ${e==null?void 0:e.hours}घं`,cOe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?rOe(e):t==="fa"?sOe(e):t==="ar"?iOe(e):t==="es"?aOe(e):t==="hi"?oOe(e):nOe(e)}),lOe=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,uOe=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,_Oe=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,fOe=e=>`${e==null?void 0:e.hours}س ${e==null?void 0:e.minutes}د`,dOe=e=>`${e==null?void 0:e.hours} h ${e==null?void 0:e.minutes} min`,hOe=e=>`${e==null?void 0:e.hours}घं ${e==null?void 0:e.minutes}मि`,pOe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?uOe(e):t==="fa"?_Oe(e):t==="ar"?fOe(e):t==="es"?dOe(e):t==="hi"?hOe(e):lOe(e)}),mOe=e=>`${e==null?void 0:e.value}m`,gOe=e=>`${e==null?void 0:e.value} 分钟`,vOe=e=>`${e==null?void 0:e.value} دقیقه`,bOe=e=>`${e==null?void 0:e.value}د`,yOe=e=>`${e==null?void 0:e.value} min`,xOe=e=>`${e==null?void 0:e.value}मि`,wOe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?gOe(e):t==="fa"?vOe(e):t==="ar"?bOe(e):t==="es"?yOe(e):t==="hi"?xOe(e):mOe(e)}),kOe=e=>`${e==null?void 0:e.value}s`,SOe=e=>`${e==null?void 0:e.value} 秒`,COe=e=>`${e==null?void 0:e.value} ثانیه`,EOe=e=>`${e==null?void 0:e.value}ث`,NOe=e=>`${e==null?void 0:e.value} s`,zOe=e=>`${e==null?void 0:e.value}से`,jOe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?SOe(e):t==="fa"?COe(e):t==="ar"?EOe(e):t==="es"?NOe(e):t==="hi"?zOe(e):kOe(e)}),TOe=()=>"Code",AOe=()=>"代码",ROe=()=>"کد",MOe=()=>"الشيفرة",OOe=()=>"Código",DOe=()=>"कोड",LOe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?AOe():t==="fa"?ROe():t==="ar"?MOe():t==="es"?OOe():t==="hi"?DOe():TOe()}),IOe=()=>"created",$Oe=()=>"创建于",BOe=()=>"ایجادشده",POe=()=>"أُنشئ",FOe=()=>"creado",HOe=()=>"बनाया गया",qOe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$Oe():t==="fa"?BOe():t==="ar"?POe():t==="es"?FOe():t==="hi"?HOe():IOe()}),UOe=()=>"from",GOe=()=>"来自",VOe=()=>"از",KOe=()=>"من",WOe=()=>"desde",QOe=()=>"से",XOe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?GOe():t==="fa"?VOe():t==="ar"?KOe():t==="es"?WOe():t==="hi"?QOe():UOe()}),YOe=()=>"Logs",ZOe=()=>"日志",JOe=()=>"گزارش‌ها",eDe=()=>"السجلات",tDe=()=>"Logs",nDe=()=>"लॉग",rDe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ZOe():t==="fa"?JOe():t==="ar"?eDe():t==="es"?tDe():t==="hi"?nDe():YOe()}),sDe=()=>"Latest run",iDe=()=>"最新运行",aDe=()=>"آخرین اجرا",oDe=()=>"أحدث تشغيل",cDe=()=>"Última ejecución",lDe=()=>"नवीनतम रन",uDe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?iDe():t==="fa"?aDe():t==="ar"?oDe():t==="es"?cDe():t==="hi"?lDe():sDe()}),_De=()=>"Code",fDe=()=>"代码",dDe=()=>"کد",hDe=()=>"الشيفرة",pDe=()=>"Código",mDe=()=>"कोड",gDe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fDe():t==="fa"?dDe():t==="ar"?hDe():t==="es"?pDe():t==="hi"?mDe():_De()}),vDe=()=>"Commit",bDe=()=>"提交",yDe=()=>"کامیت",xDe=()=>"إيداع",wDe=()=>"Commit",kDe=()=>"कमिट",SDe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bDe():t==="fa"?yDe():t==="ar"?xDe():t==="es"?wDe():t==="hi"?kDe():vDe()}),CDe=()=>"created",EDe=()=>"创建于",NDe=()=>"ایجادشده",zDe=()=>"أُنشئ",jDe=()=>"creado",TDe=()=>"बनाया गया",ADe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?EDe():t==="fa"?NDe():t==="ar"?zDe():t==="es"?jDe():t==="hi"?TDe():CDe()}),RDe=()=>"Description",MDe=()=>"说明",ODe=()=>"توضیحات",DDe=()=>"الوصف",LDe=()=>"Descripción",IDe=()=>"विवरण",$De=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?MDe():t==="fa"?ODe():t==="ar"?DDe():t==="es"?LDe():t==="hi"?IDe():RDe()}),BDe=()=>"Duration",PDe=()=>"时长",FDe=()=>"مدت",HDe=()=>"المدة",qDe=()=>"Duración",UDe=()=>"अवधि",GDe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?PDe():t==="fa"?FDe():t==="ar"?HDe():t==="es"?qDe():t==="hi"?UDe():BDe()}),VDe=()=>"exit",KDe=()=>"退出码",WDe=()=>"خروج",QDe=()=>"رمز الخروج",XDe=()=>"salida",YDe=()=>"एग्ज़िट",ZDe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?KDe():t==="fa"?WDe():t==="ar"?QDe():t==="es"?XDe():t==="hi"?YDe():VDe()}),JDe=()=>"from",eLe=()=>"来自",tLe=()=>"از",nLe=()=>"من",rLe=()=>"desde",sLe=()=>"से",iLe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?eLe():t==="fa"?tLe():t==="ar"?nLe():t==="es"?rLe():t==="hi"?sLe():JDe()}),aLe=()=>"Logs",oLe=()=>"日志",cLe=()=>"گزارش‌ها",lLe=()=>"السجلات",uLe=()=>"Logs",_Le=()=>"लॉग",fLe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?oLe():t==="fa"?cLe():t==="ar"?lLe():t==="es"?uLe():t==="hi"?_Le():aLe()}),dLe=()=>"Run",hLe=()=>"运行",pLe=()=>"اجرا",mLe=()=>"تشغيل",gLe=()=>"Ejecución",vLe=()=>"रन",bLe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hLe():t==="fa"?pLe():t==="ar"?mLe():t==="es"?gLe():t==="hi"?vLe():dLe()}),yLe=()=>"Run history",xLe=()=>"运行历史",wLe=()=>"تاریخچهٔ اجرا",kLe=()=>"سجل التشغيل",SLe=()=>"Historial de ejecuciones",CLe=()=>"रन इतिहास",ELe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xLe():t==="fa"?wLe():t==="ar"?kLe():t==="es"?SLe():t==="hi"?CLe():yLe()}),NLe=()=>"Started",zLe=()=>"开始时间",jLe=()=>"آغاز",TLe=()=>"بدأ",ALe=()=>"Inicio",RLe=()=>"शुरू हुआ",MLe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zLe():t==="fa"?jLe():t==="ar"?TLe():t==="es"?ALe():t==="hi"?RLe():NLe()}),OLe=()=>"Runs",DLe=()=>"运行",LLe=()=>"اجراها",ILe=()=>"عمليات التشغيل",$Le=()=>"Ejecuciones",BLe=()=>"रन",PLe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?DLe():t==="fa"?LLe():t==="ar"?ILe():t==="es"?$Le():t==="hi"?BLe():OLe()}),FLe=()=>"Experiments and their runs will appear here. Ask the agent to set up an experiment to get started.",HLe=()=>"实验及其运行会显示在这里。让智能体设置一个实验即可开始。",qLe=()=>"آزمایش‌ها و اجراهای آن‌ها اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید آزمایشی راه‌اندازی کند.",ULe=()=>"ستظهر التجارب وعمليات تشغيلها هنا. اطلب من الوكيل إعداد تجربة للبدء.",GLe=()=>"Los experimentos y sus ejecuciones aparecerán aquí. Pídele al agente que configure un experimento para empezar.",VLe=()=>"प्रयोग और उनके रन यहाँ दिखेंगे। शुरू करने के लिए एजेंट से एक प्रयोग सेट अप करने को कहें।",KLe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?HLe():t==="fa"?qLe():t==="ar"?ULe():t==="es"?GLe():t==="hi"?VLe():FLe()}),WLe=()=>"No runs yet",QLe=()=>"还没有运行",XLe=()=>"هنوز اجرایی وجود ندارد",YLe=()=>"لا عمليات تشغيل بعد",ZLe=()=>"Aún no hay ejecuciones",JLe=()=>"अभी तक कोई रन नहीं",eIe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?QLe():t==="fa"?XLe():t==="ar"?YLe():t==="es"?ZLe():t==="hi"?JLe():WLe()}),tIe=()=>"No experiments yet.",nIe=()=>"还没有实验。",rIe=()=>"هنوز آزمایشی وجود ندارد.",sIe=()=>"لا توجد تجارب بعد.",iIe=()=>"Aún no hay experimentos.",aIe=()=>"अभी तक कोई प्रयोग नहीं।",oIe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nIe():t==="fa"?rIe():t==="ar"?sIe():t==="es"?iIe():t==="hi"?aIe():tIe()}),cIe=()=>"Not run yet",lIe=()=>"尚未运行",uIe=()=>"هنوز اجرا نشده",_Ie=()=>"لم تُشغَّل بعد",fIe=()=>"Aún sin ejecutar",dIe=()=>"अभी तक नहीं चलाया गया",hIe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lIe():t==="fa"?uIe():t==="ar"?_Ie():t==="es"?fIe():t==="hi"?dIe():cIe()}),pIe=()=>"1 run",mIe=()=>"1 次运行",gIe=()=>"۱ اجرا",vIe=()=>"تشغيل واحد",bIe=()=>"1 ejecución",yIe=()=>"1 रन",xIe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?mIe():t==="fa"?gIe():t==="ar"?vIe():t==="es"?bIe():t==="hi"?yIe():pIe()}),wIe=()=>"Open logs",kIe=()=>"打开日志",SIe=()=>"باز کردن گزارش‌ها",CIe=()=>"فتح السجلات",EIe=()=>"Abrir logs",NIe=()=>"लॉग खोलें",zIe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?kIe():t==="fa"?SIe():t==="ar"?CIe():t==="es"?EIe():t==="hi"?NIe():wIe()}),jIe=e=>`${e==null?void 0:e.count} runs`,TIe=e=>`${e==null?void 0:e.count} 次运行`,AIe=e=>`${e==null?void 0:e.count} اجرا`,RIe=e=>`عمليات التشغيل: ${e==null?void 0:e.count}`,MIe=e=>`${e==null?void 0:e.count} ejecuciones`,OIe=e=>`${e==null?void 0:e.count} रन`,DIe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?TIe(e):t==="fa"?AIe(e):t==="ar"?RIe(e):t==="es"?MIe(e):t==="hi"?OIe(e):jIe(e)}),LIe=()=>"Stop requested",IIe=()=>"已请求停止",$Ie=()=>"درخواست توقف ثبت شد",BIe=()=>"طُلب الإيقاف",PIe=()=>"Detención solicitada",FIe=()=>"रोकने का अनुरोध किया गया",HIe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?IIe():t==="fa"?$Ie():t==="ar"?BIe():t==="es"?PIe():t==="hi"?FIe():LIe()}),qIe=()=>"Stop run",UIe=()=>"停止运行",GIe=()=>"توقف اجرا",VIe=()=>"إيقاف التشغيل",KIe=()=>"Detener ejecución",WIe=()=>"रन रोकें",QIe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?UIe():t==="fa"?GIe():t==="ar"?VIe():t==="es"?KIe():t==="hi"?WIe():qIe()}),XIe=()=>"Code",YIe=()=>"代码",ZIe=()=>"کد",JIe=()=>"الشيفرة",e$e=()=>"Código",t$e=()=>"कोड",n$e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?YIe():t==="fa"?ZIe():t==="ar"?JIe():t==="es"?e$e():t==="hi"?t$e():XIe()}),r$e=()=>"Experiments",s$e=()=>"实验",i$e=()=>"آزمایش‌ها",a$e=()=>"التجارب",o$e=()=>"Experimentos",c$e=()=>"प्रयोग",l$e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?s$e():t==="fa"?i$e():t==="ar"?a$e():t==="es"?o$e():t==="hi"?c$e():r$e()}),u$e=()=>"Logs",_$e=()=>"日志",f$e=()=>"گزارش‌ها",d$e=()=>"السجلات",h$e=()=>"Logs",p$e=()=>"लॉग",u3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_$e():t==="fa"?f$e():t==="ar"?d$e():t==="es"?h$e():t==="hi"?p$e():u$e()}),m$e=()=>"Stop failed:",g$e=()=>"停止失败:",v$e=()=>"توقف ناموفق بود:",b$e=()=>"فشل الإيقاف:",y$e=()=>"Error al detener:",x$e=()=>"रोकना विफल:",w$e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?g$e():t==="fa"?v$e():t==="ar"?b$e():t==="es"?y$e():t==="hi"?x$e():m$e()}),k$e=()=>"Download this chat as Markdown",S$e=()=>"将此聊天下载为 Markdown",C$e=()=>"دانلود این گفت‌وگو به‌صورت Markdown",E$e=()=>"تنزيل هذه المحادثة بتنسيق Markdown",N$e=()=>"Descarga este chat en Markdown",z$e=()=>"इस चैट को Markdown के रूप में डाउनलोड करें",j$e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?S$e():t==="fa"?C$e():t==="ar"?E$e():t==="es"?N$e():t==="hi"?z$e():k$e()}),T$e=()=>"Clipboard access is unavailable.",A$e=()=>"无法访问剪贴板。",R$e=()=>"دسترسی به کلیپ‌بورد در دسترس نیست.",M$e=()=>"الوصول إلى الحافظة غير متاح.",O$e=()=>"El acceso al portapapeles no está disponible.",D$e=()=>"क्लिपबोर्ड एक्सेस उपलब्ध नहीं है।",ID=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?A$e():t==="fa"?R$e():t==="ar"?M$e():t==="es"?O$e():t==="hi"?D$e():T$e()}),L$e=e=>`Delete “${e==null?void 0:e.path}”? This cannot be undone.`,I$e=e=>`删除“${e==null?void 0:e.path}”?此操作无法撤销。`,$$e=e=>`«${e==null?void 0:e.path}» حذف شود؟ این کار قابل بازگشت نیست.`,B$e=e=>`حذف «${e==null?void 0:e.path}»؟ لا يمكن التراجع عن هذا الإجراء.`,P$e=e=>`¿Eliminar “${e==null?void 0:e.path}”? Esta acción no se puede deshacer.`,F$e=e=>`“${e==null?void 0:e.path}” हटाएं? इसे वापस नहीं लाया जा सकता।`,H$e=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?I$e(e):t==="fa"?$$e(e):t==="ar"?B$e(e):t==="es"?P$e(e):t==="hi"?F$e(e):L$e(e)}),q$e=()=>"Duplicate",U$e=()=>"创建副本",G$e=()=>"ایجاد نسخهٔ تکراری",V$e=()=>"تكرار",K$e=()=>"Duplicar",W$e=()=>"डुप्लिकेट करें",Q$e=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?U$e():t==="fa"?G$e():t==="ar"?V$e():t==="es"?K$e():t==="hi"?W$e():q$e()}),X$e=e=>`File actions for ${e==null?void 0:e.path}`,Y$e=e=>`${e==null?void 0:e.path} 的文件操作`,Z$e=e=>`عملیات فایل برای ${e==null?void 0:e.path}`,J$e=e=>`إجراءات الملف لـ ${e==null?void 0:e.path}`,eBe=e=>`Acciones de archivo para ${e==null?void 0:e.path}`,tBe=e=>`${e==null?void 0:e.path} के लिए फ़ाइल क्रियाएं`,nBe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Y$e(e):t==="fa"?Z$e(e):t==="ar"?J$e(e):t==="es"?eBe(e):t==="hi"?tBe(e):X$e(e)}),rBe=()=>"Open",sBe=()=>"打开",iBe=()=>"باز کردن",aBe=()=>"فتح",oBe=()=>"Abrir",cBe=()=>"खोलें",lBe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?sBe():t==="fa"?iBe():t==="ar"?aBe():t==="es"?oBe():t==="hi"?cBe():rBe()}),uBe=e=>`Rename ${e==null?void 0:e.path}`,_Be=e=>`重命名 ${e==null?void 0:e.path}`,fBe=e=>`تغییر نام ${e==null?void 0:e.path}`,dBe=e=>`إعادة تسمية ${e==null?void 0:e.path}`,hBe=e=>`Renombrar ${e==null?void 0:e.path}`,pBe=e=>`${e==null?void 0:e.path} का नाम बदलें`,mBe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?_Be(e):t==="fa"?fBe(e):t==="ar"?dBe(e):t==="es"?hBe(e):t==="hi"?pBe(e):uBe(e)}),gBe=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,vBe=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,bBe=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,yBe=e=>`ليس في ${e==null?void 0:e.root} — عرض النسخة من مُخرَجات المشروع.`,xBe=e=>`No está en ${e==null?void 0:e.root} — se muestra la copia de los artefactos del proyecto.`,wBe=e=>`${e==null?void 0:e.root} में नहीं — प्रोजेक्ट के आर्टिफ़ैक्ट से कॉपी दिखाई जा रही है।`,kBe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?vBe(e):t==="fa"?bBe(e):t==="ar"?yBe(e):t==="es"?xBe(e):t==="hi"?wBe(e):gBe(e)}),SBe=()=>"Binary file — no inline preview.",CBe=()=>"二进制文件——无法内嵌预览。",EBe=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",NBe=()=>"ملف ثنائي — لا توجد معاينة مضمّنة.",zBe=()=>"Archivo binario — sin vista previa.",jBe=()=>"बाइनरी फ़ाइल — इनलाइन प्रीव्यू नहीं है।",TBe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?CBe():t==="fa"?EBe():t==="ar"?NBe():t==="es"?zBe():t==="hi"?jBe():SBe()}),ABe=()=>"This file changed on disk. Your edits have not been overwritten.",RBe=()=>"此文件已在磁盘上更改。您的编辑未被覆盖。",MBe=()=>"این فایل روی دیسک تغییر کرده است. ویرایش‌های شما جایگزین نشده‌اند.",OBe=()=>"تغيّر هذا الملف على القرص. لم تُستبدل تعديلاتك.",DBe=()=>"Este archivo cambió en disco. Tus cambios no se han sobrescrito.",LBe=()=>"यह फ़ाइल डिस्क पर बदल गई है। आपके बदलाव अधिलेखित नहीं हुए हैं।",ON=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?RBe():t==="fa"?MBe():t==="ar"?OBe():t==="es"?DBe():t==="hi"?LBe():ABe()}),IBe=()=>"Compile failed",$Be=()=>"编译失败",BBe=()=>"کامپایل ناموفق بود",PBe=()=>"فشل التجميع",FBe=()=>"Error al compilar",HBe=()=>"कंपाइल विफल",qBe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$Be():t==="fa"?BBe():t==="ar"?PBe():t==="es"?FBe():t==="hi"?HBe():IBe()}),UBe=()=>"Compile PDF",GBe=()=>"编译 PDF",VBe=()=>"کامپایل PDF",KBe=()=>"تجميع PDF",WBe=()=>"Compilar PDF",QBe=()=>"PDF कंपाइल करें",DN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?GBe():t==="fa"?VBe():t==="ar"?KBe():t==="es"?WBe():t==="hi"?QBe():UBe()}),XBe=()=>"Compiled, but the engine reported errors — check the output below.",YBe=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",ZBe=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",JBe=()=>"اكتمل التجميع، لكن المحرك أبلغ عن أخطاء — راجع المُخرَجات أدناه.",ePe=()=>"Compilado, pero el motor informó de errores — revisa la salida de abajo.",tPe=()=>"कंपाइल हुआ, पर इंजन ने त्रुटियाँ बताईं — नीचे आउटपुट जाँचें।",nPe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?YBe():t==="fa"?ZBe():t==="ar"?JBe():t==="es"?ePe():t==="hi"?tPe():XBe()}),rPe=()=>"Copy command",sPe=()=>"复制命令",iPe=()=>"کپی فرمان",aPe=()=>"نسخ الأمر",oPe=()=>"Copiar comando",cPe=()=>"कमांड कॉपी करें",lPe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?sPe():t==="fa"?iPe():t==="ar"?aPe():t==="es"?oPe():t==="hi"?cPe():rPe()}),uPe=()=>"Copy file contents",_Pe=()=>"复制文件内容",fPe=()=>"کپی محتوای فایل",dPe=()=>"نسخ محتوى الملف",hPe=()=>"Copiar contenido del archivo",pPe=()=>"फ़ाइल की सामग्री कॉपी करें",LN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_Pe():t==="fa"?fPe():t==="ar"?dPe():t==="es"?hPe():t==="hi"?pPe():uPe()}),mPe=()=>"Could not copy file contents",gPe=()=>"无法复制文件内容",vPe=()=>"کپی محتوای فایل ممکن نشد",bPe=()=>"تعذّر نسخ محتوى الملف",yPe=()=>"No se pudo copiar el contenido del archivo",xPe=()=>"फ़ाइल की सामग्री कॉपी नहीं हो सकी",wPe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gPe():t==="fa"?vPe():t==="ar"?bPe():t==="es"?yPe():t==="hi"?xPe():mPe()}),kPe=()=>"Copy install command",SPe=()=>"复制安装命令",CPe=()=>"کپی فرمان نصب",EPe=()=>"نسخ أمر التثبيت",NPe=()=>"Copiar comando de instalación",zPe=()=>"इंस्टॉल कमांड कॉपी करें",jPe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?SPe():t==="fa"?CPe():t==="ar"?EPe():t==="es"?NPe():t==="hi"?zPe():kPe()}),TPe=()=>"This file was deleted on disk. Your edits have not been discarded.",APe=()=>"此文件已从磁盘删除。您的编辑未被丢弃。",RPe=()=>"این فایل از روی دیسک حذف شده است. ویرایش‌های شما حذف نشده‌اند.",MPe=()=>"حُذف هذا الملف من القرص. لم تُتجاهل تعديلاتك.",OPe=()=>"Este archivo se eliminó del disco. Tus cambios no se han descartado.",DPe=()=>"यह फ़ाइल डिस्क से हटा दी गई थी। आपके बदलाव मिटाए नहीं गए हैं।",IN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?APe():t==="fa"?RPe():t==="ar"?MPe():t==="es"?OPe():t==="hi"?DPe():TPe()}),LPe=()=>"Discard my edits and reload",IPe=()=>"放弃我的编辑并重新加载",$Pe=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",BPe=()=>"تجاهل تعديلاتي وإعادة التحميل",PPe=()=>"Descartar mis cambios y recargar",FPe=()=>"मेरे बदलाव छोड़ें और फिर से लोड करें",HPe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?IPe():t==="fa"?$Pe():t==="ar"?BPe():t==="es"?PPe():t==="hi"?FPe():LPe()}),qPe=()=>"Discard unsaved changes and close this file?",UPe=()=>"要丢弃未保存的更改并关闭此文件吗?",GPe=()=>"تغییرات ذخیره‌نشده حذف و فایل بسته شود؟",VPe=()=>"تجاهل التغييرات غير المحفوظة وإغلاق هذا الملف؟",KPe=()=>"¿Descartar los cambios sin guardar y cerrar este archivo?",WPe=()=>"सेव न किए गए बदलाव छोड़ें और यह फ़ाइल बंद करें?",$N=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?UPe():t==="fa"?GPe():t==="ar"?VPe():t==="es"?KPe():t==="hi"?WPe():qPe()}),QPe=()=>"Dismiss",XPe=()=>"关闭",YPe=()=>"بستن",ZPe=()=>"تجاهل",JPe=()=>"Cerrar",eFe=()=>"खारिज करें",tFe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?XPe():t==="fa"?YPe():t==="ar"?ZPe():t==="es"?JPe():t==="hi"?eFe():QPe()}),nFe=()=>"Dismiss compile message",rFe=()=>"关闭编译消息",sFe=()=>"بستن پیام کامپایل",iFe=()=>"تجاهل رسالة التجميع",aFe=()=>"Cerrar mensaje de compilación",oFe=()=>"कंपाइल संदेश खारिज करें",cFe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rFe():t==="fa"?sFe():t==="ar"?iFe():t==="es"?aFe():t==="hi"?oFe():nFe()}),lFe=()=>"Dismiss Overleaf message",uFe=()=>"关闭 Overleaf 消息",_Fe=()=>"بستن پیام Overleaf",fFe=()=>"تجاهل رسالة Overleaf",dFe=()=>"Cerrar mensaje de Overleaf",hFe=()=>"Overleaf संदेश खारिज करें",pFe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?uFe():t==="fa"?_Fe():t==="ar"?fFe():t==="es"?dFe():t==="hi"?hFe():lFe()}),mFe=()=>"Download",gFe=()=>"下载",vFe=()=>"بارگیری",bFe=()=>"تنزيل",yFe=()=>"Descargar",xFe=()=>"डाउनलोड करें",$D=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gFe():t==="fa"?vFe():t==="ar"?bFe():t==="es"?yFe():t==="hi"?xFe():mFe()}),wFe=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,kFe=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,SFe=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,CFe=e=>`تنزيل ${e==null?void 0:e.name} (غير محدَّث — أعِد التجميع أولًا)`,EFe=e=>`Descargar ${e==null?void 0:e.name} (desactualizado — vuelve a compilar antes)`,NFe=e=>`${e==null?void 0:e.name} डाउनलोड करें (पुरानी — पहले फिर से कंपाइल करें)`,zFe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?kFe(e):t==="fa"?SFe(e):t==="ar"?CFe(e):t==="es"?EFe(e):t==="hi"?NFe(e):wFe(e)}),jFe=()=>"Failed to load file:",TFe=()=>"加载文件失败:",AFe=()=>"بارگیری فایل ناموفق بود:",RFe=()=>"تعذّر تحميل الملف:",MFe=()=>"Error al cargar el archivo:",OFe=()=>"फ़ाइल लोड नहीं हो सकी:",BN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?TFe():t==="fa"?AFe():t==="ar"?RFe():t==="es"?MFe():t==="hi"?OFe():jFe()}),DFe=()=>"File truncated — showing the first 512 KB.",LFe=()=>"文件已截断——仅显示前 512 KB。",IFe=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",$Fe=()=>"تم اقتطاع الملف — عرض أول 512 كيلوبايت.",BFe=()=>"Archivo truncado — se muestran los primeros 512 KB.",PFe=()=>"फ़ाइल छोटी की गई — पहले 512 KB दिखाए जा रहे हैं।",FFe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?LFe():t==="fa"?IFe():t==="ar"?$Fe():t==="es"?BFe():t==="hi"?PFe():DFe()}),HFe=()=>"The page below stops partway — the full file could not be loaded.",qFe=()=>"下方页面在中途结束——无法加载完整文件。",UFe=()=>"صفحهٔ زیر در میانه متوقف می‌شود — فایل کامل بارگیری نشد.",GFe=()=>"عرض الصفحة أدناه غير مكتمل — تعذّر تحميل الملف كاملًا.",VFe=()=>"La página se corta a mitad — no se pudo cargar el archivo completo.",KFe=()=>"नीचे का पेज बीच में रुक जाता है — पूरी फ़ाइल लोड नहीं हो सकी।",WFe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qFe():t==="fa"?UFe():t==="ar"?GFe():t==="es"?VFe():t==="hi"?KFe():HFe()}),QFe=e=>`Rendered HTML: ${e==null?void 0:e.name}`,XFe=e=>`已渲染的 HTML:${e==null?void 0:e.name}`,YFe=e=>`HTML رندرشده: ${e==null?void 0:e.name}`,ZFe=e=>`HTML المعروض: ${e==null?void 0:e.name}`,JFe=e=>`HTML renderizado: ${e==null?void 0:e.name}`,eHe=e=>`रेंडर किया गया HTML: ${e==null?void 0:e.name}`,tHe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?XFe(e):t==="fa"?YFe(e):t==="ar"?ZFe(e):t==="es"?JFe(e):t==="hi"?eHe(e):QFe(e)}),nHe=()=>"Loading…",rHe=()=>"正在加载…",sHe=()=>"در حال بارگیری…",iHe=()=>"جارٍ التحميل…",aHe=()=>"Cargando…",oHe=()=>"लोड हो रहा है…",BD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rHe():t==="fa"?sHe():t==="ar"?iHe():t==="es"?aHe():t==="hi"?oHe():nHe()}),cHe=()=>"File not found.",lHe=()=>"找不到文件。",uHe=()=>"فایل پیدا نشد.",_He=()=>"لم يُعثر على الملف.",fHe=()=>"No se encontró el archivo.",dHe=()=>"फ़ाइल नहीं मिली।",PN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lHe():t==="fa"?uHe():t==="ar"?_He():t==="es"?fHe():t==="hi"?dHe():cHe()}),hHe=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,pHe=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,mHe=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,gHe=e=>`لم يُعثر على الملف في مُخرَجات المشروع أو في ${e==null?void 0:e.root}.`,vHe=e=>`No se encontró el archivo en los artefactos del proyecto ni en ${e==null?void 0:e.root}.`,bHe=e=>`फ़ाइल प्रोजेक्ट के आर्टिफ़ैक्ट या ${e==null?void 0:e.root} में नहीं मिली।`,yHe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?pHe(e):t==="fa"?mHe(e):t==="ar"?gHe(e):t==="es"?vHe(e):t==="hi"?bHe(e):hHe(e)}),xHe=e=>`File not found on branch ${e==null?void 0:e.branch}.`,wHe=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,kHe=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,SHe=e=>`لم يُعثر على الملف في الفرع ${e==null?void 0:e.branch}.`,CHe=e=>`No se encontró el archivo en la rama ${e==null?void 0:e.branch}.`,EHe=e=>`फ़ाइल ${e==null?void 0:e.branch} ब्रांच पर नहीं मिली।`,NHe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?wHe(e):t==="fa"?kHe(e):t==="ar"?SHe(e):t==="es"?CHe(e):t==="hi"?EHe(e):xHe(e)}),zHe=()=>"File not found on disk.",jHe=()=>"磁盘上找不到此文件。",THe=()=>"فایل روی دیسک پیدا نشد.",AHe=()=>"لم يُعثر على الملف على القرص.",RHe=()=>"No se encontró el archivo en disco.",MHe=()=>"फ़ाइल डिस्क पर नहीं मिली।",OHe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jHe():t==="fa"?THe():t==="ar"?AHe():t==="es"?RHe():t==="hi"?MHe():zHe()}),DHe=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,LHe=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,IHe=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,$He=e=>`لم يُعثر على الملف في ${e==null?void 0:e.root} ولا في مُخرَجات المشروع.`,BHe=e=>`No se encontró el archivo en ${e==null?void 0:e.root} ni en los artefactos del proyecto.`,PHe=e=>`फ़ाइल ${e==null?void 0:e.root} या प्रोजेक्ट के आर्टिफ़ैक्ट में नहीं मिली।`,FHe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?LHe(e):t==="fa"?IHe(e):t==="ar"?$He(e):t==="es"?BHe(e):t==="hi"?PHe(e):DHe(e)}),HHe=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,qHe=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,UHe=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,GHe=e=>`ليس في مُخرَجات المشروع — عرض النسخة من ${e==null?void 0:e.root}.`,VHe=e=>`No está en los artefactos del proyecto — se muestra la copia que hay en ${e==null?void 0:e.root}.`,KHe=e=>`प्रोजेक्ट के आर्टिफ़ैक्ट में नहीं — ${e==null?void 0:e.root} से कॉपी दिखाई जा रही है।`,WHe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?qHe(e):t==="fa"?UHe(e):t==="ar"?GHe(e):t==="es"?VHe(e):t==="hi"?KHe(e):HHe(e)}),QHe=()=>"Open in default editor",XHe=()=>"在默认编辑器中打开",YHe=()=>"باز کردن در ویرایشگر پیش‌فرض",ZHe=()=>"فتح في المحرر الافتراضي",JHe=()=>"Abrir en el editor predeterminado",eqe=()=>"डिफ़ॉल्ट एडिटर में खोलें",FN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?XHe():t==="fa"?YHe():t==="ar"?ZHe():t==="es"?JHe():t==="hi"?eqe():QHe()}),tqe=e=>`Committed copy from ${e==null?void 0:e.branch}, not on disk`,nqe=e=>`${e==null?void 0:e.branch} 上已提交的副本,不在磁盘上`,rqe=e=>`نسخهٔ کامیت‌شده از ${e==null?void 0:e.branch}، نه روی دیسک`,sqe=e=>`نسخة مودعة من ${e==null?void 0:e.branch}، ليست على القرص`,iqe=e=>`Copia confirmada de ${e==null?void 0:e.branch}, no en disco`,aqe=e=>`${e==null?void 0:e.branch} की कमिट की गई कॉपी, डिस्क पर नहीं`,oqe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?nqe(e):t==="fa"?rqe(e):t==="ar"?sqe(e):t==="es"?iqe(e):t==="hi"?aqe(e):tqe(e)}),cqe=()=>"Only for projects on this computer",lqe=()=>"仅适用于此电脑上的项目",uqe=()=>"فقط برای پروژه‌های این رایانه",_qe=()=>"فقط للمشاريع على هذا الكمبيوتر",fqe=()=>"Solo para proyectos en este equipo",dqe=()=>"केवल इस कंप्यूटर के प्रोजेक्ट के लिए",hqe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lqe():t==="fa"?uqe():t==="ar"?_qe():t==="es"?fqe():t==="hi"?dqe():cqe()}),pqe=()=>"Only for files in the project folder",mqe=()=>"仅适用于项目文件夹中的文件",gqe=()=>"فقط برای فایل‌های پوشهٔ پروژه",vqe=()=>"فقط لملفات مجلد المشروع",bqe=()=>"Solo para archivos de la carpeta del proyecto",yqe=()=>"केवल प्रोजेक्ट फ़ोल्डर की फ़ाइलों के लिए",xqe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?mqe():t==="fa"?gqe():t==="ar"?vqe():t==="es"?bqe():t==="hi"?yqe():pqe()}),wqe=()=>"Overleaf's copy of this file was pulled while you had unsaved edits, so what you see is no longer what is on disk. Saving now sends this draft to Overleaf instead.",kqe=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",Sqe=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",Cqe=()=>"تم سحب نسخة Overleaf من هذا الملف بينما كانت لديك تعديلات غير محفوظة، لذا ما تراه لم يعد مطابقًا لما هو على القرص. الحفظ الآن يرسل هذه المسودة إلى Overleaf بدلًا من ذلك.",Eqe=()=>"Se descargó la copia de Overleaf de este archivo mientras tenías cambios sin guardar, así que lo que ves ya no coincide con lo que hay en disco. Si guardas ahora, este borrador se enviará a Overleaf.",Nqe=()=>"इस फ़ाइल की Overleaf कॉपी तब खींची गई जब आपके पास सेव न किए गए बदलाव थे, इसलिए जो आप देख रहे हैं वह अब डिस्क पर मौजूद चीज़ नहीं है। अभी सेव करने पर यह ड्राफ़्ट सीधे Overleaf को भेज दिया जाएगा।",zqe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?kqe():t==="fa"?Sqe():t==="ar"?Cqe():t==="es"?Eqe():t==="hi"?Nqe():wqe()}),jqe=()=>"Overwrite disk file",Tqe=()=>"覆盖磁盘文件",Aqe=()=>"بازنویسی فایل روی دیسک",Rqe=()=>"استبدال الملف على القرص",Mqe=()=>"Sobrescribir el archivo en disco",Oqe=()=>"डिस्क फ़ाइल अधिलेखित करें",Dqe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Tqe():t==="fa"?Aqe():t==="ar"?Rqe():t==="es"?Mqe():t==="hi"?Oqe():jqe()}),Lqe=()=>"Compiled PDF is out of date",Iqe=()=>"已编译的 PDF 不是最新版本",$qe=()=>"PDF کامپایل‌شده به‌روز نیست",Bqe=()=>"ملف PDF المُجمَّع غير محدَّث",Pqe=()=>"El PDF compilado está desactualizado",Fqe=()=>"कंपाइल की गई PDF पुरानी है",Hqe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Iqe():t==="fa"?$qe():t==="ar"?Bqe():t==="es"?Pqe():t==="hi"?Fqe():Lqe()}),qqe=()=>"project clone",Uqe=()=>"项目克隆",Gqe=()=>"کلون پروژه",Vqe=()=>"نسخة المشروع المستنسخة",Kqe=()=>"el clon del proyecto",Wqe=()=>"प्रोजेक्ट क्लोन",Zg=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Uqe():t==="fa"?Gqe():t==="ar"?Vqe():t==="es"?Kqe():t==="hi"?Wqe():qqe()}),Qqe=()=>"Recompile PDF",Xqe=()=>"重新编译 PDF",Yqe=()=>"کامپایل دوبارهٔ PDF",Zqe=()=>"إعادة تجميع PDF",Jqe=()=>"Volver a compilar el PDF",eUe=()=>"PDF फिर से कंपाइल करें",HN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Xqe():t==="fa"?Yqe():t==="ar"?Zqe():t==="es"?Jqe():t==="hi"?eUe():Qqe()}),tUe=()=>"Reload from disk",nUe=()=>"从磁盘重新加载",rUe=()=>"بارگذاری مجدد از دیسک",sUe=()=>"إعادة التحميل من القرص",iUe=()=>"Recargar desde el disco",aUe=()=>"डिस्क से फिर से लोड करें",oUe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nUe():t==="fa"?rUe():t==="ar"?sUe():t==="es"?iUe():t==="hi"?aUe():tUe()}),cUe=()=>"Reveal in file manager",lUe=()=>"在文件管理器中显示",uUe=()=>"نمایش در مدیر فایل",_Ue=()=>"إظهار في مدير الملفات",fUe=()=>"Mostrar en el administrador de archivos",dUe=()=>"फ़ाइल मैनेजर में दिखाएँ",qN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lUe():t==="fa"?uUe():t==="ar"?_Ue():t==="es"?fUe():t==="hi"?dUe():cUe()}),hUe=()=>"Save failed",pUe=()=>"保存失败",mUe=()=>"ذخیره ناموفق بود",gUe=()=>"فشل الحفظ",vUe=()=>"Error al guardar",bUe=()=>"सेव विफल",yUe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pUe():t==="fa"?mUe():t==="ar"?gUe():t==="es"?vUe():t==="hi"?bUe():hUe()}),xUe=()=>"Saving…",wUe=()=>"正在保存…",kUe=()=>"در حال ذخیره…",SUe=()=>"جارٍ الحفظ…",CUe=()=>"Guardando…",EUe=()=>"सेव हो रहा है…",NUe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?wUe():t==="fa"?kUe():t==="ar"?SUe():t==="es"?CUe():t==="hi"?EUe():xUe()}),zUe=()=>"Selected — press ⌘C",jUe=()=>"已选中 — 按 ⌘C 复制",TUe=()=>"انتخاب شد — برای کپی ⌘C را بزنید",AUe=()=>"محدد — اضغط ⌘C",RUe=()=>"Seleccionado — pulsa ⌘C",MUe=()=>"चयनित — ⌘C दबाएं",OUe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jUe():t==="fa"?TUe():t==="ar"?AUe():t==="es"?RUe():t==="hi"?MUe():zUe()}),DUe=()=>"session’s worktree",LUe=()=>"会话工作树",IUe=()=>"درخت کاری نشست",$Ue=()=>"شجرة عمل الجلسة",BUe=()=>"el árbol de trabajo de la sesión",PUe=()=>"सेशन की वर्कट्री",Jg=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?LUe():t==="fa"?IUe():t==="ar"?$Ue():t==="es"?BUe():t==="hi"?PUe():DUe()}),FUe=()=>"Show compiled PDF",HUe=()=>"显示已编译的 PDF",qUe=()=>"نمایش PDF کامپایل‌شده",UUe=()=>"عرض ملف PDF المُجمَّع",GUe=()=>"Mostrar el PDF compilado",VUe=()=>"कंपाइल की गई PDF दिखाएं",UN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?HUe():t==="fa"?qUe():t==="ar"?UUe():t==="es"?GUe():t==="hi"?VUe():FUe()}),KUe=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",WUe=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",QUe=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",XUe=()=>"أُنشئ ملف PDF هذا من نسخة أقدم من المصدر — أعِد تجميعه لتحديثه.",YUe=()=>"Este PDF se compiló a partir de una versión anterior del código fuente — vuelve a compilar para actualizarlo.",ZUe=()=>"यह PDF सोर्स के पुराने वर्शन से कंपाइल हुआ था — अपडेट करने के लिए फिर से कंपाइल करें।",JUe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?WUe():t==="fa"?QUe():t==="ar"?XUe():t==="es"?YUe():t==="hi"?ZUe():KUe()}),eGe=()=>"This session's worktree isn't available — showing the project clone's copy.",tGe=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",nGe=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",rGe=()=>"شجرة عمل هذه الجلسة غير متاحة — عرض الملف من نسخة المشروع المستنسخة.",sGe=()=>"El árbol de trabajo de esta sesión no está disponible — se muestra la copia del clon del proyecto.",iGe=()=>"इस सेशन की वर्कट्री उपलब्ध नहीं है — प्रोजेक्ट क्लोन की कॉपी दिखाई जा रही है।",aGe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tGe():t==="fa"?nGe():t==="ar"?rGe():t==="es"?sGe():t==="hi"?iGe():eGe()}),oGe=()=>"Unsaved",cGe=()=>"未保存",lGe=()=>"ذخیره نشده",uGe=()=>"غير محفوظ",_Ge=()=>"Sin guardar",fGe=()=>"सेव नहीं हुआ",PD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cGe():t==="fa"?lGe():t==="ar"?uGe():t==="es"?_Ge():t==="hi"?fGe():oGe()}),dGe=()=>"Unsaved — ⌘S to save",hGe=()=>"未保存 — 按 ⌘S 保存",pGe=()=>"ذخیره نشده — برای ذخیره ⌘S را بزنید",mGe=()=>"غير محفوظ — ⌘S للحفظ",gGe=()=>"Sin guardar — ⌘S para guardar",vGe=()=>"सेव नहीं हुआ — सेव करने के लिए ⌘S दबाएं",bGe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hGe():t==="fa"?pGe():t==="ar"?mGe():t==="es"?gGe():t==="hi"?vGe():dGe()}),yGe=()=>"Update orx on the remote machine to edit this file safely.",xGe=()=>"请更新远程计算机上的 orx,以安全编辑此文件。",wGe=()=>"برای ویرایش ایمن این فایل، orx را روی دستگاه ریموت به‌روز کنید.",kGe=()=>"حدّث orx على الجهاز البعيد لتعديل هذا الملف بأمان.",SGe=()=>"Actualiza orx en la máquina remota para editar este archivo de forma segura.",CGe=()=>"इस फ़ाइल को सुरक्षित रूप से संपादित करने के लिए रिमोट मशीन पर orx अपडेट करें।",EGe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xGe():t==="fa"?wGe():t==="ar"?kGe():t==="es"?SGe():t==="hi"?CGe():yGe()}),NGe=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",zGe=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",jGe=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",TGe=()=>"شجرة عمل هذه الجلسة غير متاحة، والملف ليس في نسخة المشروع المستنسخة ولا في مُخرَجاته.",AGe=()=>"El árbol de trabajo de esta sesión no está disponible y el archivo no está en el clon del proyecto ni en sus artefactos.",RGe=()=>"इस सेशन की वर्कट्री उपलब्ध नहीं है, और फ़ाइल प्रोजेक्ट क्लोन या उसके आर्टिफ़ैक्ट में नहीं है।",MGe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zGe():t==="fa"?jGe():t==="ar"?TGe():t==="es"?AGe():t==="hi"?RGe():NGe()}),OGe=()=>"Files in this workspace will appear here. Ask the agent to create a file to get started.",DGe=()=>"此工作区中的文件会显示在这里。让智能体创建一个文件即可开始。",LGe=()=>"فایل‌های این فضای کاری اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید فایلی ایجاد کند.",IGe=()=>"ستظهر ملفات مساحة العمل هنا. اطلب من الوكيل إنشاء ملف للبدء.",$Ge=()=>"Los archivos de este espacio de trabajo aparecerán aquí. Pídele al agente que cree un archivo para empezar.",BGe=()=>"इस वर्कस्पेस की फ़ाइलें यहाँ दिखेंगी। शुरू करने के लिए एजेंट से एक फ़ाइल बनाने को कहें।",PGe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?DGe():t==="fa"?LGe():t==="ar"?IGe():t==="es"?$Ge():t==="hi"?BGe():OGe()}),FGe=()=>"Back to preview",HGe=()=>"返回预览",qGe=()=>"بازگشت به پیش‌نمایش",UGe=()=>"العودة إلى المعاينة",GGe=()=>"Volver a la vista previa",VGe=()=>"प्रीव्यू पर वापस जाएं",KGe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?HGe():t==="fa"?qGe():t==="ar"?UGe():t==="es"?GGe():t==="hi"?VGe():FGe()}),WGe=e=>`${e==null?void 0:e.count} changed files`,QGe=e=>`${e==null?void 0:e.count} 个已更改文件`,XGe=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,YGe=e=>`الملفات المعدَّلة: ${e==null?void 0:e.count}`,ZGe=e=>`${e==null?void 0:e.count} archivos modificados`,JGe=e=>`${e==null?void 0:e.count} बदली गई फ़ाइलें`,FD=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?QGe(e):t==="fa"?XGe(e):t==="ar"?YGe(e):t==="es"?ZGe(e):t==="hi"?JGe(e):WGe(e)}),eVe=()=>"Changed files",tVe=()=>"已更改文件",nVe=()=>"فایل‌های تغییرکرده",rVe=()=>"الملفات المتغيّرة",sVe=()=>"Archivos modificados",iVe=()=>"बदली गई फ़ाइलें",aVe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tVe():t==="fa"?nVe():t==="ar"?rVe():t==="es"?sVe():t==="hi"?iVe():eVe()}),oVe=()=>"Diff preview truncated",cVe=()=>"差异预览已截断",lVe=()=>"پیش‌نمایش تفاوت کوتاه شده است",uVe=()=>"معاينة الفروق مقتطعة",_Ve=()=>"Vista previa del diff truncada",fVe=()=>"डिफ़ प्रीव्यू छोटा किया गया",dVe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cVe():t==="fa"?lVe():t==="ar"?uVe():t==="es"?_Ve():t==="hi"?fVe():oVe()}),hVe=e=>`${e==null?void 0:e.count} files shown (partial)`,pVe=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,mVe=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,gVe=e=>`الملفات المعروضة: ${e==null?void 0:e.count} (عرض جزئي)`,vVe=e=>`${e==null?void 0:e.count} archivos mostrados (parcial)`,bVe=e=>`${e==null?void 0:e.count} फ़ाइलें दिखाई गईं (आंशिक)`,yVe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?pVe(e):t==="fa"?mVe(e):t==="ar"?gVe(e):t==="es"?vVe(e):t==="hi"?bVe(e):hVe(e)}),xVe=()=>"No changes.",wVe=()=>"没有更改。",kVe=()=>"تغییری وجود ندارد.",SVe=()=>"لا توجد تغييرات.",CVe=()=>"No hay cambios.",EVe=()=>"कोई बदलाव नहीं।",NVe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?wVe():t==="fa"?kVe():t==="ar"?SVe():t==="es"?CVe():t==="hi"?EVe():xVe()}),zVe=()=>"No complete file preview was available before the cutoff.",jVe=()=>"在截断位置之前没有完整的文件预览。",TVe=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",AVe=()=>"لم تتوفر معاينة كاملة للملف قبل الحد الأقصى.",RVe=()=>"No se pudo previsualizar ningún archivo completo antes del límite.",MVe=()=>"कटऑफ़ से पहले कोई पूरा फ़ाइल प्रीव्यू उपलब्ध नहीं था।",OVe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jVe():t==="fa"?TVe():t==="ar"?AVe():t==="es"?RVe():t==="hi"?MVe():zVe()}),DVe=()=>"No textual diff for this file.",LVe=()=>"此文件没有文本差异。",IVe=()=>"برای این فایل تفاوت متنی وجود ندارد.",$Ve=()=>"لا يوجد فرق نصّي لهذا الملف.",BVe=()=>"No hay diff de texto para este archivo.",PVe=()=>"इस फ़ाइल के लिए कोई टेक्स्ट डिफ़ नहीं है।",FVe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?LVe():t==="fa"?IVe():t==="ar"?$Ve():t==="es"?BVe():t==="hi"?PVe():DVe()}),HVe=()=>"1 changed file",qVe=()=>"1 个已更改文件",UVe=()=>"۱ فایل تغییرکرده",GVe=()=>"ملف واحد معدَّل",VVe=()=>"1 archivo modificado",KVe=()=>"1 बदली गई फ़ाइल",HD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qVe():t==="fa"?UVe():t==="ar"?GVe():t==="es"?VVe():t==="hi"?KVe():HVe()}),WVe=()=>"1 file shown (partial)",QVe=()=>"显示 1 个文件(部分)",XVe=()=>"۱ فایل نمایش داده شده (ناقص)",YVe=()=>"عُرض ملف واحد (جزئيًا)",ZVe=()=>"1 archivo mostrado (parcial)",JVe=()=>"1 फ़ाइल दिखाई गई (आंशिक)",eKe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?QVe():t==="fa"?XVe():t==="ar"?YVe():t==="es"?ZVe():t==="hi"?JVe():WVe()}),tKe=()=>"Unable to parse this diff.",nKe=()=>"无法解析此差异。",rKe=()=>"خواندن این تفاوت ممکن نبود.",sKe=()=>"تعذّر تحليل هذا الفرق.",iKe=()=>"No se pudo interpretar este diff.",aKe=()=>"यह डिफ़ पार्स नहीं हो सका।",oKe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nKe():t==="fa"?rKe():t==="ar"?sKe():t==="es"?iKe():t==="hi"?aKe():tKe()}),cKe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,lKe=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,uKe=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,_Ke=e=>`عرض أول ${e==null?void 0:e.limit} (قُرئ ${e==null?void 0:e.read}). اطّلع على الفرق الكامل محليًا عبر git.`,fKe=e=>`Se muestran los primeros ${e==null?void 0:e.limit} (${e==null?void 0:e.read} leídos). Consulta el diff completo en local con git.`,dKe=e=>`पहले ${e==null?void 0:e.limit} दिखाए जा रहे हैं (${e==null?void 0:e.read} पढ़े गए)। git के साथ लोकल रूप से पूरा डिफ़ देखें।`,hKe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?lKe(e):t==="fa"?uKe(e):t==="ar"?_Ke(e):t==="es"?fKe(e):t==="hi"?dKe(e):cKe(e)}),pKe=()=>"View full diff",mKe=()=>"查看完整差异",gKe=()=>"نمایش تفاوت کامل",vKe=()=>"عرض الفرق الكامل",bKe=()=>"Ver diff completo",yKe=()=>"पूरा डिफ़ देखें",xKe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?mKe():t==="fa"?gKe():t==="ar"?vKe():t==="es"?bKe():t==="hi"?yKe():pKe()}),wKe=()=>"Create a token ↗",kKe=()=>"创建令牌 ↗",SKe=()=>"ساخت توکن ↗",CKe=()=>"إنشاء رمز ↗",EKe=()=>"Crear un token ↗",NKe=()=>"एक टोकन बनाएं ↗",zKe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?kKe():t==="fa"?SKe():t==="ar"?CKe():t==="es"?EKe():t==="hi"?NKe():wKe()}),jKe=()=>"Keep the agent working toward a goal",TKe=()=>"让智能体持续朝目标推进",AKe=()=>"عامل را در مسیر یک هدف نگه دارید",RKe=()=>"اجعل الوكيل يعمل نحو هدف",MKe=()=>"Mantén al agente trabajando hacia un objetivo",OKe=()=>"एजेंट को एक लक्ष्य की ओर काम पर रखें",DKe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?TKe():t==="fa"?AKe():t==="ar"?RKe():t==="es"?MKe():t==="hi"?OKe():jKe()}),LKe=()=>"Approve and run",IKe=()=>"批准并运行",$Ke=()=>"تأیید و اجرا",BKe=()=>"الموافقة والتشغيل",PKe=()=>"Aprobar y ejecutar",FKe=()=>"स्वीकार करें और चलाएं",HKe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?IKe():t==="fa"?$Ke():t==="ar"?BKe():t==="es"?PKe():t==="hi"?FKe():LKe()}),qKe=()=>"Cancel setup",UKe=()=>"取消设置",GKe=()=>"لغو راه‌اندازی",VKe=()=>"إلغاء الإعداد",KKe=()=>"Cancelar configuración",WKe=()=>"सेटअप रद्द करें",QKe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?UKe():t==="fa"?GKe():t==="ar"?VKe():t==="es"?KKe():t==="hi"?WKe():qKe()}),XKe=()=>"Checking connection…",YKe=()=>"正在检查连接…",ZKe=()=>"در حال بررسی اتصال…",JKe=()=>"جارٍ التحقق من الإعداد…",eWe=()=>"Comprobando conexión…",tWe=()=>"कनेक्शन जाँचा जा रहा है…",nWe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?YKe():t==="fa"?ZKe():t==="ar"?JKe():t==="es"?eWe():t==="hi"?tWe():XKe()}),rWe=e=>`${e==null?void 0:e.agent} is connected.`,sWe=e=>`${e==null?void 0:e.agent} 已连接。`,iWe=e=>`${e==null?void 0:e.agent} متصل است.`,aWe=e=>`أصبح ${e==null?void 0:e.agent} جاهزًا.`,oWe=e=>`${e==null?void 0:e.agent} está conectado.`,cWe=e=>`${e==null?void 0:e.agent} कनेक्टेड है।`,lWe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?sWe(e):t==="fa"?iWe(e):t==="ar"?aWe(e):t==="es"?oWe(e):t==="hi"?cWe(e):rWe(e)}),uWe=()=>"Setup needs attention.",_We=()=>"设置需要处理。",fWe=()=>"راه‌اندازی نیاز به بررسی دارد.",dWe=()=>"تعذّر إكمال الإعداد.",hWe=()=>"La configuración requiere atención.",pWe=()=>"सेटअप पर ध्यान देने की ज़रूरत है।",qD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_We():t==="fa"?fWe():t==="ar"?dWe():t==="es"?hWe():t==="hi"?pWe():uWe()}),mWe=()=>"Install",gWe=()=>"安装",vWe=()=>"نصب",bWe=()=>"تثبيت",yWe=()=>"Instalar",xWe=()=>"इंस्टॉल करें",wWe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gWe():t==="fa"?vWe():t==="ar"?bWe():t==="es"?yWe():t==="hi"?xWe():mWe()}),kWe=e=>`Approve the command below to download and install ${e==null?void 0:e.agent} on your computer.`,SWe=e=>`批准以下命令以在您的电脑上下载并安装 ${e==null?void 0:e.agent}。`,CWe=e=>`برای دانلود و نصب ${e==null?void 0:e.agent} روی رایانه خود، دستور زیر را تأیید کنید.`,EWe=e=>`سيؤدي هذا إلى تنزيل ${e==null?void 0:e.agent} وتثبيته على جهازك. وافق لتشغيل الأمر أدناه.`,NWe=e=>`Aprueba el siguiente comando para descargar e instalar ${e==null?void 0:e.agent} en tu equipo.`,zWe=e=>`अपने कंप्यूटर पर ${e==null?void 0:e.agent} डाउनलोड और इंस्टॉल करने के लिए नीचे दी गई कमांड को स्वीकार करें।`,jWe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?SWe(e):t==="fa"?CWe(e):t==="ar"?EWe(e):t==="es"?NWe(e):t==="hi"?zWe(e):kWe(e)}),TWe=()=>"Could not load setup commands.",AWe=()=>"无法加载设置命令。",RWe=()=>"بارگیری دستورهای راه‌اندازی ناموفق بود.",MWe=()=>"تعذّر تحميل أوامر الإعداد.",OWe=()=>"No se pudieron cargar los comandos de configuración.",DWe=()=>"सेटअप कमांड लोड नहीं हो सके।",LWe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?AWe():t==="fa"?RWe():t==="ar"?MWe():t==="es"?OWe():t==="hi"?DWe():TWe()}),IWe=()=>"Sign in",$We=()=>"登录",BWe=()=>"ورود",PWe=()=>"تسجيل الدخول",FWe=()=>"Iniciar sesión",HWe=()=>"साइन इन करें",UD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$We():t==="fa"?BWe():t==="ar"?PWe():t==="es"?FWe():t==="hi"?HWe():IWe()}),qWe=()=>"The agent is not ready yet. Re-check or retry sign-in.",UWe=()=>"代理尚未就绪。请重新检查或重试登录。",GWe=()=>"عامل هنوز آماده نیست. دوباره بررسی کنید یا ورود را تکرار کنید.",VWe=()=>"وكيل البرمجة غير جاهز بعد. أعد التحقق ثم حاول مجددًا.",KWe=()=>"El agente aún no está listo. Vuelve a comprobarlo o intenta iniciar sesión de nuevo.",WWe=()=>"एजेंट अभी तैयार नहीं है। फिर से जाँचें या साइन-इन फिर से कोशिश करें।",GD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?UWe():t==="fa"?GWe():t==="ar"?VWe():t==="es"?KWe():t==="hi"?WWe():qWe()}),QWe=()=>"Install, update, and sign-in buttons open a terminal here in OpenResearch.",XWe=()=>"安装、更新和登录按钮会在 OpenResearch 内打开终端。",YWe=()=>"دکمه‌های نصب، به‌روزرسانی و ورود، ترمینالی در همین OpenResearch باز می‌کنند.",ZWe=()=>"يفتح طرفية هنا",JWe=()=>"Los botones de instalación, actualización e inicio de sesión abren un terminal aquí, en OpenResearch.",eQe=()=>"इंस्टॉल, अपडेट और साइन-इन बटन OpenResearch में यहीं एक टर्मिनल खोलते हैं।",tQe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?XWe():t==="fa"?YWe():t==="ar"?ZWe():t==="es"?JWe():t==="hi"?eQe():QWe()}),nQe=()=>"This install command requires Node.js and npm.",rQe=()=>"此安装命令需要 Node.js 和 npm。",sQe=()=>"این دستور نصب به Node.js و npm نیاز دارد.",iQe=()=>"يلزم تثبيت Node.js وnpm لتشغيل هذا الأمر.",aQe=()=>"Este comando de instalación requiere Node.js y npm.",oQe=()=>"इस इंस्टॉल कमांड के लिए Node.js और npm ज़रूरी हैं।",cQe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rQe():t==="fa"?sQe():t==="ar"?iQe():t==="es"?aQe():t==="hi"?oQe():nQe()}),lQe=e=>`Running \`${e==null?void 0:e.command}\` in the terminal:`,uQe=e=>`正在终端中运行 \`${e==null?void 0:e.command}\`:`,_Qe=e=>`در حال اجرای \`${e==null?void 0:e.command}\` در ترمینال:`,fQe=e=>`جارٍ تشغيل \`${e==null?void 0:e.command}\` في الطرفية:`,dQe=e=>`Ejecutando \`${e==null?void 0:e.command}\` en el terminal:`,hQe=e=>`टर्मिनल में \`${e==null?void 0:e.command}\` चलाया जा रहा है:`,pQe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?uQe(e):t==="fa"?_Qe(e):t==="ar"?fQe(e):t==="es"?dQe(e):t==="hi"?hQe(e):lQe(e)}),mQe=e=>`Set up ${e==null?void 0:e.agent}`,gQe=e=>`设置 ${e==null?void 0:e.agent}`,vQe=e=>`راه‌اندازی ${e==null?void 0:e.agent}`,bQe=e=>`إعداد ${e==null?void 0:e.agent}`,yQe=e=>`Configurar ${e==null?void 0:e.agent}`,xQe=e=>`${e==null?void 0:e.agent} सेट अप करें`,GN=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?gQe(e):t==="fa"?vQe(e):t==="ar"?bQe(e):t==="es"?yQe(e):t==="hi"?xQe(e):mQe(e)}),wQe=()=>"Update",kQe=()=>"更新",SQe=()=>"به‌روزرسانی",CQe=()=>"تحديث",EQe=()=>"Actualizar",NQe=()=>"अपडेट करें",zQe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?kQe():t==="fa"?SQe():t==="ar"?CQe():t==="es"?EQe():t==="hi"?NQe():wQe()}),jQe=e=>`Approve the command below to update ${e==null?void 0:e.agent} on your computer.`,TQe=e=>`批准以下命令以在您的电脑上更新 ${e==null?void 0:e.agent}。`,AQe=e=>`برای به‌روزرسانی ${e==null?void 0:e.agent} روی رایانه خود، دستور زیر را تأیید کنید.`,RQe=e=>`سيؤدي هذا إلى تحديث ${e==null?void 0:e.agent} على جهازك. وافق لتشغيل الأمر أدناه.`,MQe=e=>`Aprueba el siguiente comando para actualizar ${e==null?void 0:e.agent} en tu equipo.`,OQe=e=>`अपने कंप्यूटर पर ${e==null?void 0:e.agent} अपडेट करने के लिए नीचे दी गई कमांड को स्वीकार करें।`,DQe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?TQe(e):t==="fa"?AQe(e):t==="ar"?RQe(e):t==="es"?MQe(e):t==="hi"?OQe(e):jQe(e)}),LQe=()=>"All projects",IQe=()=>"所有项目",$Qe=()=>"همهٔ پروژه‌ها",BQe=()=>"كل المشاريع",PQe=()=>"Todos los proyectos",FQe=()=>"सभी प्रोजेक्ट",VN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?IQe():t==="fa"?$Qe():t==="ar"?BQe():t==="es"?PQe():t==="hi"?FQe():LQe()}),HQe=()=>"Configure Repository",qQe=()=>"配置仓库",UQe=()=>"پیکربندی مخزن",GQe=()=>"إعداد المستودع",VQe=()=>"Configurar repositorio",KQe=()=>"रिपॉज़िटरी कॉन्फ़िगर करें",WQe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qQe():t==="fa"?UQe():t==="ar"?GQe():t==="es"?VQe():t==="hi"?KQe():HQe()}),QQe=()=>"Create a new project",XQe=()=>"新建项目",YQe=()=>"ایجاد پروژهٔ جدید",ZQe=()=>"إنشاء مشروع جديد",JQe=()=>"Crear un proyecto nuevo",eXe=()=>"नया प्रोजेक्ट बनाएं",tXe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?XQe():t==="fa"?YQe():t==="ar"?ZQe():t==="es"?JQe():t==="hi"?eXe():QQe()}),nXe=()=>"Hide sidebar",rXe=()=>"隐藏侧边栏",sXe=()=>"پنهان کردن نوار کناری",iXe=()=>"إخفاء الشريط الجانبي",aXe=()=>"Ocultar barra lateral",oXe=()=>"साइडबार छिपाएं",KN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rXe():t==="fa"?sXe():t==="ar"?iXe():t==="es"?aXe():t==="hi"?oXe():nXe()}),cXe=()=>"Project",lXe=()=>"项目",uXe=()=>"پروژه",_Xe=()=>"المشروع",fXe=()=>"Proyecto",dXe=()=>"प्रोजेक्ट",hXe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lXe():t==="fa"?uXe():t==="ar"?_Xe():t==="es"?fXe():t==="hi"?dXe():cXe()}),pXe=e=>`${e==null?void 0:e.count} cancelled`,mXe=e=>`${e==null?void 0:e.count} 次取消`,gXe=e=>`${e==null?void 0:e.count} لغوشده`,vXe=e=>`الملغاة: ${e==null?void 0:e.count}`,bXe=e=>`${e==null?void 0:e.count} canceladas`,yXe=e=>`${e==null?void 0:e.count} रद्द`,xXe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?mXe(e):t==="fa"?gXe(e):t==="ar"?vXe(e):t==="es"?bXe(e):t==="hi"?yXe(e):pXe(e)}),wXe=e=>`${e==null?void 0:e.count} done`,kXe=e=>`${e==null?void 0:e.count} 次完成`,SXe=e=>`${e==null?void 0:e.count} تمام‌شده`,CXe=e=>`المكتملة: ${e==null?void 0:e.count}`,EXe=e=>`${e==null?void 0:e.count} completadas`,NXe=e=>`${e==null?void 0:e.count} पूरे`,zXe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?kXe(e):t==="fa"?SXe(e):t==="ar"?CXe(e):t==="es"?EXe(e):t==="hi"?NXe(e):wXe(e)}),jXe=e=>`${e==null?void 0:e.count} failed`,TXe=e=>`${e==null?void 0:e.count} 次失败`,AXe=e=>`${e==null?void 0:e.count} ناموفق`,RXe=e=>`الفاشلة: ${e==null?void 0:e.count}`,MXe=e=>`${e==null?void 0:e.count} con error`,OXe=e=>`${e==null?void 0:e.count} विफल`,DXe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?TXe(e):t==="fa"?AXe(e):t==="ar"?RXe(e):t==="es"?MXe(e):t==="hi"?OXe(e):jXe(e)}),LXe=e=>`${e==null?void 0:e.count} files`,IXe=e=>`${e==null?void 0:e.count} 个文件`,$Xe=e=>`${e==null?void 0:e.count} فایل`,BXe=e=>`الملفات: ${e==null?void 0:e.count}`,PXe=e=>`${e==null?void 0:e.count} archivos`,FXe=e=>`${e==null?void 0:e.count} फ़ाइलें`,HXe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?IXe(e):t==="fa"?$Xe(e):t==="ar"?BXe(e):t==="es"?PXe(e):t==="hi"?FXe(e):LXe(e)}),qXe=e=>`${e==null?void 0:e.count}+ files`,UXe=e=>`至少 ${e==null?void 0:e.count} 个文件`,GXe=e=>`بیش از ${e==null?void 0:e.count} فایل`,VXe=e=>`الملفات: ${e==null?void 0:e.count} على الأقل`,KXe=e=>`${e==null?void 0:e.count}+ archivos`,WXe=e=>`${e==null?void 0:e.count}+ फ़ाइलें`,QXe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?UXe(e):t==="fa"?GXe(e):t==="ar"?VXe(e):t==="es"?KXe(e):t==="hi"?WXe(e):qXe(e)}),XXe=e=>`${e==null?void 0:e.count} live`,YXe=e=>`${e==null?void 0:e.count} 次进行中`,ZXe=e=>`${e==null?void 0:e.count} فعال`,JXe=e=>`النشطة: ${e==null?void 0:e.count}`,eYe=e=>`${e==null?void 0:e.count} en curso`,tYe=e=>`${e==null?void 0:e.count} लाइव`,nYe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?YXe(e):t==="fa"?ZXe(e):t==="ar"?JXe(e):t==="es"?eYe(e):t==="hi"?tYe(e):XXe(e)}),rYe=()=>"1 file",sYe=()=>"1 个文件",iYe=()=>"۱ فایل",aYe=()=>"ملف واحد",oYe=()=>"1 archivo",cYe=()=>"1 फ़ाइल",lYe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?sYe():t==="fa"?iYe():t==="ar"?aYe():t==="es"?oYe():t==="hi"?cYe():rYe()}),uYe=()=>"1 run",_Ye=()=>"1 次运行",fYe=()=>"۱ اجرا",dYe=()=>"تشغيل واحد",hYe=()=>"1 ejecución",pYe=()=>"1 रन",mYe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_Ye():t==="fa"?fYe():t==="ar"?dYe():t==="es"?hYe():t==="hi"?pYe():uYe()}),gYe=e=>`${e==null?void 0:e.count} runs`,vYe=e=>`${e==null?void 0:e.count} 次运行`,bYe=e=>`${e==null?void 0:e.count} اجرا`,yYe=e=>`عمليات التشغيل: ${e==null?void 0:e.count}`,xYe=e=>`${e==null?void 0:e.count} ejecuciones`,wYe=e=>`${e==null?void 0:e.count} रन`,kYe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?vYe(e):t==="fa"?bYe(e):t==="ar"?yYe(e):t==="es"?xYe(e):t==="hi"?wYe(e):gYe(e)}),SYe=()=>"Zoom in",CYe=()=>"放大",EYe=()=>"بزرگ‌نمایی",NYe=()=>"تكبير",zYe=()=>"Acercar",jYe=()=>"ज़ूम इन",WN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?CYe():t==="fa"?EYe():t==="ar"?NYe():t==="es"?zYe():t==="hi"?jYe():SYe()}),TYe=()=>"Zoom out",AYe=()=>"缩小",RYe=()=>"کوچک‌نمایی",MYe=()=>"تصغير",OYe=()=>"Alejar",DYe=()=>"ज़ूम आउट",QN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?AYe():t==="fa"?RYe():t==="ar"?MYe():t==="es"?OYe():t==="hi"?DYe():TYe()}),LYe=()=>"Reset zoom to fit",IYe=()=>"重置为适合窗口",$Ye=()=>"بازنشانی بزرگ‌نمایی برای جا شدن",BYe=()=>"إعادة ضبط التكبير للملاءمة",PYe=()=>"Restablecer zoom para ajustar",FYe=()=>"फ़िट करने के लिए ज़ूम रीसेट करें",XN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?IYe():t==="fa"?$Ye():t==="ar"?BYe():t==="es"?PYe():t==="hi"?FYe():LYe()}),HYe=()=>"No instances yet.",qYe=()=>"还没有实例。",UYe=()=>"هنوز نمونه‌ای وجود ندارد.",GYe=()=>"لا توجد مثيلات بعد.",VYe=()=>"Aún no hay instancias.",KYe=()=>"अभी तक कोई इंस्टेंस नहीं।",WYe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qYe():t==="fa"?UYe():t==="ar"?GYe():t==="es"?VYe():t==="hi"?KYe():HYe()}),QYe=()=>"Nothing running right now.",XYe=()=>"当前没有运行中的实例。",YYe=()=>"اکنون چیزی در حال اجرا نیست.",ZYe=()=>"لا شيء قيد التشغيل الآن.",JYe=()=>"No hay nada en ejecución ahora mismo.",eZe=()=>"अभी कुछ नहीं चल रहा।",tZe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?XYe():t==="fa"?YYe():t==="ar"?ZYe():t==="es"?JYe():t==="hi"?eZe():QYe()}),nZe=()=>"Select a project to see its history.",rZe=()=>"请选择一个项目以查看其历史记录。",sZe=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",iZe=()=>"اختر مشروعًا لرؤية سجله.",aZe=()=>"Selecciona un proyecto para ver su historial.",oZe=()=>"इसका इतिहास देखने के लिए एक प्रोजेक्ट चुनें।",cZe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rZe():t==="fa"?sZe():t==="ar"?iZe():t==="es"?aZe():t==="hi"?oZe():nZe()}),lZe=()=>"Select a project to see its runs.",uZe=()=>"请选择一个项目以查看其运行。",_Ze=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",fZe=()=>"اختر مشروعًا لرؤية عمليات تشغيله.",dZe=()=>"Selecciona un proyecto para ver sus ejecuciones.",hZe=()=>"इसके रन देखने के लिए एक प्रोजेक्ट चुनें।",pZe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?uZe():t==="fa"?_Ze():t==="ar"?fZe():t==="es"?dZe():t==="hi"?hZe():lZe()}),mZe=()=>"View history",gZe=()=>"查看历史记录",vZe=()=>"مشاهدهٔ تاریخچه",bZe=()=>"عرض السجل",yZe=()=>"Ver historial",xZe=()=>"इतिहास देखें",wZe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gZe():t==="fa"?vZe():t==="ar"?bZe():t==="es"?yZe():t==="hi"?xZe():mZe()}),kZe=e=>`View history (${e==null?void 0:e.count})`,SZe=e=>`查看历史记录(${e==null?void 0:e.count})`,CZe=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,EZe=e=>`عرض السجل (${e==null?void 0:e.count})`,NZe=e=>`Ver historial (${e==null?void 0:e.count})`,zZe=e=>`इतिहास देखें (${e==null?void 0:e.count})`,jZe=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?SZe(e):t==="fa"?CZe(e):t==="ar"?EZe(e):t==="es"?NZe(e):t==="hi"?zZe(e):kZe(e)}),TZe=()=>"The engine exited without producing a PDF or a log.",AZe=()=>"引擎已退出,但没有生成 PDF 或日志。",RZe=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",MZe=()=>"خرج المحرك دون إنتاج ملف PDF أو سجل.",OZe=()=>"El motor terminó sin generar un PDF ni un log.",DZe=()=>"इंजन बिना PDF या लॉग बनाए बाहर निकल गया।",LZe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?AZe():t==="fa"?RZe():t==="ar"?MZe():t==="es"?OZe():t==="hi"?DZe():TZe()}),IZe=()=>"Loading…",$Ze=()=>"正在加载…",BZe=()=>"در حال بارگیری…",PZe=()=>"جارٍ التحميل…",FZe=()=>"Cargando…",HZe=()=>"लोड हो रहा है…",qZe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$Ze():t==="fa"?BZe():t==="ar"?PZe():t==="es"?FZe():t==="hi"?HZe():IZe()}),UZe=()=>"Add local model",GZe=()=>"添加本地模型",VZe=()=>"افزودن مدل محلی",KZe=()=>"إضافة نموذج محلي",WZe=()=>"Añadir modelo local",QZe=()=>"लोकल मॉडल जोड़ें",VD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?GZe():t==="fa"?VZe():t==="ar"?KZe():t==="es"?WZe():t==="hi"?QZe():UZe()}),XZe=()=>"Local server address",YZe=()=>"本地服务器地址",ZZe=()=>"نشانی سرور محلی",JZe=()=>"عنوان الخادم المحلي",eJe=()=>"Dirección del servidor local",tJe=()=>"लोकल सर्वर पता",nJe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?YZe():t==="fa"?ZZe():t==="ar"?JZe():t==="es"?eJe():t==="hi"?tJe():XZe()}),rJe=()=>"Find models",sJe=()=>"查找模型",iJe=()=>"یافتن مدل‌ها",aJe=()=>"العثور على النماذج",oJe=()=>"Buscar modelos",cJe=()=>"मॉडल खोजें",lJe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?sJe():t==="fa"?iJe():t==="ar"?aJe():t==="es"?oJe():t==="hi"?cJe():rJe()}),uJe=()=>"(OpenAI compatible)",_Je=()=>"(兼容 OpenAI)",fJe=()=>"(سازگار با OpenAI)",dJe=()=>"(متوافق مع OpenAI)",hJe=()=>"(compatible con OpenAI)",pJe=()=>"(OpenAI संगत)",KD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_Je():t==="fa"?fJe():t==="ar"?dJe():t==="es"?hJe():t==="hi"?pJe():uJe()}),mJe=()=>"Saved, but OpenCode did not list this model. Check installed agents again. If your OpenCode config restricts enabled providers, allow this connection before using it.",gJe=()=>"已保存,但 OpenCode 未列出该模型。请重新检查已安装的智能体。如果 OpenCode 配置限制了启用的提供商,请先允许此连接。",vJe=()=>"ذخیره شد، اما OpenCode این مدل را فهرست نکرد. عامل‌های نصب‌شده را دوباره بررسی کنید. اگر پیکربندی OpenCode ارائه‌دهندگان فعال را محدود کرده، ابتدا این اتصال را مجاز کنید.",bJe=()=>"تم الحفظ، لكن OpenCode لم يُدرج هذا النموذج. تحقق من الوكلاء المثبّتين مجددًا. إذا كان إعداد OpenCode يقيّد المزوّدين المفعّلين، فاسمح بهذا الاتصال قبل استخدامه.",yJe=()=>"Guardado, pero OpenCode no mostró este modelo. Vuelve a comprobar los agentes instalados. Si tu configuración de OpenCode limita los proveedores habilitados, permite esta conexión antes de usarla.",xJe=()=>"सेव हो गया, पर OpenCode ने इस मॉडल की सूची नहीं दी। इंस्टॉल किए गए एजेंट फिर से जाँचें। अगर आपका OpenCode कॉन्फ़िग चालू प्रोवाइडर सीमित करता है, तो इस्तेमाल से पहले इस कनेक्शन की अनुमति दें।",wJe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gJe():t==="fa"?vJe():t==="ar"?bJe():t==="es"?yJe():t==="hi"?xJe():mJe()}),kJe=()=>"Connected",SJe=()=>"已连接",CJe=()=>"متصل شد",EJe=()=>"متصل",NJe=()=>"Conectado",zJe=()=>"कनेक्टेड",jJe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?SJe():t==="fa"?CJe():t==="ar"?EJe():t==="es"?NJe():t==="hi"?zJe():kJe()}),TJe=()=>"Context window",AJe=()=>"上下文窗口",RJe=()=>"پنجرهٔ زمینه",MJe=()=>"نافذة السياق",OJe=()=>"Ventana de contexto",DJe=()=>"कॉन्टेक्स्ट विंडो",LJe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?AJe():t==="fa"?RJe():t==="ar"?MJe():t==="es"?OJe():t==="hi"?DJe():TJe()}),IJe=()=>"Match the context window loaded in your model app. 32K is a useful starting point for tools; larger contexts use more memory.",$Je=()=>"请与模型应用中加载的上下文窗口保持一致。使用工具时可从 32K 开始;更大的上下文需要更多内存。",BJe=()=>"اندازهٔ زمینه را با تنظیم بارگذاری‌شده در برنامهٔ مدل هماهنگ کنید. ۳۲هزار توکن نقطهٔ شروع مناسبی برای ابزارهاست؛ زمینهٔ بزرگ‌تر حافظهٔ بیشتری مصرف می‌کند.",PJe=()=>"استخدم حجم نافذة السياق نفسه المحدد في تطبيق النموذج. يُعدّ 32 ألف رمز نقطة بداية مناسبة لاستخدام الأدوات؛ وتستهلك النوافذ الأكبر ذاكرة أكثر.",FJe=()=>"Usa la misma ventana de contexto que tengas cargada en tu app de modelos. 32K es un buen punto de partida para herramientas; los contextos más grandes usan más memoria.",HJe=()=>"अपने मॉडल ऐप में लोड कॉन्टेक्स्ट विंडो से मेल खाएं। टूल के लिए 32K एक अच्छा शुरुआती बिंदु है; बड़े कॉन्टेक्स्ट ज़्यादा मेमोरी इस्तेमाल करते हैं।",qJe=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$Je():t==="fa"?BJe():t==="ar"?PJe():t==="es"?FJe():t==="hi"?HJe():IJe()}),UJe=()=>"Custom Endpoint",GJe=()=>"自定义端点",VJe=()=>"نقطهٔ اتصال سفارشی",KJe=()=>"نقطة نهاية مخصصة",WJe=()=>"Endpoint personalizado",QJe=()=>"कस्टम एंडपॉइंट",Xk=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?GJe():t==="fa"?VJe():t==="ar"?KJe():t==="es"?WJe():t==="hi"?QJe():UJe()}),XJe=e=>`Disconnect ${e==null?void 0:e.name}`,YJe=e=>`断开 ${e==null?void 0:e.name}`,ZJe=e=>`قطع اتصال ${e==null?void 0:e.name}`,JJe=e=>`قطع اتصال ${e==null?void 0:e.name}`,eet=e=>`Desconectar ${e==null?void 0:e.name}`,tet=e=>`${e==null?void 0:e.name} डिस्कनेक्ट करें`,net=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?YJe(e):t==="fa"?ZJe(e):t==="ar"?JJe(e):t==="es"?eet(e):t==="hi"?tet(e):XJe(e)}),ret=()=>"Get OpenCode",set=()=>"获取 OpenCode",iet=()=>"دریافت OpenCode",aet=()=>"الحصول على OpenCode",oet=()=>"Obtener OpenCode",cet=()=>"OpenCode लें",uet=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?set():t==="fa"?iet():t==="ar"?aet():t==="es"?oet():t==="hi"?cet():ret()}),_et=()=>"Install OpenCode to run tools with your local model, then re-check installed agents. No cloud account is required.",fet=()=>"安装 OpenCode 以使用本地模型执行工具,然后重新检查已安装的智能体。无需云端账户。",det=()=>"برای اجرای ابزارها با مدل محلی، OpenCode را نصب کنید و عامل‌های نصب‌شده را دوباره بررسی کنید. حساب ابری لازم نیست.",het=()=>"ثبّت OpenCode لتشغيل الأدوات مع نموذجك المحلي، ثم أعد فحص الوكلاء المثبّتين. لا يلزم حساب سحابي.",pet=()=>"Instala OpenCode para usar herramientas con tu modelo local y vuelve a comprobar los agentes instalados. No necesitas una cuenta en la nube.",met=()=>"अपने लोकल मॉडल से टूल चलाने के लिए OpenCode इंस्टॉल करें, फिर इंस्टॉल किए गए एजेंट फिर से जाँचें। किसी क्लाउड खाते की ज़रूरत नहीं है।",get=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fet():t==="fa"?det():t==="ar"?het():t==="es"?pet():t==="hi"?met():_et()}),vet=()=>"API key (optional)",bet=()=>"API 密钥(可选)",yet=()=>"کلید API (اختیاری)",xet=()=>"مفتاح API (اختياري)",wet=()=>"Clave de API (opcional)",ket=()=>"API की (वैकल्पिक)",Cet=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bet():t==="fa"?yet():t==="ar"?xet():t==="es"?wet():t==="hi"?ket():vet()}),Eet=()=>"Save model",Net=()=>"保存模型",zet=()=>"ذخیرهٔ مدل",jet=()=>"حفظ النموذج",Tet=()=>"Guardar modelo",Aet=()=>"मॉडल सेव करें",Ret=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Net():t==="fa"?zet():t==="ar"?jet():t==="es"?Tet():t==="hi"?Aet():Eet()}),Met=()=>"Model server",Oet=()=>"模型服务器",Det=()=>"سرور مدل",Let=()=>"خادم النموذج",Iet=()=>"Servidor del modelo",$et=()=>"मॉडल सर्वर",YN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Oet():t==="fa"?Det():t==="ar"?Let():t==="es"?Iet():t==="hi"?$et():Met()}),Bet=()=>"Local models",Pet=()=>"本地模型",Fet=()=>"مدل‌های محلی",Het=()=>"النماذج المحلية",qet=()=>"Modelos locales",Uet=()=>"लोकल मॉडल",ZN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Pet():t==="fa"?Fet():t==="ar"?Het():t==="es"?qet():t==="hi"?Uet():Bet()}),Get=()=>"API token (optional)",Vet=()=>"API 令牌(可选)",Ket=()=>"توکن API (اختیاری)",Wet=()=>"رمز API (اختياري)",Qet=()=>"Token de API (opcional)",Xet=()=>"API टोकन (वैकल्पिक)",Yet=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vet():t==="fa"?Ket():t==="ar"?Wet():t==="es"?Qet():t==="hi"?Xet():Get()}),Zet=()=>"Copy",Jet=()=>"复制",ett=()=>"کپی",ttt=()=>"نسخ",ntt=()=>"Copiar",rtt=()=>"कॉपी करें",Yk=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Jet():t==="fa"?ett():t==="ar"?ttt():t==="es"?ntt():t==="hi"?rtt():Zet()}),stt=()=>"Copy code",itt=()=>"复制代码",att=()=>"کپی کد",ott=()=>"نسخ الشيفرة",ctt=()=>"Copiar código",ltt=()=>"कोड कॉपी करें",utt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?itt():t==="fa"?att():t==="ar"?ott():t==="es"?ctt():t==="hi"?ltt():stt()}),_tt=()=>"Download",ftt=()=>"下载",dtt=()=>"بارگیری",htt=()=>"تنزيل",ptt=()=>"Descargar",mtt=()=>"डाउनलोड करें",_3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ftt():t==="fa"?dtt():t==="ar"?htt():t==="es"?ptt():t==="hi"?mtt():_tt()}),gtt=()=>"This browser can’t preview this media format.",vtt=()=>"此浏览器无法预览该媒体格式。",btt=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",ytt=()=>"لا يستطيع هذا المتصفح معاينة صيغة الوسائط هذه.",xtt=()=>"Este navegador no puede mostrar este formato multimedia.",wtt=()=>"यह ब्राउज़र इस मीडिया फ़ॉर्मैट का प्रीव्यू नहीं दिखा सकता।",ktt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vtt():t==="fa"?btt():t==="ar"?ytt():t==="es"?xtt():t==="hi"?wtt():gtt()}),Stt=()=>"Choose the model for this chat",Ctt=()=>"选择此聊天的模型",Ett=()=>"انتخاب مدل این گفت‌وگو",Ntt=()=>"اختيار نموذج هذه المحادثة",ztt=()=>"Elige el modelo de este chat",jtt=()=>"इस चैट के लिए मॉडल चुनें",Ttt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ctt():t==="fa"?Ett():t==="ar"?Ntt():t==="es"?ztt():t==="hi"?jtt():Stt()}),Att=()=>"Add Local Model",Rtt=()=>"添加本地模型",Mtt=()=>"افزودن مدل محلی",Ott=()=>"إضافة نموذج محلي",Dtt=()=>"Añadir modelo local",Ltt=()=>"लोकल मॉडल जोड़ें",Itt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rtt():t==="fa"?Mtt():t==="ar"?Ott():t==="es"?Dtt():t==="hi"?Ltt():Att()}),$tt=()=>" · CLI configuration",Btt=()=>" · CLI 配置",Ptt=()=>" · پیکربندی CLI",Ftt=()=>" · إعداد واجهة سطر الأوامر",Htt=()=>" · Configuración de la CLI",qtt=()=>" · CLI कॉन्फ़िगरेशन",WD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Btt():t==="fa"?Ptt():t==="ar"?Ftt():t==="es"?Htt():t==="hi"?qtt():$tt()}),Utt=()=>"· Default",Gtt=()=>"· 默认",Vtt=()=>"· پیش‌فرض",Ktt=()=>"· الافتراضي",Wtt=()=>"· Predeterminado",Qtt=()=>"· डिफ़ॉल्ट",QD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Gtt():t==="fa"?Vtt():t==="ar"?Ktt():t==="es"?Wtt():t==="hi"?Qtt():Utt()}),Xtt=()=>"Default model",Ytt=()=>"默认模型",Ztt=()=>"مدل پیش‌فرض",Jtt=()=>"النموذج الافتراضي",ent=()=>"Modelo predeterminado",tnt=()=>"डिफ़ॉल्ट मॉडल",JN=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ytt():t==="fa"?Ztt():t==="ar"?Jtt():t==="es"?ent():t==="hi"?tnt():Xtt()}),nnt=()=>"Detecting harnesses…",rnt=()=>"正在检测智能体工具…",snt=()=>"در حال شناسایی ابزارهای عامل…",int=()=>"جارٍ اكتشاف أدوات البرمجة…",ant=()=>"Detectando agentes…",ont=()=>"हार्नेस पहचाने जा रहे हैं…",cnt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rnt():t==="fa"?snt():t==="ar"?int():t==="es"?ant():t==="hi"?ont():nnt()}),lnt=()=>"Effort",unt=()=>"推理强度",_nt=()=>"میزان استدلال",fnt=()=>"الجهد",dnt=()=>"Esfuerzo",hnt=()=>"प्रयास स्तर",pnt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?unt():t==="fa"?_nt():t==="ar"?fnt():t==="es"?dnt():t==="hi"?hnt():lnt()}),mnt=()=>"Fast speed ·",gnt=()=>"快速 ·",vnt=()=>"سرعت بالا ·",bnt=()=>"سرعة عالية ·",ynt=()=>"Modo rápido ·",xnt=()=>"तेज़ गति ·",wnt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gnt():t==="fa"?vnt():t==="ar"?bnt():t==="es"?ynt():t==="hi"?xnt():mnt()}),knt=()=>"Mode",Snt=()=>"模式",Cnt=()=>"حالت",Ent=()=>"الوضع",Nnt=()=>"Modo",znt=()=>"मोड",ez=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Snt():t==="fa"?Cnt():t==="ar"?Ent():t==="es"?Nnt():t==="hi"?znt():knt()}),jnt=()=>"Model",Tnt=()=>"模型",Ant=()=>"مدل",Rnt=()=>"النموذج",Mnt=()=>"Modelo",Ont=()=>"मॉडल",d0=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Tnt():t==="fa"?Ant():t==="ar"?Rnt():t==="es"?Mnt():t==="hi"?Ont():jnt()}),Dnt=e=>`${e==null?void 0:e.count} more — search to find`,Lnt=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,Int=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,$nt=e=>`نماذج إضافية: ${e==null?void 0:e.count} — ابحث للعثور عليها`,Bnt=e=>`${e==null?void 0:e.count} más — busca para encontrarlos`,Pnt=e=>`${e==null?void 0:e.count} और — खोजने के लिए टाइप करें`,Fnt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Lnt(e):t==="fa"?Int(e):t==="ar"?$nt(e):t==="es"?Bnt(e):t==="hi"?Pnt(e):Dnt(e)}),Hnt=()=>"Not available",qnt=()=>"不可用",Unt=()=>"در دسترس نیست",Gnt=()=>"غير متاح",Vnt=()=>"No disponible",Knt=()=>"उपलब्ध नहीं",Wnt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qnt():t==="fa"?Unt():t==="ar"?Gnt():t==="es"?Vnt():t==="hi"?Knt():Hnt()}),Qnt=()=>"Search models…",Xnt=()=>"搜索模型…",Ynt=()=>"جست‌وجوی مدل‌ها…",Znt=()=>"البحث في النماذج…",Jnt=()=>"Buscar modelos…",ert=()=>"मॉडल खोजें…",XD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Xnt():t==="fa"?Ynt():t==="ar"?Znt():t==="es"?Jnt():t==="hi"?ert():Qnt()}),trt=()=>"Sessions keep their harness. Start a new chat to switch.",nrt=()=>"会话将沿用当前的智能体工具。新建聊天即可切换。",rrt=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند. برای تغییر، گفتگوی جدیدی بسازید",srt=()=>"تحتفظ كل جلسة بأداة البرمجة الخاصة بها. ابدأ محادثة جديدة للتبديل.",irt=()=>"Cada sesión mantiene su agente. Inicia un chat nuevo para cambiarlo.",art=()=>"सेशन अपना हार्नेस बनाए रखते हैं। बदलने के लिए नई चैट शुरू करें।",ort=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nrt():t==="fa"?rrt():t==="ar"?srt():t==="es"?irt():t==="hi"?art():trt()}),crt=()=>"Speed",lrt=()=>"速度",urt=()=>"سرعت",_rt=()=>"السرعة",frt=()=>"Velocidad",drt=()=>"गति",tz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lrt():t==="fa"?urt():t==="ar"?_rt():t==="es"?frt():t==="hi"?drt():crt()}),hrt=()=>"Unavailable",prt=()=>"不可用",mrt=()=>"در دسترس نیست",grt=()=>"غير متاح",vrt=()=>"No disponible",brt=()=>"उपलब्ध नहीं",go=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?prt():t==="fa"?mrt():t==="ar"?grt():t==="es"?vrt():t==="hi"?brt():hrt()}),yrt=e=>`Use “${e==null?void 0:e.id}” as the model ID`,xrt=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,wrt=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,krt=e=>`استخدام «${e==null?void 0:e.id}» معرّفًا للنموذج`,Srt=e=>`Usar “${e==null?void 0:e.id}” como ID del modelo`,Crt=e=>`मॉडल ID के रूप में “${e==null?void 0:e.id}” इस्तेमाल करें`,Ert=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?xrt(e):t==="fa"?wrt(e):t==="ar"?krt(e):t==="es"?Srt(e):t==="hi"?Crt(e):yrt(e)}),Nrt=()=>"Variant",zrt=()=>"变体",jrt=()=>"گونه",Trt=()=>"الصنف",Art=()=>"Variante",Rrt=()=>"वेरिएंट",Mrt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zrt():t==="fa"?jrt():t==="ar"?Trt():t==="es"?Art():t==="hi"?Rrt():Nrt()}),Ort=()=>"Start a new chat",Drt=()=>"开始新聊天",Lrt=()=>"شروع گفت‌وگوی جدید",Irt=()=>"بدء محادثة جديدة",$rt=()=>"Inicia un chat nuevo",Brt=()=>"नई चैट शुरू करें",Prt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Drt():t==="fa"?Lrt():t==="ar"?Irt():t==="es"?$rt():t==="hi"?Brt():Ort()}),Frt=()=>"Advanced",Hrt=()=>"高级",qrt=()=>"پیشرفته",Urt=()=>"متقدم",Grt=()=>"Avanzado",Vrt=()=>"उन्नत",YD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Hrt():t==="fa"?qrt():t==="ar"?Urt():t==="es"?Grt():t==="hi"?Vrt():Frt()}),Krt=()=>"Advanced · Connect GitHub",Wrt=()=>"高级 · 连接 GitHub",Qrt=()=>"پیشرفته · اتصال GitHub",Xrt=()=>"متقدم · ربط GitHub",Yrt=()=>"Avanzado · Conectar GitHub",Zrt=()=>"उन्नत · GitHub कनेक्ट करें",Jrt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Wrt():t==="fa"?Qrt():t==="ar"?Xrt():t==="es"?Yrt():t==="hi"?Zrt():Krt()}),est=()=>"Advanced · GitHub sync on",tst=()=>"高级 · GitHub 同步已开启",nst=()=>"پیشرفته · همگام‌سازی GitHub روشن است",rst=()=>"متقدم · مزامنة GitHub مفعّلة",sst=()=>"Avanzado · Sincronización con GitHub activada",ist=()=>"उन्नत · GitHub सिंक चालू",ast=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tst():t==="fa"?nst():t==="ar"?rst():t==="es"?sst():t==="hi"?ist():est()}),ost=()=>"Choose a different destination. A paper project needs a new or empty folder of its own.",cst=()=>"请选择其他位置。论文项目需要拥有独立的新文件夹或空文件夹。",lst=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",ust=()=>"اختر وجهة مختلفة. يحتاج مشروع الورقة إلى مجلد جديد أو فارغ خاص به.",_st=()=>"Elige otro destino. Un proyecto de paper necesita su propia carpeta nueva o vacía.",fst=()=>"अलग गंतव्य चुनें। पेपर प्रोजेक्ट को अपना एक नया या खाली फ़ोल्डर चाहिए।",dst=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cst():t==="fa"?lst():t==="ar"?ust():t==="es"?_st():t==="hi"?fst():ost()}),hst=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,pst=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,mst=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,gst=e=>`تغيير مجلد المشروع؛ المجلد الحالي: ${e==null?void 0:e.path}`,vst=e=>`Cambiar la carpeta del proyecto; carpeta actual: ${e==null?void 0:e.path}`,bst=e=>`प्रोजेक्ट फ़ोल्डर बदलें; मौजूदा फ़ोल्डर: ${e==null?void 0:e.path}`,yst=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?pst(e):t==="fa"?mst(e):t==="ar"?gst(e):t==="es"?vst(e):t==="hi"?bst(e):hst(e)}),xst=()=>"Choose an existing project folder",wst=()=>"选择现有项目文件夹",kst=()=>"انتخاب پوشهٔ موجود پروژه",Sst=()=>"اختر مجلد مشروع موجود",Cst=()=>"Elige una carpeta de proyecto existente",Est=()=>"एक मौजूदा प्रोजेक्ट फ़ोल्डर चुनें",nz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?wst():t==="fa"?kst():t==="ar"?Sst():t==="es"?Cst():t==="hi"?Est():xst()}),Nst=()=>"Choosing…",zst=()=>"正在选择…",jst=()=>"در حال انتخاب…",Tst=()=>"جارٍ الاختيار…",Ast=()=>"Eligiendo…",Rst=()=>"चुना जा रहा है…",Mst=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zst():t==="fa"?jst():t==="ar"?Tst():t==="es"?Ast():t==="hi"?Rst():Nst()}),Ost=()=>"Clone destination",Dst=()=>"克隆位置",Lst=()=>"مقصد کلون",Ist=()=>"وجهة الاستنساخ",$st=()=>"Destino del clon",Bst=()=>"क्लोन गंतव्य",Pst=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Dst():t==="fa"?Lst():t==="ar"?Ist():t==="es"?$st():t==="hi"?Bst():Ost()}),Fst=()=>"Clone paper project",Hst=()=>"克隆论文项目",qst=()=>"کلون پروژهٔ مقاله",Ust=()=>"استنساخ مشروع الورقة",Gst=()=>"Clonar proyecto del paper",Vst=()=>"पेपर प्रोजेक्ट क्लोन करें",Kst=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Hst():t==="fa"?qst():t==="ar"?Ust():t==="es"?Gst():t==="hi"?Vst():Fst()}),Wst=()=>"Create project",Qst=()=>"创建项目",Xst=()=>"ایجاد پروژه",Yst=()=>"إنشاء المشروع",Zst=()=>"Crear proyecto",Jst=()=>"प्रोजेक्ट बनाएं",rz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Qst():t==="fa"?Xst():t==="ar"?Yst():t==="es"?Zst():t==="hi"?Jst():Wst()}),eit=()=>"Creating…",tit=()=>"正在创建…",nit=()=>"در حال ایجاد…",rit=()=>"جارٍ الإنشاء…",sit=()=>"Creando…",iit=()=>"बनाया जा रहा है…",ait=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tit():t==="fa"?nit():t==="ar"?rit():t==="es"?sit():t==="hi"?iit():eit()}),oit=()=>"Choose a different destination. This path is a file, not a folder.",cit=()=>"请选择其他位置。此路径是文件,不是文件夹。",lit=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",uit=()=>"اختر وجهة مختلفة. هذا المسار ملف وليس مجلدًا.",_it=()=>"Elige otro destino. Esta ruta es un archivo, no una carpeta.",fit=()=>"अलग गंतव्य चुनें। यह पथ एक फ़ाइल है, फ़ोल्डर नहीं।",ew=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cit():t==="fa"?lit():t==="ar"?uit():t==="es"?_it():t==="hi"?fit():oit()}),dit=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",hit=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",pit=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",mit=()=>"يوجد مجلد هنا بالفعل. اختر اسمًا أو موقعًا مختلفًا، أو استخدم «مجلد موجود».",git=()=>"Ya existe una carpeta aquí. Elige otro nombre u otra ubicación, o usa Carpeta existente.",vit=()=>"यहाँ पहले से एक फ़ोल्डर मौजूद है। अलग नाम या स्थान चुनें, या मौजूदा फ़ोल्डर का इस्तेमाल करें।",sz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hit():t==="fa"?pit():t==="ar"?mit():t==="es"?git():t==="hi"?vit():dit()}),bit=()=>"Blank project",yit=()=>"空白项目",xit=()=>"پروژهٔ خالی",wit=()=>"مشروع فارغ",kit=()=>"Proyecto en blanco",Sit=()=>"खाली प्रोजेक्ट",Cit=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yit():t==="fa"?xit():t==="ar"?wit():t==="es"?kit():t==="hi"?Sit():bit()}),Eit=()=>"Cancel",Nit=()=>"取消",zit=()=>"لغو",jit=()=>"إلغاء",Tit=()=>"Cancelar",Ait=()=>"रद्द करें",Rit=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Nit():t==="fa"?zit():t==="ar"?jit():t==="es"?Tit():t==="hi"?Ait():Eit()}),Mit=()=>"Change",Oit=()=>"更改",Dit=()=>"تغییر",Lit=()=>"تغيير",Iit=()=>"Cambiar",$it=()=>"बदलें",Bit=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Oit():t==="fa"?Dit():t==="ar"?Lit():t==="es"?Iit():t==="hi"?$it():Mit()}),Pit=()=>"Change selected paper",Fit=()=>"更改所选论文",Hit=()=>"تغییر مقالهٔ انتخاب‌شده",qit=()=>"تغيير الورقة المحددة",Uit=()=>"Cambiar el paper seleccionado",Git=()=>"चयनित पेपर बदलें",Vit=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Fit():t==="fa"?Hit():t==="ar"?qit():t==="es"?Uit():t==="hi"?Git():Pit()}),Kit=()=>"Check out a Git branch before using this folder.",Wit=()=>"使用此文件夹前,请先检出一个 Git 分支。",Qit=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",Xit=()=>"انتقل إلى فرع Git قبل استخدام هذا المجلد.",Yit=()=>"Haz checkout de una rama de Git antes de usar esta carpeta.",Zit=()=>"इस फ़ोल्डर का उपयोग करने से पहले एक Git ब्रांच चेक आउट करें।",Jit=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Wit():t==="fa"?Qit():t==="ar"?Xit():t==="es"?Yit():t==="hi"?Zit():Kit()}),eat=()=>"Checking project location.",tat=()=>"正在检查项目位置。",nat=()=>"در حال بررسی محل پروژه.",rat=()=>"جارٍ التحقق من موقع المشروع.",sat=()=>"Comprobando la ubicación del proyecto.",iat=()=>"प्रोजेक्ट स्थान जाँचा जा रहा है।",iz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tat():t==="fa"?nat():t==="ar"?rat():t==="es"?sat():t==="hi"?iat():eat()}),aat=()=>"Existing folder",oat=()=>"现有文件夹",cat=()=>"پوشهٔ موجود",lat=()=>"مجلد موجود",uat=()=>"Carpeta existente",_at=()=>"मौजूदा फ़ोल्डर",fat=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?oat():t==="fa"?cat():t==="ar"?lat():t==="es"?uat():t==="hi"?_at():aat()}),dat=()=>"Experiment branches will be pushed to the remote GitHub repository.",hat=()=>"实验分支将推送到远程 GitHub 仓库。",pat=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",mat=()=>"ستُرفع فروع التجارب إلى مستودع GitHub البعيد.",gat=()=>"Las ramas de los experimentos se subirán al repositorio remoto de GitHub.",vat=()=>"प्रयोग ब्रांच रिमोट GitHub रिपॉज़िटरी पर पुश की जाएंगी।",bat=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hat():t==="fa"?pat():t==="ar"?mat():t==="es"?gat():t==="hi"?vat():dat()}),yat=()=>"From a paper",xat=()=>"从论文创建",wat=()=>"از یک مقاله",kat=()=>"من ورقة بحثية",Sat=()=>"A partir de un paper",Cat=()=>"एक पेपर से",Eat=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xat():t==="fa"?wat():t==="ar"?kat():t==="es"?Sat():t==="hi"?Cat():yat()}),Nat=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",zat=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",jat=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",Tat=()=>"‏Git مطلوب للتجارب لكنه غير مثبّت. ثبّت Git ثم أعد تشغيل OpenResearch.",Aat=()=>"Git es necesario para los experimentos, pero no está instalado. Instala Git y reinicia OpenResearch.",Rat=()=>"प्रयोगों के लिए Git ज़रूरी है पर इंस्टॉल नहीं है। Git इंस्टॉल करें, फिर OpenResearch फिर से शुरू करें।",Mat=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zat():t==="fa"?jat():t==="ar"?Tat():t==="es"?Aat():t==="hi"?Rat():Nat()}),Oat=()=>"my-research",Dat=()=>"my-research",Lat=()=>"my-research",Iat=()=>"my-research",$at=()=>"mi-investigacion",Bat=()=>"मेरा-शोध",az=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Dat():t==="fa"?Lat():t==="ar"?Iat():t==="es"?$at():t==="hi"?Bat():Oat()}),Pat=()=>"No papers found. Try an arXiv ID, URL, or a different title.",Fat=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",Hat=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",qat=()=>"لم يُعثر على أوراق. جرّب معرّف arXiv أو رابطًا أو عنوانًا مختلفًا.",Uat=()=>"No se encontraron papers. Prueba con un ID de arXiv, una URL u otro título.",Gat=()=>"कोई पेपर नहीं मिला। एक arXiv ID, URL, या अलग शीर्षक आज़माएं।",Vat=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Fat():t==="fa"?Hat():t==="ar"?qat():t==="es"?Uat():t==="hi"?Gat():Pat()}),Kat=()=>"No public repository found on alphaXiv",Wat=()=>"在 alphaXiv 上未找到公开仓库",Qat=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",Xat=()=>"لم يُعثر على مستودع عام على alphaXiv",Yat=()=>"No se encontró ningún repositorio público en alphaXiv",Zat=()=>"alphaXiv पर कोई सार्वजनिक रिपॉज़िटरी नहीं मिली",Jat=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Wat():t==="fa"?Qat():t==="ar"?Xat():t==="es"?Yat():t==="hi"?Zat():Kat()}),eot=()=>"OpenResearch will start a blank project with this paper's PDF.",tot=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",not=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",rot=()=>"سيبدأ OpenResearch مشروعًا فارغًا مع ملف PDF لهذه الورقة.",sot=()=>"OpenResearch creará un proyecto en blanco con el PDF de este paper.",iot=()=>"OpenResearch इस पेपर की PDF के साथ एक खाली प्रोजेक्ट शुरू करेगा।",aot=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tot():t==="fa"?not():t==="ar"?rot():t==="es"?sot():t==="hi"?iot():eot()}),oot=()=>"Paper",cot=()=>"论文",lot=()=>"مقاله",uot=()=>"ورقة بحثية",_ot=()=>"Paper",fot=()=>"पेपर",dot=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cot():t==="fa"?lot():t==="ar"?uot():t==="es"?_ot():t==="hi"?fot():oot()}),hot=()=>"Project location",pot=()=>"项目位置",mot=()=>"محل پروژه",got=()=>"موقع المشروع",vot=()=>"Ubicación del proyecto",bot=()=>"प्रोजेक्ट स्थान",tw=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pot():t==="fa"?mot():t==="ar"?got():t==="es"?vot():t==="hi"?bot():hot()}),yot=()=>"Project name",xot=()=>"项目名称",wot=()=>"نام پروژه",kot=()=>"اسم المشروع",Sot=()=>"Nombre del proyecto",Cot=()=>"प्रोजेक्ट नाम",oz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xot():t==="fa"?wot():t==="ar"?kot():t==="es"?Sot():t==="hi"?Cot():yot()}),Eot=()=>"Search for a paper by arXiv ID, URL, or title",Not=()=>"按 arXiv ID、网址或标题搜索论文",zot=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",jot=()=>"ابحث عن ورقة بمعرّف arXiv أو رابط أو عنوان",Tot=()=>"Busca un paper por ID de arXiv, URL o título",Aot=()=>"arXiv ID, URL, या शीर्षक से पेपर खोजें",Rot=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Not():t==="fa"?zot():t==="ar"?jot():t==="es"?Tot():t==="hi"?Aot():Eot()}),Mot=()=>"Sync experiments to GitHub",Oot=()=>"将实验同步到 GitHub",Dot=()=>"همگام‌سازی آزمایش‌ها با GitHub",Lot=()=>"مزامنة التجارب مع GitHub",Iot=()=>"Sincronizar experimentos con GitHub",$ot=()=>"प्रयोग GitHub पर सिंक करें",Bot=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Oot():t==="fa"?Dot():t==="ar"?Lot():t==="es"?Iot():t==="hi"?$ot():Mot()}),Pot=()=>"That folder no longer exists. Choose it again.",Fot=()=>"该文件夹已不存在。请重新选择。",Hot=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",qot=()=>"لم يعد ذلك المجلد موجودًا. اختره مجددًا.",Uot=()=>"Esa carpeta ya no existe. Vuelve a elegirla.",Got=()=>"वह फ़ोल्डर अब मौजूद नहीं है। इसे फिर से चुनें।",Vot=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Fot():t==="fa"?Hot():t==="ar"?qot():t==="es"?Uot():t==="hi"?Got():Pot()}),Kot=()=>"The selected folder contains an invalid Git repository.",Wot=()=>"所选文件夹包含无效的 Git 仓库。",Qot=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",Xot=()=>"يحتوي المجلد المحدد على مستودع Git غير صالح.",Yot=()=>"La carpeta seleccionada contiene un repositorio de Git no válido.",Zot=()=>"चयनित फ़ोल्डर में एक अमान्य Git रिपॉज़िटरी है।",Jot=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Wot():t==="fa"?Qot():t==="ar"?Xot():t==="es"?Yot():t==="hi"?Zot():Kot()}),ect=()=>"The selected path is not a folder.",tct=()=>"所选路径不是文件夹。",nct=()=>"مسیر انتخاب‌شده پوشه نیست.",rct=()=>"المسار المحدد ليس مجلدًا.",sct=()=>"La ruta seleccionada no es una carpeta.",ict=()=>"चयनित पथ एक फ़ोल्डर नहीं है।",act=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tct():t==="fa"?nct():t==="ar"?rct():t==="es"?sct():t==="hi"?ict():ect()}),oct=e=>`Checking ${e==null?void 0:e.repository}.`,cct=e=>`正在检查 ${e==null?void 0:e.repository}。`,lct=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,uct=e=>`جارٍ التحقق من ${e==null?void 0:e.repository}.`,_ct=e=>`Comprobando ${e==null?void 0:e.repository}.`,fct=e=>`${e==null?void 0:e.repository} जाँची जा रही है।`,dct=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?cct(e):t==="fa"?lct(e):t==="ar"?uct(e):t==="es"?_ct(e):t==="hi"?fct(e):oct(e)}),hct=e=>`Creates ${e==null?void 0:e.repository}.`,pct=e=>`将创建 ${e==null?void 0:e.repository}。`,mct=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,gct=e=>`ينشئ ${e==null?void 0:e.repository}.`,vct=e=>`Crea ${e==null?void 0:e.repository}.`,bct=e=>`${e==null?void 0:e.repository} बनाता है।`,yct=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?pct(e):t==="fa"?mct(e):t==="ar"?gct(e):t==="es"?vct(e):t==="hi"?bct(e):hct(e)}),xct=e=>`Pushes to ${e==null?void 0:e.repository}.`,wct=e=>`将推送到 ${e==null?void 0:e.repository}。`,kct=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,Sct=e=>`يرفع التغييرات إلى ${e==null?void 0:e.repository}.`,Cct=e=>`Sube los cambios a ${e==null?void 0:e.repository}.`,Ect=e=>`${e==null?void 0:e.repository} पर पुश करता है।`,Nct=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?wct(e):t==="fa"?kct(e):t==="ar"?Sct(e):t==="es"?Cct(e):t==="hi"?Ect(e):xct(e)}),zct=()=>"Project location is required.",jct=()=>"必须填写项目位置。",Tct=()=>"محل پروژه الزامی است.",Act=()=>"موقع المشروع مطلوب.",Rct=()=>"La ubicación del proyecto es obligatoria.",Mct=()=>"प्रोजेक्ट स्थान ज़रूरी है।",cz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jct():t==="fa"?Tct():t==="ar"?Act():t==="es"?Rct():t==="hi"?Mct():zct()}),Oct=()=>"Choose a different destination. The paper repository needs a new or empty folder.",Dct=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",Lct=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",Ict=()=>"اختر وجهة مختلفة. يحتاج مستودع الورقة إلى مجلد جديد أو فارغ.",$ct=()=>"Elige otro destino. El repositorio del paper necesita una carpeta nueva o vacía.",Bct=()=>"अलग गंतव्य चुनें। पेपर रिपॉज़िटरी को एक नए या खाली फ़ोल्डर की ज़रूरत है।",lz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Dct():t==="fa"?Lct():t==="ar"?Ict():t==="es"?$ct():t==="hi"?Bct():Oct()}),Pct=()=>"A linked public code repository is cloned without credentials.",Fct=()=>"关联的公开代码仓库无需凭据即可克隆。",Hct=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",qct=()=>"يُستنسخ مستودع شيفرة عام مرتبط دون بيانات اعتماد.",Uct=()=>"El repositorio de código público vinculado se clona sin credenciales.",Gct=()=>"एक लिंक की गई सार्वजनिक कोड रिपॉज़िटरी बिना क्रेडेंशियल के क्लोन की जाती है।",Vct=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Fct():t==="fa"?Hct():t==="ar"?qct():t==="es"?Uct():t==="hi"?Gct():Pct()}),Kct=e=>`Run ${e==null?void 0:e.command} before creating the project.`,Wct=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,Qct=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,Xct=e=>`نفّذ ${e==null?void 0:e.command} قبل إنشاء المشروع.`,Yct=e=>`Ejecuta ${e==null?void 0:e.command} antes de crear el proyecto.`,Zct=e=>`प्रोजेक्ट बनाने से पहले ${e==null?void 0:e.command} चलाएं।`,Jct=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Wct(e):t==="fa"?Qct(e):t==="ar"?Xct(e):t==="es"?Yct(e):t==="hi"?Zct(e):Kct(e)}),elt=()=>"Searching alphaXiv…",tlt=()=>"正在搜索 alphaXiv…",nlt=()=>"در حال جست‌وجوی alphaXiv…",rlt=()=>"جارٍ البحث في alphaXiv…",slt=()=>"Buscando en alphaXiv…",ilt=()=>"alphaXiv खोजा जा रहा है…",alt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tlt():t==="fa"?nlt():t==="ar"?rlt():t==="es"?slt():t==="hi"?ilt():elt()}),olt=()=>"Use folder",clt=()=>"使用文件夹",llt=()=>"استفاده از پوشه",ult=()=>"استخدام المجلد",_lt=()=>"Usar carpeta",flt=()=>"फ़ोल्डर इस्तेमाल करें",dlt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?clt():t==="fa"?llt():t==="ar"?ult():t==="es"?_lt():t==="hi"?flt():olt()}),hlt=()=>"Can’t reach OpenResearch. This page is no longer live.",plt=()=>"无法连接 OpenResearch。此页面已不再实时同步。",mlt=()=>"دسترسی به OpenResearch ممکن نیست. این صفحه دیگر همگام نیست.",glt=()=>"تعذّر الاتصال بـ OpenResearch. لم تعد هذه الصفحة تُحدَّث تلقائيًا.",vlt=()=>"No se puede conectar con OpenResearch. Esta página ya no se actualiza.",blt=()=>"OpenResearch तक नहीं पहुँच सके। यह पेज अब लाइव नहीं है।",f3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?plt():t==="fa"?mlt():t==="ar"?glt():t==="es"?vlt():t==="hi"?blt():hlt()}),ylt=()=>"A workspace for your research agents",xlt=()=>"面向研究智能体的工作空间",wlt=()=>"فضای کاری برای عامل‌های پژوهشی شما",klt=()=>"مساحة عمل لوكلاء بحثك",Slt=()=>"Un espacio de trabajo para tus agentes de investigación",Clt=()=>"आपके शोध एजेंटों के लिए एक वर्कस्पेस",Elt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xlt():t==="fa"?wlt():t==="ar"?klt():t==="es"?Slt():t==="hi"?Clt():ylt()}),Nlt=()=>"Add papers that represent your research interests, including papers by other authors.",zlt=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",jlt=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",Tlt=()=>"أضِف أوراقًا تمثّل اهتماماتك البحثية، بما في ذلك أوراق لمؤلفين آخرين.",Alt=()=>"Añade papers que representen tus intereses de investigación, incluidos papers de otros autores.",Rlt=()=>"ऐसे पेपर जोड़ें जो आपकी शोध रुचियों को दर्शाते हों, चाहे वे किसी और लेखक के ही क्यों न हों।",Mlt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zlt():t==="fa"?jlt():t==="ar"?Tlt():t==="es"?Alt():t==="hi"?Rlt():Nlt()}),Olt=()=>"API key",Dlt=()=>"API 密钥",Llt=()=>"کلید API",Ilt=()=>"مفتاح API",$lt=()=>"Clave de API",Blt=()=>"API की",Zk=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Dlt():t==="fa"?Llt():t==="ar"?Ilt():t==="es"?$lt():t==="hi"?Blt():Olt()}),Plt=()=>"AI/ML",Flt=()=>"人工智能与机器学习",Hlt=()=>"هوش مصنوعی و یادگیری ماشین",qlt=()=>"الذكاء الاصطناعي/تعلّم الآلة",Ult=()=>"IA/ML",Glt=()=>"AI/ML",Vlt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Flt():t==="fa"?Hlt():t==="ar"?qlt():t==="es"?Ult():t==="hi"?Glt():Plt()}),Klt=()=>"Biology",Wlt=()=>"生物学",Qlt=()=>"زیست‌شناسی",Xlt=()=>"الأحياء",Ylt=()=>"Biología",Zlt=()=>"जीव विज्ञान",Jlt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Wlt():t==="fa"?Qlt():t==="ar"?Xlt():t==="es"?Ylt():t==="hi"?Zlt():Klt()}),eut=()=>"Other",tut=()=>"其他",nut=()=>"سایر",rut=()=>"أخرى",sut=()=>"Otra",iut=()=>"अन्य",aut=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tut():t==="fa"?nut():t==="ar"?rut():t==="es"?sut():t==="hi"?iut():eut()}),out=()=>"Physics",cut=()=>"物理学",lut=()=>"فیزیک",uut=()=>"الفيزياء",_ut=()=>"Física",fut=()=>"भौतिकी",dut=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cut():t==="fa"?lut():t==="ar"?uut():t==="es"?_ut():t==="hi"?fut():out()}),hut=()=>"Back",put=()=>"返回",mut=()=>"بازگشت",gut=()=>"رجوع",vut=()=>"Atrás",but=()=>"वापस",uz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?put():t==="fa"?mut():t==="ar"?gut():t==="es"?vut():t==="hi"?but():hut()}),yut=()=>"Check failed",xut=()=>"检查失败",wut=()=>"بررسی ناموفق بود",kut=()=>"فشل الفحص",Sut=()=>"Error en la comprobación",Cut=()=>"जाँच विफल",Eut=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xut():t==="fa"?wut():t==="ar"?kut():t==="es"?Sut():t==="hi"?Cut():yut()}),Nut=()=>"Checking",zut=()=>"正在检查",jut=()=>"در حال بررسی",Tut=()=>"جارٍ الفحص",Aut=()=>"Comprobando",Rut=()=>"जाँचा जा रहा है",nf=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zut():t==="fa"?jut():t==="ar"?Tut():t==="es"?Aut():t==="hi"?Rut():Nut()}),Mut=()=>"Checking Git…",Out=()=>"正在检查 Git…",Dut=()=>"در حال بررسی Git…",Lut=()=>"جارٍ فحص Git…",Iut=()=>"Comprobando Git…",$ut=()=>"Git जाँचा जा रहा है…",But=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Out():t==="fa"?Dut():t==="ar"?Lut():t==="es"?Iut():t==="hi"?$ut():Mut()}),Put=()=>"Choose a coding agent",Fut=()=>"选择编程智能体",Hut=()=>"یک عامل کدنویسی انتخاب کنید",qut=()=>"اختر وكيل برمجة",Uut=()=>"Elige un agente de programación",Gut=()=>"एक कोडिंग एजेंट चुनें",Vut=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Fut():t==="fa"?Hut():t==="ar"?qut():t==="es"?Uut():t==="hi"?Gut():Put()}),Kut=()=>"Choose a coding agent to continue.",Wut=()=>"选择一个编程智能体以继续。",Qut=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",Xut=()=>"اختر وكيل برمجة للمتابعة.",Yut=()=>"Elige un agente de programación para continuar.",Zut=()=>"जारी रखने के लिए एक कोडिंग एजेंट चुनें।",Jut=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Wut():t==="fa"?Qut():t==="ar"?Xut():t==="es"?Yut():t==="hi"?Zut():Kut()}),e_t=()=>"Choose another coding agent",t_t=()=>"选择其他编程智能体",n_t=()=>"انتخاب یک عامل برنامه‌نویسی دیگر",r_t=()=>"اختيار وكيل برمجة آخر",s_t=()=>"Elegir otro agente de programación",i_t=()=>"दूसरा कोडिंग एजेंट चुनें",a_t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?t_t():t==="fa"?n_t():t==="ar"?r_t():t==="es"?s_t():t==="hi"?i_t():e_t()}),o_t=()=>"Choose at least one research area to continue.",c_t=()=>"请至少选择一个研究领域后再继续。",l_t=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",u_t=()=>"اختر مجالًا بحثيًا واحدًا على الأقل للمتابعة.",__t=()=>"Elige al menos un área de investigación para continuar.",f_t=()=>"जारी रखने के लिए कम से कम एक शोध क्षेत्र चुनें।",d_t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?c_t():t==="fa"?l_t():t==="ar"?u_t():t==="es"?__t():t==="hi"?f_t():o_t()}),h_t=()=>"Choose one or more.",p_t=()=>"请选择一项或多项。",m_t=()=>"یک یا چند مورد را انتخاب کنید.",g_t=()=>"اختر واحدًا أو أكثر.",v_t=()=>"Elige una o varias.",b_t=()=>"एक या अधिक चुनें।",y_t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?p_t():t==="fa"?m_t():t==="ar"?g_t():t==="es"?v_t():t==="hi"?b_t():h_t()}),x_t=()=>"Choose your preferred coding agent",w_t=()=>"请选择首选编程智能体",k_t=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",S_t=()=>"اختر وكيل البرمجة المفضّل لديك",C_t=()=>"Elige tu agente de programación preferido",E_t=()=>"अपना पसंदीदा कोडिंग एजेंट चुनें",N_t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?w_t():t==="fa"?k_t():t==="ar"?S_t():t==="es"?C_t():t==="hi"?E_t():x_t()}),z_t=()=>"Consolidate your research",j_t=()=>"集中管理研究",T_t=()=>"پژوهش خود را یکپارچه کنید",A_t=()=>"وحّد أبحاثك",R_t=()=>"Consolida tu investigación",M_t=()=>"अपने शोध को एक जगह लाएं",O_t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?j_t():t==="fa"?T_t():t==="ar"?A_t():t==="es"?R_t():t==="hi"?M_t():z_t()}),D_t=()=>"Continue",L_t=()=>"继续",I_t=()=>"ادامه",$_t=()=>"متابعة",B_t=()=>"Continuar",P_t=()=>"जारी रखें",_z=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?L_t():t==="fa"?I_t():t==="ar"?$_t():t==="es"?B_t():t==="hi"?P_t():D_t()}),F_t=()=>"Describe your research area to continue.",H_t=()=>"请描述你的研究领域后再继续。",q_t=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",U_t=()=>"صِف مجالك البحثي للمتابعة.",G_t=()=>"Describe tu área de investigación para continuar.",V_t=()=>"जारी रखने के लिए अपना शोध क्षेत्र बताएं।",K_t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?H_t():t==="fa"?q_t():t==="ar"?U_t():t==="es"?G_t():t==="hi"?V_t():F_t()}),W_t=()=>"Detecting Claude Code, Codex, OpenCode, Cursor, Antigravity…",Q_t=()=>"正在检测 Claude Code、Codex、OpenCode、Cursor、Antigravity…",X_t=()=>"در حال شناسایی Claude Code، Codex، OpenCode و Cursor و Antigravity…",Y_t=()=>"جارٍ اكتشاف Claude Code وCodex وOpenCode وCursor وAntigravity…",Z_t=()=>"Detectando Claude Code, Codex, OpenCode, Cursor, Google Antigravity…",J_t=()=>"Claude Code, Codex, OpenCode, Cursor, Google Antigravity पहचाने जा रहे हैं…",eft=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Q_t():t==="fa"?X_t():t==="ar"?Y_t():t==="es"?Z_t():t==="hi"?J_t():W_t()}),tft=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",nft=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",rft=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",sft=()=>"مثال: أعمل على تعلّم معزّز عالي الكفاءة في العيّنات لِما بعد تدريب نماذج اللغة الكبيرة، مع التركيز على الطرق التي لا تعتمد على نماذج المكافأة.",ift=()=>"p. ej., trabajo en RL eficiente en muestras para el post-entrenamiento de LLM, centrado en métodos sin modelo de recompensa.",aft=()=>"जैसे: मैं LLM पोस्ट-ट्रेनिंग के लिए सैंपल-एफ़िशिएंट RL पर काम करता/करती हूँ, रिवॉर्ड-मॉडल-फ्री तरीकों पर ध्यान केंद्रित करते हुए।",oft=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nft():t==="fa"?rft():t==="ar"?sft():t==="es"?ift():t==="hi"?aft():tft()}),cft=()=>"Error details",lft=()=>"错误详情",uft=()=>"جزئیات خطا",_ft=()=>"تفاصيل الخطأ",fft=()=>"Detalles del error",dft=()=>"त्रुटि विवरण",hft=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lft():t==="fa"?uft():t==="ar"?_ft():t==="es"?fft():t==="hi"?dft():cft()}),pft=()=>"Everything stays local",mft=()=>"一切都保留在本地",gft=()=>"همه‌چیز محلی می‌ماند",vft=()=>"كل شيء يبقى محليًا",bft=()=>"Todo se queda en local",yft=()=>"सब कुछ लोकल ही रहता है",xft=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?mft():t==="fa"?gft():t==="ar"?vft():t==="es"?bft():t==="hi"?yft():pft()}),wft=()=>"Get started",kft=()=>"开始使用",Sft=()=>"شروع",Cft=()=>"ابدأ الآن",Eft=()=>"Empezar",Nft=()=>"शुरू करें",zft=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?kft():t==="fa"?Sft():t==="ar"?Cft():t==="es"?Eft():t==="hi"?Nft():wft()}),jft=()=>"Git is required for local experiments. Install Git, then re-check.",Tft=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",Aft=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",Rft=()=>"‏Git مطلوب للتجارب المحلية. ثبّت Git ثم أعد الفحص.",Mft=()=>"Git es necesario para los experimentos locales. Instala Git y vuelve a comprobarlo.",Oft=()=>"स्थानीय प्रयोगों के लिए Git ज़रूरी है। Git इंस्टॉल करें, फिर फिर से जाँचें।",fz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Tft():t==="fa"?Aft():t==="ar"?Rft():t==="es"?Mft():t==="hi"?Oft():jft()}),Dft=()=>"Ground your agents",Lft=()=>"为智能体提供可靠依据",Ift=()=>"عامل‌هایتان را به منابع متصل کنید",$ft=()=>"زوّد وكلاءك بأساس بحثي",Bft=()=>"Dale contexto a tus agentes",Pft=()=>"अपने एजेंटों को आधार दें",Fft=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Lft():t==="fa"?Ift():t==="ar"?$ft():t==="es"?Bft():t==="hi"?Pft():Dft()}),Hft=()=>"Install broken",qft=()=>"安装损坏",Uft=()=>"نصب خراب است",Gft=()=>"التثبيت معطوب",Vft=()=>"Instalación dañada",Kft=()=>"इंस्टॉल खराब है",Wft=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qft():t==="fa"?Uft():t==="ar"?Gft():t==="es"?Vft():t==="hi"?Kft():Hft()}),Qft=()=>"Install Git to continue",Xft=()=>"请安装 Git 后再继续",Yft=()=>"برای ادامه Git را نصب کنید",Zft=()=>"ثبّت Git للمتابعة",Jft=()=>"Instala Git para continuar",edt=()=>"जारी रखने के लिए Git इंस्टॉल करें",tdt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Xft():t==="fa"?Yft():t==="ar"?Zft():t==="es"?Jft():t==="hi"?edt():Qft()}),ndt=()=>"Loading account details…",rdt=()=>"正在加载账户信息…",sdt=()=>"در حال بارگذاری اطلاعات حساب…",idt=()=>"جارٍ تحميل تفاصيل الحساب…",adt=()=>"Cargando los datos de la cuenta…",odt=()=>"खाता विवरण लोड हो रहा है…",cdt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rdt():t==="fa"?sdt():t==="ar"?idt():t==="es"?adt():t==="hi"?odt():ndt()}),ldt=()=>"Local Git",udt=()=>"本地 Git",_dt=()=>"Git محلی",fdt=()=>"Git محلي",ddt=()=>"Git local",hdt=()=>"लोकल Git",pdt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?udt():t==="fa"?_dt():t==="ar"?fdt():t==="es"?ddt():t==="hi"?hdt():ldt()}),mdt=()=>"Install needed",gdt=()=>"需要安装",vdt=()=>"نیاز به نصب",bdt=()=>"التثبيت مطلوب",ydt=()=>"No detectado",xdt=()=>"इंस्टॉल ज़रूरी है",dz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gdt():t==="fa"?vdt():t==="ar"?bdt():t==="es"?ydt():t==="hi"?xdt():mdt()}),wdt=()=>"Not found",kdt=()=>"未找到",Sdt=()=>"پیدا نشد",Cdt=()=>"غير موجود",Edt=()=>"No encontrado",Ndt=()=>"नहीं मिला",ZD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?kdt():t==="fa"?Sdt():t==="ar"?Cdt():t==="es"?Edt():t==="hi"?Ndt():wdt()}),zdt=()=>"Signed out",jdt=()=>"未登录",Tdt=()=>"وارد نشده",Adt=()=>"غير مسجل الدخول",Rdt=()=>"Sin iniciar sesión",Mdt=()=>"साइन आउट",JD=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jdt():t==="fa"?Tdt():t==="ar"?Adt():t==="es"?Rdt():t==="hi"?Mdt():zdt()}),Odt=()=>"OpenResearch uses a coding agent already installed on this machine.",Ddt=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",Ldt=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",Idt=()=>"يستخدم OpenResearch وكيل برمجة مثبّتًا مسبقًا على هذا الجهاز.",$dt=()=>"OpenResearch usa un agente de programación que ya esté instalado en este equipo.",Bdt=()=>"OpenResearch इस मशीन पर पहले से इंस्टॉल किसी कोडिंग एजेंट का उपयोग करता है।",Pdt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ddt():t==="fa"?Ldt():t==="ar"?Idt():t==="es"?$dt():t==="hi"?Bdt():Odt()}),Fdt=()=>"Couldn’t verify OpenCode is ready. Retry to check its installation and models.",Hdt=()=>"无法确认 OpenCode 已就绪。请重试以检查安装和模型。",qdt=()=>"آماده بودن OpenCode تأیید نشد. برای بررسی نصب و مدل‌ها دوباره تلاش کنید.",Udt=()=>"تعذّر التحقق من جاهزية OpenCode. أعد المحاولة للتحقق من التثبيت والنماذج.",Gdt=()=>"No se pudo verificar que OpenCode esté listo. Vuelve a intentarlo para comprobar su instalación y sus modelos.",Vdt=()=>"यह सत्यापित नहीं हो सका कि OpenCode तैयार है। इसके इंस्टॉलेशन और मॉडल जाँचने के लिए फिर से कोशिश करें।",Kdt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Hdt():t==="fa"?qdt():t==="ar"?Udt():t==="es"?Gdt():t==="hi"?Vdt():Fdt()}),Wdt=()=>"Other research area",Qdt=()=>"其他研究领域",Xdt=()=>"حوزهٔ پژوهشی دیگر",Ydt=()=>"مجال بحثي آخر",Zdt=()=>"Otra área de investigación",Jdt=()=>"अन्य शोध क्षेत्र",eht=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Qdt():t==="fa"?Xdt():t==="ar"?Ydt():t==="es"?Zdt():t==="hi"?Jdt():Wdt()}),tht=()=>"Re-check",nht=()=>"重新检查",rht=()=>"بررسی دوباره",sht=()=>"إعادة الفحص",iht=()=>"Volver a comprobar",aht=()=>"फिर से जाँचें",Nv=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nht():t==="fa"?rht():t==="ar"?sht():t==="es"?iht():t==="hi"?aht():tht()}),oht=()=>"Ready",cht=()=>"已就绪",lht=()=>"آماده",uht=()=>"جاهز",_ht=()=>"Listo",fht=()=>"तैयार",Jk=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cht():t==="fa"?lht():t==="ar"?uht():t==="es"?_ht():t==="hi"?fht():oht()}),dht=()=>"Re-check Git before continuing",hht=()=>"请重新检查 Git 后再继续",pht=()=>"پیش از ادامه Git را دوباره بررسی کنید",mht=()=>"أعد فحص Git قبل المتابعة",ght=()=>"Vuelve a comprobar Git antes de continuar",vht=()=>"जारी रखने से पहले Git फिर से जाँचें",bht=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hht():t==="fa"?pht():t==="ar"?mht():t==="es"?ght():t==="hi"?vht():dht()}),yht=()=>"Representative papers",xht=()=>"代表性论文",wht=()=>"مقاله‌های شاخص",kht=()=>"أوراق تمثّل اهتماماتك البحثية",Sht=()=>"Papers representativos",Cht=()=>"प्रतिनिधि पेपर",Eht=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xht():t==="fa"?wht():t==="ar"?kht():t==="es"?Sht():t==="hi"?Cht():yht()}),Nht=()=>"Research background",zht=()=>"研究背景",jht=()=>"پیشینهٔ پژوهشی",Tht=()=>"الخلفية البحثية",Aht=()=>"Trayectoria de investigación",Rht=()=>"शोध पृष्ठभूमि",Mht=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zht():t==="fa"?jht():t==="ar"?Tht():t==="es"?Aht():t==="hi"?Rht():Nht()}),Oht=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",Dht=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",Lht=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",Iht=()=>"تعذّر الوصول إلى orx. تأكد من أنه لا يزال يعمل، ثم أعد الفحص.",$ht=()=>"No se pudo conectar con orx. Comprueba que sigue en ejecución y vuelve a comprobarlo.",Bht=()=>"orx तक नहीं पहुँच सके। जाँचें कि यह अभी भी चल रहा है, फिर फिर से जाँचें।",nw=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Dht():t==="fa"?Lht():t==="ar"?Iht():t==="es"?$ht():t==="hi"?Bht():Oht()}),Pht=()=>"Search alphaXiv by title to link a paper…",Fht=()=>"按标题搜索 alphaXiv 以关联论文…",Hht=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",qht=()=>"ابحث في alphaXiv بالعنوان لربط ورقة…",Uht=()=>"Busca en alphaXiv por título para vincular un paper…",Ght=()=>"एक पेपर लिंक करने के लिए शीर्षक से alphaXiv खोजें…",Vht=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Fht():t==="fa"?Hht():t==="ar"?qht():t==="es"?Uht():t==="hi"?Ght():Pht()}),Kht=()=>"Searching alphaXiv…",Wht=()=>"正在搜索 alphaXiv…",Qht=()=>"در حال جست‌وجوی alphaXiv…",Xht=()=>"جارٍ البحث في alphaXiv…",Yht=()=>"Buscando en alphaXiv…",Zht=()=>"alphaXiv खोजा जा रहा है…",Jht=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Wht():t==="fa"?Qht():t==="ar"?Xht():t==="es"?Yht():t==="hi"?Zht():Kht()}),ept=()=>"Selected",tpt=()=>"已选择",npt=()=>"انتخاب‌شده",rpt=()=>"محدد",spt=()=>"Seleccionado",ipt=()=>"चयनित",apt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tpt():t==="fa"?npt():t==="ar"?rpt():t==="es"?spt():t==="hi"?ipt():ept()}),opt=()=>"Local model unavailable",cpt=()=>"本地模型不可用",lpt=()=>"مدل محلی در دسترس نیست",upt=()=>"النموذج المحلي غير متاح",_pt=()=>"Modelo local no disponible",fpt=()=>"लोकल मॉडल उपलब्ध नहीं",eL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cpt():t==="fa"?lpt():t==="ar"?upt():t==="es"?_pt():t==="hi"?fpt():opt()}),dpt=()=>"Setting things up…",hpt=()=>"正在设置…",ppt=()=>"در حال راه‌اندازی…",mpt=()=>"جارٍ التهيئة…",gpt=()=>"Preparando todo…",vpt=()=>"सेट अप किया जा रहा है…",bpt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hpt():t==="fa"?ppt():t==="ar"?mpt():t==="es"?gpt():t==="hi"?vpt():dpt()}),ypt=()=>"Connect a local model or sign in to a coding agent to continue",xpt=()=>"连接本地模型或登录编码智能体以继续",wpt=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل کدنویسی وارد شوید",kpt=()=>"اربط نموذجًا محليًا أو سجّل الدخول إلى وكيل برمجة للمتابعة",Spt=()=>"Conecta un modelo local o inicia sesión en un agente de programación para continuar",Cpt=()=>"जारी रखने के लिए एक लोकल मॉडल कनेक्ट करें या किसी कोडिंग एजेंट में साइन इन करें",Ept=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xpt():t==="fa"?wpt():t==="ar"?kpt():t==="es"?Spt():t==="hi"?Cpt():ypt()}),Npt=()=>"Connect a local model or sign in to an agent to continue.",zpt=()=>"连接本地模型或登录一个智能体以继续。",jpt=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل وارد شوید.",Tpt=()=>"اربط نموذجًا محليًا أو سجّل الدخول إلى وكيل للمتابعة.",Apt=()=>"Conecta un modelo local o inicia sesión en un agente para continuar.",Rpt=()=>"जारी रखने के लिए एक लोकल मॉडल कनेक्ट करें या किसी एजेंट में साइन इन करें।",Mpt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zpt():t==="fa"?jpt():t==="ar"?Tpt():t==="es"?Apt():t==="hi"?Rpt():Npt()}),Opt=()=>"Signed in",Dpt=()=>"已登录",Lpt=()=>"وارد شده",Ipt=()=>"تم تسجيل الدخول",$pt=()=>"Sesión iniciada",Bpt=()=>"साइन इन",Ppt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Dpt():t==="fa"?Lpt():t==="ar"?Ipt():t==="es"?$pt():t==="hi"?Bpt():Opt()}),Fpt=()=>"Connected to alphaXiv, bioRxiv, OpenAlex, and PubMed to ground your agents in the latest research.",Hpt=()=>"已连接 alphaXiv、bioRxiv、OpenAlex 和 PubMed,让智能体以最新研究为依据。",qpt=()=>"به alphaXiv، bioRxiv، OpenAlex و PubMed متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",Upt=()=>"متصل بـ alphaXiv وbioRxiv وOpenAlex وPubMed ليستند وكلاؤك إلى أحدث الأبحاث.",Gpt=()=>"Conectado a alphaXiv, bioRxiv, OpenAlex y PubMed para que tus agentes trabajen con la investigación más reciente.",Vpt=()=>"आपके एजेंटों को नवीनतम शोध पर आधारित रखने के लिए alphaXiv, bioRxiv, OpenAlex और PubMed से कनेक्ट किया गया।",Kpt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Hpt():t==="fa"?qpt():t==="ar"?Upt():t==="es"?Gpt():t==="hi"?Vpt():Fpt()}),Wpt=()=>"· Step 1 of 2",Qpt=()=>"· 第 1 步,共 2 步",Xpt=()=>"· مرحلهٔ ۱ از ۲",Ypt=()=>"· الخطوة 1 من 2",Zpt=()=>"· Paso 1 de 2",Jpt=()=>"· चरण 1 / 2",e0t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Qpt():t==="fa"?Xpt():t==="ar"?Ypt():t==="es"?Zpt():t==="hi"?Jpt():Wpt()}),t0t=()=>"· Step 2 of 2",n0t=()=>"· 第 2 步,共 2 步",r0t=()=>"· مرحلهٔ ۲ از ۲",s0t=()=>"· الخطوة 2 من 2",i0t=()=>"· Paso 2 de 2",a0t=()=>"· चरण 2 / 2",o0t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?n0t():t==="fa"?r0t():t==="ar"?s0t():t==="es"?i0t():t==="hi"?a0t():t0t()}),c0t=()=>"Tell us about your research",l0t=()=>"介绍一下你的研究",u0t=()=>"از پژوهش خود بگویید",_0t=()=>"أخبرنا عن بحثك",f0t=()=>"Cuéntanos sobre tu investigación",d0t=()=>"हमें अपने शोध के बारे में बताएं",h0t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?l0t():t==="fa"?u0t():t==="ar"?_0t():t==="es"?f0t():t==="hi"?d0t():c0t()}),p0t=()=>"Tell us your other research area",m0t=()=>"告诉我们你的其他研究领域",g0t=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",v0t=()=>"أخبرنا عن مجالك البحثي الآخر",b0t=()=>"Cuéntanos cuál es tu otra área de investigación",y0t=()=>"हमें अपना अन्य शोध क्षेत्र बताएं",x0t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?m0t():t==="fa"?g0t():t==="ar"?v0t():t==="es"?b0t():t==="hi"?y0t():p0t()}),w0t=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",k0t=()=>"在一处跟踪实验、产物、算力、技能和代码。",S0t=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",C0t=()=>"تتبّع التجارب والمُخرَجات والحوسبة والمهارات والشيفرة في مكان واحد.",E0t=()=>"Gestiona experimentos, artefactos, cómputo, skills y código en un solo lugar.",N0t=()=>"प्रयोग, आर्टिफ़ैक्ट, कंप्यूट, स्किल और कोड — सब एक ही जगह ट्रैक करें।",z0t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?k0t():t==="fa"?S0t():t==="ar"?C0t():t==="es"?E0t():t==="hi"?N0t():w0t()}),j0t=()=>"Unable to verify",T0t=()=>"无法验证",A0t=()=>"تأیید ممکن نیست",R0t=()=>"تعذّر التحقق",M0t=()=>"No se pudo verificar",O0t=()=>"सत्यापित नहीं हो सका",D0t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?T0t():t==="fa"?A0t():t==="ar"?R0t():t==="es"?M0t():t==="hi"?O0t():j0t()}),L0t=()=>"Update required",I0t=()=>"需要更新",$0t=()=>"نیازمند به‌روزرسانی",B0t=()=>"مطلوب تحديث",P0t=()=>"Actualización necesaria",F0t=()=>"अपडेट ज़रूरी है",H0t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?I0t():t==="fa"?$0t():t==="ar"?B0t():t==="es"?P0t():t==="hi"?F0t():L0t()}),q0t=()=>"Waiting for the Git check",U0t=()=>"正在等待 Git 检查",G0t=()=>"در انتظار بررسی Git",V0t=()=>"في انتظار فحص Git",K0t=()=>"Esperando la comprobación de Git",W0t=()=>"Git जाँच का इंतज़ार है",Q0t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?U0t():t==="fa"?G0t():t==="ar"?V0t():t==="es"?K0t():t==="hi"?W0t():q0t()}),X0t=()=>"Waiting for the local tool checks",Y0t=()=>"正在等待本地工具检查",Z0t=()=>"در انتظار بررسی ابزارهای محلی",J0t=()=>"في انتظار فحوص الأدوات المحلية",emt=()=>"Esperando las comprobaciones de las herramientas locales",tmt=()=>"लोकल टूल जाँच का इंतज़ार है",nmt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Y0t():t==="fa"?Z0t():t==="ar"?J0t():t==="es"?emt():t==="hi"?tmt():X0t()}),rmt=()=>"What areas are you interested in?",smt=()=>"你对哪些领域感兴趣?",imt=()=>"به چه حوزه‌هایی علاقه دارید؟",amt=()=>"ما المجالات التي تهتم بها؟",omt=()=>"¿Qué áreas te interesan?",cmt=()=>"आपकी रुचि किन क्षेत्रों में है?",lmt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?smt():t==="fa"?imt():t==="ar"?amt():t==="es"?omt():t==="hi"?cmt():rmt()}),umt=()=>"Your code, data, and experiment history stay on your machine.",_mt=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",fmt=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",dmt=()=>"تبقى شيفرتك وبياناتك وسجل تجاربك على جهازك.",hmt=()=>"Tu código, tus datos y tu historial de experimentos se quedan en tu equipo.",pmt=()=>"आपका कोड, डेटा और प्रयोग इतिहास आपकी मशीन पर ही रहता है।",mmt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_mt():t==="fa"?fmt():t==="ar"?dmt():t==="es"?hmt():t==="hi"?pmt():umt()}),gmt=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",vmt=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",bmt=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",ymt=()=>"لم يعد الوكيل الذي اخترته جاهزًا. ارجع إلى الخطوة 1 واختر غيره.",xmt=()=>"El agente que elegiste ya no está listo. Vuelve al paso 1 y elige otro.",wmt=()=>"आपका चुना हुआ एजेंट अब तैयार नहीं है। चरण 1 पर वापस जाएं और दूसरा चुनें।",kmt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vmt():t==="fa"?bmt():t==="ar"?ymt():t==="es"?xmt():t==="hi"?wmt():gmt()}),Smt=()=>"Add cookie",Cmt=()=>"添加 cookie",Emt=()=>"افزودن کوکی",Nmt=()=>"إضافة ملف تعريف الارتباط",zmt=()=>"Añadir cookie",jmt=()=>"कुकी जोड़ें",Tmt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Cmt():t==="fa"?Emt():t==="ar"?Nmt():t==="es"?zmt():t==="hi"?jmt():Smt()}),Amt=()=>"Changed here and on Overleaf — choose which copy to keep",Rmt=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",Mmt=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",Omt=()=>"تغيّر هنا وعلى Overleaf — اختر أي نسخة تحتفظ بها",Dmt=()=>"Cambió aquí y en Overleaf — elige qué copia conservar",Lmt=()=>"यहाँ और Overleaf दोनों जगह बदला गया — चुनें कि कौन सी कॉपी रखनी है",Imt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rmt():t==="fa"?Mmt():t==="ar"?Omt():t==="es"?Dmt():t==="hi"?Lmt():Amt()}),$mt=()=>"Create a token ↗",Bmt=()=>"创建令牌 ↗",Pmt=()=>"ساخت توکن ↗",Fmt=()=>"إنشاء رمز ↗",Hmt=()=>"Crear un token ↗",qmt=()=>"एक टोकन बनाएं ↗",Umt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bmt():t==="fa"?Pmt():t==="ar"?Fmt():t==="es"?Hmt():t==="hi"?qmt():$mt()}),Gmt=()=>"Overleaf Git token",Vmt=()=>"Overleaf Git 令牌",Kmt=()=>"توکن Git در Overleaf",Wmt=()=>"رمز Git لـ Overleaf",Qmt=()=>"Token de Git de Overleaf",Xmt=()=>"Overleaf Git टोकन",hz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vmt():t==="fa"?Kmt():t==="ar"?Wmt():t==="es"?Qmt():t==="hi"?Xmt():Gmt()}),Ymt=()=>"Follow Overleaf as people type by adding your Overleaf session cookie.",Zmt=()=>"添加 Overleaf 会话 cookie,即可在他人输入时实时跟随 Overleaf。",Jmt=()=>"با افزودن کوکی نشست Overleaf، هنگام تایپ دیگران Overleaf را زنده دنبال کنید.",egt=()=>"تابِع Overleaf أثناء كتابة الآخرين بإضافة ملف تعريف ارتباط جلسة Overleaf.",tgt=()=>"Sigue los cambios de Overleaf mientras se escribe añadiendo tu cookie de sesión de Overleaf.",ngt=()=>"अपनी Overleaf सेशन कुकी जोड़कर लोगों के टाइप करते ही Overleaf को फ़ॉलो करें।",rgt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Zmt():t==="fa"?Jmt():t==="ar"?egt():t==="es"?tgt():t==="hi"?ngt():Ymt()}),sgt=()=>"Import from browser",igt=()=>"从浏览器导入",agt=()=>"وارد کردن از مرورگر",ogt=()=>"الاستيراد من المتصفح",cgt=()=>"Importar desde el navegador",lgt=()=>"ब्राउज़र से इंपोर्ट करें",ugt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?igt():t==="fa"?agt():t==="ar"?ogt():t==="es"?cgt():t==="hi"?lgt():sgt()}),_gt=()=>"In step with Overleaf",fgt=()=>"已与 Overleaf 同步",dgt=()=>"با Overleaf همگام است",hgt=()=>"متزامن مع Overleaf",pgt=()=>"Sincronizado con Overleaf",mgt=()=>"Overleaf के साथ मेल में",tL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fgt():t==="fa"?dgt():t==="ar"?hgt():t==="es"?pgt():t==="hi"?mgt():_gt()}),ggt=()=>"The last sync did not finish.",vgt=()=>"上次同步未完成。",bgt=()=>"آخرین همگام‌سازی کامل نشد.",ygt=()=>"لم تكتمل آخر مزامنة.",xgt=()=>"La última sincronización no terminó.",wgt=()=>"पिछला सिंक पूरा नहीं हुआ।",kgt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vgt():t==="fa"?bgt():t==="ar"?ygt():t==="es"?xgt():t==="hi"?wgt():ggt()}),Sgt=()=>"Link and sync",Cgt=()=>"关联并同步",Egt=()=>"پیوند و همگام‌سازی",Ngt=()=>"الربط والمزامنة",zgt=()=>"Vincular y sincronizar",jgt=()=>"लिंक करें और सिंक करें",Tgt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Cgt():t==="fa"?Egt():t==="ar"?Ngt():t==="es"?zgt():t==="hi"?jgt():Sgt()}),Agt=()=>"Connecting to Overleaf…",Rgt=()=>"正在连接 Overleaf…",Mgt=()=>"در حال اتصال به Overleaf…",Ogt=()=>"جارٍ الاتصال بـ Overleaf…",Dgt=()=>"Conectando con Overleaf…",Lgt=()=>"Overleaf से कनेक्ट हो रहा है…",Igt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rgt():t==="fa"?Mgt():t==="ar"?Ogt():t==="es"?Dgt():t==="hi"?Lgt():Agt()}),$gt=()=>"Edits are live on Overleaf",Bgt=()=>"编辑已在 Overleaf 实时同步",Pgt=()=>"ویرایش‌ها روی Overleaf زنده‌اند",Fgt=()=>"تظهر التعديلات فورًا على Overleaf",Hgt=()=>"Los cambios se sincronizan en directo con Overleaf",qgt=()=>"बदलाव Overleaf पर लाइव हैं",Ugt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bgt():t==="fa"?Pgt():t==="ar"?Fgt():t==="es"?Hgt():t==="hi"?qgt():$gt()}),Ggt=()=>"Retry",Vgt=()=>"重试",Kgt=()=>"تلاش دوباره",Wgt=()=>"إعادة المحاولة",Qgt=()=>"Reintentar",Xgt=()=>"फिर से कोशिश करें",Ygt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vgt():t==="fa"?Kgt():t==="ar"?Wgt():t==="es"?Qgt():t==="hi"?Xgt():Ggt()}),Zgt=()=>"Live sync stopped.",Jgt=()=>"实时同步已停止。",e1t=()=>"همگام‌سازی زنده متوقف شد.",t1t=()=>"توقفت المزامنة المباشرة.",n1t=()=>"Sincronización en directo detenida.",r1t=()=>"लाइव सिंक रुक गया।",s1t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Jgt():t==="fa"?e1t():t==="ar"?t1t():t==="es"?n1t():t==="hi"?r1t():Zgt()}),i1t=()=>"Live sync starts once the paper is in step with Overleaf.",a1t=()=>"论文与 Overleaf 同步后,实时同步即会开始。",o1t=()=>"همگام‌سازی زنده پس از هم‌گام شدن مقاله با Overleaf آغاز می‌شود.",c1t=()=>"تبدأ المزامنة المباشرة بمجرد أن تتزامن الورقة مع Overleaf.",l1t=()=>"La sincronización en directo empieza cuando el paper esté sincronizado con Overleaf.",u1t=()=>"पेपर Overleaf के साथ मेल में आते ही लाइव सिंक शुरू होगा।",_1t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?a1t():t==="fa"?o1t():t==="ar"?c1t():t==="es"?l1t():t==="hi"?u1t():i1t()}),f1t=()=>"My projects ↗",d1t=()=>"我的项目 ↗",h1t=()=>"پروژه‌های من ↗",p1t=()=>"مشاريعي ↗",m1t=()=>"Mis proyectos ↗",g1t=()=>"मेरे प्रोजेक्ट ↗",pz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?d1t():t==="fa"?h1t():t==="ar"?p1t():t==="es"?m1t():t==="hi"?g1t():f1t()}),v1t=()=>"Nothing could be synced.",b1t=()=>"没有内容可以同步。",y1t=()=>"هیچ موردی قابل همگام‌سازی نبود.",x1t=()=>"تعذّرت مزامنة أي شيء.",w1t=()=>"No se pudo sincronizar nada.",k1t=()=>"कुछ भी सिंक नहीं हो सका।",S1t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?b1t():t==="fa"?y1t():t==="ar"?x1t():t==="es"?w1t():t==="hi"?k1t():v1t()}),C1t=()=>"Open Overleaf ↗",E1t=()=>"打开 Overleaf ↗",N1t=()=>"باز کردن Overleaf ↗",z1t=()=>"فتح Overleaf ↗",j1t=()=>"Abrir Overleaf ↗",T1t=()=>"Overleaf खोलें ↗",A1t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?E1t():t==="fa"?N1t():t==="ar"?z1t():t==="es"?j1t():t==="hi"?T1t():C1t()}),R1t=()=>"Cancel",M1t=()=>"取消",O1t=()=>"لغو",D1t=()=>"إلغاء",L1t=()=>"Cancelar",I1t=()=>"रद्द करें",nL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?M1t():t==="fa"?O1t():t==="ar"?D1t():t==="es"?L1t():t==="hi"?I1t():R1t()}),$1t=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",B1t=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",P1t=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",F1t=()=>"تغيّر هنا وعلى Overleaf. كلا النسختين لم تُمسّا — اختر أيّهما تحتفظ به.",H1t=()=>"cambió aquí y en Overleaf. No se ha tocado ninguna de las dos copias — elige cuál conservar.",q1t=()=>"यहाँ और Overleaf दोनों जगह बदला गया। दोनों कॉपी सुरक्षित हैं — चुनें कि कौन सी रखनी है।",U1t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?B1t():t==="fa"?P1t():t==="ar"?F1t():t==="es"?H1t():t==="hi"?q1t():$1t()}),G1t=()=>"Keep this copy",V1t=()=>"保留此副本",K1t=()=>"نگه داشتن این نسخه",W1t=()=>"الاحتفاظ بهذه النسخة",Q1t=()=>"Conservar esta copia",X1t=()=>"यह कॉपी रखें",Y1t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?V1t():t==="fa"?K1t():t==="ar"?W1t():t==="es"?Q1t():t==="hi"?X1t():G1t()}),Z1t=()=>"Open in Overleaf",J1t=()=>"在 Overleaf 中打开",evt=()=>"باز کردن در Overleaf",tvt=()=>"فتح في Overleaf",nvt=()=>"Abrir en Overleaf",rvt=()=>"Overleaf में खोलें",svt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?J1t():t==="fa"?evt():t==="ar"?tvt():t==="es"?nvt():t==="hi"?rvt():Z1t()}),ivt=()=>"Replace the Overleaf token",avt=()=>"替换 Overleaf 令牌",ovt=()=>"جایگزینی توکن Overleaf",cvt=()=>"استبدال رمز Overleaf",lvt=()=>"Reemplazar el token de Overleaf",uvt=()=>"Overleaf टोकन बदलें",mz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?avt():t==="fa"?ovt():t==="ar"?cvt():t==="es"?lvt():t==="hi"?uvt():ivt()}),_vt=()=>"Sync files",fvt=()=>"同步文件",dvt=()=>"همگام‌سازی فایل‌ها",hvt=()=>"مزامنة الملفات",pvt=()=>"Sincronizar archivos",mvt=()=>"फ़ाइलें सिंक करें",gvt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fvt():t==="fa"?dvt():t==="ar"?hvt():t==="es"?pvt():t==="hi"?mvt():_vt()}),vvt=()=>"Unlink",bvt=()=>"取消关联",yvt=()=>"قطع پیوند",xvt=()=>"إلغاء الربط",wvt=()=>"Desvincular",kvt=()=>"लिंक हटाएं",Svt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bvt():t==="fa"?yvt():t==="ar"?xvt():t==="es"?wvt():t==="hi"?kvt():vvt()}),Cvt=()=>"Upload a copy as a new project ↗",Evt=()=>"上传副本作为新项目 ↗",Nvt=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",zvt=()=>"رفع نسخة كمشروع جديد ↗",jvt=()=>"Subir una copia como proyecto nuevo ↗",Tvt=()=>"नए प्रोजेक्ट के रूप में एक कॉपी अपलोड करें ↗",rL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Evt():t==="fa"?Nvt():t==="ar"?zvt():t==="es"?jvt():t==="hi"?Tvt():Cvt()}),Avt=()=>"Use Overleaf's",Rvt=()=>"使用 Overleaf 的副本",Mvt=()=>"استفاده از نسخهٔ Overleaf",Ovt=()=>"استخدام نسخة Overleaf",Dvt=()=>"Usar la de Overleaf",Lvt=()=>"Overleaf का इस्तेमाल करें",Ivt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rvt():t==="fa"?Mvt():t==="ar"?Ovt():t==="es"?Dvt():t==="hi"?Lvt():Avt()}),$vt=()=>"This paper stays in step with Overleaf.",Bvt=()=>"此论文将与 Overleaf 保持同步。",Pvt=()=>"این مقاله با Overleaf همگام می‌ماند.",Fvt=()=>"تبقى هذه الورقة متزامنة مع Overleaf.",Hvt=()=>"Este paper se mantiene sincronizado con Overleaf.",qvt=()=>"यह पेपर Overleaf के साथ मेल में रहता है।",Uvt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bvt():t==="fa"?Pvt():t==="ar"?Fvt():t==="es"?Hvt():t==="hi"?qvt():$vt()}),Gvt=()=>"Paste it instead",Vvt=()=>"改为粘贴",Kvt=()=>"به‌جایش بچسبانید",Wvt=()=>"الصقه بدلًا من ذلك",Qvt=()=>"Pegarla manualmente",Xvt=()=>"इसके बजाय पेस्ट करें",Yvt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vvt():t==="fa"?Kvt():t==="ar"?Wvt():t==="es"?Qvt():t==="hi"?Xvt():Gvt()}),Zvt=e=>`Pulled ${e==null?void 0:e.paths}.`,Jvt=e=>`已拉取 ${e==null?void 0:e.paths}。`,ebt=e=>`${e==null?void 0:e.paths} دریافت شد.`,tbt=e=>`سُحب ${e==null?void 0:e.paths}.`,nbt=e=>`Descargado: ${e==null?void 0:e.paths}.`,rbt=e=>`${e==null?void 0:e.paths} पुल किया।`,sbt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Jvt(e):t==="fa"?ebt(e):t==="ar"?tbt(e):t==="es"?nbt(e):t==="hi"?rbt(e):Zvt(e)}),ibt=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,abt=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,obt=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,cbt=e=>`سُحب ${e==null?void 0:e.pulled}؛ ورُفع ${e==null?void 0:e.pushed}.`,lbt=e=>`Descargado: ${e==null?void 0:e.pulled}; subido: ${e==null?void 0:e.pushed}.`,ubt=e=>`${e==null?void 0:e.pulled} पुल किया; ${e==null?void 0:e.pushed} पुश किया।`,_bt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?abt(e):t==="fa"?obt(e):t==="ar"?cbt(e):t==="es"?lbt(e):t==="hi"?ubt(e):ibt(e)}),fbt=e=>`Pushed ${e==null?void 0:e.paths}.`,dbt=e=>`已推送 ${e==null?void 0:e.paths}。`,hbt=e=>`${e==null?void 0:e.paths} ارسال شد.`,pbt=e=>`رُفع ${e==null?void 0:e.paths}.`,mbt=e=>`Subido: ${e==null?void 0:e.paths}.`,gbt=e=>`${e==null?void 0:e.paths} पुश किया।`,vbt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?dbt(e):t==="fa"?hbt(e):t==="ar"?pbt(e):t==="es"?mbt(e):t==="hi"?gbt(e):fbt(e)}),bbt=()=>"Add a fresh Overleaf session cookie to start following again.",ybt=()=>"添加新的 Overleaf 会话 cookie 即可继续实时跟随。",xbt=()=>"برای ادامهٔ دنبال کردن، کوکی نشست تازه‌ای از Overleaf اضافه کنید.",wbt=()=>"أضِف ملف تعريف ارتباط جلسة Overleaf جديدًا لبدء المتابعة مجددًا.",kbt=()=>"Añade una nueva cookie de sesión de Overleaf para volver a seguir los cambios.",Sbt=()=>"फिर से फ़ॉलो करना शुरू करने के लिए एक नई Overleaf सेशन कुकी जोड़ें।",Cbt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ybt():t==="fa"?xbt():t==="ar"?wbt():t==="es"?kbt():t==="hi"?Sbt():bbt()}),Ebt=()=>"Save the file first",Nbt=()=>"请先保存文件",zbt=()=>"ابتدا فایل را ذخیره کنید",jbt=()=>"احفظ الملف أولًا",Tbt=()=>"Guarda el archivo primero",Abt=()=>"पहले फ़ाइल सेव करें",Rbt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Nbt():t==="fa"?zbt():t==="ar"?jbt():t==="es"?Tbt():t==="hi"?Abt():Ebt()}),Mbt=()=>"Save this file to sync it with Overleaf",Obt=()=>"保存此文件以与 Overleaf 同步",Dbt=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",Lbt=()=>"احفظ هذا الملف لمزامنته مع Overleaf",Ibt=()=>"Guarda este archivo para sincronizarlo con Overleaf",$bt=()=>"Overleaf के साथ सिंक करने के लिए इस फ़ाइल को सेव करें",sL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Obt():t==="fa"?Dbt():t==="ar"?Lbt():t==="es"?Ibt():t==="hi"?$bt():Mbt()}),Bbt=()=>"Save token",Pbt=()=>"保存令牌",Fbt=()=>"ذخیرهٔ توکن",Hbt=()=>"حفظ الرمز",qbt=()=>"Guardar token",Ubt=()=>"टोकन सेव करें",Gbt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Pbt():t==="fa"?Fbt():t==="ar"?Hbt():t==="es"?qbt():t==="hi"?Ubt():Bbt()}),Vbt=()=>"Send this paper to Overleaf",Kbt=()=>"将此论文发送到 Overleaf",Wbt=()=>"ارسال مقاله به Overleaf",Qbt=()=>"أرسل هذه الورقة إلى Overleaf",Xbt=()=>"Enviar este paper a Overleaf",Ybt=()=>"यह पेपर Overleaf को भेजें",Zbt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Kbt():t==="fa"?Wbt():t==="ar"?Qbt():t==="es"?Xbt():t==="hi"?Ybt():Vbt()}),Jbt=()=>"Overleaf session cookie",eyt=()=>"Overleaf 会话 cookie",tyt=()=>"کوکی نشست Overleaf",nyt=()=>"ملف تعريف ارتباط جلسة Overleaf",ryt=()=>"Cookie de sesión de Overleaf",syt=()=>"Overleaf सेशन कुकी",d3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?eyt():t==="fa"?tyt():t==="ar"?nyt():t==="es"?ryt():t==="hi"?syt():Jbt()}),iyt=()=>"To follow Overleaf as people type, paste your Overleaf session cookie: in a browser signed in to Overleaf, open the developer tools, find the overleaf_session2 cookie, and copy its value. It stays on this machine.",ayt=()=>"要在他人输入时实时跟随 Overleaf,请粘贴你的 Overleaf 会话 cookie:在已登录 Overleaf 的浏览器中打开开发者工具,找到 overleaf_session2 cookie 并复制其值。它只保存在这台机器上。",oyt=()=>"برای دنبال کردن Overleaf هنگام تایپ دیگران، کوکی نشست Overleaf خود را بچسبانید: در مرورگری که به Overleaf وارد شده‌اید، ابزارهای توسعه‌دهنده را باز کنید، کوکی overleaf_session2 را پیدا کنید و مقدار آن را کپی کنید. این مقدار روی همین دستگاه می‌ماند.",cyt=()=>"لمتابعة Overleaf أثناء كتابة الآخرين، الصق ملف تعريف ارتباط جلسة Overleaf: في متصفح مسجّل الدخول إلى Overleaf، افتح أدوات المطوّر، وابحث عن ملف تعريف الارتباط overleaf_session2، وانسخ قيمته. يبقى على هذا الجهاز.",lyt=()=>"Para seguir los cambios de Overleaf mientras se escribe, pega tu cookie de sesión de Overleaf: en un navegador con la sesión de Overleaf iniciada, abre las herramientas de desarrollo, busca la cookie overleaf_session2 y copia su valor. Se queda en este equipo.",uyt=()=>"लोगों के टाइप करते ही Overleaf को फ़ॉलो करने के लिए, अपनी Overleaf सेशन कुकी पेस्ट करें: Overleaf में साइन इन ब्राउज़र में, डेवलपर टूल खोलें, overleaf_session2 कुकी खोजें, और उसकी वैल्यू कॉपी करें। यह इसी मशीन पर रहती है।",_yt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ayt():t==="fa"?oyt():t==="ar"?cyt():t==="es"?lyt():t==="hi"?uyt():iyt()}),fyt=()=>"Overleaf sync failed",dyt=()=>"Overleaf 同步失败",hyt=()=>"همگام‌سازی با Overleaf ناموفق بود",pyt=()=>"فشلت مزامنة Overleaf",myt=()=>"Error al sincronizar con Overleaf",gyt=()=>"Overleaf सिंक विफल",h3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dyt():t==="fa"?hyt():t==="ar"?pyt():t==="es"?myt():t==="hi"?gyt():fyt()}),vyt=()=>"Text syncs live. This moves figures and other files, and settles conflicts.",byt=()=>"文本会实时同步。此操作用于同步图片等其他文件,并解决冲突。",yyt=()=>"متن زنده همگام می‌شود. این کار تصویرها و دیگر فایل‌ها را جابه‌جا می‌کند و تعارض‌ها را حل می‌کند.",xyt=()=>"يتزامن النص مباشرةً. ينقل هذا الأشكال والملفات الأخرى، ويحسم التعارضات.",wyt=()=>"El texto se sincroniza en directo. Esto mueve las figuras y otros archivos, y resuelve conflictos.",kyt=()=>"टेक्स्ट लाइव सिंक होता है। यह फ़िगर और अन्य फ़ाइलें ले जाता है, और टकराव सुलझाता है।",Syt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?byt():t==="fa"?yyt():t==="ar"?xyt():t==="es"?wyt():t==="hi"?kyt():vyt()}),Cyt=()=>"Syncing with Overleaf…",Eyt=()=>"正在与 Overleaf 同步…",Nyt=()=>"در حال همگام‌سازی با Overleaf…",zyt=()=>"جارٍ المزامنة مع Overleaf…",jyt=()=>"Sincronizando con Overleaf…",Tyt=()=>"Overleaf के साथ सिंक हो रहा है…",iL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Eyt():t==="fa"?Nyt():t==="ar"?zyt():t==="es"?jyt():t==="hi"?Tyt():Cyt()}),Ayt=()=>"Paste an Overleaf Git authentication token to keep this paper in step with an Overleaf project. Create one in Overleaf under Account Settings — Git integration comes with a paid Overleaf plan.",Ryt=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",Myt=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",Oyt=()=>"الصق رمز مصادقة Git لـ Overleaf لإبقاء هذه الورقة متزامنة مع مشروع Overleaf. أنشئ واحدًا في Overleaf ضمن إعدادات الحساب — يأتي تكامل Git مع خطة Overleaf مدفوعة.",Dyt=()=>"Pega un token de autenticación de Git de Overleaf para mantener este paper sincronizado con un proyecto de Overleaf. Créalo en Overleaf, en Account Settings — la integración con Git requiere un plan de pago de Overleaf.",Lyt=()=>"इस पेपर को किसी Overleaf प्रोजेक्ट के साथ मेल में रखने के लिए एक Overleaf Git प्रमाणीकरण टोकन पेस्ट करें। इसे Overleaf में Account Settings के तहत बनाएं — Git इंटीग्रेशन एक पेड Overleaf प्लान के साथ आता है।",Iyt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ryt():t==="fa"?Myt():t==="ar"?Oyt():t==="es"?Dyt():t==="hi"?Lyt():Ayt()}),$yt=()=>"Paste the URL of the Overleaf project this paper belongs to. Overleaf cannot create one over Git, so open or create the project there first.",Byt=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",Pyt=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",Fyt=()=>"الصق رابط مشروع Overleaf الذي تنتمي إليه هذه الورقة. لا يستطيع Overleaf إنشاء مشروع عبر Git، لذا افتح المشروع أو أنشئه هناك أولًا.",Hyt=()=>"Pega la URL del proyecto de Overleaf al que pertenece este paper. Overleaf no puede crear proyectos por Git, así que abre o crea el proyecto allí primero.",qyt=()=>"उस Overleaf प्रोजेक्ट का URL पेस्ट करें जिससे यह पेपर संबंधित है। Overleaf Git के ज़रिए एक नहीं बना सकता, इसलिए पहले वहाँ प्रोजेक्ट खोलें या बनाएं।",Uyt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Byt():t==="fa"?Pyt():t==="ar"?Fyt():t==="es"?Hyt():t==="hi"?qyt():$yt()}),Gyt=()=>"Toggle Plan mode for this chat",Vyt=()=>"切换此聊天的计划模式",Kyt=()=>"تغییر حالت طرح این گفت‌وگو",Wyt=()=>"تبديل وضع التخطيط لهذه المحادثة",Qyt=()=>"Activa o desactiva el modo Plan en este chat",Xyt=()=>"इस चैट के लिए प्लान मोड टॉगल करें",Yyt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vyt():t==="fa"?Kyt():t==="ar"?Wyt():t==="es"?Qyt():t==="hi"?Xyt():Gyt()}),Zyt=()=>"Accept and auto mode",Jyt=()=>"接受并使用自动模式",ext=()=>"پذیرش و حالت خودکار",txt=()=>"قبول وتفعيل الوضع التلقائي",nxt=()=>"Aceptar en modo automático",rxt=()=>"स्वीकार करें और ऑटो मोड",sxt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Jyt():t==="fa"?ext():t==="ar"?txt():t==="es"?nxt():t==="hi"?rxt():Zyt()}),ixt=()=>"Accept and bypass all",axt=()=>"接受并跳过所有审批",oxt=()=>"پذیرش و عبور از همهٔ تأییدها",cxt=()=>"القبول وتجاوز الكل",lxt=()=>"Aceptar y omitir permisos",uxt=()=>"स्वीकार करें और सब बायपास करें",_xt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?axt():t==="fa"?oxt():t==="ar"?cxt():t==="es"?lxt():t==="hi"?uxt():ixt()}),fxt=()=>"Accept plan",dxt=()=>"接受计划",hxt=()=>"پذیرش طرح",pxt=()=>"قبول الخطة",mxt=()=>"Aceptar plan",gxt=()=>"प्लान स्वीकार करें",vxt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dxt():t==="fa"?hxt():t==="ar"?pxt():t==="es"?mxt():t==="hi"?gxt():fxt()}),bxt=e=>`${e==null?void 0:e.agent} proposed a plan`,yxt=e=>`${e==null?void 0:e.agent} 提出了一个计划`,xxt=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,wxt=e=>`${e==null?void 0:e.agent} اقترح خطة`,kxt=e=>`${e==null?void 0:e.agent} propuso un plan`,Sxt=e=>`${e==null?void 0:e.agent} ने एक प्लान प्रस्तावित किया`,Cxt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?yxt(e):t==="fa"?xxt(e):t==="ar"?wxt(e):t==="es"?kxt(e):t==="hi"?Sxt(e):bxt(e)}),Ext=e=>`${e==null?void 0:e.agent} is ready to proceed`,Nxt=e=>`${e==null?void 0:e.agent} 已准备好继续`,zxt=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,jxt=e=>`${e==null?void 0:e.agent} جاهز للمتابعة`,Txt=e=>`${e==null?void 0:e.agent} está listo para continuar`,Axt=e=>`${e==null?void 0:e.agent} आगे बढ़ने के लिए तैयार है`,Rxt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Nxt(e):t==="fa"?zxt(e):t==="ar"?jxt(e):t==="es"?Txt(e):t==="hi"?Axt(e):Ext(e)}),Mxt=()=>"Back",Oxt=()=>"返回",Dxt=()=>"بازگشت",Lxt=()=>"رجوع",Ixt=()=>"Atrás",$xt=()=>"वापस",aL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Oxt():t==="fa"?Dxt():t==="ar"?Lxt():t==="es"?Ixt():t==="hi"?$xt():Mxt()}),Bxt=()=>"More approval options",Pxt=()=>"更多批准选项",Fxt=()=>"گزینه‌های تأیید بیشتر",Hxt=()=>"خيارات موافقة إضافية",qxt=()=>"Más opciones de aprobación",Uxt=()=>"और स्वीकृति विकल्प",Gxt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Pxt():t==="fa"?Fxt():t==="ar"?Hxt():t==="es"?qxt():t==="hi"?Uxt():Bxt()}),Vxt=()=>"Open plan",Kxt=()=>"打开计划",Wxt=()=>"باز کردن طرح",Qxt=()=>"فتح الخطة",Xxt=()=>"Abrir plan",Yxt=()=>"प्लान खोलें",Zxt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Kxt():t==="fa"?Wxt():t==="ar"?Qxt():t==="es"?Xxt():t==="hi"?Yxt():Vxt()}),Jxt=()=>"Reject",e2t=()=>"拒绝",t2t=()=>"رد کردن",n2t=()=>"رفض",r2t=()=>"Rechazar",s2t=()=>"अस्वीकार करें",i2t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?e2t():t==="fa"?t2t():t==="ar"?n2t():t==="es"?r2t():t==="hi"?s2t():Jxt()}),a2t=()=>"Revise",o2t=()=>"修改",c2t=()=>"بازنگری",l2t=()=>"طلب تعديل",u2t=()=>"Pedir cambios",_2t=()=>"संशोधित करें",f2t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?o2t():t==="fa"?c2t():t==="ar"?l2t():t==="es"?u2t():t==="hi"?_2t():a2t()}),d2t=()=>"Revise…",h2t=()=>"修改…",p2t=()=>"بازنگری…",m2t=()=>"طلب تعديل…",g2t=()=>"Pedir cambios…",v2t=()=>"संशोधित करें…",b2t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?h2t():t==="fa"?p2t():t==="ar"?m2t():t==="es"?g2t():t==="hi"?v2t():d2t()}),y2t=()=>"What should change? (optional)",x2t=()=>"需要更改什么?(可选)",w2t=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",k2t=()=>"ما الذي ينبغي تغييره؟ (اختياري)",S2t=()=>"¿Qué debería cambiar? (opcional)",C2t=()=>"क्या बदलना चाहिए? (वैकल्पिक)",E2t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?x2t():t==="fa"?w2t():t==="ar"?k2t():t==="es"?S2t():t==="hi"?C2t():y2t()}),N2t=e=>`${e==null?void 0:e.count} active`,z2t=e=>`${e==null?void 0:e.count} 个活跃`,j2t=e=>`${e==null?void 0:e.count} فعال`,T2t=e=>`الوكلاء النشطون: ${e==null?void 0:e.count}`,A2t=e=>`${e==null?void 0:e.count} activos`,R2t=e=>`${e==null?void 0:e.count} सक्रिय`,M2t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?z2t(e):t==="fa"?j2t(e):t==="ar"?T2t(e):t==="es"?A2t(e):t==="hi"?R2t(e):N2t(e)}),O2t=e=>`${e==null?void 0:e.count} total agents`,D2t=e=>`共 ${e==null?void 0:e.count} 个智能体`,L2t=e=>`در مجموع ${e==null?void 0:e.count} عامل`,I2t=e=>`إجمالي الوكلاء: ${e==null?void 0:e.count}`,$2t=e=>`${e==null?void 0:e.count} agentes en total`,B2t=e=>`${e==null?void 0:e.count} कुल एजेंट`,P2t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?D2t(e):t==="fa"?L2t(e):t==="ar"?I2t(e):t==="es"?$2t(e):t==="hi"?B2t(e):O2t(e)}),F2t=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,H2t=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,q2t=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,U2t=e=>`حذف ${e==null?void 0:e.name} من OpenResearch؟ ستُزال تجاربه وعمليات تشغيله ومحادثاته نهائيًا.`,G2t=e=>`¿Eliminar ${e==null?void 0:e.name} de OpenResearch? Sus experimentos, ejecuciones y chats se eliminarán de forma permanente.`,V2t=e=>`${e==null?void 0:e.name} को OpenResearch से हटाएं? इसके प्रयोग, रन और चैट स्थायी रूप से हट जाएंगे।`,K2t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?H2t(e):t==="fa"?q2t(e):t==="ar"?U2t(e):t==="es"?G2t(e):t==="hi"?V2t(e):F2t(e)}),W2t=()=>"Agents",Q2t=()=>"智能体",X2t=()=>"عامل‌ها",Y2t=()=>"الوكلاء",Z2t=()=>"Agentes",J2t=()=>"एजेंट",gz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Q2t():t==="fa"?X2t():t==="ar"?Y2t():t==="es"?Z2t():t==="hi"?J2t():W2t()}),ewt=()=>"arXiv paper ID:",twt=()=>"arXiv 论文 ID:",nwt=()=>"شناسهٔ مقالهٔ arXiv:",rwt=()=>"معرّف ورقة arXiv:",swt=()=>"ID del paper en arXiv:",iwt=()=>"arXiv पेपर ID:",awt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?twt():t==="fa"?nwt():t==="ar"?rwt():t==="es"?swt():t==="hi"?iwt():ewt()}),owt=()=>"Cancel",cwt=()=>"取消",lwt=()=>"لغو",uwt=()=>"إلغاء",_wt=()=>"Cancelar",fwt=()=>"रद्द करें",dwt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cwt():t==="fa"?lwt():t==="ar"?uwt():t==="es"?_wt():t==="hi"?fwt():owt()}),hwt=()=>"Created",pwt=()=>"创建时间",mwt=()=>"ایجادشده",gwt=()=>"أُنشئ",vwt=()=>"Creado",bwt=()=>"बनाया गया",ywt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pwt():t==="fa"?mwt():t==="ar"?gwt():t==="es"?vwt():t==="hi"?bwt():hwt()}),xwt=()=>"Delete project?",wwt=()=>"删除项目?",kwt=()=>"پروژه حذف شود؟",Swt=()=>"حذف المشروع؟",Cwt=()=>"¿Eliminar el proyecto?",Ewt=()=>"प्रोजेक्ट हटाएं?",Nwt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?wwt():t==="fa"?kwt():t==="ar"?Swt():t==="es"?Cwt():t==="hi"?Ewt():xwt()}),zwt=()=>"Delete project",jwt=()=>"删除项目",Twt=()=>"حذف پروژه",Awt=()=>"حذف المشروع",Rwt=()=>"Eliminar proyecto",Mwt=()=>"प्रोजेक्ट हटाएं",Owt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jwt():t==="fa"?Twt():t==="ar"?Awt():t==="es"?Rwt():t==="hi"?Mwt():zwt()}),Dwt=()=>"Deleting…",Lwt=()=>"正在删除…",Iwt=()=>"در حال حذف…",$wt=()=>"جارٍ الحذف…",Bwt=()=>"Eliminando…",Pwt=()=>"हटाया जा रहा है…",Fwt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Lwt():t==="fa"?Iwt():t==="ar"?$wt():t==="es"?Bwt():t==="hi"?Pwt():Dwt()}),Hwt=()=>"Experiments",qwt=()=>"实验",Uwt=()=>"آزمایش‌ها",Gwt=()=>"التجارب",Vwt=()=>"Experimentos",Kwt=()=>"प्रयोग",vz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qwt():t==="fa"?Uwt():t==="ar"?Gwt():t==="es"?Vwt():t==="hi"?Kwt():Hwt()}),Wwt=()=>"The local folder and linked GitHub repository are kept.",Qwt=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",Xwt=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",Ywt=()=>"يُحتفظ بالمجلد المحلي ومستودع GitHub المرتبط.",Zwt=()=>"Se conservan la carpeta local y el repositorio de GitHub vinculado.",Jwt=()=>"लोकल फ़ोल्डर और लिंक की गई GitHub रिपॉज़िटरी दोनों सुरक्षित रहती हैं।",e4t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Qwt():t==="fa"?Xwt():t==="ar"?Ywt():t==="es"?Zwt():t==="hi"?Jwt():Wwt()}),t4t=()=>"The local folder is kept.",n4t=()=>"本地文件夹会保留。",r4t=()=>"پوشهٔ محلی نگه داشته می‌شود.",s4t=()=>"يُحتفظ بالمجلد المحلي.",i4t=()=>"La carpeta local se conserva.",a4t=()=>"लोकल फ़ोल्डर सुरक्षित रहता है।",o4t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?n4t():t==="fa"?r4t():t==="ar"?s4t():t==="es"?i4t():t==="hi"?a4t():t4t()}),c4t=()=>"New project",l4t=()=>"新建项目",u4t=()=>"پروژهٔ جدید",_4t=()=>"مشروع جديد",f4t=()=>"Nuevo proyecto",d4t=()=>"नया प्रोजेक्ट",oL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?l4t():t==="fa"?u4t():t==="ar"?_4t():t==="es"?f4t():t==="hi"?d4t():c4t()}),h4t=()=>"No projects yet — create one to get started.",p4t=()=>"尚无项目——新建一个即可开始。",m4t=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",g4t=()=>"لا توجد مشاريع بعد — أنشئ واحدًا للبدء.",v4t=()=>"Aún no hay proyectos — crea uno para empezar.",b4t=()=>"अभी तक कोई प्रोजेक्ट नहीं — शुरू करने के लिए एक बनाएं।",y4t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?p4t():t==="fa"?m4t():t==="ar"?g4t():t==="es"?v4t():t==="hi"?b4t():h4t()}),x4t=()=>"Project",w4t=()=>"项目",k4t=()=>"پروژه",S4t=()=>"المشروع",C4t=()=>"Proyecto",E4t=()=>"प्रोजेक्ट",N4t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?w4t():t==="fa"?k4t():t==="ar"?S4t():t==="es"?C4t():t==="hi"?E4t():x4t()}),z4t=()=>"Projects",j4t=()=>"项目",T4t=()=>"پروژه‌ها",A4t=()=>"المشاريع",R4t=()=>"Proyectos",M4t=()=>"प्रोजेक्ट",O4t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?j4t():t==="fa"?T4t():t==="ar"?A4t():t==="es"?R4t():t==="hi"?M4t():z4t()}),D4t=()=>"Repository",L4t=()=>"仓库",I4t=()=>"مخزن",$4t=()=>"المستودع",B4t=()=>"Repositorio",P4t=()=>"रिपॉज़िटरी",bz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?L4t():t==="fa"?I4t():t==="ar"?$4t():t==="es"?B4t():t==="hi"?P4t():D4t()}),F4t=()=>"Idle",H4t=()=>"空闲",q4t=()=>"بیکار",U4t=()=>"خامل",G4t=()=>"Inactivo",V4t=()=>"निष्क्रिय",K4t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?H4t():t==="fa"?q4t():t==="ar"?U4t():t==="es"?G4t():t==="hi"?V4t():F4t()}),W4t=()=>"Local",Q4t=()=>"本地",X4t=()=>"محلی",Y4t=()=>"محلي",Z4t=()=>"Local",J4t=()=>"लोकल",zv=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Q4t():t==="fa"?X4t():t==="ar"?Y4t():t==="es"?Z4t():t==="hi"?J4t():W4t()}),e3t=()=>"1 total agent",t3t=()=>"共 1 个智能体",n3t=()=>"در مجموع ۱ عامل",r3t=()=>"وكيل واحد إجمالًا",s3t=()=>"1 agente en total",i3t=()=>"1 कुल एजेंट",a3t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?t3t():t==="fa"?n3t():t==="ar"?r3t():t==="es"?s3t():t==="hi"?i3t():e3t()}),o3t=e=>`${e==null?void 0:e.count} running`,c3t=e=>`${e==null?void 0:e.count} 个运行中`,l3t=e=>`${e==null?void 0:e.count} در حال اجرا`,u3t=e=>`${e==null?void 0:e.count} قيد التشغيل`,_3t=e=>`${e==null?void 0:e.count} en ejecución`,f3t=e=>`${e==null?void 0:e.count} चल रहे`,d3t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?c3t(e):t==="fa"?l3t(e):t==="ar"?u3t(e):t==="es"?_3t(e):t==="hi"?f3t(e):o3t(e)}),h3t=e=>`${e==null?void 0:e.count} total`,p3t=e=>`共 ${e==null?void 0:e.count} 个`,m3t=e=>`در مجموع ${e==null?void 0:e.count}`,g3t=e=>`${e==null?void 0:e.count} إجمالًا`,v3t=e=>`${e==null?void 0:e.count} en total`,b3t=e=>`${e==null?void 0:e.count} कुल`,yz=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?p3t(e):t==="fa"?m3t(e):t==="ar"?g3t(e):t==="es"?v3t(e):t==="hi"?b3t(e):h3t(e)}),y3t=()=>"Installing the compatible binary. This may take a few minutes.",x3t=()=>"正在安装兼容的二进制文件。这可能需要几分钟。",w3t=()=>"در حال نصب فایل اجرایی سازگار. این کار ممکن است چند دقیقه طول بکشد.",k3t=()=>"جارٍ تثبيت الملف التنفيذي المتوافق. قد يستغرق هذا بضع دقائق.",S3t=()=>"Instalando el binario compatible. Puede tardar unos minutos.",C3t=()=>"संगत बाइनरी इंस्टॉल हो रही है। इसमें कुछ मिनट लग सकते हैं।",E3t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?x3t():t==="fa"?w3t():t==="ar"?k3t():t==="es"?S3t():t==="hi"?C3t():y3t()}),N3t=e=>`Setting up OpenResearch on ${e==null?void 0:e.host}`,z3t=e=>`正在设置 ${e==null?void 0:e.host} 上的 OpenResearch`,j3t=e=>`در حال راه‌اندازی OpenResearch روی ${e==null?void 0:e.host}`,T3t=e=>`جارٍ إعداد OpenResearch على ${e==null?void 0:e.host}`,A3t=e=>`Configurando OpenResearch en ${e==null?void 0:e.host}`,R3t=e=>`${e==null?void 0:e.host} पर OpenResearch सेट अप हो रहा है`,M3t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?z3t(e):t==="fa"?j3t(e):t==="ar"?T3t(e):t==="es"?A3t(e):t==="hi"?R3t(e):N3t(e)}),O3t=()=>"Check again",D3t=()=>"再次检查",L3t=()=>"بررسی دوباره",I3t=()=>"تحقق مجددًا",$3t=()=>"Volver a comprobar",B3t=()=>"फिर से जाँचें",xz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?D3t():t==="fa"?L3t():t==="ar"?I3t():t==="es"?$3t():t==="hi"?B3t():O3t()}),P3t=()=>"Closing…",F3t=()=>"正在关闭…",H3t=()=>"در حال بستن…",q3t=()=>"جارٍ الإغلاق…",U3t=()=>"Cerrando…",G3t=()=>"बंद हो रहा है…",V3t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?F3t():t==="fa"?H3t():t==="ar"?q3t():t==="es"?U3t():t==="hi"?G3t():P3t()}),K3t=e=>`Connected to ${e==null?void 0:e.host} as ${e==null?void 0:e.user}`,W3t=e=>`已以 ${e==null?void 0:e.user} 身份连接到 ${e==null?void 0:e.host}`,Q3t=e=>`اتصال به ${e==null?void 0:e.host} با کاربر ${e==null?void 0:e.user}`,X3t=e=>`متصل بـ ${e==null?void 0:e.host} باسم ${e==null?void 0:e.user}`,Y3t=e=>`Conectado a ${e==null?void 0:e.host} como ${e==null?void 0:e.user}`,Z3t=e=>`${e==null?void 0:e.host} से ${e==null?void 0:e.user} के रूप में कनेक्टेड`,J3t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?W3t(e):t==="fa"?Q3t(e):t==="ar"?X3t(e):t==="es"?Y3t(e):t==="hi"?Z3t(e):K3t(e)}),e5t=()=>"Preparing your remote workspace…",t5t=()=>"正在准备远程工作区…",n5t=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",r5t=()=>"جارٍ تحضير مساحة عملك البعيدة…",s5t=()=>"Preparando tu espacio de trabajo remoto…",i5t=()=>"आपका रिमोट वर्कस्पेस तैयार किया जा रहा है…",a5t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?t5t():t==="fa"?n5t():t==="ar"?r5t():t==="es"?s5t():t==="hi"?i5t():e5t()}),o5t=e=>`Connecting to ${e==null?void 0:e.host}`,c5t=e=>`正在连接到 ${e==null?void 0:e.host}`,l5t=e=>`در حال اتصال به ${e==null?void 0:e.host}`,u5t=e=>`جارٍ الاتصال بـ ${e==null?void 0:e.host}`,_5t=e=>`Conectando a ${e==null?void 0:e.host}`,f5t=e=>`${e==null?void 0:e.host} से कनेक्ट हो रहा है`,d5t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?c5t(e):t==="fa"?l5t(e):t==="ar"?u5t(e):t==="es"?_5t(e):t==="hi"?f5t(e):o5t(e)}),h5t=()=>"Close remote host picker",p5t=()=>"关闭远程主机选择器",m5t=()=>"بستن انتخاب‌گر میزبان راه‌دور",g5t=()=>"إغلاق مُنتقي المضيف البعيد",v5t=()=>"Cerrar el selector de hosts remotos",b5t=()=>"रिमोट होस्ट पिकर बंद करें",y5t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?p5t():t==="fa"?m5t():t==="ar"?g5t():t==="es"?v5t():t==="hi"?b5t():h5t()}),x5t=()=>"Choose a configured SSH host.",w5t=()=>"选择已配置的 SSH 主机。",k5t=()=>"یک میزبان SSH پیکربندی‌شده انتخاب کنید.",S5t=()=>"اختر مضيف SSH مُعدًّا.",C5t=()=>"Elige un host SSH configurado.",E5t=()=>"एक कॉन्फ़िगर किया गया SSH होस्ट चुनें।",N5t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?w5t():t==="fa"?k5t():t==="ar"?S5t():t==="es"?C5t():t==="hi"?E5t():x5t()}),z5t=()=>"Connect to remote",j5t=()=>"连接到远程主机",T5t=()=>"اتصال به میزبان راه‌دور",A5t=()=>"الاتصال بجهاز بعيد",R5t=()=>"Conectar a un host remoto",M5t=()=>"रिमोट से कनेक्ट करें",p3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?j5t():t==="fa"?T5t():t==="ar"?A5t():t==="es"?R5t():t==="hi"?M5t():z5t()}),O5t=()=>"Disconnect",D5t=()=>"断开连接",L5t=()=>"قطع اتصال",I5t=()=>"قطع الاتصال",$5t=()=>"Desconectar",B5t=()=>"डिस्कनेक्ट करें",m3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?D5t():t==="fa"?L5t():t==="ar"?I5t():t==="es"?$5t():t==="hi"?B5t():O5t()}),P5t=()=>"Your remote work is still running. Reconnect when you’re ready.",F5t=()=>"你的远程工作仍在运行。准备好后可以重新连接。",H5t=()=>"کار راه‌دور شما همچنان در حال اجرا است. هر زمان آماده بودید دوباره متصل شوید.",q5t=()=>"لا يزال عملك البعيد قيد التشغيل. أعد الاتصال عندما تكون جاهزًا.",U5t=()=>"Tu trabajo remoto sigue en ejecución. Vuelve a conectarte cuando quieras.",G5t=()=>"आपका रिमोट काम अभी भी चल रहा है। तैयार होने पर फिर से कनेक्ट करें।",V5t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?F5t():t==="fa"?H5t():t==="ar"?q5t():t==="es"?U5t():t==="hi"?G5t():P5t()}),K5t=e=>`Disconnected from ${e==null?void 0:e.host}`,W5t=e=>`已断开与 ${e==null?void 0:e.host} 的连接`,Q5t=e=>`اتصال به ${e==null?void 0:e.host} قطع شد`,X5t=e=>`انقطع الاتصال بـ ${e==null?void 0:e.host}`,Y5t=e=>`Desconectado de ${e==null?void 0:e.host}`,Z5t=e=>`${e==null?void 0:e.host} से डिस्कनेक्ट हो गया`,cL=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?W5t(e):t==="fa"?Q5t(e):t==="ar"?X5t(e):t==="es"?Y5t(e):t==="hi"?Z5t(e):K5t(e)}),J5t=e=>`Could not connect to ${e==null?void 0:e.host}`,ekt=e=>`无法连接到 ${e==null?void 0:e.host}`,tkt=e=>`اتصال به ${e==null?void 0:e.host} ممکن نشد`,nkt=e=>`تعذّر الاتصال بـ ${e==null?void 0:e.host}`,rkt=e=>`No se pudo conectar a ${e==null?void 0:e.host}`,skt=e=>`${e==null?void 0:e.host} से कनेक्ट नहीं हो सका`,ikt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?ekt(e):t==="fa"?tkt(e):t==="ar"?nkt(e):t==="es"?rkt(e):t==="hi"?skt(e):J5t(e)}),akt=()=>"Restart local OpenResearch and select this SSH host again. Work on the remote host continues.",okt=()=>"请重新启动本地 OpenResearch 并再次选择此 SSH 主机。远程主机上的工作仍在继续。",ckt=()=>"OpenResearch محلی را دوباره راه‌اندازی کنید و این میزبان SSH را دوباره انتخاب کنید. کار روی میزبان راه‌دور ادامه دارد.",lkt=()=>"أعد تشغيل OpenResearch المحلي واختر مضيف SSH هذا مجددًا. يستمر العمل على المضيف البعيد.",ukt=()=>"Reinicia OpenResearch en local y vuelve a seleccionar este host SSH. El trabajo en el host remoto continúa.",_kt=()=>"लोकल OpenResearch फिर से शुरू करें और इस SSH होस्ट को फिर से चुनें। रिमोट होस्ट पर काम जारी रहता है।",fkt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?okt():t==="fa"?ckt():t==="ar"?lkt():t==="es"?ukt():t==="hi"?_kt():akt()}),dkt=()=>"OpenResearch agents have stopped. Submitted experiments may still be running.",hkt=()=>"OpenResearch 智能体已停止。已提交的实验可能仍在运行。",pkt=()=>"عامل‌های OpenResearch متوقف شده‌اند. آزمایش‌های ارسال‌شده ممکن است همچنان در حال اجرا باشند.",mkt=()=>"توقّف وكلاء OpenResearch. قد تظل التجارب المُرسَلة قيد التشغيل.",gkt=()=>"Los agentes de OpenResearch se han detenido. Puede que los experimentos enviados sigan en ejecución.",vkt=()=>"OpenResearch एजेंट रुक गए हैं। सबमिट किए गए प्रयोग अभी भी चल सकते हैं।",bkt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hkt():t==="fa"?pkt():t==="ar"?mkt():t==="es"?gkt():t==="hi"?vkt():dkt()}),ykt=e=>`OpenResearch is not running on ${e==null?void 0:e.host}`,xkt=e=>`OpenResearch 未在 ${e==null?void 0:e.host} 上运行`,wkt=e=>`OpenResearch روی ${e==null?void 0:e.host} در حال اجرا نیست`,kkt=e=>`‏OpenResearch لا يعمل على ${e==null?void 0:e.host}`,Skt=e=>`OpenResearch no se está ejecutando en ${e==null?void 0:e.host}`,Ckt=e=>`${e==null?void 0:e.host} पर OpenResearch नहीं चल रहा`,Ekt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?xkt(e):t==="fa"?wkt(e):t==="ar"?kkt(e):t==="es"?Skt(e):t==="hi"?Ckt(e):ykt(e)}),Nkt=()=>"OpenResearch binary",zkt=()=>"OpenResearch 二进制文件",jkt=()=>"فایل اجرایی OpenResearch",Tkt=()=>"الملف التنفيذي لـ OpenResearch",Akt=()=>"Binario de OpenResearch",Rkt=()=>"OpenResearch बाइनरी",Mkt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zkt():t==="fa"?jkt():t==="ar"?Tkt():t==="es"?Akt():t==="hi"?Rkt():Nkt()}),Okt=()=>"OpenResearch Database",Dkt=()=>"OpenResearch 数据库",Lkt=()=>"پایگاه دادهٔ OpenResearch",Ikt=()=>"قاعدة بيانات OpenResearch",$kt=()=>"Base de datos de OpenResearch",Bkt=()=>"OpenResearch डेटाबेस",Pkt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Dkt():t==="fa"?Lkt():t==="ar"?Ikt():t==="es"?$kt():t==="hi"?Bkt():Okt()}),Fkt=()=>"OpenResearch will use these locations for your remote SSH user and does not require sudo.",Hkt=()=>"OpenResearch 将为你的远程 SSH 用户使用以下位置,无需 sudo。",qkt=()=>"OpenResearch از این مسیرها برای کاربر SSH راه‌دور شما استفاده می‌کند و به sudo نیاز ندارد.",Ukt=()=>"سيستخدم OpenResearch هذه المواقع لمستخدم SSH البعيد ولا يتطلب sudo.",Gkt=()=>"OpenResearch usará estas ubicaciones para tu usuario SSH remoto y no necesita sudo.",Vkt=()=>"OpenResearch आपके रिमोट SSH यूज़र के लिए इन स्थानों का इस्तेमाल करेगा और sudo की ज़रूरत नहीं है।",Kkt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Hkt():t==="fa"?qkt():t==="ar"?Ukt():t==="es"?Gkt():t==="hi"?Vkt():Fkt()}),Wkt=()=>"Install OpenResearch?",Qkt=()=>"安装 OpenResearch?",Xkt=()=>"OpenResearch نصب شود؟",Ykt=()=>"تثبيت OpenResearch؟",Zkt=()=>"¿Instalar OpenResearch?",Jkt=()=>"OpenResearch इंस्टॉल करें?",eSt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Qkt():t==="fa"?Xkt():t==="ar"?Ykt():t==="es"?Zkt():t==="hi"?Jkt():Wkt()}),tSt=()=>"Installing…",nSt=()=>"正在安装…",rSt=()=>"در حال نصب…",sSt=()=>"جارٍ التثبيت…",iSt=()=>"Instalando…",aSt=()=>"इंस्टॉल हो रहा है…",oSt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nSt():t==="fa"?rSt():t==="ar"?sSt():t==="es"?iSt():t==="hi"?aSt():tSt()}),cSt=()=>"No matching SSH hosts",lSt=()=>"没有匹配的 SSH 主机",uSt=()=>"میزبان SSH منطبقی پیدا نشد",_St=()=>"لا توجد مضيفات SSH مطابقة",fSt=()=>"No hay hosts SSH que coincidan",dSt=()=>"कोई मेल खाता SSH होस्ट नहीं",hSt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lSt():t==="fa"?uSt():t==="ar"?_St():t==="es"?fSt():t==="hi"?dSt():cSt()}),pSt=e=>`OpenResearch is not installed for ${e==null?void 0:e.user} on ${e==null?void 0:e.host}. Install it now?`,mSt=e=>`${e==null?void 0:e.user} 尚未在 ${e==null?void 0:e.host} 上安装 OpenResearch。现在安装吗?`,gSt=e=>`OpenResearch برای ${e==null?void 0:e.user} روی ${e==null?void 0:e.host} نصب نیست. اکنون نصب شود؟`,vSt=e=>`‏OpenResearch غير مثبّت للمستخدم ${e==null?void 0:e.user} على ${e==null?void 0:e.host}. هل تريد تثبيته الآن؟`,bSt=e=>`OpenResearch no está instalado para ${e==null?void 0:e.user} en ${e==null?void 0:e.host}. ¿Instalarlo ahora?`,ySt=e=>`${e==null?void 0:e.host} पर ${e==null?void 0:e.user} के लिए OpenResearch इंस्टॉल नहीं है। अभी इंस्टॉल करें?`,xSt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?mSt(e):t==="fa"?gSt(e):t==="ar"?vSt(e):t==="es"?bSt(e):t==="hi"?ySt(e):pSt(e)}),wSt=()=>"Open remote",kSt=()=>"打开远程工作区",SSt=()=>"باز کردن راه‌دور",CSt=()=>"فتح مساحة العمل البعيدة",ESt=()=>"Abrir remoto",NSt=()=>"रिमोट खोलें",zSt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?kSt():t==="fa"?SSt():t==="ar"?CSt():t==="es"?ESt():t==="hi"?NSt():wSt()}),jSt=()=>"Closing this tab or disconnecting leaves agents and experiments running. Approval requests remain pending for up to 55 minutes. A host restart or administrator policy may stop OpenResearch.",TSt=()=>"关闭此标签页或断开连接后,代理和实验仍会继续运行。审批请求最多保持待处理 55 分钟。主机重启或管理员策略可能会停止 OpenResearch。",ASt=()=>"بستن این زبانه یا قطع اتصال، عامل‌ها و آزمایش‌ها را در حال اجرا نگه می‌دارد. درخواست‌های تأیید تا ۵۵ دقیقه در انتظار می‌مانند. راه‌اندازی مجدد میزبان یا سیاست مدیر ممکن است OpenResearch را متوقف کند.",RSt=()=>"إغلاق هذا التبويب أو قطع الاتصال يُبقي الوكلاء والتجارب قيد التشغيل. تبقى طلبات الموافقة معلّقة لمدة تصل إلى 55 دقيقة. قد تتسبب إعادة تشغيل المضيف أو سياسة المسؤول في إيقاف OpenResearch.",MSt=()=>"Si cierras esta pestaña o te desconectas, los agentes y experimentos siguen en ejecución. Las solicitudes de aprobación quedan pendientes hasta 55 minutos. Un reinicio del host o una política del administrador pueden detener OpenResearch.",OSt=()=>"यह टैब बंद करने या डिस्कनेक्ट करने पर भी एजेंट और प्रयोग चलते रहते हैं। स्वीकृति अनुरोध 55 मिनट तक लंबित रहते हैं। होस्ट रीस्टार्ट या एडमिन नीति OpenResearch को रोक सकती है।",DSt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?TSt():t==="fa"?ASt():t==="ar"?RSt():t==="es"?MSt():t==="hi"?OSt():jSt()}),LSt=()=>"Your browser blocked the remote workspace tab. Allow pop-ups and try again.",ISt=()=>"浏览器阻止了远程工作区标签页。请允许弹出窗口后重试。",$St=()=>"مرورگر زبانهٔ فضای کاری راه‌دور را مسدود کرد. پنجره‌های بازشو را مجاز کنید و دوباره تلاش کنید.",BSt=()=>"حجب متصفحك تبويب مساحة العمل البعيدة. اسمح بالنوافذ المنبثقة وحاول مجددًا.",PSt=()=>"Tu navegador bloqueó la pestaña del espacio de trabajo remoto. Permite las ventanas emergentes y vuelve a intentarlo.",FSt=()=>"आपके ब्राउज़र ने रिमोट वर्कस्पेस टैब को ब्लॉक कर दिया। पॉप-अप की अनुमति दें और फिर से कोशिश करें।",HSt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ISt():t==="fa"?$St():t==="ar"?BSt():t==="es"?PSt():t==="hi"?FSt():LSt()}),qSt=()=>"Preparing remote workspace…",USt=()=>"正在准备远程工作区…",GSt=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",VSt=()=>"جارٍ تحضير مساحة العمل البعيدة…",KSt=()=>"Preparando el espacio de trabajo remoto…",WSt=()=>"रिमोट वर्कस्पेस तैयार हो रहा है…",QSt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?USt():t==="fa"?GSt():t==="ar"?VSt():t==="es"?KSt():t==="hi"?WSt():qSt()}),XSt=()=>"Reconnect",YSt=()=>"重新连接",ZSt=()=>"اتصال دوباره",JSt=()=>"إعادة الاتصال",e6t=()=>"Reconectar",t6t=()=>"फिर से कनेक्ट करें",wz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?YSt():t==="fa"?ZSt():t==="ar"?JSt():t==="es"?e6t():t==="hi"?t6t():XSt()}),n6t=()=>"The connection dropped. Your remote work remains running while OpenResearch reconnects.",r6t=()=>"连接已中断。OpenResearch 重新连接期间,你的远程工作仍会继续运行。",s6t=()=>"اتصال قطع شد. هنگام اتصال دوبارهٔ OpenResearch، کار راه‌دور شما همچنان اجرا می‌شود.",i6t=()=>"انقطع الاتصال. يبقى عملك البعيد قيد التشغيل بينما يعيد OpenResearch الاتصال.",a6t=()=>"Se perdió la conexión. Tu trabajo remoto sigue en ejecución mientras OpenResearch se reconecta.",o6t=()=>"कनेक्शन टूट गया। OpenResearch के फिर से कनेक्ट होने के दौरान आपका रिमोट काम चलता रहता है।",c6t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?r6t():t==="fa"?s6t():t==="ar"?i6t():t==="es"?a6t():t==="hi"?o6t():n6t()}),l6t=e=>`Reconnecting to ${e==null?void 0:e.host}`,u6t=e=>`正在重新连接到 ${e==null?void 0:e.host}`,_6t=e=>`در حال اتصال دوباره به ${e==null?void 0:e.host}`,f6t=e=>`جارٍ إعادة الاتصال بـ ${e==null?void 0:e.host}`,d6t=e=>`Reconectando a ${e==null?void 0:e.host}`,h6t=e=>`${e==null?void 0:e.host} से फिर से कनेक्ट हो रहा है`,p6t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?u6t(e):t==="fa"?_6t(e):t==="ar"?f6t(e):t==="es"?d6t(e):t==="hi"?h6t(e):l6t(e)}),m6t=()=>"Search SSH hosts",g6t=()=>"搜索 SSH 主机",v6t=()=>"جستجوی میزبان‌های SSH",b6t=()=>"البحث في مضيفات SSH",y6t=()=>"Buscar hosts SSH",x6t=()=>"SSH होस्ट खोजें",kz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?g6t():t==="fa"?v6t():t==="ar"?b6t():t==="es"?y6t():t==="hi"?x6t():m6t()}),w6t=e=>`SSH: ${e==null?void 0:e.host}`,k6t=e=>`SSH:${e==null?void 0:e.host}`,S6t=e=>`SSH: ${e==null?void 0:e.host}`,C6t=e=>`SSH: ${e==null?void 0:e.host}`,E6t=e=>`SSH: ${e==null?void 0:e.host}`,N6t=e=>`SSH: ${e==null?void 0:e.host}`,rw=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?k6t(e):t==="fa"?S6t(e):t==="ar"?C6t(e):t==="es"?E6t(e):t==="hi"?N6t(e):w6t(e)}),z6t=()=>"Start a new OpenResearch host",j6t=()=>"启动新的 OpenResearch 主机",T6t=()=>"راه‌اندازی میزبان جدید OpenResearch",A6t=()=>"بدء مضيف OpenResearch جديد",R6t=()=>"Iniciar un nuevo host de OpenResearch",M6t=()=>"एक नया OpenResearch होस्ट शुरू करें",O6t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?j6t():t==="fa"?T6t():t==="ar"?A6t():t==="es"?R6t():t==="hi"?M6t():z6t()}),D6t=e=>`End ${e==null?void 0:e.count} pending approvals.`,L6t=e=>`结束 ${e==null?void 0:e.count} 个待审批请求。`,I6t=e=>`${e==null?void 0:e.count} تأیید در انتظار را پایان می‌دهد.`,$6t=e=>`إنهاء طلبات الموافقة المعلّقة (${e==null?void 0:e.count}).`,B6t=e=>`Cancelará ${e==null?void 0:e.count} aprobaciones pendientes.`,P6t=e=>`${e==null?void 0:e.count} लंबित स्वीकृतियाँ खत्म होंगी।`,F6t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?L6t(e):t==="fa"?I6t(e):t==="ar"?$6t(e):t==="es"?B6t(e):t==="hi"?P6t(e):D6t(e)}),H6t=()=>"Stop OpenResearch",q6t=()=>"停止 OpenResearch",U6t=()=>"توقف OpenResearch",G6t=()=>"إيقاف OpenResearch",V6t=()=>"Detener OpenResearch",K6t=()=>"OpenResearch रोकें",W6t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?q6t():t==="fa"?U6t():t==="ar"?G6t():t==="es"?V6t():t==="hi"?K6t():H6t()}),Q6t=e=>`Stop OpenResearch on ${e==null?void 0:e.host}?`,X6t=e=>`停止 ${e==null?void 0:e.host} 上的 OpenResearch?`,Y6t=e=>`OpenResearch روی ${e==null?void 0:e.host} متوقف شود؟`,Z6t=e=>`إيقاف OpenResearch على ${e==null?void 0:e.host}؟`,J6t=e=>`¿Detener OpenResearch en ${e==null?void 0:e.host}?`,eCt=e=>`${e==null?void 0:e.host} पर OpenResearch रोकें?`,tCt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?X6t(e):t==="fa"?Y6t(e):t==="ar"?Z6t(e):t==="es"?J6t(e):t==="hi"?eCt(e):Q6t(e)}),nCt=e=>`Leave ${e==null?void 0:e.count} submitted experiments running.`,rCt=e=>`让 ${e==null?void 0:e.count} 个已提交实验继续运行。`,sCt=e=>`${e==null?void 0:e.count} آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.`,iCt=e=>`إبقاء التجارب المُرسَلة قيد التشغيل (${e==null?void 0:e.count}).`,aCt=e=>`Dejará ${e==null?void 0:e.count} experimentos enviados en ejecución.`,oCt=e=>`${e==null?void 0:e.count} सबमिट किए गए प्रयोग चलते रहेंगे।`,cCt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?rCt(e):t==="fa"?sCt(e):t==="ar"?iCt(e):t==="es"?aCt(e):t==="hi"?oCt(e):nCt(e)}),lCt=()=>"Stop OpenResearch on host",uCt=()=>"停止主机上的 OpenResearch",_Ct=()=>"توقف OpenResearch روی میزبان",fCt=()=>"إيقاف OpenResearch على المضيف",dCt=()=>"Detener OpenResearch en el host",hCt=()=>"होस्ट पर OpenResearch रोकें",lL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?uCt():t==="fa"?_Ct():t==="ar"?fCt():t==="es"?dCt():t==="hi"?hCt():lCt()}),pCt=()=>"This will also:",mCt=()=>"这还将:",gCt=()=>"این کار همچنین:",vCt=()=>"سيؤدي هذا أيضًا إلى:",bCt=()=>"Esto también:",yCt=()=>"इससे यह भी होगा:",xCt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?mCt():t==="fa"?gCt():t==="ar"?vCt():t==="es"?bCt():t==="hi"?yCt():pCt()}),wCt=()=>"End 1 pending approval.",kCt=()=>"结束 1 个待审批请求。",SCt=()=>"۱ تأیید در انتظار را پایان می‌دهد.",CCt=()=>"إنهاء طلب موافقة معلّق واحد.",ECt=()=>"Cancelará 1 aprobación pendiente.",NCt=()=>"1 लंबित स्वीकृति खत्म होगी।",zCt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?kCt():t==="fa"?SCt():t==="ar"?CCt():t==="es"?ECt():t==="hi"?NCt():wCt()}),jCt=()=>"Leave 1 submitted experiment running.",TCt=()=>"让 1 个已提交实验继续运行。",ACt=()=>"۱ آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.",RCt=()=>"ترك تجربة مُرسَلة واحدة قيد التشغيل.",MCt=()=>"Dejará 1 experimento enviado en ejecución.",OCt=()=>"1 सबमिट किया गया प्रयोग चलता रहेगा।",DCt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?TCt():t==="fa"?ACt():t==="ar"?RCt():t==="es"?MCt():t==="hi"?OCt():jCt()}),LCt=()=>"Disconnect 1 other client.",ICt=()=>"断开 1 个其他客户端。",$Ct=()=>"اتصال ۱ کارخواه دیگر را قطع می‌کند.",BCt=()=>"قطع اتصال عميل آخر واحد.",PCt=()=>"Desconectará a otro cliente.",FCt=()=>"1 अन्य क्लाइंट डिस्कनेक्ट होगा।",HCt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ICt():t==="fa"?$Ct():t==="ar"?BCt():t==="es"?PCt():t==="hi"?FCt():LCt()}),qCt=()=>"Keep 1 queued message saved.",UCt=()=>"保留 1 条排队消息。",GCt=()=>"۱ پیام در صف را ذخیره نگه می‌دارد.",VCt=()=>"إبقاء رسالة واحدة محفوظة في قائمة الانتظار.",KCt=()=>"Conservará 1 mensaje en cola.",WCt=()=>"1 कतार में लगा संदेश सुरक्षित रहेगा।",QCt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?UCt():t==="fa"?GCt():t==="ar"?VCt():t==="es"?KCt():t==="hi"?WCt():qCt()}),XCt=()=>"Interrupt 1 active agent turn.",YCt=()=>"中断 1 个活动代理任务。",ZCt=()=>"۱ نوبت فعال عامل را قطع می‌کند.",JCt=()=>"مقاطعة جولة وكيل نشطة واحدة.",e7t=()=>"Interrumpirá 1 turno activo de un agente.",t7t=()=>"1 सक्रिय एजेंट टर्न बाधित होगा।",n7t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?YCt():t==="fa"?ZCt():t==="ar"?JCt():t==="es"?e7t():t==="hi"?t7t():XCt()}),r7t=e=>`Disconnect ${e==null?void 0:e.count} other clients.`,s7t=e=>`断开 ${e==null?void 0:e.count} 个其他客户端。`,i7t=e=>`اتصال ${e==null?void 0:e.count} کارخواه دیگر را قطع می‌کند.`,a7t=e=>`قطع اتصال العملاء الآخرين (${e==null?void 0:e.count}).`,o7t=e=>`Desconectará otros ${e==null?void 0:e.count} clientes.`,c7t=e=>`${e==null?void 0:e.count} अन्य क्लाइंट डिस्कनेक्ट होंगे।`,l7t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?s7t(e):t==="fa"?i7t(e):t==="ar"?a7t(e):t==="es"?o7t(e):t==="hi"?c7t(e):r7t(e)}),u7t=e=>`Keep ${e==null?void 0:e.count} queued messages saved.`,_7t=e=>`保留 ${e==null?void 0:e.count} 条排队消息。`,f7t=e=>`${e==null?void 0:e.count} پیام در صف را ذخیره نگه می‌دارد.`,d7t=e=>`إبقاء الرسائل في قائمة الانتظار محفوظة (${e==null?void 0:e.count}).`,h7t=e=>`Conservará ${e==null?void 0:e.count} mensajes en cola.`,p7t=e=>`${e==null?void 0:e.count} कतार में लगे संदेश सुरक्षित रहेंगे।`,m7t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?_7t(e):t==="fa"?f7t(e):t==="ar"?d7t(e):t==="es"?h7t(e):t==="hi"?p7t(e):u7t(e)}),g7t=e=>`Interrupt ${e==null?void 0:e.count} active agent turns.`,v7t=e=>`中断 ${e==null?void 0:e.count} 个活动代理任务。`,b7t=e=>`${e==null?void 0:e.count} نوبت فعال عامل را قطع می‌کند.`,y7t=e=>`مقاطعة جولات الوكلاء النشطة (${e==null?void 0:e.count}).`,x7t=e=>`Interrumpirá ${e==null?void 0:e.count} turnos activos de agentes.`,w7t=e=>`${e==null?void 0:e.count} सक्रिय एजेंट टर्न बाधित होंगे।`,k7t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?v7t(e):t==="fa"?b7t(e):t==="ar"?y7t(e):t==="es"?x7t(e):t==="hi"?w7t(e):g7t(e)}),S7t=()=>"Stopping host…",C7t=()=>"正在停止主机…",E7t=()=>"در حال توقف میزبان…",N7t=()=>"جارٍ إيقاف المضيف…",z7t=()=>"Deteniendo el host…",j7t=()=>"होस्ट रोका जा रहा है…",T7t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?C7t():t==="fa"?E7t():t==="ar"?N7t():t==="es"?z7t():t==="hi"?j7t():S7t()}),A7t=()=>"Update",R7t=()=>"更新",M7t=()=>"به‌روزرسانی",O7t=()=>"تحديث",D7t=()=>"Actualizar",L7t=()=>"अपडेट करें",Sz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?R7t():t==="fa"?M7t():t==="ar"?O7t():t==="es"?D7t():t==="hi"?L7t():A7t()}),I7t=e=>`The OpenResearch installation on ${e==null?void 0:e.host} is not compatible with this dashboard. Update it now?`,$7t=e=>`${e==null?void 0:e.host} 上的 OpenResearch 与此仪表板不兼容。现在更新吗?`,B7t=e=>`نسخهٔ OpenResearch روی ${e==null?void 0:e.host} با این داشبورد سازگار نیست. اکنون به‌روزرسانی شود؟`,P7t=e=>`نسخة OpenResearch المثبّتة على ${e==null?void 0:e.host} غير متوافقة مع هذه اللوحة. هل تريد تحديثها الآن؟`,F7t=e=>`La instalación de OpenResearch en ${e==null?void 0:e.host} no es compatible con este dashboard. ¿Actualizarla ahora?`,H7t=e=>`${e==null?void 0:e.host} पर OpenResearch इंस्टॉलेशन इस डैशबोर्ड के साथ संगत नहीं है। अभी अपडेट करें?`,q7t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?$7t(e):t==="fa"?B7t(e):t==="ar"?P7t(e):t==="es"?F7t(e):t==="hi"?H7t(e):I7t(e)}),U7t=()=>"Update OpenResearch?",G7t=()=>"更新 OpenResearch?",V7t=()=>"OpenResearch به‌روزرسانی شود؟",K7t=()=>"تحديث OpenResearch؟",W7t=()=>"¿Actualizar OpenResearch?",Q7t=()=>"OpenResearch अपडेट करें?",X7t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?G7t():t==="fa"?V7t():t==="ar"?K7t():t==="es"?W7t():t==="hi"?Q7t():U7t()}),Y7t=()=>"Updating…",Z7t=()=>"正在更新…",J7t=()=>"در حال به‌روزرسانی…",e8t=()=>"جارٍ التحديث…",t8t=()=>"Actualizando…",n8t=()=>"अपडेट हो रहा है…",r8t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Z7t():t==="fa"?J7t():t==="ar"?e8t():t==="es"?t8t():t==="hi"?n8t():Y7t()}),s8t=()=>"Disable syncing",i8t=()=>"关闭同步",a8t=()=>"غیرفعال کردن همگام‌سازی",o8t=()=>"تعطيل المزامنة",c8t=()=>"Desactivar sincronización",l8t=()=>"सिंकिंग बंद करें",u8t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?i8t():t==="fa"?a8t():t==="ar"?o8t():t==="es"?c8t():t==="hi"?l8t():s8t()}),_8t=()=>"Enable GitHub syncing",f8t=()=>"启用 GitHub 同步",d8t=()=>"فعال‌سازی همگام‌سازی GitHub",h8t=()=>"تفعيل مزامنة GitHub",p8t=()=>"Activar sincronización con GitHub",m8t=()=>"GitHub सिंकिंग चालू करें",g8t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?f8t():t==="fa"?d8t():t==="ar"?h8t():t==="es"?p8t():t==="hi"?m8t():_8t()}),v8t=()=>"Enabling…",b8t=()=>"正在启用…",y8t=()=>"در حال فعال‌سازی…",x8t=()=>"جارٍ التفعيل…",w8t=()=>"Activando…",k8t=()=>"चालू हो रहा है…",S8t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?b8t():t==="fa"?y8t():t==="ar"?x8t():t==="es"?w8t():t==="hi"?k8t():v8t()}),C8t=()=>"Updating…",E8t=()=>"正在更新…",N8t=()=>"در حال به‌روزرسانی…",z8t=()=>"جارٍ التحديث…",j8t=()=>"Actualizando…",T8t=()=>"अपडेट हो रहा है…",A8t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?E8t():t==="fa"?N8t():t==="ar"?z8t():t==="es"?j8t():t==="hi"?T8t():C8t()}),R8t=()=>"Reopen a previous chat",M8t=()=>"重新打开之前的聊天",O8t=()=>"بازکردن دوبارهٔ گفت‌وگوی قبلی",D8t=()=>"إعادة فتح محادثة سابقة",L8t=()=>"Vuelve a abrir un chat anterior",I8t=()=>"पिछली चैट फिर से खोलें",$8t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?M8t():t==="fa"?O8t():t==="ar"?D8t():t==="es"?L8t():t==="hi"?I8t():R8t()}),B8t=()=>"No chats to resume",P8t=()=>"没有可恢复的聊天",F8t=()=>"گفت‌وگویی برای ادامه وجود ندارد",H8t=()=>"لا توجد محادثات لاستئنافها",q8t=()=>"No hay chats que reanudar",U8t=()=>"फिर से शुरू करने के लिए कोई चैट नहीं है",G8t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?P8t():t==="fa"?F8t():t==="ar"?H8t():t==="es"?q8t():t==="hi"?U8t():B8t()}),V8t=()=>"From your terminal — adopting copies the transcript, and new turns continue there",K8t=()=>"来自你的终端 — 采用会复制记录,新的回合将在那里继续",W8t=()=>"از ترمینال شما — با پذیرفتن، رونوشت گفت‌وگو کپی می‌شود و نوبت‌های جدید همان‌جا ادامه می‌یابند",Q8t=()=>"من طرفيتك — التبنّي ينسخ النص، والجولات الجديدة تتابع هناك",X8t=()=>"Desde tu terminal — al adoptarlo se copia la transcripción y los turnos nuevos continúan allí",Y8t=()=>"आपके टर्मिनल से — अपनाने पर ट्रांसक्रिप्ट कॉपी होती है और नए टर्न वहीं जारी रहते हैं",Cz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?K8t():t==="fa"?W8t():t==="ar"?Q8t():t==="es"?X8t():t==="hi"?Y8t():V8t()}),Z8t=()=>"Search chats",J8t=()=>"搜索聊天",e9t=()=>"جست‌وجوی گفت‌وگوها",t9t=()=>"البحث في المحادثات",n9t=()=>"Buscar chats",r9t=()=>"चैट खोजें",Ez=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?J8t():t==="fa"?e9t():t==="ar"?t9t():t==="es"?n9t():t==="hi"?r9t():Z8t()}),s9t=()=>"Resume a chat",i9t=()=>"恢复聊天",a9t=()=>"ادامهٔ یک گفت‌وگو",o9t=()=>"استئناف محادثة",c9t=()=>"Reanudar un chat",l9t=()=>"चैट फिर से शुरू करें",Nz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?i9t():t==="fa"?a9t():t==="ar"?o9t():t==="es"?c9t():t==="hi"?l9t():s9t()}),u9t=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,_9t=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,f9t=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,d9t=e=>`إعادة المحاولة · المحاولة ${e==null?void 0:e.attempt}`,h9t=e=>`Reintentando · intento ${e==null?void 0:e.attempt}`,p9t=e=>`फिर से कोशिश · प्रयास ${e==null?void 0:e.attempt}`,m9t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?_9t(e):t==="fa"?f9t(e):t==="ar"?d9t(e):t==="es"?h9t(e):t==="hi"?p9t(e):u9t(e)}),g9t=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,v9t=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,b9t=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,y9t=e=>`إعادة المحاولة · المحاولة ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,x9t=e=>`Reintentando · intento ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,w9t=e=>`फिर से कोशिश · प्रयास ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,k9t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?v9t(e):t==="fa"?b9t(e):t==="ar"?y9t(e):t==="es"?x9t(e):t==="hi"?w9t(e):g9t(e)}),S9t=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · next attempt in ${e==null?void 0:e.seconds}s`,C9t=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,E9t=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,N9t=e=>`إعادة المحاولة · المحاولة ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · المحاولة التالية بعد ${e==null?void 0:e.seconds}ث`,z9t=e=>`Reintentando · intento ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · siguiente intento en ${e==null?void 0:e.seconds} s`,j9t=e=>`फिर से कोशिश · प्रयास ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · अगला प्रयास ${e==null?void 0:e.seconds}से में`,T9t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?C9t(e):t==="fa"?E9t(e):t==="ar"?N9t(e):t==="es"?z9t(e):t==="hi"?j9t(e):S9t(e)}),A9t=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,R9t=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,M9t=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,O9t=e=>`إعادة المحاولة · المحاولة ${e==null?void 0:e.attempt} · المحاولة التالية بعد ${e==null?void 0:e.seconds}ث`,D9t=e=>`Reintentando · intento ${e==null?void 0:e.attempt} · siguiente intento en ${e==null?void 0:e.seconds} s`,L9t=e=>`फिर से कोशिश · प्रयास ${e==null?void 0:e.attempt} · अगला प्रयास ${e==null?void 0:e.seconds}से में`,I9t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?R9t(e):t==="fa"?M9t(e):t==="ar"?O9t(e):t==="es"?D9t(e):t==="hi"?L9t(e):A9t(e)}),$9t=()=>"CLI is retrying…",B9t=()=>"CLI 正在重试…",P9t=()=>"CLI در حال تلاش دوباره است…",F9t=()=>"تعيد واجهة سطر الأوامر المحاولة…",H9t=()=>"La CLI está reintentando…",q9t=()=>"CLI फिर से कोशिश कर रहा है…",U9t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?B9t():t==="fa"?P9t():t==="ar"?F9t():t==="es"?H9t():t==="hi"?q9t():$9t()}),G9t=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,V9t=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,K9t=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,W9t=e=>`إعادة المحاولة · المحاولة التالية بعد ${e==null?void 0:e.seconds}ث`,Q9t=e=>`Reintentando · siguiente intento en ${e==null?void 0:e.seconds} s`,X9t=e=>`फिर से कोशिश · अगला प्रयास ${e==null?void 0:e.seconds}से में`,Y9t=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?V9t(e):t==="fa"?K9t(e):t==="ar"?W9t(e):t==="es"?Q9t(e):t==="hi"?X9t(e):G9t(e)}),Z9t=()=>"Sending again…",J9t=()=>"正在重新发送…",eEt=()=>"در حال ارسال دوباره…",tEt=()=>"جارٍ إعادة الإرسال…",nEt=()=>"Reenviando…",rEt=()=>"फिर से भेजा जा रहा है…",sEt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?J9t():t==="fa"?eEt():t==="ar"?tEt():t==="es"?nEt():t==="hi"?rEt():Z9t()}),iEt=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,aEt=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,oEt=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,cEt=e=>`إعادة الإرسال بعد ${e==null?void 0:e.seconds}ث…`,lEt=e=>`Reenviando en ${e==null?void 0:e.seconds} s…`,uEt=e=>`${e==null?void 0:e.seconds}से में फिर से भेजा जाएगा…`,_Et=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?aEt(e):t==="fa"?oEt(e):t==="ar"?cEt(e):t==="es"?lEt(e):t==="hi"?uEt(e):iEt(e)}),fEt=()=>"Retrying…",dEt=()=>"正在重试…",hEt=()=>"در حال تلاش دوباره…",pEt=()=>"جارٍ إعادة المحاولة…",mEt=()=>"Reintentando…",gEt=()=>"फिर से कोशिश हो रही है…",uL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dEt():t==="fa"?hEt():t==="ar"?pEt():t==="es"?mEt():t==="hi"?gEt():fEt()}),vEt=()=>"Default speed",bEt=()=>"默认速度",yEt=()=>"سرعت پیش‌فرض",xEt=()=>"السرعة الافتراضية",wEt=()=>"Velocidad predeterminada",kEt=()=>"डिफ़ॉल्ट गति",SEt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bEt():t==="fa"?yEt():t==="ar"?xEt():t==="es"?wEt():t==="hi"?kEt():vEt()}),CEt=()=>"Standard",EEt=()=>"标准",NEt=()=>"استاندارد",zEt=()=>"قياسي",jEt=()=>"Estándar",TEt=()=>"स्टैंडर्ड",AEt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?EEt():t==="fa"?NEt():t==="ar"?zEt():t==="es"?jEt():t==="hi"?TEt():CEt()}),REt=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,MEt=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,OEt=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,DEt=e=>` أضِف ${e==null?void 0:e.directory} إلى PATH لاستخدامه.`,LEt=e=>` Añade ${e==null?void 0:e.directory} a tu PATH para usarlo.`,IEt=e=>` इसे इस्तेमाल करने के लिए ${e==null?void 0:e.directory} को अपने PATH में जोड़ें।`,$Et=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?MEt(e):t==="fa"?OEt(e):t==="ar"?DEt(e):t==="es"?LEt(e):t==="hi"?IEt(e):REt(e)}),BEt=()=>"Appearance",PEt=()=>"外观",FEt=()=>"ظاهر",HEt=()=>"المظهر",qEt=()=>"Apariencia",UEt=()=>"रूप-रंग",GEt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?PEt():t==="fa"?FEt():t==="ar"?HEt():t==="es"?qEt():t==="hi"?UEt():BEt()}),VEt=()=>"Check",KEt=()=>"检查",WEt=()=>"بررسی",QEt=()=>"فحص",XEt=()=>"Comprobar",YEt=()=>"जाँचें",ZEt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?KEt():t==="fa"?WEt():t==="ar"?QEt():t==="es"?XEt():t==="hi"?YEt():VEt()}),JEt=()=>"Check again",eNt=()=>"再次检查",tNt=()=>"بررسی دوباره",nNt=()=>"تحقق مجددًا",rNt=()=>"Volver a comprobar",sNt=()=>"फिर से जाँचें",km=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?eNt():t==="fa"?tNt():t==="ar"?nNt():t==="es"?rNt():t==="hi"?sNt():JEt()}),iNt=()=>"Check for updates",aNt=()=>"检查更新",oNt=()=>"بررسی به‌روزرسانی",cNt=()=>"التحقق من التحديثات",lNt=()=>"Buscar actualizaciones",uNt=()=>"अपडेट के लिए जाँचें",_Nt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?aNt():t==="fa"?oNt():t==="ar"?cNt():t==="es"?lNt():t==="hi"?uNt():iNt()}),fNt=()=>"Check now",dNt=()=>"立即检查",hNt=()=>"اکنون بررسی کن",pNt=()=>"التحقق الآن",mNt=()=>"Comprobar ahora",gNt=()=>"अभी जाँचें",vNt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dNt():t==="fa"?hNt():t==="ar"?pNt():t==="es"?mNt():t==="hi"?gNt():fNt()}),bNt=()=>"Check setup",yNt=()=>"检查设置",xNt=()=>"بررسی راه‌اندازی",wNt=()=>"فحص الإعداد",kNt=()=>"Comprobar configuración",SNt=()=>"सेटअप जाँचें",CNt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yNt():t==="fa"?xNt():t==="ar"?wNt():t==="es"?kNt():t==="hi"?SNt():bNt()}),ENt=()=>"orx checks a few times a day on its own.",NNt=()=>"orx 每天会自动检查几次。",zNt=()=>"orx روزی چند بار خودکار بررسی می‌کند.",jNt=()=>"يتحقق orx بضع مرات يوميًا تلقائيًا.",TNt=()=>"orx lo comprueba por sí solo varias veces al día.",ANt=()=>"orx खुद दिन में कुछ बार जाँच करता है।",RNt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?NNt():t==="fa"?zNt():t==="ar"?jNt():t==="es"?TNt():t==="hi"?ANt():ENt()}),MNt=()=>"Choose a flavor",ONt=()=>"选择配置",DNt=()=>"انتخاب پیکربندی",LNt=()=>"اختر تكوين الموارد",INt=()=>"Elige una opción",$Nt=()=>"एक फ़्लेवर चुनें",BNt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ONt():t==="fa"?DNt():t==="ar"?LNt():t==="es"?INt():t==="hi"?$Nt():MNt()}),PNt=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,FNt=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,HNt=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,qNt=e=>`اختر تكوين الموارد لاستخدام ${e==null?void 0:e.destination} في عمليات التشغيل الجديدة.`,UNt=e=>`Elige una opción para usar ${e==null?void 0:e.destination} en las nuevas ejecuciones.`,GNt=e=>`नए रन के लिए ${e==null?void 0:e.destination} इस्तेमाल करने के लिए एक फ़्लेवर चुनें।`,VNt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?FNt(e):t==="fa"?HNt(e):t==="ar"?qNt(e):t==="es"?UNt(e):t==="hi"?GNt(e):PNt(e)}),KNt=()=>"clean",WNt=()=>"无更改",QNt=()=>"بدون تغییر",XNt=()=>"نظيف",YNt=()=>"sin cambios",ZNt=()=>"साफ़",JNt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?WNt():t==="fa"?QNt():t==="ar"?XNt():t==="es"?YNt():t==="hi"?ZNt():KNt()}),ezt=e=>`Already linked at ${e==null?void 0:e.link}.`,tzt=e=>`已链接到 ${e==null?void 0:e.link}。`,nzt=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,rzt=e=>`مرتبط بالفعل في ${e==null?void 0:e.link}.`,szt=e=>`Ya está enlazado en ${e==null?void 0:e.link}.`,izt=e=>`पहले से ${e==null?void 0:e.link} पर लिंक है।`,azt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?tzt(e):t==="fa"?nzt(e):t==="ar"?rzt(e):t==="es"?szt(e):t==="hi"?izt(e):ezt(e)}),ozt=e=>`Linked ${e==null?void 0:e.link}.`,czt=e=>`已链接 ${e==null?void 0:e.link}。`,lzt=e=>`${e==null?void 0:e.link} پیوند شد.`,uzt=e=>`تم إنشاء الرابط ${e==null?void 0:e.link}.`,_zt=e=>`Enlazado en ${e==null?void 0:e.link}.`,fzt=e=>`${e==null?void 0:e.link} लिंक किया गया।`,dzt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?czt(e):t==="fa"?lzt(e):t==="ar"?uzt(e):t==="es"?_zt(e):t==="hi"?fzt(e):ozt(e)}),hzt=()=>"Close terminal",pzt=()=>"关闭终端",mzt=()=>"بستن ترمینال",gzt=()=>"إغلاق الطرفية",vzt=()=>"Cerrar la terminal",bzt=()=>"टर्मिनल बंद करें",zz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pzt():t==="fa"?mzt():t==="ar"?gzt():t==="es"?vzt():t==="hi"?bzt():hzt()}),yzt=()=>"Terminal closed",xzt=()=>"终端已关闭",wzt=()=>"ترمینال بسته شد",kzt=()=>"أُغلقت الطرفية",Szt=()=>"Terminal cerrada",Czt=()=>"टर्मिनल बंद हो गया",Ezt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xzt():t==="fa"?wzt():t==="ar"?kzt():t==="es"?Szt():t==="hi"?Czt():yzt()}),Nzt=()=>"Finished",zzt=()=>"已完成",jzt=()=>"انجام شد",Tzt=()=>"اكتمل",Azt=()=>"Finalizado",Rzt=()=>"पूर्ण",Mzt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zzt():t==="fa"?jzt():t==="ar"?Tzt():t==="es"?Azt():t==="hi"?Rzt():Nzt()}),Ozt=()=>"Command failed",Dzt=()=>"命令失败",Lzt=()=>"دستور ناموفق بود",Izt=()=>"فشل الأمر",$zt=()=>"El comando falló",Bzt=()=>"कमांड विफल रही",Pzt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Dzt():t==="fa"?Lzt():t==="ar"?Izt():t==="es"?$zt():t==="hi"?Bzt():Ozt()}),Fzt=()=>"Running…",Hzt=()=>"运行中…",qzt=()=>"در حال اجرا…",Uzt=()=>"قيد التشغيل…",Gzt=()=>"Ejecutando…",Vzt=()=>"चल रहा है…",Kzt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Hzt():t==="fa"?qzt():t==="ar"?Uzt():t==="es"?Gzt():t==="hi"?Vzt():Fzt()}),Wzt=()=>"Connect",Qzt=()=>"连接",Xzt=()=>"اتصال",Yzt=()=>"اتصال",Zzt=()=>"Conectar",Jzt=()=>"कनेक्ट करें",eS=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Qzt():t==="fa"?Xzt():t==="ar"?Yzt():t==="es"?Zzt():t==="hi"?Jzt():Wzt()}),ejt=()=>"Connected via GitHub CLI",tjt=()=>"已通过 GitHub CLI 连接",njt=()=>"از طریق GitHub CLI متصل است",rjt=()=>"متصل عبر واجهة GitHub لسطر الأوامر",sjt=()=>"Conectado mediante GitHub CLI",ijt=()=>"GitHub CLI के ज़रिए कनेक्टेड",_L=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tjt():t==="fa"?njt():t==="ar"?rjt():t==="es"?sjt():t==="hi"?ijt():ejt()}),ajt=()=>"Connecting…",ojt=()=>"正在连接…",cjt=()=>"در حال اتصال…",ljt=()=>"جارٍ الاتصال…",ujt=()=>"Conectando…",_jt=()=>"कनेक्ट हो रहा है…",fL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ojt():t==="fa"?cjt():t==="ar"?ljt():t==="es"?ujt():t==="hi"?_jt():ajt()}),fjt=e=>`CPU cores: ${e==null?void 0:e.count}`,djt=e=>`${e==null?void 0:e.count} 个 CPU 核心`,hjt=e=>`${e==null?void 0:e.count} هستهٔ CPU`,pjt=e=>`أنوية المعالج: ${e==null?void 0:e.count}`,mjt=e=>`Núcleos de CPU: ${e==null?void 0:e.count}`,gjt=e=>`CPU कोर: ${e==null?void 0:e.count}`,vjt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?djt(e):t==="fa"?hjt(e):t==="ar"?pjt(e):t==="es"?mjt(e):t==="hi"?gjt(e):fjt(e)}),bjt=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",yjt=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",xjt=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",wjt=()=>"أنشئ مستودعًا خاصًا وارفع فروع التجارب تلقائيًا ليطّلع عليها المتعاونون.",kjt=()=>"Crear un repositorio privado y subir automáticamente las ramas de los experimentos para que las vean tus colaboradores.",Sjt=()=>"एक निजी रिपॉज़िटरी बनाएं और सहयोगी दृश्यता के लिए प्रयोग ब्रांच अपने आप पुश करें।",Cjt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yjt():t==="fa"?xjt():t==="ar"?wjt():t==="es"?kjt():t==="hi"?Sjt():bjt()}),Ejt=()=>"the current project",Njt=()=>"当前项目",zjt=()=>"پروژهٔ فعلی",jjt=()=>"المشروع الحالي",Tjt=()=>"el proyecto actual",Ajt=()=>"मौजूदा प्रोजेक्ट",Rjt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Njt():t==="fa"?zjt():t==="ar"?jjt():t==="es"?Tjt():t==="hi"?Ajt():Ejt()}),Mjt=e=>`${e==null?void 0:e.value} (custom)`,Ojt=e=>`${e==null?void 0:e.value}(自定义)`,Djt=e=>`${e==null?void 0:e.value} (سفارشی)`,Ljt=e=>`${e==null?void 0:e.value} (مخصص)`,Ijt=e=>`${e==null?void 0:e.value} (personalizado)`,$jt=e=>`${e==null?void 0:e.value} (कस्टम)`,Bjt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Ojt(e):t==="fa"?Djt(e):t==="ar"?Ljt(e):t==="es"?Ijt(e):t==="hi"?$jt(e):Mjt(e)}),Pjt=()=>"detached",Fjt=()=>"分离头指针",Hjt=()=>"جدا از شاخه",qjt=()=>"منفصل",Ujt=()=>"desacoplado",Gjt=()=>"डिटैच्ड",tS=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Fjt():t==="fa"?Hjt():t==="ar"?qjt():t==="es"?Ujt():t==="hi"?Gjt():Pjt()}),Vjt=()=>"Disconnected",Kjt=()=>"已断开连接",Wjt=()=>"قطع اتصال",Qjt=()=>"غير متصل",Xjt=()=>"Desconectado",Yjt=()=>"डिस्कनेक्ट हो गया",dL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Kjt():t==="fa"?Wjt():t==="ar"?Qjt():t==="es"?Xjt():t==="hi"?Yjt():Vjt()}),Zjt=()=>"Environment tab",Jjt=()=>"环境标签页",eTt=()=>"زبانهٔ محیط",tTt=()=>"تبويب البيئة",nTt=()=>"pestaña Entorno",rTt=()=>"एनवायरनमेंट टैब",sTt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Jjt():t==="fa"?eTt():t==="ar"?tTt():t==="es"?nTt():t==="hi"?rTt():Zjt()}),iTt=()=>"Free models · No sign-in required",aTt=()=>"免费模型 · 无需登录",oTt=()=>"مدل‌های رایگان · بدون نیاز به ورود",cTt=()=>"نماذج مجانية · لا يلزم تسجيل الدخول",lTt=()=>"Modelos gratuitos · No es necesario iniciar sesión",uTt=()=>"मुफ़्त मॉडल · साइन-इन ज़रूरी नहीं",_Tt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?aTt():t==="fa"?oTt():t==="ar"?cTt():t==="es"?lTt():t==="hi"?uTt():iTt()}),fTt=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,dTt=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,hTt=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,pTt=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,mTt=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,gTt=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,vTt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?dTt(e):t==="fa"?hTt(e):t==="ar"?pTt(e):t==="es"?mTt(e):t==="hi"?gTt(e):fTt(e)}),bTt=()=>"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.",yTt=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",xTt=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",wTt=()=>"رفض GitHub رفع التغييرات لأن هذا المستودع مؤرشف وللقراءة فقط. لا يزال المشروع المحلي متاحًا. ألغِ أرشفة المستودع على GitHub، ثم فعّل المزامنة هنا.",kTt=()=>"GitHub rechazó el push porque este repositorio está archivado y es de solo lectura. El proyecto local sigue disponible. Desarchiva el repositorio en GitHub y vuelve a activar la sincronización aquí.",STt=()=>"GitHub ने पुश अस्वीकार कर दिया क्योंकि यह रिपॉज़िटरी आर्काइव और रीड-ओनली है। लोकल प्रोजेक्ट अब भी उपलब्ध है। GitHub पर रिपॉज़िटरी को अनआर्काइव करें, फिर यहाँ सिंकिंग चालू करें।",CTt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yTt():t==="fa"?xTt():t==="ar"?wTt():t==="es"?kTt():t==="hi"?STt():bTt()}),ETt=()=>"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.",NTt=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",zTt=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",jTt=()=>"يحتوي GitHub على تغييرات ليست في هذا المشروع المحلي. اسحب أحدث تغييرات GitHub وحُلّ أي تعارضات في Git، ثم أعد محاولة تفعيل المزامنة.",TTt=()=>"GitHub tiene cambios que no están en este proyecto local. Descarga los últimos cambios de GitHub, resuelve los conflictos en Git y vuelve a intentar activar la sincronización.",ATt=()=>"GitHub में ऐसे बदलाव हैं जो इस लोकल प्रोजेक्ट में नहीं हैं। नवीनतम GitHub बदलाव पुल करें और Git में किसी भी टकराव को सुलझाएं, फिर सिंकिंग फिर से चालू करने की कोशिश करें।",RTt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?NTt():t==="fa"?zTt():t==="ar"?jTt():t==="es"?TTt():t==="hi"?ATt():ETt()}),MTt=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",OTt=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",DTt=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",LTt=()=>"رفض GitHub رفع التغييرات. تأكد من أن حسابك المتصل يملك صلاحية الكتابة على هذا المستودع، ثم حاول مجددًا.",ITt=()=>"GitHub rechazó el push. Asegúrate de que tu cuenta conectada tiene permiso de escritura en este repositorio y vuelve a intentarlo.",$Tt=()=>"GitHub ने पुश अस्वीकार कर दिया। सुनिश्चित करें कि आपके कनेक्टेड खाते के पास इस रिपॉज़िटरी में राइट एक्सेस है, फिर फिर से कोशिश करें।",BTt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?OTt():t==="fa"?DTt():t==="ar"?LTt():t==="es"?ITt():t==="hi"?$Tt():MTt()}),PTt=e=>`GPU × ${e==null?void 0:e.count}`,FTt=e=>`${e==null?void 0:e.count} 个 GPU`,HTt=e=>`${e==null?void 0:e.count} پردازندهٔ گرافیکی`,qTt=e=>`معالج رسومات × ${e==null?void 0:e.count}`,UTt=e=>`GPU × ${e==null?void 0:e.count}`,GTt=e=>`GPU × ${e==null?void 0:e.count}`,VTt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?FTt(e):t==="fa"?HTt(e):t==="ar"?qTt(e):t==="es"?UTt(e):t==="hi"?GTt(e):PTt(e)}),KTt=()=>"has changes",WTt=()=>"有更改",QTt=()=>"دارای تغییر",XTt=()=>"به تغييرات",YTt=()=>"con cambios",ZTt=()=>"बदलाव हैं",JTt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?WTt():t==="fa"?QTt():t==="ar"?XTt():t==="es"?YTt():t==="hi"?ZTt():KTt()}),eAt=e=>`This token is valid but does not report whether it can launch Jobs; OAuth tokens from ${e==null?void 0:e.login} never do. Launches may still work. For a definitive check, save a write-scoped token from ${e==null?void 0:e.url}.`,tAt=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,nAt=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,rAt=e=>`هذا الرمز صالح لكنه لا يبيّن ما إن كان قادرًا على إطلاق المهام؛ ورموز OAuth من ${e==null?void 0:e.login} لا تبيّن ذلك أبدًا. قد ينجح الإطلاق رغم ذلك. للتحقق القاطع، احفظ رمزًا بصلاحية الكتابة من ${e==null?void 0:e.url}.`,sAt=e=>`Este token es válido, pero no indica si puede lanzar Jobs; los tokens OAuth de ${e==null?void 0:e.login} nunca lo indican. Puede que los lanzamientos funcionen igualmente. Para comprobarlo con seguridad, guarda un token con permiso de escritura desde ${e==null?void 0:e.url}.`,iAt=e=>`यह टोकन मान्य है पर यह नहीं बताता कि यह Jobs लॉन्च कर सकता है या नहीं; ${e==null?void 0:e.login} से मिले OAuth टोकन कभी नहीं बताते। लॉन्च फिर भी काम कर सकता है। निश्चित जाँच के लिए, ${e==null?void 0:e.url} से एक राइट-स्कोप्ड टोकन सेव करें।`,aAt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?tAt(e):t==="fa"?nAt(e):t==="ar"?rAt(e):t==="es"?sAt(e):t==="hi"?iAt(e):eAt(e)}),oAt=()=>"This token is valid, but cannot submit Hugging Face Jobs. Create a token with Jobs write permission in Hugging Face token settings, then replace it here.",cAt=()=>"此令牌有效,但无法提交 Hugging Face 任务。请在 Hugging Face 令牌设置中创建具有 Jobs 写入权限的令牌,然后在此处替换。",lAt=()=>"این توکن معتبر است، اما اجازهٔ ارسال کار به Hugging Face را ندارد. در تنظیمات توکن Hugging Face، توکنی با مجوز نوشتن Jobs بسازید و آن را اینجا جایگزین کنید.",uAt=()=>"هذا الرمز صالح لكنه لا يستطيع إرسال مهام Hugging Face. أنشئ رمزًا بصلاحية كتابة المهام في إعدادات رموز Hugging Face، ثم استبدله هنا.",_At=()=>"Este token es válido, pero no puede enviar Hugging Face Jobs. Crea un token con permiso de escritura en Jobs desde la configuración de tokens de Hugging Face y reemplázalo aquí.",fAt=()=>"यह टोकन मान्य है, पर Hugging Face Jobs सबमिट नहीं कर सकता। Hugging Face टोकन सेटिंग्स में Jobs राइट अनुमति वाला टोकन बनाएं, फिर इसे यहाँ बदलें।",dAt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cAt():t==="fa"?lAt():t==="ar"?uAt():t==="es"?_At():t==="hi"?fAt():oAt()}),hAt=()=>"Install",pAt=()=>"安装",mAt=()=>"نصب",gAt=()=>"تثبيت",vAt=()=>"Instalar",bAt=()=>"इंस्टॉल करें",yAt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pAt():t==="fa"?mAt():t==="ar"?gAt():t==="es"?vAt():t==="hi"?bAt():hAt()}),xAt=e=>`Adds ${e==null?void 0:e.command} to your terminal, pointing at this app, so the CLI and app are always the same version.`,wAt=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,kAt=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,SAt=e=>`يضيف ${e==null?void 0:e.command} إلى طرفيتك موجّهًا إلى هذا التطبيق، بحيث تكون واجهة سطر الأوامر والتطبيق دائمًا بالإصدار نفسه.`,CAt=e=>`Añade ${e==null?void 0:e.command} a tu terminal, apuntando a esta app, para que la CLI y la app tengan siempre la misma versión.`,EAt=e=>`आपके टर्मिनल में ${e==null?void 0:e.command} जोड़ता है, जो इसी ऐप की ओर इशारा करता है, ताकि CLI और ऐप हमेशा एक ही वर्शन के रहें।`,NAt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?wAt(e):t==="fa"?kAt(e):t==="ar"?SAt(e):t==="es"?CAt(e):t==="hi"?EAt(e):xAt(e)}),zAt=e=>`Install the ${e==null?void 0:e.command} command`,jAt=e=>`安装 ${e==null?void 0:e.command} 命令`,TAt=e=>`نصب فرمان ${e==null?void 0:e.command}`,AAt=e=>`تثبيت أمر ${e==null?void 0:e.command}`,RAt=e=>`Instalar el comando ${e==null?void 0:e.command}`,MAt=e=>`${e==null?void 0:e.command} कमांड इंस्टॉल करें`,OAt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?jAt(e):t==="fa"?TAt(e):t==="ar"?AAt(e):t==="es"?RAt(e):t==="hi"?MAt(e):zAt(e)}),DAt=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",LAt=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",IAt=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",$At=()=>"ثبّت واجهة GitHub لسطر الأوامر، ثم نفّذ `gh auth login` في طرفيتك.",BAt=()=>"Instala GitHub CLI y ejecuta `gh auth login` en tu terminal.",PAt=()=>"GitHub CLI इंस्टॉल करें, फिर अपने टर्मिनल में `gh auth login` चलाएं।",FAt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?LAt():t==="fa"?IAt():t==="ar"?$At():t==="es"?BAt():t==="hi"?PAt():DAt()}),HAt=()=>"Install the new release now instead of waiting for the background update.",qAt=()=>"立即安装新版本,无需等待后台更新。",UAt=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",GAt=()=>"ثبّت الإصدار الجديد الآن بدلًا من انتظار التحديث في الخلفية.",VAt=()=>"Instala la nueva versión ahora en lugar de esperar a la actualización en segundo plano.",KAt=()=>"बैकग्राउंड अपडेट का इंतज़ार करने की बजाय अभी नया रिलीज़ इंस्टॉल करें।",WAt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qAt():t==="fa"?UAt():t==="ar"?GAt():t==="es"?VAt():t==="hi"?KAt():HAt()}),QAt=()=>"Discard your unsaved Kubernetes changes?",XAt=()=>"要放弃未保存的 Kubernetes 更改吗?",YAt=()=>"تغییرات ذخیره‌نشدهٔ Kubernetes کنار گذاشته شود؟",ZAt=()=>"تجاهل تغييرات Kubernetes غير المحفوظة؟",JAt=()=>"¿Descartar los cambios sin guardar de Kubernetes?",eRt=()=>"आपके सेव न किए गए Kubernetes बदलाव छोड़ें?",tRt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?XAt():t==="fa"?YAt():t==="ar"?ZAt():t==="es"?JAt():t==="hi"?eRt():QAt()}),nRt=()=>"Key from",rRt=()=>"密钥来自",sRt=()=>"کلید از",iRt=()=>"المفتاح من",aRt=()=>"Clave tomada de la",oRt=()=>"की स्रोत",cRt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rRt():t==="fa"?sRt():t==="ar"?iRt():t==="es"?aRt():t==="hi"?oRt():nRt()}),lRt=()=>"Use current kubectl context",uRt=()=>"使用当前 kubectl 上下文",_Rt=()=>"استفاده از کانتکست فعلی kubectl",fRt=()=>"استخدام سياق kubectl الحالي",dRt=()=>"Usar el contexto actual de kubectl",hRt=()=>"मौजूदा kubectl कॉन्टेक्स्ट इस्तेमाल करें",pRt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?uRt():t==="fa"?_Rt():t==="ar"?fRt():t==="es"?dRt():t==="hi"?hRt():lRt()}),mRt=e=>`Use current context (${e==null?void 0:e.context})`,gRt=e=>`使用当前上下文(${e==null?void 0:e.context})`,vRt=e=>`استفاده از کانتکست فعلی (${e==null?void 0:e.context})`,bRt=e=>`استخدام السياق الحالي (${e==null?void 0:e.context})`,yRt=e=>`Usar el contexto actual (${e==null?void 0:e.context})`,xRt=e=>`मौजूदा कॉन्टेक्स्ट इस्तेमाल करें (${e==null?void 0:e.context})`,wRt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?gRt(e):t==="fa"?vRt(e):t==="ar"?bRt(e):t==="es"?yRt(e):t==="hi"?xRt(e):mRt(e)}),kRt=()=>"Language",SRt=()=>"语言",CRt=()=>"زبان",ERt=()=>"اللغة",NRt=()=>"Idioma",zRt=()=>"भाषा",jRt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?SRt():t==="fa"?CRt():t==="ar"?ERt():t==="es"?NRt():t==="hi"?zRt():kRt()}),TRt=e=>`Run ${e==null?void 0:e.command} in a terminal to sign in.`,ARt=e=>`在终端中运行 ${e==null?void 0:e.command} 以登录。`,RRt=e=>`برای ورود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,MRt=e=>`نفّذ ${e==null?void 0:e.command} في الطرفية لتسجيل الدخول.`,ORt=e=>`Ejecuta ${e==null?void 0:e.command} en una terminal para iniciar sesión.`,DRt=e=>`साइन इन करने के लिए टर्मिनल में ${e==null?void 0:e.command} चलाएं।`,LRt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?ARt(e):t==="fa"?RRt(e):t==="ar"?MRt(e):t==="es"?ORt(e):t==="hi"?DRt(e):TRt(e)}),IRt=()=>"Make default",$Rt=()=>"设为默认值",BRt=()=>"پیش‌فرض شود",PRt=()=>"جعله افتراضيًا",FRt=()=>"Establecer como predeterminado",HRt=()=>"डिफ़ॉल्ट बनाएं",qRt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$Rt():t==="fa"?BRt():t==="ar"?PRt():t==="es"?FRt():t==="hi"?HRt():IRt()}),URt=()=>"Modal credentials are set in the process environment. Remove those overrides before replacing the token here.",GRt=()=>"Modal 凭据已在进程环境中设置。请先移除这些覆盖设置,再在此处替换令牌。",VRt=()=>"اعتبارنامه‌های Modal در محیط فرایند تنظیم شده‌اند. پیش از جایگزینی توکن در اینجا، این تنظیمات را حذف کنید.",KRt=()=>"بيانات اعتماد Modal مضبوطة في بيئة العملية. أزِل تلك التجاوزات قبل استبدال الرمز هنا.",WRt=()=>"Las credenciales de Modal están definidas en el entorno del proceso. Elimínalas antes de reemplazar el token aquí.",QRt=()=>"Modal क्रेडेंशियल प्रोसेस एनवायरनमेंट में सेट हैं। यहाँ सेव टोकन बदलने से पहले उन ओवरराइड को हटाएं।",XRt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?GRt():t==="fa"?VRt():t==="ar"?KRt():t==="es"?WRt():t==="hi"?QRt():URt()}),YRt=()=>"Replace token ID",ZRt=()=>"替换令牌 ID",JRt=()=>"جایگزینی شناسهٔ توکن",eMt=()=>"استبدال معرّف الرمز",tMt=()=>"Reemplazar ID del token",nMt=()=>"टोकन ID बदलें",rMt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ZRt():t==="fa"?JRt():t==="ar"?eMt():t==="es"?tMt():t==="hi"?nMt():YRt()}),sMt=()=>"Replace token secret",iMt=()=>"替换令牌密钥",aMt=()=>"جایگزینی رمز توکن",oMt=()=>"استبدال سرّ الرمز",cMt=()=>"Reemplazar secreto del token",lMt=()=>"टोकन सीक्रेट बदलें",uMt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?iMt():t==="fa"?aMt():t==="ar"?oMt():t==="es"?cMt():t==="hi"?lMt():sMt()}),_Mt=()=>"How to get a Modal token",fMt=()=>"如何获取 Modal 令牌",dMt=()=>"روش دریافت توکن Modal",hMt=()=>"كيفية الحصول على رمز Modal",pMt=()=>"Cómo obtener un token de Modal",mMt=()=>"Modal टोकन कैसे लें",gMt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fMt():t==="fa"?dMt():t==="ar"?hMt():t==="es"?pMt():t==="hi"?mMt():_Mt()}),vMt=()=>"Token ID",bMt=()=>"令牌 ID",yMt=()=>"شناسهٔ توکن",xMt=()=>"معرّف الرمز",wMt=()=>"ID del token",kMt=()=>"टोकन ID",SMt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bMt():t==="fa"?yMt():t==="ar"?xMt():t==="es"?wMt():t==="hi"?kMt():vMt()}),CMt=()=>"Token secret",EMt=()=>"令牌密钥",NMt=()=>"رمز توکن",zMt=()=>"سرّ الرمز",jMt=()=>"Secreto del token",TMt=()=>"टोकन सीक्रेट",AMt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?EMt():t==="fa"?NMt():t==="ar"?zMt():t==="es"?jMt():t==="hi"?TMt():CMt()}),RMt=e=>`${e==null?void 0:e.count} models available — ${e==null?void 0:e.models}`,MMt=e=>`${e==null?void 0:e.count} 个模型可用 — ${e==null?void 0:e.models}`,OMt=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,DMt=e=>`النماذج المتاحة: ${e==null?void 0:e.count} — ${e==null?void 0:e.models}`,LMt=e=>`Modelos disponibles (${e==null?void 0:e.count}): ${e==null?void 0:e.models}`,IMt=e=>`${e==null?void 0:e.count} मॉडल उपलब्ध — ${e==null?void 0:e.models}`,$Mt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?MMt(e):t==="fa"?OMt(e):t==="ar"?DMt(e):t==="es"?LMt(e):t==="hi"?IMt(e):RMt(e)}),BMt=e=>`Needs ${e==null?void 0:e.tool}`,PMt=e=>`需要 ${e==null?void 0:e.tool}`,FMt=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,HMt=e=>`يحتاج إلى ${e==null?void 0:e.tool}`,qMt=e=>`Requiere ${e==null?void 0:e.tool}`,UMt=e=>`${e==null?void 0:e.tool} की ज़रूरत है`,GMt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?PMt(e):t==="fa"?FMt(e):t==="ar"?HMt(e):t==="es"?qMt(e):t==="hi"?UMt(e):BMt(e)}),VMt=()=>"Needs tools",KMt=()=>"缺少工具",WMt=()=>"به ابزارها نیاز دارد",QMt=()=>"يحتاج إلى أدوات",XMt=()=>"Requiere herramientas",YMt=()=>"टूल की ज़रूरत है",ZMt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?KMt():t==="fa"?WMt():t==="ar"?QMt():t==="es"?XMt():t==="hi"?YMt():VMt()}),JMt=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,eOt=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,tOt=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,nOt=e=>`تستخدم عمليات التشغيل الجديدة ${e==null?void 0:e.destination} ما لم تُحدَّد بيئة تنفيذ أخرى.`,rOt=e=>`Las nuevas ejecuciones usan ${e==null?void 0:e.destination}, salvo que se indique otro backend.`,sOt=e=>`जब तक कोई और बैकएंड न बताया जाए, नए रन ${e==null?void 0:e.destination} इस्तेमाल करते हैं।`,iOt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?eOt(e):t==="fa"?tOt(e):t==="ar"?nOt(e):t==="es"?rOt(e):t==="hi"?sOt(e):JMt(e)}),aOt=()=>"New runs use SSH; choose a host when launching.",oOt=()=>"新运行将使用 SSH;启动时请选择主机。",cOt=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",lOt=()=>"تستخدم عمليات التشغيل الجديدة SSH؛ اختر مضيفًا عند الإطلاق.",uOt=()=>"Las nuevas ejecuciones usan SSH; elige un host al lanzarlas.",_Ot=()=>"नए रन SSH इस्तेमाल करते हैं; लॉन्च करते समय एक होस्ट चुनें।",fOt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?oOt():t==="fa"?cOt():t==="ar"?lOt():t==="es"?uOt():t==="hi"?_Ot():aOt()}),dOt=()=>"New token",hOt=()=>"新令牌",pOt=()=>"توکن جدید",mOt=()=>"رمز جديد",gOt=()=>"Nuevo token",vOt=()=>"नया टोकन",bOt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hOt():t==="fa"?pOt():t==="ar"?mOt():t==="es"?gOt():t==="hi"?vOt():dOt()}),yOt=()=>"No default flavor",xOt=()=>"不设默认配置",wOt=()=>"بدون پیکربندی پیش‌فرض",kOt=()=>"لا يوجد تكوين افتراضي للموارد",SOt=()=>"Sin opción predeterminada",COt=()=>"कोई डिफ़ॉल्ट फ़्लेवर नहीं",EOt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xOt():t==="fa"?wOt():t==="ar"?kOt():t==="es"?SOt():t==="hi"?COt():yOt()}),NOt=()=>"none",zOt=()=>"无",jOt=()=>"هیچ‌کدام",TOt=()=>"لا شيء",AOt=()=>"ninguno",ROt=()=>"कोई नहीं",nS=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zOt():t==="fa"?jOt():t==="ar"?TOt():t==="es"?AOt():t==="hi"?ROt():NOt()}),MOt=()=>"Not connected",OOt=()=>"未连接",DOt=()=>"متصل نیست",LOt=()=>"غير متصل",IOt=()=>"No conectado",$Ot=()=>"कनेक्टेड नहीं",hL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?OOt():t==="fa"?DOt():t==="ar"?LOt():t==="es"?IOt():t==="hi"?$Ot():MOt()}),BOt=()=>"not found on PATH",POt=()=>"在 PATH 中未找到",FOt=()=>"در PATH پیدا نشد",HOt=()=>"غير موجود في PATH",qOt=()=>"no se encontró en el PATH",UOt=()=>"PATH पर नहीं मिला",GOt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?POt():t==="fa"?FOt():t==="ar"?HOt():t==="es"?qOt():t==="hi"?UOt():BOt()}),VOt=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,KOt=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,WOt=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,QOt=e=>`${e==null?void 0:e.context} (ليس في kubeconfig)`,XOt=e=>`${e==null?void 0:e.context} (no está en kubeconfig)`,YOt=e=>`${e==null?void 0:e.context} (kubeconfig में नहीं)`,ZOt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?KOt(e):t==="fa"?WOt(e):t==="ar"?QOt(e):t==="es"?XOt(e):t==="hi"?YOt(e):VOt(e)}),JOt=()=>"not initialized",eDt=()=>"尚未初始化",tDt=()=>"راه‌اندازی نشده",nDt=()=>"غير مهيّأ",rDt=()=>"sin inicializar",sDt=()=>"शुरू नहीं किया गया",iDt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?eDt():t==="fa"?tDt():t==="ar"?nDt():t==="es"?rDt():t==="hi"?sDt():JOt()}),aDt=()=>"Not set",oDt=()=>"未设置",cDt=()=>"تنظیم نشده",lDt=()=>"غير مضبوط",uDt=()=>"Sin definir",_Dt=()=>"सेट नहीं",g3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?oDt():t==="fa"?cDt():t==="ar"?lDt():t==="es"?uDt():t==="hi"?_Dt():aDt()}),fDt=()=>"OAuth (subscription login)",dDt=()=>"OAuth(订阅登录)",hDt=()=>"OAuth (ورود با اشتراک)",pDt=()=>"OAuth (تسجيل دخول الاشتراك)",mDt=()=>"OAuth (inicio de sesión con suscripción)",gDt=()=>"OAuth (सब्सक्रिप्शन लॉगिन)",vDt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dDt():t==="fa"?hDt():t==="ar"?pDt():t==="es"?mDt():t==="hi"?gDt():fDt()}),bDt=e=>`The old copy was left at ${e==null?void 0:e.path} on a different disk. You can delete it after confirming everything works.`,yDt=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,xDt=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,wDt=e=>`تُركت النسخة القديمة في ${e==null?void 0:e.path} على قرص مختلف. يمكنك حذفها بعد التأكد من أن كل شيء يعمل.`,kDt=e=>`La copia anterior se dejó en ${e==null?void 0:e.path}, en otro disco. Puedes eliminarla cuando confirmes que todo funciona.`,SDt=e=>`पुरानी कॉपी एक अलग डिस्क पर ${e==null?void 0:e.path} पर छोड़ दी गई थी। सब कुछ ठीक होने की पुष्टि के बाद आप इसे हटा सकते हैं।`,CDt=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?yDt(e):t==="fa"?xDt(e):t==="ar"?wDt(e):t==="es"?kDt(e):t==="hi"?SDt(e):bDt(e)}),EDt=()=>"Setting up…",NDt=()=>"正在设置…",zDt=()=>"در حال راه‌اندازی…",jDt=()=>"جارٍ الإعداد…",TDt=()=>"Configurando…",ADt=()=>"सेट अप हो रहा है…",RDt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?NDt():t==="fa"?zDt():t==="ar"?jDt():t==="es"?TDt():t==="hi"?ADt():EDt()}),MDt=()=>"Account",ODt=()=>"账户",DDt=()=>"حساب",LDt=()=>"الحساب",IDt=()=>"Cuenta",$Dt=()=>"खाता",rS=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ODt():t==="fa"?DDt():t==="ar"?LDt():t==="es"?IDt():t==="hi"?$Dt():MDt()}),BDt=()=>"Add one with",PDt=()=>"使用以下命令添加:",FDt=()=>"یکی با این فرمان اضافه کنید:",HDt=()=>"أضِف واحدًا عبر",qDt=()=>"Añade una con",UDt=()=>"इसके साथ एक जोड़ें",GDt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?PDt():t==="fa"?FDt():t==="ar"?HDt():t==="es"?qDt():t==="hi"?UDt():BDt()}),VDt=()=>"Add variable",KDt=()=>"添加变量",WDt=()=>"افزودن متغیر",QDt=()=>"إضافة متغيّر",XDt=()=>"Añadir variable",YDt=()=>"वेरिएबल जोड़ें",ZDt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?KDt():t==="fa"?WDt():t==="ar"?QDt():t==="es"?XDt():t==="hi"?YDt():VDt()}),JDt=()=>"Agent models",eLt=()=>"智能体模型",tLt=()=>"مدل‌های عامل",nLt=()=>"نماذج الوكيل",rLt=()=>"Modelos de los agentes",sLt=()=>"एजेंट मॉडल",iLt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?eLt():t==="fa"?tLt():t==="ar"?nLt():t==="es"?rLt():t==="hi"?sLt():JDt()}),aLt=()=>"Anonymous usage analytics",oLt=()=>"匿名使用情况分析",cLt=()=>"تحلیل ناشناس استفاده",lLt=()=>"تحليلات استخدام مجهولة الهوية",uLt=()=>"Estadísticas de uso anónimas",_Lt=()=>"अनाम उपयोग एनालिटिक्स",jz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?oLt():t==="fa"?cLt():t==="ar"?lLt():t==="es"?uLt():t==="hi"?_Lt():aLt()}),fLt=()=>"Auth",dLt=()=>"身份验证",hLt=()=>"احراز هویت",pLt=()=>"المصادقة",mLt=()=>"Autenticación",gLt=()=>"ऑथ",vLt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dLt():t==="fa"?hLt():t==="ar"?pLt():t==="es"?mLt():t==="hi"?gLt():fLt()}),bLt=()=>"Authentication",yLt=()=>"身份验证",xLt=()=>"احراز هویت",wLt=()=>"المصادقة",kLt=()=>"Autenticación",SLt=()=>"प्रमाणीकरण",pL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yLt():t==="fa"?xLt():t==="ar"?wLt():t==="es"?kLt():t==="hi"?SLt():bLt()}),CLt=()=>"Back to Compute",ELt=()=>"返回算力设置",NLt=()=>"بازگشت به رایانش",zLt=()=>"العودة إلى الحوسبة",jLt=()=>"Volver a Cómputo",TLt=()=>"कंप्यूट पर वापस जाएं",mL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ELt():t==="fa"?NLt():t==="ar"?zLt():t==="es"?jLt():t==="hi"?TLt():CLt()}),ALt=()=>"Backend",RLt=()=>"后端",MLt=()=>"بک‌اند",OLt=()=>"بيئة التنفيذ",DLt=()=>"Backend",LLt=()=>"बैकएंड",ILt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?RLt():t==="fa"?MLt():t==="ar"?OLt():t==="es"?DLt():t==="hi"?LLt():ALt()}),$Lt=()=>"Baseline",BLt=()=>"基线",PLt=()=>"خط مبنا",FLt=()=>"الأساس المرجعي",HLt=()=>"Rama base",qLt=()=>"बेसलाइन",ULt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?BLt():t==="fa"?PLt():t==="ar"?FLt():t==="es"?HLt():t==="hi"?qLt():$Lt()}),GLt=()=>"Binary",VLt=()=>"可执行文件",KLt=()=>"فایل اجرایی",WLt=()=>"الملف التنفيذي",QLt=()=>"Binario",XLt=()=>"बाइनरी",YLt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?VLt():t==="fa"?KLt():t==="ar"?WLt():t==="es"?QLt():t==="hi"?XLt():GLt()}),ZLt=()=>"Cancel",JLt=()=>"取消",eIt=()=>"لغو",tIt=()=>"إلغاء",nIt=()=>"Cancelar",rIt=()=>"रद्द करें",rf=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?JLt():t==="fa"?eIt():t==="ar"?tIt():t==="es"?nIt():t==="hi"?rIt():ZLt()}),sIt=()=>"Cancel new variable",iIt=()=>"取消新变量",aIt=()=>"لغو متغیر جدید",oIt=()=>"إلغاء المتغيّر الجديد",cIt=()=>"Cancelar nueva variable",lIt=()=>"नया वेरिएबल रद्द करें",uIt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?iIt():t==="fa"?aIt():t==="ar"?oIt():t==="es"?cIt():t==="hi"?lIt():sIt()}),_It=()=>"Checking compute targets…",fIt=()=>"正在检查算力目标…",dIt=()=>"در حال بررسی مقصدهای رایانشی…",hIt=()=>"جارٍ التحقق من أهداف الحوسبة…",pIt=()=>"Comprobando destinos de cómputo…",mIt=()=>"कंप्यूट टारगेट जाँचे जा रहे हैं…",gIt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fIt():t==="fa"?dIt():t==="ar"?hIt():t==="es"?pIt():t==="hi"?mIt():_It()}),vIt=()=>"Checking kubectl…",bIt=()=>"正在检查 kubectl…",yIt=()=>"در حال بررسی kubectl…",xIt=()=>"جارٍ التحقق من kubectl…",wIt=()=>"Comprobando kubectl…",kIt=()=>"kubectl जाँचा जा रहा है…",SIt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bIt():t==="fa"?yIt():t==="ar"?xIt():t==="es"?wIt():t==="hi"?kIt():vIt()}),CIt=()=>"Checking Modal…",EIt=()=>"正在检查 Modal…",NIt=()=>"در حال بررسی Modal…",zIt=()=>"جارٍ التحقق من Modal…",jIt=()=>"Comprobando Modal…",TIt=()=>"Modal जाँचा जा रहा है…",AIt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?EIt():t==="fa"?NIt():t==="ar"?zIt():t==="es"?jIt():t==="hi"?TIt():CIt()}),RIt=()=>"Choose a preset flavor",MIt=()=>"选择预设规格",OIt=()=>"یک پیکربندی آماده انتخاب کنید",DIt=()=>"اختر تكوينًا محددًا مسبقًا للموارد",LIt=()=>"Elige una opción predefinida",IIt=()=>"एक प्रीसेट फ़्लेवर चुनें",Tz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?MIt():t==="fa"?OIt():t==="ar"?DIt():t==="es"?LIt():t==="hi"?IIt():RIt()}),$It=()=>"cluster default",BIt=()=>"集群默认值",PIt=()=>"پیش‌فرض خوشه",FIt=()=>"افتراضي العنقود",HIt=()=>"valor predeterminado del clúster",qIt=()=>"क्लस्टर डिफ़ॉल्ट",Az=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?BIt():t==="fa"?PIt():t==="ar"?FIt():t==="es"?HIt():t==="hi"?qIt():$It()}),UIt=()=>"cluster default (e.g. 4h, 30m)",GIt=()=>"集群默认值(例如 4h、30m)",VIt=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",KIt=()=>"افتراضي العنقود (مثل 4h أو 30m)",WIt=()=>"valor predeterminado del clúster (p. ej., 4h, 30m)",QIt=()=>"क्लस्टर डिफ़ॉल्ट (जैसे 4h, 30m)",XIt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?GIt():t==="fa"?VIt():t==="ar"?KIt():t==="es"?WIt():t==="hi"?QIt():UIt()}),YIt=()=>"Cluster unreachable",ZIt=()=>"无法连接集群",JIt=()=>"خوشه در دسترس نیست",e$t=()=>"تعذّر الوصول إلى العنقود",t$t=()=>"Clúster inaccesible",n$t=()=>"क्लस्टर तक नहीं पहुँचा जा सका",r$t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ZIt():t==="fa"?JIt():t==="ar"?e$t():t==="es"?t$t():t==="hi"?n$t():YIt()}),s$t=()=>"Compute",i$t=()=>"算力",a$t=()=>"رایانش",o$t=()=>"الحوسبة",c$t=()=>"Cómputo",l$t=()=>"कंप्यूट",gL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?i$t():t==="fa"?a$t():t==="ar"?o$t():t==="es"?c$t():t==="hi"?l$t():s$t()}),u$t=()=>"Connect compute backends and choose where new runs execute.",_$t=()=>"连接算力后端,并选择新运行的执行位置。",f$t=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",d$t=()=>"اربط بيئات التنفيذ واختر أين تُنفَّذ عمليات التشغيل الجديدة.",h$t=()=>"Conecta backends de cómputo y elige dónde se lanzan las nuevas ejecuciones.",p$t=()=>"कंप्यूट बैकएंड कनेक्ट करें और चुनें कि नए रन कहाँ चलेंगे।",m$t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_$t():t==="fa"?f$t():t==="ar"?d$t():t==="es"?h$t():t==="hi"?p$t():u$t()}),g$t=()=>"Connected",v$t=()=>"已连接",b$t=()=>"متصل",y$t=()=>"متصل",x$t=()=>"Conectado",w$t=()=>"कनेक्टेड",k$t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?v$t():t==="fa"?b$t():t==="ar"?y$t():t==="es"?x$t():t==="hi"?w$t():g$t()}),S$t=()=>"Context",C$t=()=>"上下文",E$t=()=>"زمینه",N$t=()=>"السياق",z$t=()=>"Contexto",j$t=()=>"कॉन्टेक्स्ट",T$t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?C$t():t==="fa"?E$t():t==="ar"?N$t():t==="es"?z$t():t==="hi"?j$t():S$t()}),A$t=()=>"Current",R$t=()=>"当前",M$t=()=>"فعلی",O$t=()=>"الحالي",D$t=()=>"Actual",L$t=()=>"मौजूदा",I$t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?R$t():t==="fa"?M$t():t==="ar"?O$t():t==="es"?D$t():t==="hi"?L$t():A$t()}),$$t=()=>"Currently off:",B$t=()=>"当前已关闭:",P$t=()=>"اکنون خاموش است:",F$t=()=>"معطّل حاليًا:",H$t=()=>"Desactivado actualmente:",q$t=()=>"फ़िलहाल बंद:",U$t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?B$t():t==="fa"?P$t():t==="ar"?F$t():t==="es"?H$t():t==="hi"?q$t():$$t()}),G$t=()=>"Custom flavor",V$t=()=>"自定义规格",K$t=()=>"پیکربندی سفارشی",W$t=()=>"تكوين موارد مخصّص",Q$t=()=>"Opción personalizada",X$t=()=>"कस्टम फ़्लेवर",Y$t=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?V$t():t==="fa"?K$t():t==="ar"?W$t():t==="es"?Q$t():t==="hi"?X$t():G$t()}),Z$t=()=>"Custom flavor…",J$t=()=>"自定义规格…",eBt=()=>"پیکربندی سفارشی…",tBt=()=>"تكوين موارد مخصّص…",nBt=()=>"Opción personalizada…",rBt=()=>"कस्टम फ़्लेवर…",sBt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?J$t():t==="fa"?eBt():t==="ar"?tBt():t==="es"?nBt():t==="hi"?rBt():Z$t()}),iBt=()=>"Data directory",aBt=()=>"数据目录",oBt=()=>"پوشهٔ داده",cBt=()=>"دليل البيانات",lBt=()=>"Directorio de datos",uBt=()=>"डेटा डायरेक्टरी",_Bt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?aBt():t==="fa"?oBt():t==="ar"?cBt():t==="es"?lBt():t==="hi"?uBt():iBt()}),fBt=()=>"default",dBt=()=>"默认",hBt=()=>"پیش‌فرض",pBt=()=>"افتراضي",mBt=()=>"predeterminado",gBt=()=>"डिफ़ॉल्ट",vBt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dBt():t==="fa"?hBt():t==="ar"?pBt():t==="es"?mBt():t==="hi"?gBt():fBt()}),bBt=()=>"Default",yBt=()=>"默认",xBt=()=>"پیش‌فرض",wBt=()=>"الافتراضي",kBt=()=>"Predeterminado",SBt=()=>"डिफ़ॉल्ट",vL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yBt():t==="fa"?xBt():t==="ar"?wBt():t==="es"?kBt():t==="hi"?SBt():bBt()}),CBt=()=>"Default destination",EBt=()=>"默认目标",NBt=()=>"مقصد پیش‌فرض",zBt=()=>"الوجهة الافتراضية",jBt=()=>"Destino predeterminado",TBt=()=>"डिफ़ॉल्ट गंतव्य",ABt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?EBt():t==="fa"?NBt():t==="ar"?zBt():t==="es"?jBt():t==="hi"?TBt():CBt()}),RBt=()=>"Detecting hardware…",MBt=()=>"正在检测硬件…",OBt=()=>"در حال شناسایی سخت‌افزار…",DBt=()=>"جارٍ اكتشاف العتاد…",LBt=()=>"Detectando hardware…",IBt=()=>"हार्डवेयर पहचाना जा रहा है…",$Bt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?MBt():t==="fa"?OBt():t==="ar"?DBt():t==="es"?LBt():t==="hi"?IBt():RBt()}),BBt=()=>"Detecting harnesses…",PBt=()=>"正在检测智能体工具…",FBt=()=>"در حال شناسایی ابزارهای عامل…",HBt=()=>"جارٍ اكتشاف أدوات البرمجة…",qBt=()=>"Detectando agentes…",UBt=()=>"हार्नेस पहचाने जा रहे हैं…",GBt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?PBt():t==="fa"?FBt():t==="ar"?HBt():t==="es"?qBt():t==="hi"?UBt():BBt()}),VBt=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",KBt=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",WBt=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",QBt=()=>"يوقف تعطيل المزامنة عمليات الرفع التلقائية. تواصل الحوسبة استخدام لقطات المصدر المباشرة. لا يحذف هذا مستودع GitHub أو الشيفرة التي رُفعت إليه مسبقًا.",XBt=()=>"Desactivar la sincronización detiene los push automáticos. El cómputo sigue usando snapshots directos del código fuente. No se elimina el repositorio de GitHub ni el código que ya se subió.",YBt=()=>"सिंकिंग बंद करने से ऑटोमैटिक पुश रुक जाते हैं। कंप्यूट सीधे सोर्स स्नैपशॉट का इस्तेमाल करता रहेगा। इससे GitHub रिपॉज़िटरी या पहले से पुश किया गया कोड नहीं मिटता।",ZBt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?KBt():t==="fa"?WBt():t==="ar"?QBt():t==="es"?XBt():t==="hi"?YBt():VBt()}),JBt=()=>"Effective URL",ePt=()=>"实际使用的网址",tPt=()=>"نشانی مؤثر",nPt=()=>"الرابط الفعّال",rPt=()=>"URL efectiva",sPt=()=>"प्रभावी URL",iPt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ePt():t==="fa"?tPt():t==="ar"?nPt():t==="es"?rPt():t==="hi"?sPt():JBt()}),aPt=()=>"Enable GitHub syncing for new projects",oPt=()=>"为新项目启用 GitHub 同步",cPt=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",lPt=()=>"تفعيل مزامنة GitHub للمشاريع الجديدة",uPt=()=>"Activar la sincronización con GitHub en proyectos nuevos",_Pt=()=>"नए प्रोजेक्ट के लिए GitHub सिंकिंग चालू करें",Rz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?oPt():t==="fa"?cPt():t==="ar"?lPt():t==="es"?uPt():t==="hi"?_Pt():aPt()}),fPt=()=>"Environment",dPt=()=>"环境",hPt=()=>"محیط",pPt=()=>"البيئة",mPt=()=>"Entorno",gPt=()=>"एनवायरनमेंट",bL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dPt():t==="fa"?hPt():t==="ar"?pPt():t==="es"?mPt():t==="hi"?gPt():fPt()}),vPt=()=>"Failed",bPt=()=>"失败",yPt=()=>"ناموفق",xPt=()=>"فشل",wPt=()=>"Error",kPt=()=>"विफल",sS=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bPt():t==="fa"?yPt():t==="ar"?xPt():t==="es"?wPt():t==="hi"?kPt():vPt()}),SPt=()=>"General",CPt=()=>"常规",EPt=()=>"عمومی",NPt=()=>"عام",zPt=()=>"General",jPt=()=>"सामान्य",TPt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?CPt():t==="fa"?EPt():t==="ar"?NPt():t==="es"?zPt():t==="hi"?jPt():SPt()}),APt=()=>"GitHub publishing",RPt=()=>"GitHub 发布",MPt=()=>"انتشار در GitHub",OPt=()=>"النشر على GitHub",DPt=()=>"Publicación en GitHub",LPt=()=>"GitHub प्रकाशन",IPt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?RPt():t==="fa"?MPt():t==="ar"?OPt():t==="es"?DPt():t==="hi"?LPt():APt()}),$Pt=()=>"Git token",BPt=()=>"Git 令牌",PPt=()=>"توکن Git",FPt=()=>"رمز Git",HPt=()=>"Token de Git",qPt=()=>"Git टोकन",UPt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?BPt():t==="fa"?PPt():t==="ar"?FPt():t==="es"?HPt():t==="hi"?qPt():$Pt()}),GPt=()=>"Harnesses",VPt=()=>"智能体工具",KPt=()=>"ابزارهای عامل",WPt=()=>"أدوات البرمجة",QPt=()=>"Agentes",XPt=()=>"हार्नेस",v3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?VPt():t==="fa"?KPt():t==="ar"?WPt():t==="es"?QPt():t==="hi"?XPt():GPt()}),YPt=()=>"hf_…",ZPt=()=>"hf_…",JPt=()=>"hf_…",eFt=()=>"hf_…",tFt=()=>"hf_…",nFt=()=>"hf_…",rFt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ZPt():t==="fa"?JPt():t==="ar"?eFt():t==="es"?tFt():t==="hi"?nFt():YPt()}),sFt=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",iFt=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",aFt=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",oFt=()=>"‏HF_TOKEN مضبوط في البيئة ويتجاوز أي رمز محفوظ هنا.",cFt=()=>"HF_TOKEN está definido en el entorno y tiene prioridad sobre cualquier token guardado aquí.",lFt=()=>"HF_TOKEN एनवायरनमेंट में सेट है और यहाँ सेव किसी भी टोकन को ओवरराइड करता है।",uFt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?iFt():t==="fa"?aFt():t==="ar"?oFt():t==="es"?cFt():t==="hi"?lFt():sFt()}),_Ft=()=>"Initialize Git",fFt=()=>"初始化 Git",dFt=()=>"راه‌اندازی Git",hFt=()=>"تهيئة Git",pFt=()=>"Inicializar Git",mFt=()=>"Git शुरू करें",gFt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fFt():t==="fa"?dFt():t==="ar"?hFt():t==="es"?pFt():t==="hi"?mFt():_Ft()}),vFt=()=>"Install",bFt=()=>"安装",yFt=()=>"نصب",xFt=()=>"تثبيت",wFt=()=>"Instalar",kFt=()=>"इंस्टॉल करें",yL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bFt():t==="fa"?yFt():t==="ar"?xFt():t==="es"?wFt():t==="hi"?kFt():vFt()}),SFt=()=>"Install broken",CFt=()=>"安装损坏",EFt=()=>"نصب خراب است",NFt=()=>"التثبيت معطوب",zFt=()=>"Instalación dañada",jFt=()=>"इंस्टॉल खराब है",TFt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?CFt():t==="fa"?EFt():t==="ar"?NFt():t==="es"?zFt():t==="hi"?jFt():SFt()}),AFt=()=>"Install GitHub CLI",RFt=()=>"安装 GitHub CLI",MFt=()=>"نصب GitHub CLI",OFt=()=>"تثبيت واجهة GitHub لسطر الأوامر",DFt=()=>"Instalar GitHub CLI",LFt=()=>"GitHub CLI इंस्टॉल करें",IFt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?RFt():t==="fa"?MFt():t==="ar"?OFt():t==="es"?DFt():t==="hi"?LFt():AFt()}),$Ft=()=>"Install updates automatically",BFt=()=>"自动安装更新",PFt=()=>"نصب خودکار به‌روزرسانی‌ها",FFt=()=>"تثبيت التحديثات تلقائيًا",HFt=()=>"Instalar actualizaciones automáticamente",qFt=()=>"अपडेट अपने आप इंस्टॉल करें",Mz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?BFt():t==="fa"?PFt():t==="ar"?FFt():t==="es"?HFt():t==="hi"?qFt():$Ft()}),UFt=()=>"Instance history",GFt=()=>"实例历史",VFt=()=>"تاریخچهٔ نمونه‌ها",KFt=()=>"سجل المثيلات",WFt=()=>"Historial de instancias",QFt=()=>"इंस्टेंस इतिहास",XFt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?GFt():t==="fa"?VFt():t==="ar"?KFt():t==="es"?WFt():t==="hi"?QFt():UFt()}),YFt=()=>"Invalid Token",ZFt=()=>"令牌无效",JFt=()=>"توکن نامعتبر",eHt=()=>"رمز غير صالح",tHt=()=>"Token no válido",nHt=()=>"अमान्य टोकन",rHt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ZFt():t==="fa"?JFt():t==="ar"?eHt():t==="es"?tHt():t==="hi"?nHt():YFt()}),sHt=()=>"Jobs / Dashboard URL",iHt=()=>"Jobs / 控制台网址",aHt=()=>"نشانی Jobs / داشبورد",oHt=()=>"رابط المهام / لوحة التحكم",cHt=()=>"URL de jobs / dashboard",lHt=()=>"Jobs / डैशबोर्ड URL",uHt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?iHt():t==="fa"?aHt():t==="ar"?oHt():t==="es"?cHt():t==="hi"?lHt():sHt()}),_Ht=()=>"kubectl not found",fHt=()=>"未找到 kubectl",dHt=()=>"kubectl پیدا نشد",hHt=()=>"لم يُعثر على kubectl",pHt=()=>"No se encontró kubectl",mHt=()=>"kubectl नहीं मिला",gHt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fHt():t==="fa"?dHt():t==="ar"?hHt():t==="es"?pHt():t==="hi"?mHt():_Ht()}),vHt=()=>"Latest",bHt=()=>"最新版本",yHt=()=>"جدیدترین",xHt=()=>"الأحدث",wHt=()=>"Última",kHt=()=>"नवीनतम",SHt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bHt():t==="fa"?yHt():t==="ar"?xHt():t==="es"?wHt():t==="hi"?kHt():vHt()}),CHt=()=>"Loading…",EHt=()=>"正在加载…",NHt=()=>"در حال بارگیری…",zHt=()=>"جارٍ التحميل…",jHt=()=>"Cargando…",THt=()=>"लोड हो रहा है…",Hu=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?EHt():t==="fa"?NHt():t==="ar"?zHt():t==="es"?jHt():t==="hi"?THt():CHt()}),AHt=()=>"Loading Ray settings…",RHt=()=>"正在加载 Ray 设置…",MHt=()=>"در حال بارگیری تنظیمات Ray…",OHt=()=>"جارٍ تحميل إعدادات Ray…",DHt=()=>"Cargando configuración de Ray…",LHt=()=>"Ray सेटिंग्स लोड हो रही हैं…",IHt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?RHt():t==="fa"?MHt():t==="ar"?OHt():t==="es"?DHt():t==="hi"?LHt():AHt()}),$Ht=()=>"Loading slurm settings…",BHt=()=>"正在加载 Slurm 设置…",PHt=()=>"در حال بارگیری تنظیمات Slurm…",FHt=()=>"جارٍ تحميل إعدادات slurm…",HHt=()=>"Cargando configuración de Slurm…",qHt=()=>"Slurm सेटिंग्स लोड हो रही हैं…",UHt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?BHt():t==="fa"?PHt():t==="ar"?FHt():t==="es"?HHt():t==="hi"?qHt():$Ht()}),GHt=()=>"Loading status…",VHt=()=>"正在加载状态…",KHt=()=>"در حال بارگیری وضعیت…",WHt=()=>"جارٍ تحميل الحالة…",QHt=()=>"Cargando estado…",XHt=()=>"स्थिति लोड हो रही है…",YHt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?VHt():t==="fa"?KHt():t==="ar"?WHt():t==="es"?QHt():t==="hi"?XHt():GHt()}),ZHt=()=>"Local only",JHt=()=>"仅本地",eqt=()=>"فقط محلی",tqt=()=>"محلي فقط",nqt=()=>"Solo local",rqt=()=>"केवल लोकल",sqt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?JHt():t==="fa"?eqt():t==="ar"?tqt():t==="es"?nqt():t==="hi"?rqt():ZHt()}),iqt=()=>"Local repository",aqt=()=>"本地仓库",oqt=()=>"مخزن محلی",cqt=()=>"مستودع محلي",lqt=()=>"Repositorio local",uqt=()=>"लोकल रिपॉज़िटरी",_qt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?aqt():t==="fa"?oqt():t==="ar"?cqt():t==="es"?lqt():t==="hi"?uqt():iqt()}),fqt=()=>"Login node",dqt=()=>"登录节点",hqt=()=>"گرهٔ ورود",pqt=()=>"عقدة الدخول",mqt=()=>"Nodo de acceso",gqt=()=>"लॉगिन नोड",vqt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?dqt():t==="fa"?hqt():t==="ar"?pqt():t==="es"?mqt():t==="hi"?gqt():fqt()}),bqt=()=>"Make GitHub syncing the default?",yqt=()=>"将 GitHub 同步设为默认值?",xqt=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",wqt=()=>"جعل مزامنة GitHub افتراضية؟",kqt=()=>"¿Activar la sincronización con GitHub de forma predeterminada?",Sqt=()=>"GitHub सिंकिंग को डिफ़ॉल्ट बनाएं?",Cqt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yqt():t==="fa"?xqt():t==="ar"?wqt():t==="es"?kqt():t==="hi"?Sqt():bqt()}),Eqt=()=>"Missing bash/tar",Nqt=()=>"缺少 bash/tar",zqt=()=>"bash/tar موجود نیست",jqt=()=>"‏bash/tar مفقودان",Tqt=()=>"Falta bash/tar",Aqt=()=>"bash/tar गुम है",Rqt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Nqt():t==="fa"?zqt():t==="ar"?jqt():t==="es"?Tqt():t==="hi"?Aqt():Eqt()}),Mqt=()=>"More compute options",Oqt=()=>"更多算力选项",Dqt=()=>"گزینه‌های رایانشی بیشتر",Lqt=()=>"خيارات حوسبة إضافية",Iqt=()=>"Más opciones de cómputo",$qt=()=>"और कंप्यूट विकल्प",Bqt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Oqt():t==="fa"?Dqt():t==="ar"?Lqt():t==="es"?Iqt():t==="hi"?$qt():Mqt()}),Pqt=()=>"Move failed:",Fqt=()=>"移动失败:",Hqt=()=>"انتقال ناموفق بود:",qqt=()=>"فشل النقل:",Uqt=()=>"Error al mover:",Gqt=()=>"स्थानांतरण विफल:",Vqt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Fqt():t==="fa"?Hqt():t==="ar"?qqt():t==="es"?Uqt():t==="hi"?Gqt():Pqt()}),Kqt=()=>"Moved. orx is now using the new location.",Wqt=()=>"已移动。orx 现在使用新位置。",Qqt=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",Xqt=()=>"تم النقل. يستخدم orx الآن الموقع الجديد.",Yqt=()=>"Movido. orx ya usa la nueva ubicación.",Zqt=()=>"स्थानांतरित हो गया। orx अब नए स्थान का उपयोग कर रहा है।",Jqt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Wqt():t==="fa"?Qqt():t==="ar"?Xqt():t==="es"?Yqt():t==="hi"?Zqt():Kqt()}),eUt=()=>"Namespace",tUt=()=>"命名空间",nUt=()=>"فضای نام",rUt=()=>"مساحة الأسماء",sUt=()=>"Namespace",iUt=()=>"नेमस्पेस",aUt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tUt():t==="fa"?nUt():t==="ar"?rUt():t==="es"?sUt():t==="hi"?iUt():eUt()}),oUt=()=>"New location",cUt=()=>"新位置",lUt=()=>"محل جدید",uUt=()=>"الموقع الجديد",_Ut=()=>"Nueva ubicación",fUt=()=>"नया स्थान",dUt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cUt():t==="fa"?lUt():t==="ar"?uUt():t==="es"?_Ut():t==="hi"?fUt():oUt()}),hUt=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",pUt=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",mUt=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",gUt=()=>"تُنزَّل الإصدارات الجديدة وتُثبَّت في الخلفية. إيقاف هذا يبقي الإشعار لكنه يترك التثبيت لك.",vUt=()=>"Las nuevas versiones se descargan e instalan en segundo plano. Si lo desactivas, verás el aviso, pero tendrás que instalarlas tú.",bUt=()=>"नए रिलीज़ बैकग्राउंड में डाउनलोड और इंस्टॉल होते हैं। इसे बंद करने पर सूचना बनी रहेगी, पर इंस्टॉल करना आप पर निर्भर होगा।",yUt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pUt():t==="fa"?mUt():t==="ar"?gUt():t==="es"?vUt():t==="hi"?bUt():hUt()}),xUt=()=>"New variable key",wUt=()=>"新变量键名",kUt=()=>"کلید متغیر جدید",SUt=()=>"مفتاح المتغيّر الجديد",CUt=()=>"Nombre de la nueva variable",EUt=()=>"नई वेरिएबल की",NUt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?wUt():t==="fa"?kUt():t==="ar"?SUt():t==="es"?CUt():t==="hi"?EUt():xUt()}),zUt=()=>"New variable value",jUt=()=>"新变量值",TUt=()=>"مقدار متغیر جدید",AUt=()=>"قيمة المتغيّر الجديد",RUt=()=>"Valor de la nueva variable",MUt=()=>"नई वेरिएबल वैल्यू",OUt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jUt():t==="fa"?TUt():t==="ar"?AUt():t==="es"?RUt():t==="hi"?MUt():zUt()}),DUt=()=>"No code, prompts, file contents, or account identifiers are sent.",LUt=()=>"不会发送代码、提示词、文件内容或账户标识符。",IUt=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",$Ut=()=>"لا تُرسَل أي شيفرة أو طلبات أو محتويات ملفات أو معرّفات حسابات.",BUt=()=>"No se envía código, prompts, contenido de archivos ni identificadores de cuenta.",PUt=()=>"कोई कोड, प्रॉम्प्ट, फ़ाइल सामग्री, या खाता पहचानकर्ता नहीं भेजे जाते।",FUt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?LUt():t==="fa"?IUt():t==="ar"?$Ut():t==="es"?BUt():t==="hi"?PUt():DUt()}),HUt=()=>"No hosts found in ~/.ssh/config.",qUt=()=>"在 ~/.ssh/config 中未找到主机。",UUt=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",GUt=()=>"لم يُعثر على مضيفين في ‎~/.ssh/config.",VUt=()=>"No se encontraron hosts en ~/.ssh/config.",KUt=()=>"~/.ssh/config में कोई होस्ट नहीं मिला।",WUt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qUt():t==="fa"?UUt():t==="ar"?GUt():t==="es"?VUt():t==="hi"?KUt():HUt()}),QUt=()=>"No job-create permission",XUt=()=>"没有创建 Job 的权限",YUt=()=>"مجوز ساخت Job وجود ندارد",ZUt=()=>"لا صلاحية لإنشاء المهام",JUt=()=>"Sin permiso para crear jobs",eGt=()=>"जॉब बनाने की अनुमति नहीं",tGt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?XUt():t==="fa"?YUt():t==="ar"?ZUt():t==="es"?JUt():t==="hi"?eGt():QUt()}),nGt=()=>"No Write Permissions",rGt=()=>"无写入权限",sGt=()=>"بدون مجوز نوشتن",iGt=()=>"لا صلاحيات كتابة",aGt=()=>"Sin permisos de escritura",oGt=()=>"लिखने की अनुमति नहीं",cGt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rGt():t==="fa"?sGt():t==="ar"?iGt():t==="es"?aGt():t==="hi"?oGt():nGt()}),lGt=()=>"No key on this computer to register — load a registered key with",uGt=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",_Gt=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",fGt=()=>"لا مفتاح على هذا الحاسوب لتسجيله — حمّل مفتاحًا مسجّلًا عبر",dGt=()=>"No hay ninguna clave en este equipo para registrar — carga una clave registrada con",hGt=()=>"इस कंप्यूटर पर रजिस्टर करने के लिए कोई की नहीं है — इसके साथ एक रजिस्टर्ड की लोड करें",pGt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?uGt():t==="fa"?_Gt():t==="ar"?fGt():t==="es"?dGt():t==="hi"?hGt():lGt()}),mGt=()=>"No key on this computer yet — create one with",gGt=()=>"此计算机上还没有密钥——使用以下命令创建:",vGt=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",bGt=()=>"لا مفتاح على هذا الحاسوب بعد — أنشئ واحدًا عبر",yGt=()=>"Aún no hay ninguna clave en este equipo — crea una con",xGt=()=>"इस कंप्यूटर पर अभी तक कोई की नहीं है — इसके साथ एक बनाएं",wGt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gGt():t==="fa"?vGt():t==="ar"?bGt():t==="es"?yGt():t==="hi"?xGt():mGt()}),kGt=()=>"No Slurm CLI",SGt=()=>"无 Slurm CLI",CGt=()=>"بدون CLI اسلورم",EGt=()=>"لا توجد واجهة Slurm لسطر الأوامر",NGt=()=>"Sin CLI de Slurm",zGt=()=>"कोई Slurm CLI नहीं",jGt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?SGt():t==="fa"?CGt():t==="ar"?EGt():t==="es"?NGt():t==="hi"?zGt():kGt()}),TGt=()=>"None registered",AGt=()=>"未注册任何密钥",RGt=()=>"هیچ‌کدام ثبت نشده",MGt=()=>"لا شيء مسجّل",OGt=()=>"Ninguna registrada",DGt=()=>"कोई रजिस्टर्ड नहीं",LGt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?AGt():t==="fa"?RGt():t==="ar"?MGt():t==="es"?OGt():t==="hi"?DGt():TGt()}),IGt=()=>"Not checked",$Gt=()=>"未检查",BGt=()=>"بررسی نشده",PGt=()=>"لم يُفحص",FGt=()=>"Sin comprobar",HGt=()=>"जाँचा नहीं गया",xL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$Gt():t==="fa"?BGt():t==="ar"?PGt():t==="es"?FGt():t==="hi"?HGt():IGt()}),qGt=()=>"Not configured",UGt=()=>"未配置",GGt=()=>"پیکربندی نشده",VGt=()=>"غير مُعَد",KGt=()=>"Sin configurar",WGt=()=>"कॉन्फ़िगर नहीं किया गया",Ab=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?UGt():t==="fa"?GGt():t==="ar"?VGt():t==="es"?KGt():t==="hi"?WGt():qGt()}),QGt=()=>"Not installed",XGt=()=>"未安装",YGt=()=>"نصب نیست",ZGt=()=>"غير مثبّت",JGt=()=>"No instalado",eVt=()=>"इंस्टॉल नहीं है",tVt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?XGt():t==="fa"?YGt():t==="ar"?ZGt():t==="es"?JGt():t==="hi"?eVt():QGt()}),nVt=()=>"Not now",rVt=()=>"暂不",sVt=()=>"اکنون نه",iVt=()=>"ليس الآن",aVt=()=>"Ahora no",oVt=()=>"अभी नहीं",cVt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rVt():t==="fa"?sVt():t==="ar"?iVt():t==="es"?aVt():t==="hi"?oVt():nVt()}),lVt=()=>"Not on this computer",uVt=()=>"不在此计算机上",_Vt=()=>"روی این رایانه نیست",fVt=()=>"ليس على هذا الحاسوب",dVt=()=>"No en este equipo",hVt=()=>"इस कंप्यूटर पर नहीं",pVt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?uVt():t==="fa"?_Vt():t==="ar"?fVt():t==="es"?dVt():t==="hi"?hVt():lVt()}),mVt=()=>"Not set (pass --host per launch)",gVt=()=>"未设置(每次启动时传入 --host)",vVt=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",bVt=()=>"غير مضبوط (مرّر ‎--host‎ عند كل تشغيل)",yVt=()=>"Sin definir (pasa --host en cada lanzamiento)",xVt=()=>"सेट नहीं (हर लॉन्च पर --host दें)",wL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gVt():t==="fa"?vVt():t==="ar"?bVt():t==="es"?yVt():t==="hi"?xVt():mVt()}),wVt=()=>"Not signed in",kVt=()=>"未登录",SVt=()=>"وارد نشده",CVt=()=>"لم يتم تسجيل الدخول",EVt=()=>"Sin iniciar sesión",NVt=()=>"साइन इन नहीं है",kL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?kVt():t==="fa"?SVt():t==="ar"?CVt():t==="es"?EVt():t==="hi"?NVt():wVt()}),zVt=()=>"On this computer",jVt=()=>"在此计算机上",TVt=()=>"روی این رایانه",AVt=()=>"على هذا الحاسوب",RVt=()=>"En este equipo",MVt=()=>"इस कंप्यूटर पर",OVt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jVt():t==="fa"?TVt():t==="ar"?AVt():t==="es"?RVt():t==="hi"?MVt():zVt()}),DVt=()=>"Open a project to inspect its repository and GitHub publication state.",LVt=()=>"打开项目以查看其仓库和 GitHub 发布状态。",IVt=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",$Vt=()=>"افتح مشروعًا لفحص مستودعه وحالة نشره على GitHub.",BVt=()=>"Abre un proyecto para ver su repositorio y su estado de publicación en GitHub.",PVt=()=>"इसकी रिपॉज़िटरी और GitHub प्रकाशन स्थिति देखने के लिए एक प्रोजेक्ट खोलें।",FVt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?LVt():t==="fa"?IVt():t==="ar"?$Vt():t==="es"?BVt():t==="hi"?PVt():DVt()}),HVt=()=>"Open job page",qVt=()=>"打开作业页面",UVt=()=>"باز کردن صفحهٔ کار",GVt=()=>"فتح صفحة المهمة",VVt=()=>"Abrir página del job",KVt=()=>"जॉब पेज खोलें",Oz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qVt():t==="fa"?UVt():t==="ar"?GVt():t==="es"?VVt():t==="hi"?KVt():HVt()}),WVt=()=>"Open on GitHub",QVt=()=>"在 GitHub 上打开",XVt=()=>"باز کردن در GitHub",YVt=()=>"فتح على GitHub",ZVt=()=>"Abrir en GitHub",JVt=()=>"GitHub पर खोलें",Dz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?QVt():t==="fa"?XVt():t==="ar"?YVt():t==="es"?ZVt():t==="hi"?JVt():WVt()}),eKt=()=>", or create one with",tKt=()=>",或使用以下命令创建:",nKt=()=>"، یا با این فرمان یکی بسازید:",rKt=()=>"، أو أنشئ واحدًا عبر",sKt=()=>", o crea una con",iKt=()=>", या इसके साथ एक बनाएं",aKt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tKt():t==="fa"?nKt():t==="ar"?rKt():t==="es"?sKt():t==="hi"?iKt():eKt()}),oKt=()=>"Org",cKt=()=>"组织",lKt=()=>"سازمان",uKt=()=>"المؤسسة",_Kt=()=>"Org.",fKt=()=>"संगठन",dKt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cKt():t==="fa"?lKt():t==="ar"?uKt():t==="es"?_Kt():t==="hi"?fKt():oKt()}),hKt=()=>"Orgs",pKt=()=>"组织",mKt=()=>"سازمان‌ها",gKt=()=>"المؤسسات",vKt=()=>"Orgs.",bKt=()=>"संगठन",yKt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pKt():t==="fa"?mKt():t==="ar"?gKt():t==="es"?vKt():t==="hi"?bKt():hKt()}),xKt=()=>"orx can't update this install",wKt=()=>"orx 无法更新此安装",kKt=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",SKt=()=>"لا يستطيع orx تحديث هذا التثبيت",CKt=()=>"orx no puede actualizar esta instalación",EKt=()=>"orx इस इंस्टॉल को अपडेट नहीं कर सकता",NKt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?wKt():t==="fa"?kKt():t==="ar"?SKt():t==="es"?CKt():t==="hi"?EKt():xKt()}),zKt=()=>"Overleaf",jKt=()=>"Overleaf",TKt=()=>"Overleaf",AKt=()=>"Overleaf",RKt=()=>"Overleaf",MKt=()=>"Overleaf",SL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jKt():t==="fa"?TKt():t==="ar"?AKt():t==="es"?RKt():t==="hi"?MKt():zKt()}),OKt=()=>"Overleaf Git authentication token",DKt=()=>"Overleaf Git 身份验证令牌",LKt=()=>"توکن احراز هویت Git در Overleaf",IKt=()=>"رمز مصادقة Git لـ Overleaf",$Kt=()=>"Token de autenticación de Git de Overleaf",BKt=()=>"Overleaf Git प्रमाणीकरण टोकन",PKt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?DKt():t==="fa"?LKt():t==="ar"?IKt():t==="es"?$Kt():t==="hi"?BKt():OKt()}),FKt=()=>"Overridden by env",HKt=()=>"已被环境变量覆盖",qKt=()=>"بازنویسی‌شده توسط محیط",UKt=()=>"متجاوَز عبر متغيّر البيئة",GKt=()=>"Sobrescrito por el entorno",VKt=()=>"env द्वारा ओवरराइड किया गया",KKt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?HKt():t==="fa"?qKt():t==="ar"?UKt():t==="es"?GKt():t==="hi"?VKt():FKt()}),WKt=()=>"Partition",QKt=()=>"分区",XKt=()=>"پارتیشن",YKt=()=>"القسم",ZKt=()=>"Partición",JKt=()=>"पार्टीशन",eWt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?QKt():t==="fa"?XKt():t==="ar"?YKt():t==="es"?ZKt():t==="hi"?JKt():WKt()}),tWt=()=>"Path",nWt=()=>"路径",rWt=()=>"مسیر",sWt=()=>"المسار",iWt=()=>"Ruta",aWt=()=>"पथ",oWt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nWt():t==="fa"?rWt():t==="ar"?sWt():t==="es"?iWt():t==="hi"?aWt():tWt()}),cWt=()=>"Plan",lWt=()=>"方案",uWt=()=>"سطح اشتراک",_Wt=()=>"الخطة",fWt=()=>"Plan",dWt=()=>"प्लान",hWt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lWt():t==="fa"?uWt():t==="ar"?_Wt():t==="es"?fWt():t==="hi"?dWt():cWt()}),pWt=()=>"Project",mWt=()=>"项目",gWt=()=>"پروژه",vWt=()=>"المشروع",bWt=()=>"Proyecto",yWt=()=>"प्रोजेक्ट",xWt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?mWt():t==="fa"?gWt():t==="ar"?vWt():t==="es"?bWt():t==="hi"?yWt():pWt()}),wWt=()=>"Ray version",kWt=()=>"Ray 版本",SWt=()=>"نسخهٔ Ray",CWt=()=>"إصدار Ray",EWt=()=>"Versión de Ray",NWt=()=>"Ray वर्शन",zWt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?kWt():t==="fa"?SWt():t==="ar"?CWt():t==="es"?EWt():t==="hi"?NWt():wWt()}),jWt=()=>"Reachable",TWt=()=>"可访问",AWt=()=>"در دسترس",RWt=()=>"يمكن الوصول إليه",MWt=()=>"Accesible",OWt=()=>"पहुँच योग्य",DWt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?TWt():t==="fa"?AWt():t==="ar"?RWt():t==="es"?MWt():t==="hi"?OWt():jWt()}),LWt=()=>"Reading ~/.ssh/config…",IWt=()=>"正在读取 ~/.ssh/config…",$Wt=()=>"در حال خواندن ‎~/.ssh/config…",BWt=()=>"جارٍ قراءة ‎~/.ssh/config…",PWt=()=>"Leyendo ~/.ssh/config…",FWt=()=>"~/.ssh/config पढ़ा जा रहा है…",CL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?IWt():t==="fa"?$Wt():t==="ar"?BWt():t==="es"?PWt():t==="hi"?FWt():LWt()}),HWt=()=>"Ready",qWt=()=>"就绪",UWt=()=>"آماده",GWt=()=>"جاهز",VWt=()=>"Listo",KWt=()=>"तैयार",Sm=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qWt():t==="fa"?UWt():t==="ar"?GWt():t==="es"?VWt():t==="hi"?KWt():HWt()}),WWt=()=>"Ready to move",QWt=()=>"可以移动",XWt=()=>"آمادهٔ انتقال",YWt=()=>"جاهز للنقل",ZWt=()=>"Listo para mover",JWt=()=>"स्थानांतरण के लिए तैयार",eQt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?QWt():t==="fa"?XWt():t==="ar"?YWt():t==="es"?ZWt():t==="hi"?JWt():WWt()}),tQt=()=>"Configured",nQt=()=>"已配置",rQt=()=>"پیکربندی‌شده",sQt=()=>"مُعَد",iQt=()=>"Configurado",aQt=()=>"कॉन्फ़िगर किया गया",iS=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nQt():t==="fa"?rQt():t==="ar"?sQt():t==="es"?iQt():t==="hi"?aQt():tQt()}),oQt=()=>"Refresh",cQt=()=>"刷新",lQt=()=>"تازه‌سازی",uQt=()=>"تحديث",_Qt=()=>"Actualizar",fQt=()=>"रीफ़्रेश करें",Cm=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cQt():t==="fa"?lQt():t==="ar"?uQt():t==="es"?_Qt():t==="hi"?fQt():oQt()}),dQt=()=>"Remotes",hQt=()=>"远程仓库",pQt=()=>"مخزن‌های دوردست",mQt=()=>"المستودعات البعيدة",gQt=()=>"Remotos",vQt=()=>"रिमोट",bQt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hQt():t==="fa"?pQt():t==="ar"?mQt():t==="es"?gQt():t==="hi"?vQt():dQt()}),yQt=()=>"Repository",xQt=()=>"仓库",wQt=()=>"مخزن",kQt=()=>"المستودع",SQt=()=>"Repositorio",CQt=()=>"रिपॉज़िटरी",EQt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xQt():t==="fa"?wQt():t==="ar"?kQt():t==="es"?SQt():t==="hi"?CQt():yQt()}),NQt=()=>"Restart to finish updating",zQt=()=>"重新启动以完成更新",jQt=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",TQt=()=>"أعد التشغيل لإكمال التحديث",AQt=()=>"Reinicia para terminar la actualización",RQt=()=>"अपडेट पूरा करने के लिए फिर से शुरू करें",MQt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zQt():t==="fa"?jQt():t==="ar"?TQt():t==="es"?AQt():t==="hi"?RQt():NQt()}),OQt=()=>"Running instances",DQt=()=>"正在运行的实例",LQt=()=>"نمونه‌های در حال اجرا",IQt=()=>"المثيلات قيد التشغيل",$Qt=()=>"Instancias en ejecución",BQt=()=>"चल रहे इंस्टेंस",PQt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?DQt():t==="fa"?LQt():t==="ar"?IQt():t==="es"?$Qt():t==="hi"?BQt():OQt()}),FQt=()=>"Runtime",HQt=()=>"运行时间",qQt=()=>"زمان اجرا",UQt=()=>"مدة التشغيل",GQt=()=>"Runtime",VQt=()=>"रनटाइम",KQt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?HQt():t==="fa"?qQt():t==="ar"?UQt():t==="es"?GQt():t==="hi"?VQt():FQt()}),WQt=()=>". Save it under that key if it's meant for HF Jobs.",QQt=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",XQt=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",YQt=()=>"‏. احفظه تحت ذلك المفتاح إن كان مخصصًا لمهام HF.",ZQt=()=>". Guárdalo con ese nombre si es para HF Jobs.",JQt=()=>"। यदि यह HF Jobs के लिए है तो इसे उस की के तहत सेव करें।",eXt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?QQt():t==="fa"?XQt():t==="ar"?YQt():t==="es"?ZQt():t==="hi"?JQt():WQt()}),tXt=()=>"Session cookie",nXt=()=>"会话 cookie",rXt=()=>"کوکی نشست",sXt=()=>"ملف تعريف ارتباط الجلسة",iXt=()=>"Cookie de sesión",aXt=()=>"सेशन कुकी",oXt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nXt():t==="fa"?rXt():t==="ar"?sXt():t==="es"?iXt():t==="hi"?aXt():tXt()}),cXt=()=>"With a session cookie saved, a linked paper follows Overleaf as people type and sends saves straight back. Figures still move on the slower Git sync. Copy the overleaf_session2 cookie from a browser signed in to Overleaf; it stops working when that sign-in does.",lXt=()=>"保存会话 cookie 后,已关联的论文会在他人输入时实时跟随 Overleaf,并立即回传保存;图片仍通过较慢的 Git 同步传输。请从已登录 Overleaf 的浏览器复制 overleaf_session2 cookie;该登录失效后它也会失效。",uXt=()=>"با ذخیرهٔ کوکی نشست، مقالهٔ پیوندشده هنگام تایپ دیگران Overleaf را زنده دنبال می‌کند و ذخیره‌ها را مستقیماً برمی‌گرداند؛ تصویرها همچنان با همگام‌سازی کندتر Git جابه‌جا می‌شوند. کوکی overleaf_session2 را از مرورگری که به Overleaf وارد شده کپی کنید؛ با پایان آن ورود، کوکی هم از کار می‌افتد.",_Xt=()=>"مع حفظ ملف تعريف ارتباط الجلسة، تتابع الورقة المرتبطة Overleaf أثناء كتابة الآخرين وترسل عمليات الحفظ مباشرةً. لا تزال الأشكال تُنقَل عبر مزامنة Git الأبطأ. انسخ ملف تعريف الارتباط overleaf_session2 من متصفح مسجّل الدخول إلى Overleaf؛ ويتوقف عن العمل عند انتهاء ذلك الدخول.",fXt=()=>"Con una cookie de sesión guardada, un paper vinculado sigue los cambios de Overleaf mientras se escribe y envía los guardados directamente. Las figuras siguen usando la sincronización por Git, más lenta. Copia la cookie overleaf_session2 de un navegador con la sesión de Overleaf iniciada; deja de funcionar cuando esa sesión termine.",dXt=()=>"सेशन कुकी सेव होने पर, एक लिंक किया गया पेपर लोगों के टाइप करते ही Overleaf को फ़ॉलो करता है और सेव सीधे वापस भेजता है। फ़िगर अभी भी धीमे Git सिंक पर चलती हैं। Overleaf में साइन इन ब्राउज़र से overleaf_session2 कुकी कॉपी करें; वह साइन-इन खत्म होने पर काम करना बंद कर देती है।",hXt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lXt():t==="fa"?uXt():t==="ar"?_Xt():t==="es"?fXt():t==="hi"?dXt():cXt()}),pXt=()=>"Settings",mXt=()=>"设置",gXt=()=>"تنظیمات",vXt=()=>"الإعدادات",bXt=()=>"Configuración",yXt=()=>"सेटिंग्स",aS=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?mXt():t==="fa"?gXt():t==="ar"?vXt():t==="es"?bXt():t==="hi"?yXt():pXt()}),xXt=()=>"Signed in",wXt=()=>"已登录",kXt=()=>"وارد شده",SXt=()=>"تم تسجيل الدخول",CXt=()=>"Sesión iniciada",EXt=()=>"साइन इन है",NXt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?wXt():t==="fa"?kXt():t==="ar"?SXt():t==="es"?CXt():t==="hi"?EXt():xXt()}),zXt=()=>"Source",jXt=()=>"来源",TXt=()=>"منبع",AXt=()=>"المصدر",RXt=()=>"Origen",MXt=()=>"स्रोत",EL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jXt():t==="fa"?TXt():t==="ar"?AXt():t==="es"?RXt():t==="hi"?MXt():zXt()}),OXt=()=>"SSH Key",DXt=()=>"SSH 密钥",LXt=()=>"کلید SSH",IXt=()=>"مفتاح SSH",$Xt=()=>"Clave SSH",BXt=()=>"SSH की",PXt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?DXt():t==="fa"?LXt():t==="ar"?IXt():t==="es"?$Xt():t==="hi"?BXt():OXt()}),FXt=()=>"Started",HXt=()=>"开始时间",qXt=()=>"آغاز",UXt=()=>"بدأ",GXt=()=>"Inicio",VXt=()=>"शुरू हुआ",KXt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?HXt():t==="fa"?qXt():t==="ar"?UXt():t==="es"?GXt():t==="hi"?VXt():FXt()}),WXt=()=>"State",QXt=()=>"状态",XXt=()=>"وضعیت",YXt=()=>"الحالة",ZXt=()=>"Estado",JXt=()=>"स्थिति",eYt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?QXt():t==="fa"?XXt():t==="ar"?YXt():t==="es"?ZXt():t==="hi"?JXt():WXt()}),tYt=()=>"Status",nYt=()=>"状态",rYt=()=>"وضعیت",sYt=()=>"الحالة",iYt=()=>"Estado",aYt=()=>"स्थिति",Lh=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nYt():t==="fa"?rYt():t==="ar"?sYt():t==="es"?iYt():t==="hi"?aYt():tYt()}),oYt=()=>"Storage",cYt=()=>"存储",lYt=()=>"ذخیره‌سازی",uYt=()=>"التخزين",_Yt=()=>"Almacenamiento",fYt=()=>"स्टोरेज",dYt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cYt():t==="fa"?lYt():t==="ar"?uYt():t==="es"?_Yt():t==="hi"?fYt():oYt()}),hYt=()=>"Sync",pYt=()=>"同步",mYt=()=>"همگام‌سازی",gYt=()=>"مزامنة",vYt=()=>"Sincronización",bYt=()=>"सिंक",yYt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pYt():t==="fa"?mYt():t==="ar"?gYt():t==="es"?vYt():t==="hi"?bYt():hYt()}),xYt=()=>"Syncing off",wYt=()=>"同步已关闭",kYt=()=>"همگام‌سازی خاموش",SYt=()=>"المزامنة معطّلة",CYt=()=>"Sincronización desactivada",EYt=()=>"सिंकिंग बंद है",NYt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?wYt():t==="fa"?kYt():t==="ar"?SYt():t==="es"?CYt():t==="hi"?EYt():xYt()}),zYt=()=>"Test connection",jYt=()=>"测试连接",TYt=()=>"آزمایش اتصال",AYt=()=>"اختبار الاتصال",RYt=()=>"Probar conexión",MYt=()=>"कनेक्शन जाँचें",OYt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jYt():t==="fa"?TYt():t==="ar"?AYt():t==="es"?RYt():t==="hi"?MYt():zYt()}),DYt=()=>"Testing…",LYt=()=>"正在测试…",IYt=()=>"در حال آزمایش…",$Yt=()=>"جارٍ الاختبار…",BYt=()=>"Probando…",PYt=()=>"जाँचा जा रहा है…",FYt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?LYt():t==="fa"?IYt():t==="ar"?$Yt():t==="es"?BYt():t==="hi"?PYt():DYt()}),HYt=()=>", then add it with",qYt=()=>",然后使用以下命令添加:",UYt=()=>"، سپس با این فرمان اضافه‌اش کنید:",GYt=()=>"، ثم أضِفه عبر",VYt=()=>" y luego añádela con",KYt=()=>", फिर इसे इसके साथ जोड़ें",WYt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qYt():t==="fa"?UYt():t==="ar"?GYt():t==="es"?VYt():t==="hi"?KYt():HYt()}),QYt=()=>"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.",XYt=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",YYt=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",ZYt=()=>"هذا مفيد عندما يتابع المتعاونون تغييرات المشروع على GitHub. ستفعّل المشاريع الجديدة المزامنة تلقائيًا، مع إنشاء مستودع خاص عند الحاجة ورفع فروع التجارب لإتاحة الاطلاع عليها.",JYt=()=>"Es útil cuando tus colaboradores siguen los cambios del proyecto en GitHub. Los proyectos nuevos activarán la sincronización automáticamente: se creará un repositorio privado cuando haga falta y se subirán las ramas de los experimentos para que sean visibles.",eZt=()=>"यह तब उपयोगी है जब सहयोगी GitHub पर प्रोजेक्ट के बदलावों को फ़ॉलो करते हों। नए प्रोजेक्ट में सिंकिंग अपने आप चालू हो जाएगी, ज़रूरत पड़ने पर एक निजी रिपॉज़िटरी बनेगी और प्रयोग ब्रांच दृश्यता के लिए पुश की जाएंगी।",tZt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?XYt():t==="fa"?YYt():t==="ar"?ZYt():t==="es"?JYt():t==="hi"?eZt():QYt()}),nZt=()=>"This saved destination is not configured. Set it up below or choose another backend.",rZt=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",sZt=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",iZt=()=>"هذه الوجهة المحفوظة غير مُعدّة. أعِدّها أدناه أو اختر بيئة تنفيذ أخرى.",aZt=()=>"Este destino guardado no está configurado. Configúralo abajo o elige otro backend.",oZt=()=>"यह सेव किया गया गंतव्य कॉन्फ़िगर नहीं है। इसे नीचे सेट अप करें या कोई और बैकएंड चुनें।",cZt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rZt():t==="fa"?sZt():t==="ar"?iZt():t==="es"?aZt():t==="hi"?oZt():nZt()}),lZt=()=>"This value looks like a Hugging Face token — compute runs only read it from",uZt=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",_Zt=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",fZt=()=>"تبدو هذه القيمة كرمز Hugging Face — لا تقرؤه عمليات التشغيل الحوسبية إلا من",dZt=()=>"Este valor parece un token de Hugging Face — las ejecuciones de cómputo solo lo leen de",hZt=()=>"यह वैल्यू एक Hugging Face टोकन जैसी लगती है — कंप्यूट रन इसे केवल यहाँ से पढ़ते हैं",pZt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?uZt():t==="fa"?_Zt():t==="ar"?fZt():t==="es"?dZt():t==="hi"?hZt():lZt()}),mZt=()=>"Time limit",gZt=()=>"时间限制",vZt=()=>"محدودیت زمانی",bZt=()=>"الحد الزمني",yZt=()=>"Límite de tiempo",xZt=()=>"समय सीमा",wZt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gZt():t==="fa"?vZt():t==="ar"?bZt():t==="es"?yZt():t==="hi"?xZt():mZt()}),kZt=()=>"Unable to verify",SZt=()=>"无法验证",CZt=()=>"تأیید ممکن نیست",EZt=()=>"تعذّر التحقق",NZt=()=>"No se pudo verificar",zZt=()=>"सत्यापित नहीं हो सका",b3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?SZt():t==="fa"?CZt():t==="ar"?EZt():t==="es"?NZt():t==="hi"?zZt():kZt()}),jZt=()=>"Unknown",TZt=()=>"未知",AZt=()=>"نامشخص",RZt=()=>"غير معروف",MZt=()=>"Desconocido",OZt=()=>"अज्ञात",NL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?TZt():t==="fa"?AZt():t==="ar"?RZt():t==="es"?MZt():t==="hi"?OZt():jZt()}),DZt=()=>"Update required",LZt=()=>"需要更新",IZt=()=>"نیازمند به‌روزرسانی",$Zt=()=>"مطلوب تحديث",BZt=()=>"Actualización necesaria",PZt=()=>"अपडेट ज़रूरी है",FZt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?LZt():t==="fa"?IZt():t==="ar"?$Zt():t==="es"?BZt():t==="hi"?PZt():DZt()}),HZt=()=>"Updates",qZt=()=>"更新",UZt=()=>"به‌روزرسانی‌ها",GZt=()=>"التحديثات",VZt=()=>"Actualizaciones",KZt=()=>"अपडेट",Lz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qZt():t==="fa"?UZt():t==="ar"?GZt():t==="es"?VZt():t==="hi"?KZt():HZt()}),WZt=()=>"Usage analytics",QZt=()=>"使用情况分析",XZt=()=>"تحلیل استفاده",YZt=()=>"تحليلات الاستخدام",ZZt=()=>"Estadísticas de uso",JZt=()=>"उपयोग एनालिटिक्स",eJt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?QZt():t==="fa"?XZt():t==="ar"?YZt():t==="es"?ZZt():t==="hi"?JZt():WZt()}),tJt=()=>"value",nJt=()=>"值",rJt=()=>"مقدار",sJt=()=>"القيمة",iJt=()=>"valor",aJt=()=>"वैल्यू",zL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?nJt():t==="fa"?rJt():t==="ar"?sJt():t==="es"?iJt():t==="hi"?aJt():tJt()}),oJt=()=>"Variables available to runs and the research agent (API keys, tokens).",cJt=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",lJt=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API، توکن‌ها).",uJt=()=>"متغيّرات متاحة لعمليات التشغيل ولوكيل البحث (مفاتيح API والرموز).",_Jt=()=>"Variables disponibles para las ejecuciones y el agente de investigación (claves de API, tokens).",fJt=()=>"रन और शोध एजेंट के लिए उपलब्ध वेरिएबल (API की, टोकन)।",dJt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cJt():t==="fa"?lJt():t==="ar"?uJt():t==="es"?_Jt():t==="hi"?fJt():oJt()}),hJt=()=>"Version",pJt=()=>"版本",mJt=()=>"نسخه",gJt=()=>"الإصدار",vJt=()=>"Versión",bJt=()=>"वर्शन",jL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pJt():t==="fa"?mJt():t==="ar"?gJt():t==="es"?vJt():t==="hi"?bJt():hJt()}),yJt=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",xJt=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",wJt=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",kJt=()=>"عند التفعيل، يحصل كل مشروع جديد على مستودع GitHub خاص. تُرفع فروع التجارب تلقائيًا ليطّلع عليها المتعاونون. تستخدم الحوسبة دائمًا لقطات المصدر المباشرة.",SJt=()=>"Si se activa, cada proyecto nuevo tendrá un repositorio privado en GitHub. Las ramas de los experimentos se suben automáticamente para que las vean tus colaboradores. El cómputo siempre usa snapshots directos del código fuente.",CJt=()=>"चालू होने पर, हर नए प्रोजेक्ट को एक निजी GitHub रिपॉज़िटरी मिलती है। सहयोगी दृश्यता के लिए प्रयोग ब्रांच अपने आप पुश होती हैं। कंप्यूट हमेशा सीधे सोर्स स्नैपशॉट का उपयोग करता है।",EJt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xJt():t==="fa"?wJt():t==="ar"?kJt():t==="es"?SJt():t==="hi"?CJt():yJt()}),NJt=()=>"With a token saved, a paper opened in the dashboard can be kept in step with an Overleaf project, in both directions. Overleaf's Git integration comes with a paid Overleaf plan; without one, a paper can still be uploaded to Overleaf as a new project. The token stays on this machine and is not sent to compute backends.",zJt=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",jJt=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",TJt=()=>"مع حفظ رمز، يمكن إبقاء ورقة مفتوحة في لوحة التحكم متزامنة مع مشروع Overleaf في الاتجاهين. يأتي تكامل Git في Overleaf مع خطة Overleaf مدفوعة؛ وبدونها لا يزال بالإمكان رفع ورقة إلى Overleaf كمشروع جديد. يبقى الرمز على هذا الجهاز ولا يُرسَل إلى بيئات التنفيذ.",AJt=()=>"Con un token guardado, un paper abierto en el dashboard puede mantenerse sincronizado con un proyecto de Overleaf en ambas direcciones. La integración con Git de Overleaf requiere un plan de pago; sin él, puedes seguir subiendo un paper a Overleaf como proyecto nuevo. El token se queda en este equipo y no se envía a los backends de cómputo.",RJt=()=>"टोकन सेव होने पर, डैशबोर्ड में खुला कोई पेपर दोनों दिशाओं में Overleaf प्रोजेक्ट के साथ मेल खाता रहता है। Overleaf का Git इंटीग्रेशन एक पेड Overleaf प्लान के साथ आता है; उसके बिना, एक पेपर को अब भी नए प्रोजेक्ट के रूप में Overleaf पर अपलोड किया जा सकता है। टोकन इसी मशीन पर रहता है और कंप्यूट बैकएंड को नहीं भेजा जाता।",MJt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zJt():t==="fa"?jJt():t==="ar"?TJt():t==="es"?AJt():t==="hi"?RJt():NJt()}),OJt=()=>"Pick a login node first",DJt=()=>"请先选择登录节点",LJt=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",IJt=()=>"اختر عقدة دخول أولًا",$Jt=()=>"Elige primero un nodo de acceso",BJt=()=>"पहले एक लॉगिन नोड चुनें",PJt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?DJt():t==="fa"?LJt():t==="ar"?IJt():t==="es"?$Jt():t==="hi"?BJt():OJt()}),FJt=()=>"Providers",HJt=()=>"提供商",qJt=()=>"ارائه‌دهندگان",UJt=()=>"المزوّدون",GJt=()=>"Proveedores",VJt=()=>"प्रोवाइडर",KJt=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?HJt():t==="fa"?qJt():t==="ar"?UJt():t==="es"?GJt():t==="hi"?VJt():FJt()}),WJt=()=>"Reconnect",QJt=()=>"重新连接",XJt=()=>"اتصال دوباره",YJt=()=>"إعادة الاتصال",ZJt=()=>"Reconectar",JJt=()=>"फिर से कनेक्ट करें",TL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?QJt():t==="fa"?XJt():t==="ar"?YJt():t==="es"?ZJt():t==="hi"?JJt():WJt()}),een=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,ten=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,nen=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,ren=e=>`سجّل هذا الحاسوب عبر ${e==null?void 0:e.register}، أو حمّل مفتاحًا مسجّلًا عبر ${e==null?void 0:e.load}.`,sen=e=>`Registra este equipo con ${e==null?void 0:e.register} o carga una clave registrada con ${e==null?void 0:e.load}.`,ien=e=>`इस कंप्यूटर को ${e==null?void 0:e.register} से रजिस्टर करें, या ${e==null?void 0:e.load} से एक रजिस्टर्ड की लोड करें।`,aen=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?ten(e):t==="fa"?nen(e):t==="ar"?ren(e):t==="es"?sen(e):t==="hi"?ien(e):een(e)}),oen=()=>"Reinstall with the orx installer to get automatic updates.",cen=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",len=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",uen=()=>"أعد التثبيت عبر مُثبّت orx للحصول على التحديثات التلقائية.",_en=()=>"Reinstala con el instalador de orx para recibir actualizaciones automáticas.",fen=()=>"ऑटोमैटिक अपडेट पाने के लिए orx इंस्टॉलर से फिर से इंस्टॉल करें।",den=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cen():t==="fa"?len():t==="ar"?uen():t==="es"?_en():t==="hi"?fen():oen()}),hen=()=>"Re-link",pen=()=>"重新链接",men=()=>"پیوند دوباره",gen=()=>"إعادة الربط",ven=()=>"Volver a enlazar",ben=()=>"फिर से लिंक करें",yen=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pen():t==="fa"?men():t==="ar"?gen():t==="es"?ven():t==="hi"?ben():hen()}),xen=()=>"Remove cookie",wen=()=>"移除 cookie",ken=()=>"حذف کوکی",Sen=()=>"إزالة ملف تعريف الارتباط",Cen=()=>"Quitar cookie",Een=()=>"कुकी हटाएं",Nen=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?wen():t==="fa"?ken():t==="ar"?Sen():t==="es"?Cen():t==="hi"?Een():xen()}),zen=()=>"Remove token",jen=()=>"移除令牌",Ten=()=>"حذف توکن",Aen=()=>"إزالة الرمز",Ren=()=>"Quitar token",Men=()=>"टोकन हटाएं",Oen=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jen():t==="fa"?Ten():t==="ar"?Aen():t==="es"?Ren():t==="hi"?Men():zen()}),Den=()=>"Removing…",Len=()=>"正在移除…",Ien=()=>"در حال حذف…",$en=()=>"جارٍ الإزالة…",Ben=()=>"Quitando…",Pen=()=>"हटाया जा रहा है…",Iz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Len():t==="fa"?Ien():t==="ar"?$en():t==="es"?Ben():t==="hi"?Pen():Den()}),Fen=()=>"Replace anyway",Hen=()=>"仍要替换",qen=()=>"به‌هرحال جایگزین کن",Uen=()=>"الاستبدال على أي حال",Gen=()=>"Reemplazar de todos modos",Ven=()=>"फिर भी बदलें",Ken=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Hen():t==="fa"?qen():t==="ar"?Uen():t==="es"?Gen():t==="hi"?Ven():Fen()}),Wen=()=>"Replace key",Qen=()=>"替换密钥",Xen=()=>"جایگزینی کلید",Yen=()=>"استبدال المفتاح",Zen=()=>"Reemplazar clave",Jen=()=>"की बदलें",etn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Qen():t==="fa"?Xen():t==="ar"?Yen():t==="es"?Zen():t==="hi"?Jen():Wen()}),ttn=()=>"Replace token",ntn=()=>"替换令牌",rtn=()=>"جایگزینی توکن",stn=()=>"استبدال الرمز",itn=()=>"Reemplazar token",atn=()=>"टोकन बदलें",otn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ntn():t==="fa"?rtn():t==="ar"?stn():t==="es"?itn():t==="hi"?atn():ttn()}),ctn=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,ltn=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,utn=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,_tn=e=>`إعدادات Git وGitHub لـ ${e==null?void 0:e.project}. تعتمد التجارب على Git المحلي؛ والنشر اختياري.`,ftn=e=>`Configuración de Git y GitHub de ${e==null?void 0:e.project}. Git local hace posibles los experimentos; publicar es opcional.`,dtn=e=>`${e==null?void 0:e.project} के लिए Git और GitHub सेटिंग्स। लोकल Git प्रयोगों को चलाता है; प्रकाशन वैकल्पिक है।`,htn=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?ltn(e):t==="fa"?utn(e):t==="ar"?_tn(e):t==="es"?ftn(e):t==="hi"?dtn(e):ctn(e)}),ptn=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,mtn=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,gtn=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,vtn=e=>`الإصدار ${e==null?void 0:e.installed} مثبّت. لا تزال هذه النافذة تعمل بالإصدار ${e==null?void 0:e.current}.`,btn=e=>`La versión ${e==null?void 0:e.installed} está instalada. Esta ventana sigue ejecutando la ${e==null?void 0:e.current}.`,ytn=e=>`वर्शन ${e==null?void 0:e.installed} इंस्टॉल है। यह विंडो अभी भी ${e==null?void 0:e.current} चला रही है।`,xtn=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?mtn(e):t==="fa"?gtn(e):t==="ar"?vtn(e):t==="es"?btn(e):t==="hi"?ytn(e):ptn(e)}),wtn=()=>"Run `gh auth login` in your terminal.",ktn=()=>"请在终端中运行 `gh auth login`。",Stn=()=>"در پایانه `gh auth login` را اجرا کنید.",Ctn=()=>"نفّذ `gh auth login` في طرفيتك.",Etn=()=>"Ejecuta `gh auth login` en tu terminal.",Ntn=()=>"अपने टर्मिनल में `gh auth login` चलाएं।",ztn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ktn():t==="fa"?Stn():t==="ar"?Ctn():t==="es"?Etn():t==="hi"?Ntn():wtn()}),jtn=()=>"Saved",Ttn=()=>"已保存",Atn=()=>"ذخیره شده",Rtn=()=>"تم الحفظ",Mtn=()=>"Guardado",Otn=()=>"सेव हो गया",$z=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ttn():t==="fa"?Atn():t==="ar"?Rtn():t==="es"?Mtn():t==="hi"?Otn():jtn()}),Dtn=()=>"Set up",Ltn=()=>"设置",Itn=()=>"راه‌اندازی",$tn=()=>"إعداد",Btn=()=>"Configurar",Ptn=()=>"सेट अप करें",Ftn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ltn():t==="fa"?Itn():t==="ar"?$tn():t==="es"?Btn():t==="hi"?Ptn():Dtn()}),Htn=()=>"Set up SSH key",qtn=()=>"设置 SSH 密钥",Utn=()=>"راه‌اندازی کلید SSH",Gtn=()=>"إعداد مفتاح SSH",Vtn=()=>"Configurar clave SSH",Ktn=()=>"SSH की सेट अप करें",Wtn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qtn():t==="fa"?Utn():t==="ar"?Gtn():t==="es"?Vtn():t==="hi"?Ktn():Htn()}),Qtn=()=>"Sign in",Xtn=()=>"登录",Ytn=()=>"ورود",Ztn=()=>"تسجيل الدخول",Jtn=()=>"Iniciar sesión",enn=()=>"साइन इन करें",AL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Xtn():t==="fa"?Ytn():t==="ar"?Ztn():t==="es"?Jtn():t==="hi"?enn():Qtn()}),tnn=e=>`SSH connection terminal for ${e==null?void 0:e.host}`,nnn=e=>`${e==null?void 0:e.host} 的 SSH 连接终端`,rnn=e=>`پایانهٔ اتصال SSH برای ${e==null?void 0:e.host}`,snn=e=>`طرفية اتصال SSH لـ ${e==null?void 0:e.host}`,inn=e=>`Terminal de conexión SSH para ${e==null?void 0:e.host}`,ann=e=>`${e==null?void 0:e.host} के लिए SSH कनेक्शन टर्मिनल`,RL=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?nnn(e):t==="fa"?rnn(e):t==="ar"?snn(e):t==="es"?inn(e):t==="hi"?ann(e):tnn(e)}),onn=()=>"The local database, run logs, artifacts, and chat attachments. Moving this directory copies the entire store.",cnn=()=>"本地数据库、运行日志、产物和聊天附件。移动此目录会复制整个存储。",lnn=()=>"پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگو. انتقال این پوشه، کل مخزن داده را کپی می‌کند.",unn=()=>"قاعدة البيانات المحلية وسجلات التشغيل والمُخرَجات ومرفقات المحادثة. نقل هذا الدليل ينسخ المخزن بالكامل.",_nn=()=>"La base de datos local, los logs de las ejecuciones, los artefactos y los adjuntos de los chats. Mover este directorio copia todo el almacén.",fnn=()=>"लोकल डेटाबेस, रन लॉग, आर्टिफ़ैक्ट और चैट अटैचमेंट। इस डायरेक्टरी को स्थानांतरित करने पर पूरा स्टोर कॉपी होता है।",dnn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cnn():t==="fa"?lnn():t==="ar"?unn():t==="es"?_nn():t==="hi"?fnn():onn()}),hnn=()=>"The terminal disconnected before setup completed. Try again.",pnn=()=>"设置完成前终端连接已断开。请重试。",mnn=()=>"ارتباط ترمینال پیش از تکمیل راه‌اندازی قطع شد. دوباره تلاش کنید.",gnn=()=>"انقطعت الطرفية قبل اكتمال الإعداد. حاول مجددًا.",vnn=()=>"La terminal se desconectó antes de completar la configuración. Inténtalo de nuevo.",bnn=()=>"सेटअप पूरा होने से पहले टर्मिनल डिस्कनेक्ट हो गया। फिर से कोशिश करें।",jv=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pnn():t==="fa"?mnn():t==="ar"?gnn():t==="es"?vnn():t==="hi"?bnn():hnn()}),ynn=()=>"Dark",xnn=()=>"深色",wnn=()=>"تیره",knn=()=>"داكن",Snn=()=>"Oscuro",Cnn=()=>"डार्क",Enn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xnn():t==="fa"?wnn():t==="ar"?knn():t==="es"?Snn():t==="hi"?Cnn():ynn()}),Nnn=()=>"Theme",znn=()=>"主题",jnn=()=>"پوسته",Tnn=()=>"السمة",Ann=()=>"Tema",Rnn=()=>"थीम",Bz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?znn():t==="fa"?jnn():t==="ar"?Tnn():t==="es"?Ann():t==="hi"?Rnn():Nnn()}),Mnn=()=>"Light",Onn=()=>"浅色",Dnn=()=>"روشن",Lnn=()=>"فاتح",Inn=()=>"Claro",$nn=()=>"लाइट",Bnn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Onn():t==="fa"?Dnn():t==="ar"?Lnn():t==="es"?Inn():t==="hi"?$nn():Mnn()}),Pnn=()=>"System",Fnn=()=>"系统",Hnn=()=>"سیستم",qnn=()=>"النظام",Unn=()=>"Sistema",Gnn=()=>"सिस्टम",Vnn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Fnn():t==="fa"?Hnn():t==="ar"?qnn():t==="es"?Unn():t==="hi"?Gnn():Pnn()}),Knn=()=>"Set up billing in the Tinker console",Wnn=()=>"在 Tinker 控制台设置账单",Qnn=()=>"تنظیم پرداخت در کنسول Tinker",Xnn=()=>"أعِدّ الفوترة في وحدة تحكم Tinker",Ynn=()=>"Configura la facturación en la consola de Tinker",Znn=()=>"Tinker कंसोल में बिलिंग सेट अप करें",Jnn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Wnn():t==="fa"?Qnn():t==="ar"?Xnn():t==="es"?Ynn():t==="hi"?Znn():Knn()}),ern=()=>"Billing setup required",trn=()=>"需要设置账单",nrn=()=>"تنظیم پرداخت لازم است",rrn=()=>"مطلوب إعداد الفوترة",srn=()=>"Hay que configurar la facturación",irn=()=>"बिलिंग सेटअप ज़रूरी है",arn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?trn():t==="fa"?nrn():t==="ar"?rrn():t==="es"?srn():t==="hi"?irn():ern()}),orn=()=>"TINKER_API_KEY is set in the process environment and overrides keys saved here. The status reflects that key.",crn=()=>"进程环境中已设置 TINKER_API_KEY,它会覆盖此处保存的密钥。状态显示的是该密钥的检查结果。",lrn=()=>"متغیر TINKER_API_KEY در محیط فرایند تنظیم شده و بر کلیدهای ذخیره‌شده در اینجا اولویت دارد. وضعیت مربوط به همان کلید است.",urn=()=>"‏TINKER_API_KEY مضبوط في بيئة العملية ويتجاوز المفاتيح المحفوظة هنا. تعكس الحالة ذلك المفتاح.",_rn=()=>"TINKER_API_KEY está definida en el entorno del proceso y tiene prioridad sobre las claves guardadas aquí. El estado corresponde a esa clave.",frn=()=>"TINKER_API_KEY प्रोसेस एनवायरनमेंट में सेट है और यहाँ सेव की को ओवरराइड करता है। स्थिति उसी की को दर्शाती है।",drn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?crn():t==="fa"?lrn():t==="ar"?urn():t==="es"?_rn():t==="hi"?frn():orn()}),hrn=()=>"Invalid Key",prn=()=>"密钥无效",mrn=()=>"کلید نامعتبر",grn=()=>"مفتاح غير صالح",vrn=()=>"Clave no válida",brn=()=>"अमान्य की",yrn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?prn():t==="fa"?mrn():t==="ar"?grn():t==="es"?vrn():t==="hi"?brn():hrn()}),xrn=()=>"Token from",wrn=()=>"令牌来自",krn=()=>"توکن از",Srn=()=>"الرمز من",Crn=()=>"Token tomado de la",Ern=()=>"टोकन स्रोत",Nrn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?wrn():t==="fa"?krn():t==="ar"?Srn():t==="es"?Crn():t==="hi"?Ern():xrn()}),zrn=()=>"Update now",jrn=()=>"立即更新",Trn=()=>"اکنون به‌روزرسانی کن",Arn=()=>"التحديث الآن",Rrn=()=>"Actualizar ahora",Mrn=()=>"अभी अपडेट करें",Orn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jrn():t==="fa"?Trn():t==="ar"?Arn():t==="es"?Rrn():t==="hi"?Mrn():zrn()}),Drn=e=>`Update to ${e==null?void 0:e.version}`,Lrn=e=>`更新到 ${e==null?void 0:e.version}`,Irn=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,$rn=e=>`التحديث إلى ${e==null?void 0:e.version}`,Brn=e=>`Actualizar a ${e==null?void 0:e.version}`,Prn=e=>`वर्शन ${e==null?void 0:e.version} पर अपडेट करें`,Frn=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Lrn(e):t==="fa"?Irn(e):t==="ar"?$rn(e):t==="es"?Brn(e):t==="hi"?Prn(e):Drn(e)}),Hrn=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",qrn=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",Urn=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",Grn=()=>" التحديثات معطّلة لهذه البيئة عبر ORX_NO_UPDATE_CHECK، لذا ليس لهذا الإعداد أثر.",Vrn=()=>" ORX_NO_UPDATE_CHECK desactiva las actualizaciones en este entorno, así que este ajuste no tiene efecto.",Krn=()=>" इस एनवायरनमेंट के लिए ORX_NO_UPDATE_CHECK द्वारा अपडेट बंद कर दिए गए हैं, इसलिए इस सेटिंग का कोई असर नहीं है।",Wrn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qrn():t==="fa"?Urn():t==="ar"?Grn():t==="es"?Vrn():t==="hi"?Krn():Hrn()}),Qrn=()=>"Updating default destination…",Xrn=()=>"正在更新默认运行位置…",Yrn=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",Zrn=()=>"جارٍ تحديث الوجهة الافتراضية…",Jrn=()=>"Actualizando el destino predeterminado…",esn=()=>"डिफ़ॉल्ट गंतव्य अपडेट हो रहा है…",tsn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Xrn():t==="fa"?Yrn():t==="ar"?Zrn():t==="es"?Jrn():t==="hi"?esn():Qrn()}),nsn=()=>"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.",rsn=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",ssn=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",isn=()=>"استخدم هذا المستودع لرفع فروع التجارب تلقائيًا عندما يملك حسابك المتصل صلاحية الكتابة فيه. وإلا، ينشئ OpenResearch مستودعًا خاصًا منفصلًا للتعاون.",asn=()=>"Usar este repositorio para subir automáticamente las ramas de los experimentos si tu cuenta conectada tiene permiso de escritura. Si no, OpenResearch crea un repositorio privado aparte para colaborar.",osn=()=>"जब आपका कनेक्टेड खाता इसमें लिख सकता है तो ऑटोमैटिक प्रयोग-ब्रांच पुश के लिए इस रिपॉज़िटरी का इस्तेमाल करें। नहीं तो, OpenResearch सहयोग के लिए एक अलग निजी रिपॉज़िटरी बनाता है।",csn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?rsn():t==="fa"?ssn():t==="ar"?isn():t==="es"?asn():t==="hi"?osn():nsn()}),lsn=()=>"Validating…",usn=()=>"正在验证…",_sn=()=>"در حال اعتبارسنجی…",fsn=()=>"جارٍ التحقق…",dsn=()=>"Validando…",hsn=()=>"सत्यापित हो रहा है…",ML=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?usn():t==="fa"?_sn():t==="ar"?fsn():t==="es"?dsn():t==="hi"?hsn():lsn()}),psn=()=>"View settings",msn=()=>"查看设置",gsn=()=>"مشاهدهٔ تنظیمات",vsn=()=>"عرض الإعدادات",bsn=()=>"Ver configuración",ysn=()=>"सेटिंग्स देखें",xsn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?msn():t==="fa"?gsn():t==="ar"?vsn():t==="es"?bsn():t==="hi"?ysn():psn()}),wsn=()=>"Skill",ksn=()=>"技能",Ssn=()=>"مهارت",Csn=()=>"مهارة",Esn=()=>"Skill",Nsn=()=>"स्किल",zsn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ksn():t==="fa"?Ssn():t==="ar"?Csn():t==="es"?Esn():t==="hi"?Nsn():wsn()}),jsn=()=>"Loading skill…",Tsn=()=>"正在加载技能…",Asn=()=>"در حال بارگیری مهارت…",Rsn=()=>"جارٍ تحميل المهارة…",Msn=()=>"Cargando skill…",Osn=()=>"स्किल लोड हो रही है…",Dsn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Tsn():t==="fa"?Asn():t==="ar"?Rsn():t==="es"?Msn():t==="hi"?Osn():jsn()}),Lsn=()=>"Personal",Isn=()=>"个人",$sn=()=>"شخصی",Bsn=()=>"شخصي",Psn=()=>"Personal",Fsn=()=>"व्यक्तिगत",Hsn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Isn():t==="fa"?$sn():t==="ar"?Bsn():t==="es"?Psn():t==="hi"?Fsn():Lsn()}),qsn=()=>"Alternatively, tell your agent to save a reusable skill for you.",Usn=()=>"或者,请你的智能体为你保存可重复使用的技能。",Gsn=()=>"یا از عامل خود بخواهید یک مهارت قابل استفادهٔ مجدد برایتان ذخیره کند.",Vsn=()=>"أو بدلًا من ذلك، اطلب من وكيلك حفظ مهارة قابلة لإعادة الاستخدام لك.",Ksn=()=>"También puedes pedirle a tu agente que guarde una skill reutilizable por ti.",Wsn=()=>"या अपने एजेंट से आपके लिए एक पुनः-प्रयोग करने योग्य स्किल सेव करने को कहें।",Qsn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Usn():t==="fa"?Gsn():t==="ar"?Vsn():t==="es"?Ksn():t==="hi"?Wsn():qsn()}),Xsn=e=>`Delete the “${e==null?void 0:e.name}” skill?`,Ysn=e=>`删除技能“${e==null?void 0:e.name}”?`,Zsn=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,Jsn=e=>`حذف مهارة «${e==null?void 0:e.name}»؟`,ein=e=>`¿Eliminar la skill “${e==null?void 0:e.name}”?`,tin=e=>`“${e==null?void 0:e.name}” स्किल हटाएं?`,nin=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Ysn(e):t==="fa"?Zsn(e):t==="ar"?Jsn(e):t==="es"?ein(e):t==="hi"?tin(e):Xsn(e)}),rin=e=>`Delete skill ${e==null?void 0:e.name}`,sin=e=>`删除技能 ${e==null?void 0:e.name}`,iin=e=>`حذف مهارت ${e==null?void 0:e.name}`,ain=e=>`حذف المهارة ${e==null?void 0:e.name}`,oin=e=>`Eliminar la skill ${e==null?void 0:e.name}`,cin=e=>`${e==null?void 0:e.name} स्किल हटाएं`,lin=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?sin(e):t==="fa"?iin(e):t==="ar"?ain(e):t==="es"?oin(e):t==="hi"?cin(e):rin(e)}),uin=e=>`Delete the “${e==null?void 0:e.name}” template?`,_in=e=>`删除模板“${e==null?void 0:e.name}”?`,fin=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,din=e=>`حذف قالب «${e==null?void 0:e.name}»؟`,hin=e=>`¿Eliminar la plantilla “${e==null?void 0:e.name}”?`,pin=e=>`“${e==null?void 0:e.name}” टेम्पलेट हटाएं?`,min=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?_in(e):t==="fa"?fin(e):t==="ar"?din(e):t==="es"?hin(e):t==="hi"?pin(e):uin(e)}),gin=e=>`Delete template ${e==null?void 0:e.name}`,vin=e=>`删除模板 ${e==null?void 0:e.name}`,bin=e=>`حذف قالب ${e==null?void 0:e.name}`,yin=e=>`حذف القالب ${e==null?void 0:e.name}`,xin=e=>`Eliminar la plantilla ${e==null?void 0:e.name}`,win=e=>`${e==null?void 0:e.name} टेम्पलेट हटाएं`,kin=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?vin(e):t==="fa"?bin(e):t==="ar"?yin(e):t==="es"?xin(e):t==="hi"?win(e):gin(e)}),Sin=()=>"Invoke skills with /name in chat. Skills from your coding agents are screened for research relevance before importing. Upload a skill to include it yourself. Alternatively, tell your OpenResearch agent to create and add a reusable skill for you.",Cin=()=>"在聊天中使用 /name 调用技能。来自编程代理的技能会先经过研究相关性筛选,再导入。您也可以自行上传技能,或让 OpenResearch 代理为您创建并添加可复用技能。",Ein=()=>"مهارت‌ها را با /name در گفتگو فراخوانی کنید. مهارت‌های عامل‌های برنامه‌نویسی پیش از وارد شدن از نظر ارتباط با پژوهش بررسی می‌شوند. می‌توانید مهارت را خودتان بارگذاری کنید یا از عامل OpenResearch بخواهید یک مهارت قابل استفادهٔ مجدد بسازد و اضافه کند.",Nin=()=>"استدعِ المهارات عبر ‎/name‎ في المحادثة. تُفحَص مهارات وكلاء البرمجة لديك للتأكد من صلتها بالبحث قبل استيرادها. ارفع مهارة لتضمينها بنفسك. أو بدلًا من ذلك، اطلب من وكيل OpenResearch إنشاء مهارة قابلة لإعادة الاستخدام وإضافتها لك.",zin=()=>"Usa las skills con /nombre en el chat. Las skills de tus agentes de programación se filtran según su relevancia para la investigación antes de importarlas. Sube una skill para incluirla tú mismo. También puedes pedirle a tu agente de OpenResearch que cree y añada una skill reutilizable por ti.",jin=()=>"चैट में /नाम से स्किल इस्तेमाल करें। आपके कोडिंग एजेंटों की स्किल इंपोर्ट करने से पहले शोध प्रासंगिकता के लिए जाँची जाती हैं। खुद स्किल शामिल करने के लिए एक अपलोड करें। या अपने OpenResearch एजेंट से आपके लिए एक पुनः-प्रयोग करने योग्य स्किल बनाने और जोड़ने को कहें।",Tin=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Cin():t==="fa"?Ein():t==="ar"?Nin():t==="es"?zin():t==="hi"?jin():Sin()}),Ain=()=>"Drop a SKILL.md or .zip here, or click to choose",Rin=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",Min=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Oin=()=>"أفلِت ملف ‎SKILL.md‎ أو ‎.zip‎ هنا، أو انقر للاختيار",Din=()=>"Suelta aquí un SKILL.md o un .zip, o haz clic para elegirlo",Lin=()=>"यहाँ एक SKILL.md या .zip छोड़ें, या चुनने के लिए क्लिक करें",Iin=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rin():t==="fa"?Min():t==="ar"?Oin():t==="es"?Din():t==="hi"?Lin():Ain()}),$in=()=>"Drop a .tex or .zip here, or click to choose",Bin=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",Pin=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Fin=()=>"أفلِت ملف ‎.tex‎ أو ‎.zip‎ هنا، أو انقر للاختيار",Hin=()=>"Suelta aquí un .tex o un .zip, o haz clic para elegirlo",qin=()=>"यहाँ एक .tex या .zip छोड़ें, या चुनने के लिए क्लिक करें",Uin=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bin():t==="fa"?Pin():t==="ar"?Fin():t==="es"?Hin():t==="hi"?qin():$in()}),Gin=()=>"File too large (max 20 MB).",Vin=()=>"文件过大(最大 20 MB)。",Kin=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",Win=()=>"الملف كبير جدًا (بحد أقصى 20 ميغابايت).",Qin=()=>"Archivo demasiado grande (máx. 20 MB).",Xin=()=>"फ़ाइल बहुत बड़ी है (अधिकतम 20 MB)।",OL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vin():t==="fa"?Kin():t==="ar"?Win():t==="es"?Qin():t==="hi"?Xin():Gin()}),Yin=()=>" + 1 file",Zin=()=>" + 1 个文件",Jin=()=>" + ۱ فایل",ean=()=>" + ملف واحد",tan=()=>" + 1 archivo",nan=()=>" + 1 फ़ाइल",ran=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Zin():t==="fa"?Jin():t==="ar"?ean():t==="es"?tan():t==="hi"?nan():Yin()}),san=()=>"Customize the skills and LaTeX templates available across your projects. Upload them here, or ask an OpenResearch agent to create and add them for you.",ian=()=>"自定义所有项目中可用的技能和 LaTeX 模板。在此上传,或让 OpenResearch 代理为您创建并添加。",aan=()=>"مهارت‌ها و قالب‌های LaTeX قابل استفاده در همهٔ پروژه‌ها را سفارشی کنید. آن‌ها را اینجا بارگذاری کنید یا از عامل OpenResearch بخواهید برایتان بسازد و اضافه کند.",oan=()=>"خصّص المهارات وقوالب LaTeX المتاحة عبر مشاريعك. ارفعها هنا، أو اطلب من وكيل OpenResearch إنشاءها وإضافتها لك.",can=()=>"Personaliza las skills y plantillas de LaTeX disponibles en todos tus proyectos. Súbelas aquí o pídele a un agente de OpenResearch que las cree y las añada por ti.",lan=()=>"अपने प्रोजेक्ट में उपलब्ध स्किल और LaTeX टेम्पलेट कस्टमाइज़ करें। उन्हें यहाँ अपलोड करें, या किसी OpenResearch एजेंट से आपके लिए उन्हें बनाने और जोड़ने को कहें।",uan=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ian():t==="fa"?aan():t==="ar"?oan():t==="es"?can():t==="hi"?lan():san()}),_an=()=>"Remove from OpenResearch",fan=()=>"从 OpenResearch 移除",dan=()=>"حذف از OpenResearch",han=()=>"إزالة من OpenResearch",pan=()=>"Quitar de OpenResearch",man=()=>"OpenResearch से हटाएं",gan=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fan():t==="fa"?dan():t==="ar"?han():t==="es"?pan():t==="hi"?man():_an()}),van=e=>`Remove “${e==null?void 0:e.name}” from OpenResearch? Its source files will remain in your coding agent.`,ban=e=>`从 OpenResearch 移除“${e==null?void 0:e.name}”?源文件将保留在你的编程智能体中。`,yan=e=>`«${e==null?void 0:e.name}» از OpenResearch حذف شود؟ فایل‌های اصلی در عامل برنامه‌نویسی شما باقی می‌مانند.`,xan=e=>`إزالة «${e==null?void 0:e.name}» من OpenResearch؟ ستبقى ملفاتها المصدرية في وكيل البرمجة الخاص بك.`,wan=e=>`¿Quitar “${e==null?void 0:e.name}” de OpenResearch? Sus archivos originales se conservarán en tu agente de programación.`,kan=e=>`“${e==null?void 0:e.name}” को OpenResearch से हटाएं? इसकी सोर्स फ़ाइलें आपके कोडिंग एजेंट में बनी रहेंगी।`,San=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?ban(e):t==="fa"?yan(e):t==="ar"?xan(e):t==="es"?wan(e):t==="hi"?kan(e):van(e)}),Can=e=>`Remove ${e==null?void 0:e.name} from OpenResearch`,Ean=e=>`从 OpenResearch 移除 ${e==null?void 0:e.name}`,Nan=e=>`حذف ${e==null?void 0:e.name} از OpenResearch`,zan=e=>`إزالة ${e==null?void 0:e.name} من OpenResearch`,jan=e=>`Quitar ${e==null?void 0:e.name} de OpenResearch`,Tan=e=>`${e==null?void 0:e.name} को OpenResearch से हटाएं`,Aan=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Ean(e):t==="fa"?Nan(e):t==="ar"?zan(e):t==="es"?jan(e):t==="hi"?Tan(e):Can(e)}),Ran=e=>` + ${e==null?void 0:e.count} files`,Man=e=>` + ${e==null?void 0:e.count} 个文件`,Oan=e=>` + ${e==null?void 0:e.count} فایل`,Dan=e=>` + ملفات (${e==null?void 0:e.count})`,Lan=e=>` + ${e==null?void 0:e.count} archivos`,Ian=e=>` + ${e==null?void 0:e.count} फ़ाइलें`,$an=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Man(e):t==="fa"?Oan(e):t==="ar"?Dan(e):t==="es"?Lan(e):t==="hi"?Ian(e):Ran(e)}),Ban=()=>"Could not load skills:",Pan=()=>"无法加载技能:",Fan=()=>"بارگیری مهارت‌ها ممکن نشد:",Han=()=>"تعذّر تحميل المهارات:",qan=()=>"No se pudieron cargar las skills:",Uan=()=>"स्किल लोड नहीं हो सकीं:",Gan=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Pan():t==="fa"?Fan():t==="ar"?Han():t==="es"?qan():t==="hi"?Uan():Ban()}),Van=()=>"Could not load templates:",Kan=()=>"无法加载模板:",Wan=()=>"بارگیری قالب‌ها ممکن نشد:",Qan=()=>"تعذّر تحميل القوالب:",Xan=()=>"No se pudieron cargar las plantillas:",Yan=()=>"टेम्पलेट लोड नहीं हो सके:",Zan=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Kan():t==="fa"?Wan():t==="ar"?Qan():t==="es"?Xan():t==="hi"?Yan():Van()}),Jan=()=>"Customize",eon=()=>"自定义",ton=()=>"سفارشی‌سازی",non=()=>"تخصيص",ron=()=>"Personalizar",son=()=>"कस्टमाइज़ करें",ion=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?eon():t==="fa"?ton():t==="ar"?non():t==="es"?ron():t==="hi"?son():Jan()}),aon=()=>"Delete skill",oon=()=>"删除技能",con=()=>"حذف مهارت",lon=()=>"حذف المهارة",uon=()=>"Eliminar skill",_on=()=>"स्किल हटाएं",fon=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?oon():t==="fa"?con():t==="ar"?lon():t==="es"?uon():t==="hi"?_on():aon()}),don=()=>"Delete template",hon=()=>"删除模板",pon=()=>"حذف قالب",mon=()=>"حذف القالب",gon=()=>"Eliminar plantilla",von=()=>"टेम्पलेट हटाएं",bon=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hon():t==="fa"?pon():t==="ar"?mon():t==="es"?gon():t==="hi"?von():don()}),yon=()=>"LaTeX templates",xon=()=>"LaTeX 模板",won=()=>"قالب‌های LaTeX",kon=()=>"قوالب LaTeX",Son=()=>"Plantillas de LaTeX",Con=()=>"LaTeX टेम्पलेट",Eon=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xon():t==="fa"?won():t==="ar"?kon():t==="es"?Son():t==="hi"?Con():yon()}),Non=()=>"Loading skills…",zon=()=>"正在加载技能…",jon=()=>"در حال بارگیری مهارت‌ها…",Ton=()=>"جارٍ تحميل المهارات…",Aon=()=>"Cargando skills…",Ron=()=>"स्किल लोड हो रही हैं…",Mon=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zon():t==="fa"?jon():t==="ar"?Ton():t==="es"?Aon():t==="hi"?Ron():Non()}),Oon=()=>"Loading templates…",Don=()=>"正在加载模板…",Lon=()=>"در حال بارگیری قالب‌ها…",Ion=()=>"جارٍ تحميل القوالب…",$on=()=>"Cargando plantillas…",Bon=()=>"टेम्पलेट लोड हो रहे हैं…",Pon=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Don():t==="fa"?Lon():t==="ar"?Ion():t==="es"?$on():t==="hi"?Bon():Oon()}),Fon=()=>"No skills yet.",Hon=()=>"尚无技能。",qon=()=>"هنوز مهارتی وجود ندارد.",Uon=()=>"لا توجد مهارات بعد.",Gon=()=>"Aún no hay skills.",Von=()=>"अभी तक कोई स्किल नहीं।",Kon=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Hon():t==="fa"?qon():t==="ar"?Uon():t==="es"?Gon():t==="hi"?Von():Fon()}),Won=()=>"No templates yet.",Qon=()=>"尚无模板。",Xon=()=>"هنوز قالبی وجود ندارد.",Yon=()=>"لا توجد قوالب بعد.",Zon=()=>"Aún no hay plantillas.",Jon=()=>"अभी तक कोई टेम्पलेट नहीं।",ecn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Qon():t==="fa"?Xon():t==="ar"?Yon():t==="es"?Zon():t==="hi"?Jon():Won()}),tcn=()=>"Skills",ncn=()=>"技能",rcn=()=>"مهارت‌ها",scn=()=>"المهارات",icn=()=>"Skills",acn=()=>"स्किल",ocn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ncn():t==="fa"?rcn():t==="ar"?scn():t==="es"?icn():t==="hi"?acn():tcn()}),ccn=()=>"Uploading…",lcn=()=>"正在上传…",ucn=()=>"در حال بارگذاری…",_cn=()=>"جارٍ الرفع…",fcn=()=>"Subiendo…",dcn=()=>"अपलोड हो रहा है…",hcn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?lcn():t==="fa"?ucn():t==="ar"?_cn():t==="es"?fcn():t==="hi"?dcn():ccn()}),pcn=()=>"A conference class or house style the agent writes papers into instead of its default preamble. Upload a .tex file or a .zip containing its .cls and .sty files. Alternatively, tell your OpenResearch agent to create and add a LaTeX template for you. With exactly one template available, the agent uses it without asking.",mcn=()=>"代理撰写论文时使用的会议格式或自定义样式,用于替代默认导言区。上传 .tex 文件或包含 .cls 和 .sty 文件的 .zip 压缩包,也可以让 OpenResearch 代理为您创建并添加 LaTeX 模板。只有一个模板可用时,代理会直接使用,无需询问。",gcn=()=>"قالب کنفرانس یا سبک اختصاصی که عامل به‌جای پیش‌گفتار پیش‌فرض برای نوشتن مقاله استفاده می‌کند. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید، یا از عامل OpenResearch بخواهید قالب LaTeX بسازد و اضافه کند. اگر تنها یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",vcn=()=>"قالب مؤتمر أو تنسيق خاص بالمؤسسة يستخدمه الوكيل لكتابة الأوراق بدلًا من إعدادات LaTeX الافتراضية. ارفع ملف ‎.tex‎ أو ملف ‎.zip‎ يحتوي على ملفات ‎.cls‎ و‎.sty‎ الخاصة به. أو اطلب من وكيل OpenResearch إنشاء قالب LaTeX وإضافته لك. عند توفّر قالب واحد فقط، يستخدمه الوكيل دون سؤال.",bcn=()=>"Un estilo de congreso o de la casa en el que el agente escribe los papers en lugar de usar su preámbulo predeterminado. Sube un archivo .tex o un .zip con sus archivos .cls y .sty. También puedes pedirle a tu agente de OpenResearch que cree y añada una plantilla de LaTeX por ti. Si solo hay una plantilla disponible, el agente la usa sin preguntar.",ycn=()=>"एक कॉन्फ़्रेंस क्लास या हाउस स्टाइल जिसमें एजेंट अपने डिफ़ॉल्ट प्रीएंबल की बजाय पेपर लिखता है। एक .tex फ़ाइल या उसकी .cls और .sty फ़ाइलों वाली .zip अपलोड करें। या अपने OpenResearch एजेंट से आपके लिए एक LaTeX टेम्पलेट बनाने और जोड़ने को कहें। ठीक एक टेम्पलेट उपलब्ध होने पर, एजेंट बिना पूछे उसी का इस्तेमाल करता है।",xcn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?mcn():t==="fa"?gcn():t==="ar"?vcn():t==="es"?bcn():t==="hi"?ycn():pcn()}),wcn=()=>"Upload a SKILL.md file or a .zip of a skill folder.",kcn=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",Scn=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",Ccn=()=>"ارفع ملف ‎SKILL.md‎ أو ملف ‎.zip‎ لمجلد مهارة.",Ecn=()=>"Sube un archivo SKILL.md o un .zip con la carpeta de la skill.",Ncn=()=>"एक SKILL.md फ़ाइल या स्किल फ़ोल्डर की .zip अपलोड करें।",zcn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?kcn():t==="fa"?Scn():t==="ar"?Ccn():t==="es"?Ecn():t==="hi"?Ncn():wcn()}),jcn=()=>"Upload a .tex file or a .zip of a template folder.",Tcn=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",Acn=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",Rcn=()=>"ارفع ملف ‎.tex‎ أو ملف ‎.zip‎ لمجلد قالب.",Mcn=()=>"Sube un archivo .tex o un .zip con la carpeta de la plantilla.",Ocn=()=>"एक .tex फ़ाइल या टेम्पलेट फ़ोल्डर की .zip अपलोड करें।",Dcn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Tcn():t==="fa"?Acn():t==="ar"?Rcn():t==="es"?Mcn():t==="hi"?Ocn():jcn()}),Lcn=()=>"Close SSH config",Icn=()=>"关闭 SSH 配置",$cn=()=>"بستن پیکربندی SSH",Bcn=()=>"إغلاق إعداد SSH",Pcn=()=>"Cerrar la configuración SSH",Fcn=()=>"SSH कॉन्फ़िग बंद करें",Hcn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Icn():t==="fa"?$cn():t==="ar"?Bcn():t==="es"?Pcn():t==="hi"?Fcn():Lcn()}),qcn=()=>"Discard your unsaved SSH config changes?",Ucn=()=>"要放弃未保存的 SSH 配置更改吗?",Gcn=()=>"تغییرات ذخیره‌نشدهٔ پیکربندی SSH کنار گذاشته شود؟",Vcn=()=>"تجاهل تغييرات إعداد SSH غير المحفوظة؟",Kcn=()=>"¿Descartar los cambios sin guardar en la configuración SSH?",Wcn=()=>"आपके सेव न किए गए SSH कॉन्फ़िग बदलाव छोड़ें?",Qcn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ucn():t==="fa"?Gcn():t==="ar"?Vcn():t==="es"?Kcn():t==="hi"?Wcn():qcn()}),Xcn=()=>"Loading SSH config…",Ycn=()=>"正在加载 SSH 配置…",Zcn=()=>"در حال بارگیری پیکربندی SSH…",Jcn=()=>"جارٍ تحميل إعداد SSH…",eln=()=>"Cargando la configuración SSH…",tln=()=>"SSH कॉन्फ़िग लोड हो रहा है…",nln=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ycn():t==="fa"?Zcn():t==="ar"?Jcn():t==="es"?eln():t==="hi"?tln():Xcn()}),rln=()=>"SSH config saved",sln=()=>"SSH 配置已保存",iln=()=>"پیکربندی SSH ذخیره شد",aln=()=>"تم حفظ إعداد SSH",oln=()=>"Configuración SSH guardada",cln=()=>"SSH कॉन्फ़िग सेव हो गया",lln=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?sln():t==="fa"?iln():t==="ar"?aln():t==="es"?oln():t==="hi"?cln():rln()}),uln=()=>"SSH config",_ln=()=>"SSH 配置",fln=()=>"پیکربندی SSH",dln=()=>"إعداد SSH",hln=()=>"Configuración SSH",pln=()=>"SSH कॉन्फ़िग",mln=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_ln():t==="fa"?fln():t==="ar"?dln():t==="es"?hln():t==="hi"?pln():uln()}),gln=()=>"Configure SSH hosts…",vln=()=>"配置 SSH 主机…",bln=()=>"پیکربندی میزبان‌های SSH…",yln=()=>"إعداد مضيفات SSH…",xln=()=>"Configurar hosts SSH…",wln=()=>"SSH होस्ट कॉन्फ़िगर करें…",DL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vln():t==="fa"?bln():t==="ar"?yln():t==="es"?xln():t==="hi"?wln():gln()}),kln=()=>"Container name or ID",Sln=()=>"容器名称或 ID",Cln=()=>"نام یا شناسهٔ کانتینر",Eln=()=>"اسم الحاوية أو معرّفها",Nln=()=>"Nombre o ID del contenedor",zln=()=>"कंटेनर का नाम या ID",jln=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Sln():t==="fa"?Cln():t==="ar"?Eln():t==="es"?Nln():t==="hi"?zln():kln()}),Tln=()=>"Default SSH host",Aln=()=>"默认 SSH 主机",Rln=()=>"میزبان پیش‌فرض SSH",Mln=()=>"مضيف SSH الافتراضي",Oln=()=>"Servidor SSH predeterminado",Dln=()=>"डिफ़ॉल्ट SSH होस्ट",Lln=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Aln():t==="fa"?Rln():t==="ar"?Mln():t==="es"?Oln():t==="hi"?Dln():Tln()}),Iln=()=>"Direct host",$ln=()=>"直接在主机上",Bln=()=>"مستقیماً روی میزبان",Pln=()=>"المضيف مباشرة",Fln=()=>"Servidor directamente",Hln=()=>"सीधे होस्ट पर",qln=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?$ln():t==="fa"?Bln():t==="ar"?Pln():t==="es"?Fln():t==="hi"?Hln():Iln()}),Uln=()=>"Existing container",Gln=()=>"现有容器",Vln=()=>"کانتینر موجود",Kln=()=>"حاوية موجودة",Wln=()=>"Contenedor existente",Qln=()=>"मौजूदा कंटेनर",Xln=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Gln():t==="fa"?Vln():t==="ar"?Kln():t==="es"?Wln():t==="hi"?Qln():Uln()}),Yln=()=>"Run in",Zln=()=>"运行位置",Jln=()=>"اجرا در",eun=()=>"التشغيل في",tun=()=>"Ejecutar en",nun=()=>"यहाँ चलाएँ",run=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Zln():t==="fa"?Jln():t==="ar"?eun():t==="es"?tun():t==="hi"?nun():Yln()}),sun=()=>"Cancelled",iun=()=>"已取消",aun=()=>"لغوشده",oun=()=>"ملغى",cun=()=>"Cancelado",lun=()=>"रद्द किया गया",uun=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?iun():t==="fa"?aun():t==="ar"?oun():t==="es"?cun():t==="hi"?lun():sun()}),_un=()=>"Cancelling",fun=()=>"正在取消",dun=()=>"در حال لغو",hun=()=>"جارٍ الإلغاء",pun=()=>"Cancelando",mun=()=>"रद्द हो रहा है",gun=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fun():t==="fa"?dun():t==="ar"?hun():t==="es"?pun():t==="hi"?mun():_un()}),vun=()=>"Done",bun=()=>"已完成",yun=()=>"انجام‌شده",xun=()=>"تم",wun=()=>"Completado",kun=()=>"पूरा हुआ",LL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bun():t==="fa"?yun():t==="ar"?xun():t==="es"?wun():t==="hi"?kun():vun()}),Sun=()=>"Editing",Cun=()=>"正在编辑",Eun=()=>"در حال ویرایش",Nun=()=>"قيد التعديل",zun=()=>"Editando",jun=()=>"संपादित हो रहा है",Tun=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Cun():t==="fa"?Eun():t==="ar"?Nun():t==="es"?zun():t==="hi"?jun():Sun()}),Aun=()=>"Failed",Run=()=>"失败",Mun=()=>"ناموفق",Oun=()=>"فشل",Dun=()=>"Error",Lun=()=>"विफल",Iun=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Run():t==="fa"?Mun():t==="ar"?Oun():t==="es"?Dun():t==="hi"?Lun():Aun()}),$un=()=>"Idle",Bun=()=>"空闲",Pun=()=>"بی‌کار",Fun=()=>"خامل",Hun=()=>"Inactivo",qun=()=>"निष्क्रिय",Uun=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bun():t==="fa"?Pun():t==="ar"?Fun():t==="es"?Hun():t==="hi"?qun():$un()}),Gun=()=>"Running",Vun=()=>"运行中",Kun=()=>"در حال اجرا",Wun=()=>"قيد التشغيل",Qun=()=>"En ejecución",Xun=()=>"चल रहा है",Yun=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vun():t==="fa"?Kun():t==="ar"?Wun():t==="es"?Qun():t==="hi"?Xun():Gun()}),Zun=()=>"Starting",Jun=()=>"正在启动",e_n=()=>"در حال آغاز",t_n=()=>"جارٍ البدء",n_n=()=>"Iniciando",r_n=()=>"शुरू हो रहा है",s_n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Jun():t==="fa"?e_n():t==="ar"?t_n():t==="es"?n_n():t==="hi"?r_n():Zun()}),i_n=()=>"Copying…",a_n=()=>"正在复制…",o_n=()=>"در حال کپی…",c_n=()=>"جارٍ النسخ…",l_n=()=>"Copiando…",u_n=()=>"कॉपी हो रहा है…",__n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?a_n():t==="fa"?o_n():t==="ar"?c_n():t==="es"?l_n():t==="hi"?u_n():i_n()}),f_n=()=>"Finalizing…",d_n=()=>"正在完成…",h_n=()=>"در حال نهایی‌سازی…",p_n=()=>"جارٍ الإنهاء…",m_n=()=>"Finalizando…",g_n=()=>"अंतिम रूप दिया जा रहा है…",v_n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?d_n():t==="fa"?h_n():t==="ar"?p_n():t==="es"?m_n():t==="hi"?g_n():f_n()}),b_n=e=>`${e==null?void 0:e.size} free at target`,y_n=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,x_n=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,w_n=e=>`${e==null?void 0:e.size} متاح في الوجهة`,k_n=e=>`${e==null?void 0:e.size} libres en el destino`,S_n=e=>`गंतव्य पर ${e==null?void 0:e.size} खाली`,C_n=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?y_n(e):t==="fa"?x_n(e):t==="ar"?w_n(e):t==="es"?k_n(e):t==="hi"?S_n(e):b_n(e)}),E_n=e=>`Move all orx data to: ${e==null?void 0:e.path} -The store is copied to the new location and activated there. Active runs or chats will block the move.`,m_n=e=>`将所有 orx 数据移动到: +The store is copied to the new location and activated there. Active runs or chats will block the move.`,N_n=e=>`将所有 orx 数据移动到: ${e==null?void 0:e.path} -存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,g_n=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ +存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,z_n=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ ${e==null?void 0:e.path} -مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,v_n=e=>`نقل كل بيانات orx إلى: +مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,j_n=e=>`نقل كل بيانات orx إلى: ${e==null?void 0:e.path} -يُنسَخ المخزن إلى الموقع الجديد ويُفعَّل هناك. ستمنع عمليات التشغيل أو المحادثات النشطة النقل.`,b_n=e=>`¿Mover todos los datos de orx a esta ubicación? +يُنسَخ المخزن إلى الموقع الجديد ويُفعَّل هناك. ستمنع عمليات التشغيل أو المحادثات النشطة النقل.`,T_n=e=>`¿Mover todos los datos de orx a esta ubicación? ${e==null?void 0:e.path} -El almacén se copia a la nueva ubicación y se activa allí. Si hay ejecuciones o chats activos, no se podrá mover.`,y_n=e=>`सारा orx डेटा यहाँ ले जाएं: +El almacén se copia a la nueva ubicación y se activa allí. Si hay ejecuciones o chats activos, no se podrá mover.`,A_n=e=>`सारा orx डेटा यहाँ ले जाएं: ${e==null?void 0:e.path} -स्टोर की एक कॉपी नए स्थान पर बनाई जाएगी और वहीं सक्रिय की जाएगी। सक्रिय रन या चैट स्थानांतरण को रोक सकते हैं।`,x_n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?m_n(e):t==="fa"?g_n(e):t==="ar"?v_n(e):t==="es"?b_n(e):t==="hi"?y_n(e):p_n(e)}),w_n=()=>"Move data here",k_n=()=>"将数据移动到此处",S_n=()=>"انتقال داده به اینجا",C_n=()=>"نقل البيانات إلى هنا",E_n=()=>"Mover los datos aquí",N_n=()=>"डेटा यहाँ ले जाएं",z_n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?k_n():t==="fa"?S_n():t==="ar"?C_n():t==="es"?E_n():t==="hi"?N_n():w_n()}),j_n=()=>"Moving…",T_n=()=>"正在移动…",A_n=()=>"در حال جابه‌جایی…",R_n=()=>"جارٍ النقل…",M_n=()=>"Moviendo…",O_n=()=>"स्थानांतरित हो रहा है…",D_n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?T_n():t==="fa"?A_n():t==="ar"?R_n():t==="es"?M_n():t==="hi"?O_n():j_n()}),L_n=()=>"Preparing…",I_n=()=>"正在准备…",$_n=()=>"در حال آماده‌سازی…",B_n=()=>"جارٍ التحضير…",P_n=()=>"Preparando…",F_n=()=>"तैयार हो रहा है…",H_n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?I_n():t==="fa"?$_n():t==="ar"?B_n():t==="es"?P_n():t==="hi"?F_n():L_n()}),q_n=()=>" (same disk, instant)",U_n=()=>"(同一磁盘,可立即完成)",G_n=()=>" (روی همان دیسک، فوری)",V_n=()=>" (القرص نفسه، فوري)",K_n=()=>" (mismo disco, instantáneo)",W_n=()=>" (उसी डिस्क पर, तुरंत)",Q_n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?U_n():t==="fa"?G_n():t==="ar"?V_n():t==="es"?K_n():t==="hi"?W_n():q_n()}),X_n=()=>"default location",Y_n=()=>"默认位置",Z_n=()=>"محل پیش‌فرض",J_n=()=>"الموقع الافتراضي",efn=()=>"ubicación predeterminada",tfn=()=>"डिफ़ॉल्ट स्थान",nfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y_n():t==="fa"?Z_n():t==="ar"?J_n():t==="es"?efn():t==="hi"?tfn():X_n()}),rfn=()=>"ORX_DATA_DIR environment variable",sfn=()=>"ORX_DATA_DIR 环境变量",ifn=()=>"متغیر محیطی ORX_DATA_DIR",afn=()=>"متغيّر البيئة ORX_DATA_DIR",ofn=()=>"variable de entorno ORX_DATA_DIR",cfn=()=>"ORX_DATA_DIR एनवायरनमेंट वेरिएबल",lfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sfn():t==="fa"?ifn():t==="ar"?afn():t==="es"?ofn():t==="hi"?cfn():rfn()}),ufn=()=>"your saved setting",_fn=()=>"已保存的设置",ffn=()=>"تنظیم ذخیره‌شدهٔ شما",dfn=()=>"إعدادك المحفوظ",hfn=()=>"tu ajuste guardado",pfn=()=>"आपकी सेव की गई सेटिंग",mfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_fn():t==="fa"?ffn():t==="ar"?dfn():t==="es"?hfn():t==="hi"?pfn():ufn()}),gfn=()=>"XDG_DATA_HOME",vfn=()=>"XDG_DATA_HOME",bfn=()=>"XDG_DATA_HOME",yfn=()=>"XDG_DATA_HOME",xfn=()=>"XDG_DATA_HOME",wfn=()=>"XDG_DATA_HOME",kfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vfn():t==="fa"?bfn():t==="ar"?yfn():t==="es"?xfn():t==="hi"?wfn():gfn()}),Sfn=()=>"Verifying…",Cfn=()=>"正在验证…",Efn=()=>"در حال بررسی…",Nfn=()=>"جارٍ التحقق…",zfn=()=>"Verificando…",jfn=()=>"सत्यापित हो रहा है…",Tfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cfn():t==="fa"?Efn():t==="ar"?Nfn():t==="es"?zfn():t==="hi"?jfn():Sfn()}),Afn=()=>"Loading…",Rfn=()=>"正在加载…",Mfn=()=>"در حال بارگیری…",Ofn=()=>"جارٍ التحميل…",Dfn=()=>"Cargando…",Lfn=()=>"लोड हो रहा है…",Ifn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rfn():t==="fa"?Mfn():t==="ar"?Ofn():t==="es"?Dfn():t==="hi"?Lfn():Afn()}),$fn=()=>"This sub-agent is no longer available.",Bfn=()=>"此子智能体已不可用。",Pfn=()=>"این عامل فرعی دیگر در دسترس نیست.",Ffn=()=>"لم يعد هذا الوكيل الفرعي متاحًا.",Hfn=()=>"Este subagente ya no está disponible.",qfn=()=>"यह सब-एजेंट अब उपलब्ध नहीं है।",Ufn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bfn():t==="fa"?Pfn():t==="ar"?Ffn():t==="es"?Hfn():t==="hi"?qfn():$fn()}),Gfn=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,Vfn=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,Kfn=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,Wfn=e=>`${e==null?void 0:e.label} (معاينة؛ انقر نقرًا مزدوجًا أو Command/Control K ثم Enter لإبقائه مفتوحًا)`,Qfn=e=>`${e==null?void 0:e.label} (vista previa; doble clic o Comando/Control K y luego Intro para mantenerla abierta)`,Xfn=e=>`${e==null?void 0:e.label} (प्रीव्यू; खुला रखने के लिए डबल-क्लिक करें या Command/Control K, फिर Enter दबाएं)`,Yfn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Vfn(e):t==="fa"?Kfn(e):t==="ar"?Wfn(e):t==="es"?Qfn(e):t==="hi"?Xfn(e):Gfn(e)}),Zfn=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,Jfn=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,edn=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,tdn=e=>`${e==null?void 0:e.label} (انقر نقرًا مزدوجًا أو ⌘/Ctrl+K ثم Enter لإبقائه مفتوحًا)`,ndn=e=>`${e==null?void 0:e.label} (doble clic o ⌘/Ctrl+K Intro para mantenerla abierta)`,rdn=e=>`${e==null?void 0:e.label} (खुला रखने के लिए डबल-क्लिक करें या ⌘/Ctrl+K फिर Enter दबाएं)`,sdn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Jfn(e):t==="fa"?edn(e):t==="ar"?tdn(e):t==="es"?ndn(e):t==="hi"?rdn(e):Zfn(e)}),idn=()=>"Alternatively, tell your agent to add a LaTeX template for you.",adn=()=>"或者,请你的智能体为你添加 LaTeX 模板。",odn=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",cdn=()=>"أو بدلًا من ذلك، اطلب من وكيلك إضافة قالب LaTeX لك.",ldn=()=>"También puedes pedirle a tu agente que añada una plantilla de LaTeX por ti.",udn=()=>"या अपने एजेंट से आपके लिए एक LaTeX टेम्पलेट जोड़ने को कहें।",_dn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?adn():t==="fa"?odn():t==="ar"?cdn():t==="es"?ldn():t==="hi"?udn():idn()}),fdn=()=>", a repo for training a mini-GPT from scratch.",ddn=()=>",一个从零训练迷你 GPT 的仓库。",hdn=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",pdn=()=>" لأندريه كارباثي، المخصّص لتدريب نموذج mini-GPT من الصفر.",mdn=()=>" de Andrej Karpathy, un repositorio para entrenar un mini-GPT desde cero.",gdn=()=>", स्क्रैच से एक मिनी-GPT ट्रेन करने के लिए एक रिपॉज़िटरी।",vdn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ddn():t==="fa"?hdn():t==="ar"?pdn():t==="es"?mdn():t==="hi"?gdn():fdn()}),bdn=()=>"Close",ydn=()=>"关闭",xdn=()=>"بستن",wdn=()=>"إغلاق",kdn=()=>"Cerrar",Sdn=()=>"बंद करें",v3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ydn():t==="fa"?xdn():t==="ar"?wdn():t==="es"?kdn():t==="hi"?Sdn():bdn()}),Cdn=()=>"Create a new project",Edn=()=>"新建项目",Ndn=()=>"ایجاد پروژهٔ جدید",zdn=()=>"إنشاء مشروع جديد",jdn=()=>"Crear un proyecto nuevo",Tdn=()=>"नया प्रोजेक्ट बनाएं",Adn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Edn():t==="fa"?Ndn():t==="ar"?zdn():t==="es"?jdn():t==="hi"?Tdn():Cdn()}),Rdn=()=>"Demo project",Mdn=()=>"演示项目",Odn=()=>"پروژهٔ نمایشی",Ddn=()=>"مشروع توضيحي",Ldn=()=>"Proyecto de demostración",Idn=()=>"डेमो प्रोजेक्ट",$dn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mdn():t==="fa"?Odn():t==="ar"?Ddn():t==="es"?Ldn():t==="hi"?Idn():Rdn()}),Bdn=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",Pdn=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",Fdn=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",Hdn=()=>"تصفّح محادثات الوكيل والتجارب وعمليات التشغيل والمُخرَجات لترى كيف يتشكّل مشروع على OpenResearch.",qdn=()=>"Explora las conversaciones con el agente, los experimentos, las ejecuciones y los artefactos para ver cómo se construye un proyecto en OpenResearch.",Udn=()=>"यह देखने के लिए एजेंट बातचीत, प्रयोग, रन और आर्टिफ़ैक्ट देखें कि OpenResearch पर एक प्रोजेक्ट कैसे आकार लेता है।",Gdn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pdn():t==="fa"?Fdn():t==="ar"?Hdn():t==="es"?qdn():t==="hi"?Udn():Bdn()}),Vdn=()=>"nanochat",Kdn=()=>"nanochat",Wdn=()=>"nanochat",Qdn=()=>"nanochat",Xdn=()=>"nanochat",Ydn=()=>"nanochat",Zdn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kdn():t==="fa"?Wdn():t==="ar"?Qdn():t==="es"?Xdn():t==="hi"?Ydn():Vdn()}),Jdn=()=>"Try the demo experiment",ehn=()=>"试试演示实验",thn=()=>"آزمایش نمایشی را امتحان کنید",nhn=()=>"جرّب التجربة التوضيحية",rhn=()=>"Probar el experimento de demostración",shn=()=>"डेमो प्रयोग आज़माएं",ihn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ehn():t==="fa"?thn():t==="ar"?nhn():t==="es"?rhn():t==="hi"?shn():Jdn()}),ahn=()=>"Couldn’t save your progress. Try again.",ohn=()=>"无法保存进度。请重试。",chn=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",lhn=()=>"تعذّر حفظ تقدّمك. حاول مجددًا.",uhn=()=>"No se pudo guardar tu progreso. Inténtalo de nuevo.",_hn=()=>"आपकी प्रगति सेव नहीं हो सकी। फिर से कोशिश करें।",fhn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ohn():t==="fa"?chn():t==="ar"?lhn():t==="es"?uhn():t==="hi"?_hn():ahn()}),dhn=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",hhn=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",phn=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",mhn=()=>"هذا مشروع توضيحي يبيّن كيف يعمل OpenResearch. يستخدم هذا العرض مستودع",ghn=()=>"Este es un proyecto de demostración que muestra cómo funciona OpenResearch. Esta demo usa",vhn=()=>"यह एक डेमो प्रोजेक्ट है जो दिखाता है कि OpenResearch कैसे काम करता है। यह डेमो Andrej Karpathy के",bhn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hhn():t==="fa"?phn():t==="ar"?mhn():t==="es"?ghn():t==="hi"?vhn():dhn()}),yhn=()=>"Welcome to OpenResearch",xhn=()=>"欢迎使用 OpenResearch",whn=()=>"به OpenResearch خوش آمدید",khn=()=>"مرحبًا بك في OpenResearch",Shn=()=>"Te damos la bienvenida a OpenResearch",Chn=()=>"OpenResearch में आपका स्वागत है",Ehn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xhn():t==="fa"?whn():t==="ar"?khn():t==="es"?Shn():t==="hi"?Chn():yhn()}),Nhn=()=>"Baseline",zhn=()=>"基线",jhn=()=>"مبنا",Thn=()=>"الأساس",Ahn=()=>"Base",Rhn=()=>"बेसलाइन",Mhn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zhn():t==="fa"?jhn():t==="ar"?Thn():t==="es"?Ahn():t==="hi"?Rhn():Nhn()}),Ohn=()=>"Experiment",Dhn=()=>"实验",Lhn=()=>"آزمایش",Ihn=()=>"تجربة",$hn=()=>"Experimento",Bhn=()=>"प्रयोग",Vc=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dhn():t==="fa"?Lhn():t==="ar"?Ihn():t==="es"?$hn():t==="hi"?Bhn():Ohn()}),Phn=e=>`${e==null?void 0:e.count} experiments`,Fhn=e=>`${e==null?void 0:e.count} 个实验`,Hhn=e=>`${e==null?void 0:e.count} آزمایش`,qhn=e=>`التجارب: ${e==null?void 0:e.count}`,Uhn=e=>`${e==null?void 0:e.count} experimentos`,Ghn=e=>`${e==null?void 0:e.count} प्रयोग`,Vhn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Fhn(e):t==="fa"?Hhn(e):t==="ar"?qhn(e):t==="es"?Uhn(e):t==="hi"?Ghn(e):Phn(e)}),Khn=()=>"1 experiment",Whn=()=>"1 个实验",Qhn=()=>"۱ آزمایش",Xhn=()=>"تجربة واحدة",Yhn=()=>"1 experimento",Zhn=()=>"1 प्रयोग",Jhn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Whn():t==="fa"?Qhn():t==="ar"?Xhn():t==="es"?Yhn():t==="hi"?Zhn():Khn()}),epn=()=>"Running",tpn=()=>"运行中",npn=()=>"در حال اجرا",rpn=()=>"قيد التشغيل",spn=()=>"En ejecución",ipn=()=>"चल रहा है",apn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tpn():t==="fa"?npn():t==="ar"?rpn():t==="es"?spn():t==="hi"?ipn():epn()}),opn=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",cpn=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",lpn=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",upn=()=>"اطلب في هذه المهمة إنشاء واحدة، أو بدّل إلى «المشروع بالكامل» لرؤية جميع التجارب.",_pn=()=>"Pide en esta tarea que se cree uno, o cambia a Todo el proyecto para ver todos los experimentos.",fpn=()=>"इस टास्क में एक बनाने को कहें, या सभी प्रयोग देखने के लिए पूरा प्रोजेक्ट पर स्विच करें।",dpn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cpn():t==="fa"?lpn():t==="ar"?upn():t==="es"?_pn():t==="hi"?fpn():opn()}),hpn=()=>"Ask the agent in chat to create and run your first experiment.",ppn=()=>"在聊天中让智能体创建并运行你的第一个实验。",mpn=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",gpn=()=>"اطلب من الوكيل في المحادثة إنشاء أول تجربة لك وتشغيلها.",vpn=()=>"Pídele al agente en el chat que cree y ejecute tu primer experimento.",bpn=()=>"एजेंट से चैट में अपना पहला प्रयोग बनाने और चलाने को कहें।",ypn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ppn():t==="fa"?mpn():t==="ar"?gpn():t==="es"?vpn():t==="hi"?bpn():hpn()}),xpn=()=>"Code",wpn=()=>"代码",kpn=()=>"کد",Spn=()=>"الشيفرة",Cpn=()=>"Código",Epn=()=>"कोड",Npn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wpn():t==="fa"?kpn():t==="ar"?Spn():t==="es"?Cpn():t==="hi"?Epn():xpn()}),zpn=()=>"Logs",jpn=()=>"日志",Tpn=()=>"گزارش‌ها",Apn=()=>"السجلات",Rpn=()=>"Logs",Mpn=()=>"लॉग",DL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jpn():t==="fa"?Tpn():t==="ar"?Apn():t==="es"?Rpn():t==="hi"?Mpn():zpn()}),Opn=()=>"No experiments from the current task yet",Dpn=()=>"当前任务尚无实验",Lpn=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",Ipn=()=>"لا توجد تجارب من المهمة الحالية بعد",$pn=()=>"Aún no hay experimentos de la tarea actual",Bpn=()=>"मौजूदा टास्क से अभी तक कोई प्रयोग नहीं",Ppn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dpn():t==="fa"?Lpn():t==="ar"?Ipn():t==="es"?$pn():t==="hi"?Bpn():Opn()}),Fpn=()=>"No experiments yet",Hpn=()=>"尚无实验",qpn=()=>"هنوز آزمایشی وجود ندارد",Upn=()=>"لا توجد تجارب بعد",Gpn=()=>"Aún no hay experimentos",Vpn=()=>"अभी तक कोई प्रयोग नहीं",Kpn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hpn():t==="fa"?qpn():t==="ar"?Upn():t==="es"?Gpn():t==="hi"?Vpn():Fpn()}),Wpn=()=>"no runs",Qpn=()=>"无运行",Xpn=()=>"بدون اجرا",Ypn=()=>"لا عمليات تشغيل",Zpn=()=>"sin ejecuciones",Jpn=()=>"कोई रन नहीं",e0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qpn():t==="fa"?Xpn():t==="ar"?Ypn():t==="es"?Zpn():t==="hi"?Jpn():Wpn()}),t0n=()=>"Open logs",n0n=()=>"打开日志",r0n=()=>"باز کردن گزارش‌ها",s0n=()=>"فتح السجلات",i0n=()=>"Abrir logs",a0n=()=>"लॉग खोलें",o0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n0n():t==="fa"?r0n():t==="ar"?s0n():t==="es"?i0n():t==="hi"?a0n():t0n()}),c0n=()=>"other tasks",l0n=()=>"其他任务",u0n=()=>"وظایف دیگر",_0n=()=>"مهام أخرى",f0n=()=>"otras tareas",d0n=()=>"अन्य टास्क",h0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?l0n():t==="fa"?u0n():t==="ar"?_0n():t==="es"?f0n():t==="hi"?d0n():c0n()}),p0n=()=>"Runs",m0n=()=>"运行",g0n=()=>"اجراها",v0n=()=>"عمليات التشغيل",b0n=()=>"Ejecuciones",y0n=()=>"रन",x0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?m0n():t==="fa"?g0n():t==="ar"?v0n():t==="es"?b0n():t==="hi"?y0n():p0n()}),w0n=()=>"Switch to Entire project to see all experiments",k0n=()=>"切换到“整个项目”以查看所有实验",S0n=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",C0n=()=>"بدّل إلى «المشروع بالكامل» لرؤية جميع التجارب",E0n=()=>"Cambia a Todo el proyecto para ver todos los experimentos",N0n=()=>"सभी प्रयोग देखने के लिए पूरा प्रोजेक्ट पर स्विच करें",z0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?k0n():t==="fa"?S0n():t==="ar"?C0n():t==="es"?E0n():t==="hi"?N0n():w0n()}),j0n=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,T0n=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,A0n=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,R0n=e=>`تم التحديث إلى ${e==null?void 0:e.version}. أعد التشغيل لاستخدامه.`,M0n=e=>`Actualizado a la versión ${e==null?void 0:e.version}. Reinicia para usarla.`,O0n=e=>`${e==null?void 0:e.version} पर अपडेट हुआ। इस्तेमाल के लिए फिर से शुरू करें।`,D0n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?T0n(e):t==="fa"?A0n(e):t==="ar"?R0n(e):t==="es"?M0n(e):t==="hi"?O0n(e):j0n(e)}),L0n=()=>"Dismiss",I0n=()=>"关闭",$0n=()=>"بستن",B0n=()=>"تجاهل",P0n=()=>"Descartar",F0n=()=>"खारिज करें",H0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?I0n():t==="fa"?$0n():t==="ar"?B0n():t==="es"?P0n():t==="hi"?F0n():L0n()}),q0n=()=>"Restart now",U0n=()=>"立即重新启动",G0n=()=>"هم‌اکنون دوباره راه‌اندازی کن",V0n=()=>"أعد التشغيل الآن",K0n=()=>"Reiniciar ahora",W0n=()=>"अभी फिर से शुरू करें",LL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?U0n():t==="fa"?G0n():t==="ar"?V0n():t==="es"?K0n():t==="hi"?W0n():q0n()}),Q0n=e=>`Could not restart: ${e==null?void 0:e.error}`,X0n=e=>`无法重新启动:${e==null?void 0:e.error}`,Y0n=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,Z0n=e=>`تعذّرت إعادة التشغيل: ${e==null?void 0:e.error}`,J0n=e=>`No se pudo reiniciar: ${e==null?void 0:e.error}`,emn=e=>`फिर से शुरू नहीं हो सका: ${e==null?void 0:e.error}`,IL=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?X0n(e):t==="fa"?Y0n(e):t==="ar"?Z0n(e):t==="es"?J0n(e):t==="hi"?emn(e):Q0n(e)}),tmn=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",nmn=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",rmn=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",smn=()=>"لم يعد OpenResearch المحدَّث في الوقت المناسب. أعد تشغيله يدويًا.",imn=()=>"La nueva versión de OpenResearch no se inició a tiempo. Reinícialo manualmente.",amn=()=>"अपडेट किया गया OpenResearch समय पर वापस नहीं आया। इसे खुद फिर से शुरू करें।",omn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nmn():t==="fa"?rmn():t==="ar"?smn():t==="es"?imn():t==="hi"?amn():tmn()}),cmn=()=>"Restarting…",lmn=()=>"正在重新启动…",umn=()=>"در حال راه‌اندازی مجدد…",_mn=()=>"جارٍ إعادة التشغيل…",fmn=()=>"Reiniciando…",dmn=()=>"फिर से शुरू हो रहा है…",$L=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lmn():t==="fa"?umn():t==="ar"?_mn():t==="es"?fmn():t==="hi"?dmn():cmn()}),hmn=()=>"macOS app",pmn=()=>"macOS 应用",mmn=()=>"برنامهٔ macOS",gmn=()=>"تطبيق macOS",vmn=()=>"App de macOS",bmn=()=>"macOS ऐप",ymn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pmn():t==="fa"?mmn():t==="ar"?gmn():t==="es"?vmn():t==="hi"?bmn():hmn()}),xmn=()=>"Installed with cargo",wmn=()=>"通过 cargo 安装",kmn=()=>"نصب‌شده با cargo",Smn=()=>"مثبّت عبر cargo",Cmn=()=>"Instalado con cargo",Emn=()=>"cargo से इंस्टॉल किया गया",Nmn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wmn():t==="fa"?kmn():t==="ar"?Smn():t==="es"?Cmn():t==="hi"?Emn():xmn()}),zmn=()=>"Installed with Homebrew",jmn=()=>"通过 Homebrew 安装",Tmn=()=>"نصب‌شده با Homebrew",Amn=()=>"مثبّت عبر Homebrew",Rmn=()=>"Instalado con Homebrew",Mmn=()=>"Homebrew से इंस्टॉल किया गया",Omn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jmn():t==="fa"?Tmn():t==="ar"?Amn():t==="es"?Rmn():t==="hi"?Mmn():zmn()}),Dmn=()=>"Installed with the orx installer",Lmn=()=>"通过 orx 安装程序安装",Imn=()=>"نصب‌شده با نصب‌کنندهٔ orx",$mn=()=>"مثبّت عبر مُثبّت orx",Bmn=()=>"Instalado con el instalador de orx",Pmn=()=>"orx इंस्टॉलर से इंस्टॉल किया गया",Fmn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lmn():t==="fa"?Imn():t==="ar"?$mn():t==="es"?Bmn():t==="hi"?Pmn():Dmn()}),Hmn=()=>"Managed by Nix",qmn=()=>"由 Nix 管理",Umn=()=>"مدیریت‌شده با Nix",Gmn=()=>"مُدار بواسطة Nix",Vmn=()=>"Gestionado por Nix",Kmn=()=>"Nix द्वारा प्रबंधित",Wmn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qmn():t==="fa"?Umn():t==="ar"?Gmn():t==="es"?Vmn():t==="hi"?Kmn():Hmn()}),Qmn=()=>"Portable orx.exe",Xmn=()=>"便携版 orx.exe",Ymn=()=>"orx.exe قابل‌حمل",Zmn=()=>"‏orx.exe المحمول",Jmn=()=>"orx.exe portable",egn=()=>"पोर्टेबल orx.exe",tgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xmn():t==="fa"?Ymn():t==="ar"?Zmn():t==="es"?Jmn():t==="hi"?egn():Qmn()}),ngn=()=>"Unknown install",rgn=()=>"未知安装方式",sgn=()=>"روش نصب نامشخص",ign=()=>"تثبيت غير معروف",agn=()=>"Instalación desconocida",ogn=()=>"अज्ञात इंस्टॉल",cgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rgn():t==="fa"?sgn():t==="ar"?ign():t==="es"?agn():t==="hi"?ogn():ngn()}),lgn=()=>"Re-run your cargo install to update.",ugn=()=>"重新运行 cargo 安装命令以更新。",_gn=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",fgn=()=>"أعِد تنفيذ أمر cargo install للتحديث.",dgn=()=>"Vuelve a ejecutar cargo install para actualizar.",hgn=()=>"अपडेट करने के लिए अपना cargo install फिर से चलाएं।",pgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ugn():t==="fa"?_gn():t==="ar"?fgn():t==="es"?dgn():t==="hi"?hgn():lgn()}),mgn=()=>"Run brew upgrade to update.",ggn=()=>"运行 brew upgrade 以更新。",vgn=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",bgn=()=>"نفّذ brew upgrade للتحديث.",ygn=()=>"Ejecuta brew upgrade para actualizar.",xgn=()=>"अपडेट करने के लिए brew upgrade चलाएं।",wgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ggn():t==="fa"?vgn():t==="ar"?bgn():t==="es"?ygn():t==="hi"?xgn():mgn()}),kgn=()=>"Update it through your Nix configuration.",Sgn=()=>"通过 Nix 配置进行更新。",Cgn=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Egn=()=>"حدّثه عبر إعداد Nix الخاص بك.",Ngn=()=>"Actualízalo desde tu configuración de Nix.",zgn=()=>"इसे अपने Nix कॉन्फ़िगरेशन के ज़रिए अपडेट करें।",jgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sgn():t==="fa"?Cgn():t==="ar"?Egn():t==="es"?Ngn():t==="hi"?zgn():kgn()}),Tgn=()=>"Active Experiments",Agn=()=>"活跃实验",Rgn=()=>"آزمایش‌های فعال",Mgn=()=>"التجارب النشطة",Ogn=()=>"Experimentos activos",Dgn=()=>"सक्रिय प्रयोग",Lgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Agn():t==="fa"?Rgn():t==="ar"?Mgn():t==="es"?Ogn():t==="hi"?Dgn():Tgn()}),Ign=()=>"Default compute",$gn=()=>"默认计算目标",Bgn=()=>"محاسبات پیش‌فرض",Pgn=()=>"الحوسبة الافتراضية",Fgn=()=>"Cómputo predeterminado",Hgn=()=>"डिफ़ॉल्ट कंप्यूट",qgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$gn():t==="fa"?Bgn():t==="ar"?Pgn():t==="es"?Fgn():t==="hi"?Hgn():Ign()}),Ugn=()=>"Terminal",Ggn=()=>"终端",Vgn=()=>"ترمینال",Kgn=()=>"الطرفية",Wgn=()=>"Terminal",Qgn=()=>"टर्मिनल",Tv=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ggn():t==="fa"?Vgn():t==="ar"?Kgn():t==="es"?Wgn():t==="hi"?Qgn():Ugn()}),Xgn=()=>"The terminal disconnected.",Ygn=()=>"终端连接已断开。",Zgn=()=>"ارتباط ترمینال قطع شد.",Jgn=()=>"انقطعت الطرفية.",e1n=()=>"La terminal se desconectó.",t1n=()=>"टर्मिनल डिस्कनेक्ट हो गया।",Bz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ygn():t==="fa"?Zgn():t==="ar"?Jgn():t==="es"?e1n():t==="hi"?t1n():Xgn()}),n1n=e=>`Shell exited with code ${e==null?void 0:e.code}.`,r1n=e=>`Shell 已退出,退出码 ${e==null?void 0:e.code}。`,s1n=e=>`پوسته با کد ${e==null?void 0:e.code} خارج شد.`,i1n=e=>`انتهى Shell برمز الخروج ${e==null?void 0:e.code}.`,a1n=e=>`El shell terminó con el código ${e==null?void 0:e.code}.`,o1n=e=>`शेल कोड ${e==null?void 0:e.code} के साथ बंद हो गया।`,c1n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?r1n(e):t==="fa"?s1n(e):t==="ar"?i1n(e):t==="es"?a1n(e):t==="hi"?o1n(e):n1n(e)}),l1n=()=>"Restart shell",u1n=()=>"重新启动 Shell",_1n=()=>"راه‌اندازی دوباره پوسته",f1n=()=>"إعادة تشغيل Shell",d1n=()=>"Reiniciar shell",h1n=()=>"शेल फिर से शुरू करें",p1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u1n():t==="fa"?_1n():t==="ar"?f1n():t==="es"?d1n():t==="hi"?h1n():l1n()}),m1n=()=>"This worktree",g1n=()=>"当前工作树",v1n=()=>"این درخت کاری",b1n=()=>"شجرة العمل هذه",y1n=()=>"Este árbol de trabajo",x1n=()=>"यह वर्कट्री",w1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?g1n():t==="fa"?v1n():t==="ar"?b1n():t==="es"?y1n():t==="hi"?x1n():m1n()}),k1n=()=>"Workspace",S1n=()=>"工作区",C1n=()=>"فضای کاری",E1n=()=>"مساحة العمل",N1n=()=>"Espacio de trabajo",z1n=()=>"वर्कस्पेस",nw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?S1n():t==="fa"?C1n():t==="ar"?E1n():t==="es"?N1n():t==="hi"?z1n():k1n()}),j1n=e=>`Current worktree · ${e==null?void 0:e.branch}`,T1n=e=>`当前工作树 · ${e==null?void 0:e.branch}`,A1n=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,R1n=e=>`شجرة العمل الحالية · ${e==null?void 0:e.branch}`,M1n=e=>`Árbol de trabajo actual · ${e==null?void 0:e.branch}`,O1n=e=>`मौजूदा वर्कट्री · ${e==null?void 0:e.branch}`,D1n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?T1n(e):t==="fa"?A1n(e):t==="ar"?R1n(e):t==="es"?M1n(e):t==="hi"?O1n(e):j1n(e)}),L1n=e=>`Default branch · ${e==null?void 0:e.branch}`,I1n=e=>`默认分支 · ${e==null?void 0:e.branch}`,$1n=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,B1n=e=>`الفرع الافتراضي · ${e==null?void 0:e.branch}`,P1n=e=>`Rama predeterminada · ${e==null?void 0:e.branch}`,F1n=e=>`डिफ़ॉल्ट ब्रांच · ${e==null?void 0:e.branch}`,H1n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?I1n(e):t==="fa"?$1n(e):t==="ar"?B1n(e):t==="es"?P1n(e):t==="hi"?F1n(e):L1n(e)}),q1n=e=>`detached at ${e==null?void 0:e.branch}`,U1n=e=>`分离于 ${e==null?void 0:e.branch}`,G1n=e=>`جدا در ${e==null?void 0:e.branch}`,V1n=e=>`منفصل عند ${e==null?void 0:e.branch}`,K1n=e=>`desacoplado en ${e==null?void 0:e.branch}`,W1n=e=>`${e==null?void 0:e.branch} पर डिटैच्ड`,Q1n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?U1n(e):t==="fa"?G1n(e):t==="ar"?V1n(e):t==="es"?K1n(e):t==="hi"?W1n(e):q1n(e)}),X1n=()=>"Listing truncated.",Y1n=()=>"列表已截断。",Z1n=()=>"فهرست کوتاه شده است.",J1n=()=>"القائمة مقتطعة.",evn=()=>"Listado truncado.",tvn=()=>"सूची छोटी की गई।",nvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y1n():t==="fa"?Z1n():t==="ar"?J1n():t==="es"?evn():t==="hi"?tvn():X1n()}),rvn=()=>"Loading…",svn=()=>"正在加载…",ivn=()=>"در حال بارگیری…",avn=()=>"جارٍ التحميل…",ovn=()=>"Cargando…",cvn=()=>"लोड हो रहा है…",lvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?svn():t==="fa"?ivn():t==="ar"?avn():t==="es"?ovn():t==="hi"?cvn():rvn()}),uvn=()=>"No changes yet.",_vn=()=>"尚无更改。",fvn=()=>"هنوز تغییری وجود ندارد.",dvn=()=>"لا توجد تغييرات بعد.",hvn=()=>"Aún no hay cambios.",pvn=()=>"अभी तक कोई बदलाव नहीं।",mvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_vn():t==="fa"?fvn():t==="ar"?dvn():t==="es"?hvn():t==="hi"?pvn():uvn()}),gvn=()=>"No files.",vvn=()=>"没有文件。",bvn=()=>"فایلی وجود ندارد.",yvn=()=>"لا توجد ملفات.",xvn=()=>"No hay archivos.",wvn=()=>"कोई फ़ाइल नहीं।",kvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vvn():t==="fa"?bvn():t==="ar"?yvn():t==="es"?xvn():t==="hi"?wvn():gvn()}),Svn=()=>"Refresh failed:",Cvn=()=>"刷新失败:",Evn=()=>"تازه‌سازی ناموفق بود:",Nvn=()=>"فشل التحديث:",zvn=()=>"Error al actualizar:",jvn=()=>"रीफ़्रेश विफल:",Tvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cvn():t==="fa"?Evn():t==="ar"?Nvn():t==="es"?zvn():t==="hi"?jvn():Svn()}),Ne=e=>`⁦${e}⁩`,Wi=e=>`⁨${e}⁩`,Xt=e=>new Intl.NumberFormat(E()).format(e),Pp="demo_nanochat_v1",Uc=e=>e.startsWith("demo_"),Ld="chat_demo_nanochat_v1",Ab="chat_demo_nanochat_figures_v1",Rb="chat_demo_nanochat_literature_v1",Avn={[Ld]:"cpu_end_to_end",[Ab]:"figures",[Rb]:"literature"},rw="cpu-apple-silicon-pipeline-results.md",Rvn={[Ld]:"msg_demo_nanochat_assistant_v1",[Ab]:"msg_demo_nanochat_figures_assistant_v1",[Rb]:"msg_demo_nanochat_literature_assistant_v1"},Pz="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class b3 extends Error{constructor(t,r,s){super(t);Hs(this,"currentVersion");Hs(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function Zi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const BL=new WeakMap;async function hi(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new b3(s,a,i.exists)}}catch(i){if(i instanceof b3)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=BL.get(e);if(t&&!Dn(t))throw new DOMException("Workspace changed","AbortError");return n}const At=(e,n)=>fetch(e,{signal:n}).then(t=>hi(t));async function ca(e,n){const t=Ia(),r=await fetch(e,n);if(!Dn(t))throw new DOMException("Workspace changed","AbortError");return BL.set(r,t),r.ok&&hQ(e,t),r}const bt=(e,n,t=!1)=>ca(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>hi(r)),hf=(e,n)=>ca(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>hi(t)),PL=(e,n)=>ca(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>hi(t)),Mvn=e=>At("/api/projects",e).then(n=>n.projects),Ovn=e=>At("/api/projects/activity",e).then(n=>n.activity),Dvn=e=>At("/api/settings/ui-state",e),Lvn=(e,n)=>At(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),Ivn=(e,n,t=!1)=>bt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),$vn=(e,n=!1)=>bt("/api/settings/ui-state",{workspace:e},n),Bvn=e=>bt("/api/settings/ui-state",e),Pvn=(e,n)=>bt("/api/onboarding/complete",{...e,...n}),Fvn=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return At(`/api/project-path/status${t}`,n)},Hvn=()=>bt("/api/project-path/pick").then(e=>e.path),qvn=e=>bt("/api/projects",e),Uvn=(e,n)=>At(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),Gvn=e=>At("/api/github/account",e),Vvn=(e,n)=>At(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),Kvn=(e,n,t)=>At(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),Wvn=(e,n)=>At(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),Qvn=e=>bt("/api/projects/starter-prompts/prewarm",e),Xvn=(e,n,t,r,s)=>At(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),Yvn=e=>bt(`/api/projects/${e}/open`).then(n=>n.project),Zvn=e=>ca(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}fQ(e)}),Jvn=(e,n)=>At(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),ebn=(e,n)=>At(`/api/projects/${e}/runs`,n).then(t=>t.runs),FL=e=>bt(`/api/runs/${e}/cancel`).then(()=>{}),tbn=(e,n)=>At(`/api/runs/${e}/log?offset=${n}`),nbn=(e,n)=>At(`/api/runs/${e}/diff`,n),rbn=(e,n)=>At(`/api/experiments/${e}/diff`,n),Mu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),sbn=(e,n,t={},r)=>At(`/api/projects/${e}/file?${Mu(t,new URLSearchParams({path:n}))}`,r),y3=(e,n,t={})=>`/api/projects/${e}/file/raw?${Mu(t,new URLSearchParams({path:n}))}`,ibn=(e,n)=>At(`/api/files/abs?path=${encodeURIComponent(e)}`,n),HL=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,abn=(e,n,t,r)=>PL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),obn=(e,n,t,r={})=>hf(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),cbn=(e,n,t={})=>bt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),lbn=(e,n,t={})=>bt(`/api/projects/${e}/file/reveal`,{path:n,sessionId:t.sessionId}),ubn=e=>At("/api/latex/engine",e),_bn=(e,n,t={})=>bt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),fbn=e=>At("/api/overleaf/settings",e),qL=e=>bt("/api/overleaf/token",{token:e}),dbn=()=>ca("/api/overleaf/token",{method:"DELETE"}).then(e=>hi(e)),UL=(e,n={})=>bt("/api/overleaf/session",{session:e,host:n.host}),hbn=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>hi(e)),pbn=(e={})=>bt("/api/overleaf/session/import",{host:e.host}),mbn=(e,n,t={})=>bt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),gbn=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${Mu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>hi(r)),vbn=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf?${Mu(t,new URLSearchParams({path:n}))}`,r),bbn=(e,n,t)=>bt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),ybn=(e,n,t={})=>ca(`/api/projects/${e}/file/overleaf?${Mu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>hi(r)),xbn=(e,n,t={})=>bt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),wbn=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf/status?${Mu(t,new URLSearchParams({path:n}))}`,r),kbn=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${Mu(t,new URLSearchParams({path:n}))}`,Sbn=(e,n={},t)=>{const r=Mu(n).toString();return At(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Cbn=(e,n)=>At(`/api/chat/sessions/${e}/worktree`,n),Mb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,Ebn=e=>At("/api/settings/hf",e),Nbn=e=>bt("/api/settings/hf",{token:e}),zbn=e=>At("/api/settings/tinker",e),jbn=e=>bt("/api/settings/tinker",{key:e}),Tbn=e=>At("/api/update",e),Abn=()=>bt("/api/update/apply"),Rbn=()=>bt("/api/update/restart"),Mbn=e=>bt("/api/update/auto",{enabled:e}),Obn=(e=!1)=>bt("/api/update/install-cli",{force:e}),Dbn=e=>At("/api/settings/k8s",e),Lbn=e=>bt("/api/settings/k8s",e),Ibn=e=>At("/api/settings/modal",e),$bn=(e,n)=>bt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Bbn=e=>At("/api/settings/env",e).then(n=>n.vars),GL=(e,n)=>bt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Pbn=e=>ca(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>hi(n)).then(n=>n.vars),Fbn=e=>At("/api/settings/data-dir",e),Hbn=e=>bt("/api/settings/data-dir/validate",{path:e}),qbn=e=>bt("/api/settings/data-dir/move",{path:e}),Ubn=e=>At("/api/settings/ssh",e),Gbn=e=>bt("/api/settings/ssh",e),Vbn=e=>bt("/api/settings/ssh/default",{host:e}),Kbn=(e,n)=>bt("/api/settings/ssh/preflight",{host:e,container:n}),Wbn=e=>At("/api/settings/ssh/config",e),Qbn=(e,n)=>PL("/api/settings/ssh/config",{content:e,previousContent:n}),Xbn=(e,n)=>At(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),Ybn=e=>At("/_orx/runtime",e),Zbn=e=>At("/api/remote/sessions",e).then(n=>n.sessions),Jbn=(e,n)=>bt("/api/remote/sessions",{host:e,uiPreferences:n}),eyn=e=>bt("/_orx/install",e),tyn=()=>bt("/_orx/reconnect"),VL=()=>bt("/_orx/disconnect"),nyn=()=>bt("/_orx/start-host"),KL=()=>At("/_orx/stop-host"),WL=e=>bt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),ryn=e=>At("/api/settings/slurm",e),syn=e=>bt("/api/settings/slurm",e),iyn=e=>At("/api/settings/ray",e),ayn=e=>bt("/api/settings/ray",e),oyn=e=>bt("/api/settings/ray/preflight",{address:e??null}),cyn=(e,n)=>At(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),lyn=e=>bt("/api/settings/compute/default",e),uyn=e=>At("/api/settings/local",e),_yn=e=>At("/api/settings/openresearch",e),fyn=(e,n)=>At(`/api/projects/${e}/files`,n),dyn=(e,n)=>ca(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>hi(t)),hyn=(e,n,t)=>hf(`/api/projects/${e}/files`,{path:n,...t}),X_=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,QL=512e3,pyn=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},myn=(e,n,t)=>fetch(X_(e,n),{signal:t,headers:{Range:`bytes=0-${QL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>pyn(a,Number.isFinite(s)&&s>a.byteLength))}),gyn=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",vyn=(e,n,t)=>fetch(X_(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:gyn(s)?s:"download"}}),byn=e=>At("/api/settings/profile",e),yyn=e=>At("/api/settings/lit-sources",e),xyn=e=>bt("/api/settings/lit-sources",e),wyn=e=>At("/api/settings/projects",e),XL=(e,n)=>bt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubDefaultPromptSeen:n}}),kyn=(e,n)=>At(`/api/projects/${e}/git`,n),Syn=e=>bt(`/api/projects/${e}/git/init`),Cyn=e=>bt(`/api/projects/${e}/github`),Eyn=e=>bt(`/api/projects/${e}/github/disable`),Nyn=e=>At("/api/settings/telemetry",e),zyn=e=>bt("/api/settings/telemetry",{enabled:e}),ru=e=>{bt("/api/telemetry/event",e).catch(()=>{})},YL=e=>{bt("/api/telemetry/locale",{locale:e}).catch(()=>{})};function K1(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??w3(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?Wk():n,r=w3(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const Av="default";function Ob(e,n){var a,o,c;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===Av)?Av:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((c=r[0])==null?void 0:c.id)??null;return{choices:r,defaultId:i}}const x3="default";function ZL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:x3,label:yEt(),description:dEt()},...t]:[]}function Rv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=ZL(e,n);return s.length===0?x3:t!=null&&s.some(a=>a.id===t)?t:x3}function JL(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=Ob(e,n);return r.length===0?Av:t&&r.some(i=>i.id===t)?t:s}const jyn=e=>At("/api/harnesses/setup/commands",e),eI=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return At(`/api/harnesses${s}`,t).then(i=>i.harnesses)},Tyn=(e,n)=>At(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),Ayn=(e,n,t,r)=>At(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),Ryn=e=>At("/api/latex-templates",e).then(n=>n.templates),Myn=e=>bt("/api/latex-templates",e).then(n=>n.template),Oyn=e=>ca(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>hi(n)),Dyn=e=>At("/api/user-skills",e),Lyn=e=>bt("/api/user-skills",e).then(n=>n.skill),Iyn=e=>ca(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>hi(n));function w3(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const $yn=(e,n)=>At(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),Byn=e=>At("/api/chat/native-sessions",e).then(n=>n.chats),Pyn=(e,n)=>bt("/api/chat/native-sessions/import",{projectId:e,harness:n.harness,nativeId:n.nativeId,title:n.title}).then(t=>t.session),Fyn=e=>At("/api/chat/sessions?scope=all",e).then(n=>n.sessions),Hyn=(e,n,t={})=>bt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),qyn=e=>ca(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>hi(n).then(t=>(jb(e),t))),Uyn=(e,n)=>hf(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),Gyn=(e,n)=>hf(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),Vyn=(e,n)=>hf(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),Kyn=(e,n)=>hf(`/api/chat/sessions/${e}`,{goal:n}).then(t=>t.session),Wyn=(e,n)=>hf(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),Qyn=(e,n)=>At(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),Xyn=(e,n)=>ca(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>hi(t)),Yyn=(e,n)=>bt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),Zyn=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,Fz=(e,n,t={},r,s,i,a)=>bt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),Jyn=e=>bt(`/api/chat/sessions/${e}/compact`,{}),exn=(e,n)=>bt(`/api/chat/sessions/${e}/shell`,{command:n}),txn=(e,n,t,r={})=>bt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),nxn=(e,n,t)=>bt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),rxn=(e,n)=>bt(`/api/chat/sessions/${e}/branch`,{leafId:n}),sxn=e=>bt(`/api/chat/sessions/${e}/interrupt`),ixn=(e,n)=>bt(`/api/chat/sessions/${e}/respond`,n);function co(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(E(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function A0(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return vOe({value:Xt(n)});const t=Math.floor(n/60);if(t<60)return _Oe({value:Xt(t)});const r=Math.floor(t/60);return r<24?sOe({hours:Xt(r),minutes:Xt(t%60)}):YMe({days:Xt(Math.floor(r/24)),hours:Xt(r%24)})}function el(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rAt("/api/local-models",e),cxn=e=>bt("/api/local-models/discover",e),lxn=e=>bt("/api/local-models",e),uxn=e=>bt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),_xn=e=>ca(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>hi(n)),Hz=()=>({queryKey:zt("getHfSettings"),queryFn:({signal:e})=>Ebn(e),staleTime:3e5}),qz=()=>({queryKey:zt("getTinkerSettings"),queryFn:({signal:e})=>zbn(e),staleTime:3e5}),Uz=()=>({queryKey:zt("getK8sSettings"),queryFn:({signal:e})=>Dbn(e),staleTime:3e4}),Gz=()=>({queryKey:zt("getModalSettings"),queryFn:({signal:e})=>Ibn(e),staleTime:3e5}),fxn=()=>({queryKey:zt("getSlurmSettings"),queryFn:({signal:e})=>ryn(e),staleTime:3e5}),dxn=()=>({queryKey:zt("getRaySettings"),queryFn:({signal:e})=>iyn(e),staleTime:3e5}),tI=e=>({queryKey:zt("getComputeSettings",e??null),queryFn:({signal:n})=>cyn(e,n),staleTime:3e4}),hxn=()=>({queryKey:zt("getLocalMachine"),queryFn:({signal:e})=>uyn(e),staleTime:3e5}),pxn=()=>({queryKey:zt("getOpenResearchSettings"),queryFn:({signal:e})=>_yn(e),staleTime:3e4}),mxn=()=>({queryKey:zt("getEnvVars"),queryFn:({signal:e})=>Bbn(e),staleTime:3e5}),gxn=()=>({queryKey:zt("getDataDir"),queryFn:({signal:e})=>Fbn(e),staleTime:3e5}),nI=()=>({queryKey:zt("getSshSettings"),queryFn:({signal:e})=>Ubn(e),staleTime:3e4}),vxn=()=>({queryKey:zt("getSshConfig"),queryFn:({signal:e})=>Wbn(e),staleTime:3e5}),Vz=e=>({queryKey:zt("getSshMasterStatus",e),queryFn:({signal:n})=>Xbn(e,n),staleTime:5e3}),bxn=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>Ybn(e),staleTime:2e3}),yxn=()=>({queryKey:zt("listRemoteSessions"),queryFn:({signal:e})=>Zbn(e),staleTime:3e4}),Mv=()=>({queryKey:zt("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>Oh(n,t,()=>Tbn(e)),staleTime:3e4}),xxn=()=>({queryKey:zt("getProfile"),queryFn:({signal:e})=>byn(e),staleTime:3e5}),wxn=()=>({queryKey:zt("getLitSources"),queryFn:({signal:e})=>yyn(e),staleTime:3e5}),aS=()=>({queryKey:zt("getProjectDefaults"),queryFn:({signal:e})=>wyn(e),staleTime:3e5}),kxn=e=>({queryKey:zt("getProjectGitStatus",e),queryFn:({signal:n})=>kyn(e,n),staleTime:3e4}),Sxn=()=>({queryKey:zt("getTelemetry"),queryFn:({signal:e})=>Nyn(e),staleTime:3e5}),rI=()=>({queryKey:zt("getHarnessSetupCommands"),queryFn:({signal:e})=>jyn(e),staleTime:1/0}),ku=()=>({queryKey:zt("getHarnesses"),queryFn:({signal:e})=>eI(!1,!1,e),staleTime:3e5,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.some(t=>t.accountLoading||t.catalogPending)?1e3:!1}}),Cxn=e=>({queryKey:zt("getSkills",e??null),queryFn:({signal:n})=>Tyn(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),Exn=(e,n,t)=>({queryKey:zt("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>Ayn(e,n,r,t),staleTime:3e5}),Nxn=()=>({queryKey:zt("listLatexTemplates"),queryFn:({signal:e})=>Ryn(e),refetchInterval:3e4,staleTime:3e5}),zxn=()=>({queryKey:zt("listUserSkills"),queryFn:({signal:e})=>Dyn(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function Y_(e=!1,n=!1){const t=ku();if(!e&&!n)return et.fetchQuery(t);await et.cancelQueries(t);const r=await eI(e,n);return Dn(t.queryKey)&&et.setQueryData(t.queryKey,r),r}const jxn=()=>({queryKey:zt("getLocalModels"),queryFn:({signal:e})=>oxn(e),staleTime:3e4}),La=e=>({queryKey:zt("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>Oh(t,r,async()=>{const s=await $yn(e,n),i=t.getQueryData(r);return s.filter(a=>!ll.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(c=>c.id===a.id))==null?void 0:o.contextUsage)}})},xm),staleTime:3e4}),sI=()=>({queryKey:zt("listNativeChats"),queryFn:({signal:e})=>Byn(e),staleTime:0}),Txn=()=>({queryKey:zt("listAllChatSessions"),queryFn:async({signal:e})=>(await Fyn(e)).filter(n=>!ll.has(n.id)),staleTime:0}),il=e=>({queryKey:zt("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var h;const s=t.getQueryData(r),i=await Oh(t,r,()=>Qyn(e,n),(_,p,m)=>{if(!p)return _;const x=new Set([...m].filter(k=>k.startsWith("message:")).map(k=>k.slice(8)));return{messages:xm(_.messages,p.messages,x,!1),queued:m.has("queued")?p.queued:_.queued,activeLeafId:m.has("branch")||x.size?p.activeLeafId:_.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),c=s!==void 0&&i.messages.some(_=>_.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===_.id)))?[]:(a==null?void 0:a.messages.filter(_=>_.id.startsWith("local-")))??[],u=c.some(_=>_.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...c.filter(_=>!i.messages.some(p=>p.id===_.id))],activeLeafId:a&&(u||!((h=a.activeLeafId)!=null&&h.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),P_="local-",iI="bash";function Kz(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(P_)),n]}function Axn(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(P_),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:Kz(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${P_}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:iI,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?Kz(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${P_}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let aI=0;function oI(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}et.getQueryCache().subscribe(e=>{oI(e)&&aI++});const Rxn=e=>et.getQueryCache().subscribe(n=>{oI(n)&&e()}),Mxn=()=>aI;function Oxn(e,n){const t=et.getQueryData(La(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=et.getQueryData(il(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function cI(e,n,t=!1){if(n.type==="busy"){Za(et,La(e).queryKey,n.sessionId),et.setQueryData(La(e).queryKey,c=>c==null?void 0:c.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=il(n.sessionId);if(ll.has(n.sessionId))return;Za(et,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=et.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=Axn(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};et.setQueryData(r.queryKey,o)}function Dxn(e,n){const t=!!n&&!ll.has(n??""),r=ct({...il(n??""),enabled:t,subscribed:t}),s=A.useSyncExternalStore(Rxn,Mxn),i=A.useMemo(()=>Oxn(e,n),[e,n,s]),a=Ia()[1],o=A.useCallback(c=>{Dn(["workspace",a])&&cI(e,c)},[e,a]);return[i,o,r]}const W1=new Map;function Lxn(e,n){let t=W1.get(e);return t||(t=new Set,W1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&W1.delete(e)}}function Ixn(e){var n;(n=W1.get(e.runId))==null||n.forEach(t=>t(e))}const k3=new Set;function Ov(e){return k3.add(e),()=>{k3.delete(e)}}function Ic(e){k3.forEach(n=>n(e))}const S3=new Set;function $xn(e){return S3.add(e),()=>{S3.delete(e)}}function $c(){S3.forEach(e=>e())}const C3=new Set;function Bxn(e){return C3.add(e),()=>{C3.delete(e)}}const E3=new Set;function Pxn(e){return E3.add(e),()=>{E3.delete(e)}}function Fxn(){E3.forEach(e=>e())}function Wz(e){C3.forEach(n=>n(e))}const N3=new Set;function lI(e){return N3.add(e),()=>{N3.delete(e)}}function sw(e){N3.forEach(n=>n(e))}const z3=new Set;function Hxn(e){return z3.add(e),()=>{z3.delete(e)}}function Qz(e){z3.forEach(n=>n(e))}const j3=new Set;function qxn(e){return j3.add(e),()=>{j3.delete(e)}}function Uxn(e){j3.forEach(n=>n(e))}let T3=!0;const A3=new Set;function Gxn(e){return A3.add(e),()=>{A3.delete(e)}}function Xz(){return T3}function Yz(e){e!==T3&&(T3=e,A3.forEach(n=>n()))}const Vxn=8e3,Kxn=3e3;function Wxn(e){const n=A.useRef(e);n.current=e,A.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const c=new EventSource("/api/events");t=c,c.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>Yz(!1),Vxn)),c.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},Kxn)))},c.onopen=()=>{var h,_;r||(window.clearTimeout(s),s=void 0,Yz(!0),a&&(Ic({type:"reconnected"}),$c(),Wz({harness:"*",authState:"unknown"}),(_=(h=n.current).onReconnect)==null||_.call(h)),a=!0)};const u=h=>{try{return JSON.parse(h.data)}catch{return null}};c.addEventListener("resync.required",()=>{var h,_;Ic({type:"reconnected"}),$c(),(_=(h=n.current).onReconnect)==null||_.call(h)}),c.addEventListener("run.updated",h=>{const _=u(h);_!=null&&_.run&&($c(),n.current.onRun(_.run))}),c.addEventListener("experiment.updated",h=>{var p,m;const _=u(h);_!=null&&_.experiment&&($c(),(m=(p=n.current).onExperiment)==null||m.call(p,_.experiment))}),c.addEventListener("project.updated",h=>{var p,m;const _=u(h);_!=null&&_.project&&($c(),(m=(p=n.current).onProject)==null||m.call(p,_.project))}),c.addEventListener("files.updated",h=>{var p,m;const _=u(h);_!=null&&_.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,_.projectId))}),c.addEventListener("run.log",h=>{const _=u(h);_!=null&&_.runId&&Ixn(_)}),c.addEventListener("chat.session",h=>{const _=u(h);_!=null&&_.session&&($c(),Ic({type:"session",session:_.session}))}),c.addEventListener("chat.session.deleted",h=>{const _=u(h);_!=null&&_.sessionId&&($c(),Ic({type:"sessionDeleted",sessionId:_.sessionId}))}),c.addEventListener("chat.message",h=>{const _=u(h);_!=null&&_.message&&($c(),Ic({type:"message",sessionId:_.sessionId,message:_.message}))}),c.addEventListener("chat.busy",h=>{const _=u(h);_!=null&&_.sessionId&&($c(),Ic({type:"busy",sessionId:_.sessionId,busy:_.busy}))}),c.addEventListener("chat.usage",h=>{const _=u(h);_!=null&&_.sessionId&&_.usage&&Ic({type:"usage",sessionId:_.sessionId,usage:_.usage})}),c.addEventListener("chat.queued",h=>{const _=u(h);_!=null&&_.sessionId&&Ic({type:"queued",sessionId:_.sessionId,items:_.items??[]})}),c.addEventListener("chat.branch",h=>{const _=u(h);_!=null&&_.sessionId&&Ic({type:"branch",sessionId:_.sessionId,activeLeafId:_.activeLeafId??null})}),c.addEventListener("harness.auth",h=>{const _=u(h);_!=null&&_.harness&&_.authState&&Wz(_)}),c.addEventListener("harness.catalog",()=>Fxn()),c.addEventListener("datadir.move.progress",h=>{const _=u(h);_&&sw({type:"progress",..._})}),c.addEventListener("datadir.move.done",h=>{const _=u(h);_&&sw({type:"done",path:_.path,oldPathLeft:_.oldPathLeft})}),c.addEventListener("datadir.move.error",h=>{const _=u(h);_&&sw({type:"error",error:_.error})}),c.addEventListener("update.status",h=>{const _=u(h);_&&Uxn(_)}),c.addEventListener("overleaf.live",h=>{const _=u(h);_!=null&&_.key&&_.status&&Qz({type:"live",key:_.key,status:_.status})}),c.addEventListener("overleaf.pulled",h=>{const _=u(h);_!=null&&_.key&&Array.isArray(_.paths)&&Qz({type:"pulled",key:_.key,paths:_.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const Dv=new Set;function Qxn(e){const n=A.useRef(e);n.current=e,A.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return Dv.add(t),()=>{Dv.delete(t)}},[])}const Zz={onRun:e=>Dv.forEach(n=>n.onRun(e)),onReconnect:()=>Dv.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},dh=()=>({queryKey:zt("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>Oh(n,t,()=>Mvn(e),xm),staleTime:3e4}),Xxn=()=>({queryKey:zt("listProjectActivity"),queryFn:({signal:e})=>Ovn(e),staleTime:3e4}),Cm=()=>({queryKey:zt("getUiState"),queryFn:({signal:e})=>Dvn(e),staleTime:3e5}),oS=e=>({queryKey:zt("getProjectUiState",e),queryFn:({signal:n})=>Lvn(e,n),staleTime:3e5}),d0=(e="")=>({queryKey:zt("getProjectPathStatus",e),queryFn:({signal:n})=>Fvn(e,n),staleTime:3e4}),uI=e=>({queryKey:zt("searchPapers",e),queryFn:({signal:n})=>Uvn(e,n),staleTime:3e5}),Yxn=()=>({queryKey:zt("githubAccount"),queryFn:({signal:e})=>Gvn(e),staleTime:3e5}),Zxn=e=>({queryKey:zt("githubProjectRepoPreview",e),queryFn:({signal:n})=>Vvn(e,n),staleTime:3e4}),Jz=(e,n)=>({queryKey:zt("repoAccess",e,n),queryFn:({signal:t})=>Kvn(e,n,t),staleTime:3e4}),R3=e=>({queryKey:zt("resolvePaper",e),queryFn:({signal:n})=>Wvn(e,n),staleTime:36e5}),Jxn=(e,n,t,r)=>({queryKey:zt("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>Xvn(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),M3=e=>({queryKey:zt("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>Oh(t,r,()=>Jvn(e,n),xm),staleTime:3e4}),mu=e=>({queryKey:zt("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>Oh(t,r,()=>ebn(e,n),xm),staleTime:3e4});function t1(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function ej(){const e=Ia();return Wxn({onRun(n){var r;if(!Dn(e))return;const t=(r=et.getQueryData(mu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);Za(et,mu(n.projectId).queryKey,n.id),et.setQueryData(mu(n.projectId).queryKey,s=>t1(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(Ta(["getRunDiff"],e,s=>s.queryKey[3]===n.id),Ta(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),Zz.onRun(n)},onExperiment(n){Dn(e)&&(Za(et,M3(n.projectId).queryKey,n.id),et.setQueryData(M3(n.projectId).queryKey,t=>t1(t,n)),Ta(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),Ta(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),Ta(["getRunDiff"],e,t=>{var r;return((r=et.getQueryData(mu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Dn(e)&&(Za(et,dh().queryKey,n.id),et.setQueryData(dh().queryKey,t=>t1(t,n)))},onArtifacts(n){Dn(e)&&(Ta(Pk,e,t=>t.queryKey[3]===n),Ta(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Dn(e)&&(Ta(uQ,e),Zz.onReconnect())}}),A.useEffect(()=>{let n;const t=$xn(()=>{n??(n=setTimeout(()=>{n=void 0,Ta(["listProjectActivity"],e)},100))}),r=lI(c=>{c.type==="done"&&Ta(["getDataDir"],e)}),s=Ov(c=>{Dn(e)&&(c.type==="session"?Za(et,La(c.session.projectId).queryKey,c.session.id):(c.type==="busy"||c.type==="usage")&&Za(et,[...e,"listChatSessions"],c.sessionId),(c.type==="message"||c.type==="queued"||c.type==="branch")&&cI("",c.type==="message"?{type:"upsertMessage",sessionId:c.sessionId,message:c.message}:c.type==="queued"?{type:"setQueued",sessionId:c.sessionId,items:c.items}:{type:"activeLeaf",sessionId:c.sessionId,leafId:c.activeLeafId},!0),c.type==="session"&&!ll.has(c.session.id)?et.setQueryData(La(c.session.projectId).queryKey,u=>{if(!u)return;const h=u.find(_=>_.id===c.session.id);return h?t1(u,{...c.session,contextUsage:c.session.contextUsage??h.contextUsage}):[c.session,...u]}):c.type==="sessionDeleted"?jb(c.sessionId):(c.type==="busy"||c.type==="usage")&&et.setQueriesData({queryKey:[...e,"listChatSessions"]},u=>u==null?void 0:u.map(h=>h.id!==c.sessionId?h:c.type==="busy"?{...h,busy:c.busy}:{...h,contextUsage:c.usage})))}),i=Bxn(()=>{Dn(e)&&Y_(!0).catch(()=>{})}),a=Pxn(()=>{Dn(e)&&et.fetchQuery({...ku(),staleTime:0}).catch(()=>{})}),o=qxn(c=>{Dn(e)&&(Za(et,Mv().queryKey),et.setQueryData(Mv().queryKey,c))});return()=>{clearTimeout(n),t(),r(),s(),i(),a(),o()}},[e[1]]),null}const O3=new Set;function _I(e){if(e!==E()){dD(e,{reload:!1}),document.documentElement.lang=e,YL(e);for(const n of O3)n()}}function e2n(e){return O3.add(e),()=>O3.delete(e)}function pf(){return A.useSyncExternalStore(e2n,E,E)}const fI="orx:theme";function t2n(){try{const e=localStorage.getItem(fI);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let hh=t2n();const D3=new Set;function n2n(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function cS(){document.documentElement.dataset.theme=n2n(hh)}function dI(e){hh=e;try{localStorage.setItem(fI,e)}catch{}cS();for(const n of D3)n()}function r2n(){return hh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{hh==="system"&&cS()});cS();function s2n(e){return D3.add(e),()=>D3.delete(e)}function hI(){return[A.useSyncExternalStore(s2n,()=>hh,()=>hh),dI]}const i2n=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),pI=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),Lv="-",tj=[],o2n="arbitrary..",c2n=e=>{const n=u2n(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return l2n(a);const o=a.split(Lv),c=o[0]===""&&o.length>1?1:0;return mI(o,c,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const c=r[a],u=t[a];return c?u?i2n(u,c):c:u||tj}return t[a]||tj}}},mI=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=mI(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(Lv):e.slice(n).join(Lv),c=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?o2n+r:void 0})(),u2n=e=>{const{theme:n,classGroups:t}=e;return _2n(t,n)},_2n=(e,n)=>{const t=pI();for(const r in e){const s=e[r];lS(s,t,r,n)}return t},lS=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){d2n(e,n,t);return}if(typeof e=="function"){h2n(e,n,t,r);return}p2n(e,n,t,r)},d2n=(e,n,t)=>{const r=e===""?n:gI(n,e);r.classGroupId=t},h2n=(e,n,t,r)=>{if(m2n(e)){lS(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(a2n(t,e))},p2n=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(Lv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,g2n=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},L3="!",nj=":",v2n=[],rj=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),b2n=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,c=0,u;const h=s.length;for(let k=0;kc?u-c:void 0;return rj(i,m,p,x)};if(n){const s=n+nj,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):rj(v2n,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},y2n=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},x2n=e=>({cache:g2n(e.cacheSize),parseClassName:b2n(e),sortModifiers:y2n(e),postfixLookupClassGroupIds:w2n(e),...c2n(e)}),w2n=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],c=e.trim().split(k2n);let u="";for(let h=c.length-1;h>=0;h-=1){const _=c[h],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:k,maybePostfixModifierPosition:v}=t(_);if(p){u=_+(u.length>0?" "+u:u);continue}let b=!!v,w;if(b){const T=k.substring(0,v);w=r(T);const j=w&&a[w]?r(k):void 0;j&&j!==w&&(w=j,b=!1)}else w=r(k);if(!w){if(!b){u=_+(u.length>0?" "+u:u);continue}if(w=r(k),!w){u=_+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=x?y+L3:y,N=C+w;if(o.indexOf(N)>-1)continue;o.push(N);const z=s(w,b);for(let T=0;T0?" "+u:u)}return u},C2n=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=c=>{const u=n.reduce((h,_)=>_(h),e());return t=x2n(u),r=t.cache.get,s=t.cache.set,i=o,o(c)},o=c=>{const u=r(c);if(u)return u;const h=S2n(c,t);return s(c,h),h};return i=a,(...c)=>i(C2n(...c))},E2n=[],ms=e=>{const n=t=>t[e]||E2n;return n.isThemeGetter=!0,n},bI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,N2n=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,z2n=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,j2n=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,T2n=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,A2n=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,R2n=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ql=e=>N2n.test(e),ln=e=>!!e&&!Number.isNaN(Number(e)),Mo=e=>!!e&&Number.isInteger(Number(e)),iw=e=>e.endsWith("%")&&ln(e.slice(0,-1)),Bc=e=>z2n.test(e),xI=()=>!0,M2n=e=>j2n.test(e)&&!T2n.test(e),uS=()=>!1,O2n=e=>A2n.test(e),D2n=e=>R2n.test(e),L2n=e=>!gt(e)&&!vt(e),I2n=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),$2n=e=>Ou(e,SI,uS),gt=e=>bI.test(e),u_=e=>Ou(e,CI,M2n),ij=e=>Ou(e,V2n,ln),B2n=e=>Ou(e,NI,xI),P2n=e=>Ou(e,EI,uS),aj=e=>Ou(e,wI,uS),F2n=e=>Ou(e,kI,D2n),n1=e=>Ou(e,zI,O2n),vt=e=>yI.test(e),Fp=e=>mf(e,CI),H2n=e=>mf(e,EI),oj=e=>mf(e,wI),q2n=e=>mf(e,SI),U2n=e=>mf(e,kI),r1=e=>mf(e,zI,!0),G2n=e=>mf(e,NI,!0),Ou=(e,n,t)=>{const r=bI.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},mf=(e,n,t=!1)=>{const r=yI.exec(e);return r?r[1]?n(r[1]):t:!1},wI=e=>e==="position"||e==="percentage",kI=e=>e==="image"||e==="url",SI=e=>e==="length"||e==="size"||e==="bg-size",CI=e=>e==="length",V2n=e=>e==="number",EI=e=>e==="family-name",NI=e=>e==="number"||e==="weight",zI=e=>e==="shadow",cj=()=>{const e=ms("color"),n=ms("font"),t=ms("text"),r=ms("font-weight"),s=ms("tracking"),i=ms("leading"),a=ms("breakpoint"),o=ms("container"),c=ms("spacing"),u=ms("radius"),h=ms("shadow"),_=ms("inset-shadow"),p=ms("text-shadow"),m=ms("drop-shadow"),x=ms("blur"),k=ms("perspective"),v=ms("aspect"),b=ms("ease"),w=ms("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...C(),vt,gt],z=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[vt,gt,c],M=()=>[Ql,"full","auto",...j()],D=()=>[Mo,"none","subgrid",vt,gt],I=()=>["auto",{span:["full",Mo,vt,gt]},Mo,vt,gt],$=()=>[Mo,"auto",vt,gt],q=()=>["auto","min","max","fr",vt,gt],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...j()],J=()=>[Ql,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],Z=()=>[Ql,"screen","full","dvw","lvw","svw","min","max","fit",...j()],B=()=>[Ql,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,vt,gt],F=()=>[...C(),oj,aj,{position:[vt,gt]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],K=()=>["auto","cover","contain",q2n,$2n,{size:[vt,gt]}],ne=()=>[iw,Fp,u_],ce=()=>["","none","full",u,vt,gt],_e=()=>["",ln,Fp,u_],se=()=>["solid","dashed","dotted","double"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[ln,iw,oj,aj],le=()=>["","none",x,vt,gt],pe=()=>["none",ln,vt,gt],be=()=>["none",ln,vt,gt],Me=()=>[ln,vt,gt],Le=()=>[Ql,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Bc],breakpoint:[Bc],color:[xI],container:[Bc],"drop-shadow":[Bc],ease:["in","out","in-out"],font:[L2n],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Bc],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Bc],shadow:[Bc],spacing:["px",ln],text:[Bc],"text-shadow":[Bc],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ql,gt,vt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",vt,gt]}],"container-named":[I2n],columns:[{columns:[ln,gt,vt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[Mo,"auto",vt,gt]}],basis:[{basis:[Ql,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ln,Ql,"auto","initial","none",gt]}],grow:[{grow:["",ln,vt,gt]}],shrink:[{shrink:["",ln,vt,gt]}],order:[{order:[Mo,"first","last","none",vt,gt]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...B()]}],"min-block-size":[{"min-block":["auto",...B()]}],"max-block-size":[{"max-block":["none",...B()]}],w:[{w:[o,"screen",...J()]}],"min-w":[{"min-w":[o,"screen","none",...J()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",t,Fp,u_]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,G2n,B2n]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",iw,gt]}],"font-family":[{font:[H2n,P2n,n]}],"font-features":[{"font-features":[gt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,vt,gt]}],"line-clamp":[{"line-clamp":[ln,"none",vt,ij]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",vt,gt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",vt,gt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[ln,"from-font","auto",vt,u_]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[ln,"auto",vt,gt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[Mo,vt,gt]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",vt,gt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",vt,gt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:K()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mo,vt,gt],radial:["",vt,gt],conic:[Mo,vt,gt]},U2n,F2n]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:_e()}],"border-w-x":[{"border-x":_e()}],"border-w-y":[{"border-y":_e()}],"border-w-s":[{"border-s":_e()}],"border-w-e":[{"border-e":_e()}],"border-w-bs":[{"border-bs":_e()}],"border-w-be":[{"border-be":_e()}],"border-w-t":[{"border-t":_e()}],"border-w-r":[{"border-r":_e()}],"border-w-b":[{"border-b":_e()}],"border-w-l":[{"border-l":_e()}],"divide-x":[{"divide-x":_e()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_e()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ln,vt,gt]}],"outline-w":[{outline:["",ln,Fp,u_]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",h,r1,n1]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",_,r1,n1]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:_e()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[ln,u_]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":_e()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,r1,n1]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[ln,vt,gt]}],"mix-blend":[{"mix-blend":[...G(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":G()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ln]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[vt,gt]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[ln]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:K()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",vt,gt]}],filter:[{filter:["","none",vt,gt]}],blur:[{blur:le()}],brightness:[{brightness:[ln,vt,gt]}],contrast:[{contrast:[ln,vt,gt]}],"drop-shadow":[{"drop-shadow":["","none",m,r1,n1]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",ln,vt,gt]}],"hue-rotate":[{"hue-rotate":[ln,vt,gt]}],invert:[{invert:["",ln,vt,gt]}],saturate:[{saturate:[ln,vt,gt]}],sepia:[{sepia:["",ln,vt,gt]}],"backdrop-filter":[{"backdrop-filter":["","none",vt,gt]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[ln,vt,gt]}],"backdrop-contrast":[{"backdrop-contrast":[ln,vt,gt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ln,vt,gt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ln,vt,gt]}],"backdrop-invert":[{"backdrop-invert":["",ln,vt,gt]}],"backdrop-opacity":[{"backdrop-opacity":[ln,vt,gt]}],"backdrop-saturate":[{"backdrop-saturate":[ln,vt,gt]}],"backdrop-sepia":[{"backdrop-sepia":["",ln,vt,gt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",vt,gt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ln,"initial",vt,gt]}],ease:[{ease:["linear","initial",b,vt,gt]}],delay:[{delay:[ln,vt,gt]}],animate:[{animate:["none",w,vt,gt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,vt,gt]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:Me()}],"skew-x":[{"skew-x":Me()}],"skew-y":[{"skew-y":Me()}],transform:[{transform:[vt,gt,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],zoom:[{zoom:[Mo,vt,gt]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",vt,gt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",vt,gt]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[ln,Fp,u_,ij]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},K2n=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(xd(e,"cacheSize",n),xd(e,"prefix",t),xd(e,"experimentalParseClassName",r),s1(e.theme,i.theme),s1(e.classGroups,i.classGroups),s1(e.conflictingClassGroups,i.conflictingClassGroups),s1(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),xd(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),xd(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),i1(e.theme,s.theme),i1(e.classGroups,s.classGroups),i1(e.conflictingClassGroups,s.conflictingClassGroups),i1(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),I3(e,s,"postfixLookupClassGroups"),I3(e,s,"orderSensitiveModifiers"),e),xd=(e,n,t)=>{t!==void 0&&(e[n]=t)},s1=(e,n)=>{if(n)for(const t in n)xd(e,t,n[t])},i1=(e,n)=>{if(n)for(const t in n)I3(e,n,t)},I3=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},W2n=(e,...n)=>typeof e=="function"?sj(cj,e,...n):sj(()=>K2n(cj(),e),...n),Q2n=W2n({extend:{theme:{text:["menu"]}}});function bs(...e){return Q2n(...e)}const X2n={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Gt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:bs("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",X2n[e],t),...r})}const Y2n=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),Z2n={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},J2n={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function jI(e,n,t,r){return bs(Y2n,Z2n[e],J2n[n],t&&"active",r)}function De({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:jI(n,t,e,r),...s})}function ph({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:jI(n,t,e,r),...s})}const ewn=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),twn={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},nwn={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function TI(e,n,t,r,s){return bs(ewn,twn[e],nwn[n],r==="circle"&&"rounded-full",t&&"active",s)}const $t=A.forwardRef(function({active:n=!1,shape:t="rounded",size:r="default",variant:s="default",className:i,...a},o){return f.jsx("button",{ref:o,className:TI(s,r,n,t,i),...a})});function Lh({active:e=!1,shape:n="rounded",size:t="default",variant:r="default",className:s,...i}){return f.jsx("a",{className:TI(r,t,e,n,s),...i})}const rwn={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function qr({variant:e="default",className:n,...t}){return f.jsx("input",{className:bs("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",rwn[e],n),...t})}function Jn({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:bs("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function Nt({className:e,...n}){return f.jsx("span",{className:bs("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function Gr({className:e,...n}){return f.jsx("div",{className:bs("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const swn={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function Id({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:bs("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:bs("h-[7px] w-[7px] shrink-0 rounded-full bg-current",swn[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const iwn=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function AI(e,n){return bs(iwn,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function _S({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:AI(e,n),...r,children:t??f.jsx("span",{})})}function awn({checked:e=!1,className:n,...t}){return f.jsx("span",{className:AI(e,n),...t,children:f.jsx("span",{})})}var Mi=TO();const own=vm(Mi);function cwn(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const lwn=e=>{switch(e){case"success":return fwn;case"info":return hwn;case"warning":return dwn;case"error":return pwn;default:return null}},uwn=Array(12).fill(0),_wn=({visible:e,className:n})=>Je.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},uwn.map((t,r)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),fwn=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),dwn=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),hwn=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),pwn=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),mwn=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),gwn=()=>{const[e,n]=Je.useState(document.hidden);return Je.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let vwn=1;const bwn=100,lj=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:vwn++};class ywn{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-bwn;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=lj(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],Je.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(wwn(u)&&!u.ok){i=!1;const _=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,x=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:p,...x})}else if(u instanceof Error){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:p,...x})}else if(t.success!==void 0){i=!1;const _=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"success",description:p,...x})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const h=typeof t.error=="function"?await t.error(u):t.error,_=typeof t.description=="function"?await t.description(u):t.description,m=typeof h=="object"&&!Je.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:_,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((u,h)=>o.then(()=>a[0]==="reject"?h(a[1]):u(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(n,t)=>{const r=lj(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const zi=new ywn,xwn=(e,n)=>zi.message(e,n),wwn=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",kwn=xwn,Swn=()=>zi.toasts,Cwn=()=>zi.getActiveToasts(),Ewn=Object.assign(kwn,{success:zi.success,info:zi.info,warning:zi.warning,error:zi.error,custom:zi.custom,message:zi.message,promise:zi.promise,dismiss:zi.dismiss,loading:zi.loading},{getHistory:Swn,getToasts:Cwn});cwn("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function a1(e){return e.label!==void 0}const Nwn=3,zwn="24px",jwn="16px",uj=4e3,Twn=356,Awn=14,Rwn=45,Mwn=200;function Oo(...e){return e.filter(Boolean).join(" ")}function Own(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const Dwn=e=>{var n,t,r,s,i,a,o,c,u;const{invert:h,toast:_,unstyled:p,interacting:m,setHeights:x,visibleToasts:k,heights:v,index:b,toasts:w,expanded:y,removeToast:C,defaultRichColors:N,closeButton:z,style:T,cancelButtonStyle:j,actionButtonStyle:M,className:D="",descriptionClassName:I="",duration:$,position:q,gap:H,expandByDefault:Q,classNames:V,icons:J,closeButtonAriaLabel:Z="Close toast"}=e,[B,L]=Je.useState(null),[F,U]=Je.useState(null),[K,ne]=Je.useState(!1),[ce,_e]=Je.useState(!1),[se,G]=Je.useState(!1),[oe,le]=Je.useState(!1),[pe,be]=Je.useState(!1),[Me,Le]=Je.useState(0),[Ke,je]=Je.useState(0),we=Je.useRef(_.duration||$||uj),rt=Je.useRef(null),Ze=Je.useRef(null),at=b===0,St=b+1<=k,Ft=_.type,ut=Ft??"default",dt=_.dismissible!==!1,Ie=_.className||"",me=_.descriptionClassName||"",Ae=Je.useMemo(()=>v.findIndex(Ct=>Ct.toastId===_.id)||0,[v,_.id]),Pe=Je.useMemo(()=>{var Ct;return(Ct=_.closeButton)!=null?Ct:z},[_.closeButton,z]),nt=Je.useMemo(()=>_.duration||$||uj,[_.duration,$]),_t=Je.useRef(0),pt=Je.useRef(0),yt=Je.useRef(0),Zt=Je.useRef(null),[nn,jt]=q.split("-"),mt=Je.useMemo(()=>v.reduce((Ct,on,cn)=>cn>=Ae?Ct:Ct+on.height,0),[v,Ae]),ft=gwn(),en=Je.useMemo(()=>{var Ct;return(Ct=e.swipeDirections)!=null?Ct:Own(q)},[e.swipeDirections,q]),An=_.invert||h,xr=Ft==="loading";pt.current=Je.useMemo(()=>Ae*H+mt,[Ae,mt]),Je.useEffect(()=>{we.current=nt},[nt]),Je.useEffect(()=>{ne(!0)},[]),Je.useEffect(()=>{const Ct=Ze.current;if(Ct){const on=Ct.getBoundingClientRect().height;return je(on),x(cn=>[{toastId:_.id,height:on,position:_.position},...cn]),()=>x(cn=>cn.filter(fn=>fn.toastId!==_.id))}},[x,_.id]),Je.useLayoutEffect(()=>{if(!K)return;const Ct=Ze.current,on=Ct.style.height;Ct.style.height="auto";const cn=Ct.getBoundingClientRect().height;Ct.style.height=on,je(cn),x(fn=>fn.find(un=>un.toastId===_.id)?fn.map(un=>un.toastId===_.id?{...un,height:cn}:un):[{toastId:_.id,height:cn,position:_.position},...fn])},[K,_.title,_.description,x,_.id,_.jsx,_.action,_.cancel]);const kn=Je.useCallback(()=>{_e(!0),Le(pt.current),x(Ct=>Ct.filter(on=>on.toastId!==_.id)),setTimeout(()=>{C(_)},Mwn)},[_,C,x,pt]);Je.useEffect(()=>{if(_.promise&&Ft==="loading"||_.duration===1/0||_.type==="loading")return;let Ct;return y||m||ft?(()=>{if(yt.current<_t.current){const fn=new Date().getTime()-_t.current;we.current=we.current-fn}yt.current=new Date().getTime()})():(()=>{we.current!==1/0&&(_t.current=new Date().getTime(),Ct=setTimeout(()=>{_.onAutoClose==null||_.onAutoClose.call(_,_),kn()},we.current))})(),()=>clearTimeout(Ct)},[y,m,_,Ft,ft,kn]),Je.useEffect(()=>{_.delete&&(kn(),_.onDismiss==null||_.onDismiss.call(_,_))},[kn,_.delete]);function Ln(){var Ct;if(J!=null&&J.loading){var on;return Je.createElement("div",{className:Oo(V==null?void 0:V.loader,_==null||(on=_.classNames)==null?void 0:on.loader,"sonner-loader"),"data-visible":Ft==="loading"},J.loading)}return Je.createElement(_wn,{className:Oo(V==null?void 0:V.loader,_==null||(Ct=_.classNames)==null?void 0:Ct.loader),visible:Ft==="loading"})}const Un=_.icon||(J==null?void 0:J[Ft])||lwn(Ft);var dr,es;return Je.createElement("li",{tabIndex:0,ref:Ze,className:Oo(D,Ie,V==null?void 0:V.toast,_==null||(n=_.classNames)==null?void 0:n.toast,V==null?void 0:V[ut],_==null||(t=_.classNames)==null?void 0:t[ut]),"data-sonner-toast":"","data-rich-colors":(dr=_.richColors)!=null?dr:N,"data-styled":!(_.jsx||_.unstyled||p),"data-mounted":K,"data-promise":!!_.promise,"data-swiped":pe,"data-removed":ce,"data-visible":St,"data-y-position":nn,"data-x-position":jt,"data-index":b,"data-front":at,"data-swiping":se,"data-dismissible":dt,"data-type":Ft,"data-invert":An,"data-swipe-out":oe,"data-swipe-direction":F,"data-expanded":!!(y||Q&&K),"data-testid":_.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${ce?Me:pt.current}px`,"--initial-height":Q?"auto":`${Ke}px`,...T,..._.style},onDragEnd:()=>{G(!1),L(null),Zt.current=null},onPointerDown:Ct=>{Ct.button!==2&&(xr||!dt||(rt.current=new Date,Le(pt.current),Ct.target.setPointerCapture(Ct.pointerId),Ct.target.tagName!=="BUTTON"&&(G(!0),Zt.current={x:Ct.clientX,y:Ct.clientY})))},onPointerUp:()=>{var Ct,on,cn;if(oe||!dt)return;Zt.current=null;const fn=Number(((Ct=Ze.current)==null?void 0:Ct.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wr=Number(((on=Ze.current)==null?void 0:on.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),un=new Date().getTime()-((cn=rt.current)==null?void 0:cn.getTime()),dn=B==="x"?fn:wr,Tn=Math.abs(dn)/un;if((B==="x"?en.includes(fn>0?"right":"left"):en.includes(wr>0?"bottom":"top"))&&(Math.abs(dn)>=Rwn||Tn>.11)){Le(pt.current),_.onDismiss==null||_.onDismiss.call(_,_),U(B==="x"?fn>0?"right":"left":wr>0?"down":"up"),kn(),le(!0);return}else{var Mt,zn;(Mt=Ze.current)==null||Mt.style.setProperty("--swipe-amount-x","0px"),(zn=Ze.current)==null||zn.style.setProperty("--swipe-amount-y","0px")}be(!1),G(!1),L(null)},onPointerMove:Ct=>{var on,cn,fn;if(!Zt.current||!dt||((on=window.getSelection())==null?void 0:on.toString().length)>0)return;const un=Ct.clientY-Zt.current.y,dn=Ct.clientX-Zt.current.x;!B&&(Math.abs(dn)>1||Math.abs(un)>1)&&L(Math.abs(dn)>Math.abs(un)?"x":"y");let Tn={x:0,y:0};const wt=Mt=>1/(1.5+Math.abs(Mt)/20);if(B==="y"){if(en.includes("top")||en.includes("bottom"))if(en.includes("top")&&un<0||en.includes("bottom")&&un>0)Tn.y=un;else{const Mt=un*wt(un);Tn.y=Math.abs(Mt)0)Tn.x=dn;else{const Mt=dn*wt(dn);Tn.x=Math.abs(Mt)0||Math.abs(Tn.y)>0)&&be(!0),(cn=Ze.current)==null||cn.style.setProperty("--swipe-amount-x",`${Tn.x}px`),(fn=Ze.current)==null||fn.style.setProperty("--swipe-amount-y",`${Tn.y}px`)}},Pe&&!_.jsx&&Ft!=="loading"?Je.createElement("button",{"aria-label":Z,"data-disabled":xr,"data-close-button":!0,onClick:xr||!dt?()=>{}:()=>{kn(),_.onDismiss==null||_.onDismiss.call(_,_)},className:Oo(V==null?void 0:V.closeButton,_==null||(r=_.classNames)==null?void 0:r.closeButton)},(es=J==null?void 0:J.close)!=null?es:mwn):null,(Ft||_.icon||_.promise)&&_.icon!==null&&((J==null?void 0:J[Ft])!==null||_.icon)?Je.createElement("div",{"data-icon":"",className:Oo(V==null?void 0:V.icon,_==null||(s=_.classNames)==null?void 0:s.icon)},Ft==="loading"?_.icon||Ln():_.promise?Ln():null,Ft!=="loading"?Un:null):null,Je.createElement("div",{"data-content":"",className:Oo(V==null?void 0:V.content,_==null||(i=_.classNames)==null?void 0:i.content)},Je.createElement("div",{"data-title":"",className:Oo(V==null?void 0:V.title,_==null||(a=_.classNames)==null?void 0:a.title)},_.jsx?_.jsx:typeof _.title=="function"?_.title():_.title),_.description?Je.createElement("div",{"data-description":"",className:Oo(I,me,V==null?void 0:V.description,_==null||(o=_.classNames)==null?void 0:o.description)},typeof _.description=="function"?_.description():_.description):null),Je.isValidElement(_.cancel)?_.cancel:_.cancel&&a1(_.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:_.cancelButtonStyle||j,onClick:Ct=>{a1(_.cancel)&&dt&&(_.cancel.onClick==null||_.cancel.onClick.call(_.cancel,Ct),kn())},className:Oo(V==null?void 0:V.cancelButton,_==null||(c=_.classNames)==null?void 0:c.cancelButton)},_.cancel.label):null,Je.isValidElement(_.action)?_.action:_.action&&a1(_.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:_.actionButtonStyle||M,onClick:Ct=>{a1(_.action)&&(_.action.onClick==null||_.action.onClick.call(_.action,Ct),!Ct.defaultPrevented&&kn())},className:Oo(V==null?void 0:V.actionButton,_==null||(u=_.classNames)==null?void 0:u.actionButton)},_.action.label):null)};function _j(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Lwn(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?jwn:zwn;function c(u){["top","right","bottom","left"].forEach(h=>{t[`${a}-${h}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(o)}),t}const Iwn=Je.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:h,mobileOffset:_,theme:p="light",richColors:m,duration:x,style:k,visibleToasts:v=Nwn,toastOptions:b,dir:w=_j(),gap:y=Awn,icons:C,customAriaLabel:N,containerAriaLabel:z="Notifications"}=n,[T,j]=Je.useState([]),M=Je.useMemo(()=>r?T.filter(ne=>ne.toasterId===r):T.filter(ne=>!ne.toasterId),[T,r]),D=Je.useMemo(()=>Array.from(new Set([i].concat(M.filter(ne=>ne.position).map(ne=>ne.position)))),[M,i]),[I,$]=Je.useState([]),[q,H]=Je.useState(!1),[Q,V]=Je.useState(!1),[J,Z]=Je.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=Je.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=Je.useRef(null),U=Je.useRef(!1),K=Je.useCallback(ne=>{j(ce=>{var _e;return(_e=ce.find(se=>se.id===ne.id))!=null&&_e.delete||zi.dismiss(ne.id),ce.filter(({id:se})=>se!==ne.id)})},[]);return Je.useEffect(()=>zi.subscribe(ne=>{if(ne.dismiss){requestAnimationFrame(()=>{j(ce=>ce.map(_e=>_e.id===ne.id?{..._e,delete:!0}:_e))});return}setTimeout(()=>{own.flushSync(()=>{j(ce=>{const _e=ce.findIndex(se=>se.id===ne.id);return _e!==-1?[...ce.slice(0,_e),{...ce[_e],...ne},...ce.slice(_e+1)]:[ne,...ce]})})})}),[]),Je.useEffect(()=>{if(p!=="system"){Z(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const ne=window.matchMedia("(prefers-color-scheme: dark)");try{ne.addEventListener("change",({matches:ce})=>{Z(ce?"dark":"light")})}catch{ne.addListener(({matches:_e})=>{try{Z(_e?"dark":"light")}catch(se){console.error(se)}})}},[p]),Je.useEffect(()=>{T.length<=1&&H(!1)},[T]),Je.useEffect(()=>{const ne=ce=>{var _e;if(a.length>0&&a.every(oe=>ce[oe]||ce.code===oe)){var G;H(!0),(G=B.current)==null||G.focus()}ce.code==="Escape"&&(document.activeElement===B.current||(_e=B.current)!=null&&_e.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[a]),Je.useEffect(()=>{if(B.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,U.current=!1)}},[B.current]),Je.createElement("section",{ref:t,"aria-label":N??`${z} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},D.map((ne,ce)=>{var _e;const[se,G]=ne.split("-");return M.length?Je.createElement("ol",{key:ne,dir:w==="auto"?_j():w,tabIndex:-1,ref:B,className:u,"data-sonner-toaster":!0,"data-sonner-theme":J,"data-y-position":se,"data-x-position":G,style:{"--front-toast-height":`${((_e=I[0])==null?void 0:_e.height)||0}px`,"--width":`${Twn}px`,"--gap":`${y}px`,...k,...Lwn(h,_)},onBlur:oe=>{U.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(U.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||U.current||(U.current=!0,F.current=oe.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{Q||H(!1)},onDragEnd:()=>H(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},M.filter(oe=>!oe.position&&ce===0||oe.position===ne).map((oe,le)=>{var pe,be;return Je.createElement(Dwn,{key:oe.id,icons:C,index:le,toast:oe,defaultRichColors:m,duration:(pe=b==null?void 0:b.duration)!=null?pe:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(be=b==null?void 0:b.closeButton)!=null?be:c,interacting:Q,position:ne,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:K,toasts:M.filter(Me=>Me.position==oe.position),heights:I.filter(Me=>Me.position==oe.position),setHeights:$,expandByDefault:o,gap:y,expanded:q,swipeDirections:n.swipeDirections})})):null}))});function $wn(e){const[n]=hI();return f.jsx(Iwn,{theme:n,...e})}function bn(e,n,t){Ewn[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function fS({content:e,children:n,className:t}){const r=A.useRef(null),s=A.useRef(null);function i(){const o=r.current,c=s.current;if(!o||!c)return;c.matches(":popover-open")||c.showPopover();const u=o.getBoundingClientRect(),h=c.getBoundingClientRect(),_=Math.max(8,Math.min(u.left+u.width/2-h.width/2,window.innerWidth-h.width-8));c.style.left=`${_}px`,c.style.top=`${Math.max(8,u.top-h.height-6)}px`}function a(){var o,c;(o=r.current)!=null&&o.matches(":hover, :focus")||(c=s.current)==null||c.hidePopover()}return A.useEffect(()=>{const o=()=>{var c;return(c=s.current)==null?void 0:c.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:bs("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var c;o.key==="Escape"&&((c=s.current)!=null&&c.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const Bwn=["button:not([disabled])","input:not([disabled])","textarea:not([disabled])","[tabindex]"].map(e=>`${e}:not([tabindex="-1"])`).join(", ");function Em(e,n,t="[data-initial-focus]"){const r=A.useRef(n);r.current=n,A.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(Bwn)];(s.querySelector(t)??a()[0]??s).focus();const o=c=>{if(c.key==="Escape"){if(s.querySelector(":popover-open"))return;c.preventDefault(),c.stopPropagation(),r.current();return}if(c.key!=="Tab")return;const u=a(),h=u[0],_=u.at(-1);!h||!_?(c.preventDefault(),s.focus()):c.shiftKey&&document.activeElement===h?(c.preventDefault(),_.focus()):!c.shiftKey&&document.activeElement===_&&(c.preventDefault(),h.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function RI({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=A.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),c=[];return n.activeTurnCount>0&&c.push(n.activeTurnCount===1?GCt():f7t({count:Xt(n.activeTurnCount)})),n.pendingPermissionCount>0&&c.push(n.pendingPermissionCount===1?gCt():T6t({count:Xt(n.pendingPermissionCount)})),o>0&&c.push(o===1?ACt():ZCt({count:Xt(o)})),n.queuedMessageCount>0&&c.push(n.queuedMessageCount===1?$Ct():i7t({count:Xt(n.queuedMessageCount)})),n.activeRunCount>0&&c.push(n.activeRunCount===1?SCt():Y6t({count:Xt(n.activeRunCount)})),Em(a,s),Mi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":c.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:U6t({host:Ne(e)})}),c.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:uCt()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:c.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(De,{disabled:r,onClick:s,children:Q_()}),f.jsx(De,{variant:"danger",disabled:r,onClick:i,children:r?b7t():I6t()})]})]})}),document.body)}/** +स्टोर की एक कॉपी नए स्थान पर बनाई जाएगी और वहीं सक्रिय की जाएगी। सक्रिय रन या चैट स्थानांतरण को रोक सकते हैं।`,R_n=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?N_n(e):t==="fa"?z_n(e):t==="ar"?j_n(e):t==="es"?T_n(e):t==="hi"?A_n(e):E_n(e)}),M_n=()=>"Move data here",O_n=()=>"将数据移动到此处",D_n=()=>"انتقال داده به اینجا",L_n=()=>"نقل البيانات إلى هنا",I_n=()=>"Mover los datos aquí",$_n=()=>"डेटा यहाँ ले जाएं",B_n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?O_n():t==="fa"?D_n():t==="ar"?L_n():t==="es"?I_n():t==="hi"?$_n():M_n()}),P_n=()=>"Moving…",F_n=()=>"正在移动…",H_n=()=>"در حال جابه‌جایی…",q_n=()=>"جارٍ النقل…",U_n=()=>"Moviendo…",G_n=()=>"स्थानांतरित हो रहा है…",V_n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?F_n():t==="fa"?H_n():t==="ar"?q_n():t==="es"?U_n():t==="hi"?G_n():P_n()}),K_n=()=>"Preparing…",W_n=()=>"正在准备…",Q_n=()=>"در حال آماده‌سازی…",X_n=()=>"جارٍ التحضير…",Y_n=()=>"Preparando…",Z_n=()=>"तैयार हो रहा है…",J_n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?W_n():t==="fa"?Q_n():t==="ar"?X_n():t==="es"?Y_n():t==="hi"?Z_n():K_n()}),efn=()=>" (same disk, instant)",tfn=()=>"(同一磁盘,可立即完成)",nfn=()=>" (روی همان دیسک، فوری)",rfn=()=>" (القرص نفسه، فوري)",sfn=()=>" (mismo disco, instantáneo)",ifn=()=>" (उसी डिस्क पर, तुरंत)",afn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tfn():t==="fa"?nfn():t==="ar"?rfn():t==="es"?sfn():t==="hi"?ifn():efn()}),ofn=()=>"default location",cfn=()=>"默认位置",lfn=()=>"محل پیش‌فرض",ufn=()=>"الموقع الافتراضي",_fn=()=>"ubicación predeterminada",ffn=()=>"डिफ़ॉल्ट स्थान",dfn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?cfn():t==="fa"?lfn():t==="ar"?ufn():t==="es"?_fn():t==="hi"?ffn():ofn()}),hfn=()=>"ORX_DATA_DIR environment variable",pfn=()=>"ORX_DATA_DIR 环境变量",mfn=()=>"متغیر محیطی ORX_DATA_DIR",gfn=()=>"متغيّر البيئة ORX_DATA_DIR",vfn=()=>"variable de entorno ORX_DATA_DIR",bfn=()=>"ORX_DATA_DIR एनवायरनमेंट वेरिएबल",yfn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?pfn():t==="fa"?mfn():t==="ar"?gfn():t==="es"?vfn():t==="hi"?bfn():hfn()}),xfn=()=>"your saved setting",wfn=()=>"已保存的设置",kfn=()=>"تنظیم ذخیره‌شدهٔ شما",Sfn=()=>"إعدادك المحفوظ",Cfn=()=>"tu ajuste guardado",Efn=()=>"आपकी सेव की गई सेटिंग",Nfn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?wfn():t==="fa"?kfn():t==="ar"?Sfn():t==="es"?Cfn():t==="hi"?Efn():xfn()}),zfn=()=>"XDG_DATA_HOME",jfn=()=>"XDG_DATA_HOME",Tfn=()=>"XDG_DATA_HOME",Afn=()=>"XDG_DATA_HOME",Rfn=()=>"XDG_DATA_HOME",Mfn=()=>"XDG_DATA_HOME",Ofn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?jfn():t==="fa"?Tfn():t==="ar"?Afn():t==="es"?Rfn():t==="hi"?Mfn():zfn()}),Dfn=()=>"Verifying…",Lfn=()=>"正在验证…",Ifn=()=>"در حال بررسی…",$fn=()=>"جارٍ التحقق…",Bfn=()=>"Verificando…",Pfn=()=>"सत्यापित हो रहा है…",Ffn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Lfn():t==="fa"?Ifn():t==="ar"?$fn():t==="es"?Bfn():t==="hi"?Pfn():Dfn()}),Hfn=()=>"Loading…",qfn=()=>"正在加载…",Ufn=()=>"در حال بارگیری…",Gfn=()=>"جارٍ التحميل…",Vfn=()=>"Cargando…",Kfn=()=>"लोड हो रहा है…",Wfn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?qfn():t==="fa"?Ufn():t==="ar"?Gfn():t==="es"?Vfn():t==="hi"?Kfn():Hfn()}),Qfn=()=>"This sub-agent is no longer available.",Xfn=()=>"此子智能体已不可用。",Yfn=()=>"این عامل فرعی دیگر در دسترس نیست.",Zfn=()=>"لم يعد هذا الوكيل الفرعي متاحًا.",Jfn=()=>"Este subagente ya no está disponible.",edn=()=>"यह सब-एजेंट अब उपलब्ध नहीं है।",tdn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Xfn():t==="fa"?Yfn():t==="ar"?Zfn():t==="es"?Jfn():t==="hi"?edn():Qfn()}),ndn=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,rdn=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,sdn=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,idn=e=>`${e==null?void 0:e.label} (معاينة؛ انقر نقرًا مزدوجًا أو Command/Control K ثم Enter لإبقائه مفتوحًا)`,adn=e=>`${e==null?void 0:e.label} (vista previa; doble clic o Comando/Control K y luego Intro para mantenerla abierta)`,odn=e=>`${e==null?void 0:e.label} (प्रीव्यू; खुला रखने के लिए डबल-क्लिक करें या Command/Control K, फिर Enter दबाएं)`,cdn=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?rdn(e):t==="fa"?sdn(e):t==="ar"?idn(e):t==="es"?adn(e):t==="hi"?odn(e):ndn(e)}),ldn=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,udn=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,_dn=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,fdn=e=>`${e==null?void 0:e.label} (انقر نقرًا مزدوجًا أو ⌘/Ctrl+K ثم Enter لإبقائه مفتوحًا)`,ddn=e=>`${e==null?void 0:e.label} (doble clic o ⌘/Ctrl+K Intro para mantenerla abierta)`,hdn=e=>`${e==null?void 0:e.label} (खुला रखने के लिए डबल-क्लिक करें या ⌘/Ctrl+K फिर Enter दबाएं)`,pdn=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?udn(e):t==="fa"?_dn(e):t==="ar"?fdn(e):t==="es"?ddn(e):t==="hi"?hdn(e):ldn(e)}),mdn=()=>"Alternatively, tell your agent to add a LaTeX template for you.",gdn=()=>"或者,请你的智能体为你添加 LaTeX 模板。",vdn=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",bdn=()=>"أو بدلًا من ذلك، اطلب من وكيلك إضافة قالب LaTeX لك.",ydn=()=>"También puedes pedirle a tu agente que añada una plantilla de LaTeX por ti.",xdn=()=>"या अपने एजेंट से आपके लिए एक LaTeX टेम्पलेट जोड़ने को कहें।",wdn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?gdn():t==="fa"?vdn():t==="ar"?bdn():t==="es"?ydn():t==="hi"?xdn():mdn()}),kdn=()=>", a repo for training a mini-GPT from scratch.",Sdn=()=>",一个从零训练迷你 GPT 的仓库。",Cdn=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",Edn=()=>" لأندريه كارباثي، المخصّص لتدريب نموذج mini-GPT من الصفر.",Ndn=()=>" de Andrej Karpathy, un repositorio para entrenar un mini-GPT desde cero.",zdn=()=>", स्क्रैच से एक मिनी-GPT ट्रेन करने के लिए एक रिपॉज़िटरी।",jdn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Sdn():t==="fa"?Cdn():t==="ar"?Edn():t==="es"?Ndn():t==="hi"?zdn():kdn()}),Tdn=()=>"Close",Adn=()=>"关闭",Rdn=()=>"بستن",Mdn=()=>"إغلاق",Odn=()=>"Cerrar",Ddn=()=>"बंद करें",y3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Adn():t==="fa"?Rdn():t==="ar"?Mdn():t==="es"?Odn():t==="hi"?Ddn():Tdn()}),Ldn=()=>"Create a new project",Idn=()=>"新建项目",$dn=()=>"ایجاد پروژهٔ جدید",Bdn=()=>"إنشاء مشروع جديد",Pdn=()=>"Crear un proyecto nuevo",Fdn=()=>"नया प्रोजेक्ट बनाएं",Hdn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Idn():t==="fa"?$dn():t==="ar"?Bdn():t==="es"?Pdn():t==="hi"?Fdn():Ldn()}),qdn=()=>"Demo project",Udn=()=>"演示项目",Gdn=()=>"پروژهٔ نمایشی",Vdn=()=>"مشروع توضيحي",Kdn=()=>"Proyecto de demostración",Wdn=()=>"डेमो प्रोजेक्ट",Qdn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Udn():t==="fa"?Gdn():t==="ar"?Vdn():t==="es"?Kdn():t==="hi"?Wdn():qdn()}),Xdn=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",Ydn=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",Zdn=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",Jdn=()=>"تصفّح محادثات الوكيل والتجارب وعمليات التشغيل والمُخرَجات لترى كيف يتشكّل مشروع على OpenResearch.",ehn=()=>"Explora las conversaciones con el agente, los experimentos, las ejecuciones y los artefactos para ver cómo se construye un proyecto en OpenResearch.",thn=()=>"यह देखने के लिए एजेंट बातचीत, प्रयोग, रन और आर्टिफ़ैक्ट देखें कि OpenResearch पर एक प्रोजेक्ट कैसे आकार लेता है।",nhn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ydn():t==="fa"?Zdn():t==="ar"?Jdn():t==="es"?ehn():t==="hi"?thn():Xdn()}),rhn=()=>"nanochat",shn=()=>"nanochat",ihn=()=>"nanochat",ahn=()=>"nanochat",ohn=()=>"nanochat",chn=()=>"nanochat",lhn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?shn():t==="fa"?ihn():t==="ar"?ahn():t==="es"?ohn():t==="hi"?chn():rhn()}),uhn=()=>"Try the demo experiment",_hn=()=>"试试演示实验",fhn=()=>"آزمایش نمایشی را امتحان کنید",dhn=()=>"جرّب التجربة التوضيحية",hhn=()=>"Probar el experimento de demostración",phn=()=>"डेमो प्रयोग आज़माएं",mhn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_hn():t==="fa"?fhn():t==="ar"?dhn():t==="es"?hhn():t==="hi"?phn():uhn()}),ghn=()=>"Couldn’t save your progress. Try again.",vhn=()=>"无法保存进度。请重试。",bhn=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",yhn=()=>"تعذّر حفظ تقدّمك. حاول مجددًا.",xhn=()=>"No se pudo guardar tu progreso. Inténtalo de nuevo.",whn=()=>"आपकी प्रगति सेव नहीं हो सकी। फिर से कोशिश करें।",khn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vhn():t==="fa"?bhn():t==="ar"?yhn():t==="es"?xhn():t==="hi"?whn():ghn()}),Shn=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",Chn=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",Ehn=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",Nhn=()=>"هذا مشروع توضيحي يبيّن كيف يعمل OpenResearch. يستخدم هذا العرض مستودع",zhn=()=>"Este es un proyecto de demostración que muestra cómo funciona OpenResearch. Esta demo usa",jhn=()=>"यह एक डेमो प्रोजेक्ट है जो दिखाता है कि OpenResearch कैसे काम करता है। यह डेमो Andrej Karpathy के",Thn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Chn():t==="fa"?Ehn():t==="ar"?Nhn():t==="es"?zhn():t==="hi"?jhn():Shn()}),Ahn=()=>"Welcome to OpenResearch",Rhn=()=>"欢迎使用 OpenResearch",Mhn=()=>"به OpenResearch خوش آمدید",Ohn=()=>"مرحبًا بك في OpenResearch",Dhn=()=>"Te damos la bienvenida a OpenResearch",Lhn=()=>"OpenResearch में आपका स्वागत है",Ihn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rhn():t==="fa"?Mhn():t==="ar"?Ohn():t==="es"?Dhn():t==="hi"?Lhn():Ahn()}),$hn=()=>"All experiments are archived. Turn on Show archived to view them.",Bhn=()=>"所有实验均已归档。开启“显示已归档”即可查看。",Phn=()=>"همه آزمایش‌ها بایگانی شده‌اند. برای دیدنشان نمایش بایگانی‌شده‌ها را فعال کنید.",Fhn=()=>"جميع التجارب مؤرشفة. فعّل إظهار المؤرشف لعرضها.",Hhn=()=>"Todos los experimentos están archivados. Activa Mostrar archivados para verlos.",qhn=()=>"सभी प्रयोग संग्रहीत हैं। उन्हें देखने के लिए संग्रहीत दिखाएँ चालू करें।",x3=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bhn():t==="fa"?Phn():t==="ar"?Fhn():t==="es"?Hhn():t==="hi"?qhn():$hn()}),Uhn=()=>"Archive above",Ghn=()=>"归档上方节点",Vhn=()=>"بایگانی گره‌های بالاتر",Khn=()=>"أرشفة العقد أعلاه",Whn=()=>"Archivar arriba",Qhn=()=>"ऊपर के नोड संग्रहीत करें",Xhn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ghn():t==="fa"?Vhn():t==="ar"?Khn():t==="es"?Whn():t==="hi"?Qhn():Uhn()}),Yhn=()=>"Archive from here down",Zhn=()=>"归档此节点及下方节点",Jhn=()=>"بایگانی از اینجا به پایین",epn=()=>"الأرشفة من هنا إلى الأسفل",tpn=()=>"Archivar desde aquí hacia abajo",npn=()=>"यहाँ से नीचे संग्रहीत करें",rpn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Zhn():t==="fa"?Jhn():t==="ar"?epn():t==="es"?tpn():t==="hi"?npn():Yhn()}),spn=()=>"Manage",ipn=()=>"管理",apn=()=>"مدیریت",opn=()=>"إدارة",cpn=()=>"Gestionar",lpn=()=>"प्रबंधित करें",upn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ipn():t==="fa"?apn():t==="ar"?opn():t==="es"?cpn():t==="hi"?lpn():spn()}),_pn=e=>`Manage ${e==null?void 0:e.name}`,fpn=e=>`管理 ${e==null?void 0:e.name}`,dpn=e=>`مدیریت ${e==null?void 0:e.name}`,hpn=e=>`إدارة ${e==null?void 0:e.name}`,ppn=e=>`Gestionar ${e==null?void 0:e.name}`,mpn=e=>`${e==null?void 0:e.name} प्रबंधित करें`,Pz=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?fpn(e):t==="fa"?dpn(e):t==="ar"?hpn(e):t==="es"?ppn(e):t==="hi"?mpn(e):_pn(e)}),gpn=()=>"Archived",vpn=()=>"已归档",bpn=()=>"بایگانی‌شده",ypn=()=>"مؤرشف",xpn=()=>"Archivado",wpn=()=>"संग्रहीत",IL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?vpn():t==="fa"?bpn():t==="ar"?ypn():t==="es"?xpn():t==="hi"?wpn():gpn()}),kpn=()=>"Baseline",Spn=()=>"基线",Cpn=()=>"مبنا",Epn=()=>"الأساس",Npn=()=>"Base",zpn=()=>"बेसलाइन",jpn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Spn():t==="fa"?Cpn():t==="ar"?Epn():t==="es"?Npn():t==="hi"?zpn():kpn()}),Tpn=()=>"Experiment",Apn=()=>"实验",Rpn=()=>"آزمایش",Mpn=()=>"تجربة",Opn=()=>"Experimento",Dpn=()=>"प्रयोग",Wc=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Apn():t==="fa"?Rpn():t==="ar"?Mpn():t==="es"?Opn():t==="hi"?Dpn():Tpn()}),Lpn=e=>`${e==null?void 0:e.count} experiments`,Ipn=e=>`${e==null?void 0:e.count} 个实验`,$pn=e=>`${e==null?void 0:e.count} آزمایش`,Bpn=e=>`التجارب: ${e==null?void 0:e.count}`,Ppn=e=>`${e==null?void 0:e.count} experimentos`,Fpn=e=>`${e==null?void 0:e.count} प्रयोग`,Hpn=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Ipn(e):t==="fa"?$pn(e):t==="ar"?Bpn(e):t==="es"?Ppn(e):t==="hi"?Fpn(e):Lpn(e)}),qpn=()=>"1 experiment",Upn=()=>"1 个实验",Gpn=()=>"۱ آزمایش",Vpn=()=>"تجربة واحدة",Kpn=()=>"1 experimento",Wpn=()=>"1 प्रयोग",Qpn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Upn():t==="fa"?Gpn():t==="ar"?Vpn():t==="es"?Kpn():t==="hi"?Wpn():qpn()}),Xpn=()=>"Restore above",Ypn=()=>"恢复上方节点",Zpn=()=>"بازیابی گره‌های بالاتر",Jpn=()=>"استعادة العقد أعلاه",e0n=()=>"Restaurar arriba",t0n=()=>"ऊपर के नोड पुनर्स्थापित करें",n0n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ypn():t==="fa"?Zpn():t==="ar"?Jpn():t==="es"?e0n():t==="hi"?t0n():Xpn()}),r0n=()=>"Restore from here down",s0n=()=>"恢复此节点及下方节点",i0n=()=>"بازیابی از اینجا به پایین",a0n=()=>"الاستعادة من هنا إلى الأسفل",o0n=()=>"Restaurar desde aquí hacia abajo",c0n=()=>"यहाँ से नीचे पुनर्स्थापित करें",l0n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?s0n():t==="fa"?i0n():t==="ar"?a0n():t==="es"?o0n():t==="hi"?c0n():r0n()}),u0n=()=>"Running",_0n=()=>"运行中",f0n=()=>"در حال اجرا",d0n=()=>"قيد التشغيل",h0n=()=>"En ejecución",p0n=()=>"चल रहा है",m0n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?_0n():t==="fa"?f0n():t==="ar"?d0n():t==="es"?h0n():t==="hi"?p0n():u0n()}),g0n=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",v0n=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",b0n=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",y0n=()=>"اطلب في هذه المهمة إنشاء واحدة، أو بدّل إلى «المشروع بالكامل» لرؤية جميع التجارب.",x0n=()=>"Pide en esta tarea que se cree uno, o cambia a Todo el proyecto para ver todos los experimentos.",w0n=()=>"इस टास्क में एक बनाने को कहें, या सभी प्रयोग देखने के लिए पूरा प्रोजेक्ट पर स्विच करें।",k0n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?v0n():t==="fa"?b0n():t==="ar"?y0n():t==="es"?x0n():t==="hi"?w0n():g0n()}),S0n=()=>"Ask the agent in chat to create and run your first experiment.",C0n=()=>"在聊天中让智能体创建并运行你的第一个实验。",E0n=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",N0n=()=>"اطلب من الوكيل في المحادثة إنشاء أول تجربة لك وتشغيلها.",z0n=()=>"Pídele al agente en el chat que cree y ejecute tu primer experimento.",j0n=()=>"एजेंट से चैट में अपना पहला प्रयोग बनाने और चलाने को कहें।",T0n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?C0n():t==="fa"?E0n():t==="ar"?N0n():t==="es"?z0n():t==="hi"?j0n():S0n()}),A0n=()=>"Code",R0n=()=>"代码",M0n=()=>"کد",O0n=()=>"الشيفرة",D0n=()=>"Código",L0n=()=>"कोड",I0n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?R0n():t==="fa"?M0n():t==="ar"?O0n():t==="es"?D0n():t==="hi"?L0n():A0n()}),$0n=()=>"Logs",B0n=()=>"日志",P0n=()=>"گزارش‌ها",F0n=()=>"السجلات",H0n=()=>"Logs",q0n=()=>"लॉग",$L=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?B0n():t==="fa"?P0n():t==="ar"?F0n():t==="es"?H0n():t==="hi"?q0n():$0n()}),U0n=()=>"No experiments from the current task yet",G0n=()=>"当前任务尚无实验",V0n=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",K0n=()=>"لا توجد تجارب من المهمة الحالية بعد",W0n=()=>"Aún no hay experimentos de la tarea actual",Q0n=()=>"मौजूदा टास्क से अभी तक कोई प्रयोग नहीं",X0n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?G0n():t==="fa"?V0n():t==="ar"?K0n():t==="es"?W0n():t==="hi"?Q0n():U0n()}),Y0n=()=>"No experiments yet",Z0n=()=>"尚无实验",J0n=()=>"هنوز آزمایشی وجود ندارد",emn=()=>"لا توجد تجارب بعد",tmn=()=>"Aún no hay experimentos",nmn=()=>"अभी तक कोई प्रयोग नहीं",rmn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Z0n():t==="fa"?J0n():t==="ar"?emn():t==="es"?tmn():t==="hi"?nmn():Y0n()}),smn=()=>"no runs",imn=()=>"无运行",amn=()=>"بدون اجرا",omn=()=>"لا عمليات تشغيل",cmn=()=>"sin ejecuciones",lmn=()=>"कोई रन नहीं",umn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?imn():t==="fa"?amn():t==="ar"?omn():t==="es"?cmn():t==="hi"?lmn():smn()}),_mn=()=>"Open logs",fmn=()=>"打开日志",dmn=()=>"باز کردن گزارش‌ها",hmn=()=>"فتح السجلات",pmn=()=>"Abrir logs",mmn=()=>"लॉग खोलें",gmn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fmn():t==="fa"?dmn():t==="ar"?hmn():t==="es"?pmn():t==="hi"?mmn():_mn()}),vmn=()=>"other tasks",bmn=()=>"其他任务",ymn=()=>"وظایف دیگر",xmn=()=>"مهام أخرى",wmn=()=>"otras tareas",kmn=()=>"अन्य टास्क",Smn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bmn():t==="fa"?ymn():t==="ar"?xmn():t==="es"?wmn():t==="hi"?kmn():vmn()}),Cmn=()=>"Runs",Emn=()=>"运行",Nmn=()=>"اجراها",zmn=()=>"عمليات التشغيل",jmn=()=>"Ejecuciones",Tmn=()=>"रन",Amn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Emn():t==="fa"?Nmn():t==="ar"?zmn():t==="es"?jmn():t==="hi"?Tmn():Cmn()}),Rmn=()=>"Switch to Entire project to see all experiments",Mmn=()=>"切换到“整个项目”以查看所有实验",Omn=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",Dmn=()=>"بدّل إلى «المشروع بالكامل» لرؤية جميع التجارب",Lmn=()=>"Cambia a Todo el proyecto para ver todos los experimentos",Imn=()=>"सभी प्रयोग देखने के लिए पूरा प्रोजेक्ट पर स्विच करें",$mn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Mmn():t==="fa"?Omn():t==="ar"?Dmn():t==="es"?Lmn():t==="hi"?Imn():Rmn()}),Bmn=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,Pmn=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,Fmn=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,Hmn=e=>`تم التحديث إلى ${e==null?void 0:e.version}. أعد التشغيل لاستخدامه.`,qmn=e=>`Actualizado a la versión ${e==null?void 0:e.version}. Reinicia para usarla.`,Umn=e=>`${e==null?void 0:e.version} पर अपडेट हुआ। इस्तेमाल के लिए फिर से शुरू करें।`,Gmn=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Pmn(e):t==="fa"?Fmn(e):t==="ar"?Hmn(e):t==="es"?qmn(e):t==="hi"?Umn(e):Bmn(e)}),Vmn=()=>"Dismiss",Kmn=()=>"关闭",Wmn=()=>"بستن",Qmn=()=>"تجاهل",Xmn=()=>"Descartar",Ymn=()=>"खारिज करें",Zmn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Kmn():t==="fa"?Wmn():t==="ar"?Qmn():t==="es"?Xmn():t==="hi"?Ymn():Vmn()}),Jmn=()=>"Restart now",egn=()=>"立即重新启动",tgn=()=>"هم‌اکنون دوباره راه‌اندازی کن",ngn=()=>"أعد التشغيل الآن",rgn=()=>"Reiniciar ahora",sgn=()=>"अभी फिर से शुरू करें",BL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?egn():t==="fa"?tgn():t==="ar"?ngn():t==="es"?rgn():t==="hi"?sgn():Jmn()}),ign=e=>`Could not restart: ${e==null?void 0:e.error}`,agn=e=>`无法重新启动:${e==null?void 0:e.error}`,ogn=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,cgn=e=>`تعذّرت إعادة التشغيل: ${e==null?void 0:e.error}`,lgn=e=>`No se pudo reiniciar: ${e==null?void 0:e.error}`,ugn=e=>`फिर से शुरू नहीं हो सका: ${e==null?void 0:e.error}`,PL=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?agn(e):t==="fa"?ogn(e):t==="ar"?cgn(e):t==="es"?lgn(e):t==="hi"?ugn(e):ign(e)}),_gn=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",fgn=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",dgn=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",hgn=()=>"لم يعد OpenResearch المحدَّث في الوقت المناسب. أعد تشغيله يدويًا.",pgn=()=>"La nueva versión de OpenResearch no se inició a tiempo. Reinícialo manualmente.",mgn=()=>"अपडेट किया गया OpenResearch समय पर वापस नहीं आया। इसे खुद फिर से शुरू करें।",ggn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?fgn():t==="fa"?dgn():t==="ar"?hgn():t==="es"?pgn():t==="hi"?mgn():_gn()}),vgn=()=>"Restarting…",bgn=()=>"正在重新启动…",ygn=()=>"در حال راه‌اندازی مجدد…",xgn=()=>"جارٍ إعادة التشغيل…",wgn=()=>"Reiniciando…",kgn=()=>"फिर से शुरू हो रहा है…",FL=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?bgn():t==="fa"?ygn():t==="ar"?xgn():t==="es"?wgn():t==="hi"?kgn():vgn()}),Sgn=()=>"macOS app",Cgn=()=>"macOS 应用",Egn=()=>"برنامهٔ macOS",Ngn=()=>"تطبيق macOS",zgn=()=>"App de macOS",jgn=()=>"macOS ऐप",Tgn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Cgn():t==="fa"?Egn():t==="ar"?Ngn():t==="es"?zgn():t==="hi"?jgn():Sgn()}),Agn=()=>"Installed with cargo",Rgn=()=>"通过 cargo 安装",Mgn=()=>"نصب‌شده با cargo",Ogn=()=>"مثبّت عبر cargo",Dgn=()=>"Instalado con cargo",Lgn=()=>"cargo से इंस्टॉल किया गया",Ign=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Rgn():t==="fa"?Mgn():t==="ar"?Ogn():t==="es"?Dgn():t==="hi"?Lgn():Agn()}),$gn=()=>"Installed with Homebrew",Bgn=()=>"通过 Homebrew 安装",Pgn=()=>"نصب‌شده با Homebrew",Fgn=()=>"مثبّت عبر Homebrew",Hgn=()=>"Instalado con Homebrew",qgn=()=>"Homebrew से इंस्टॉल किया गया",Ugn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Bgn():t==="fa"?Pgn():t==="ar"?Fgn():t==="es"?Hgn():t==="hi"?qgn():$gn()}),Ggn=()=>"Installed with the orx installer",Vgn=()=>"通过 orx 安装程序安装",Kgn=()=>"نصب‌شده با نصب‌کنندهٔ orx",Wgn=()=>"مثبّت عبر مُثبّت orx",Qgn=()=>"Instalado con el instalador de orx",Xgn=()=>"orx इंस्टॉलर से इंस्टॉल किया गया",Ygn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Vgn():t==="fa"?Kgn():t==="ar"?Wgn():t==="es"?Qgn():t==="hi"?Xgn():Ggn()}),Zgn=()=>"Managed by Nix",Jgn=()=>"由 Nix 管理",e1n=()=>"مدیریت‌شده با Nix",t1n=()=>"مُدار بواسطة Nix",n1n=()=>"Gestionado por Nix",r1n=()=>"Nix द्वारा प्रबंधित",s1n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Jgn():t==="fa"?e1n():t==="ar"?t1n():t==="es"?n1n():t==="hi"?r1n():Zgn()}),i1n=()=>"Portable orx.exe",a1n=()=>"便携版 orx.exe",o1n=()=>"orx.exe قابل‌حمل",c1n=()=>"‏orx.exe المحمول",l1n=()=>"orx.exe portable",u1n=()=>"पोर्टेबल orx.exe",_1n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?a1n():t==="fa"?o1n():t==="ar"?c1n():t==="es"?l1n():t==="hi"?u1n():i1n()}),f1n=()=>"Unknown install",d1n=()=>"未知安装方式",h1n=()=>"روش نصب نامشخص",p1n=()=>"تثبيت غير معروف",m1n=()=>"Instalación desconocida",g1n=()=>"अज्ञात इंस्टॉल",v1n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?d1n():t==="fa"?h1n():t==="ar"?p1n():t==="es"?m1n():t==="hi"?g1n():f1n()}),b1n=()=>"Re-run your cargo install to update.",y1n=()=>"重新运行 cargo 安装命令以更新。",x1n=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",w1n=()=>"أعِد تنفيذ أمر cargo install للتحديث.",k1n=()=>"Vuelve a ejecutar cargo install para actualizar.",S1n=()=>"अपडेट करने के लिए अपना cargo install फिर से चलाएं।",C1n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?y1n():t==="fa"?x1n():t==="ar"?w1n():t==="es"?k1n():t==="hi"?S1n():b1n()}),E1n=()=>"Run brew upgrade to update.",N1n=()=>"运行 brew upgrade 以更新。",z1n=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",j1n=()=>"نفّذ brew upgrade للتحديث.",T1n=()=>"Ejecuta brew upgrade para actualizar.",A1n=()=>"अपडेट करने के लिए brew upgrade चलाएं।",R1n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?N1n():t==="fa"?z1n():t==="ar"?j1n():t==="es"?T1n():t==="hi"?A1n():E1n()}),M1n=()=>"Update it through your Nix configuration.",O1n=()=>"通过 Nix 配置进行更新。",D1n=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",L1n=()=>"حدّثه عبر إعداد Nix الخاص بك.",I1n=()=>"Actualízalo desde tu configuración de Nix.",$1n=()=>"इसे अपने Nix कॉन्फ़िगरेशन के ज़रिए अपडेट करें।",B1n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?O1n():t==="fa"?D1n():t==="ar"?L1n():t==="es"?I1n():t==="hi"?$1n():M1n()}),P1n=()=>"Active Experiments",F1n=()=>"活跃实验",H1n=()=>"آزمایش‌های فعال",q1n=()=>"التجارب النشطة",U1n=()=>"Experimentos activos",G1n=()=>"सक्रिय प्रयोग",V1n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?F1n():t==="fa"?H1n():t==="ar"?q1n():t==="es"?U1n():t==="hi"?G1n():P1n()}),K1n=()=>"Default compute",W1n=()=>"默认计算目标",Q1n=()=>"محاسبات پیش‌فرض",X1n=()=>"الحوسبة الافتراضية",Y1n=()=>"Cómputo predeterminado",Z1n=()=>"डिफ़ॉल्ट कंप्यूट",J1n=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?W1n():t==="fa"?Q1n():t==="ar"?X1n():t==="es"?Y1n():t==="hi"?Z1n():K1n()}),evn=()=>"Terminal",tvn=()=>"终端",nvn=()=>"ترمینال",rvn=()=>"الطرفية",svn=()=>"Terminal",ivn=()=>"टर्मिनल",Tv=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?tvn():t==="fa"?nvn():t==="ar"?rvn():t==="es"?svn():t==="hi"?ivn():evn()}),avn=()=>"The terminal disconnected.",ovn=()=>"终端连接已断开。",cvn=()=>"ارتباط ترمینال قطع شد.",lvn=()=>"انقطعت الطرفية.",uvn=()=>"La terminal se desconectó.",_vn=()=>"टर्मिनल डिस्कनेक्ट हो गया।",Fz=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?ovn():t==="fa"?cvn():t==="ar"?lvn():t==="es"?uvn():t==="hi"?_vn():avn()}),fvn=e=>`Shell exited with code ${e==null?void 0:e.code}.`,dvn=e=>`Shell 已退出,退出码 ${e==null?void 0:e.code}。`,hvn=e=>`پوسته با کد ${e==null?void 0:e.code} خارج شد.`,pvn=e=>`انتهى Shell برمز الخروج ${e==null?void 0:e.code}.`,mvn=e=>`El shell terminó con el código ${e==null?void 0:e.code}.`,gvn=e=>`शेल कोड ${e==null?void 0:e.code} के साथ बंद हो गया।`,vvn=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?dvn(e):t==="fa"?hvn(e):t==="ar"?pvn(e):t==="es"?mvn(e):t==="hi"?gvn(e):fvn(e)}),bvn=()=>"Restart shell",yvn=()=>"重新启动 Shell",xvn=()=>"راه‌اندازی دوباره پوسته",wvn=()=>"إعادة تشغيل Shell",kvn=()=>"Reiniciar shell",Svn=()=>"शेल फिर से शुरू करें",Cvn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?yvn():t==="fa"?xvn():t==="ar"?wvn():t==="es"?kvn():t==="hi"?Svn():bvn()}),Evn=()=>"This worktree",Nvn=()=>"当前工作树",zvn=()=>"این درخت کاری",jvn=()=>"شجرة العمل هذه",Tvn=()=>"Este árbol de trabajo",Avn=()=>"यह वर्कट्री",Rvn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Nvn():t==="fa"?zvn():t==="ar"?jvn():t==="es"?Tvn():t==="hi"?Avn():Evn()}),Mvn=()=>"Workspace",Ovn=()=>"工作区",Dvn=()=>"فضای کاری",Lvn=()=>"مساحة العمل",Ivn=()=>"Espacio de trabajo",$vn=()=>"वर्कस्पेस",sw=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Ovn():t==="fa"?Dvn():t==="ar"?Lvn():t==="es"?Ivn():t==="hi"?$vn():Mvn()}),Bvn=e=>`Current worktree · ${e==null?void 0:e.branch}`,Pvn=e=>`当前工作树 · ${e==null?void 0:e.branch}`,Fvn=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,Hvn=e=>`شجرة العمل الحالية · ${e==null?void 0:e.branch}`,qvn=e=>`Árbol de trabajo actual · ${e==null?void 0:e.branch}`,Uvn=e=>`मौजूदा वर्कट्री · ${e==null?void 0:e.branch}`,Gvn=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Pvn(e):t==="fa"?Fvn(e):t==="ar"?Hvn(e):t==="es"?qvn(e):t==="hi"?Uvn(e):Bvn(e)}),Vvn=e=>`Default branch · ${e==null?void 0:e.branch}`,Kvn=e=>`默认分支 · ${e==null?void 0:e.branch}`,Wvn=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,Qvn=e=>`الفرع الافتراضي · ${e==null?void 0:e.branch}`,Xvn=e=>`Rama predeterminada · ${e==null?void 0:e.branch}`,Yvn=e=>`डिफ़ॉल्ट ब्रांच · ${e==null?void 0:e.branch}`,Zvn=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?Kvn(e):t==="fa"?Wvn(e):t==="ar"?Qvn(e):t==="es"?Xvn(e):t==="hi"?Yvn(e):Vvn(e)}),Jvn=e=>`detached at ${e==null?void 0:e.branch}`,ebn=e=>`分离于 ${e==null?void 0:e.branch}`,tbn=e=>`جدا در ${e==null?void 0:e.branch}`,nbn=e=>`منفصل عند ${e==null?void 0:e.branch}`,rbn=e=>`desacoplado en ${e==null?void 0:e.branch}`,sbn=e=>`${e==null?void 0:e.branch} पर डिटैच्ड`,ibn=((e,n={})=>{const t=n.locale??N();return t==="zh-CN"?ebn(e):t==="fa"?tbn(e):t==="ar"?nbn(e):t==="es"?rbn(e):t==="hi"?sbn(e):Jvn(e)}),abn=()=>"Listing truncated.",obn=()=>"列表已截断。",cbn=()=>"فهرست کوتاه شده است.",lbn=()=>"القائمة مقتطعة.",ubn=()=>"Listado truncado.",_bn=()=>"सूची छोटी की गई।",fbn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?obn():t==="fa"?cbn():t==="ar"?lbn():t==="es"?ubn():t==="hi"?_bn():abn()}),dbn=()=>"Loading…",hbn=()=>"正在加载…",pbn=()=>"در حال بارگیری…",mbn=()=>"جارٍ التحميل…",gbn=()=>"Cargando…",vbn=()=>"लोड हो रहा है…",bbn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?hbn():t==="fa"?pbn():t==="ar"?mbn():t==="es"?gbn():t==="hi"?vbn():dbn()}),ybn=()=>"No changes yet.",xbn=()=>"尚无更改。",wbn=()=>"هنوز تغییری وجود ندارد.",kbn=()=>"لا توجد تغييرات بعد.",Sbn=()=>"Aún no hay cambios.",Cbn=()=>"अभी तक कोई बदलाव नहीं।",Ebn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?xbn():t==="fa"?wbn():t==="ar"?kbn():t==="es"?Sbn():t==="hi"?Cbn():ybn()}),Nbn=()=>"No files.",zbn=()=>"没有文件。",jbn=()=>"فایلی وجود ندارد.",Tbn=()=>"لا توجد ملفات.",Abn=()=>"No hay archivos.",Rbn=()=>"कोई फ़ाइल नहीं।",Mbn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?zbn():t==="fa"?jbn():t==="ar"?Tbn():t==="es"?Abn():t==="hi"?Rbn():Nbn()}),Obn=()=>"Refresh failed:",Dbn=()=>"刷新失败:",Lbn=()=>"تازه‌سازی ناموفق بود:",Ibn=()=>"فشل التحديث:",$bn=()=>"Error al actualizar:",Bbn=()=>"रीफ़्रेश विफल:",Pbn=((e={},n={})=>{const t=n.locale??N();return t==="zh-CN"?Dbn():t==="fa"?Lbn():t==="ar"?Ibn():t==="es"?$bn():t==="hi"?Bbn():Obn()}),Ce=e=>`⁦${e}⁩`,ia=e=>`⁨${e}⁩`,tn=e=>new Intl.NumberFormat(N()).format(e),Fp="demo_nanochat_v1",Vc=e=>e.startsWith("demo_"),Id="chat_demo_nanochat_v1",Rb="chat_demo_nanochat_figures_v1",Mb="chat_demo_nanochat_literature_v1",Fbn={[Id]:"cpu_end_to_end",[Rb]:"figures",[Mb]:"literature"},iw="cpu-apple-silicon-pipeline-results.md",Hbn={[Id]:"msg_demo_nanochat_assistant_v1",[Rb]:"msg_demo_nanochat_figures_assistant_v1",[Mb]:"msg_demo_nanochat_literature_assistant_v1"},Hz="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class w3 extends Error{constructor(t,r,s){super(t);Us(this,"currentVersion");Us(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function la(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const HL=new WeakMap;async function mi(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new w3(s,a,i.exists)}}catch(i){if(i instanceof w3)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=HL.get(e);if(t&&!Fn(t))throw new DOMException("Workspace changed","AbortError");return n}const Mt=(e,n)=>fetch(e,{signal:n}).then(t=>mi(t));async function ba(e,n){const t=Va(),r=await fetch(e,n);if(!Fn(t))throw new DOMException("Workspace changed","AbortError");return HL.set(r,t),r.ok&&vQ(e,t),r}const wt=(e,n,t=!1)=>ba(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>mi(r)),qu=(e,n)=>ba(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>mi(t)),qL=(e,n)=>ba(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>mi(t)),qbn=e=>Mt("/api/projects",e).then(n=>n.projects),Ubn=e=>Mt("/api/projects/activity",e).then(n=>n.activity),Gbn=e=>Mt("/api/settings/ui-state",e),Vbn=(e,n)=>Mt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),Kbn=(e,n,t=!1)=>wt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),Wbn=(e,n=!1)=>wt("/api/settings/ui-state",{workspace:e},n),Qbn=e=>wt("/api/settings/ui-state",e),Xbn=(e,n)=>wt("/api/onboarding/complete",{...e,...n}),Ybn=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return Mt(`/api/project-path/status${t}`,n)},Zbn=()=>wt("/api/project-path/pick").then(e=>e.path),Jbn=e=>wt("/api/projects",e),eyn=(e,n)=>Mt(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),tyn=e=>Mt("/api/github/account",e),nyn=(e,n)=>Mt(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),ryn=(e,n,t)=>Mt(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),syn=(e,n)=>Mt(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),iyn=e=>wt("/api/projects/starter-prompts/prewarm",e),ayn=(e,n,t,r,s)=>Mt(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),oyn=e=>wt(`/api/projects/${e}/open`).then(n=>n.project),cyn=e=>ba(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}mQ(e)}),lyn=(e,n)=>Mt(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),uyn=(e,n,t)=>qu(`/api/experiments/${e}/archive`,{direction:n,archived:t}),_yn=(e,n)=>Mt(`/api/projects/${e}/runs`,n).then(t=>t.runs),UL=e=>wt(`/api/runs/${e}/cancel`).then(()=>{}),fyn=(e,n)=>Mt(`/api/runs/${e}/log?offset=${n}`),dyn=(e,n)=>Mt(`/api/runs/${e}/diff`,n),hyn=(e,n)=>Mt(`/api/experiments/${e}/diff`,n),Uu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),pyn=(e,n,t={},r)=>Mt(`/api/projects/${e}/file?${Uu(t,new URLSearchParams({path:n}))}`,r),k3=(e,n,t={})=>`/api/projects/${e}/file/raw?${Uu(t,new URLSearchParams({path:n}))}`,myn=(e,n)=>Mt(`/api/files/abs?path=${encodeURIComponent(e)}`,n),GL=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,gyn=(e,n,t,r)=>qL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),vyn=(e,n,t,r={})=>qu(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),byn=(e,n,t={})=>wt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),yyn=(e,n,t={})=>wt(`/api/projects/${e}/file/reveal`,{path:n,sessionId:t.sessionId}),xyn=e=>Mt("/api/latex/engine",e),wyn=(e,n,t={})=>wt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),kyn=e=>Mt("/api/overleaf/settings",e),VL=e=>wt("/api/overleaf/token",{token:e}),Syn=()=>ba("/api/overleaf/token",{method:"DELETE"}).then(e=>mi(e)),KL=(e,n={})=>wt("/api/overleaf/session",{session:e,host:n.host}),Cyn=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>mi(e)),Eyn=(e={})=>wt("/api/overleaf/session/import",{host:e.host}),Nyn=(e,n,t={})=>wt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),zyn=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${Uu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>mi(r)),jyn=(e,n,t={},r)=>Mt(`/api/projects/${e}/file/overleaf?${Uu(t,new URLSearchParams({path:n}))}`,r),Tyn=(e,n,t)=>wt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),Ayn=(e,n,t={})=>ba(`/api/projects/${e}/file/overleaf?${Uu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>mi(r)),Ryn=(e,n,t={})=>wt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),Myn=(e,n,t={},r)=>Mt(`/api/projects/${e}/file/overleaf/status?${Uu(t,new URLSearchParams({path:n}))}`,r),Oyn=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${Uu(t,new URLSearchParams({path:n}))}`,Dyn=(e,n={},t)=>{const r=Uu(n).toString();return Mt(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Lyn=(e,n)=>Mt(`/api/chat/sessions/${e}/worktree`,n),Ob=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,Iyn=e=>Mt("/api/settings/hf",e),$yn=e=>wt("/api/settings/hf",{token:e}),Byn=e=>Mt("/api/settings/tinker",e),Pyn=e=>wt("/api/settings/tinker",{key:e}),Fyn=e=>Mt("/api/update",e),Hyn=()=>wt("/api/update/apply"),qyn=()=>wt("/api/update/restart"),Uyn=e=>wt("/api/update/auto",{enabled:e}),Gyn=(e=!1)=>wt("/api/update/install-cli",{force:e}),Vyn=e=>Mt("/api/settings/k8s",e),Kyn=e=>wt("/api/settings/k8s",e),Wyn=e=>Mt("/api/settings/modal",e),Qyn=(e,n)=>wt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Xyn=e=>Mt("/api/settings/env",e).then(n=>n.vars),WL=(e,n)=>wt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Yyn=e=>ba(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>mi(n)).then(n=>n.vars),Zyn=e=>Mt("/api/settings/data-dir",e),Jyn=e=>wt("/api/settings/data-dir/validate",{path:e}),exn=e=>wt("/api/settings/data-dir/move",{path:e}),txn=e=>Mt("/api/settings/ssh",e),nxn=e=>wt("/api/settings/ssh",e),rxn=e=>wt("/api/settings/ssh/default",{host:e}),sxn=(e,n)=>wt("/api/settings/ssh/preflight",{host:e,container:n}),ixn=e=>Mt("/api/settings/ssh/config",e),axn=(e,n)=>qL("/api/settings/ssh/config",{content:e,previousContent:n}),oxn=(e,n)=>Mt(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),cxn=e=>Mt("/_orx/runtime",e),lxn=e=>Mt("/api/remote/sessions",e).then(n=>n.sessions),uxn=(e,n)=>wt("/api/remote/sessions",{host:e,uiPreferences:n}),_xn=e=>wt("/_orx/install",e),fxn=()=>wt("/_orx/reconnect"),QL=()=>wt("/_orx/disconnect"),dxn=()=>wt("/_orx/start-host"),XL=()=>Mt("/_orx/stop-host"),YL=e=>wt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),hxn=e=>Mt("/api/settings/slurm",e),pxn=e=>wt("/api/settings/slurm",e),mxn=e=>Mt("/api/settings/ray",e),gxn=e=>wt("/api/settings/ray",e),vxn=e=>wt("/api/settings/ray/preflight",{address:e??null}),bxn=(e,n)=>Mt(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),yxn=e=>wt("/api/settings/compute/default",e),xxn=e=>Mt("/api/settings/local",e),wxn=e=>Mt("/api/settings/openresearch",e),kxn=(e,n)=>Mt(`/api/projects/${e}/files`,n),Sxn=(e,n)=>ba(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>mi(t)),Cxn=(e,n,t)=>qu(`/api/projects/${e}/files`,{path:n,...t}),sf=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,ZL=512e3,Exn=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},Nxn=(e,n,t)=>fetch(sf(e,n),{signal:t,headers:{Range:`bytes=0-${ZL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>Exn(a,Number.isFinite(s)&&s>a.byteLength))}),zxn=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",jxn=(e,n,t)=>fetch(sf(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:zxn(s)?s:"download"}}),Txn=e=>Mt("/api/settings/profile",e),Axn=e=>Mt("/api/settings/lit-sources",e),Rxn=e=>wt("/api/settings/lit-sources",e),Mxn=e=>Mt("/api/settings/projects",e),JL=(e,n)=>wt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubDefaultPromptSeen:n}}),Oxn=(e,n)=>Mt(`/api/projects/${e}/git`,n),Dxn=e=>wt(`/api/projects/${e}/git/init`),Lxn=e=>wt(`/api/projects/${e}/github`),Ixn=e=>wt(`/api/projects/${e}/github/disable`),$xn=e=>Mt("/api/settings/telemetry",e),Bxn=e=>wt("/api/settings/telemetry",{enabled:e}),du=e=>{wt("/api/telemetry/event",e).catch(()=>{})},eI=e=>{wt("/api/telemetry/locale",{locale:e}).catch(()=>{})};function K1(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??C3(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?Xk():n,r=C3(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const Av="default";function Db(e,n){var a,o,c;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===Av)?Av:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((c=r[0])==null?void 0:c.id)??null;return{choices:r,defaultId:i}}const S3="default";function tI(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:S3,label:AEt(),description:SEt()},...t]:[]}function Rv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=tI(e,n);return s.length===0?S3:t!=null&&s.some(a=>a.id===t)?t:S3}function nI(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=Db(e,n);return r.length===0?Av:t&&r.some(i=>i.id===t)?t:s}const Pxn=e=>Mt("/api/harnesses/setup/commands",e),rI=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return Mt(`/api/harnesses${s}`,t).then(i=>i.harnesses)},Fxn=(e,n)=>Mt(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),Hxn=(e,n,t,r)=>Mt(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),qxn=e=>Mt("/api/latex-templates",e).then(n=>n.templates),Uxn=e=>wt("/api/latex-templates",e).then(n=>n.template),Gxn=e=>ba(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>mi(n)),Vxn=e=>Mt("/api/user-skills",e),Kxn=e=>wt("/api/user-skills",e).then(n=>n.skill),Wxn=e=>ba(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>mi(n));function C3(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const Qxn=(e,n)=>Mt(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),Xxn=e=>Mt("/api/chat/native-sessions",e).then(n=>n.chats),Yxn=(e,n)=>wt("/api/chat/native-sessions/import",{projectId:e,harness:n.harness,nativeId:n.nativeId,title:n.title}).then(t=>t.session),Zxn=e=>Mt("/api/chat/sessions?scope=all",e).then(n=>n.sessions),Jxn=(e,n,t={})=>wt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),e2n=e=>ba(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>mi(n).then(t=>(Tb(e),t))),t2n=(e,n)=>qu(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),n2n=(e,n)=>qu(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),r2n=(e,n)=>qu(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),s2n=(e,n)=>qu(`/api/chat/sessions/${e}`,{goal:n}).then(t=>t.session),i2n=(e,n)=>qu(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),a2n=(e,n)=>Mt(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),o2n=(e,n)=>ba(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>mi(t)),c2n=(e,n)=>wt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),l2n=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,qz=(e,n,t={},r,s,i,a)=>wt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),u2n=e=>wt(`/api/chat/sessions/${e}/compact`,{}),_2n=(e,n)=>wt(`/api/chat/sessions/${e}/shell`,{command:n}),f2n=(e,n,t,r={})=>wt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),d2n=(e,n,t)=>wt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),h2n=(e,n)=>wt(`/api/chat/sessions/${e}/branch`,{leafId:n}),p2n=e=>wt(`/api/chat/sessions/${e}/interrupt`),m2n=(e,n)=>wt(`/api/chat/sessions/${e}/respond`,n);function wo(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(N(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function R0(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return jOe({value:tn(n)});const t=Math.floor(n/60);if(t<60)return wOe({value:tn(t)});const r=Math.floor(t/60);return r<24?pOe({hours:tn(r),minutes:tn(t%60)}):cOe({days:tn(Math.floor(r/24)),hours:tn(r%24)})}function nl(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rMt("/api/local-models",e),b2n=e=>wt("/api/local-models/discover",e),y2n=e=>wt("/api/local-models",e),x2n=e=>wt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),w2n=e=>ba(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>mi(n)),Uz=()=>({queryKey:Tt("getHfSettings"),queryFn:({signal:e})=>Iyn(e),staleTime:3e5}),Gz=()=>({queryKey:Tt("getTinkerSettings"),queryFn:({signal:e})=>Byn(e),staleTime:3e5}),Vz=()=>({queryKey:Tt("getK8sSettings"),queryFn:({signal:e})=>Vyn(e),staleTime:3e4}),Kz=()=>({queryKey:Tt("getModalSettings"),queryFn:({signal:e})=>Wyn(e),staleTime:3e5}),k2n=()=>({queryKey:Tt("getSlurmSettings"),queryFn:({signal:e})=>hxn(e),staleTime:3e5}),S2n=()=>({queryKey:Tt("getRaySettings"),queryFn:({signal:e})=>mxn(e),staleTime:3e5}),sI=e=>({queryKey:Tt("getComputeSettings",e??null),queryFn:({signal:n})=>bxn(e,n),staleTime:3e4}),C2n=()=>({queryKey:Tt("getLocalMachine"),queryFn:({signal:e})=>xxn(e),staleTime:3e5}),E2n=()=>({queryKey:Tt("getOpenResearchSettings"),queryFn:({signal:e})=>wxn(e),staleTime:3e4}),N2n=()=>({queryKey:Tt("getEnvVars"),queryFn:({signal:e})=>Xyn(e),staleTime:3e5}),z2n=()=>({queryKey:Tt("getDataDir"),queryFn:({signal:e})=>Zyn(e),staleTime:3e5}),iI=()=>({queryKey:Tt("getSshSettings"),queryFn:({signal:e})=>txn(e),staleTime:3e4}),j2n=()=>({queryKey:Tt("getSshConfig"),queryFn:({signal:e})=>ixn(e),staleTime:3e5}),Wz=e=>({queryKey:Tt("getSshMasterStatus",e),queryFn:({signal:n})=>oxn(e,n),staleTime:5e3}),T2n=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>cxn(e),staleTime:2e3}),A2n=()=>({queryKey:Tt("listRemoteSessions"),queryFn:({signal:e})=>lxn(e),staleTime:3e4}),Mv=()=>({queryKey:Tt("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>Dh(n,t,()=>Fyn(e)),staleTime:3e4}),R2n=()=>({queryKey:Tt("getProfile"),queryFn:({signal:e})=>Txn(e),staleTime:3e5}),M2n=()=>({queryKey:Tt("getLitSources"),queryFn:({signal:e})=>Axn(e),staleTime:3e5}),cS=()=>({queryKey:Tt("getProjectDefaults"),queryFn:({signal:e})=>Mxn(e),staleTime:3e5}),O2n=e=>({queryKey:Tt("getProjectGitStatus",e),queryFn:({signal:n})=>Oxn(e,n),staleTime:3e4}),D2n=()=>({queryKey:Tt("getTelemetry"),queryFn:({signal:e})=>$xn(e),staleTime:3e5}),aI=()=>({queryKey:Tt("getHarnessSetupCommands"),queryFn:({signal:e})=>Pxn(e),staleTime:1/0}),Mu=()=>({queryKey:Tt("getHarnesses"),queryFn:({signal:e})=>rI(!1,!1,e),staleTime:3e5,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.some(t=>t.accountLoading||t.catalogPending)?1e3:!1}}),L2n=e=>({queryKey:Tt("getSkills",e??null),queryFn:({signal:n})=>Fxn(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),I2n=(e,n,t)=>({queryKey:Tt("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>Hxn(e,n,r,t),staleTime:3e5}),$2n=()=>({queryKey:Tt("listLatexTemplates"),queryFn:({signal:e})=>qxn(e),refetchInterval:3e4,staleTime:3e5}),B2n=()=>({queryKey:Tt("listUserSkills"),queryFn:({signal:e})=>Vxn(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function af(e=!1,n=!1){const t=Mu();if(!e&&!n)return Je.fetchQuery(t);await Je.cancelQueries(t);const r=await rI(e,n);return Fn(t.queryKey)&&Je.setQueryData(t.queryKey,r),r}const P2n=()=>({queryKey:Tt("getLocalModels"),queryFn:({signal:e})=>v2n(e),staleTime:3e4}),Ga=e=>({queryKey:Tt("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>Dh(t,r,async()=>{const s=await Qxn(e,n),i=t.getQueryData(r);return s.filter(a=>!_l.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(c=>c.id===a.id))==null?void 0:o.contextUsage)}})},wm),staleTime:3e4}),oI=()=>({queryKey:Tt("listNativeChats"),queryFn:({signal:e})=>Xxn(e),staleTime:0}),F2n=()=>({queryKey:Tt("listAllChatSessions"),queryFn:async({signal:e})=>(await Zxn(e)).filter(n=>!_l.has(n.id)),staleTime:0}),ol=e=>({queryKey:Tt("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var h;const s=t.getQueryData(r),i=await Dh(t,r,()=>a2n(e,n),(_,p,m)=>{if(!p)return _;const w=new Set([...m].filter(k=>k.startsWith("message:")).map(k=>k.slice(8)));return{messages:wm(_.messages,p.messages,w,!1),queued:m.has("queued")?p.queued:_.queued,activeLeafId:m.has("branch")||w.size?p.activeLeafId:_.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),c=s!==void 0&&i.messages.some(_=>_.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===_.id)))?[]:(a==null?void 0:a.messages.filter(_=>_.id.startsWith("local-")))??[],u=c.some(_=>_.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...c.filter(_=>!i.messages.some(p=>p.id===_.id))],activeLeafId:a&&(u||!((h=a.activeLeafId)!=null&&h.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),W_="local-",cI="bash";function Qz(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(W_)),n]}function H2n(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(W_),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:Qz(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${W_}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:cI,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?Qz(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${W_}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let lI=0;function uI(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}Je.getQueryCache().subscribe(e=>{uI(e)&&lI++});const q2n=e=>Je.getQueryCache().subscribe(n=>{uI(n)&&e()}),U2n=()=>lI;function G2n(e,n){const t=Je.getQueryData(Ga(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=Je.getQueryData(ol(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function _I(e,n,t=!1){if(n.type==="busy"){_o(Je,Ga(e).queryKey,n.sessionId),Je.setQueryData(Ga(e).queryKey,c=>c==null?void 0:c.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=ol(n.sessionId);if(_l.has(n.sessionId))return;_o(Je,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=Je.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=H2n(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};Je.setQueryData(r.queryKey,o)}function V2n(e,n){const t=!!n&&!_l.has(n??""),r=ut({...ol(n??""),enabled:t,subscribed:t}),s=A.useSyncExternalStore(q2n,U2n),i=A.useMemo(()=>G2n(e,n),[e,n,s]),a=Va()[1],o=A.useCallback(c=>{Fn(["workspace",a])&&_I(e,c)},[e,a]);return[i,o,r]}const W1=new Map;function K2n(e,n){let t=W1.get(e);return t||(t=new Set,W1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&W1.delete(e)}}function W2n(e){var n;(n=W1.get(e.runId))==null||n.forEach(t=>t(e))}const E3=new Set;function Ov(e){return E3.add(e),()=>{E3.delete(e)}}function Bc(e){E3.forEach(n=>n(e))}const N3=new Set;function Q2n(e){return N3.add(e),()=>{N3.delete(e)}}function Pc(){N3.forEach(e=>e())}const z3=new Set;function X2n(e){return z3.add(e),()=>{z3.delete(e)}}const j3=new Set;function Y2n(e){return j3.add(e),()=>{j3.delete(e)}}function Z2n(){j3.forEach(e=>e())}function Xz(e){z3.forEach(n=>n(e))}const T3=new Set;function fI(e){return T3.add(e),()=>{T3.delete(e)}}function aw(e){T3.forEach(n=>n(e))}const A3=new Set;function J2n(e){return A3.add(e),()=>{A3.delete(e)}}function Yz(e){A3.forEach(n=>n(e))}const R3=new Set;function ewn(e){return R3.add(e),()=>{R3.delete(e)}}function twn(e){R3.forEach(n=>n(e))}let M3=!0;const O3=new Set;function nwn(e){return O3.add(e),()=>{O3.delete(e)}}function Zz(){return M3}function Jz(e){e!==M3&&(M3=e,O3.forEach(n=>n()))}const rwn=8e3,swn=3e3;function iwn(e){const n=A.useRef(e);n.current=e,A.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const c=new EventSource("/api/events");t=c,c.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>Jz(!1),rwn)),c.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},swn)))},c.onopen=()=>{var h,_;r||(window.clearTimeout(s),s=void 0,Jz(!0),a&&(Bc({type:"reconnected"}),Pc(),Xz({harness:"*",authState:"unknown"}),(_=(h=n.current).onReconnect)==null||_.call(h)),a=!0)};const u=h=>{try{return JSON.parse(h.data)}catch{return null}};c.addEventListener("resync.required",()=>{var h,_;Bc({type:"reconnected"}),Pc(),(_=(h=n.current).onReconnect)==null||_.call(h)}),c.addEventListener("run.updated",h=>{const _=u(h);_!=null&&_.run&&(Pc(),n.current.onRun(_.run))}),c.addEventListener("experiment.updated",h=>{var p,m;const _=u(h);_!=null&&_.experiment&&(Pc(),(m=(p=n.current).onExperiment)==null||m.call(p,_.experiment))}),c.addEventListener("project.updated",h=>{var p,m;const _=u(h);_!=null&&_.project&&(Pc(),(m=(p=n.current).onProject)==null||m.call(p,_.project))}),c.addEventListener("files.updated",h=>{var p,m;const _=u(h);_!=null&&_.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,_.projectId))}),c.addEventListener("run.log",h=>{const _=u(h);_!=null&&_.runId&&W2n(_)}),c.addEventListener("chat.session",h=>{const _=u(h);_!=null&&_.session&&(Pc(),Bc({type:"session",session:_.session}))}),c.addEventListener("chat.session.deleted",h=>{const _=u(h);_!=null&&_.sessionId&&(Pc(),Bc({type:"sessionDeleted",sessionId:_.sessionId}))}),c.addEventListener("chat.message",h=>{const _=u(h);_!=null&&_.message&&(Pc(),Bc({type:"message",sessionId:_.sessionId,message:_.message}))}),c.addEventListener("chat.busy",h=>{const _=u(h);_!=null&&_.sessionId&&(Pc(),Bc({type:"busy",sessionId:_.sessionId,busy:_.busy}))}),c.addEventListener("chat.usage",h=>{const _=u(h);_!=null&&_.sessionId&&_.usage&&Bc({type:"usage",sessionId:_.sessionId,usage:_.usage})}),c.addEventListener("chat.queued",h=>{const _=u(h);_!=null&&_.sessionId&&Bc({type:"queued",sessionId:_.sessionId,items:_.items??[]})}),c.addEventListener("chat.branch",h=>{const _=u(h);_!=null&&_.sessionId&&Bc({type:"branch",sessionId:_.sessionId,activeLeafId:_.activeLeafId??null})}),c.addEventListener("harness.auth",h=>{const _=u(h);_!=null&&_.harness&&_.authState&&Xz(_)}),c.addEventListener("harness.catalog",()=>Z2n()),c.addEventListener("datadir.move.progress",h=>{const _=u(h);_&&aw({type:"progress",..._})}),c.addEventListener("datadir.move.done",h=>{const _=u(h);_&&aw({type:"done",path:_.path,oldPathLeft:_.oldPathLeft})}),c.addEventListener("datadir.move.error",h=>{const _=u(h);_&&aw({type:"error",error:_.error})}),c.addEventListener("update.status",h=>{const _=u(h);_&&twn(_)}),c.addEventListener("overleaf.live",h=>{const _=u(h);_!=null&&_.key&&_.status&&Yz({type:"live",key:_.key,status:_.status})}),c.addEventListener("overleaf.pulled",h=>{const _=u(h);_!=null&&_.key&&Array.isArray(_.paths)&&Yz({type:"pulled",key:_.key,paths:_.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const Dv=new Set;function awn(e){const n=A.useRef(e);n.current=e,A.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return Dv.add(t),()=>{Dv.delete(t)}},[])}const ej={onRun:e=>Dv.forEach(n=>n.onRun(e)),onReconnect:()=>Dv.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},hh=()=>({queryKey:Tt("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>Dh(n,t,()=>qbn(e),wm),staleTime:3e4}),own=()=>({queryKey:Tt("listProjectActivity"),queryFn:({signal:e})=>Ubn(e),staleTime:3e4}),Em=()=>({queryKey:Tt("getUiState"),queryFn:({signal:e})=>Gbn(e),staleTime:3e5}),lS=e=>({queryKey:Tt("getProjectUiState",e),queryFn:({signal:n})=>Vbn(e,n),staleTime:3e5}),h0=(e="")=>({queryKey:Tt("getProjectPathStatus",e),queryFn:({signal:n})=>Ybn(e,n),staleTime:3e4}),dI=e=>({queryKey:Tt("searchPapers",e),queryFn:({signal:n})=>eyn(e,n),staleTime:3e5}),cwn=()=>({queryKey:Tt("githubAccount"),queryFn:({signal:e})=>tyn(e),staleTime:3e5}),lwn=e=>({queryKey:Tt("githubProjectRepoPreview",e),queryFn:({signal:n})=>nyn(e,n),staleTime:3e4}),tj=(e,n)=>({queryKey:Tt("repoAccess",e,n),queryFn:({signal:t})=>ryn(e,n,t),staleTime:3e4}),D3=e=>({queryKey:Tt("resolvePaper",e),queryFn:({signal:n})=>syn(e,n),staleTime:36e5}),uwn=(e,n,t,r)=>({queryKey:Tt("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>ayn(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),Lv=e=>({queryKey:Tt("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>Dh(t,r,()=>lyn(e,n),wm),staleTime:3e4}),Eu=e=>({queryKey:Tt("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>Dh(t,r,()=>_yn(e,n),wm),staleTime:3e4});function t1(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function nj(){const e=Va();return iwn({onRun(n){var r;if(!Fn(e))return;const t=(r=Je.getQueryData(Eu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);_o(Je,Eu(n.projectId).queryKey,n.id),Je.setQueryData(Eu(n.projectId).queryKey,s=>t1(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(Ba(["getRunDiff"],e,s=>s.queryKey[3]===n.id),Ba(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),ej.onRun(n)},onExperiment(n){Fn(e)&&(_o(Je,Lv(n.projectId).queryKey,n.id),Je.setQueryData(Lv(n.projectId).queryKey,t=>t1(t,n)),Ba(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),Ba(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),Ba(["getRunDiff"],e,t=>{var r;return((r=Je.getQueryData(Eu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Fn(e)&&(_o(Je,hh().queryKey,n.id),Je.setQueryData(hh().queryKey,t=>t1(t,n)))},onArtifacts(n){Fn(e)&&(Ba(Hk,e,t=>t.queryKey[3]===n),Ba(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Fn(e)&&(Ba(hQ,e),ej.onReconnect())}}),A.useEffect(()=>{let n;const t=Q2n(()=>{n??(n=setTimeout(()=>{n=void 0,Ba(["listProjectActivity"],e)},100))}),r=fI(c=>{c.type==="done"&&Ba(["getDataDir"],e)}),s=Ov(c=>{Fn(e)&&(c.type==="session"?_o(Je,Ga(c.session.projectId).queryKey,c.session.id):(c.type==="busy"||c.type==="usage")&&_o(Je,[...e,"listChatSessions"],c.sessionId),(c.type==="message"||c.type==="queued"||c.type==="branch")&&_I("",c.type==="message"?{type:"upsertMessage",sessionId:c.sessionId,message:c.message}:c.type==="queued"?{type:"setQueued",sessionId:c.sessionId,items:c.items}:{type:"activeLeaf",sessionId:c.sessionId,leafId:c.activeLeafId},!0),c.type==="session"&&!_l.has(c.session.id)?Je.setQueryData(Ga(c.session.projectId).queryKey,u=>{if(!u)return;const h=u.find(_=>_.id===c.session.id);return h?t1(u,{...c.session,contextUsage:c.session.contextUsage??h.contextUsage}):[c.session,...u]}):c.type==="sessionDeleted"?Tb(c.sessionId):(c.type==="busy"||c.type==="usage")&&Je.setQueriesData({queryKey:[...e,"listChatSessions"]},u=>u==null?void 0:u.map(h=>h.id!==c.sessionId?h:c.type==="busy"?{...h,busy:c.busy}:{...h,contextUsage:c.usage})))}),i=X2n(()=>{Fn(e)&&af(!0).catch(()=>{})}),a=Y2n(()=>{Fn(e)&&Je.fetchQuery({...Mu(),staleTime:0}).catch(()=>{})}),o=ewn(c=>{Fn(e)&&(_o(Je,Mv().queryKey),Je.setQueryData(Mv().queryKey,c))});return()=>{clearTimeout(n),t(),r(),s(),i(),a(),o()}},[e[1]]),null}const L3=new Set;function hI(e){if(e!==N()){pD(e,{reload:!1}),document.documentElement.lang=e,eI(e);for(const n of L3)n()}}function _wn(e){return L3.add(e),()=>L3.delete(e)}function wf(){return A.useSyncExternalStore(_wn,N,N)}const pI="orx:theme";function fwn(){try{const e=localStorage.getItem(pI);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let ph=fwn();const I3=new Set;function dwn(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function uS(){document.documentElement.dataset.theme=dwn(ph)}function mI(e){ph=e;try{localStorage.setItem(pI,e)}catch{}uS();for(const n of I3)n()}function hwn(){return ph}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{ph==="system"&&uS()});uS();function pwn(e){return I3.add(e),()=>I3.delete(e)}function gI(){return[A.useSyncExternalStore(pwn,()=>ph,()=>ph),mI]}const mwn=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),vI=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),Iv="-",rj=[],vwn="arbitrary..",bwn=e=>{const n=xwn(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return ywn(a);const o=a.split(Iv),c=o[0]===""&&o.length>1?1:0;return bI(o,c,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const c=r[a],u=t[a];return c?u?mwn(u,c):c:u||rj}return t[a]||rj}}},bI=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=bI(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(Iv):e.slice(n).join(Iv),c=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?vwn+r:void 0})(),xwn=e=>{const{theme:n,classGroups:t}=e;return wwn(t,n)},wwn=(e,n)=>{const t=vI();for(const r in e){const s=e[r];_S(s,t,r,n)}return t},_S=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){Swn(e,n,t);return}if(typeof e=="function"){Cwn(e,n,t,r);return}Ewn(e,n,t,r)},Swn=(e,n,t)=>{const r=e===""?n:yI(n,e);r.classGroupId=t},Cwn=(e,n,t,r)=>{if(Nwn(e)){_S(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(gwn(t,e))},Ewn=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(Iv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,zwn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},$3="!",sj=":",jwn=[],ij=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),Twn=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,c=0,u;const h=s.length;for(let k=0;kc?u-c:void 0;return ij(i,m,p,w)};if(n){const s=n+sj,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):ij(jwn,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},Awn=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},Rwn=e=>({cache:zwn(e.cacheSize),parseClassName:Twn(e),sortModifiers:Awn(e),postfixLookupClassGroupIds:Mwn(e),...bwn(e)}),Mwn=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],c=e.trim().split(Own);let u="";for(let h=c.length-1;h>=0;h-=1){const _=c[h],{isExternal:p,modifiers:m,hasImportantModifier:w,baseClassName:k,maybePostfixModifierPosition:v}=t(_);if(p){u=_+(u.length>0?" "+u:u);continue}let b=!!v,x;if(b){const T=k.substring(0,v);x=r(T);const j=x&&a[x]?r(k):void 0;j&&j!==x&&(x=j,b=!1)}else x=r(k);if(!x){if(!b){u=_+(u.length>0?" "+u:u);continue}if(x=r(k),!x){u=_+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=w?y+$3:y,z=C+x;if(o.indexOf(z)>-1)continue;o.push(z);const E=s(x,b);for(let T=0;T0?" "+u:u)}return u},Lwn=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=c=>{const u=n.reduce((h,_)=>_(h),e());return t=Rwn(u),r=t.cache.get,s=t.cache.set,i=o,o(c)},o=c=>{const u=r(c);if(u)return u;const h=Dwn(c,t);return s(c,h),h};return i=a,(...c)=>i(Lwn(...c))},Iwn=[],gs=e=>{const n=t=>t[e]||Iwn;return n.isThemeGetter=!0,n},wI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$wn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Bwn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Pwn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fwn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Hwn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qwn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,iu=e=>$wn.test(e),pn=e=>!!e&&!Number.isNaN(Number(e)),Lo=e=>!!e&&Number.isInteger(Number(e)),ow=e=>e.endsWith("%")&&pn(e.slice(0,-1)),Fc=e=>Bwn.test(e),SI=()=>!0,Uwn=e=>Pwn.test(e)&&!Fwn.test(e),fS=()=>!1,Gwn=e=>Hwn.test(e),Vwn=e=>qwn.test(e),Kwn=e=>!bt(e)&&!xt(e),Wwn=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Qwn=e=>Gu(e,NI,fS),bt=e=>wI.test(e),v_=e=>Gu(e,zI,Uwn),oj=e=>Gu(e,r4n,pn),Xwn=e=>Gu(e,TI,SI),Ywn=e=>Gu(e,jI,fS),cj=e=>Gu(e,CI,fS),Zwn=e=>Gu(e,EI,Vwn),n1=e=>Gu(e,AI,Gwn),xt=e=>kI.test(e),Hp=e=>kf(e,zI),Jwn=e=>kf(e,jI),lj=e=>kf(e,CI),e4n=e=>kf(e,NI),t4n=e=>kf(e,EI),r1=e=>kf(e,AI,!0),n4n=e=>kf(e,TI,!0),Gu=(e,n,t)=>{const r=wI.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},kf=(e,n,t=!1)=>{const r=kI.exec(e);return r?r[1]?n(r[1]):t:!1},CI=e=>e==="position"||e==="percentage",EI=e=>e==="image"||e==="url",NI=e=>e==="length"||e==="size"||e==="bg-size",zI=e=>e==="length",r4n=e=>e==="number",jI=e=>e==="family-name",TI=e=>e==="number"||e==="weight",AI=e=>e==="shadow",uj=()=>{const e=gs("color"),n=gs("font"),t=gs("text"),r=gs("font-weight"),s=gs("tracking"),i=gs("leading"),a=gs("breakpoint"),o=gs("container"),c=gs("spacing"),u=gs("radius"),h=gs("shadow"),_=gs("inset-shadow"),p=gs("text-shadow"),m=gs("drop-shadow"),w=gs("blur"),k=gs("perspective"),v=gs("aspect"),b=gs("ease"),x=gs("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[...C(),xt,bt],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[xt,bt,c],M=()=>[iu,"full","auto",...j()],D=()=>[Lo,"none","subgrid",xt,bt],I=()=>["auto",{span:["full",Lo,xt,bt]},Lo,xt,bt],$=()=>[Lo,"auto",xt,bt],q=()=>["auto","min","max","fr",xt,bt],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...j()],Z=()=>[iu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],Y=()=>[iu,"screen","full","dvw","lvw","svw","min","max","fit",...j()],B=()=>[iu,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,xt,bt],F=()=>[...C(),lj,cj,{position:[xt,bt]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],K=()=>["auto","cover","contain",e4n,Qwn,{size:[xt,bt]}],ne=()=>[ow,Hp,v_],oe=()=>["","none","full",u,xt,bt],ue=()=>["",pn,Hp,v_],se=()=>["solid","dashed","dotted","double"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[pn,ow,lj,cj],ce=()=>["","none",w,xt,bt],pe=()=>["none",pn,xt,bt],be=()=>["none",pn,xt,bt],Ae=()=>[pn,xt,bt],De=()=>[iu,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fc],breakpoint:[Fc],color:[SI],container:[Fc],"drop-shadow":[Fc],ease:["in","out","in-out"],font:[Kwn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fc],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fc],shadow:[Fc],spacing:["px",pn],text:[Fc],"text-shadow":[Fc],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",iu,bt,xt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",xt,bt]}],"container-named":[Wwn],columns:[{columns:[pn,bt,xt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:z()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[Lo,"auto",xt,bt]}],basis:[{basis:[iu,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pn,iu,"auto","initial","none",bt]}],grow:[{grow:["",pn,xt,bt]}],shrink:[{shrink:["",pn,xt,bt]}],order:[{order:[Lo,"first","last","none",xt,bt]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...B()]}],"min-block-size":[{"min-block":["auto",...B()]}],"max-block-size":[{"max-block":["none",...B()]}],w:[{w:[o,"screen",...Z()]}],"min-w":[{"min-w":[o,"screen","none",...Z()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",t,Hp,v_]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,n4n,Xwn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ow,bt]}],"font-family":[{font:[Jwn,Ywn,n]}],"font-features":[{"font-features":[bt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,xt,bt]}],"line-clamp":[{"line-clamp":[pn,"none",xt,oj]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",xt,bt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xt,bt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[pn,"from-font","auto",xt,v_]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[pn,"auto",xt,bt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[Lo,xt,bt]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xt,bt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xt,bt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:K()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Lo,xt,bt],radial:["",xt,bt],conic:[Lo,xt,bt]},t4n,Zwn]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pn,xt,bt]}],"outline-w":[{outline:["",pn,Hp,v_]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",h,r1,n1]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",_,r1,n1]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[pn,v_]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,r1,n1]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[pn,xt,bt]}],"mix-blend":[{"mix-blend":[...G(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":G()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[pn]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[xt,bt]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[pn]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:K()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xt,bt]}],filter:[{filter:["","none",xt,bt]}],blur:[{blur:ce()}],brightness:[{brightness:[pn,xt,bt]}],contrast:[{contrast:[pn,xt,bt]}],"drop-shadow":[{"drop-shadow":["","none",m,r1,n1]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",pn,xt,bt]}],"hue-rotate":[{"hue-rotate":[pn,xt,bt]}],invert:[{invert:["",pn,xt,bt]}],saturate:[{saturate:[pn,xt,bt]}],sepia:[{sepia:["",pn,xt,bt]}],"backdrop-filter":[{"backdrop-filter":["","none",xt,bt]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[pn,xt,bt]}],"backdrop-contrast":[{"backdrop-contrast":[pn,xt,bt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pn,xt,bt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pn,xt,bt]}],"backdrop-invert":[{"backdrop-invert":["",pn,xt,bt]}],"backdrop-opacity":[{"backdrop-opacity":[pn,xt,bt]}],"backdrop-saturate":[{"backdrop-saturate":[pn,xt,bt]}],"backdrop-sepia":[{"backdrop-sepia":["",pn,xt,bt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xt,bt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pn,"initial",xt,bt]}],ease:[{ease:["linear","initial",b,xt,bt]}],delay:[{delay:[pn,xt,bt]}],animate:[{animate:["none",x,xt,bt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,xt,bt]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:Ae()}],"skew-x":[{"skew-x":Ae()}],"skew-y":[{"skew-y":Ae()}],transform:[{transform:[xt,bt,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:De()}],"translate-x":[{"translate-x":De()}],"translate-y":[{"translate-y":De()}],"translate-z":[{"translate-z":De()}],"translate-none":["translate-none"],zoom:[{zoom:[Lo,xt,bt]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xt,bt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xt,bt]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[pn,Hp,v_,oj]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},s4n=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(wd(e,"cacheSize",n),wd(e,"prefix",t),wd(e,"experimentalParseClassName",r),s1(e.theme,i.theme),s1(e.classGroups,i.classGroups),s1(e.conflictingClassGroups,i.conflictingClassGroups),s1(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),wd(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),wd(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),i1(e.theme,s.theme),i1(e.classGroups,s.classGroups),i1(e.conflictingClassGroups,s.conflictingClassGroups),i1(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),B3(e,s,"postfixLookupClassGroups"),B3(e,s,"orderSensitiveModifiers"),e),wd=(e,n,t)=>{t!==void 0&&(e[n]=t)},s1=(e,n)=>{if(n)for(const t in n)wd(e,t,n[t])},i1=(e,n)=>{if(n)for(const t in n)B3(e,n,t)},B3=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},i4n=(e,...n)=>typeof e=="function"?aj(uj,e,...n):aj(()=>s4n(uj(),e),...n),a4n=i4n({extend:{theme:{text:["menu"]}}});function ys(...e){return a4n(...e)}const o4n={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Wt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:ys("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",o4n[e],t),...r})}const c4n=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),l4n={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},u4n={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function RI(e,n,t,r){return ys(c4n,l4n[e],u4n[n],t&&"active",r)}function Oe({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:RI(n,t,e,r),...s})}function mh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:RI(n,t,e,r),...s})}const _4n=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),f4n={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},d4n={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function MI(e,n,t,r,s){return ys(_4n,f4n[e],d4n[n],r==="circle"&&"rounded-full",t&&"active",s)}const Ft=A.forwardRef(function({active:n=!1,shape:t="rounded",size:r="default",variant:s="default",className:i,...a},o){return f.jsx("button",{ref:o,className:MI(s,r,n,t,i),...a})});function Ih({active:e=!1,shape:n="rounded",size:t="default",variant:r="default",className:s,...i}){return f.jsx("a",{className:MI(r,t,e,n,s),...i})}const h4n={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Ur({variant:e="default",className:n,...t}){return f.jsx("input",{className:ys("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",h4n[e],n),...t})}function Dn({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:ys("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function jt({className:e,...n}){return f.jsx("span",{className:ys("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function Vr({className:e,...n}){return f.jsx("div",{className:ys("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const p4n={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function $d({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:ys("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:ys("h-[7px] w-[7px] shrink-0 rounded-full bg-current",p4n[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const m4n=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function OI(e,n){return ys(m4n,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function dS({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:OI(e,n),...r,children:t??f.jsx("span",{})})}function g4n({checked:e=!1,className:n,...t}){return f.jsx("span",{className:OI(e,n),...t,children:f.jsx("span",{})})}var Fi=RO();const v4n=bm(Fi);function b4n(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const y4n=e=>{switch(e){case"success":return k4n;case"info":return C4n;case"warning":return S4n;case"error":return E4n;default:return null}},x4n=Array(12).fill(0),w4n=({visible:e,className:n})=>et.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},et.createElement("div",{className:"sonner-spinner"},x4n.map((t,r)=>et.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),k4n=et.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},et.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),S4n=et.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},et.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),C4n=et.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},et.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),E4n=et.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},et.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),N4n=et.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},et.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),et.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),z4n=()=>{const[e,n]=et.useState(document.hidden);return et.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let j4n=1;const T4n=100,_j=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:j4n++};class A4n{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-T4n;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=_j(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],et.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(M4n(u)&&!u.ok){i=!1;const _=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,w=typeof _=="object"&&!et.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:p,...w})}else if(u instanceof Error){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,w=typeof _=="object"&&!et.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:p,...w})}else if(t.success!==void 0){i=!1;const _=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,w=typeof _=="object"&&!et.isValidElement(_)?_:{message:_};this.create({id:r,type:"success",description:p,...w})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const h=typeof t.error=="function"?await t.error(u):t.error,_=typeof t.description=="function"?await t.description(u):t.description,m=typeof h=="object"&&!et.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:_,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((u,h)=>o.then(()=>a[0]==="reject"?h(a[1]):u(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(n,t)=>{const r=_j(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Li=new A4n,R4n=(e,n)=>Li.message(e,n),M4n=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",O4n=R4n,D4n=()=>Li.toasts,L4n=()=>Li.getActiveToasts(),I4n=Object.assign(O4n,{success:Li.success,info:Li.info,warning:Li.warning,error:Li.error,custom:Li.custom,message:Li.message,promise:Li.promise,dismiss:Li.dismiss,loading:Li.loading},{getHistory:D4n,getToasts:L4n});b4n("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function a1(e){return e.label!==void 0}const $4n=3,B4n="24px",P4n="16px",fj=4e3,F4n=356,H4n=14,q4n=45,U4n=200;function Io(...e){return e.filter(Boolean).join(" ")}function G4n(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const V4n=e=>{var n,t,r,s,i,a,o,c,u;const{invert:h,toast:_,unstyled:p,interacting:m,setHeights:w,visibleToasts:k,heights:v,index:b,toasts:x,expanded:y,removeToast:C,defaultRichColors:z,closeButton:E,style:T,cancelButtonStyle:j,actionButtonStyle:M,className:D="",descriptionClassName:I="",duration:$,position:q,gap:H,expandByDefault:Q,classNames:V,icons:Z,closeButtonAriaLabel:Y="Close toast"}=e,[B,L]=et.useState(null),[F,U]=et.useState(null),[K,ne]=et.useState(!1),[oe,ue]=et.useState(!1),[se,G]=et.useState(!1),[ae,ce]=et.useState(!1),[pe,be]=et.useState(!1),[Ae,De]=et.useState(0),[We,Ne]=et.useState(0),xe=et.useRef(_.duration||$||fj),rt=et.useRef(null),Ze=et.useRef(null),ct=b===0,Ct=b+1<=k,qt=_.type,dt=qt??"default",ht=_.dismissible!==!1,Le=_.className||"",me=_.descriptionClassName||"",Te=et.useMemo(()=>v.findIndex(Et=>Et.toastId===_.id)||0,[v,_.id]),He=et.useMemo(()=>{var Et;return(Et=_.closeButton)!=null?Et:E},[_.closeButton,E]),nt=et.useMemo(()=>_.duration||$||fj,[_.duration,$]),_t=et.useRef(0),St=et.useRef(0),yt=et.useRef(0),Zt=et.useRef(null),[un,At]=q.split("-"),pt=et.useMemo(()=>v.reduce((Et,fn,an)=>an>=Te?Et:Et+fn.height,0),[v,Te]),mt=z4n(),_n=et.useMemo(()=>{var Et;return(Et=e.swipeDirections)!=null?Et:G4n(q)},[e.swipeDirections,q]),us=_.invert||h,xr=qt==="loading";St.current=et.useMemo(()=>Te*H+pt,[Te,pt]),et.useEffect(()=>{xe.current=nt},[nt]),et.useEffect(()=>{ne(!0)},[]),et.useEffect(()=>{const Et=Ze.current;if(Et){const fn=Et.getBoundingClientRect().height;return Ne(fn),w(an=>[{toastId:_.id,height:fn,position:_.position},...an]),()=>w(an=>an.filter(xn=>xn.toastId!==_.id))}},[w,_.id]),et.useLayoutEffect(()=>{if(!K)return;const Et=Ze.current,fn=Et.style.height;Et.style.height="auto";const an=Et.getBoundingClientRect().height;Et.style.height=fn,Ne(an),w(xn=>xn.find(mn=>mn.toastId===_.id)?xn.map(mn=>mn.toastId===_.id?{...mn,height:an}:mn):[{toastId:_.id,height:an,position:_.position},...xn])},[K,_.title,_.description,w,_.id,_.jsx,_.action,_.cancel]);const Qt=et.useCallback(()=>{ue(!0),De(St.current),w(Et=>Et.filter(fn=>fn.toastId!==_.id)),setTimeout(()=>{C(_)},U4n)},[_,C,w,St]);et.useEffect(()=>{if(_.promise&&qt==="loading"||_.duration===1/0||_.type==="loading")return;let Et;return y||m||mt?(()=>{if(yt.current<_t.current){const xn=new Date().getTime()-_t.current;xe.current=xe.current-xn}yt.current=new Date().getTime()})():(()=>{xe.current!==1/0&&(_t.current=new Date().getTime(),Et=setTimeout(()=>{_.onAutoClose==null||_.onAutoClose.call(_,_),Qt()},xe.current))})(),()=>clearTimeout(Et)},[y,m,_,qt,mt,Qt]),et.useEffect(()=>{_.delete&&(Qt(),_.onDismiss==null||_.onDismiss.call(_,_))},[Qt,_.delete]);function Mn(){var Et;if(Z!=null&&Z.loading){var fn;return et.createElement("div",{className:Io(V==null?void 0:V.loader,_==null||(fn=_.classNames)==null?void 0:fn.loader,"sonner-loader"),"data-visible":qt==="loading"},Z.loading)}return et.createElement(w4n,{className:Io(V==null?void 0:V.loader,_==null||(Et=_.classNames)==null?void 0:Et.loader),visible:qt==="loading"})}const mr=_.icon||(Z==null?void 0:Z[qt])||y4n(qt);var gr,_s;return et.createElement("li",{tabIndex:0,ref:Ze,className:Io(D,Le,V==null?void 0:V.toast,_==null||(n=_.classNames)==null?void 0:n.toast,V==null?void 0:V[dt],_==null||(t=_.classNames)==null?void 0:t[dt]),"data-sonner-toast":"","data-rich-colors":(gr=_.richColors)!=null?gr:z,"data-styled":!(_.jsx||_.unstyled||p),"data-mounted":K,"data-promise":!!_.promise,"data-swiped":pe,"data-removed":oe,"data-visible":Ct,"data-y-position":un,"data-x-position":At,"data-index":b,"data-front":ct,"data-swiping":se,"data-dismissible":ht,"data-type":qt,"data-invert":us,"data-swipe-out":ae,"data-swipe-direction":F,"data-expanded":!!(y||Q&&K),"data-testid":_.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${oe?Ae:St.current}px`,"--initial-height":Q?"auto":`${We}px`,...T,..._.style},onDragEnd:()=>{G(!1),L(null),Zt.current=null},onPointerDown:Et=>{Et.button!==2&&(xr||!ht||(rt.current=new Date,De(St.current),Et.target.setPointerCapture(Et.pointerId),Et.target.tagName!=="BUTTON"&&(G(!0),Zt.current={x:Et.clientX,y:Et.clientY})))},onPointerUp:()=>{var Et,fn,an;if(ae||!ht)return;Zt.current=null;const xn=Number(((Et=Ze.current)==null?void 0:Et.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ir=Number(((fn=Ze.current)==null?void 0:fn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mn=new Date().getTime()-((an=rt.current)==null?void 0:an.getTime()),gn=B==="x"?xn:Ir,Ln=Math.abs(gn)/mn;if((B==="x"?_n.includes(xn>0?"right":"left"):_n.includes(Ir>0?"bottom":"top"))&&(Math.abs(gn)>=q4n||Ln>.11)){De(St.current),_.onDismiss==null||_.onDismiss.call(_,_),U(B==="x"?xn>0?"right":"left":Ir>0?"down":"up"),Qt(),ce(!0);return}else{var Ot,Hn;(Ot=Ze.current)==null||Ot.style.setProperty("--swipe-amount-x","0px"),(Hn=Ze.current)==null||Hn.style.setProperty("--swipe-amount-y","0px")}be(!1),G(!1),L(null)},onPointerMove:Et=>{var fn,an,xn;if(!Zt.current||!ht||((fn=window.getSelection())==null?void 0:fn.toString().length)>0)return;const mn=Et.clientY-Zt.current.y,gn=Et.clientX-Zt.current.x;!B&&(Math.abs(gn)>1||Math.abs(mn)>1)&&L(Math.abs(gn)>Math.abs(mn)?"x":"y");let Ln={x:0,y:0};const Nt=Ot=>1/(1.5+Math.abs(Ot)/20);if(B==="y"){if(_n.includes("top")||_n.includes("bottom"))if(_n.includes("top")&&mn<0||_n.includes("bottom")&&mn>0)Ln.y=mn;else{const Ot=mn*Nt(mn);Ln.y=Math.abs(Ot)0)Ln.x=gn;else{const Ot=gn*Nt(gn);Ln.x=Math.abs(Ot)0||Math.abs(Ln.y)>0)&&be(!0),(an=Ze.current)==null||an.style.setProperty("--swipe-amount-x",`${Ln.x}px`),(xn=Ze.current)==null||xn.style.setProperty("--swipe-amount-y",`${Ln.y}px`)}},He&&!_.jsx&&qt!=="loading"?et.createElement("button",{"aria-label":Y,"data-disabled":xr,"data-close-button":!0,onClick:xr||!ht?()=>{}:()=>{Qt(),_.onDismiss==null||_.onDismiss.call(_,_)},className:Io(V==null?void 0:V.closeButton,_==null||(r=_.classNames)==null?void 0:r.closeButton)},(_s=Z==null?void 0:Z.close)!=null?_s:N4n):null,(qt||_.icon||_.promise)&&_.icon!==null&&((Z==null?void 0:Z[qt])!==null||_.icon)?et.createElement("div",{"data-icon":"",className:Io(V==null?void 0:V.icon,_==null||(s=_.classNames)==null?void 0:s.icon)},qt==="loading"?_.icon||Mn():_.promise?Mn():null,qt!=="loading"?mr:null):null,et.createElement("div",{"data-content":"",className:Io(V==null?void 0:V.content,_==null||(i=_.classNames)==null?void 0:i.content)},et.createElement("div",{"data-title":"",className:Io(V==null?void 0:V.title,_==null||(a=_.classNames)==null?void 0:a.title)},_.jsx?_.jsx:typeof _.title=="function"?_.title():_.title),_.description?et.createElement("div",{"data-description":"",className:Io(I,me,V==null?void 0:V.description,_==null||(o=_.classNames)==null?void 0:o.description)},typeof _.description=="function"?_.description():_.description):null),et.isValidElement(_.cancel)?_.cancel:_.cancel&&a1(_.cancel)?et.createElement("button",{"data-button":!0,"data-cancel":!0,style:_.cancelButtonStyle||j,onClick:Et=>{a1(_.cancel)&&ht&&(_.cancel.onClick==null||_.cancel.onClick.call(_.cancel,Et),Qt())},className:Io(V==null?void 0:V.cancelButton,_==null||(c=_.classNames)==null?void 0:c.cancelButton)},_.cancel.label):null,et.isValidElement(_.action)?_.action:_.action&&a1(_.action)?et.createElement("button",{"data-button":!0,"data-action":!0,style:_.actionButtonStyle||M,onClick:Et=>{a1(_.action)&&(_.action.onClick==null||_.action.onClick.call(_.action,Et),!Et.defaultPrevented&&Qt())},className:Io(V==null?void 0:V.actionButton,_==null||(u=_.classNames)==null?void 0:u.actionButton)},_.action.label):null)};function dj(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function K4n(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?P4n:B4n;function c(u){["top","right","bottom","left"].forEach(h=>{t[`${a}-${h}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(o)}),t}const W4n=et.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:h,mobileOffset:_,theme:p="light",richColors:m,duration:w,style:k,visibleToasts:v=$4n,toastOptions:b,dir:x=dj(),gap:y=H4n,icons:C,customAriaLabel:z,containerAriaLabel:E="Notifications"}=n,[T,j]=et.useState([]),M=et.useMemo(()=>r?T.filter(ne=>ne.toasterId===r):T.filter(ne=>!ne.toasterId),[T,r]),D=et.useMemo(()=>Array.from(new Set([i].concat(M.filter(ne=>ne.position).map(ne=>ne.position)))),[M,i]),[I,$]=et.useState([]),[q,H]=et.useState(!1),[Q,V]=et.useState(!1),[Z,Y]=et.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=et.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=et.useRef(null),U=et.useRef(!1),K=et.useCallback(ne=>{j(oe=>{var ue;return(ue=oe.find(se=>se.id===ne.id))!=null&&ue.delete||Li.dismiss(ne.id),oe.filter(({id:se})=>se!==ne.id)})},[]);return et.useEffect(()=>Li.subscribe(ne=>{if(ne.dismiss){requestAnimationFrame(()=>{j(oe=>oe.map(ue=>ue.id===ne.id?{...ue,delete:!0}:ue))});return}setTimeout(()=>{v4n.flushSync(()=>{j(oe=>{const ue=oe.findIndex(se=>se.id===ne.id);return ue!==-1?[...oe.slice(0,ue),{...oe[ue],...ne},...oe.slice(ue+1)]:[ne,...oe]})})})}),[]),et.useEffect(()=>{if(p!=="system"){Y(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const ne=window.matchMedia("(prefers-color-scheme: dark)");try{ne.addEventListener("change",({matches:oe})=>{Y(oe?"dark":"light")})}catch{ne.addListener(({matches:ue})=>{try{Y(ue?"dark":"light")}catch(se){console.error(se)}})}},[p]),et.useEffect(()=>{T.length<=1&&H(!1)},[T]),et.useEffect(()=>{const ne=oe=>{var ue;if(a.length>0&&a.every(ae=>oe[ae]||oe.code===ae)){var G;H(!0),(G=B.current)==null||G.focus()}oe.code==="Escape"&&(document.activeElement===B.current||(ue=B.current)!=null&&ue.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[a]),et.useEffect(()=>{if(B.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,U.current=!1)}},[B.current]),et.createElement("section",{ref:t,"aria-label":z??`${E} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},D.map((ne,oe)=>{var ue;const[se,G]=ne.split("-");return M.length?et.createElement("ol",{key:ne,dir:x==="auto"?dj():x,tabIndex:-1,ref:B,className:u,"data-sonner-toaster":!0,"data-sonner-theme":Z,"data-y-position":se,"data-x-position":G,style:{"--front-toast-height":`${((ue=I[0])==null?void 0:ue.height)||0}px`,"--width":`${F4n}px`,"--gap":`${y}px`,...k,...K4n(h,_)},onBlur:ae=>{U.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(U.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||U.current||(U.current=!0,F.current=ae.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{Q||H(!1)},onDragEnd:()=>H(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},M.filter(ae=>!ae.position&&oe===0||ae.position===ne).map((ae,ce)=>{var pe,be;return et.createElement(V4n,{key:ae.id,icons:C,index:ce,toast:ae,defaultRichColors:m,duration:(pe=b==null?void 0:b.duration)!=null?pe:w,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(be=b==null?void 0:b.closeButton)!=null?be:c,interacting:Q,position:ne,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:K,toasts:M.filter(Ae=>Ae.position==ae.position),heights:I.filter(Ae=>Ae.position==ae.position),setHeights:$,expandByDefault:o,gap:y,expanded:q,swipeDirections:n.swipeDirections})})):null}))});function Q4n(e){const[n]=gI();return f.jsx(W4n,{theme:n,...e})}function bn(e,n,t){I4n[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function hS({content:e,children:n,className:t}){const r=A.useRef(null),s=A.useRef(null);function i(){const o=r.current,c=s.current;if(!o||!c)return;c.matches(":popover-open")||c.showPopover();const u=o.getBoundingClientRect(),h=c.getBoundingClientRect(),_=Math.max(8,Math.min(u.left+u.width/2-h.width/2,window.innerWidth-h.width-8));c.style.left=`${_}px`,c.style.top=`${Math.max(8,u.top-h.height-6)}px`}function a(){var o,c;(o=r.current)!=null&&o.matches(":hover, :focus")||(c=s.current)==null||c.hidePopover()}return A.useEffect(()=>{const o=()=>{var c;return(c=s.current)==null?void 0:c.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:ys("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var c;o.key==="Escape"&&((c=s.current)!=null&&c.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const X4n=["button:not([disabled])","input:not([disabled])","textarea:not([disabled])","[tabindex]"].map(e=>`${e}:not([tabindex="-1"])`).join(", ");function Nm(e,n,t="[data-initial-focus]"){const r=A.useRef(n);r.current=n,A.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(X4n)];(s.querySelector(t)??a()[0]??s).focus();const o=c=>{if(c.key==="Escape"){if(s.querySelector(":popover-open"))return;c.preventDefault(),c.stopPropagation(),r.current();return}if(c.key!=="Tab")return;const u=a(),h=u[0],_=u.at(-1);!h||!_?(c.preventDefault(),s.focus()):c.shiftKey&&document.activeElement===h?(c.preventDefault(),_.focus()):!c.shiftKey&&document.activeElement===_&&(c.preventDefault(),h.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function DI({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=A.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),c=[];return n.activeTurnCount>0&&c.push(n.activeTurnCount===1?n7t():k7t({count:tn(n.activeTurnCount)})),n.pendingPermissionCount>0&&c.push(n.pendingPermissionCount===1?zCt():F6t({count:tn(n.pendingPermissionCount)})),o>0&&c.push(o===1?HCt():l7t({count:tn(o)})),n.queuedMessageCount>0&&c.push(n.queuedMessageCount===1?QCt():m7t({count:tn(n.queuedMessageCount)})),n.activeRunCount>0&&c.push(n.activeRunCount===1?DCt():cCt({count:tn(n.activeRunCount)})),Nm(a,s),Fi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":c.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:tCt({host:Ce(e)})}),c.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:xCt()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:c.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(Oe,{disabled:r,onClick:s,children:rf()}),f.jsx(Oe,{variant:"danger",disabled:r,onClick:i,children:r?T7t():W6t()})]})]})}),document.body)}/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MI=(...e)=>e.filter((n,t,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===t).join(" ").trim();/** + */const LI=(...e)=>e.filter((n,t,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===t).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 Pwn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + */const Y4n=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 Fwn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase());/** + */const Z4n=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.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 fj=e=>{const n=Fwn(e);return n.charAt(0).toUpperCase()+n.slice(1)};/** + */const hj=e=>{const n=Z4n(e);return n.charAt(0).toUpperCase()+n.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 aw={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 cw={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 Hwn=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},qwn=A.createContext({}),Uwn=()=>A.useContext(qwn),Gwn=A.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},c)=>{const{size:u=24,strokeWidth:h=2,absoluteStrokeWidth:_=!1,color:p="currentColor",className:m=""}=Uwn()??{},x=r??_?Number(t??h)*24/Number(n??u):t??h;return A.createElement("svg",{ref:c,...aw,width:n??u??aw.width,height:n??u??aw.height,stroke:e??p,strokeWidth:x,className:MI("lucide",m,s),...!i&&!Hwn(o)&&{"aria-hidden":"true"},...o},[...a.map(([k,v])=>A.createElement(k,v)),...Array.isArray(i)?i:[i]])});/** + */const J4n=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},e3n=A.createContext({}),t3n=()=>A.useContext(e3n),n3n=A.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},c)=>{const{size:u=24,strokeWidth:h=2,absoluteStrokeWidth:_=!1,color:p="currentColor",className:m=""}=t3n()??{},w=r??_?Number(t??h)*24/Number(n??u):t??h;return A.createElement("svg",{ref:c,...cw,width:n??u??cw.width,height:n??u??cw.height,stroke:e??p,strokeWidth:w,className:LI("lucide",m,s),...!i&&!J4n(o)&&{"aria-hidden":"true"},...o},[...a.map(([k,v])=>A.createElement(k,v)),...Array.isArray(i)?i:[i]])});/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const it=(e,n)=>{const t=A.forwardRef(({className:r,...s},i)=>A.createElement(Gwn,{ref:i,iconNode:n,className:MI(`lucide-${Pwn(fj(e))}`,`lucide-${e}`,r),...s}));return t.displayName=fj(e),t};/** + */const ot=(e,n)=>{const t=A.forwardRef(({className:r,...s},i)=>A.createElement(n3n,{ref:i,iconNode:n,className:LI(`lucide-${Y4n(hj(e))}`,`lucide-${e}`,r),...s}));return t.displayName=hj(e),t};/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vwn=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Kwn=it("arrow-down",Vwn);/** + */const r3n=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],s3n=ot("arrow-down",r3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wwn=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],R0=it("arrow-left",Wwn);/** + */const i3n=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],M0=ot("arrow-left",i3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qwn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Q1=it("arrow-right",Qwn);/** + */const a3n=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Q1=ot("arrow-right",a3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xwn=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Ywn=it("arrow-up-right",Xwn);/** + */const o3n=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],c3n=ot("arrow-up-right",o3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Zwn=[["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"}]],OI=it("blocks",Zwn);/** + */const l3n=[["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"}]],II=ot("blocks",l3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Jwn=[["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"}]],DI=it("book-open",Jwn);/** + */const u3n=[["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"}]],$I=ot("book-open",u3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const e4n=[["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"}]],t4n=it("calendar-days",e4n);/** + */const _3n=[["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"}]],f3n=ot("calendar-days",_3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const n4n=[["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"}]],r4n=it("chart-spline",n4n);/** + */const d3n=[["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"}]],h3n=ot("chart-spline",d3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const s4n=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ri=it("check",s4n);/** + */const p3n=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Pi=ot("check",p3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const i4n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],rc=it("chevron-down",i4n);/** + */const m3n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ac=ot("chevron-down",m3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const a4n=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],LI=it("chevron-left",a4n);/** + */const g3n=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],BI=ot("chevron-left",g3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const o4n=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ba=it("chevron-right",o4n);/** + */const v3n=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Wa=ot("chevron-right",v3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const c4n=[["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"}]],dS=it("circle-alert",c4n);/** + */const b3n=[["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"}]],pS=ot("circle-alert",b3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const l4n=[["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"}]],u4n=it("circle-question-mark",l4n);/** + */const y3n=[["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"}]],x3n=ot("circle-question-mark",y3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _4n=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],II=it("circle-stop",_4n);/** + */const w3n=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],PI=ot("circle-stop",w3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const f4n=[["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"}]],$I=it("circle-x",f4n);/** + */const k3n=[["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"}]],FI=ot("circle-x",k3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const d4n=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],h4n=it("clock-3",d4n);/** + */const S3n=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],C3n=ot("clock-3",S3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const p4n=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],m4n=it("clock",p4n);/** + */const E3n=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],N3n=ot("clock",E3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const g4n=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],v4n=it("cloud-upload",g4n);/** + */const z3n=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],j3n=ot("cloud-upload",z3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const b4n=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],$3=it("code",b4n);/** + */const T3n=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],P3=ot("code",T3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const y4n=[["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"}]],gf=it("copy",y4n);/** + */const A3n=[["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"}]],Sf=ot("copy",A3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const x4n=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],BI=it("corner-down-left",x4n);/** + */const R3n=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],HI=ot("corner-down-left",R3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const w4n=[["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"}]],hS=it("cpu",w4n);/** + */const M3n=[["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"}]],mS=ot("cpu",M3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const k4n=[["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"}]],Db=it("download",k4n);/** + */const O3n=[["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"}]],Lb=ot("download",O3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const S4n=[["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"}]],pS=it("ellipsis",S4n);/** + */const D3n=[["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"}]],Ib=ot("ellipsis",D3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const C4n=[["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"}]],Z_=it("external-link",C4n);/** + */const L3n=[["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"}]],of=ot("external-link",L3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const E4n=[["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"}]],PI=it("file-code",E4n);/** + */const I3n=[["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"}]],qI=ot("file-code",I3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const N4n=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],z4n=it("file-output",N4n);/** + */const $3n=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],B3n=ot("file-output",$3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const j4n=[["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"}]],Lb=it("file-text",j4n);/** + */const P3n=[["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"}]],$b=ot("file-text",P3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const T4n=[["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"}]],mh=it("flask-conical",T4n);/** + */const F3n=[["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"}]],gh=ot("flask-conical",F3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const A4n=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]],R4n=it("fold-vertical",A4n);/** + */const H3n=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]],q3n=ot("fold-vertical",H3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const M4n=[["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"}]],FI=it("folder-git-2",M4n);/** + */const U3n=[["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"}]],UI=ot("folder-git-2",U3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const O4n=[["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"}]],Su=it("folder-open",O4n);/** + */const G3n=[["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"}]],Ou=ot("folder-open",G3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const D4n=[["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"}]],L4n=it("folder-plus",D4n);/** + */const V3n=[["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"}]],K3n=ot("folder-plus",V3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const I4n=[["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"}]],Ib=it("folder-tree",I4n);/** + */const W3n=[["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"}]],Bb=ot("folder-tree",W3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $4n=[["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"}]],B4n=it("funnel",$4n);/** + */const Q3n=[["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"}]],X3n=ot("funnel",Q3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const P4n=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],F4n=it("gauge",P4n);/** + */const Y3n=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Z3n=ot("gauge",Y3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const H4n=[["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"}]],Nm=it("git-branch",H4n);/** + */const J3n=[["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"}]],zm=ot("git-branch",J3n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const q4n=[["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"}]],U4n=it("git-commit-horizontal",q4n);/** + */const e5n=[["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"}]],t5n=ot("git-commit-horizontal",e5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const G4n=[["path",{d:"M12 13V2l8 4-8 4",key:"5wlwwj"}],["path",{d:"M20.561 10.222a9 9 0 1 1-12.55-5.29",key:"1c0wjv"}],["path",{d:"M8.002 9.997a5 5 0 1 0 8.9 2.02",key:"gb1g7m"}]],HI=it("goal",G4n);/** + */const n5n=[["path",{d:"M12 13V2l8 4-8 4",key:"5wlwwj"}],["path",{d:"M20.561 10.222a9 9 0 1 1-12.55-5.29",key:"1c0wjv"}],["path",{d:"M8.002 9.997a5 5 0 1 0 8.9 2.02",key:"gb1g7m"}]],GI=ot("goal",n5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const V4n=[["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"}]],K4n=it("globe",V4n);/** + */const r5n=[["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"}]],s5n=ot("globe",r5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const W4n=[["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"}]],qI=it("history",W4n);/** + */const i5n=[["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"}]],VI=ot("history",i5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Q4n=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],mS=it("info",Q4n);/** + */const a5n=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],gS=ot("info",a5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const X4n=[["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"}]],Y4n=it("laptop",X4n);/** + */const o5n=[["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"}]],c5n=ot("laptop",o5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Z4n=[["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"}]],J4n=it("lightbulb",Z4n);/** + */const l5n=[["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"}]],u5n=ot("lightbulb",l5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const e3n=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],UI=it("link-2",e3n);/** + */const _5n=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],KI=ot("link-2",_5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const t3n=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],n3n=it("list-checks",t3n);/** + */const f5n=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],d5n=ot("list-checks",f5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const r3n=[["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"}]],dj=it("lock",r3n);/** + */const h5n=[["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"}]],pj=ot("lock",h5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const s3n=[["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"}]],i3n=it("maximize-2",s3n);/** + */const p5n=[["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"}]],m5n=ot("maximize-2",p5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const a3n=[["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"}]],GI=it("message-square-quote",a3n);/** + */const g5n=[["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"}]],WI=ot("message-square-quote",g5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const o3n=[["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"}]],c3n=it("minimize-2",o3n);/** + */const v5n=[["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"}]],b5n=ot("minimize-2",v5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const l3n=[["path",{d:"M5 12h14",key:"1ays0h"}]],u3n=it("minus",l3n);/** + */const y5n=[["path",{d:"M5 12h14",key:"1ays0h"}]],x5n=ot("minus",y5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _3n=[["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"}]],f3n=it("monitor",_3n);/** + */const w5n=[["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"}]],k5n=ot("monitor",w5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const d3n=[["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"}]],h3n=it("moon",d3n);/** + */const S5n=[["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"}]],C5n=ot("moon",S5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const p3n=[["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"}]],m3n=it("mouse-pointer-click",p3n);/** + */const E5n=[["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"}]],N5n=ot("mouse-pointer-click",E5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const g3n=[["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"}]],gS=it("package",g3n);/** + */const z5n=[["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"}]],vS=ot("package",z5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const v3n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],VI=it("panel-left",v3n);/** + */const j5n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],QI=ot("panel-left",j5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const b3n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],KI=it("panel-right",b3n);/** + */const T5n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],XI=ot("panel-right",T5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const y3n=[["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"}]],x3n=it("paperclip",y3n);/** + */const A5n=[["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"}]],R5n=ot("paperclip",A5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const w3n=[["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"}]],vS=it("pencil",w3n);/** + */const M5n=[["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"}]],bS=ot("pencil",M5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const k3n=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],S3n=it("play",k3n);/** + */const O5n=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],D5n=ot("play",O5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const C3n=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ih=it("plus",C3n);/** + */const L5n=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$h=ot("plus",L5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const E3n=[["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"}]],Pa=it("refresh-cw",E3n);/** + */const I5n=[["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"}]],Qa=ot("refresh-cw",I5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const N3n=[["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"}]],z3n=it("rotate-cw",N3n);/** + */const $5n=[["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"}]],B5n=ot("rotate-cw",$5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const j3n=[["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"}]],bS=it("scroll-text",j3n);/** + */const P5n=[["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"}]],yS=ot("scroll-text",P5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const T3n=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],WI=it("search",T3n);/** + */const F5n=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],YI=ot("search",F5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const A3n=[["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"}]],hj=it("server",A3n);/** + */const H5n=[["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"}]],mj=ot("server",H5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const R3n=[["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"}]],yS=it("settings",R3n);/** + */const q5n=[["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"}]],xS=ot("settings",q5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const M3n=[["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"}]],QI=it("sliders-horizontal",M3n);/** + */const U5n=[["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"}]],ZI=ot("sliders-horizontal",U5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const O3n=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],D3n=it("square-pen",O3n);/** + */const G5n=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],V5n=ot("square-pen",G5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const L3n=[["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"}]],vf=it("square-terminal",L3n);/** + */const K5n=[["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"}]],Cf=ot("square-terminal",K5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const I3n=[["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"}]],$3n=it("sun",I3n);/** + */const W5n=[["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"}]],Q5n=ot("sun",W5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const B3n=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],lo=it("terminal",B3n);/** + */const X5n=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ko=ot("terminal",X5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const P3n=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],F3n=it("toggle-right",P3n);/** + */const Y5n=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Z5n=ot("toggle-right",Y5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const H3n=[["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"}]],bf=it("trash-2",H3n);/** + */const J5n=[["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"}]],Ef=ot("trash-2",J5n);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const q3n=[["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"}]],xS=it("triangle-alert",q3n);/** + */const ekn=[["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"}]],wS=ot("triangle-alert",ekn);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const U3n=[["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"}]],G3n=it("upload",U3n);/** + */const tkn=[["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"}]],nkn=ot("upload",tkn);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const V3n=[["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"}]],wS=it("users",V3n);/** + */const rkn=[["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"}]],kS=ot("users",rkn);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const K3n=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],W3n=it("wand-sparkles",K3n);/** + */const skn=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],ikn=ot("wand-sparkles",skn);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Q3n=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lr=it("x",Q3n);/** + */const akn=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_r=ot("x",akn);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const X3n=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Y3n=it("zap",X3n);function yu(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const Z3n=["settings","harnesses","projects","compute","instances","environment","git","storage"],J3n=e=>Z3n.some(n=>n===e),yf=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Gi=e=>typeof e=="string"&&e.length>0,o1=e=>e==null||Gi(e);function kS(e){if(!yf(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"||e.view==="terminal"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&Gi(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&o1(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...Gi(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&Gi(e.path)&&o1(e.sessionId)&&o1(e.ref)&&o1(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...Gi(e.sessionId)?{sessionId:e.sessionId}:{},...Gi(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...Gi(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&Gi(e.experimentId)&&Gi(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&Gi(e.sessionId)&&Gi(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&Gi(e.sessionId)&&Gi(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function J_(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&J3n(r)?{kind:"settings",projectId:t,section:r}:null:null}function $b(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=J_(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!kS(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function X1(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const pj=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function XI(e,n){let t,r,s=!1,i=!1,a;async function o(c=!1){if(clearTimeout(a),i||(i=c),s||t===void 0)return;s=!0;const u=t;t=void 0;const h=i;i=!1;try{await e(u,h),r=void 0}catch(_){r=u,n(_)}finally{s=!1,t!==void 0&&o()}}return{queue(c,u=0){t=c,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}var ow={exports:{}},mj;function e5n(){return mj||(mj=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),h=window.getComputedStyle(this._terminal.element),_=c-(parseInt(h.getPropertyValue("padding-top"))+parseInt(h.getPropertyValue("padding-bottom"))),p=u-(parseInt(h.getPropertyValue("padding-right"))+parseInt(h.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(_/i.css.cell.height))}}}})(),t})()))})(ow)),ow.exports}var t5n=e5n(),cw={exports:{}},gj;function n5n(){return gj||(gj=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function c(h){try{const _=new URL(h),p=_.password&&_.username?`${_.protocol}//${_.username}:${_.password}@${_.host}`:_.username?`${_.protocol}//${_.username}@${_.host}`:`${_.protocol}//${_.host}`;return h.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(h,_,p,m={}){this._terminal=h,this._regex=_,this._handler=p,this._options=m}provideLinks(h,_){const p=u.computeLink(h,this._regex,this._terminal,this._handler);_(this._addCallbacks(p))}_addCallbacks(h){return h.map((_=>(_.leave=this._options.leave,_.hover=(p,m)=>{if(this._options.hover){const{range:x}=_;this._options.hover(p,m,x)}},_)))}};class u{static computeLink(_,p,m,x){const k=new RegExp(p.source,(p.flags||"")+"g"),[v,b]=u._getWindowedLineStrings(_-1,m),w=v.join("");let y;const C=[];for(;y=k.exec(w);){const N=y[0];if(!c(N))continue;const[z,T]=u._mapStrIdx(m,b,0,y.index),[j,M]=u._mapStrIdx(m,z,T,N.length);if(z===-1||T===-1||j===-1||M===-1)continue;const D={start:{x:T+1,y:z+1},end:{x:M,y:j+1}};C.push({range:D,text:N,activate:x})}return C}static _getWindowedLineStrings(_,p){let m,x=_,k=_,v=0,b="";const w=[];if(m=p.buffer.active.getLine(_)){const y=m.translateToString(!0);if(m.isWrapped&&y[0]!==" "){for(v=0;(m=p.buffer.active.getLine(--x))&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),m.isWrapped&&b.indexOf(" ")===-1););w.reverse()}for(w.push(y),v=0;(m=p.buffer.active.getLine(++k))&&m.isWrapped&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),b.indexOf(" ")===-1););}return[w,x]}static _mapStrIdx(_,p,m,x){const k=_.buffer.active,v=k.getNullCell();let b=m;for(;x;){const w=k.getLine(p);if(!w)return[-1,-1];for(let y=b;y{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(h,_){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=_}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(h=u,_={}){this._handler=h,this._options=_}activate(h){this._terminal=h;const _=this._options,p=_.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,_))}dispose(){var h;(h=this._linkProvider)==null||h.dispose()}}})(),i})()))})(cw)),cw.exports}var r5n=n5n(),lw={exports:{}},vj;function s5n(){return vj||(vj=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,c){var u=this&&this.__decorate||function(w,y,C,N){var z,T=arguments.length,j=T<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,N);else for(var M=w.length-1;M>=0;M--)(z=w[M])&&(j=(T<3?z(j):T>3?z(y,C,j):z(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},h=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const _=c(9042),p=c(9924),m=c(844),x=c(4725),k=c(2585),v=c(3656);let b=o.AccessibilityManager=class extends m.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 z=0;zthis._handleBoundaryFocus(z,0),this._bottomBoundaryFocusListener=z=>this._handleBoundaryFocus(z,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 p.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((z=>this._handleResize(z.rows)))),this.register(this._terminal.onRender((z=>this._refreshRows(z.start,z.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((z=>this._handleChar(z)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` -`)))),this.register(this._terminal.onA11yTab((z=>this._handleTab(z)))),this.register(this._terminal.onKey((z=>this._handleKey(z.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,m.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+=_.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 z=w;z<=y;z++){const T=C.lines.get(C.ydisp+z),j=[],M=(T==null?void 0:T.translateToString(!0,void 0,void 0,j))||"",D=(C.ydisp+z+1).toString(),I=this._rowElements[z];I&&(M.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=M,this._rowColumns.set(I,j)),I.setAttribute("aria-posinset",D),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 z,T;if(y===0?(z=C,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(z=this._rowElements.shift(),T=C,this._rowContainer.removeChild(z)),z.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}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 M;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:((M=N.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(C.node))return;const z=({node:D,offset:I})=>{const $=D instanceof Text?D.parentNode:D;let q=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(q))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get($);if(!H)return console.warn("columns is null. Race condition?"),null;let Q=I=this._terminal.cols&&(++q,Q=0),{row:q,column:Q}},T=z(y),j=z(C);if(T&&j){if(T.row>j.row||T.row===j.row&&T.column>=j.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(j.row-T.row)*this._terminal.cols-T.column+j.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(p){return p.replace(/\r?\n/g,"\r")}function u(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function h(p,m,x,k){p=u(p=c(p),x.decPrivateModes.bracketedPasteMode&&k.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(p,!0),m.value=""}function _(p,m,x){const k=x.getBoundingClientRect(),v=p.clientX-k.left-10,b=p.clientY-k.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${v}px`,m.style.top=`${b}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=u,o.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},o.handlePasteEvent=function(p,m,x,k){p.stopPropagation(),p.clipboardData&&h(p.clipboardData.getData("text/plain"),m,x,k)},o.paste=h,o.moveTextAreaUnderMouseCursor=_,o.rightClickHandler=function(p,m,x,k,v){_(p,m,x),v&&k.rightClickSelect(p),m.value=k.selectionText,m.select()}},7239:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=c(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(h,_,p){this._css.set(h,_,p)}getCss(h,_){return this._css.get(h,_)}setColor(h,_,p){this._color.set(h,_,p)}getColor(h,_){return this._color.get(h,_)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,u,h,_){c.addEventListener(u,h,_);let p=!1;return{dispose:()=>{p||(p=!0,c.removeEventListener(u,h,_))}}}},3551:function(a,o,c){var u=this&&this.__decorate||function(b,w,y,C){var N,z=arguments.length,T=z<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(N=b[j])&&(T=(z<3?N(T):z>3?N(w,y,T):N(w,y))||T);return z>3&&T&&Object.defineProperty(w,y,T),T},h=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const _=c(3656),p=c(8460),m=c(844),x=c(2585),k=c(4725);let v=o.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(b,w,y,C,N){super(),this._element=b,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 p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var z;this._lastMouseEvent=void 0,(z=this._activeProviderReplies)==null||z.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,_.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,_.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,_.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,_.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=b.composedPath();for(let C=0;C{z==null||z.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[z,T]of this._linkProviderService.linkProviders.entries())w?(N=this._activeProviderReplies)!=null&&N.get(z)&&(y=this._checkLinkProviderResult(z,b,y)):T.provideLinks(b.y,(j=>{var D,I;if(this._isMouseOut)return;const M=j==null?void 0:j.map(($=>({link:$})));(D=this._activeProviderReplies)==null||D.set(z,M),y=this._checkLinkProviderResult(z,b,y),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,w){const y=new Set;for(let C=0;Cb?this._bufferService.cols:T.link.range.end.x;for(let D=j;D<=M;D++){if(y.has(D)){N.splice(z--,1);break}y.add(D)}}}}_checkLinkProviderResult(b,w,y){var z;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let N=!1;for(let T=0;Tthis._linkAtPosition(j.link,w)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;Tthis._linkAtPosition(M.link,w)));if(j){y=!0,this._handleNewLink(j);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,w){this._currentLink&&this._lastMouseEvent&&(!b||!w||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(b.link,w)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.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,z;(C=this._currentLink)!=null&&C.state&&((z=(N=this._currentLink)==null?void 0:N.state)==null?void 0:z.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.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 z=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);z&&this._askForLink(z,!1)}}))))}_linkHover(b,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&&b.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(b,w){const y=b.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(b,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&&b.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(b,w){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,C=b.range.end.y*this._bufferService.cols+b.range.end.x,N=w.y*this._bufferService.cols+w.x;return y<=N&&N<=C}_positionFromMouseEvent(b,w,y){const C=y.getCoords(b,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,w,y,C,N){return{x1:b,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:N}}};o.Linkifier=v=u([h(1,k.IMouseService),h(2,k.IRenderService),h(3,x.IBufferService),h(4,k.ILinkProviderService)],v)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,c){var u=this&&this.__decorate||function(k,v,b,w){var y,C=arguments.length,N=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(k,v,b,w);else for(var z=k.length-1;z>=0;z--)(y=k[z])&&(N=(C<3?y(N):C>3?y(v,b,N):y(v,b))||N);return C>3&&N&&Object.defineProperty(v,b,N),N},h=this&&this.__param||function(k,v){return function(b,w){v(b,w,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const _=c(511),p=c(2585);let m=o.OscLinkProvider=class{constructor(k,v,b){this._bufferService=k,this._optionsService=v,this._oscLinkService=b}provideLinks(k,v){var M;const b=this._bufferService.buffer.lines.get(k-1);if(!b)return void v(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new _.CellData,N=b.getTrimmedLength();let z=-1,T=-1,j=!1;for(let D=0;Dy?y.activate(H,Q,$):x(0,Q),hover:(H,Q)=>{var V;return(V=y==null?void 0:y.hover)==null?void 0:V.call(y,H,Q,$)},leave:(H,Q)=>{var V;return(V=y==null?void 0:y.leave)==null?void 0:V.call(y,H,Q,$)}})}j=!1,C.hasExtendedAttrs()&&C.extended.urlId?(T=D,z=C.extended.urlId):(T=-1,z=-1)}}v(w)}};function x(k,v){if(confirm(`Do you want to navigate to ${v}? + */const okn=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ckn=ot("zap",okn);function Tu(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const lkn=["settings","harnesses","projects","compute","instances","environment","git","storage"],ukn=e=>lkn.some(n=>n===e),Nf=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),na=e=>typeof e=="string"&&e.length>0,o1=e=>e==null||na(e);function SS(e){if(!Nf(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"||e.view==="terminal"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&na(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&o1(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...na(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&na(e.path)&&o1(e.sessionId)&&o1(e.ref)&&o1(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...na(e.sessionId)?{sessionId:e.sessionId}:{},...na(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...na(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&na(e.experimentId)&&na(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&na(e.sessionId)&&na(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&na(e.sessionId)&&na(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function cf(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&ukn(r)?{kind:"settings",projectId:t,section:r}:null:null}function Pb(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=cf(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!SS(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function X1(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const gj=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function JI(e,n){let t,r,s=!1,i=!1,a;async function o(c=!1){if(clearTimeout(a),i||(i=c),s||t===void 0)return;s=!0;const u=t;t=void 0;const h=i;i=!1;try{await e(u,h),r=void 0}catch(_){r=u,n(_)}finally{s=!1,t!==void 0&&o()}}return{queue(c,u=0){t=c,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}var lw={exports:{}},vj;function _kn(){return vj||(vj=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),h=window.getComputedStyle(this._terminal.element),_=c-(parseInt(h.getPropertyValue("padding-top"))+parseInt(h.getPropertyValue("padding-bottom"))),p=u-(parseInt(h.getPropertyValue("padding-right"))+parseInt(h.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(_/i.css.cell.height))}}}})(),t})()))})(lw)),lw.exports}var fkn=_kn(),uw={exports:{}},bj;function dkn(){return bj||(bj=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function c(h){try{const _=new URL(h),p=_.password&&_.username?`${_.protocol}//${_.username}:${_.password}@${_.host}`:_.username?`${_.protocol}//${_.username}@${_.host}`:`${_.protocol}//${_.host}`;return h.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(h,_,p,m={}){this._terminal=h,this._regex=_,this._handler=p,this._options=m}provideLinks(h,_){const p=u.computeLink(h,this._regex,this._terminal,this._handler);_(this._addCallbacks(p))}_addCallbacks(h){return h.map((_=>(_.leave=this._options.leave,_.hover=(p,m)=>{if(this._options.hover){const{range:w}=_;this._options.hover(p,m,w)}},_)))}};class u{static computeLink(_,p,m,w){const k=new RegExp(p.source,(p.flags||"")+"g"),[v,b]=u._getWindowedLineStrings(_-1,m),x=v.join("");let y;const C=[];for(;y=k.exec(x);){const z=y[0];if(!c(z))continue;const[E,T]=u._mapStrIdx(m,b,0,y.index),[j,M]=u._mapStrIdx(m,E,T,z.length);if(E===-1||T===-1||j===-1||M===-1)continue;const D={start:{x:T+1,y:E+1},end:{x:M,y:j+1}};C.push({range:D,text:z,activate:w})}return C}static _getWindowedLineStrings(_,p){let m,w=_,k=_,v=0,b="";const x=[];if(m=p.buffer.active.getLine(_)){const y=m.translateToString(!0);if(m.isWrapped&&y[0]!==" "){for(v=0;(m=p.buffer.active.getLine(--w))&&v<2048&&(b=m.translateToString(!0),v+=b.length,x.push(b),m.isWrapped&&b.indexOf(" ")===-1););x.reverse()}for(x.push(y),v=0;(m=p.buffer.active.getLine(++k))&&m.isWrapped&&v<2048&&(b=m.translateToString(!0),v+=b.length,x.push(b),b.indexOf(" ")===-1););}return[x,w]}static _mapStrIdx(_,p,m,w){const k=_.buffer.active,v=k.getNullCell();let b=m;for(;w;){const x=k.getLine(p);if(!x)return[-1,-1];for(let y=b;y{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(h,_){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=_}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(h=u,_={}){this._handler=h,this._options=_}activate(h){this._terminal=h;const _=this._options,p=_.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,_))}dispose(){var h;(h=this._linkProvider)==null||h.dispose()}}})(),i})()))})(uw)),uw.exports}var hkn=dkn(),_w={exports:{}},yj;function pkn(){return yj||(yj=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,c){var u=this&&this.__decorate||function(x,y,C,z){var E,T=arguments.length,j=T<3?y:z===null?z=Object.getOwnPropertyDescriptor(y,C):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(x,y,C,z);else for(var M=x.length-1;M>=0;M--)(E=x[M])&&(j=(T<3?E(j):T>3?E(y,C,j):E(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},h=this&&this.__param||function(x,y){return function(C,z){y(C,z,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const _=c(9042),p=c(9924),m=c(844),w=c(4725),k=c(2585),v=c(3656);let b=o.AccessibilityManager=class extends m.Disposable{constructor(x,y,C,z){super(),this._terminal=x,this._coreBrowserService=C,this._renderService=z,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 p.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,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,m.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(x){for(let y=0;y0?this._charsToConsume.shift()!==x&&(this._charsToAnnounce+=x):this._charsToAnnounce+=x,x===` +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=_.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(x){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(x)||this._charsToConsume.push(x)}_refreshRows(x,y){this._liveRegionDebouncer.refresh(x,y,this._terminal.rows)}_renderRows(x,y){const C=this._terminal.buffer,z=C.lines.length.toString();for(let E=x;E<=y;E++){const T=C.lines.get(C.ydisp+E),j=[],M=(T==null?void 0:T.translateToString(!0,void 0,void 0,j))||"",D=(C.ydisp+E+1).toString(),I=this._rowElements[E];I&&(M.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=M,this._rowColumns.set(I,j)),I.setAttribute("aria-posinset",D),I.setAttribute("aria-setsize",z))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(x,y){const C=x.target,z=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||x.relatedTarget!==z)return;let E,T;if(y===0?(E=C,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(E=this._rowElements.shift(),T=C,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),x.preventDefault(),x.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const x=document.getSelection();if(!x)return;if(x.isCollapsed)return void(this._rowContainer.contains(x.anchorNode)&&this._terminal.clearSelection());if(!x.anchorNode||!x.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:x.anchorNode,offset:x.anchorOffset},C={node:x.focusNode,offset:x.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 z=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(z)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:z,offset:((M=z.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(C.node))return;const E=({node:D,offset:I})=>{const $=D instanceof Text?D.parentNode:D;let q=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(q))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get($);if(!H)return console.warn("columns is null. Race condition?"),null;let Q=I=this._terminal.cols&&(++q,Q=0),{row:q,column:Q}},T=E(y),j=E(C);if(T&&j){if(T.row>j.row||T.row===j.row&&T.column>=j.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(j.row-T.row)*this._terminal.cols-T.column+j.column)}}_handleResize(x){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yx;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const x=this._coreBrowserService.mainDocument.createElement("div");return x.setAttribute("role","listitem"),x.tabIndex=-1,this._refreshRowDimensions(x),x}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let x=0;x{function c(p){return p.replace(/\r?\n/g,"\r")}function u(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function h(p,m,w,k){p=u(p=c(p),w.decPrivateModes.bracketedPasteMode&&k.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(p,!0),m.value=""}function _(p,m,w){const k=w.getBoundingClientRect(),v=p.clientX-k.left-10,b=p.clientY-k.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${v}px`,m.style.top=`${b}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=u,o.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},o.handlePasteEvent=function(p,m,w,k){p.stopPropagation(),p.clipboardData&&h(p.clipboardData.getData("text/plain"),m,w,k)},o.paste=h,o.moveTextAreaUnderMouseCursor=_,o.rightClickHandler=function(p,m,w,k,v){_(p,m,w),v&&k.rightClickSelect(p),m.value=k.selectionText,m.select()}},7239:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=c(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(h,_,p){this._css.set(h,_,p)}getCss(h,_){return this._css.get(h,_)}setColor(h,_,p){this._color.set(h,_,p)}getColor(h,_){return this._color.get(h,_)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,u,h,_){c.addEventListener(u,h,_);let p=!1;return{dispose:()=>{p||(p=!0,c.removeEventListener(u,h,_))}}}},3551:function(a,o,c){var u=this&&this.__decorate||function(b,x,y,C){var z,E=arguments.length,T=E<3?x:C===null?C=Object.getOwnPropertyDescriptor(x,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,x,y,C);else for(var j=b.length-1;j>=0;j--)(z=b[j])&&(T=(E<3?z(T):E>3?z(x,y,T):z(x,y))||T);return E>3&&T&&Object.defineProperty(x,y,T),T},h=this&&this.__param||function(b,x){return function(y,C){x(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const _=c(3656),p=c(8460),m=c(844),w=c(2585),k=c(4725);let v=o.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(b,x,y,C,z){super(),this._element=b,this._mouseService=x,this._renderService=y,this._bufferService=C,this._linkProviderService=z,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.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,_.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,_.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,_.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,_.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const x=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!x)return;this._isMouseOut=!1;const y=b.composedPath();for(let C=0;C{E==null||E.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[E,T]of this._linkProviderService.linkProviders.entries())x?(z=this._activeProviderReplies)!=null&&z.get(E)&&(y=this._checkLinkProviderResult(E,b,y)):T.provideLinks(b.y,(j=>{var D,I;if(this._isMouseOut)return;const M=j==null?void 0:j.map(($=>({link:$})));(D=this._activeProviderReplies)==null||D.set(E,M),y=this._checkLinkProviderResult(E,b,y),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,x){const y=new Set;for(let C=0;Cb?this._bufferService.cols:T.link.range.end.x;for(let D=j;D<=M;D++){if(y.has(D)){z.splice(E--,1);break}y.add(D)}}}}_checkLinkProviderResult(b,x,y){var E;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let z=!1;for(let T=0;Tthis._linkAtPosition(j.link,x)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;Tthis._linkAtPosition(M.link,x)));if(j){y=!0,this._handleNewLink(j);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const x=this._positionFromMouseEvent(b,this._element,this._mouseService);x&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,x)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,x){this._currentLink&&this._lastMouseEvent&&(!b||!x||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=x)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._linkAtPosition(b.link,x)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.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,z,E;(C=this._currentLink)!=null&&C.state&&((E=(z=this._currentLink)==null?void 0:z.state)==null?void 0:E.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.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,z=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=z&&(this._clearCurrentLink(C,z),this._lastMouseEvent)){const E=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);E&&this._askForLink(E,!1)}}))))}_linkHover(b,x,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),x.hover&&x.hover(y,x.text)}_fireUnderlineEvent(b,x){const y=b.range,C=this._bufferService.buffer.ydisp,z=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(x?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(z)}_linkLeave(b,x,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),x.leave&&x.leave(y,x.text)}_linkAtPosition(b,x){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,C=b.range.end.y*this._bufferService.cols+b.range.end.x,z=x.y*this._bufferService.cols+x.x;return y<=z&&z<=C}_positionFromMouseEvent(b,x,y){const C=y.getCoords(b,x,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,x,y,C,z){return{x1:b,y1:x,x2:y,y2:C,cols:this._bufferService.cols,fg:z}}};o.Linkifier=v=u([h(1,k.IMouseService),h(2,k.IRenderService),h(3,w.IBufferService),h(4,k.ILinkProviderService)],v)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,c){var u=this&&this.__decorate||function(k,v,b,x){var y,C=arguments.length,z=C<3?v:x===null?x=Object.getOwnPropertyDescriptor(v,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(k,v,b,x);else for(var E=k.length-1;E>=0;E--)(y=k[E])&&(z=(C<3?y(z):C>3?y(v,b,z):y(v,b))||z);return C>3&&z&&Object.defineProperty(v,b,z),z},h=this&&this.__param||function(k,v){return function(b,x){v(b,x,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const _=c(511),p=c(2585);let m=o.OscLinkProvider=class{constructor(k,v,b){this._bufferService=k,this._optionsService=v,this._oscLinkService=b}provideLinks(k,v){var M;const b=this._bufferService.buffer.lines.get(k-1);if(!b)return void v(void 0);const x=[],y=this._optionsService.rawOptions.linkHandler,C=new _.CellData,z=b.getTrimmedLength();let E=-1,T=-1,j=!1;for(let D=0;Dy?y.activate(H,Q,$):w(0,Q),hover:(H,Q)=>{var V;return(V=y==null?void 0:y.hover)==null?void 0:V.call(y,H,Q,$)},leave:(H,Q)=>{var V;return(V=y==null?void 0:y.leave)==null?void 0:V.call(y,H,Q,$)}})}j=!1,C.hasExtendedAttrs()&&C.extended.urlId?(T=D,E=C.extended.urlId):(T=-1,E=-1)}}v(x)}};function w(k,v){if(confirm(`Do you want to navigate to ${v}? -WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=m=u([h(0,p.IBufferService),h(1,p.IOptionsService),h(2,p.IOscLinkService)],m)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,u){this._renderCallback=c,this._coreBrowserService=u,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,u,h){this._rowCount=h,c=c!==void 0?c:0,u=u!==void 0?u: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,u):u,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),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const u=c(3614),h=c(3656),_=c(3551),p=c(9042),m=c(3730),x=c(1680),k=c(3107),v=c(5744),b=c(2950),w=c(1296),y=c(428),C=c(4269),N=c(5114),z=c(8934),T=c(3230),j=c(9312),M=c(4725),D=c(6731),I=c(8055),$=c(8969),q=c(8460),H=c(844),Q=c(6114),V=c(8437),J=c(2584),Z=c(7399),B=c(5941),L=c(9074),F=c(2585),U=c(5435),K=c(4567),ne=c(779);class ce extends $.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(se={}){super(se),this.browser=Q,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new q.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new q.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new q.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new q.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new q.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new q.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new q.EventEmitter),this._onBlur=this.register(new q.EventEmitter),this._onA11yCharEmitter=this.register(new q.EventEmitter),this._onA11yTabEmitter=this.register(new q.EventEmitter),this._onWillOpen=this.register(new q.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((G,oe)=>this.refresh(G,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((G=>this._reportWindowsOptions(G)))),this.register(this._inputHandler.onColor((G=>this._handleColorEvent(G)))),this.register((0,q.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,q.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,q.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,q.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((G=>this._afterResize(G.cols,G.rows)))),this.register((0,H.toDisposable)((()=>{var G,oe;this._customKeyEventHandler=void 0,(oe=(G=this.element)==null?void 0:G.parentNode)==null||oe.removeChild(this.element)})))}_handleColorEvent(se){if(this._themeService)for(const G of se){let oe,le="";switch(G.index){case 256:oe="foreground",le="10";break;case 257:oe="background",le="11";break;case 258:oe="cursor",le="12";break;default:oe="ansi",le="4;"+G.index}switch(G.type){case 0:const pe=I.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[G.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${le};${(0,B.toRgbString)(pe)}${J.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((be=>be.ansi[G.index]=I.channels.toColor(...G.color)));else{const be=oe;this._themeService.modifyColors((Me=>Me[be]=I.channels.toColor(...G.color)))}break;case 2:this._themeService.restoreColor(G.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(se){se?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(se){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var se;return(se=this.textarea)==null?void 0:se.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.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 se=this.buffer.ybase+this.buffer.y,G=this.buffer.lines.get(se);if(!G)return;const oe=Math.min(this.buffer.x,this.cols-1),le=this._renderService.dimensions.css.cell.height,pe=G.getWidth(oe),be=this._renderService.dimensions.css.cell.width*pe,Me=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=Me+"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,h.addDisposableDomListener)(this.element,"copy",(G=>{this.hasSelection()&&(0,u.copyHandler)(G,this._selectionService)})));const se=G=>(0,u.handlePasteEvent)(G,this.textarea,this.coreService,this.optionsService);this.register((0,h.addDisposableDomListener)(this.textarea,"paste",se)),this.register((0,h.addDisposableDomListener)(this.element,"paste",se)),Q.isFirefox?this.register((0,h.addDisposableDomListener)(this.element,"mousedown",(G=>{G.button===2&&(0,u.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,h.addDisposableDomListener)(this.element,"contextmenu",(G=>{(0,u.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Q.isLinux&&this.register((0,h.addDisposableDomListener)(this.element,"auxclick",(G=>{G.button===1&&(0,u.moveTextAreaUnderMouseCursor)(G,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,h.addDisposableDomListener)(this.textarea,"keyup",(se=>this._keyUp(se)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keydown",(se=>this._keyDown(se)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keypress",(se=>this._keyPress(se)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionupdate",(se=>this._compositionHelper.compositionupdate(se)))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,h.addDisposableDomListener)(this.textarea,"input",(se=>this._inputEvent(se)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(se){var oe;if(!se)throw new Error("Terminal requires a parent element.");if(se.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((oe=this.element)==null?void 0:oe.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=se.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"),se.appendChild(this.element);const G=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),G.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,h.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),G.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),Q.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,se.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,h.addDisposableDomListener)(this.textarea,"focus",(le=>this._handleTextAreaFocus(le)))),this.register((0,h.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(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(D.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.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(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(z.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(_.Linkifier,this.screenElement)),this.element.appendChild(G);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.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(j.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.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,h.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(k.BufferDecorationRenderer,this.screenElement)),this.register((0,h.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(K.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.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 se=this,G=this.element;function oe(be){const Me=se._mouseService.getMouseReportCoords(be,se.screenElement);if(!Me)return!1;let Le,Ke;switch(be.overrideType||be.type){case"mousemove":Ke=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":Ke=0,Le=be.button<3?be.button:3;break;case"mousedown":Ke=1,Le=be.button<3?be.button:3;break;case"wheel":if(se._customWheelEventHandler&&se._customWheelEventHandler(be)===!1||se.viewport.getLinesScrolled(be)===0)return!1;Ke=be.deltaY<0?0:1,Le=4;break;default:return!1}return!(Ke===void 0||Le===void 0||Le>4)&&se.coreMouseService.triggerMouseEvent({col:Me.col,row:Me.row,x:Me.x,y:Me.y,button:Le,action:Ke,ctrl:be.ctrlKey,alt:be.altKey,shift:be.shiftKey})}const le={mouseup:null,wheel:null,mousedrag:null,mousemove:null},pe={mouseup:be=>(oe(be),be.buttons||(this._document.removeEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.removeEventListener("mousemove",le.mousedrag)),this.cancel(be)),wheel:be=>(oe(be),this.cancel(be,!0)),mousedrag:be=>{be.buttons&&oe(be)},mousemove:be=>{be.buttons||oe(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||(G.addEventListener("mousemove",pe.mousemove),le.mousemove=pe.mousemove):(G.removeEventListener("mousemove",le.mousemove),le.mousemove=null),16&be?le.wheel||(G.addEventListener("wheel",pe.wheel,{passive:!1}),le.wheel=pe.wheel):(G.removeEventListener("wheel",le.wheel),le.wheel=null),2&be?le.mouseup||(le.mouseup=pe.mouseup):(this._document.removeEventListener("mouseup",le.mouseup),le.mouseup=null),4&be?le.mousedrag||(le.mousedrag=pe.mousedrag):(this._document.removeEventListener("mousemove",le.mousedrag),le.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,h.addDisposableDomListener)(G,"mousedown",(be=>{if(be.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(be))return oe(be),le.mouseup&&this._document.addEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.addEventListener("mousemove",le.mousedrag),this.cancel(be)}))),this.register((0,h.addDisposableDomListener)(G,"wheel",(be=>{if(!le.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(be)===!1)return!1;if(!this.buffer.hasScrollback){const Me=this.viewport.getLinesScrolled(be);if(Me===0)return;const Le=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(be.deltaY<0?"A":"B");let Ke="";for(let je=0;je{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(be),this.cancel(be)}),{passive:!0})),this.register((0,h.addDisposableDomListener)(G,"touchmove",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(be)?void 0:this.cancel(be)}),{passive:!1}))}refresh(se,G){var oe;(oe=this._renderService)==null||oe.refreshRows(se,G)}updateCursorStyle(se){var G;(G=this._selectionService)!=null&&G.shouldColumnSelect(se)?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(se,G,oe=0){var le;oe===1?(super.scrollLines(se,G,oe),this.refresh(0,this.rows-1)):(le=this.viewport)==null||le.scrollLines(se)}paste(se){(0,u.paste)(se,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(se){this._customKeyEventHandler=se}attachCustomWheelEventHandler(se){this._customWheelEventHandler=se}registerLinkProvider(se){return this._linkProviderService.registerLinkProvider(se)}registerCharacterJoiner(se){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const G=this._characterJoinerService.register(se);return this.refresh(0,this.rows-1),G}deregisterCharacterJoiner(se){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(se)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(se){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+se)}registerDecoration(se){return this._decorationService.registerDecoration(se)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(se,G,oe){this._selectionService.setSelection(se,G,oe)}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 se;(se=this._selectionService)==null||se.clearSelection()}selectAll(){var se;(se=this._selectionService)==null||se.selectAll()}selectLines(se,G){var oe;(oe=this._selectionService)==null||oe.selectLines(se,G)}_keyDown(se){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(se)===!1)return!1;const G=this.browser.isMac&&this.options.macOptionIsMeta&&se.altKey;if(!G&&!this._compositionHelper.keydown(se))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;G||se.key!=="Dead"&&se.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,Z.evaluateKeyboardEvent)(se,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(se),oe.type===3||oe.type===2){const le=this.rows-1;return this.scrollLines(oe.type===2?-le:le),this.cancel(se,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,se)||(oe.cancel&&this.cancel(se,!0),!oe.key||!!(se.key&&!se.ctrlKey&&!se.altKey&&!se.metaKey&&se.key.length===1&&se.key.charCodeAt(0)>=65&&se.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(oe.key!==J.C0.ETX&&oe.key!==J.C0.CR||(this.textarea.value=""),this._onKey.fire({key:oe.key,domEvent:se}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||se.altKey||se.ctrlKey?this.cancel(se,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(se,G){const oe=se.isMac&&!this.options.macOptionIsMeta&&G.altKey&&!G.ctrlKey&&!G.metaKey||se.isWindows&&G.altKey&&G.ctrlKey&&!G.metaKey||se.isWindows&&G.getModifierState("AltGraph");return G.type==="keypress"?oe:oe&&(!G.keyCode||G.keyCode>47)}_keyUp(se){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(se)===!1||((function(G){return G.keyCode===16||G.keyCode===17||G.keyCode===18})(se)||this.focus(),this.updateCursorStyle(se),this._keyPressHandled=!1)}_keyPress(se){let G;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(se)===!1)return!1;if(this.cancel(se),se.charCode)G=se.charCode;else if(se.which===null||se.which===void 0)G=se.keyCode;else{if(se.which===0||se.charCode===0)return!1;G=se.which}return!(!G||(se.altKey||se.ctrlKey||se.metaKey)&&!this._isThirdLevelShift(this.browser,se)||(G=String.fromCharCode(G),this._onKey.fire({key:G,domEvent:se}),this._showCursor(),this.coreService.triggerDataEvent(G,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(se){if(se.data&&se.inputType==="insertText"&&(!se.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const G=se.data;return this.coreService.triggerDataEvent(G,!0),this.cancel(se),!0}return!1}resize(se,G){se!==this.cols||G!==this.rows?super.resize(se,G):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(se,G){var oe,le;(oe=this._charSizeService)==null||oe.measure(),(le=this.viewport)==null||le.syncScrollArea(!0)}clear(){var se;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 G=1;G{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,u=1e3){this._renderCallback=c,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,u,h){this._rowCount=h,c=c!==void 0?c:0,u=u!==void 0?u: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,u):u;const _=Date.now();if(_-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=_,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=_-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u)}}},1680:function(a,o,c){var u=this&&this.__decorate||function(b,w,y,C){var N,z=arguments.length,T=z<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(N=b[j])&&(T=(z<3?N(T):z>3?N(w,y,T):N(w,y))||T);return z>3&&T&&Object.defineProperty(w,y,T),T},h=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const _=c(3656),p=c(4725),m=c(8460),x=c(844),k=c(2585);let v=o.Viewport=class extends x.Disposable{constructor(b,w,y,C,N,z,T,j){super(),this._viewportElement=b,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=N,this._renderService=z,this._coreBrowserService=T,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 m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(j.colors),this.register(j.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.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(b){if(b)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 b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){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 b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<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(b,w){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&y0&&(y=$),C=""}}return{bufferElements:N,cursorElement:y}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let w=this._applyScrollModifier(b.deltaY,b);return b.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):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._bufferService.rows),w}_applyScrollModifier(b,w){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&w.altKey||y==="ctrl"&&w.ctrlKey||y==="shift"&&w.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const w=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,w!==0&&(this._viewportElement.scrollTop+=w,this._bubbleScroll(b,w))}};o.Viewport=v=u([h(2,k.IBufferService),h(3,k.IOptionsService),h(4,p.ICharSizeService),h(5,p.IRenderService),h(6,p.ICoreBrowserService),h(7,p.IThemeService)],v)},3107:function(a,o,c){var u=this&&this.__decorate||function(k,v,b,w){var y,C=arguments.length,N=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(k,v,b,w);else for(var z=k.length-1;z>=0;z--)(y=k[z])&&(N=(C<3?y(N):C>3?y(v,b,N):y(v,b))||N);return C>3&&N&&Object.defineProperty(v,b,N),N},h=this&&this.__param||function(k,v){return function(b,w){v(b,w,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const _=c(4725),p=c(844),m=c(2585);let x=o.BufferDecorationRenderer=class extends p.Disposable{constructor(k,v,b,w,y){super(),this._screenElement=k,this._bufferService=v,this._coreBrowserService=b,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,p.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 v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((w=k==null?void 0:k.options)==null?void 0:w.layer)==="top"),v.style.width=`${Math.round((k.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(k.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(k.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=k.options.x??0;return b&&b>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(k,v),v}_refreshStyle(k){const v=k.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)k.element&&(k.element.style.display="none",k.onRenderEmitter.fire(k.element));else{let b=this._decorationElements.get(k);b||(b=this._createElement(k),k.element=b,this._decorationElements.set(k,b),this._container.appendChild(b),k.onDispose((()=>{this._decorationElements.delete(k),b.remove()}))),b.style.top=v*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",k.onRenderEmitter.fire(b)}}_refreshXPosition(k,v=k.element){if(!v)return;const b=k.options.x??0;(k.options.anchor||"left")==="right"?v.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(k){var v;(v=this._decorationElements.get(k))==null||v.remove(),this._decorationElements.delete(k),k.dispose()}};o.BufferDecorationRenderer=x=u([h(1,m.IBufferService),h(2,_.ICoreBrowserService),h(3,m.IDecorationService),h(4,_.IRenderService)],x)},5871:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const u of this._zones)if(u.color===c.options.overviewRulerOptions.color&&u.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,c.marker.line))return;if(this._lineAdjacentToZone(u,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(u,c.marker.line)}if(this._zonePoolIndex=c.startBufferLine&&u<=c.endBufferLine}_lineAdjacentToZone(c,u,h){return u>=c.startBufferLine-this._linePadding[h||"full"]&&u<=c.endBufferLine+this._linePadding[h||"full"]}_addLineToZone(c,u){c.startBufferLine=Math.min(c.startBufferLine,u),c.endBufferLine=Math.max(c.endBufferLine,u)}}},5744:function(a,o,c){var u=this&&this.__decorate||function(y,C,N,z){var T,j=arguments.length,M=j<3?C:z===null?z=Object.getOwnPropertyDescriptor(C,N):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,N,z);else for(var D=y.length-1;D>=0;D--)(T=y[D])&&(M=(j<3?T(M):j>3?T(C,N,M):T(C,N))||M);return j>3&&M&&Object.defineProperty(C,N,M),M},h=this&&this.__param||function(y,C){return function(N,z){C(N,z,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const _=c(5871),p=c(4725),m=c(844),x=c(2585),k={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let w=o.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,N,z,T,j,M){var I;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=N,this._decorationService=z,this._renderService=T,this._optionsService=j,this._coreBrowserService=M,this._colorZoneStore=new _.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(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const D=this._canvas.getContext("2d");if(!D)throw new Error("Ctx cannot be null");this._ctx=D,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)((()=>{var $;($=this._canvas)==null||$.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);v.full=this._canvas.width,v.left=y,v.center=C,v.right=y,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=v.left,b.right=v.left+v.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(b[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-k[y.position||"full"]/2),v[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})))}};o.OverviewRulerRenderer=w=u([h(2,x.IBufferService),h(3,x.IDecorationService),h(4,p.IRenderService),h(5,x.IOptionsService),h(6,p.ICoreBrowserService)],w)},2950:function(a,o,c){var u=this&&this.__decorate||function(k,v,b,w){var y,C=arguments.length,N=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(k,v,b,w);else for(var z=k.length-1;z>=0;z--)(y=k[z])&&(N=(C<3?y(N):C>3?y(v,b,N):y(v,b))||N);return C>3&&N&&Object.defineProperty(v,b,N),N},h=this&&this.__param||function(k,v){return function(b,w){v(b,w,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const _=c(4725),p=c(2585),m=c(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(k,v,b,w,y,C){this._textarea=k,this._compositionView=v,this._bufferService=b,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 v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const k=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,b=v.replace(k,"");this._dataAlreadySent=b,v.length>k.length?this._coreService.triggerDataEvent(b,!0):v.lengththis.updateCompositionElements(!0)),0)}}};o.CompositionHelper=x=u([h(2,p.IBufferService),h(3,p.IOptionsService),h(4,p.ICoreService),h(5,_.IRenderService)],x)},9806:(a,o)=>{function c(u,h,_){const p=_.getBoundingClientRect(),m=u.getComputedStyle(_),x=parseInt(m.getPropertyValue("padding-left")),k=parseInt(m.getPropertyValue("padding-top"));return[h.clientX-p.left-x,h.clientY-p.top-k]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(u,h,_,p,m,x,k,v,b){if(!x)return;const w=c(u,h,_);return w?(w[0]=Math.ceil((w[0]+(b?k/2:0))/k),w[1]=Math.ceil(w[1]/v),w[0]=Math.min(Math.max(w[0],1),p+(b?1:0)),w[1]=Math.min(Math.max(w[1],1),m),w):void 0}},9504:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=c(2584);function h(v,b,w,y){const C=v-_(v,w),N=b-_(b,w),z=Math.abs(C-N)-(function(T,j,M){let D=0;const I=T-_(T,M),$=j-_(j,M);for(let q=0;q=0&&vb?"A":"B"}function m(v,b,w,y,C,N){let z=v,T=b,j="";for(;z!==w||T!==y;)z+=C?1:-1,C&&z>N.cols-1?(j+=N.buffer.translateBufferLineToString(T,!1,v,z),z=0,v=0,T++):!C&&z<0&&(j+=N.buffer.translateBufferLineToString(T,!1,0,v+1),z=N.cols-1,v=z,T--);return j+N.buffer.translateBufferLineToString(T,!1,v,z)}function x(v,b){const w=b?"O":"[";return u.C0.ESC+w+v}function k(v,b){v=Math.floor(v);let w="";for(let y=0;y0?I-_(I,$):M;const Q=I,V=(function(J,Z,B,L,F,U){let K;return K=h(B,L,F,U).length>0?L-_(L,F):Z,J=B&&Kv?"D":"C",k(Math.abs(C-v),x(z,y));z=N>b?"D":"C";const T=Math.abs(N-b);return k((function(j,M){return M.cols-j})(N>b?v:C,w)+(T-1)*w.cols+1+((N>b?C:v)-1),x(z,y))}},1296:function(a,o,c){var u=this&&this.__decorate||function(q,H,Q,V){var J,Z=arguments.length,B=Z<3?H:V===null?V=Object.getOwnPropertyDescriptor(H,Q):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(q,H,Q,V);else for(var L=q.length-1;L>=0;L--)(J=q[L])&&(B=(Z<3?J(B):Z>3?J(H,Q,B):J(H,Q))||B);return Z>3&&B&&Object.defineProperty(H,Q,B),B},h=this&&this.__param||function(q,H){return function(Q,V){H(Q,V,q)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const _=c(3787),p=c(2550),m=c(2223),x=c(6171),k=c(6052),v=c(4725),b=c(8055),w=c(8460),y=c(844),C=c(2585),N="xterm-dom-renderer-owner-",z="xterm-rows",T="xterm-fg-",j="xterm-bg-",M="xterm-focus",D="xterm-selection";let I=1,$=o.DomRenderer=class extends y.Disposable{constructor(q,H,Q,V,J,Z,B,L,F,U,K,ne,ce){super(),this._terminal=q,this._document=H,this._element=Q,this._screenElement=V,this._viewportElement=J,this._helperContainer=Z,this._linkifier2=B,this._charSizeService=F,this._optionsService=U,this._bufferService=K,this._coreBrowserService=ne,this._themeService=ce,this._terminalClass=I++,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(z),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(D),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((_e=>this._injectCss(_e)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(_.DomRendererRowFactory,document),this._element.classList.add(N+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((_e=>this._handleLinkHover(_e)))),this.register(this._linkifier2.onHideLinkUnderline((_e=>this._handleLinkLeave(_e)))),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 p.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 q=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*q,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*q),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/q),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/q),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 Q of this._rowElements)Q.style.width=`${this.dimensions.css.canvas.width}px`,Q.style.height=`${this.dimensions.css.cell.height}px`,Q.style.lineHeight=`${this.dimensions.css.cell.height}px`,Q.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const H=`${this._terminalSelector} .${z} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=H,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(q){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let H=`${this._terminalSelector} .${z} { color: ${q.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;H+=`${this._terminalSelector} .${z} .xterm-dim { color: ${b.color.multiplyOpacity(q.foreground,.5).css};}`,H+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Q=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;H+=`@keyframes ${Q} { 50% { border-bottom-style: hidden; }}`,H+=`@keyframes ${V} { 50% { box-shadow: none; }}`,H+=`@keyframes ${J} { 0% { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css}; } 50% { background-color: inherit; color: ${q.cursor.css}; }}`,H+=`${this._terminalSelector} .${z}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${z}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${z}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${z} .xterm-cursor.xterm-cursor-block { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css};}${this._terminalSelector} .${z} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${q.cursor.css} !important; color: ${q.cursorAccent.css} !important;}${this._terminalSelector} .${z} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${q.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${z} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${q.cursor.css} inset;}${this._terminalSelector} .${z} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${q.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,H+=`${this._terminalSelector} .${D} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${D} div { position: absolute; background-color: ${q.selectionBackgroundOpaque.css};}${this._terminalSelector} .${D} div { position: absolute; background-color: ${q.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,B]of q.ansi.entries())H+=`${this._terminalSelector} .${T}${Z} { color: ${B.css}; }${this._terminalSelector} .${T}${Z}.xterm-dim { color: ${b.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${j}${Z} { background-color: ${B.css}; }`;H+=`${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(q.background).css}; }${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(q.background),.5).css}; }${this._terminalSelector} .${j}${m.INVERTED_DEFAULT_COLOR} { background-color: ${q.foreground.css}; }`,this._themeStyleElement.textContent=H}_setDefaultSpacing(){const q=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${q}px`,this._rowFactory.defaultSpacing=q}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(q,H){for(let Q=this._rowElements.length;Q<=H;Q++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>H;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(q,H){this._refreshRowElements(q,H),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(q,H,Q){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(q,H,Q),this.renderRows(0,this._bufferService.rows-1),!q||!H)return;this._selectionRenderModel.update(this._terminal,q,H,Q);const V=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||B<0)return;const L=this._document.createDocumentFragment();if(Q){const F=q[0]>H[0];L.appendChild(this._createSelectionElement(Z,F?H[0]:q[0],F?q[0]:H[0],B-Z+1))}else{const F=V===Z?q[0]:0,U=Z===J?H[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(Z,F,U));const K=B-Z-1;if(L.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,K)),Z!==B){const ne=J===B?H[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(B,0,ne))}}this._selectionContainer.appendChild(L)}_createSelectionElement(q,H,Q,V=1){const J=this._document.createElement("div"),Z=H*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(Q-H);return Z+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-Z),J.style.height=V*this.dimensions.css.cell.height+"px",J.style.top=q*this.dimensions.css.cell.height+"px",J.style.left=`${Z}px`,J.style.width=`${B}px`,J}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 q of this._rowElements)q.replaceChildren()}renderRows(q,H){const Q=this._bufferService.buffer,V=Q.ybase+Q.y,J=Math.min(Q.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=q;F<=H;F++){const U=F+Q.ydisp,K=this._rowElements[F],ne=Q.lines.get(U);if(!K||!ne)break;K.replaceChildren(...this._rowFactory.createRow(ne,U,U===V,B,L,J,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${N}${this._terminalClass}`}_handleLinkHover(q){this._setCellUnderline(q.x1,q.x2,q.y1,q.y2,q.cols,!0)}_handleLinkLeave(q){this._setCellUnderline(q.x1,q.x2,q.y1,q.y2,q.cols,!1)}_setCellUnderline(q,H,Q,V,J,Z){Q<0&&(q=0),V<0&&(H=0);const B=this._bufferService.rows-1;Q=Math.max(Math.min(Q,B),0),V=Math.max(Math.min(V,B),0),J=Math.min(J,this._bufferService.cols);const L=this._bufferService.buffer,F=L.ybase+L.y,U=Math.min(L.x,J-1),K=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let _e=Q;_e<=V;++_e){const se=_e+L.ydisp,G=this._rowElements[_e],oe=L.lines.get(se);if(!G||!oe)break;G.replaceChildren(...this._rowFactory.createRow(oe,se,se===F,ne,ce,U,K,this.dimensions.css.cell.width,this._widthCache,Z?_e===Q?q:0:-1,Z?(_e===V?H:J)-1:-1))}}};o.DomRenderer=$=u([h(7,C.IInstantiationService),h(8,v.ICharSizeService),h(9,C.IOptionsService),h(10,C.IBufferService),h(11,v.ICoreBrowserService),h(12,v.IThemeService)],$)},3787:function(a,o,c){var u=this&&this.__decorate||function(z,T,j,M){var D,I=arguments.length,$=I<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,j):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(z,T,j,M);else for(var q=z.length-1;q>=0;q--)(D=z[q])&&($=(I<3?D($):I>3?D(T,j,$):D(T,j))||$);return I>3&&$&&Object.defineProperty(T,j,$),$},h=this&&this.__param||function(z,T){return function(j,M){T(j,M,z)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const _=c(2223),p=c(643),m=c(511),x=c(2585),k=c(8055),v=c(4725),b=c(4269),w=c(6171),y=c(3734);let C=o.DomRendererRowFactory=class{constructor(z,T,j,M,D,I,$){this._document=z,this._characterJoinerService=T,this._optionsService=j,this._coreBrowserService=M,this._coreService=D,this._decorationService=I,this._themeService=$,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(z,T,j){this._selectionStart=z,this._selectionEnd=T,this._columnSelectMode=j}createRow(z,T,j,M,D,I,$,q,H,Q,V){const J=[],Z=this._characterJoinerService.getJoinedCharacters(T),B=this._themeService.colors;let L,F=z.getNoBgTrimmedLength();j&&F0&&Me===Z[0][0]){Ke=!0;const yt=Z.shift();we=new b.JoinedCellData(this._workCell,z.translateToString(!0,yt[0],yt[1]),yt[1]-yt[0]),je=yt[1]-1,Le=we.getWidth()}const rt=this._isCellInSelection(Me,T),Ze=j&&Me===I,at=be&&Me>=Q&&Me<=V;let St=!1;this._decorationService.forEachDecorationAtCell(Me,T,void 0,(yt=>{St=!0}));let Ft=we.getChars()||p.WHITESPACE_CELL_CHAR;if(Ft===" "&&(we.isUnderline()||we.isOverline())&&(Ft=" "),le=Le*q-H.get(Ft,we.isBold(),we.isItalic()),L){if(U&&(rt&&oe||!rt&&!oe&&we.bg===ne)&&(rt&&oe&&B.selectionForeground||we.fg===ce)&&we.extended.ext===_e&&at===se&&le===G&&!Ze&&!Ke&&!St){we.isInvisible()?K+=p.WHITESPACE_CELL_CHAR:K+=Ft,U++;continue}U&&(L.textContent=K),L=this._document.createElement("span"),U=0,K=""}else L=this._document.createElement("span");if(ne=we.bg,ce=we.fg,_e=we.extended.ext,se=at,G=le,oe=rt,Ke&&I>=Me&&I<=je&&(I=Me),!this._coreService.isCursorHidden&&Ze&&this._coreService.isCursorInitialized){if(pe.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&pe.push("xterm-cursor-blink"),pe.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(D)switch(D){case"outline":pe.push("xterm-cursor-outline");break;case"block":pe.push("xterm-cursor-block");break;case"bar":pe.push("xterm-cursor-bar");break;case"underline":pe.push("xterm-cursor-underline")}}if(we.isBold()&&pe.push("xterm-bold"),we.isItalic()&&pe.push("xterm-italic"),we.isDim()&&pe.push("xterm-dim"),K=we.isInvisible()?p.WHITESPACE_CELL_CHAR:we.getChars()||p.WHITESPACE_CELL_CHAR,we.isUnderline()&&(pe.push(`xterm-underline-${we.extended.underlineStyle}`),K===" "&&(K=" "),!we.isUnderlineColorDefault()))if(we.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(we.getUnderlineColor()).join(",")})`;else{let yt=we.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&we.isBold()&&yt<8&&(yt+=8),L.style.textDecorationColor=B.ansi[yt].css}we.isOverline()&&(pe.push("xterm-overline"),K===" "&&(K=" ")),we.isStrikethrough()&&pe.push("xterm-strikethrough"),at&&(L.style.textDecoration="underline");let ut=we.getFgColor(),dt=we.getFgColorMode(),Ie=we.getBgColor(),me=we.getBgColorMode();const Ae=!!we.isInverse();if(Ae){const yt=ut;ut=Ie,Ie=yt;const Zt=dt;dt=me,me=Zt}let Pe,nt,_t,pt=!1;switch(this._decorationService.forEachDecorationAtCell(Me,T,void 0,(yt=>{yt.options.layer!=="top"&&pt||(yt.backgroundColorRGB&&(me=50331648,Ie=yt.backgroundColorRGB.rgba>>8&16777215,Pe=yt.backgroundColorRGB),yt.foregroundColorRGB&&(dt=50331648,ut=yt.foregroundColorRGB.rgba>>8&16777215,nt=yt.foregroundColorRGB),pt=yt.options.layer==="top")})),!pt&&rt&&(Pe=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,Ie=Pe.rgba>>8&16777215,me=50331648,pt=!0,B.selectionForeground&&(dt=50331648,ut=B.selectionForeground.rgba>>8&16777215,nt=B.selectionForeground)),pt&&pe.push("xterm-decoration-top"),me){case 16777216:case 33554432:_t=B.ansi[Ie],pe.push(`xterm-bg-${Ie}`);break;case 50331648:_t=k.channels.toColor(Ie>>16,Ie>>8&255,255&Ie),this._addStyle(L,`background-color:#${N((Ie>>>0).toString(16),"0",6)}`);break;default:Ae?(_t=B.foreground,pe.push(`xterm-bg-${_.INVERTED_DEFAULT_COLOR}`)):_t=B.background}switch(Pe||we.isDim()&&(Pe=k.color.multiplyOpacity(_t,.5)),dt){case 16777216:case 33554432:we.isBold()&&ut<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ut+=8),this._applyMinimumContrast(L,_t,B.ansi[ut],we,Pe,void 0)||pe.push(`xterm-fg-${ut}`);break;case 50331648:const yt=k.channels.toColor(ut>>16&255,ut>>8&255,255&ut);this._applyMinimumContrast(L,_t,yt,we,Pe,nt)||this._addStyle(L,`color:#${N(ut.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,_t,B.foreground,we,Pe,nt)||Ae&&pe.push(`xterm-fg-${_.INVERTED_DEFAULT_COLOR}`)}pe.length&&(L.className=pe.join(" "),pe.length=0),Ze||Ke||St?L.textContent=K:U++,le!==this.defaultSpacing&&(L.style.letterSpacing=`${le}px`),J.push(L),Me=je}return L&&U&&(L.textContent=K),J}_applyMinimumContrast(z,T,j,M,D,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const $=this._getContrastCache(M);let q;if(D||I||(q=$.getColor(T.rgba,j.rgba)),q===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);q=k.color.ensureContrastRatio(D||T,I||j,H),$.setColor((D||T).rgba,(I||j).rgba,q??null)}return!!q&&(this._addStyle(z,`color:${q.css}`),!0)}_getContrastCache(z){return z.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(z,T){z.setAttribute("style",`${z.getAttribute("style")||""}${T};`)}_isCellInSelection(z,T){const j=this._selectionStart,M=this._selectionEnd;return!(!j||!M)&&(this._columnSelectMode?j[0]<=M[0]?z>=j[0]&&T>=j[1]&&z=j[1]&&z>=M[0]&&T<=M[1]:T>j[1]&&T=j[0]&&z=j[0])}};function N(z,T,j){for(;z.length{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,u){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 h=c.createElement("span");h.classList.add("xterm-char-measure-element");const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold";const p=c.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=c.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[h,_,p,m],this._container.appendChild(h),this._container.appendChild(_),this._container.appendChild(p),this._container.appendChild(m),u.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,u,h,_){c===this._font&&u===this._fontSize&&h===this._weight&&_===this._weightBold||(this._font=c,this._fontSize=u,this._weight=h,this._weightBold=_,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${h}`,this._measureElements[1].style.fontWeight=`${_}`,this._measureElements[2].style.fontWeight=`${h}`,this._measureElements[3].style.fontWeight=`${_}`,this.clear())}get(c,u,h){let _=0;if(!u&&!h&&c.length===1&&(_=c.charCodeAt(0))<256){if(this._flat[_]!==-9999)return this._flat[_];const x=this._measure(c,0);return x>0&&(this._flat[_]=x),x}let p=c;u&&(p+="B"),h&&(p+="I");let m=this._holey.get(p);if(m===void 0){let x=0;u&&(x|=1),h&&(x|=2),m=this._measure(c,x),m>0&&this._holey.set(p,m)}return m}_measure(c,u){const h=this._measureElements[u];return h.textContent=c.repeat(32),h.offsetWidth/32}}},2223:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function c(h){return 57508<=h&&h<=57558}function u(h){return h>=128512&&h<=128591||h>=127744&&h<=128511||h>=128640&&h<=128767||h>=9728&&h<=9983||h>=9984&&h<=10175||h>=65024&&h<=65039||h>=129280&&h<=129535||h>=127462&&h<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},o.isEmoji=u,o.allowRescaling=function(h,_,p,m){return _===1&&p>Math.ceil(1.5*m)&&h!==void 0&&h>255&&!u(h)&&!c(h)&&!(function(x){return 57344<=x&&x<=63743})(h)},o.treatGlyphAsBackgroundColor=function(h){return c(h)||(function(_){return 9472<=_&&_<=9631})(h)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(h,_,p=0){return(h-(2*Math.round(_)-p))%(2*Math.round(_))}},6052:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(h,_,p,m=!1){if(this.selectionStart=_,this.selectionEnd=p,!_||!p||_[0]===p[0]&&_[1]===p[1])return void this.clear();const x=h.buffers.active.ydisp,k=_[1]-x,v=p[1]-x,b=Math.max(k,0),w=Math.min(v,h.rows-1);b>=h.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=k,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=w,this.startCol=_[0],this.endCol=p[0])}isCellSelected(h,_,p){return!!this.hasSelection&&(p-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?_>=this.startCol&&p>=this.viewportCappedStartRow&&_=this.viewportCappedStartRow&&_>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p=this.startCol&&_=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,u=this.selectionEnd;return!(!c||!u)&&(c[1]>u[1]||c[1]===u[1]&&c[0]>u[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(a,o,c){var u=this&&this.__decorate||function(w,y,C,N){var z,T=arguments.length,j=T<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,N);else for(var M=w.length-1;M>=0;M--)(z=w[M])&&(j=(T<3?z(j):T>3?z(y,C,j):z(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},h=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const _=c(2585),p=c(8460),m=c(844);let x=o.CharSizeService=class extends m.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 p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new v(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())}};o.CharSizeService=x=u([h(2,_.IOptionsService)],x);class k extends m.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 v 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 b 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(a,o,c){var u=this&&this.__decorate||function(b,w,y,C){var N,z=arguments.length,T=z<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(N=b[j])&&(T=(z<3?N(T):z>3?N(w,y,T):N(w,y))||T);return z>3&&T&&Object.defineProperty(w,y,T),T},h=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const _=c(3734),p=c(643),m=c(511),x=c(2585);class k extends _.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()]}}o.JoinedCellData=k;let v=o.CharacterJoinerService=class YI{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.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 $=this._getJoinedRanges(N,j,T,y,z);for(let q=0;q<$.length;q++)C.push($[q])}z=I,j=T,M=this._workCell.fg,D=this._workCell.bg}T+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-z>1){const I=this._getJoinedRanges(N,j,T,y,z);for(let $=0;${Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const u=c(844),h=c(8460),_=c(3656);class p extends u.Disposable{constructor(k,v,b){super(),this._textarea=k,this._window=v,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new h.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((w=>this._screenDprMonitor.setWindow(w)))),this.register((0,h.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}}o.CoreBrowserService=p;class m extends u.Disposable{constructor(k){super(),this._parentWindow=k,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(k){this._parentWindow=k,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,_.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:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const u=c(844);class h extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}o.LinkProviderService=h},8934:function(a,o,c){var u=this&&this.__decorate||function(x,k,v,b){var w,y=arguments.length,C=y<3?k:b===null?b=Object.getOwnPropertyDescriptor(k,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(x,k,v,b);else for(var N=x.length-1;N>=0;N--)(w=x[N])&&(C=(y<3?w(C):y>3?w(k,v,C):w(k,v))||C);return y>3&&C&&Object.defineProperty(k,v,C),C},h=this&&this.__param||function(x,k){return function(v,b){k(v,b,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const _=c(4725),p=c(9806);let m=o.MouseService=class{constructor(x,k){this._renderService=x,this._charSizeService=k}getCoords(x,k,v,b,w){return(0,p.getCoords)(window,x,k,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(x,k){const v=(0,p.getCoordsRelativeToElement)(window,x,k);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=m=u([h(0,_.IRenderService),h(1,_.ICharSizeService)],m)},3230:function(a,o,c){var u=this&&this.__decorate||function(w,y,C,N){var z,T=arguments.length,j=T<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,N);else for(var M=w.length-1;M>=0;M--)(z=w[M])&&(j=(T<3?z(j):T>3?z(y,C,j):z(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},h=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const _=c(6193),p=c(4725),m=c(8460),x=c(844),k=c(7226),v=c(2585);let b=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,N,z,T,j,M){super(),this._rowCount=w,this._charSizeService=N,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new k.DebouncedIdleTask,this._observerDisposable=this.register(new x.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 m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new _.RenderDebouncer(((D,I)=>this._renderRows(D,I)),j),this.register(this._renderDebouncer),this.register(j.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var D;return(D=this._renderer.value)==null?void 0:D.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(z.onDecorationRegistered((()=>this._fullRefresh()))),this.register(z.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(j.window,y),this.register(j.onWindowChange((D=>this._registerIntersectionObserver(D,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,x.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()}};o.RenderService=b=u([h(2,v.IOptionsService),h(3,p.ICharSizeService),h(4,v.IDecorationService),h(5,v.IBufferService),h(6,p.ICoreBrowserService),h(7,p.IThemeService)],b)},9312:function(a,o,c){var u=this&&this.__decorate||function(j,M,D,I){var $,q=arguments.length,H=q<3?M:I===null?I=Object.getOwnPropertyDescriptor(M,D):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(j,M,D,I);else for(var Q=j.length-1;Q>=0;Q--)($=j[Q])&&(H=(q<3?$(H):q>3?$(M,D,H):$(M,D))||H);return q>3&&H&&Object.defineProperty(M,D,H),H},h=this&&this.__param||function(j,M){return function(D,I){M(D,I,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const _=c(9806),p=c(9504),m=c(456),x=c(4725),k=c(8460),v=c(844),b=c(6114),w=c(4841),y=c(511),C=c(2585),N=" ",z=new RegExp(N,"g");let T=o.SelectionService=class extends v.Disposable{constructor(j,M,D,I,$,q,H,Q,V){super(),this._element=j,this._screenElement=M,this._linkifier=D,this._bufferService=I,this._coreService=$,this._mouseService=q,this._optionsService=H,this._renderService=Q,this._coreBrowserService=V,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=J=>this._handleMouseMove(J),this._mouseUpListener=J=>this._handleMouseUp(J),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((J=>this._handleTrim(J))),this.register(this._bufferService.buffers.onBufferActivate((J=>this._handleBufferActivate(J)))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.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 j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!j||!M||j[0]===M[0]&&j[1]===M[1])}get selectionText(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!j||!M)return"";const D=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(j[0]===M[0])return"";const $=j[0]$.replace(z," "))).join(b.isWindows?`\r +WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=m=u([h(0,p.IBufferService),h(1,p.IOptionsService),h(2,p.IOscLinkService)],m)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,u){this._renderCallback=c,this._coreBrowserService=u,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,u,h){this._rowCount=h,c=c!==void 0?c:0,u=u!==void 0?u: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,u):u,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),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const u=c(3614),h=c(3656),_=c(3551),p=c(9042),m=c(3730),w=c(1680),k=c(3107),v=c(5744),b=c(2950),x=c(1296),y=c(428),C=c(4269),z=c(5114),E=c(8934),T=c(3230),j=c(9312),M=c(4725),D=c(6731),I=c(8055),$=c(8969),q=c(8460),H=c(844),Q=c(6114),V=c(8437),Z=c(2584),Y=c(7399),B=c(5941),L=c(9074),F=c(2585),U=c(5435),K=c(4567),ne=c(779);class oe extends $.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(se={}){super(se),this.browser=Q,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new q.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new q.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new q.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new q.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new q.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new q.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new q.EventEmitter),this._onBlur=this.register(new q.EventEmitter),this._onA11yCharEmitter=this.register(new q.EventEmitter),this._onA11yTabEmitter=this.register(new q.EventEmitter),this._onWillOpen=this.register(new q.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((G,ae)=>this.refresh(G,ae)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((G=>this._reportWindowsOptions(G)))),this.register(this._inputHandler.onColor((G=>this._handleColorEvent(G)))),this.register((0,q.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,q.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,q.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,q.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((G=>this._afterResize(G.cols,G.rows)))),this.register((0,H.toDisposable)((()=>{var G,ae;this._customKeyEventHandler=void 0,(ae=(G=this.element)==null?void 0:G.parentNode)==null||ae.removeChild(this.element)})))}_handleColorEvent(se){if(this._themeService)for(const G of se){let ae,ce="";switch(G.index){case 256:ae="foreground",ce="10";break;case 257:ae="background",ce="11";break;case 258:ae="cursor",ce="12";break;default:ae="ansi",ce="4;"+G.index}switch(G.type){case 0:const pe=I.color.toColorRGB(ae==="ansi"?this._themeService.colors.ansi[G.index]:this._themeService.colors[ae]);this.coreService.triggerDataEvent(`${Z.C0.ESC}]${ce};${(0,B.toRgbString)(pe)}${Z.C1_ESCAPED.ST}`);break;case 1:if(ae==="ansi")this._themeService.modifyColors((be=>be.ansi[G.index]=I.channels.toColor(...G.color)));else{const be=ae;this._themeService.modifyColors((Ae=>Ae[be]=I.channels.toColor(...G.color)))}break;case 2:this._themeService.restoreColor(G.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(se){se?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(se){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var se;return(se=this.textarea)==null?void 0:se.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 se=this.buffer.ybase+this.buffer.y,G=this.buffer.lines.get(se);if(!G)return;const ae=Math.min(this.buffer.x,this.cols-1),ce=this._renderService.dimensions.css.cell.height,pe=G.getWidth(ae),be=this._renderService.dimensions.css.cell.width*pe,Ae=this.buffer.y*this._renderService.dimensions.css.cell.height,De=ae*this._renderService.dimensions.css.cell.width;this.textarea.style.left=De+"px",this.textarea.style.top=Ae+"px",this.textarea.style.width=be+"px",this.textarea.style.height=ce+"px",this.textarea.style.lineHeight=ce+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,h.addDisposableDomListener)(this.element,"copy",(G=>{this.hasSelection()&&(0,u.copyHandler)(G,this._selectionService)})));const se=G=>(0,u.handlePasteEvent)(G,this.textarea,this.coreService,this.optionsService);this.register((0,h.addDisposableDomListener)(this.textarea,"paste",se)),this.register((0,h.addDisposableDomListener)(this.element,"paste",se)),Q.isFirefox?this.register((0,h.addDisposableDomListener)(this.element,"mousedown",(G=>{G.button===2&&(0,u.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,h.addDisposableDomListener)(this.element,"contextmenu",(G=>{(0,u.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Q.isLinux&&this.register((0,h.addDisposableDomListener)(this.element,"auxclick",(G=>{G.button===1&&(0,u.moveTextAreaUnderMouseCursor)(G,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,h.addDisposableDomListener)(this.textarea,"keyup",(se=>this._keyUp(se)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keydown",(se=>this._keyDown(se)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keypress",(se=>this._keyPress(se)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionupdate",(se=>this._compositionHelper.compositionupdate(se)))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,h.addDisposableDomListener)(this.textarea,"input",(se=>this._inputEvent(se)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(se){var ae;if(!se)throw new Error("Terminal requires a parent element.");if(se.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ae=this.element)==null?void 0:ae.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=se.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"),se.appendChild(this.element);const G=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),G.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,h.addDisposableDomListener)(this.screenElement,"mousemove",(ce=>this.updateCursorStyle(ce)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),G.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),Q.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(z.CoreBrowserService,this.textarea,se.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,h.addDisposableDomListener)(this.textarea,"focus",(ce=>this._handleTextAreaFocus(ce)))),this.register((0,h.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(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(D.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ce=>this._onRender.fire(ce)))),this.onResize((ce=>this._renderService.resize(ce.cols,ce.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(E.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(_.Linkifier,this.screenElement)),this.element.appendChild(G);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ce=>this.scrollLines(ce.amount,ce.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(j.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ce=>this.scrollLines(ce.amount,ce.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ce=>this._renderService.handleSelectionChanged(ce.start,ce.end,ce.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ce=>{this.textarea.value=ce,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ce=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(k.BufferDecorationRenderer,this.screenElement)),this.register((0,h.addDisposableDomListener)(this.element,"mousedown",(ce=>this._selectionService.handleMouseDown(ce)))),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(K.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ce=>this._handleScreenReaderModeOptionChange(ce)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ce=>{!this._overviewRulerRenderer&&ce&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(x.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const se=this,G=this.element;function ae(be){const Ae=se._mouseService.getMouseReportCoords(be,se.screenElement);if(!Ae)return!1;let De,We;switch(be.overrideType||be.type){case"mousemove":We=32,be.buttons===void 0?(De=3,be.button!==void 0&&(De=be.button<3?be.button:3)):De=1&be.buttons?0:4&be.buttons?1:2&be.buttons?2:3;break;case"mouseup":We=0,De=be.button<3?be.button:3;break;case"mousedown":We=1,De=be.button<3?be.button:3;break;case"wheel":if(se._customWheelEventHandler&&se._customWheelEventHandler(be)===!1||se.viewport.getLinesScrolled(be)===0)return!1;We=be.deltaY<0?0:1,De=4;break;default:return!1}return!(We===void 0||De===void 0||De>4)&&se.coreMouseService.triggerMouseEvent({col:Ae.col,row:Ae.row,x:Ae.x,y:Ae.y,button:De,action:We,ctrl:be.ctrlKey,alt:be.altKey,shift:be.shiftKey})}const ce={mouseup:null,wheel:null,mousedrag:null,mousemove:null},pe={mouseup:be=>(ae(be),be.buttons||(this._document.removeEventListener("mouseup",ce.mouseup),ce.mousedrag&&this._document.removeEventListener("mousemove",ce.mousedrag)),this.cancel(be)),wheel:be=>(ae(be),this.cancel(be,!0)),mousedrag:be=>{be.buttons&&ae(be)},mousemove:be=>{be.buttons||ae(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?ce.mousemove||(G.addEventListener("mousemove",pe.mousemove),ce.mousemove=pe.mousemove):(G.removeEventListener("mousemove",ce.mousemove),ce.mousemove=null),16&be?ce.wheel||(G.addEventListener("wheel",pe.wheel,{passive:!1}),ce.wheel=pe.wheel):(G.removeEventListener("wheel",ce.wheel),ce.wheel=null),2&be?ce.mouseup||(ce.mouseup=pe.mouseup):(this._document.removeEventListener("mouseup",ce.mouseup),ce.mouseup=null),4&be?ce.mousedrag||(ce.mousedrag=pe.mousedrag):(this._document.removeEventListener("mousemove",ce.mousedrag),ce.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,h.addDisposableDomListener)(G,"mousedown",(be=>{if(be.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(be))return ae(be),ce.mouseup&&this._document.addEventListener("mouseup",ce.mouseup),ce.mousedrag&&this._document.addEventListener("mousemove",ce.mousedrag),this.cancel(be)}))),this.register((0,h.addDisposableDomListener)(G,"wheel",(be=>{if(!ce.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(be)===!1)return!1;if(!this.buffer.hasScrollback){const Ae=this.viewport.getLinesScrolled(be);if(Ae===0)return;const De=Z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(be.deltaY<0?"A":"B");let We="";for(let Ne=0;Ne{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(be),this.cancel(be)}),{passive:!0})),this.register((0,h.addDisposableDomListener)(G,"touchmove",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(be)?void 0:this.cancel(be)}),{passive:!1}))}refresh(se,G){var ae;(ae=this._renderService)==null||ae.refreshRows(se,G)}updateCursorStyle(se){var G;(G=this._selectionService)!=null&&G.shouldColumnSelect(se)?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(se,G,ae=0){var ce;ae===1?(super.scrollLines(se,G,ae),this.refresh(0,this.rows-1)):(ce=this.viewport)==null||ce.scrollLines(se)}paste(se){(0,u.paste)(se,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(se){this._customKeyEventHandler=se}attachCustomWheelEventHandler(se){this._customWheelEventHandler=se}registerLinkProvider(se){return this._linkProviderService.registerLinkProvider(se)}registerCharacterJoiner(se){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const G=this._characterJoinerService.register(se);return this.refresh(0,this.rows-1),G}deregisterCharacterJoiner(se){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(se)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(se){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+se)}registerDecoration(se){return this._decorationService.registerDecoration(se)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(se,G,ae){this._selectionService.setSelection(se,G,ae)}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 se;(se=this._selectionService)==null||se.clearSelection()}selectAll(){var se;(se=this._selectionService)==null||se.selectAll()}selectLines(se,G){var ae;(ae=this._selectionService)==null||ae.selectLines(se,G)}_keyDown(se){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(se)===!1)return!1;const G=this.browser.isMac&&this.options.macOptionIsMeta&&se.altKey;if(!G&&!this._compositionHelper.keydown(se))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;G||se.key!=="Dead"&&se.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ae=(0,Y.evaluateKeyboardEvent)(se,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(se),ae.type===3||ae.type===2){const ce=this.rows-1;return this.scrollLines(ae.type===2?-ce:ce),this.cancel(se,!0)}return ae.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,se)||(ae.cancel&&this.cancel(se,!0),!ae.key||!!(se.key&&!se.ctrlKey&&!se.altKey&&!se.metaKey&&se.key.length===1&&se.key.charCodeAt(0)>=65&&se.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ae.key!==Z.C0.ETX&&ae.key!==Z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ae.key,domEvent:se}),this._showCursor(),this.coreService.triggerDataEvent(ae.key,!0),!this.optionsService.rawOptions.screenReaderMode||se.altKey||se.ctrlKey?this.cancel(se,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(se,G){const ae=se.isMac&&!this.options.macOptionIsMeta&&G.altKey&&!G.ctrlKey&&!G.metaKey||se.isWindows&&G.altKey&&G.ctrlKey&&!G.metaKey||se.isWindows&&G.getModifierState("AltGraph");return G.type==="keypress"?ae:ae&&(!G.keyCode||G.keyCode>47)}_keyUp(se){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(se)===!1||((function(G){return G.keyCode===16||G.keyCode===17||G.keyCode===18})(se)||this.focus(),this.updateCursorStyle(se),this._keyPressHandled=!1)}_keyPress(se){let G;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(se)===!1)return!1;if(this.cancel(se),se.charCode)G=se.charCode;else if(se.which===null||se.which===void 0)G=se.keyCode;else{if(se.which===0||se.charCode===0)return!1;G=se.which}return!(!G||(se.altKey||se.ctrlKey||se.metaKey)&&!this._isThirdLevelShift(this.browser,se)||(G=String.fromCharCode(G),this._onKey.fire({key:G,domEvent:se}),this._showCursor(),this.coreService.triggerDataEvent(G,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(se){if(se.data&&se.inputType==="insertText"&&(!se.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const G=se.data;return this.coreService.triggerDataEvent(G,!0),this.cancel(se),!0}return!1}resize(se,G){se!==this.cols||G!==this.rows?super.resize(se,G):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(se,G){var ae,ce;(ae=this._charSizeService)==null||ae.measure(),(ce=this.viewport)==null||ce.syncScrollArea(!0)}clear(){var se;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 G=1;G{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,u=1e3){this._renderCallback=c,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,u,h){this._rowCount=h,c=c!==void 0?c:0,u=u!==void 0?u: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,u):u;const _=Date.now();if(_-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=_,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=_-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u)}}},1680:function(a,o,c){var u=this&&this.__decorate||function(b,x,y,C){var z,E=arguments.length,T=E<3?x:C===null?C=Object.getOwnPropertyDescriptor(x,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,x,y,C);else for(var j=b.length-1;j>=0;j--)(z=b[j])&&(T=(E<3?z(T):E>3?z(x,y,T):z(x,y))||T);return E>3&&T&&Object.defineProperty(x,y,T),T},h=this&&this.__param||function(b,x){return function(y,C){x(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const _=c(3656),p=c(4725),m=c(8460),w=c(844),k=c(2585);let v=o.Viewport=class extends w.Disposable{constructor(b,x,y,C,z,E,T,j){super(),this._viewportElement=b,this._scrollArea=x,this._bufferService=y,this._optionsService=C,this._charSizeService=z,this._renderService=E,this._coreBrowserService=T,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 m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(j.colors),this.register(j.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.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(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const x=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==x&&(this._lastRecordedBufferHeight=x,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const x=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:x,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<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(b,x){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(x<0&&this._viewportElement.scrollTop!==0||x>0&&y0&&(y=$),C=""}}return{bufferElements:z,cursorElement:y}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let x=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(x/=this._currentRowHeight+0,this._wheelPartialScroll+=x,x=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._bufferService.rows),x}_applyScrollModifier(b,x){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&x.altKey||y==="ctrl"&&x.ctrlKey||y==="shift"&&x.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const x=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,x!==0&&(this._viewportElement.scrollTop+=x,this._bubbleScroll(b,x))}};o.Viewport=v=u([h(2,k.IBufferService),h(3,k.IOptionsService),h(4,p.ICharSizeService),h(5,p.IRenderService),h(6,p.ICoreBrowserService),h(7,p.IThemeService)],v)},3107:function(a,o,c){var u=this&&this.__decorate||function(k,v,b,x){var y,C=arguments.length,z=C<3?v:x===null?x=Object.getOwnPropertyDescriptor(v,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(k,v,b,x);else for(var E=k.length-1;E>=0;E--)(y=k[E])&&(z=(C<3?y(z):C>3?y(v,b,z):y(v,b))||z);return C>3&&z&&Object.defineProperty(v,b,z),z},h=this&&this.__param||function(k,v){return function(b,x){v(b,x,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const _=c(4725),p=c(844),m=c(2585);let w=o.BufferDecorationRenderer=class extends p.Disposable{constructor(k,v,b,x,y){super(),this._screenElement=k,this._bufferService=v,this._coreBrowserService=b,this._decorationService=x,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((C=>this._removeDecoration(C)))),this.register((0,p.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 x;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((x=k==null?void 0:k.options)==null?void 0:x.layer)==="top"),v.style.width=`${Math.round((k.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(k.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(k.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=k.options.x??0;return b&&b>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(k,v),v}_refreshStyle(k){const v=k.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)k.element&&(k.element.style.display="none",k.onRenderEmitter.fire(k.element));else{let b=this._decorationElements.get(k);b||(b=this._createElement(k),k.element=b,this._decorationElements.set(k,b),this._container.appendChild(b),k.onDispose((()=>{this._decorationElements.delete(k),b.remove()}))),b.style.top=v*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",k.onRenderEmitter.fire(b)}}_refreshXPosition(k,v=k.element){if(!v)return;const b=k.options.x??0;(k.options.anchor||"left")==="right"?v.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(k){var v;(v=this._decorationElements.get(k))==null||v.remove(),this._decorationElements.delete(k),k.dispose()}};o.BufferDecorationRenderer=w=u([h(1,m.IBufferService),h(2,_.ICoreBrowserService),h(3,m.IDecorationService),h(4,_.IRenderService)],w)},5871:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const u of this._zones)if(u.color===c.options.overviewRulerOptions.color&&u.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,c.marker.line))return;if(this._lineAdjacentToZone(u,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(u,c.marker.line)}if(this._zonePoolIndex=c.startBufferLine&&u<=c.endBufferLine}_lineAdjacentToZone(c,u,h){return u>=c.startBufferLine-this._linePadding[h||"full"]&&u<=c.endBufferLine+this._linePadding[h||"full"]}_addLineToZone(c,u){c.startBufferLine=Math.min(c.startBufferLine,u),c.endBufferLine=Math.max(c.endBufferLine,u)}}},5744:function(a,o,c){var u=this&&this.__decorate||function(y,C,z,E){var T,j=arguments.length,M=j<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,z):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,z,E);else for(var D=y.length-1;D>=0;D--)(T=y[D])&&(M=(j<3?T(M):j>3?T(C,z,M):T(C,z))||M);return j>3&&M&&Object.defineProperty(C,z,M),M},h=this&&this.__param||function(y,C){return function(z,E){C(z,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const _=c(5871),p=c(4725),m=c(844),w=c(2585),k={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let x=o.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,z,E,T,j,M){var I;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=z,this._decorationService=E,this._renderService=T,this._optionsService=j,this._coreBrowserService=M,this._colorZoneStore=new _.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(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const D=this._canvas.getContext("2d");if(!D)throw new Error("Ctx cannot be null");this._ctx=D,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)((()=>{var $;($=this._canvas)==null||$.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);v.full=this._canvas.width,v.left=y,v.center=C,v.right=y,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=v.left,b.right=v.left+v.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(b[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-k[y.position||"full"]/2),v[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})))}};o.OverviewRulerRenderer=x=u([h(2,w.IBufferService),h(3,w.IDecorationService),h(4,p.IRenderService),h(5,w.IOptionsService),h(6,p.ICoreBrowserService)],x)},2950:function(a,o,c){var u=this&&this.__decorate||function(k,v,b,x){var y,C=arguments.length,z=C<3?v:x===null?x=Object.getOwnPropertyDescriptor(v,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(k,v,b,x);else for(var E=k.length-1;E>=0;E--)(y=k[E])&&(z=(C<3?y(z):C>3?y(v,b,z):y(v,b))||z);return C>3&&z&&Object.defineProperty(v,b,z),z},h=this&&this.__param||function(k,v){return function(b,x){v(b,x,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const _=c(4725),p=c(2585),m=c(2584);let w=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(k,v,b,x,y,C){this._textarea=k,this._compositionView=v,this._bufferService=b,this._optionsService=x,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 v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const k=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,b=v.replace(k,"");this._dataAlreadySent=b,v.length>k.length?this._coreService.triggerDataEvent(b,!0):v.lengththis.updateCompositionElements(!0)),0)}}};o.CompositionHelper=w=u([h(2,p.IBufferService),h(3,p.IOptionsService),h(4,p.ICoreService),h(5,_.IRenderService)],w)},9806:(a,o)=>{function c(u,h,_){const p=_.getBoundingClientRect(),m=u.getComputedStyle(_),w=parseInt(m.getPropertyValue("padding-left")),k=parseInt(m.getPropertyValue("padding-top"));return[h.clientX-p.left-w,h.clientY-p.top-k]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(u,h,_,p,m,w,k,v,b){if(!w)return;const x=c(u,h,_);return x?(x[0]=Math.ceil((x[0]+(b?k/2:0))/k),x[1]=Math.ceil(x[1]/v),x[0]=Math.min(Math.max(x[0],1),p+(b?1:0)),x[1]=Math.min(Math.max(x[1],1),m),x):void 0}},9504:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=c(2584);function h(v,b,x,y){const C=v-_(v,x),z=b-_(b,x),E=Math.abs(C-z)-(function(T,j,M){let D=0;const I=T-_(T,M),$=j-_(j,M);for(let q=0;q=0&&vb?"A":"B"}function m(v,b,x,y,C,z){let E=v,T=b,j="";for(;E!==x||T!==y;)E+=C?1:-1,C&&E>z.cols-1?(j+=z.buffer.translateBufferLineToString(T,!1,v,E),E=0,v=0,T++):!C&&E<0&&(j+=z.buffer.translateBufferLineToString(T,!1,0,v+1),E=z.cols-1,v=E,T--);return j+z.buffer.translateBufferLineToString(T,!1,v,E)}function w(v,b){const x=b?"O":"[";return u.C0.ESC+x+v}function k(v,b){v=Math.floor(v);let x="";for(let y=0;y0?I-_(I,$):M;const Q=I,V=(function(Z,Y,B,L,F,U){let K;return K=h(B,L,F,U).length>0?L-_(L,F):Y,Z=B&&Kv?"D":"C",k(Math.abs(C-v),w(E,y));E=z>b?"D":"C";const T=Math.abs(z-b);return k((function(j,M){return M.cols-j})(z>b?v:C,x)+(T-1)*x.cols+1+((z>b?C:v)-1),w(E,y))}},1296:function(a,o,c){var u=this&&this.__decorate||function(q,H,Q,V){var Z,Y=arguments.length,B=Y<3?H:V===null?V=Object.getOwnPropertyDescriptor(H,Q):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(q,H,Q,V);else for(var L=q.length-1;L>=0;L--)(Z=q[L])&&(B=(Y<3?Z(B):Y>3?Z(H,Q,B):Z(H,Q))||B);return Y>3&&B&&Object.defineProperty(H,Q,B),B},h=this&&this.__param||function(q,H){return function(Q,V){H(Q,V,q)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const _=c(3787),p=c(2550),m=c(2223),w=c(6171),k=c(6052),v=c(4725),b=c(8055),x=c(8460),y=c(844),C=c(2585),z="xterm-dom-renderer-owner-",E="xterm-rows",T="xterm-fg-",j="xterm-bg-",M="xterm-focus",D="xterm-selection";let I=1,$=o.DomRenderer=class extends y.Disposable{constructor(q,H,Q,V,Z,Y,B,L,F,U,K,ne,oe){super(),this._terminal=q,this._document=H,this._element=Q,this._screenElement=V,this._viewportElement=Z,this._helperContainer=Y,this._linkifier2=B,this._charSizeService=F,this._optionsService=U,this._bufferService=K,this._coreBrowserService=ne,this._themeService=oe,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,k.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new x.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(D),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ue=>this._injectCss(ue)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(_.DomRendererRowFactory,document),this._element.classList.add(z+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ue=>this._handleLinkHover(ue)))),this.register(this._linkifier2.onHideLinkUnderline((ue=>this._handleLinkLeave(ue)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(z+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.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 q=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*q,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*q),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/q),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/q),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 Q of this._rowElements)Q.style.width=`${this.dimensions.css.canvas.width}px`,Q.style.height=`${this.dimensions.css.cell.height}px`,Q.style.lineHeight=`${this.dimensions.css.cell.height}px`,Q.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const H=`${this._terminalSelector} .${E} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=H,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(q){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let H=`${this._terminalSelector} .${E} { color: ${q.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;H+=`${this._terminalSelector} .${E} .xterm-dim { color: ${b.color.multiplyOpacity(q.foreground,.5).css};}`,H+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Q=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,Z=`blink_block_${this._terminalClass}`;H+=`@keyframes ${Q} { 50% { border-bottom-style: hidden; }}`,H+=`@keyframes ${V} { 50% { box-shadow: none; }}`,H+=`@keyframes ${Z} { 0% { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css}; } 50% { background-color: inherit; color: ${q.cursor.css}; }}`,H+=`${this._terminalSelector} .${E}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${E}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${E}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css};}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${q.cursor.css} !important; color: ${q.cursorAccent.css} !important;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${q.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${q.cursor.css} inset;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${q.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,H+=`${this._terminalSelector} .${D} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${D} div { position: absolute; background-color: ${q.selectionBackgroundOpaque.css};}${this._terminalSelector} .${D} div { position: absolute; background-color: ${q.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,B]of q.ansi.entries())H+=`${this._terminalSelector} .${T}${Y} { color: ${B.css}; }${this._terminalSelector} .${T}${Y}.xterm-dim { color: ${b.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${j}${Y} { background-color: ${B.css}; }`;H+=`${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(q.background).css}; }${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(q.background),.5).css}; }${this._terminalSelector} .${j}${m.INVERTED_DEFAULT_COLOR} { background-color: ${q.foreground.css}; }`,this._themeStyleElement.textContent=H}_setDefaultSpacing(){const q=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${q}px`,this._rowFactory.defaultSpacing=q}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(q,H){for(let Q=this._rowElements.length;Q<=H;Q++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>H;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(q,H){this._refreshRowElements(q,H),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(q,H,Q){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(q,H,Q),this.renderRows(0,this._bufferService.rows-1),!q||!H)return;this._selectionRenderModel.update(this._terminal,q,H,Q);const V=this._selectionRenderModel.viewportStartRow,Z=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||B<0)return;const L=this._document.createDocumentFragment();if(Q){const F=q[0]>H[0];L.appendChild(this._createSelectionElement(Y,F?H[0]:q[0],F?q[0]:H[0],B-Y+1))}else{const F=V===Y?q[0]:0,U=Y===Z?H[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(Y,F,U));const K=B-Y-1;if(L.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,K)),Y!==B){const ne=Z===B?H[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(B,0,ne))}}this._selectionContainer.appendChild(L)}_createSelectionElement(q,H,Q,V=1){const Z=this._document.createElement("div"),Y=H*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(Q-H);return Y+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-Y),Z.style.height=V*this.dimensions.css.cell.height+"px",Z.style.top=q*this.dimensions.css.cell.height+"px",Z.style.left=`${Y}px`,Z.style.width=`${B}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 q of this._rowElements)q.replaceChildren()}renderRows(q,H){const Q=this._bufferService.buffer,V=Q.ybase+Q.y,Z=Math.min(Q.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=q;F<=H;F++){const U=F+Q.ydisp,K=this._rowElements[F],ne=Q.lines.get(U);if(!K||!ne)break;K.replaceChildren(...this._rowFactory.createRow(ne,U,U===V,B,L,Z,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${z}${this._terminalClass}`}_handleLinkHover(q){this._setCellUnderline(q.x1,q.x2,q.y1,q.y2,q.cols,!0)}_handleLinkLeave(q){this._setCellUnderline(q.x1,q.x2,q.y1,q.y2,q.cols,!1)}_setCellUnderline(q,H,Q,V,Z,Y){Q<0&&(q=0),V<0&&(H=0);const B=this._bufferService.rows-1;Q=Math.max(Math.min(Q,B),0),V=Math.max(Math.min(V,B),0),Z=Math.min(Z,this._bufferService.cols);const L=this._bufferService.buffer,F=L.ybase+L.y,U=Math.min(L.x,Z-1),K=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,oe=this._optionsService.rawOptions.cursorInactiveStyle;for(let ue=Q;ue<=V;++ue){const se=ue+L.ydisp,G=this._rowElements[ue],ae=L.lines.get(se);if(!G||!ae)break;G.replaceChildren(...this._rowFactory.createRow(ae,se,se===F,ne,oe,U,K,this.dimensions.css.cell.width,this._widthCache,Y?ue===Q?q:0:-1,Y?(ue===V?H:Z)-1:-1))}}};o.DomRenderer=$=u([h(7,C.IInstantiationService),h(8,v.ICharSizeService),h(9,C.IOptionsService),h(10,C.IBufferService),h(11,v.ICoreBrowserService),h(12,v.IThemeService)],$)},3787:function(a,o,c){var u=this&&this.__decorate||function(E,T,j,M){var D,I=arguments.length,$=I<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,j):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(E,T,j,M);else for(var q=E.length-1;q>=0;q--)(D=E[q])&&($=(I<3?D($):I>3?D(T,j,$):D(T,j))||$);return I>3&&$&&Object.defineProperty(T,j,$),$},h=this&&this.__param||function(E,T){return function(j,M){T(j,M,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const _=c(2223),p=c(643),m=c(511),w=c(2585),k=c(8055),v=c(4725),b=c(4269),x=c(6171),y=c(3734);let C=o.DomRendererRowFactory=class{constructor(E,T,j,M,D,I,$){this._document=E,this._characterJoinerService=T,this._optionsService=j,this._coreBrowserService=M,this._coreService=D,this._decorationService=I,this._themeService=$,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(E,T,j){this._selectionStart=E,this._selectionEnd=T,this._columnSelectMode=j}createRow(E,T,j,M,D,I,$,q,H,Q,V){const Z=[],Y=this._characterJoinerService.getJoinedCharacters(T),B=this._themeService.colors;let L,F=E.getNoBgTrimmedLength();j&&F0&&Ae===Y[0][0]){We=!0;const yt=Y.shift();xe=new b.JoinedCellData(this._workCell,E.translateToString(!0,yt[0],yt[1]),yt[1]-yt[0]),Ne=yt[1]-1,De=xe.getWidth()}const rt=this._isCellInSelection(Ae,T),Ze=j&&Ae===I,ct=be&&Ae>=Q&&Ae<=V;let Ct=!1;this._decorationService.forEachDecorationAtCell(Ae,T,void 0,(yt=>{Ct=!0}));let qt=xe.getChars()||p.WHITESPACE_CELL_CHAR;if(qt===" "&&(xe.isUnderline()||xe.isOverline())&&(qt=" "),ce=De*q-H.get(qt,xe.isBold(),xe.isItalic()),L){if(U&&(rt&&ae||!rt&&!ae&&xe.bg===ne)&&(rt&&ae&&B.selectionForeground||xe.fg===oe)&&xe.extended.ext===ue&&ct===se&&ce===G&&!Ze&&!We&&!Ct){xe.isInvisible()?K+=p.WHITESPACE_CELL_CHAR:K+=qt,U++;continue}U&&(L.textContent=K),L=this._document.createElement("span"),U=0,K=""}else L=this._document.createElement("span");if(ne=xe.bg,oe=xe.fg,ue=xe.extended.ext,se=ct,G=ce,ae=rt,We&&I>=Ae&&I<=Ne&&(I=Ae),!this._coreService.isCursorHidden&&Ze&&this._coreService.isCursorInitialized){if(pe.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&pe.push("xterm-cursor-blink"),pe.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(D)switch(D){case"outline":pe.push("xterm-cursor-outline");break;case"block":pe.push("xterm-cursor-block");break;case"bar":pe.push("xterm-cursor-bar");break;case"underline":pe.push("xterm-cursor-underline")}}if(xe.isBold()&&pe.push("xterm-bold"),xe.isItalic()&&pe.push("xterm-italic"),xe.isDim()&&pe.push("xterm-dim"),K=xe.isInvisible()?p.WHITESPACE_CELL_CHAR:xe.getChars()||p.WHITESPACE_CELL_CHAR,xe.isUnderline()&&(pe.push(`xterm-underline-${xe.extended.underlineStyle}`),K===" "&&(K=" "),!xe.isUnderlineColorDefault()))if(xe.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(xe.getUnderlineColor()).join(",")})`;else{let yt=xe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&xe.isBold()&&yt<8&&(yt+=8),L.style.textDecorationColor=B.ansi[yt].css}xe.isOverline()&&(pe.push("xterm-overline"),K===" "&&(K=" ")),xe.isStrikethrough()&&pe.push("xterm-strikethrough"),ct&&(L.style.textDecoration="underline");let dt=xe.getFgColor(),ht=xe.getFgColorMode(),Le=xe.getBgColor(),me=xe.getBgColorMode();const Te=!!xe.isInverse();if(Te){const yt=dt;dt=Le,Le=yt;const Zt=ht;ht=me,me=Zt}let He,nt,_t,St=!1;switch(this._decorationService.forEachDecorationAtCell(Ae,T,void 0,(yt=>{yt.options.layer!=="top"&&St||(yt.backgroundColorRGB&&(me=50331648,Le=yt.backgroundColorRGB.rgba>>8&16777215,He=yt.backgroundColorRGB),yt.foregroundColorRGB&&(ht=50331648,dt=yt.foregroundColorRGB.rgba>>8&16777215,nt=yt.foregroundColorRGB),St=yt.options.layer==="top")})),!St&&rt&&(He=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,Le=He.rgba>>8&16777215,me=50331648,St=!0,B.selectionForeground&&(ht=50331648,dt=B.selectionForeground.rgba>>8&16777215,nt=B.selectionForeground)),St&&pe.push("xterm-decoration-top"),me){case 16777216:case 33554432:_t=B.ansi[Le],pe.push(`xterm-bg-${Le}`);break;case 50331648:_t=k.channels.toColor(Le>>16,Le>>8&255,255&Le),this._addStyle(L,`background-color:#${z((Le>>>0).toString(16),"0",6)}`);break;default:Te?(_t=B.foreground,pe.push(`xterm-bg-${_.INVERTED_DEFAULT_COLOR}`)):_t=B.background}switch(He||xe.isDim()&&(He=k.color.multiplyOpacity(_t,.5)),ht){case 16777216:case 33554432:xe.isBold()&&dt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(dt+=8),this._applyMinimumContrast(L,_t,B.ansi[dt],xe,He,void 0)||pe.push(`xterm-fg-${dt}`);break;case 50331648:const yt=k.channels.toColor(dt>>16&255,dt>>8&255,255&dt);this._applyMinimumContrast(L,_t,yt,xe,He,nt)||this._addStyle(L,`color:#${z(dt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,_t,B.foreground,xe,He,nt)||Te&&pe.push(`xterm-fg-${_.INVERTED_DEFAULT_COLOR}`)}pe.length&&(L.className=pe.join(" "),pe.length=0),Ze||We||Ct?L.textContent=K:U++,ce!==this.defaultSpacing&&(L.style.letterSpacing=`${ce}px`),Z.push(L),Ae=Ne}return L&&U&&(L.textContent=K),Z}_applyMinimumContrast(E,T,j,M,D,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,x.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const $=this._getContrastCache(M);let q;if(D||I||(q=$.getColor(T.rgba,j.rgba)),q===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);q=k.color.ensureContrastRatio(D||T,I||j,H),$.setColor((D||T).rgba,(I||j).rgba,q??null)}return!!q&&(this._addStyle(E,`color:${q.css}`),!0)}_getContrastCache(E){return E.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(E,T){E.setAttribute("style",`${E.getAttribute("style")||""}${T};`)}_isCellInSelection(E,T){const j=this._selectionStart,M=this._selectionEnd;return!(!j||!M)&&(this._columnSelectMode?j[0]<=M[0]?E>=j[0]&&T>=j[1]&&E=j[1]&&E>=M[0]&&T<=M[1]:T>j[1]&&T=j[0]&&E=j[0])}};function z(E,T,j){for(;E.length{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,u){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 h=c.createElement("span");h.classList.add("xterm-char-measure-element");const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold";const p=c.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=c.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[h,_,p,m],this._container.appendChild(h),this._container.appendChild(_),this._container.appendChild(p),this._container.appendChild(m),u.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,u,h,_){c===this._font&&u===this._fontSize&&h===this._weight&&_===this._weightBold||(this._font=c,this._fontSize=u,this._weight=h,this._weightBold=_,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${h}`,this._measureElements[1].style.fontWeight=`${_}`,this._measureElements[2].style.fontWeight=`${h}`,this._measureElements[3].style.fontWeight=`${_}`,this.clear())}get(c,u,h){let _=0;if(!u&&!h&&c.length===1&&(_=c.charCodeAt(0))<256){if(this._flat[_]!==-9999)return this._flat[_];const w=this._measure(c,0);return w>0&&(this._flat[_]=w),w}let p=c;u&&(p+="B"),h&&(p+="I");let m=this._holey.get(p);if(m===void 0){let w=0;u&&(w|=1),h&&(w|=2),m=this._measure(c,w),m>0&&this._holey.set(p,m)}return m}_measure(c,u){const h=this._measureElements[u];return h.textContent=c.repeat(32),h.offsetWidth/32}}},2223:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function c(h){return 57508<=h&&h<=57558}function u(h){return h>=128512&&h<=128591||h>=127744&&h<=128511||h>=128640&&h<=128767||h>=9728&&h<=9983||h>=9984&&h<=10175||h>=65024&&h<=65039||h>=129280&&h<=129535||h>=127462&&h<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},o.isEmoji=u,o.allowRescaling=function(h,_,p,m){return _===1&&p>Math.ceil(1.5*m)&&h!==void 0&&h>255&&!u(h)&&!c(h)&&!(function(w){return 57344<=w&&w<=63743})(h)},o.treatGlyphAsBackgroundColor=function(h){return c(h)||(function(_){return 9472<=_&&_<=9631})(h)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(h,_,p=0){return(h-(2*Math.round(_)-p))%(2*Math.round(_))}},6052:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(h,_,p,m=!1){if(this.selectionStart=_,this.selectionEnd=p,!_||!p||_[0]===p[0]&&_[1]===p[1])return void this.clear();const w=h.buffers.active.ydisp,k=_[1]-w,v=p[1]-w,b=Math.max(k,0),x=Math.min(v,h.rows-1);b>=h.rows||x<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=k,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=x,this.startCol=_[0],this.endCol=p[0])}isCellSelected(h,_,p){return!!this.hasSelection&&(p-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?_>=this.startCol&&p>=this.viewportCappedStartRow&&_=this.viewportCappedStartRow&&_>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p=this.startCol&&_=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,u=this.selectionEnd;return!(!c||!u)&&(c[1]>u[1]||c[1]===u[1]&&c[0]>u[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(a,o,c){var u=this&&this.__decorate||function(x,y,C,z){var E,T=arguments.length,j=T<3?y:z===null?z=Object.getOwnPropertyDescriptor(y,C):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(x,y,C,z);else for(var M=x.length-1;M>=0;M--)(E=x[M])&&(j=(T<3?E(j):T>3?E(y,C,j):E(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},h=this&&this.__param||function(x,y){return function(C,z){y(C,z,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const _=c(2585),p=c(8460),m=c(844);let w=o.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(x,y,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new v(x,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const x=this._measureStrategy.measure();x.width===this.width&&x.height===this.height||(this.width=x.width,this.height=x.height,this._onCharSizeChange.fire())}};o.CharSizeService=w=u([h(2,_.IOptionsService)],w);class k extends m.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 v extends k{constructor(y,C,z){super(),this._document=y,this._parentElement=C,this._optionsService=z,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 b 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(a,o,c){var u=this&&this.__decorate||function(b,x,y,C){var z,E=arguments.length,T=E<3?x:C===null?C=Object.getOwnPropertyDescriptor(x,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,x,y,C);else for(var j=b.length-1;j>=0;j--)(z=b[j])&&(T=(E<3?z(T):E>3?z(x,y,T):z(x,y))||T);return E>3&&T&&Object.defineProperty(x,y,T),T},h=this&&this.__param||function(b,x){return function(y,C){x(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const _=c(3734),p=c(643),m=c(511),w=c(2585);class k extends _.AttributeData{constructor(x,y,C){super(),this.content=0,this.combinedData="",this.fg=x.fg,this.bg=x.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(x){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=k;let v=o.CharacterJoinerService=class e${constructor(x){this._bufferService=x,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(x){const y={id:this._nextCharacterJoinerId++,handler:x};return this._characterJoiners.push(y),y.id}deregister(x){for(let y=0;y1){const $=this._getJoinedRanges(z,j,T,y,E);for(let q=0;q<$.length;q++)C.push($[q])}E=I,j=T,M=this._workCell.fg,D=this._workCell.bg}T+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-E>1){const I=this._getJoinedRanges(z,j,T,y,E);for(let $=0;${Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const u=c(844),h=c(8460),_=c(3656);class p extends u.Disposable{constructor(k,v,b){super(),this._textarea=k,this._window=v,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new h.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((x=>this._screenDprMonitor.setWindow(x)))),this.register((0,h.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}}o.CoreBrowserService=p;class m extends u.Disposable{constructor(k){super(),this._parentWindow=k,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(k){this._parentWindow=k,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,_.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:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const u=c(844);class h extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}o.LinkProviderService=h},8934:function(a,o,c){var u=this&&this.__decorate||function(w,k,v,b){var x,y=arguments.length,C=y<3?k:b===null?b=Object.getOwnPropertyDescriptor(k,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(w,k,v,b);else for(var z=w.length-1;z>=0;z--)(x=w[z])&&(C=(y<3?x(C):y>3?x(k,v,C):x(k,v))||C);return y>3&&C&&Object.defineProperty(k,v,C),C},h=this&&this.__param||function(w,k){return function(v,b){k(v,b,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const _=c(4725),p=c(9806);let m=o.MouseService=class{constructor(w,k){this._renderService=w,this._charSizeService=k}getCoords(w,k,v,b,x){return(0,p.getCoords)(window,w,k,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,x)}getMouseReportCoords(w,k){const v=(0,p.getCoordsRelativeToElement)(window,w,k);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=m=u([h(0,_.IRenderService),h(1,_.ICharSizeService)],m)},3230:function(a,o,c){var u=this&&this.__decorate||function(x,y,C,z){var E,T=arguments.length,j=T<3?y:z===null?z=Object.getOwnPropertyDescriptor(y,C):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(x,y,C,z);else for(var M=x.length-1;M>=0;M--)(E=x[M])&&(j=(T<3?E(j):T>3?E(y,C,j):E(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},h=this&&this.__param||function(x,y){return function(C,z){y(C,z,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const _=c(6193),p=c(4725),m=c(8460),w=c(844),k=c(7226),v=c(2585);let b=o.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(x,y,C,z,E,T,j,M){super(),this._rowCount=x,this._charSizeService=z,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new k.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new _.RenderDebouncer(((D,I)=>this._renderRows(D,I)),j),this.register(this._renderDebouncer),this.register(j.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var D;return(D=this._renderer.value)==null?void 0:D.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(T.cols,T.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(j.window,y),this.register(j.onWindowChange((D=>this._registerIntersectionObserver(D,y))))}_registerIntersectionObserver(x,y){if("IntersectionObserver"in x){const C=new x.IntersectionObserver((z=>this._handleIntersectionChange(z[z.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,w.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(x){this._isPaused=x.isIntersecting===void 0?x.intersectionRatio===0:!x.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(x,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(x,y,this._rowCount))}_renderRows(x,y){this._renderer.value&&(x=Math.min(x,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(x,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:x,end:y}),this._onRender.fire({start:x,end:y}),this._isNextRenderRedrawOnly=!0)}resize(x,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(x){this._renderer.value=x,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(x){return this._renderDebouncer.addRefreshCallback(x)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var x,y;this._renderer.value&&((y=(x=this._renderer.value).clearTextureAtlas)==null||y.call(x),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(x,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(x,y)})):this._renderer.value.handleResize(x,y),this._fullRefresh())}handleCharSizeChanged(){var x;(x=this._renderer.value)==null||x.handleCharSizeChanged()}handleBlur(){var x;(x=this._renderer.value)==null||x.handleBlur()}handleFocus(){var x;(x=this._renderer.value)==null||x.handleFocus()}handleSelectionChanged(x,y,C){var z;this._selectionState.start=x,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(z=this._renderer.value)==null||z.handleSelectionChanged(x,y,C)}handleCursorMove(){var x;(x=this._renderer.value)==null||x.handleCursorMove()}clear(){var x;(x=this._renderer.value)==null||x.clear()}};o.RenderService=b=u([h(2,v.IOptionsService),h(3,p.ICharSizeService),h(4,v.IDecorationService),h(5,v.IBufferService),h(6,p.ICoreBrowserService),h(7,p.IThemeService)],b)},9312:function(a,o,c){var u=this&&this.__decorate||function(j,M,D,I){var $,q=arguments.length,H=q<3?M:I===null?I=Object.getOwnPropertyDescriptor(M,D):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(j,M,D,I);else for(var Q=j.length-1;Q>=0;Q--)($=j[Q])&&(H=(q<3?$(H):q>3?$(M,D,H):$(M,D))||H);return q>3&&H&&Object.defineProperty(M,D,H),H},h=this&&this.__param||function(j,M){return function(D,I){M(D,I,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const _=c(9806),p=c(9504),m=c(456),w=c(4725),k=c(8460),v=c(844),b=c(6114),x=c(4841),y=c(511),C=c(2585),z=" ",E=new RegExp(z,"g");let T=o.SelectionService=class extends v.Disposable{constructor(j,M,D,I,$,q,H,Q,V){super(),this._element=j,this._screenElement=M,this._linkifier=D,this._bufferService=I,this._coreService=$,this._mouseService=q,this._optionsService=H,this._renderService=Q,this._coreBrowserService=V,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 m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.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 j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!j||!M||j[0]===M[0]&&j[1]===M[1])}get selectionText(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!j||!M)return"";const D=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(j[0]===M[0])return"";const $=j[0]$.replace(E," "))).join(b.isWindows?`\r `:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(j){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&j&&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(j){const M=this._getMouseBufferCoords(j),D=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(D&&I&&M)&&this._areCoordsInSelection(M,D,I)}isCellInSelection(j,M){const D=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!D||!I)&&this._areCoordsInSelection([j,M],D,I)}_areCoordsInSelection(j,M,D){return j[1]>M[1]&&j[1]=M[0]&&j[0]=M[0]}_selectWordAtCursor(j,M){var $,q;const D=(q=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:q.range;if(D)return this._model.selectionStart=[D.start.x-1,D.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(D,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(j);return!!I&&(this._selectWordAt(I,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,M){this._model.clearSelection(),j=Math.max(j,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const M=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(j){let M=(0,_.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const D=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=D?0:(M>D&&(M-=D),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(j){return b.isMac?j.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:j.shiftKey}handleMouseDown(j){if(this._mouseDownTimeStamp=j.timeStamp,(j.button!==2||!this.hasSelection)&&j.button===0){if(!this._enabled){if(!this.shouldForceSelection(j))return;j.stopPropagation()}j.preventDefault(),this._dragScrollAmount=0,this._enabled&&j.shiftKey?this._handleIncrementalClick(j):j.detail===1?this._handleSingleClick(j):j.detail===2?this._handleDoubleClick(j):j.detail===3&&this._handleTripleClick(j),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(j){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(j))}_handleSingleClick(j){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(j)?3:0,this._model.selectionStart=this._getMouseBufferCoords(j),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const M=this._getMouseBufferCoords(j);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(j){return j.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(j),!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 D=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(j.ydisp+this._bufferService.rows,j.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=j.ydisp),this.refresh()}}_handleMouseUp(j){const M=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const D=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(D&&D[0]!==void 0&&D[1]!==void 0){const I=(0,p.moveToCellSequence)(D[0]-1,D[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,D=!(!j||!M||j[0]===M[0]&&j[1]===M[1]);D?j&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,M,D)):this._oldHasSelection&&this._fireOnSelectionChange(j,M,D)}_fireOnSelectionChange(j,M,D){this._oldSelectionStart=j,this._oldSelectionEnd=M,this._oldHasSelection=D,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(j,M){let D=M;for(let I=0;M>=I;I++){const $=j.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?D--:$>1&&M!==I&&(D+=$-1)}return D}setSelection(j,M,D){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,M],this._model.selectionStartLength=D,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,M,D=!0,I=!0){if(j[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,q=$.lines.get(j[1]);if(!q)return;const H=$.translateBufferLineToString(j[1],!1);let Q=this._convertViewportColToCharacterIndex(q,j[0]),V=Q;const J=j[0]-Q;let Z=0,B=0,L=0,F=0;if(H.charAt(Q)===" "){for(;Q>0&&H.charAt(Q-1)===" ";)Q--;for(;V1&&(F+=_e-1,V+=_e-1);ne>0&&Q>0&&!this._isCharWordSeparator(q.loadCell(ne-1,this._workCell));){q.loadCell(ne-1,this._workCell);const se=this._workCell.getChars().length;this._workCell.getWidth()===0?(Z++,ne--):se>1&&(L+=se-1,Q-=se-1),Q--,ne--}for(;ce1&&(F+=se-1,V+=se-1),V++,ce++}}V++;let U=Q+J-Z+L,K=Math.min(this._bufferService.cols,V-Q+Z+B-L-F);if(M||H.slice(Q,V).trim()!==""){if(D&&U===0&&q.getCodePoint(0)!==32){const ne=$.lines.get(j[1]-1);if(ne&&q.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(ce){const _e=this._bufferService.cols-ce.start;U-=_e,K+=_e}}}if(I&&U+K===this._bufferService.cols&&q.getCodePoint(this._bufferService.cols-1)!==32){const ne=$.lines.get(j[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const ce=this._getWordAt([0,j[1]+1],!1,!1,!0);ce&&(K+=ce.length)}}return{start:U,length:K}}}_selectWordAt(j,M){const D=this._getWordAt(j,M);if(D){for(;D.start<0;)D.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[D.start,j[1]],this._model.selectionStartLength=D.length}}_selectToWordAt(j){const M=this._getWordAt(j,!0);if(M){let D=j[1];for(;M.start<0;)M.start+=this._bufferService.cols,D--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,D++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,D]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const M=this._bufferService.buffer.getWrappedRangeForLine(j),D={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(D,this._bufferService.cols)}};o.SelectionService=T=u([h(3,C.IBufferService),h(4,C.ICoreService),h(5,x.IMouseService),h(6,C.IOptionsService),h(7,x.IRenderService),h(8,x.ICoreBrowserService)],T)},4725:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=c(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(a,o,c){var u=this&&this.__decorate||function(T,j,M,D){var I,$=arguments.length,q=$<3?j:D===null?D=Object.getOwnPropertyDescriptor(j,M):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(T,j,M,D);else for(var H=T.length-1;H>=0;H--)(I=T[H])&&(q=($<3?I(q):$>3?I(j,M,q):I(j,M))||q);return $>3&&q&&Object.defineProperty(j,M,q),q},h=this&&this.__param||function(T,j){return function(M,D){j(M,D,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const _=c(7239),p=c(8055),m=c(8460),x=c(844),k=c(2585),v=p.css.toColor("#ffffff"),b=p.css.toColor("#000000"),w=p.css.toColor("#ffffff"),y=p.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let M=0;M<216;M++){const D=j[M/36%6|0],I=j[M/6%6|0],$=j[M%6];T.push({css:p.channels.toCss(D,I,$),rgba:p.channels.toRgba(D,I,$)})}for(let M=0;M<24;M++){const D=8+10*M;T.push({css:p.channels.toCss(D,D,D),rgba:p.channels.toRgba(D,D,D)})}return T})());let N=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new _.ColorContrastCache,this._halfContrastCache=new _.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:p.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:p.color.blend(b,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const j=this._colors;if(j.foreground=z(T.foreground,v),j.background=z(T.background,b),j.cursor=z(T.cursor,w),j.cursorAccent=z(T.cursorAccent,y),j.selectionBackgroundTransparent=z(T.selectionBackground,C),j.selectionBackgroundOpaque=p.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=z(T.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=p.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=T.selectionForeground?z(T.selectionForeground,p.NULL_COLOR):void 0,j.selectionForeground===p.NULL_COLOR&&(j.selectionForeground=void 0),p.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=p.color.opacity(j.selectionBackgroundTransparent,.3)),p.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=p.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=o.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=z(T.black,o.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=z(T.red,o.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=z(T.green,o.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=z(T.yellow,o.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=z(T.blue,o.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=z(T.magenta,o.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=z(T.cyan,o.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=z(T.white,o.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=z(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=z(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=z(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=z(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=z(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=z(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=z(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=z(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(j.ansi.length-16,T.extendedAnsi.length);for(let D=0;D{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=c(8460),h=c(844);class _ extends h.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.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(m){if(this._maxLength===m)return;const x=new Array(m);for(let k=0;kthis._length)for(let x=this._length;x=m;v--)this._array[this._getCyclicIndex(v+k.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;vthis._maxLength){const v=this._length+k.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=k.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,x,k){if(!(x<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+k<0)throw new Error("Cannot shift elements in list beyond index 0");if(k>0){for(let b=x-1;b>=0;b--)this.set(m+b+k,this.get(m+b));const v=m+x+k-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(u,h=5){if(typeof u!="object")return u;const _=Array.isArray(u)?[]:{};for(const p in u)_[p]=h<=1?u[p]:u[p]&&c(u[p],h-1);return _}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,u=0,h=0,_=0;var p,m,x,k,v;function b(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,z,T){return{css:y.toCss(C,N,z,T),rgba:y.toRgba(C,N,z,T)}}})(p||(o.channels=p={})),(function(y){function C(N,z){return _=Math.round(255*z),[c,u,h]=v.toChannels(N.rgba),{css:p.toCss(c,u,h,_),rgba:p.toRgba(c,u,h,_)}}y.blend=function(N,z){if(_=(255&z.rgba)/255,_===1)return{css:z.css,rgba:z.rgba};const T=z.rgba>>24&255,j=z.rgba>>16&255,M=z.rgba>>8&255,D=N.rgba>>24&255,I=N.rgba>>16&255,$=N.rgba>>8&255;return c=D+Math.round((T-D)*_),u=I+Math.round((j-I)*_),h=$+Math.round((M-$)*_),{css:p.toCss(c,u,h),rgba:p.toRgba(c,u,h)}},y.isOpaque=function(N){return(255&N.rgba)==255},y.ensureContrastRatio=function(N,z,T){const j=v.ensureContrastRatio(N.rgba,z.rgba,T);if(j)return p.toColor(j>>24&255,j>>16&255,j>>8&255)},y.opaque=function(N){const z=(255|N.rgba)>>>0;return[c,u,h]=v.toChannels(z),{css:p.toCss(c,u,h),rgba:z}},y.opacity=C,y.multiplyOpacity=function(N,z){return _=255&N.rgba,C(N,_*z/255)},y.toColorRGB=function(N){return[N.rgba>>24&255,N.rgba>>16&255,N.rgba>>8&255]}})(m||(o.color=m={})),(function(y){let C,N;try{const z=document.createElement("canvas");z.width=1,z.height=1;const T=z.getContext("2d",{willReadFrequently:!0});T&&(C=T,C.globalCompositeOperation="copy",N=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(z){if(z.match(/#[\da-f]{3,8}/i))switch(z.length){case 4:return c=parseInt(z.slice(1,2).repeat(2),16),u=parseInt(z.slice(2,3).repeat(2),16),h=parseInt(z.slice(3,4).repeat(2),16),p.toColor(c,u,h);case 5:return c=parseInt(z.slice(1,2).repeat(2),16),u=parseInt(z.slice(2,3).repeat(2),16),h=parseInt(z.slice(3,4).repeat(2),16),_=parseInt(z.slice(4,5).repeat(2),16),p.toColor(c,u,h,_);case 7:return{css:z,rgba:(parseInt(z.slice(1),16)<<8|255)>>>0};case 9:return{css:z,rgba:parseInt(z.slice(1),16)>>>0}}const T=z.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return c=parseInt(T[1]),u=parseInt(T[2]),h=parseInt(T[3]),_=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),p.toColor(c,u,h,_);if(!C||!N)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=N,C.fillStyle=z,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[c,u,h,_]=C.getImageData(0,0,1,1).data,_!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(c,u,h,_),css:z}}})(x||(o.css=x={})),(function(y){function C(N,z,T){const j=N/255,M=z/255,D=T/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))}y.relativeLuminance=function(N){return C(N>>16&255,N>>8&255,255&N)},y.relativeLuminance2=C})(k||(o.rgb=k={})),(function(y){function C(z,T,j){const M=z>>24&255,D=z>>16&255,I=z>>8&255;let $=T>>24&255,q=T>>16&255,H=T>>8&255,Q=w(k.relativeLuminance2($,q,H),k.relativeLuminance2(M,D,I));for(;Q0||q>0||H>0);)$-=Math.max(0,Math.ceil(.1*$)),q-=Math.max(0,Math.ceil(.1*q)),H-=Math.max(0,Math.ceil(.1*H)),Q=w(k.relativeLuminance2($,q,H),k.relativeLuminance2(M,D,I));return($<<24|q<<16|H<<8|255)>>>0}function N(z,T,j){const M=z>>24&255,D=z>>16&255,I=z>>8&255;let $=T>>24&255,q=T>>16&255,H=T>>8&255,Q=w(k.relativeLuminance2($,q,H),k.relativeLuminance2(M,D,I));for(;Q>>0}y.blend=function(z,T){if(_=(255&T)/255,_===1)return T;const j=T>>24&255,M=T>>16&255,D=T>>8&255,I=z>>24&255,$=z>>16&255,q=z>>8&255;return c=I+Math.round((j-I)*_),u=$+Math.round((M-$)*_),h=q+Math.round((D-q)*_),p.toRgba(c,u,h)},y.ensureContrastRatio=function(z,T,j){const M=k.relativeLuminance(z>>8),D=k.relativeLuminance(T>>8);if(w(M,D)>8));if(Hw(M,k.relativeLuminance(Q>>8))?q:Q}return q}const I=N(z,T,j),$=w(M,k.relativeLuminance(I>>8));if($w(M,k.relativeLuminance(q>>8))?I:q}return I}},y.reduceLuminance=C,y.increaseLuminance=N,y.toChannels=function(z){return[z>>24&255,z>>16&255,z>>8&255,255&z]}})(v||(o.rgba=v={})),o.toPaddedHex=b,o.contrastRatio=w},8969:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=c(844),h=c(2585),_=c(4348),p=c(7866),m=c(744),x=c(7302),k=c(6975),v=c(8460),b=c(1753),w=c(1480),y=c(7994),C=c(9282),N=c(5435),z=c(5981),T=c(2660);let j=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((I=>{var $;($=this._onScrollApi)==null||$.fire(I.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(I){for(const $ in I)this.optionsService.options[$]=I[$]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new _.InstantiationService,this.optionsService=this.register(new x.OptionsService(I)),this._instantiationService.setService(h.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(h.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(h.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(k.CoreService)),this._instantiationService.setService(h.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(h.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(h.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(h.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(h.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,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.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(($=>{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(($=>{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 z.WriteBuffer((($,q)=>this._inputHandler.parse($,q)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,$){this._writeBuffer.write(I,$)}writeSync(I,$){this._logService.logLevel<=h.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(I,$)}input(I,$=!0){this.coreService.triggerDataEvent(I,$)}resize(I,$){isNaN(I)||isNaN($)||(I=Math.max(I,m.MINIMUM_COLS),$=Math.max($,m.MINIMUM_ROWS),this._bufferService.resize(I,$))}scroll(I,$=!1){this._bufferService.scroll(I,$)}scrollLines(I,$,q){this._bufferService.scrollLines(I,$,q)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const $=I-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(I,$){return this._inputHandler.registerEscHandler(I,$)}registerDcsHandler(I,$){return this._inputHandler.registerDcsHandler(I,$)}registerCsiHandler(I,$){return this._inputHandler.registerCsiHandler(I,$)}registerOscHandler(I,$){return this._inputHandler.registerOscHandler(I,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?I=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const $ of I)$.dispose()}))}}}o.CoreTerminal=M},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;uu.fire(h)))},o.runAndSubscribe=function(c,u){return u(void 0),c((h=>u(h)))}},5435:function(a,o,c){var u=this&&this.__decorate||function(Z,B,L,F){var U,K=arguments.length,ne=K<3?B:F===null?F=Object.getOwnPropertyDescriptor(B,L):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(Z,B,L,F);else for(var ce=Z.length-1;ce>=0;ce--)(U=Z[ce])&&(ne=(K<3?U(ne):K>3?U(B,L,ne):U(B,L))||ne);return K>3&&ne&&Object.defineProperty(B,L,ne),ne},h=this&&this.__param||function(Z,B){return function(L,F){B(L,F,Z)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const _=c(2584),p=c(7116),m=c(2015),x=c(844),k=c(482),v=c(8437),b=c(8460),w=c(643),y=c(511),C=c(3734),N=c(2585),z=c(1480),T=c(6242),j=c(6351),M=c(5941),D={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function $(Z,B){if(Z>24)return B.setWinLines||!1;switch(Z){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var q;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(q||(o.WindowsOptionsReportType=q={}));let H=0;class Q extends x.Disposable{getAttrData(){return this._curAttrData}constructor(B,L,F,U,K,ne,ce,_e,se=new m.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=L,this._coreService=F,this._logService=U,this._optionsService=K,this._oscLinkService=ne,this._coreMouseService=ce,this._unicodeService=_e,this._parser=se,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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.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 V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((G=>this._activeBuffer=G.activeBuffer))),this._parser.setCsiHandlerFallback(((G,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(G),params:oe.toArray()})})),this._parser.setEscHandlerFallback((G=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(G)})})),this._parser.setExecuteHandlerFallback((G=>{this._logService.debug("Unknown EXECUTE code: ",{code:G})})),this._parser.setOscHandlerFallback(((G,oe,le)=>{this._logService.debug("Unknown OSC code: ",{identifier:G,action:oe,data:le})})),this._parser.setDcsHandlerFallback(((G,oe,le)=>{oe==="HOOK"&&(le=le.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(G),action:oe,payload:le})})),this._parser.setPrintHandler(((G,oe,le)=>this.print(G,oe,le))),this._parser.registerCsiHandler({final:"@"},(G=>this.insertChars(G))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(G=>this.scrollLeft(G))),this._parser.registerCsiHandler({final:"A"},(G=>this.cursorUp(G))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(G=>this.scrollRight(G))),this._parser.registerCsiHandler({final:"B"},(G=>this.cursorDown(G))),this._parser.registerCsiHandler({final:"C"},(G=>this.cursorForward(G))),this._parser.registerCsiHandler({final:"D"},(G=>this.cursorBackward(G))),this._parser.registerCsiHandler({final:"E"},(G=>this.cursorNextLine(G))),this._parser.registerCsiHandler({final:"F"},(G=>this.cursorPrecedingLine(G))),this._parser.registerCsiHandler({final:"G"},(G=>this.cursorCharAbsolute(G))),this._parser.registerCsiHandler({final:"H"},(G=>this.cursorPosition(G))),this._parser.registerCsiHandler({final:"I"},(G=>this.cursorForwardTab(G))),this._parser.registerCsiHandler({final:"J"},(G=>this.eraseInDisplay(G,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(G=>this.eraseInDisplay(G,!0))),this._parser.registerCsiHandler({final:"K"},(G=>this.eraseInLine(G,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(G=>this.eraseInLine(G,!0))),this._parser.registerCsiHandler({final:"L"},(G=>this.insertLines(G))),this._parser.registerCsiHandler({final:"M"},(G=>this.deleteLines(G))),this._parser.registerCsiHandler({final:"P"},(G=>this.deleteChars(G))),this._parser.registerCsiHandler({final:"S"},(G=>this.scrollUp(G))),this._parser.registerCsiHandler({final:"T"},(G=>this.scrollDown(G))),this._parser.registerCsiHandler({final:"X"},(G=>this.eraseChars(G))),this._parser.registerCsiHandler({final:"Z"},(G=>this.cursorBackwardTab(G))),this._parser.registerCsiHandler({final:"`"},(G=>this.charPosAbsolute(G))),this._parser.registerCsiHandler({final:"a"},(G=>this.hPositionRelative(G))),this._parser.registerCsiHandler({final:"b"},(G=>this.repeatPrecedingCharacter(G))),this._parser.registerCsiHandler({final:"c"},(G=>this.sendDeviceAttributesPrimary(G))),this._parser.registerCsiHandler({prefix:">",final:"c"},(G=>this.sendDeviceAttributesSecondary(G))),this._parser.registerCsiHandler({final:"d"},(G=>this.linePosAbsolute(G))),this._parser.registerCsiHandler({final:"e"},(G=>this.vPositionRelative(G))),this._parser.registerCsiHandler({final:"f"},(G=>this.hVPosition(G))),this._parser.registerCsiHandler({final:"g"},(G=>this.tabClear(G))),this._parser.registerCsiHandler({final:"h"},(G=>this.setMode(G))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(G=>this.setModePrivate(G))),this._parser.registerCsiHandler({final:"l"},(G=>this.resetMode(G))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(G=>this.resetModePrivate(G))),this._parser.registerCsiHandler({final:"m"},(G=>this.charAttributes(G))),this._parser.registerCsiHandler({final:"n"},(G=>this.deviceStatus(G))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(G=>this.deviceStatusPrivate(G))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(G=>this.softReset(G))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(G=>this.setCursorStyle(G))),this._parser.registerCsiHandler({final:"r"},(G=>this.setScrollRegion(G))),this._parser.registerCsiHandler({final:"s"},(G=>this.saveCursor(G))),this._parser.registerCsiHandler({final:"t"},(G=>this.windowOptions(G))),this._parser.registerCsiHandler({final:"u"},(G=>this.restoreCursor(G))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(G=>this.insertColumns(G))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(G=>this.deleteColumns(G))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(G=>this.selectProtected(G))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(G=>this.requestMode(G,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(G=>this.requestMode(G,!1))),this._parser.setExecuteHandler(_.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(_.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(_.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(_.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(_.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(_.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(_.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(_.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(_.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(_.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(_.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(_.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((G=>(this.setTitle(G),this.setIconName(G),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((G=>this.setIconName(G)))),this._parser.registerOscHandler(2,new T.OscHandler((G=>this.setTitle(G)))),this._parser.registerOscHandler(4,new T.OscHandler((G=>this.setOrReportIndexedColor(G)))),this._parser.registerOscHandler(8,new T.OscHandler((G=>this.setHyperlink(G)))),this._parser.registerOscHandler(10,new T.OscHandler((G=>this.setOrReportFgColor(G)))),this._parser.registerOscHandler(11,new T.OscHandler((G=>this.setOrReportBgColor(G)))),this._parser.registerOscHandler(12,new T.OscHandler((G=>this.setOrReportCursorColor(G)))),this._parser.registerOscHandler(104,new T.OscHandler((G=>this.restoreIndexedColor(G)))),this._parser.registerOscHandler(110,new T.OscHandler((G=>this.restoreFgColor(G)))),this._parser.registerOscHandler(111,new T.OscHandler((G=>this.restoreBgColor(G)))),this._parser.registerOscHandler(112,new T.OscHandler((G=>this.restoreCursorColor(G)))),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 G in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:G},(()=>this.selectCharset("("+G))),this._parser.registerEscHandler({intermediates:")",final:G},(()=>this.selectCharset(")"+G))),this._parser.registerEscHandler({intermediates:"*",final:G},(()=>this.selectCharset("*"+G))),this._parser.registerEscHandler({intermediates:"+",final:G},(()=>this.selectCharset("+"+G))),this._parser.registerEscHandler({intermediates:"-",final:G},(()=>this.selectCharset("-"+G))),this._parser.registerEscHandler({intermediates:".",final:G},(()=>this.selectCharset("."+G))),this._parser.registerEscHandler({intermediates:"/",final:G},(()=>this.selectCharset("/"+G)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((G=>(this._logService.error("Parsing error: ",G),G))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((G,oe)=>this.requestStatusString(G,oe))))}_preserveStack(B,L,F,U){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=F,this._parseStack.position=U}_logSlowResolvingAsync(B){this._logService.logLevel<=N.LogLevelEnum.WARN&&Promise.race([B,new Promise(((L,F)=>setTimeout((()=>F("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,L){let F,U=this._activeBuffer.x,K=this._activeBuffer.y,ne=0;const ce=this._parseStack.paused;if(ce){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(F),F;U=this._parseStack.cursorStartX,K=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>I&&(ne=this._parseStack.position+I)}if(this._logService.logLevel<=N.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,(G=>String.fromCharCode(G))).join("")}"`),typeof B=="string"?B.split("").map((G=>G.charCodeAt(0))):B),this._parseBuffer.lengthI)for(let G=ne;G0&&le.getWidth(this._activeBuffer.x-1)===2&&le.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let pe=this._parser.precedingJoinState;for(let be=L;be_e){if(se){const je=le;let we=this._activeBuffer.x-Ke;for(this._activeBuffer.x=Ke,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ke>0&&le instanceof v.BufferLine&&le.copyCellsFrom(je,we,0,Ke,!1);we<_e;)je.setCellFromCodepoint(we++,0,1,oe)}else if(this._activeBuffer.x=_e-1,K===2)continue}if(Le&&this._activeBuffer.x){const je=le.getWidth(this._activeBuffer.x-1)?1:2;le.addCodepointToCell(this._activeBuffer.x-je,U,K);for(let we=K-Ke;--we>=0;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if(G&&(le.insertCells(this._activeBuffer.x,K-Ke,this._activeBuffer.getNullCell(oe)),le.getWidth(_e-1)===2&&le.setCellFromCodepoint(_e-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,oe)),le.setCellFromCodepoint(this._activeBuffer.x++,U,K,oe),K>0)for(;--K;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=pe,this._activeBuffer.x<_e&&F-L>0&&le.getWidth(this._activeBuffer.x)===0&&!le.hasContent(this._activeBuffer.x)&&le.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,L){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,L):this._parser.registerCsiHandler(B,(F=>!$(F.params[0],this._optionsService.rawOptions.windowOptions)||L(F)))}registerDcsHandler(B,L){return this._parser.registerDcsHandler(B,new j.DcsHandler(L))}registerEscHandler(B,L){return this._parser.registerEscHandler(B,L)}registerOscHandler(B,L){return this._parser.registerOscHandler(B,new T.OscHandler(L))}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 B;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&&((B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&B.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,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(B,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=B,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+L)}cursorUp(B){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const L=B.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=B.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=B.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const L=B.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,L,F,U=!1,K=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);ne.replaceCells(L,F,this._activeBuffer.getNullCell(this._eraseAttrData()),K),U&&(ne.isWrapped=!1)}_resetBufferLine(B,L=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),F.isWrapped=!1)}eraseInDisplay(B,L=!1){let F;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);F=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 3:const U=this._activeBuffer.lines.length-this._bufferService.rows;U>0&&(this._activeBuffer.lines.trimStart(U),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-U,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-U,0),this._onScroll.fire(0))}return!0}eraseInLine(B,L=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let L=B.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 se=_e;for(let G=1;G0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(_.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(_.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(_.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(_.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(_.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let L=0;LLe?1:2,pe=B.params[0];return be=pe,Me=L?pe===2?4:pe===4?le(ne.modes.insertMode):pe===12?3:pe===20?le(oe.convertEol):0:pe===1?le(F.applicationCursorKeys):pe===3?oe.windowOptions.setWinLines?_e===80?2:_e===132?1:0:0:pe===6?le(F.origin):pe===7?le(F.wraparound):pe===8?3:pe===9?le(U==="X10"):pe===12?le(oe.cursorBlink):pe===25?le(!ne.isCursorHidden):pe===45?le(F.reverseWraparound):pe===66?le(F.applicationKeypad):pe===67?4:pe===1e3?le(U==="VT200"):pe===1002?le(U==="DRAG"):pe===1003?le(U==="ANY"):pe===1004?le(F.sendFocus):pe===1005?4:pe===1006?le(K==="SGR"):pe===1015?4:pe===1016?le(K==="SGR_PIXELS"):pe===1048?1:pe===47||pe===1047||pe===1049?le(se===G):pe===2004?le(F.bracketedPasteMode):0,ne.triggerDataEvent(`${_.C0.ESC}[${L?"":"?"}${be};${Me}$y`),!0;var be,Me}_updateAttrColor(B,L,F,U,K){return L===2?(B|=50331648,B&=-16777216,B|=C.AttributeData.fromColorRGB([F,U,K])):L===5&&(B&=-50331904,B|=33554432|255&F),B}_extractColor(B,L,F){const U=[0,0,-1,0,0,0];let K=0,ne=0;do{if(U[ne+K]=B.params[L+ne],B.hasSubParams(L+ne)){const ce=B.getSubParams(L+ne);let _e=0;do U[1]===5&&(K=1),U[ne+_e+1+K]=ce[_e];while(++_e=2||U[1]===2&&ne+K>=5)break;U[1]&&(K=1)}while(++ne+L5)&&(B=1),L.extended.underlineStyle=B,L.fg|=268435456,B===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(B){B.fg=v.DEFAULT_ATTR_DATA.fg,B.bg=v.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=B.length;let F;const U=this._curAttrData;for(let K=0;K=30&&F<=37?(U.fg&=-50331904,U.fg|=16777216|F-30):F>=40&&F<=47?(U.bg&=-50331904,U.bg|=16777216|F-40):F>=90&&F<=97?(U.fg&=-50331904,U.fg|=16777224|F-90):F>=100&&F<=107?(U.bg&=-50331904,U.bg|=16777224|F-100):F===0?this._processSGR0(U):F===1?U.fg|=134217728:F===3?U.bg|=67108864:F===4?(U.fg|=268435456,this._processUnderline(B.hasSubParams(K)?B.getSubParams(K)[0]:1,U)):F===5?U.fg|=536870912:F===7?U.fg|=67108864:F===8?U.fg|=1073741824:F===9?U.fg|=2147483648:F===2?U.bg|=134217728:F===21?this._processUnderline(2,U):F===22?(U.fg&=-134217729,U.bg&=-134217729):F===23?U.bg&=-67108865:F===24?(U.fg&=-268435457,this._processUnderline(0,U)):F===25?U.fg&=-536870913:F===27?U.fg&=-67108865:F===28?U.fg&=-1073741825:F===29?U.fg&=2147483647:F===39?(U.fg&=-67108864,U.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):F===49?(U.bg&=-67108864,U.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?K+=this._extractColor(B,K,U):F===53?U.bg|=1073741824:F===55?U.bg&=-1073741825:F===59?(U.extended=U.extended.clone(),U.extended.underlineColor=-1,U.updateExtended()):F===100?(U.fg&=-67108864,U.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,U.bg&=-67108864,U.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${_.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${_.C0.ESC}[${L};${F}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${_.C0.ESC}[?${L};${F}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.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(B){const L=B.params[0]||1;switch(L){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 F=L%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(B){const L=B.params[0]||1;let F;return(B.length<2||(F=B.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(B){if(!$(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(q.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(q.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${_.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){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(B){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(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const L=[],F=B.split(";");for(;F.length>1;){const U=F.shift(),K=F.shift();if(/^\d+$/.exec(U)){const ne=parseInt(U);if(J(ne))if(K==="?")L.push({type:0,index:ne});else{const ce=(0,M.parseColor)(K);ce&&L.push({type:1,index:ne,color:ce})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(B){const L=B.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(B,L){this._getCurrentLinkId()&&this._finishHyperlink();const F=B.split(":");let U;const K=F.findIndex((ne=>ne.startsWith("id=")));return K!==-1&&(U=F[K].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:U,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,L){const F=B.split(";");for(let U=0;U=this._specialColors.length);++U,++L)if(F[U]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const K=(0,M.parseColor)(F[U]);K&&this._onColor.fire([{type:1,index:this._specialColors[L],color:K}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const L=[],F=B.split(";");for(let U=0;U=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 B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new y.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${_.C0.ESC}${K}${_.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[U.cursorStyle]-(U.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,L){this._dirtyRowTracker.markRangeDirty(B,L)}}o.InputHandler=Q;let V=class{constructor(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Zthis.end&&(this.end=Z)}markRangeDirty(Z,B){Z>B&&(H=Z,Z=B,B=H),Zthis.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(Z){return 0<=Z&&Z<256}V=u([h(0,N.IBufferService)],V)},844:(a,o)=>{function c(u){for(const h of u)h.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const h=this._disposables.indexOf(u);h!==-1&&this._disposables.splice(h,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var h;this._isDisposed||u===this._value||((h=this._value)==null||h.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=c,o.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(h,_,p){this._data[h]||(this._data[h]={}),this._data[h][_]=p}get(h,_){return this._data[h]?this._data[h][_]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(u,h,_,p,m){this._data.get(u,h)||this._data.set(u,h,new c),this._data.get(u,h).set(_,p,m)}get(u,h,_,p){var m;return(m=this._data.get(u,h))==null?void 0:m.get(_,p)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const h=c.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(c=this._search(this._getKey(u)),this._array.splice(c,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const h=this._getKey(u);if(h===void 0||(c=this._search(h),c===-1)||this._getKey(this._array[c])!==h)return!1;do if(this._array[c]===u)return this._array.splice(c,1),!0;while(++c=this._array.length)&&this._getKey(this._array[c])===u))do yield this._array[c];while(++c=this._array.length)&&this._getKey(this._array[c])===u))do h(this._array[c]);while(++c=h;){let p=h+_>>1;const m=this._getKey(this._array[p]);if(m>u)_=p-1;else{if(!(m0&&this._getKey(this._array[p-1])===u;)p--;return p}h=p+1}}return h}}},7226:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=c(6114);class h{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ib)return v-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-x))}ms`),void this._start();v=b}this.clear()}}class _ extends h{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const x=Date.now()+m;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=_,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:_,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=c(643);o.updateWindowsModeWrappedState=function(h){const _=h.buffer.lines.get(h.buffer.ybase+h.buffer.y-1),p=_==null?void 0:_.get(h.cols-1),m=h.buffer.lines.get(h.buffer.ybase+h.buffer.y);m&&p&&(m.isWrapped=p[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&p[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(_){return[_>>>16&255,_>>>8&255,255&_]}static fromColorRGB(_){return(255&_[0])<<16|(255&_[1])<<8|255&_[2]}clone(){const _=new c;return _.fg=this.fg,_.bg=this.bg,_.extended=this.extended.clone(),_}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(_){this._ext=_}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(_){this._ext&=-469762049,this._ext|=_<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(_){this._ext&=-67108864,this._ext|=67108863&_}get urlId(){return this._urlId}set urlId(_){this._urlId=_}get underlineVariantOffset(){const _=(3758096384&this._ext)>>29;return _<0?4294967288^_:_}set underlineVariantOffset(_){this._ext&=536870911,this._ext|=_<<29&3758096384}constructor(_=0,p=0){this._ext=0,this._urlId=0,this._ext=_,this._urlId=p}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=c(6349),h=c(7226),_=c(3734),p=c(8437),m=c(4634),x=c(511),k=c(643),v=c(4863),b=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.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=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,k.NULL_CELL_CHAR,k.NULL_CELL_WIDTH,k.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,k.WHITESPACE_CELL_CHAR,k.WHITESPACE_CELL_WIDTH,k.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new h.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.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 _.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 _.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new p.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&&wo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=p.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 u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let N=0;const z=this._getCorrectBufferLength(y);if(z>this.lines.maxLength&&(this.lines.maxLength=z),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(w,C)));else for(let j=this._rows;j>y;j--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(z0&&(this.lines.trimStart(j),this.ybase=Math.max(this.ybase-j,0),this.ydisp=Math.max(this.ydisp-j,0),this.savedY=Math.max(this.savedY-j,0)),this.lines.maxLength=z}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),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 T=0;T.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,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(C.length>0){const N=(0,m.reflowLargerCreateNewLayout)(this.lines,C);(0,m.reflowLargerApplyNewLayout)(this.lines,N.layout),this._reflowLargerAdjustViewport(w,y,N.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const N=this.getNullCell(p.DEFAULT_ATTR_DATA);let z=C;for(;z-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;T--){let j=this.lines.get(T);if(!j||!j.isWrapped&&j.getTrimmedLength()<=w)continue;const M=[j];for(;j.isWrapped&&T>0;)j=this.lines.get(--T),M.unshift(j);const D=this.ybase+this.y;if(D>=T&&D0&&(N.push({start:T+M.length+z,newLines:Q}),z+=Q.length),M.push(...Q);let V=$.length-1,J=$[V];J===0&&(V--,J=$[V]);let Z=M.length-q-1,B=I;for(;Z>=0;){const F=Math.min(B,J);if(M[V]===void 0)break;if(M[V].copyCellsFrom(M[Z],B-F,J-F,F,!0),J-=F,J===0&&(V--,J=$[V]),B-=F,B===0){Z--;const U=Math.max(Z,0);B=(0,m.getWrappedLineTrimmedLength)(M,U,this._cols)}}for(let F=0;F0;)this.ybase===0?this.y0){const T=[],j=[];for(let V=0;V=0;V--)if($&&$.start>D+q){for(let J=$.newLines.length-1;J>=0;J--)this.lines.set(V--,$.newLines[J]);V++,T.push({index:D+1,amount:$.newLines.length}),q+=$.newLines.length,$=N[++I]}else this.lines.set(V,j[D--]);let H=0;for(let V=T.length-1;V>=0;V--)T[V].index+=H,this.lines.onInsertEmitter.fire(T[V]),H+=T[V].amount;const Q=Math.max(0,M+z-this.lines.maxLength);Q>0&&this.lines.onTrimEmitter.fire(Q)}}translateBufferLineToString(w,y,C=0,N){const z=this.lines.get(w);return z?z.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:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=c(3734),h=c(511),_=c(643),p=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let m=0;class x{constructor(v,b,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||h.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]);for(let C=0;C>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):w]}set(v,b){this._data[3*v+1]=b[_.CHAR_DATA_ATTR_INDEX],b[_.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[_.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[_.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,p.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return m=3*v,b.content=this._data[m+0],b.fg=this._data[m+1],b.bg=this._data[m+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,w,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|w<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,w){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,p.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,p.stringFromCodePoint)(2097151&y)+(0,p.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*v+0]=y}insertCells(v,b,w){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,w),b=0;--C)this.setCell(v+b+C,this.loadCell(v+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=v&&delete this._combined[z]}const C=Object.keys(this._extendedAttrs);for(let N=0;N=v&&delete this._extendedAttrs[z]}}return this.length=v,4*w*2=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,w,y,C){const N=v._data;if(C)for(let T=y-1;T>=0;T--){for(let j=0;j<3;j++)this._data[3*(w+T)+j]=N[3*(b+T)+j];268435456&N[3*(b+T)+2]&&(this._extendedAttrs[w+T]=v._extendedAttrs[b+T])}else for(let T=0;T=b&&(this._combined[j-b+w]=v._combined[j])}}translateToString(v,b,w,y){b=b??0,w=w??this.length,v&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;b>22||1}return y&&y.push(b),C}}o.BufferLine=x},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,u){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 u*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(a,o)=>{function c(u,h,_){if(h===u.length-1)return u[h].getTrimmedLength();const p=!u[h].hasContent(_-1)&&u[h].getWidth(_-1)===1,m=u[h+1].getWidth(0)===2;return p&&m?_-1:_}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,h,_,p,m){const x=[];for(let k=0;k=k&&p0&&(j>y||w[j].getTrimmedLength()===0);j--)T++;T>0&&(x.push(k+w.length-T),x.push(T)),k+=w.length-1}return x},o.reflowLargerCreateNewLayout=function(u,h){const _=[];let p=0,m=h[p],x=0;for(let k=0;kc(u,w,h))).reduce(((b,w)=>b+w));let x=0,k=0,v=0;for(;vb&&(x-=b,k++);const w=u[k].getWidth(x-1)===2;w&&x--;const y=w?_-1:_;p.push(y),v+=y}return p},o.getWrappedLineTrimmedLength=c},5295:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=c(8460),h=c(844),_=c(9092);class p extends h.Disposable{constructor(x,k){super(),this._optionsService=x,this._bufferService=k,this._onBufferActivate=this.register(new u.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 _.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new _.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(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),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(x,k){this._normal.resize(x,k),this._alt.resize(x,k),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=p},511:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=c(482),h=c(643),_=c(3734);class p extends _.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new _.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const k=new p;return k.setFromCharData(x),k}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let k=!1;if(x[h.CHAR_DATA_CHAR_INDEX].length>2)k=!0;else if(x[h.CHAR_DATA_CHAR_INDEX].length===2){const v=x[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=x[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|x[h.CHAR_DATA_WIDTH_INDEX]<<22:k=!0}else k=!0}else this.content=x[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[h.CHAR_DATA_WIDTH_INDEX]<<22;k&&(this.combinedData=x[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=p},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=c(8460),h=c(844);class _{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=_._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,h.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}o.Marker=_,_._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var c,u,h;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(_){_.NUL="\0",_.SOH="",_.STX="",_.ETX="",_.EOT="",_.ENQ="",_.ACK="",_.BEL="\x07",_.BS="\b",_.HT=" ",_.LF=` -`,_.VT="\v",_.FF="\f",_.CR="\r",_.SO="",_.SI="",_.DLE="",_.DC1="",_.DC2="",_.DC3="",_.DC4="",_.NAK="",_.SYN="",_.ETB="",_.CAN="",_.EM="",_.SUB="",_.ESC="\x1B",_.FS="",_.GS="",_.RS="",_.US="",_.SP=" ",_.DEL=""})(c||(o.C0=c={})),(function(_){_.PAD="€",_.HOP="",_.BPH="‚",_.NBH="ƒ",_.IND="„",_.NEL="…",_.SSA="†",_.ESA="‡",_.HTS="ˆ",_.HTJ="‰",_.VTS="Š",_.PLD="‹",_.PLU="Œ",_.RI="",_.SS2="Ž",_.SS3="",_.DCS="",_.PU1="‘",_.PU2="’",_.STS="“",_.CCH="”",_.MW="•",_.SPA="–",_.EPA="—",_.SOS="˜",_.SGCI="™",_.SCI="š",_.CSI="›",_.ST="œ",_.OSC="",_.PM="ž",_.APC="Ÿ"})(u||(o.C1=u={})),(function(_){_.ST=`${c.ESC}\\`})(h||(o.C1_ESCAPED=h={}))},7399:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=c(2584),h={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(_,p,m,x){const k={type:0,cancel:!1,key:void 0},v=(_.shiftKey?1:0)|(_.altKey?2:0)|(_.ctrlKey?4:0)|(_.metaKey?8:0);switch(_.keyCode){case 0:_.key==="UIKeyInputUpArrow"?k.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A":_.key==="UIKeyInputLeftArrow"?k.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D":_.key==="UIKeyInputRightArrow"?k.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C":_.key==="UIKeyInputDownArrow"&&(k.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:k.key=_.ctrlKey?"\b":u.C0.DEL,_.altKey&&(k.key=u.C0.ESC+k.key);break;case 9:if(_.shiftKey){k.key=u.C0.ESC+"[Z";break}k.key=u.C0.HT,k.cancel=!0;break;case 13:k.key=_.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,k.cancel=!0;break;case 27:k.key=u.C0.ESC,_.altKey&&(k.key=u.C0.ESC+u.C0.ESC),k.cancel=!0;break;case 37:if(_.metaKey)break;v?(k.key=u.C0.ESC+"[1;"+(v+1)+"D",k.key===u.C0.ESC+"[1;3D"&&(k.key=u.C0.ESC+(m?"b":"[1;5D"))):k.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(_.metaKey)break;v?(k.key=u.C0.ESC+"[1;"+(v+1)+"C",k.key===u.C0.ESC+"[1;3C"&&(k.key=u.C0.ESC+(m?"f":"[1;5C"))):k.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(_.metaKey)break;v?(k.key=u.C0.ESC+"[1;"+(v+1)+"A",m||k.key!==u.C0.ESC+"[1;3A"||(k.key=u.C0.ESC+"[1;5A")):k.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(_.metaKey)break;v?(k.key=u.C0.ESC+"[1;"+(v+1)+"B",m||k.key!==u.C0.ESC+"[1;3B"||(k.key=u.C0.ESC+"[1;5B")):k.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:_.shiftKey||_.ctrlKey||(k.key=u.C0.ESC+"[2~");break;case 46:k.key=v?u.C0.ESC+"[3;"+(v+1)+"~":u.C0.ESC+"[3~";break;case 36:k.key=v?u.C0.ESC+"[1;"+(v+1)+"H":p?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:k.key=v?u.C0.ESC+"[1;"+(v+1)+"F":p?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:_.shiftKey?k.type=2:_.ctrlKey?k.key=u.C0.ESC+"[5;"+(v+1)+"~":k.key=u.C0.ESC+"[5~";break;case 34:_.shiftKey?k.type=3:_.ctrlKey?k.key=u.C0.ESC+"[6;"+(v+1)+"~":k.key=u.C0.ESC+"[6~";break;case 112:k.key=v?u.C0.ESC+"[1;"+(v+1)+"P":u.C0.ESC+"OP";break;case 113:k.key=v?u.C0.ESC+"[1;"+(v+1)+"Q":u.C0.ESC+"OQ";break;case 114:k.key=v?u.C0.ESC+"[1;"+(v+1)+"R":u.C0.ESC+"OR";break;case 115:k.key=v?u.C0.ESC+"[1;"+(v+1)+"S":u.C0.ESC+"OS";break;case 116:k.key=v?u.C0.ESC+"[15;"+(v+1)+"~":u.C0.ESC+"[15~";break;case 117:k.key=v?u.C0.ESC+"[17;"+(v+1)+"~":u.C0.ESC+"[17~";break;case 118:k.key=v?u.C0.ESC+"[18;"+(v+1)+"~":u.C0.ESC+"[18~";break;case 119:k.key=v?u.C0.ESC+"[19;"+(v+1)+"~":u.C0.ESC+"[19~";break;case 120:k.key=v?u.C0.ESC+"[20;"+(v+1)+"~":u.C0.ESC+"[20~";break;case 121:k.key=v?u.C0.ESC+"[21;"+(v+1)+"~":u.C0.ESC+"[21~";break;case 122:k.key=v?u.C0.ESC+"[23;"+(v+1)+"~":u.C0.ESC+"[23~";break;case 123:k.key=v?u.C0.ESC+"[24;"+(v+1)+"~":u.C0.ESC+"[24~";break;default:if(!_.ctrlKey||_.shiftKey||_.altKey||_.metaKey)if(m&&!x||!_.altKey||_.metaKey)!m||_.altKey||_.ctrlKey||_.shiftKey||!_.metaKey?_.key&&!_.ctrlKey&&!_.altKey&&!_.metaKey&&_.keyCode>=48&&_.key.length===1?k.key=_.key:_.key&&_.ctrlKey&&(_.key==="_"&&(k.key=u.C0.US),_.key==="@"&&(k.key=u.C0.NUL)):_.keyCode===65&&(k.type=1);else{const b=h[_.keyCode],w=b==null?void 0:b[_.shiftKey?1:0];if(w)k.key=u.C0.ESC+w;else if(_.keyCode>=65&&_.keyCode<=90){const y=_.ctrlKey?_.keyCode-64:_.keyCode+32;let C=String.fromCharCode(y);_.shiftKey&&(C=C.toUpperCase()),k.key=u.C0.ESC+C}else if(_.keyCode===32)k.key=u.C0.ESC+(_.ctrlKey?u.C0.NUL:" ");else if(_.key==="Dead"&&_.code.startsWith("Key")){let y=_.code.slice(3,4);_.shiftKey||(y=y.toLowerCase()),k.key=u.C0.ESC+y,k.cancel=!0}}else _.keyCode>=65&&_.keyCode<=90?k.key=String.fromCharCode(_.keyCode-64):_.keyCode===32?k.key=u.C0.NUL:_.keyCode>=51&&_.keyCode<=55?k.key=String.fromCharCode(_.keyCode-51+27):_.keyCode===56?k.key=u.C0.DEL:_.keyCode===219?k.key=u.C0.ESC:_.keyCode===220?k.key=u.C0.FS:_.keyCode===221&&(k.key=u.C0.GS)}return k}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,u=0,h=c.length){let _="";for(let p=u;p65535?(m-=65536,_+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):_+=String.fromCharCode(m)}return _},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const h=c.length;if(!h)return 0;let _=0,p=0;if(this._interim){const m=c.charCodeAt(p++);56320<=m&&m<=57343?u[_++]=1024*(this._interim-55296)+m-56320+65536:(u[_++]=this._interim,u[_++]=m),this._interim=0}for(let m=p;m=h)return this._interim=x,_;const k=c.charCodeAt(m);56320<=k&&k<=57343?u[_++]=1024*(x-55296)+k-56320+65536:(u[_++]=x,u[_++]=k)}else x!==65279&&(u[_++]=x)}return _}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const h=c.length;if(!h)return 0;let _,p,m,x,k=0,v=0,b=0;if(this.interim[0]){let C=!1,N=this.interim[0];N&=(224&N)==192?31:(240&N)==224?15:7;let z,T=0;for(;(z=63&this.interim[++T])&&T<4;)N<<=6,N|=z;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=j-T;for(;b=h)return 0;if(z=c[b++],(192&z)!=128){b--,C=!0;break}this.interim[T++]=z,N<<=6,N|=63&z}C||(j===2?N<128?b--:u[k++]=N:j===3?N<2048||N>=55296&&N<=57343||N===65279||(u[k++]=N):N<65536||N>1114111||(u[k++]=N)),this.interim.fill(0)}const w=h-4;let y=b;for(;y=h)return this.interim[0]=_,k;if(p=c[y++],(192&p)!=128){y--;continue}if(v=(31&_)<<6|63&p,v<128){y--;continue}u[k++]=v}else if((240&_)==224){if(y>=h)return this.interim[0]=_,k;if(p=c[y++],(192&p)!=128){y--;continue}if(y>=h)return this.interim[0]=_,this.interim[1]=p,k;if(m=c[y++],(192&m)!=128){y--;continue}if(v=(15&_)<<12|(63&p)<<6|63&m,v<2048||v>=55296&&v<=57343||v===65279)continue;u[k++]=v}else if((248&_)==240){if(y>=h)return this.interim[0]=_,k;if(p=c[y++],(192&p)!=128){y--;continue}if(y>=h)return this.interim[0]=_,this.interim[1]=p,k;if(m=c[y++],(192&m)!=128){y--;continue}if(y>=h)return this.interim[0]=_,this.interim[1]=p,this.interim[2]=m,k;if(x=c[y++],(192&x)!=128){y--;continue}if(v=(7&_)<<18|(63&p)<<12|(63&m)<<6|63&x,v<65536||v>1114111)continue;u[k++]=v}}return k}}},225:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=c(1480),h=[[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]],_=[[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 p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;mk[w][1])return!1;for(;w>=b;)if(v=b+w>>1,x>k[v][1])b=v+1;else{if(!(x=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,x){let k=this.wcwidth(m),v=k===0&&x!==0;if(v){const b=u.UnicodeService.extractWidth(x);b===0?v=!1:b>k&&(k=b)}return u.UnicodeService.createPropertyValue(0,k,v)}}},5981:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=c(8460),h=c(844);class _ extends h.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let k;for(this._isSyncWriting=!0;k=this._writeBuffer.shift();){this._action(k);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,x){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+=m.length,this._writeBuffer.push(m),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x)}_innerWrite(m=0,x=!0){const k=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,x);if(b){const y=C=>Date.now()-k>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(k,C);return void b.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=v.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()}}o.WriteBuffer=_},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function h(_,p){const m=_.toString(16),x=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(_){if(!_)return;let p=_.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=c.exec(p);if(m){const x=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/x*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/x*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/x*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),u.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,x=[0,0,0];for(let k=0;k<3;++k){const v=parseInt(p.slice(m*k,m*k+m),16);x[k]=m===1?v<<4:m===2?v:m===3?v>>4:v>>8}return x}},o.toRgbString=function(_,p=16){const[m,x,k]=_;return`rgb:${h(m,p)}/${h(x,p)}/${h(k,p)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=c(482),h=c(8742),_=c(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(x,k){this._handlers[x]===void 0&&(this._handlers[x]=[]);const v=this._handlers[x];return v.push(k),{dispose:()=>{const b=v.indexOf(k);b!==-1&&v.splice(b,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(x,k){if(this.reset(),this._ident=x,this._active=this._handlers[x]||p,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(k);else this._handlerFb(this._ident,"HOOK",k)}put(x,k,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(x,k,v);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,k,v))}unhook(x,k=!0){if(this._active.length){let v=!1,b=this._active.length-1,w=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=k,w=this._stack.fallThrough,this._stack.paused=!1),!w&&v===!1){for(;b>=0&&(v=this._active[b].unhook(x),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",x);this._active=p,this._ident=0}};const m=new h.Params;m.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=m,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():m,this._data="",this._hitLimit=!1}put(x,k,v){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,k,v),this._data.length>_.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let k=!1;if(this._hitLimit)k=!1;else if(x&&(k=this._handler(this._data,this._params),k instanceof Promise))return k.then((v=>(this._params=m,this._data="",this._hitLimit=!1,v)));return this._params=m,this._data="",this._hitLimit=!1,k}}},2015:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=c(844),h=c(8742),_=c(6242),p=c(6351);class m{constructor(b){this.table=new Uint8Array(b)}setDefault(b,w){this.table.fill(b<<4|w)}add(b,w,y,C){this.table[w<<8|b]=y<<4|C}addMany(b,w,y,C){for(let N=0;Nj)),w=(T,j)=>b.slice(T,j),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const N=w(0,14);let z;for(z in v.setDefault(1,0),v.addMany(y,0,2,0),N)v.addMany([24,26,153,154],z,3,0),v.addMany(w(128,144),z,3,0),v.addMany(w(144,152),z,3,0),v.add(156,z,0,0),v.add(27,z,11,1),v.add(157,z,4,8),v.addMany([152,158,159],z,0,7),v.add(155,z,11,3),v.add(144,z,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(w(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(w(64,127),3,7,0),v.addMany(w(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(w(48,60),4,8,4),v.addMany(w(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(w(32,64),6,0,6),v.add(127,6,0,6),v.addMany(w(64,127),6,0,0),v.addMany(w(32,48),3,9,5),v.addMany(w(32,48),5,9,5),v.addMany(w(48,64),5,0,6),v.addMany(w(64,127),5,7,0),v.addMany(w(32,48),4,9,5),v.addMany(w(32,48),1,9,2),v.addMany(w(32,48),2,9,2),v.addMany(w(48,127),2,10,0),v.addMany(w(48,80),1,10,0),v.addMany(w(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(w(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(w(28,32),9,0,9),v.addMany(w(32,48),9,9,12),v.addMany(w(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(w(32,128),11,0,11),v.addMany(w(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(w(28,32),10,0,10),v.addMany(w(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(w(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(w(28,32),12,0,12),v.addMany(w(32,48),12,9,12),v.addMany(w(48,64),12,0,11),v.addMany(w(64,127),12,12,13),v.addMany(w(64,127),10,12,13),v.addMany(w(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(x,0,2,0),v.add(x,8,5,8),v.add(x,6,0,6),v.add(x,11,0,11),v.add(x,13,13,13),v})();class k extends u.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new h.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,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new _.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,w=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let N=0;Nz||z>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=z}}if(b.final.length!==1)throw new Error("final must be a single byte");const C=b.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(b){const w=[];for(;b;)w.push(String.fromCharCode(255&b)),b>>=8;return w.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,w){const y=this._identifier(b,[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(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,w){this._executeHandlers[b.charCodeAt(0)]=w}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,w){const y=this._identifier(b);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(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,w){return this._dcsParser.registerHandler(this._identifier(b),w)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,w){return this._oscParser.registerHandler(b,w)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}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(b,w,y,C,N){this._parseStack.state=b,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=N}parse(b,w,y){let C,N=0,z=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=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 j=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](this._params),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 6:if(N=b[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=b[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,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let j=T;j>4){case 2:for(let q=j+1;;++q){if(q>=w||(N=b[q])<32||N>126&&N=w||(N=b[q])<32||N>126&&N=w||(N=b[q])<32||N>126&&N=w||(N=b[q])<32||N>126&&N=0&&(C=M[D](this._params),C!==!0);D--)if(C instanceof Promise)return this._preserveStack(3,M,D,z,j),C;D<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(++j47&&N<60);j--;break;case 9:this._collect<<=8,this._collect|=N;break;case 10:const I=this._escHandlers[this._collect<<8|N];let $=I?I.length-1:-1;for(;$>=0&&(C=I[$](),C!==!0);$--)if(C instanceof Promise)return this._preserveStack(4,I,$,z,j),C;$<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 q=j+1;;++q)if(q>=w||(N=b[q])===24||N===26||N===27||N>127&&N=w||(N=b[q])<32||N>127&&N{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=c(5770),h=c(482),_=[];o.OscParser=class{constructor(){this._state=0,this._active=_,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const x=this._handlers[p];return x.push(m),{dispose:()=>{const k=x.indexOf(m);k!==-1&&x.splice(k,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=_,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||_,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,x){if(this._active.length)for(let k=this._active.length-1;k>=0;k--)this._active[k].put(p,m,x);else this._handlerFb(this._id,"PUT",(0,h.utf32ToString)(p,m,x))}start(){this.reset(),this._state=1}put(p,m,x){if(this._state!==3){if(this._state===1)for(;m0&&this._put(p,m,x)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,k=this._active.length-1,v=!1;if(this._stack.paused&&(k=this._stack.loopPosition-1,x=m,v=this._stack.fallThrough,this._stack.paused=!1),!v&&x===!1){for(;k>=0&&(x=this._active[k].end(p),x!==!0);k--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!1,x;k--}for(;k>=0;k--)if(x=this._active[k].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",p);this._active=_,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,x){this._hitLimit||(this._data+=(0,h.utf32ToString)(p,m,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,m}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class u{static fromArray(_){const p=new u;if(!_.length)return p;for(let m=Array.isArray(_[0])?1:0;m<_.length;++m){const x=_[m];if(Array.isArray(x))for(let k=0;k256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(_),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(_),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const _=new u(this.maxLength,this.maxSubParamsLength);return _.params.set(this.params),_.length=this.length,_._subParams.set(this._subParams),_._subParamsLength=this._subParamsLength,_._subParamsIdx.set(this._subParamsIdx),_._rejectDigits=this._rejectDigits,_._rejectSubDigits=this._rejectSubDigits,_._digitIsSub=this._digitIsSub,_}toArray(){const _=[];for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&_.push(Array.prototype.slice.call(this._subParams,m,x))}return _}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(_){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(_<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=_>c?c:_}}addSubParam(_){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(_<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=_>c?c:_,this._subParamsIdx[this.length-1]++}}hasSubParams(_){return(255&this._subParamsIdx[_])-(this._subParamsIdx[_]>>8)>0}getSubParams(_){const p=this._subParamsIdx[_]>>8,m=255&this._subParamsIdx[_];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const _={};for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&(_[p]=this._subParams.slice(m,x))}return _}addDigit(_){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,x=m[p-1];m[p-1]=~x?Math.min(10*x+_,c):_}}o.Params=u},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,u){const h={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(h),u.dispose=()=>this._wrappedAddonDispose(h),u.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let u=-1;for(let h=0;h{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=c(3785),h=c(511);o.BufferApiView=class{constructor(_,p){this._buffer=_,this.type=p}init(_){return this._buffer=_,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(_){const p=this._buffer.lines.get(_);if(p)return new u.BufferLineApiView(p)}getNullCell(){return new h.CellData}}},3785:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=c(511);o.BufferLineApiView=class{constructor(h){this._line=h}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(h,_){if(!(h<0||h>=this._line.length))return _?(this._line.loadCell(h,_),_):this._line.loadCell(h,new u.CellData)}translateToString(h,_,p){return this._line.translateToString(h,_,p)}}},8285:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=c(8771),h=c(8460),_=c(844);class p extends _.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new h.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=p},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,u){return this._core.registerCsiHandler(c,(h=>u(h.toArray())))}addCsiHandler(c,u){return this.registerCsiHandler(c,u)}registerDcsHandler(c,u){return this._core.registerDcsHandler(c,((h,_)=>u(h,_.toArray())))}addDcsHandler(c,u){return this.registerDcsHandler(c,u)}registerEscHandler(c,u){return this._core.registerEscHandler(c,u)}addEscHandler(c,u){return this.registerEscHandler(c,u)}registerOscHandler(c,u){return this._core.registerOscHandler(c,u)}addOscHandler(c,u){return this.registerOscHandler(c,u)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(a,o,c){var u=this&&this.__decorate||function(v,b,w,y){var C,N=arguments.length,z=N<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(z=(N<3?C(z):N>3?C(b,w,z):C(b,w))||z);return N>3&&z&&Object.defineProperty(b,w,z),z},h=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const _=c(8460),p=c(844),m=c(5295),x=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let k=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new _.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=w.getBlankLine(v,b),this._cachedBlankLine=y),y.isWrapped=b;const C=w.ybase+w.scrollTop,N=w.ybase+w.scrollBottom;if(w.scrollTop===0){const z=w.lines.isFull;N===w.lines.length-1?z?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(N+1,0,y.clone()),z?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const z=N-C+1;w.lines.shiftElements(C+1,z-1,-1),w.lines.set(N,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(v,b,w){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),C!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};o.BufferService=k=u([h(0,x.IOptionsService)],k)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,u){this._charsets[c]=u,this.glevel===c&&(this.charset=u)}}},1753:function(a,o,c){var u=this&&this.__decorate||function(y,C,N,z){var T,j=arguments.length,M=j<3?C:z===null?z=Object.getOwnPropertyDescriptor(C,N):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,N,z);else for(var D=y.length-1;D>=0;D--)(T=y[D])&&(M=(j<3?T(M):j>3?T(C,N,M):T(C,N))||M);return j>3&&M&&Object.defineProperty(C,N,M),M},h=this&&this.__param||function(y,C){return function(N,z){C(N,z,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const _=c(2585),p=c(8460),m=c(844),x={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 v=String.fromCharCode,b={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${v(C[0])}${v(C[1])}${v(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=o.CoreMouseService=class extends m.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 p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const N of Object.keys(x))this.addProtocol(N,x[N]);for(const N of Object.keys(b))this.addEncoding(N,b[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}};o.CoreMouseService=w=u([h(0,_.IBufferService),h(1,_.ICoreService)],w)},6975:function(a,o,c){var u=this&&this.__decorate||function(w,y,C,N){var z,T=arguments.length,j=T<3?y:N===null?N=Object.getOwnPropertyDescriptor(y,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,N);else for(var M=w.length-1;M>=0;M--)(z=w[M])&&(j=(T<3?z(j):T>3?z(y,C,j):z(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},h=this&&this.__param||function(w,y){return function(C,N){y(C,N,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const _=c(1439),p=c(8460),m=c(844),x=c(2585),k=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends m.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 p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,_.clone)(k),this.decPrivateModes=(0,_.clone)(v)}reset(){this.modes=(0,_.clone)(k),this.decPrivateModes=(0,_.clone)(v)}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))}};o.CoreService=b=u([h(0,x.IBufferService),h(1,x.ILogService),h(2,x.IOptionsService)],b)},9074:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=c(8055),h=c(8460),_=c(844),p=c(6106);let m=0,x=0;class k extends _.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new h.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new h.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,_.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new v(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,z=0;for(const T of this._decorations.getKeyIterator(y))N=T.options.x??0,z=N+(T.options.width??1),w>=N&&w{m=z.options.x??0,x=m+(z.options.width??1),w>=m&&w{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=c(2585),h=c(8343);class _{constructor(...m){this._entries=new Map;for(const[x,k]of m)this.set(x,k)}set(m,x){const k=this._entries.get(m);return this._entries.set(m,x),k}forEach(m){for(const[x,k]of this._entries.entries())m(x,k)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}o.ServiceCollection=_,o.InstantiationService=class{constructor(){this._services=new _,this._services.set(u.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const x=(0,h.getServiceDependencies)(p).sort(((b,w)=>b.index-w.index)),k=[];for(const b of x){const w=this._services.get(b.id);if(!w)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${b.id}.`);k.push(w)}const v=x.length>0?x[0].index:m.length;if(m.length!==v)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${v+1} conflicts with ${m.length} static arguments`);return new p(...m,...k)}}},7866:function(a,o,c){var u=this&&this.__decorate||function(v,b,w,y){var C,N=arguments.length,z=N<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(z=(N<3?C(z):N>3?C(b,w,z):C(b,w))||z);return N>3&&z&&Object.defineProperty(b,w,z),z},h=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const _=c(844),p=c(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let x,k=o.LogService=class extends _.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(z))).join(", ")})`);const N=y.apply(this,C);return x.trace(`GlyphRenderer#${y.name} return`,N),N}}},7302:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=c(8460),h=c(844),_=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:_.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends h.Disposable{constructor(k){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const b in k)if(b in v)try{const w=k[b];v[b]=this._sanitizeAndValidateOption(b,w)}catch(w){console.error(w)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,h.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(k,v){return this.onOptionChange((b=>{b===k&&v(this.rawOptions[k])}))}onMultipleOptionChange(k,v){return this.onOptionChange((b=>{k.indexOf(b)!==-1&&v()}))}_setupOptions(){const k=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,w)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);w=this._sanitizeAndValidateOption(b,w),this.rawOptions[b]!==w&&(this.rawOptions[b]=w,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const w={get:k.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,w)}}_sanitizeAndValidateOption(k,v){switch(k){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[k]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${k}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[k]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=p.includes(v)?v:o.DEFAULT_OPTIONS[k];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${k} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${k} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${k} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${k} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=m},2660:function(a,o,c){var u=this&&this.__decorate||function(m,x,k,v){var b,w=arguments.length,y=w<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,k):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,x,k,v);else for(var C=m.length-1;C>=0;C--)(b=m[C])&&(y=(w<3?b(y):w>3?b(x,k,y):b(x,k))||y);return w>3&&y&&Object.defineProperty(x,k,y),y},h=this&&this.__param||function(m,x){return function(k,v){x(k,v,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const _=c(2585);let p=o.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const x=this._bufferService.buffer;if(m.id===void 0){const C=x.addMarker(x.ybase+x.y),N={data:m,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(N,C))),this._dataByLinkId.set(N.id,N),N.id}const k=m,v=this._getEntryIdKey(k),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,x.ybase+x.y),b.id;const w=x.addMarker(x.ybase+x.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(m,x){const k=this._dataByLinkId.get(m);if(k&&k.lines.every((v=>v.line!==x))){const v=this._bufferService.buffer.addMarker(x);k.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(k,v)))}}getLinkData(m){var x;return(x=this._dataByLinkId.get(m))==null?void 0:x.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,x){const k=m.lines.indexOf(x);k!==-1&&(m.lines.splice(k,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};o.OscLinkService=p=u([h(0,_.IBufferService)],p)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(h){return h[u]||[]},o.createDecorator=function(h){if(o.serviceRegistry.has(h))return o.serviceRegistry.get(h);const _=function(p,m,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(k,v,b){v[c]===v?v[u].push({id:k,index:b}):(v[u]=[{id:k,index:b}],v[c]=v)})(_,p,x)};return _.toString=()=>h,o.serviceRegistry.set(h,_),_}},2585:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=c(8343);var h;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(_){_[_.TRACE=0]="TRACE",_[_.DEBUG=1]="DEBUG",_[_.INFO=2]="INFO",_[_.WARN=3]="WARN",_[_.ERROR=4]="ERROR",_[_.OFF=5]="OFF"})(h||(o.LogLevelEnum=h={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=c(8460),h=c(225);class _{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,x,k=!1){return(16777215&m)<<3|(3&x)<<1|(k?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const m=new h.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let x=0,k=0;const v=m.length;for(let b=0;b=v)return x+this.wcwidth(w);const N=m.charCodeAt(b);56320<=N&&N<=57343?w=1024*(w-55296)+N-56320+65536:x+=this.wcwidth(N)}const y=this.charProperties(w,k);let C=_.extractWidth(y);_.extractShouldJoin(y)&&(C-=_.extractWidth(k)),x+=C,k=y}return x}charProperties(m,x){return this._activeProvider.charProperties(m,x)}}o.UnicodeService=_}},r={};function s(a){var o=r[a];if(o!==void 0)return o.exports;var c=r[a]={exports:{}};return t[a].call(c.exports,c,c.exports,s),c.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=s(9042),c=s(3236),u=s(844),h=s(5741),_=s(8285),p=s(7975),m=s(7090),x=["cols","rows"];class k extends u.Disposable{constructor(b){super(),this._core=this.register(new c.Terminal(b)),this._addonManager=this.register(new h.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(b){if(x.includes(b))throw new Error(`Option "${b}" 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 p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.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 _.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=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:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const w in b)this._publicOptions[w]=b[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,w=!0){this._core.input(b,w)}resize(b,w){this._verifyIntegers(b,w),this._core.resize(b,w)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,w,y){this._verifyIntegers(b,w,y),this._core.select(b,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,w){this._verifyIntegers(b,w),this._core.selectLines(b,w)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,w){this._core.write(b,w)}writeln(b,w){this._core.write(b),this._core.write(`\r -`,w)}paste(b){this._core.paste(b)}refresh(b,w){this._verifyIntegers(b,w),this._core.refresh(b,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const w of b)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const w of b)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}a.Terminal=k})(),i})()))})(lw)),lw.exports}var ZI=s5n();const i5n=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"];function bj(e,n){const t=document.documentElement,r=getComputedStyle(t),s=a=>r.getPropertyValue(n==="app"?`--term-app-${a}`:`--term-${a}`).trim(),i={};if(n==="app"&&t.dataset.theme!=="dark")for(const a of i5n){const o=r.getPropertyValue(`--term-app-ansi-${a.replace(/[A-Z]/g,c=>`-${c.toLowerCase()}`)}`).trim();o&&(i[a]=o)}return{...i,background:s("bg"),foreground:s("foreground"),cursor:s(e?"bg":"foreground"),cursorAccent:s("bg"),selectionBackground:s("selection")}}function Bb(e,n,t=!1,r="dark"){const s=getComputedStyle(document.documentElement),i=new ZI.Terminal({convertEol:!0,disableStdin:n,cursorBlink:!n,cursorStyle:"bar",cursorWidth:2,fontSize:12,fontFamily:s.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:bj(n,r)}),a=r==="app"?new MutationObserver(()=>{i.options.theme=bj(i.options.disableStdin??n,r)}):null;a==null||a.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const o=new t5n.FitAddon;i.loadAddon(o),t&&i.loadAddon(new r5n.WebLinksAddon((w,y)=>{let C;try{C=new URL(y)}catch{return}(C.protocol==="http:"||C.protocol==="https:")&&window.open(C,"_blank","noopener,noreferrer")}));const c=e.style.overflowY;e.style.overflowY="auto",i.open(e);let u=!0,h=null;const _=()=>{if(h===e.scrollTop){h=null;return}h=null,u=e.scrollTop+e.clientHeight>=e.scrollHeight-1};e.addEventListener("scroll",_);const p=()=>{var j;const w=i.element,y=w==null?void 0:w.querySelector(".xterm-screen"),C=w==null?void 0:w.querySelector(".xterm-viewport");if(!w||!(y instanceof HTMLElement)||!(C instanceof HTMLElement))return;const N=i.buffer.active;let z=Math.max(0,N.baseY+N.cursorY-N.viewportY+1);for(let M=i.rows-1;M>=z;M--)if((j=N.getLine(N.viewportY+M))!=null&&j.translateToString(!0).trim()){z=M+1;break}const T=y.getBoundingClientRect().height;w.style.height=`${Math.max(e.clientHeight,Math.min(z,i.rows)*T/i.rows)}px`,w.style.overflow="hidden",C.style.height=`${T}px`},m=()=>{try{const w=o.proposeDimensions();w&&(i.resize(w.cols,Math.max(w.rows,n?1:40)),p())}catch{}};m();const x=new ResizeObserver(m);x.observe(e);const k=i.onWriteParsed(()=>{var y;const w=u&&i.buffer.active.viewportY===i.buffer.active.baseY;if(p(),w){const C=(y=i.element)==null?void 0:y.querySelector(".xterm-screen");if(C instanceof HTMLElement){const N=(i.buffer.active.cursorY+1)*C.getBoundingClientRect().height/i.rows;e.scrollTop=Math.max(0,N-e.clientHeight),h=e.scrollTop}}}),v=i.onScroll(p),b=w=>{(w.deltaY<0?e.scrollTop>0:e.scrollTop+e.clientHeighttypeof n=="string")}function a5n(e){return yf(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||e$(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function o5n(e){return yf(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&e$(e.partitions)&&(e.error===null||typeof e.error=="string")}function c5n(e){return!yf(e)||e.type!=="complete"?null:e.backend==="ssh"&&a5n(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&o5n(e.result)?{backend:"slurm",result:e.result}:null}function t$(e){return yf(e)&&e.type==="complete"}function l5n(e){return yf(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function SS({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(Pb,{path:`${t}?${a}`,label:TL({host:Ne(e)}),active:r,onError:i,onComplete:o=>{const c=c5n(o);return c?(s(c),!0):!1}})}function u5n({login:e,onComplete:n,onError:t}){return f.jsx(Pb,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-96",onError:t,onComplete:r=>t$(r)?(n(),!0):!1})}function _5n({path:e,label:n,onComplete:t,onError:r,onClose:s}){const[i,a]=A.useState("running");return f.jsxs("div",{className:"mt-4 overflow-hidden rounded-lg border border-border",children:[f.jsxs("div",{className:"flex h-9 items-center gap-3 border-b border-b-border-variant bg-surface ps-3 pe-1.5",children:[f.jsx("code",{dir:"ltr",className:"min-w-0 flex-1 truncate font-mono text-xs text-subtext",children:n}),f.jsx("span",{role:"status",className:"flex shrink-0 items-center gap-1.5 text-xs text-subtext",children:i==="running"?f.jsxs(f.Fragment,{children:[f.jsx(Nt,{className:"border-t-accent-amber"})," ",Lzt()]}):i==="done"?f.jsxs(f.Fragment,{children:[f.jsx(Ri,{size:13,strokeWidth:2.5,className:"text-accent-green"})," ",wzt()]}):i==="failed"?f.jsxs(f.Fragment,{children:[f.jsx(lr,{size:13,strokeWidth:2.5,className:"text-accent-red"})," ",jzt()]}):pzt()}),f.jsx("button",{type:"button",onClick:s,"aria-label":Nz(),title:Nz(),className:"ms-1 inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted [&:hover]:bg-highlight [&:hover]:text-text",children:f.jsx(lr,{size:14})})]}),f.jsx(Pb,{path:e,label:n,heightClass:"h-80",frame:"bare",palette:"app",shellAfter:!0,onError:(o,c)=>{a("failed"),c&&r(o)},onComplete:o=>t$(o)?(a("done"),t(),!0):!1,onClosed:()=>a(o=>o==="running"?"closed":o)})]})}function Pb({path:e,label:n,command:t,heightClass:r="h-40",frame:s="card",palette:i="dark",shellAfter:a=!1,active:o=!0,awaitingApproval:c=!1,onComplete:u,onError:h,onClosed:_}){const p=A.useRef(null),m=A.useRef(null),x=A.useRef(u),k=A.useRef(h),v=A.useRef(_),[b,w]=A.useState(null);return x.current=u,k.current=h,v.current=_,A.useEffect(()=>{const y=p.current;if(!y)return;const{terminal:C,dispose:N}=Bb(y,c,!0,i);if(m.current=C,c)return t&&C.writeln(`$ ${t}`),()=>{m.current=null,N()};C.focus();const z=location.protocol==="https:"?"wss:":"ws:",T=new URL(e,`${z}//${location.host}`),j=new WebSocket(T);j.binaryType="arraybuffer";let M=!1,D=!1,I=!1;const $=(Q,V)=>{var J;if(D){V||C.writeln(Q);return}D=!0,(!I||a)&&C.writeln(Q),(J=k.current)==null||J.call(k,Q,V),!(a&&!V)&&(C.options.disableStdin=!0,C.blur(),w(Q))},q=C.onData(Q=>{j.readyState===WebSocket.OPEN&&j.send(new TextEncoder().encode(Q))}),H=C.onResize(({cols:Q,rows:V})=>{j.readyState===WebSocket.OPEN&&j.send(JSON.stringify({type:"resize",cols:Q,rows:V}))});return j.onopen=()=>{t&&C.writeln(`$ ${t}`),j.send(JSON.stringify({type:"resize",cols:C.cols,rows:C.rows}))},j.onmessage=Q=>{if(Q.data instanceof ArrayBuffer){I=!0,C.write(new Uint8Array(Q.data));return}if(typeof Q.data!="string")return;let V;try{V=JSON.parse(Q.data)}catch{return}if(x.current(V)){M=!0,a||j.close();return}const J=l5n(V);J&&(M?C.writeln(J):$(J,!a))},j.onerror=()=>$(jv(),!0),j.onclose=()=>{var Q;if(!M&&!D){$(jv(),!0);return}a&&(C.options.disableStdin=!0,C.blur(),(Q=v.current)==null||Q.call(v))},()=>{j.onopen=null,j.onmessage=null,j.onerror=null,j.onclose=null,q.dispose(),H.dispose(),j.close(),m.current=null,N()}},[e,t,c,i,a]),A.useEffect(()=>{const y=m.current;y&&(y.options.disableStdin=c||!o||b!==null,!c&&o&&b===null?y.focus():y.blur())},[o,b,c]),f.jsxs("div",{className:s==="card"?"mt-3":void 0,children:[f.jsx("div",{className:`${r} ${s==="card"?JI:`overflow-hidden p-3 ${i==="app"?"bg-terminal-app":"bg-terminal"}`}`,role:"group","aria-label":n,children:f.jsx("div",{ref:p,className:"h-full overflow-hidden"})}),b?f.jsx("p",{role:"alert",className:"sr-only",children:b}):null]})}function f5n({host:e,transcript:n}){const t=A.useRef(null);return A.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=Bb(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${JI}`,role:"group","aria-label":TL({host:Ne(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}let Iv=null,r0=0;const CS=()=>Iv;function n$(){const e=r0;return XI(async(n,t)=>{if(e!==r0)return;const r=await $vn(n,t);e===r0&&et.setQueryData(Cm().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===r0&&bn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Qs(),onClick:()=>void Fb.retry()}})})}let Y1=n$();function d5n(){r0++,Iv=null,Y1=n$()}const Fb={flush:(e=!1)=>Y1.flush(e),retry:()=>Y1.retry(),queue(e,n=0){const t=Iv;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||(Iv=e,Y1.queue(e,n))}};window.addEventListener("pagehide",()=>void Fb.flush(!0));function tl(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function Ja(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function r$(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.terminalTabOpen&&r.push("terminal"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[Ot(u),u])),a=e.contentTabOrder.flatMap(u=>{const h=i.get(u);return h?[h]:[]}),o=Ot(e.rightTab);return{tabs:[...r,...a].map(u=>tl(u,Ot(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?tl(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?Ot(e.previewTab):null,history:e.tabHistory.map(Ot),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[Ot(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function h5n(e,n){const t=NS();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>Ot(Ja(a))===Ot(Ja(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=Ja(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0),a==="terminal"&&(t.terminalTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[Ot(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(Ot(a))}const s=new Map(r.map(i=>{const a=Ja(i);return[Ot(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?Ja(n):e!=null&&e.active?Ja(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,i$(t,n)}const uw=(e,n)=>e.id===n.id&&e.view===n.view,__=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,ES=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Ls=(e,n,t)=>`${e}:${n??""}:${ES(t)}`,s$=e=>({...e,lineScrollRequest:void 0});function c1(e){return typeof e=="object"&&"path"in e?s$(e):e}const fd=(e,n)=>e.branch===n.branch;function Ot(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:${ES(e)}`:`experiment:${e.id}:${e.view}`}function Hp(e,n){const t=e.filter(r=>Ot(r)!==n);return t.length===e.length?e:t}function p5n(e){return e!==void 0}function NS(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,terminalTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===Ld&&n){const r="experiments";return{...t,rightTab:r,tabHistory:[r],experimentsTabOpen:!0,panelOpen:!0}}if(e===Ab){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{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Ot),panelOpen:!0}}if(e===Rb){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Ot),panelOpen:!0}}return t}function zS(e,n){const t=NS(e,n);return t.panelOpen?r$(t,{},{}):void 0}function i$(e,n){if(!n)return e;const t=Ja(n),r=Ot(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(c=>Ot(c)===r),i=(c,u)=>{const h=c.findIndex(_=>Ot(_)===r);return h<0?[...c,u]:JSON.stringify(tl(c[h]))===JSON.stringify(tl(u))?c:c.map((_,p)=>p===h?{..._,...u}:_)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:t==="terminal"?a.terminalTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&Ot(o)===r&&JSON.stringify(tl(o))===JSON.stringify(tl(t))||(a.tabHistory=[...e.tabHistory.filter(c=>Ot(c)!==r),t]),a}let eo=0;const M0=new Map,$v=new Map,B3=new Set,P3=()=>{for(const e of B3)e()},m5n=e=>(B3.add(e),()=>{B3.delete(e)}),O0=new Map,to=new Map,a$=e=>to.get(e);function g5n(){eo++,to.clear(),O0.clear(),M0.clear(),$v.clear(),P3()}function v5n(e,n){const t=to.get(e);if(!(t!=null&&t.tasks.new)||yu(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const c=Ja(o);if(typeof c=="string"||!("path"in c))return[];const u=Ls(e,null,c);return u in a?[[Ls(e,n,c),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,O0.set(e,n),to.set(e,{...t,tasks:i})}function b5n(e){let n=M0.get(e);if(!n){const t=eo;n=XI(async(r,s)=>{if(t!==eo)return;const i=await Ivn(e,r,s);t===eo&&et.setQueryData(oS(e).queryKey,i),t===eo&&$v.delete(e)&&P3()},r=>{t===eo&&($v.set(e,r instanceof Error?r.message:String(r)),P3())}),M0.set(e,n)}return n}function _w(e,n,t,r){const s=to.get(e);if(!s||t==="new"&&O0.has(e))return;const i=$b(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?yu(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const c={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});to.set(e,c),b5n(e).queue(c,u?250:0)}function yj(e,n,t,r){const s=new Set(e.state.fileTabs.map(h=>Ls(t,r==="new"?null:r,h))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([h])=>s.has(h))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([h])=>s.has(h))),o=r$(e.state,i,a),c=e.pane??(n==null?void 0:n.active),u=c?Ot(Ja(c)):null;return o.active=o.tabs.find(h=>Ot(Ja(h))===u)??null,o}function y5n(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,firstDemoOpen:a,state:o,apply:c,getScroll:u,sourceModes:h,revision:_}=e,p=A.useRef(pj()),m=A.useSyncExternalStore(m5n,()=>n?$v.get(n)??null:null),[x,k]=A.useState(null),[v,b]=A.useState(0),[w,y]=A.useState(null),[C,N]=A.useState(null),z=A.useRef(null),T=A.useRef(null),j=A.useRef(null),M=A.useRef(e);M.current=e;const D=JSON.stringify([n,t,i]),I=JSON.stringify(s??null),$=A.useCallback(()=>{const H=j.current;if(!H)return;const Q=yj({...M.current,state:H.state,pane:H.pane},yu(to.get(H.projectId),H.taskKey),H.projectId,H.taskKey);_w(H.projectId,H.location,H.taskKey,Q)},[]);A.useEffect(()=>{let H=!0;const Q=eo;if(k(null),y(null),!!n)return to.has(n)?y(n):et.fetchQuery(oS(n)).then(V=>{!H||Q!==eo||(to.set(n,V??pj()),y(n))}).catch(V=>{H&&Q===eo&&k(V instanceof Error?V.message:String(V))}),()=>{H=!1}},[n,v]),A.useLayoutEffect(()=>{if(j.current&&j.current.scope!==D){const V=j.current.projectId;$(),O0.get(V)===t&&O0.delete(V),j.current=null}if(!n||w!==n)return;const H=to.get(n);if(!H)return;if(p.current=H,z.current!==D){if(z.current=D,T.current=I,i){const V=yu(H,t)??(Uc(n)?zS(t,a):void 0);c(h5n(V,s),V,!0)}N(D);return}if(C!==D)return;let Q=o;T.current!==I&&(T.current=I,i&&s&&(Q=i$(o,s),c(Q,void 0,!1))),i?(_w(n,r,t,yj({state:Q,pane:s,getScroll:u,sourceModes:h},yu(H,t),n,t)),j.current={projectId:n,taskKey:t,scope:D,location:r,pane:s,state:Q}):_w(n,r),p.current=to.get(n)??H},[n,t,r,s,I,i,a,o,c,u,h,_,w,D,C,$]),A.useEffect(()=>{const H=eo,Q=J=>{if(H===eo){$();for(const Z of M0.values())Z.flush(J)}},V=()=>Q(!0);return window.addEventListener("pagehide",V),()=>{window.removeEventListener("pagehide",V),Q(!1)}},[$]);const q=A.useCallback(()=>{var H;n&&(x?b(Q=>Q+1):(H=M0.get(n))==null||H.retry())},[n,x]);return{ready:n===null||w===n&&C===D,loaded:n===null||w===n,error:x??m,retry:q,capture:$,workspace:p}}const x5n="data:image/svg+xml,"+encodeURIComponent(''),F3=A.createContext(null);function w5n(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function o$(){const e=A.useContext(F3);if(!e)throw new Error("Runtime is not connected");return e}function k5n(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?x5n:"/favicon.svg")}function xj(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function S5n(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!xj("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&dI(n),!xj("orx:locale")&&t&&hD(t)&&_I(t)}function C5n(e){return e.includes("ssh ")&&e.includes("failed")}function wj({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:aL({host:Ne(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:u3()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:tkt()})]})})}function kj({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,D,I;const{session:s}=e,[i,a]=A.useState(s.installPaths),[o,c]=A.useState(!1),[u,h]=A.useState(null);A.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(D=s.installPaths)==null?void 0:D.database,(I=s.installPaths)==null?void 0:I.cache]);async function _(){if(i){c(!0);try{await eyn(i)}catch($){bn($ instanceof Error?$.message:String($),"error")}finally{c(!1)}}}async function p($=!1){r($?s.error:null),c(!0);try{await tyn()}catch(q){bn(q instanceof Error?q.message:String(q),"error")}finally{c(!1)}}async function m(){c(!0);try{await VL()}catch($){bn($ instanceof Error?$.message:String($),"error")}finally{c(!1)}}async function x(){c(!0);try{h(await KL())}catch($){bn($ instanceof Error?$.message:String($),"error")}finally{c(!1)}}async function k(){if(u){c(!0);try{await WL(u),h(null)}catch($){h(null),bn($ instanceof Error?$.message:String($),"error")}finally{c(!1)}}}async function v(){c(!0);try{await nyn()}catch($){bn($ instanceof Error?$.message:String($),"error")}finally{c(!1)}}const b=s.status==="applying"||o,w=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&w,N=["connecting","applying","reconnecting"].includes(s.status),z=s.status==="disconnected"&&s.error!==null&&C5n(s.error)&&t!==s.error&&!s.canStartNewHost,T=w?qkt():y?B7t():s.status==="applying"?w3t({host:Ne(s.host)}):s.status==="reconnecting"?s6t({host:Ne(s.host)}):s.status==="disconnected"?s.error?W5t({host:Ne(s.host)}):s.canStartNewHost?pkt({host:Ne(s.host)}):aL({host:Ne(s.host)}):n5t({host:Ne(s.host)}),j=s.error??(s.canStartNewHost?ckt():w?uSt({user:Ne(s.user??""),host:Ne(s.host)}):y?R7t({host:Ne(s.host)}):s.status==="applying"?p3t():s.status==="reconnecting"?YSt():s.status==="disconnected"?D5t():Q3t());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[N&&f.jsx(Nt,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:T}),!z&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j})]})]}),z&&f.jsx(SS,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:Lkt()}),[["binary",wkt()],["database",jkt()]].map(([$,q])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[q,f.jsx(qr,{value:i[$],onChange:H=>a({...i,[$]:H.target.value}),disabled:b,dir:"ltr"})]},$)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(De,{variant:"primary",disabled:b,onClick:()=>void _(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(Nt,{})," ",Xkt()]}):y?kz():vL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(De,{variant:"primary",disabled:b,onClick:()=>void _(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(Nt,{})," ",V7t()]}):kz()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(De,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(Nt,{}):null,s.error?xz():k6t()]}):f.jsxs(De,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(Nt,{}):null,xz()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(De,{disabled:o,onClick:()=>void m(),children:h3()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(De,{disabled:o,onClick:()=>void m(),children:h3()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(Nt,{}):null,yz()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid x(),children:[o?f.jsx(Nt,{}):null,oL()]})]}),w&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(De,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(Nt,{}):null,yz()]})})]})}),u&&f.jsx(RI,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||h(null)},onConfirm:()=>void k()})]})}function E5n({children:e}){const n=A.useRef(null);return A.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function N5n(){A.useSyncExternalStore(eE,sK),A.useEffect(()=>eE(()=>{d5n(),g5n()}),[]);const e=lQ({select:x=>x.pathname==="/remote-launch"}),[n,t]=A.useState(null),[r,s]=A.useState(null),i=A.useRef(!1),a=A.useRef(!1),o=A.useRef(!1),c=A.useRef(null),[u,h]=A.useState(null),_=ct({...bxn(),enabled:!e,refetchInterval:x=>{var k;return x.state.status==="error"||((k=x.state.data)==null?void 0:k.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(A.useEffect(()=>{var v,b;if(e)return;const x=_.data;if(!x){s(((v=_.error)==null?void 0:v.message)??null);return}const k=w5n(x);iK(k),c.current!==null&&c.current!==k&&(i.current=!1,a.current=!1,o.current=!1),c.current=k,x.kind==="ssh"&&(o.current||(o.current=!0,S5n(x)),x.session.status==="connected"?(i.current=!0,a.current=!0,h(null)):x.session.status==="disconnected"&&x.session.error===null&&(a.current=!1)),t(x),s(((b=_.error)==null?void 0:b.message)??null)},[e,_.data,_.error]),A.useEffect(()=>{const x=(n==null?void 0:n.kind)==="ssh";k5n(x),x&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(Nt,{})," ",$St()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(De,{onClick:()=>location.reload(),children:Qs()})]}):f.jsx(Nt,{})});if(n.kind==="local")return f.jsxs(F3,{value:n,children:[f.jsx(ej,{}),f.jsx(N0,{})]},Ia()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(wj,{host:n.session.host}):f.jsx(kj,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:h});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(F3,{value:n,children:[f.jsx(ej,{}),f.jsx(N0,{})]},Ia()[1])}),m&&f.jsx(E5n,{children:r?f.jsx(wj,{host:n.session.host,overlay:!0}):f.jsx(kj,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:h})})]})}const Hb=VW()({component:N5n}),jS="orx:demo-read-sessions";function c$(){try{const e=JSON.parse(sessionStorage.getItem(jS)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function z5n(e){try{const n=c$();n.add(e),sessionStorage.setItem(jS,JSON.stringify([...n]))}catch{}}function j5n(){try{sessionStorage.removeItem(jS)}catch{}}function l$(e,n){const t=J_(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function T5n(e=et){var i;const[n,t]=await Promise.all([e.fetchQuery(Cm()),e.fetchQuery(dh())]),r=$b((i=CS()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=J_(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!l$(r,await e.fetchQuery(La(s.projectId)))?"/projects":r}async function A5n(e,n=et){var h;const[t,r]=await Promise.all([n.fetchQuery(oS(e)),n.fetchQuery(La(e))]),s=a$(e)??t,i=$b(s==null?void 0:s.lastLocation);if(i&&((h=J_(i.split("?")[0]))==null?void 0:h.projectId)===e&&l$(i,r))return i;const a=r.find(_=>!_.archived),o=Uc(e)?zS(a==null?void 0:a.id,!(await n.fetchQuery(Cm())).tourCompleted):void 0,c=yu(s,(a==null?void 0:a.id)??"new"),u=c?c.active:o==null?void 0:o.active;return X1(e,(a==null?void 0:a.id)??null,u)}const Bv=360,R5n=272,M5n=380,O5n=R5n+56;function s0(){return Math.max(Bv,window.innerWidth-O5n-M5n)}function u$(){const e=s0();return Math.max(Bv,Math.min(480,e,Math.round(window.innerWidth*.25)))}function TS(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.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 fw(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx(TS,{}),"OpenResearch"]})}const Sj="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";function D5n({cmd:e,onRun:n}){const[t,r]=A.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{dir:"ltr",className:"font-mono text-sm",children:e}),n&&f.jsx("button",{type:"button",className:`cmd-inline-run ${Sj}`,onClick:n,"aria-label":FE({value:Ne(e)}),title:FE({value:Ne(e)}),children:f.jsx(S3n,{size:11})}),f.jsx("button",{type:"button",className:`cmd-inline-copy ${Sj}`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})},"aria-label":t?K_():MX({value:Ne(e)}),title:t?K_():Qk(),children:t?f.jsx(Ri,{size:11,strokeWidth:3}):f.jsx(gf,{size:11})})]})}function gh(e,n){return e?e.split(/`([^`]+)`/).map((t,r)=>r%2===1?f.jsx(D5n,{cmd:t,onRun:n!=null&&n.canRun(t)?()=>n.onRun(t):void 0},r):t):null}function vh({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.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"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):e==="antigravity"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"13 18 85 80",fill:"#3186FF","aria-hidden":"true",children:f.jsx("path",{d:"M89.6992 93.695C94.3659 97.195 101.366 94.8617 94.9492 88.445C75.6992 69.7783 79.7825 18.445 55.8659 18.445C31.9492 18.445 36.0325 69.7783 16.7825 88.445C9.78251 95.445 17.3658 97.195 22.0325 93.695C40.1159 81.445 38.9492 59.8617 55.8659 59.8617C72.7825 59.8617 71.6159 81.445 89.6992 93.695Z"})}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.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"})})}function H3(e){return!e.installed||e.installBroken?"install":e.authState==="unsupported"&&!e.needsConfigRepair?"update":"login"}function L5n(e,n){return e.needsConfigRepair?"error":n==="login"?"running":"preview"}function Cj(e,n){return n||e==="preview"}function I5n(e,n){if(!e||e.needsConfigRepair)return null;const t=H3(e);return t===n?null:t}function _$({harness:e,commands:n,onReady:t,onClose:r}){const s=A.useRef(null),i=A.useRef(!1),[a,o]=A.useState(()=>H3(e)),[c,u]=A.useState(0),[h,_]=A.useState(()=>L5n(e,H3(e))),[p,m]=A.useState(h==="running"),[x,k]=A.useState(e.needsConfigRepair),[v,b]=A.useState(e.needsConfigRepair?e.agentNote??null:null),w=h==="running"||h==="checking",y=n[a].includes(` -`)?void 0:n[a];A.useEffect(()=>{i.current=!1;const N=s.current;return N==null||N.showModal(),()=>{i.current=!0,N==null||N.close()}},[]);const C=async()=>{_("checking"),b(null);try{const N=await Y_(!0,!0);if(i.current)return;const z=N.find(T=>T.id===e.id);if(k((z==null?void 0:z.needsConfigRepair)??!1),z!=null&&z.agentReady&&(a!=="login"||z.authenticated))t==null||t(z),_("success"),e.id==="antigravity"&&a==="login"&&r();else if(a!=="login"&&(z!=null&&z.installed)&&!z.installBroken&&!z.needsConfigRepair&&z.authState==="needsLogin")o("login"),m(!0),_("running");else{const T=I5n(z,a);T&&(o(T),m(!1)),b((z==null?void 0:z.agentNote)??qD()),_("error")}}catch(N){if(i.current)return;b(N instanceof Error?N.message:String(N)),_("error")}};return f.jsxs("dialog",{ref:s,className:"m-auto w-180 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"harness-setup-title",onKeyDown:N=>{N.key==="Escape"&&w&&N.preventDefault()},onCancel:N=>{N.preventDefault(),w||r()},children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(vh,{harness:e.id,size:26}),f.jsx("h2",{id:"harness-setup-title",className:"m-0 text-xl font-medium",children:UN({agent:e.name})})]}),h==="preview"?f.jsx("p",{className:"my-4 text-sm text-subtext",children:a==="install"?vWe({agent:e.name}):SQe({agent:e.name})}):y&&Cj(h,p)?f.jsx("p",{className:"my-4 text-sm text-subtext [&_.cmd-inline]:mx-2 [&_.cmd-inline]:gap-2",children:gh(sQe({command:y}))}):null,h!=="running"&&h!=="preview"&&f.jsxs("p",{className:"my-4 flex items-center gap-2 text-sm",role:"status",children:[h==="checking"&&f.jsx(Nt,{}),h==="success"?ZKe({agent:e.name}):h==="error"?FD():GKe()]}),a==="install"&&n.requiresNpm&&f.jsx("p",{className:"text-sm text-subtext",children:YWe()}),Cj(h,p)&&f.jsx(Pb,{path:`/api/harnesses/setup?${new URLSearchParams({harness:e.id,action:a})}`,label:UN({agent:e.name}),command:y,heightClass:"h-96",active:h==="running",awaitingApproval:h==="preview",onComplete:N=>typeof N!="object"||N===null||!("type"in N)||N.type!=="complete"?!1:(C(),!0),onError:N=>{b(N),_("error")}},`${a}-${c}`),v&&f.jsx("p",{role:"alert",className:"text-sm text-accent-red",children:gh(v)}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[h==="error"&&f.jsx(De,{variant:"ghost",onClick:()=>{b(null),C()},children:Nv()}),h==="error"&&!x&&f.jsx(De,{onClick:()=>{b(null),m(!0),_("running"),u(N=>N+1)},children:Qs()}),f.jsx(De,{variant:h==="success"?"primary":"default",onClick:r,children:h==="success"?OL():w?$Ke():T0()}),h==="preview"&&f.jsx(De,{variant:"primary",onClick:()=>{m(!0),_("running")},children:AKe()})]})]})}const $5n={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function D0({variant:e="list",className:n,...t}){return f.jsx("span",{className:bs("title",$5n[e],n),...t})}const Ej=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),F_=["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(" "),dw=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),f$=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),B5n=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),P5n=[{id:"AI/ML",label:Dlt},{id:"Biology",label:Hlt},{id:"Physics",label:nut},{id:"Other",label:Qlt}],F5n=["welcome","environment","profile"];function H5n({onDone:e,preferredAgent:n,remote:t}){var dt;const r=an({mutationFn:Ie=>Pvn(...Ie)}),[s,i]=A.useState(0);A.useEffect(()=>{const Ie=F5n[s];Ie&&ru({name:"onboarding_step_viewed",step:Ie})},[s]);const a=ct(ku()),o=ct(d0()),c=ct(rI()),[u,h]=A.useState(null),[_,p]=A.useState(!1),m=A.useRef(null),x=A.useRef(""),k=A.useRef(null),v=A.useRef(!1);A.useEffect(()=>()=>{var Ie;return(Ie=m.current)==null?void 0:Ie.close()},[]);const b=a.data??null,w=(dt=o.data)==null?void 0:dt.gitVersion,[y,C]=A.useState(!1),[N,z]=A.useState(null),[T,j]=A.useState(""),[M,D]=A.useState(null),[I,$]=A.useState(!1),[q,H]=A.useState([]),[Q,V]=A.useState(""),[J,Z]=A.useState(""),[B,L]=A.useState([]),[F,U]=A.useState(""),[K,ne]=A.useState([]),[ce,_e]=A.useState(!1),se=A.useRef(0),[G,oe]=A.useState(!1),[le,pe]=A.useState(!1),be=(b==null?void 0:b.some(Ie=>Ie.agentReady&&!Ie.catalogPending))??!1,Me=(b==null?void 0:b.some(Ie=>Ie.catalogPending))??!1,Le=w!=null,Ke=A.useRef(0),je=(Ie,me=!1)=>{const Ae=++Ke.current;$(!0),oe(!1),pe(!1);const Pe=()=>Ae===Ke.current;Promise.allSettled([Y_(Ie,me),et.fetchQuery({...d0(),staleTime:Ie?0:3e4})]).then(([nt,_t])=>{Pe()&&(nt.status==="rejected"&&oe(!0),_t.status==="rejected"&&pe(!0))}).finally(()=>Pe()&&$(!1))};A.useEffect(()=>je(!1),[]),A.useEffect(()=>{if(b===null)return;const Ie=b.filter(me=>me.agentReady&&!me.catalogPending);D(me=>{var Pe;if(me&&Ie.some(nt=>nt.id===me))return me;const Ae=n&&Ie.find(nt=>nt.id===n.harness);return(Ae==null?void 0:Ae.id)??((Pe=Ie[0])==null?void 0:Pe.id)??null})},[b,n]),A.useEffect(()=>oe(a.isError),[a.isError,a.dataUpdatedAt]),A.useEffect(()=>pe(o.isError),[o.isError,o.dataUpdatedAt]),A.useEffect(()=>{et.fetchQuery(xxn()).then(Ie=>{H(Ie.researchAreas),V(Ie.otherArea??""),Z(Ie.background??""),L(Ie.papers)}).catch(()=>{})},[]),A.useEffect(()=>{const Ie=F.trim();if(Ie.length<3){ne([]),_e(!1);return}const me=++se.current;_e(!0);const Ae=setTimeout(()=>{et.fetchQuery(uI(Ie)).then(Pe=>me===se.current&&ne(Pe)).catch(()=>me===se.current&&ne([])).finally(()=>me===se.current&&_e(!1))},350);return()=>clearTimeout(Ae)},[F]);const we=Ie=>{const me=B.some(Ae=>Ae.paperId===Ie.paperId);L(Ae=>Ae.some(Pe=>Pe.paperId===Ie.paperId)?Ae:[...Ae,{paperId:Ie.paperId,title:Nj(Ie.title)}]),U(""),ne([]),me||et.fetchQuery(R3(Ie.paperId)).then(Ae=>{var nt;const Pe=(nt=Ae.title)==null?void 0:nt.trim();Pe&&L(_t=>_t.map(pt=>pt.paperId===Ie.paperId?{...pt,title:Pe}:pt))}).catch(()=>{})},rt=Ie=>L(me=>me.filter(Ae=>Ae.paperId!==Ie)),Ze=Ie=>{H(me=>me.includes(Ie)?me.filter(Ae=>Ae!==Ie):[...me,Ie])},at=q.length>0&&(!q.includes("Other")||Q.trim().length>0),St=()=>{if(k.current)return k.current;x.current="",v.current=!0,p(!0);const Ie=(async()=>{await new Promise((Pe,nt)=>{const _t=location.protocol==="https:"?"wss:":"ws:",pt=new WebSocket(`${_t}//${location.host}/api/harnesses/setup?harness=opencode&action=install&trigger=automatic`);pt.binaryType="arraybuffer";const yt=new TextDecoder,Zt=new ZI.Terminal;Zt.onData(jt=>{pt.readyState===WebSocket.OPEN&&pt.send(new TextEncoder().encode(jt))}),m.current=pt;let nn=!1;pt.onmessage=jt=>{if(jt.data instanceof ArrayBuffer){Zt.write(new Uint8Array(jt.data)),x.current=(x.current+yt.decode(jt.data,{stream:!0})).slice(-65536);return}if(typeof jt.data!="string")return;let mt;try{mt=JSON.parse(jt.data)}catch{return}typeof mt!="object"||mt===null||!("type"in mt)||(mt.type==="complete"?(nn=!0,pt.close(),Pe()):mt.type==="error"&&(pt.close(),nt(new Error("error"in mt&&typeof mt.error=="string"?mt.error:FD()))))},pt.onerror=()=>{pt.close(),nt(new Error(jv()))},pt.onclose=()=>{Zt.dispose(),m.current=null,nn||nt(new Error(jv()))}});const Ae=(await Y_(!0,!0)).find(Pe=>Pe.id==="opencode"&&Pe.agentReady);if(!Ae)throw new Error(Ldt());return D("opencode"),Ae})();return k.current=Ie,Ie.catch(()=>{}),Ie};A.useEffect(()=>{t||v.current||!(b!=null&&b.length)||b.some(Ie=>Ie.catalogPending)||!b.every(Ie=>!Ie.installed&&!Ie.installBroken)||St()},[b,t]),A.useEffect(()=>{s===1&&_&&i(2)},[s,_]);const Ft=()=>{i(_?2:1)},ut=async(Ie="complete")=>{var me;if(!(y||Ie==="complete"&&(!at||!Le))){C(!0),z(null),j("");try{const Ae=_?await St():b==null?void 0:b.find(_t=>_t.id===M&&_t.agentReady&&!_t.catalogPending);if(!Ae)throw new Error(qD());if(Ie==="setup")return;const Pe=U5n(Ae,((me=Ae.models[0])==null?void 0:me.id)??null),nt=await r.mutateAsync([Pe,{researchAreas:q,otherArea:q.includes("Other")?Q:null,background:J||null,papers:B}]);e(nt.project,nt.selection)}catch(Ae){_&&(k.current=null);const Pe=Ae instanceof Error?Ae.message:String(Ae);z(Pe),j([x.current,Pe].filter(Boolean).join(` +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(j){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&j&&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(j){const M=this._getMouseBufferCoords(j),D=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(D&&I&&M)&&this._areCoordsInSelection(M,D,I)}isCellInSelection(j,M){const D=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!D||!I)&&this._areCoordsInSelection([j,M],D,I)}_areCoordsInSelection(j,M,D){return j[1]>M[1]&&j[1]=M[0]&&j[0]=M[0]}_selectWordAtCursor(j,M){var $,q;const D=(q=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:q.range;if(D)return this._model.selectionStart=[D.start.x-1,D.start.y-1],this._model.selectionStartLength=(0,x.getRangeLength)(D,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(j);return!!I&&(this._selectWordAt(I,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,M){this._model.clearSelection(),j=Math.max(j,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const M=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(j){let M=(0,_.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const D=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=D?0:(M>D&&(M-=D),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(j){return b.isMac?j.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:j.shiftKey}handleMouseDown(j){if(this._mouseDownTimeStamp=j.timeStamp,(j.button!==2||!this.hasSelection)&&j.button===0){if(!this._enabled){if(!this.shouldForceSelection(j))return;j.stopPropagation()}j.preventDefault(),this._dragScrollAmount=0,this._enabled&&j.shiftKey?this._handleIncrementalClick(j):j.detail===1?this._handleSingleClick(j):j.detail===2?this._handleDoubleClick(j):j.detail===3&&this._handleTripleClick(j),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(j){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(j))}_handleSingleClick(j){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(j)?3:0,this._model.selectionStart=this._getMouseBufferCoords(j),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const M=this._getMouseBufferCoords(j);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(j){return j.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(j),!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 D=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(j.ydisp+this._bufferService.rows,j.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=j.ydisp),this.refresh()}}_handleMouseUp(j){const M=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const D=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(D&&D[0]!==void 0&&D[1]!==void 0){const I=(0,p.moveToCellSequence)(D[0]-1,D[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,D=!(!j||!M||j[0]===M[0]&&j[1]===M[1]);D?j&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,M,D)):this._oldHasSelection&&this._fireOnSelectionChange(j,M,D)}_fireOnSelectionChange(j,M,D){this._oldSelectionStart=j,this._oldSelectionEnd=M,this._oldHasSelection=D,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(j,M){let D=M;for(let I=0;M>=I;I++){const $=j.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?D--:$>1&&M!==I&&(D+=$-1)}return D}setSelection(j,M,D){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,M],this._model.selectionStartLength=D,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,M,D=!0,I=!0){if(j[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,q=$.lines.get(j[1]);if(!q)return;const H=$.translateBufferLineToString(j[1],!1);let Q=this._convertViewportColToCharacterIndex(q,j[0]),V=Q;const Z=j[0]-Q;let Y=0,B=0,L=0,F=0;if(H.charAt(Q)===" "){for(;Q>0&&H.charAt(Q-1)===" ";)Q--;for(;V1&&(F+=ue-1,V+=ue-1);ne>0&&Q>0&&!this._isCharWordSeparator(q.loadCell(ne-1,this._workCell));){q.loadCell(ne-1,this._workCell);const se=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,ne--):se>1&&(L+=se-1,Q-=se-1),Q--,ne--}for(;oe1&&(F+=se-1,V+=se-1),V++,oe++}}V++;let U=Q+Z-Y+L,K=Math.min(this._bufferService.cols,V-Q+Y+B-L-F);if(M||H.slice(Q,V).trim()!==""){if(D&&U===0&&q.getCodePoint(0)!==32){const ne=$.lines.get(j[1]-1);if(ne&&q.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const oe=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(oe){const ue=this._bufferService.cols-oe.start;U-=ue,K+=ue}}}if(I&&U+K===this._bufferService.cols&&q.getCodePoint(this._bufferService.cols-1)!==32){const ne=$.lines.get(j[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const oe=this._getWordAt([0,j[1]+1],!1,!1,!0);oe&&(K+=oe.length)}}return{start:U,length:K}}}_selectWordAt(j,M){const D=this._getWordAt(j,M);if(D){for(;D.start<0;)D.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[D.start,j[1]],this._model.selectionStartLength=D.length}}_selectToWordAt(j){const M=this._getWordAt(j,!0);if(M){let D=j[1];for(;M.start<0;)M.start+=this._bufferService.cols,D--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,D++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,D]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const M=this._bufferService.buffer.getWrappedRangeForLine(j),D={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,x.getRangeLength)(D,this._bufferService.cols)}};o.SelectionService=T=u([h(3,C.IBufferService),h(4,C.ICoreService),h(5,w.IMouseService),h(6,C.IOptionsService),h(7,w.IRenderService),h(8,w.ICoreBrowserService)],T)},4725:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=c(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(a,o,c){var u=this&&this.__decorate||function(T,j,M,D){var I,$=arguments.length,q=$<3?j:D===null?D=Object.getOwnPropertyDescriptor(j,M):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(T,j,M,D);else for(var H=T.length-1;H>=0;H--)(I=T[H])&&(q=($<3?I(q):$>3?I(j,M,q):I(j,M))||q);return $>3&&q&&Object.defineProperty(j,M,q),q},h=this&&this.__param||function(T,j){return function(M,D){j(M,D,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const _=c(7239),p=c(8055),m=c(8460),w=c(844),k=c(2585),v=p.css.toColor("#ffffff"),b=p.css.toColor("#000000"),x=p.css.toColor("#ffffff"),y=p.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let M=0;M<216;M++){const D=j[M/36%6|0],I=j[M/6%6|0],$=j[M%6];T.push({css:p.channels.toCss(D,I,$),rgba:p.channels.toRgba(D,I,$)})}for(let M=0;M<24;M++){const D=8+10*M;T.push({css:p.channels.toCss(D,D,D),rgba:p.channels.toRgba(D,D,D)})}return T})());let z=o.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new _.ColorContrastCache,this._halfContrastCache=new _.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:x,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:p.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:p.color.blend(b,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const j=this._colors;if(j.foreground=E(T.foreground,v),j.background=E(T.background,b),j.cursor=E(T.cursor,x),j.cursorAccent=E(T.cursorAccent,y),j.selectionBackgroundTransparent=E(T.selectionBackground,C),j.selectionBackgroundOpaque=p.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=E(T.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=p.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=T.selectionForeground?E(T.selectionForeground,p.NULL_COLOR):void 0,j.selectionForeground===p.NULL_COLOR&&(j.selectionForeground=void 0),p.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=p.color.opacity(j.selectionBackgroundTransparent,.3)),p.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=p.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=o.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=E(T.black,o.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=E(T.red,o.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=E(T.green,o.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=E(T.yellow,o.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=E(T.blue,o.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=E(T.magenta,o.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=E(T.cyan,o.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=E(T.white,o.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=E(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=E(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=E(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=E(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=E(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=E(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=E(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=E(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(j.ansi.length-16,T.extendedAnsi.length);for(let D=0;D{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=c(8460),h=c(844);class _ extends h.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.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(m){if(this._maxLength===m)return;const w=new Array(m);for(let k=0;kthis._length)for(let w=this._length;w=m;v--)this._array[this._getCyclicIndex(v+k.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;vthis._maxLength){const v=this._length+k.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=k.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,w,k){if(!(w<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+k<0)throw new Error("Cannot shift elements in list beyond index 0");if(k>0){for(let b=w-1;b>=0;b--)this.set(m+b+k,this.get(m+b));const v=m+w+k-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(u,h=5){if(typeof u!="object")return u;const _=Array.isArray(u)?[]:{};for(const p in u)_[p]=h<=1?u[p]:u[p]&&c(u[p],h-1);return _}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,u=0,h=0,_=0;var p,m,w,k,v;function b(y){const C=y.toString(16);return C.length<2?"0"+C:C}function x(y,C){return y>>0},y.toColor=function(C,z,E,T){return{css:y.toCss(C,z,E,T),rgba:y.toRgba(C,z,E,T)}}})(p||(o.channels=p={})),(function(y){function C(z,E){return _=Math.round(255*E),[c,u,h]=v.toChannels(z.rgba),{css:p.toCss(c,u,h,_),rgba:p.toRgba(c,u,h,_)}}y.blend=function(z,E){if(_=(255&E.rgba)/255,_===1)return{css:E.css,rgba:E.rgba};const T=E.rgba>>24&255,j=E.rgba>>16&255,M=E.rgba>>8&255,D=z.rgba>>24&255,I=z.rgba>>16&255,$=z.rgba>>8&255;return c=D+Math.round((T-D)*_),u=I+Math.round((j-I)*_),h=$+Math.round((M-$)*_),{css:p.toCss(c,u,h),rgba:p.toRgba(c,u,h)}},y.isOpaque=function(z){return(255&z.rgba)==255},y.ensureContrastRatio=function(z,E,T){const j=v.ensureContrastRatio(z.rgba,E.rgba,T);if(j)return p.toColor(j>>24&255,j>>16&255,j>>8&255)},y.opaque=function(z){const E=(255|z.rgba)>>>0;return[c,u,h]=v.toChannels(E),{css:p.toCss(c,u,h),rgba:E}},y.opacity=C,y.multiplyOpacity=function(z,E){return _=255&z.rgba,C(z,_*E/255)},y.toColorRGB=function(z){return[z.rgba>>24&255,z.rgba>>16&255,z.rgba>>8&255]}})(m||(o.color=m={})),(function(y){let C,z;try{const E=document.createElement("canvas");E.width=1,E.height=1;const T=E.getContext("2d",{willReadFrequently:!0});T&&(C=T,C.globalCompositeOperation="copy",z=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),u=parseInt(E.slice(2,3).repeat(2),16),h=parseInt(E.slice(3,4).repeat(2),16),p.toColor(c,u,h);case 5:return c=parseInt(E.slice(1,2).repeat(2),16),u=parseInt(E.slice(2,3).repeat(2),16),h=parseInt(E.slice(3,4).repeat(2),16),_=parseInt(E.slice(4,5).repeat(2),16),p.toColor(c,u,h,_);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 T=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(T)return c=parseInt(T[1]),u=parseInt(T[2]),h=parseInt(T[3]),_=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),p.toColor(c,u,h,_);if(!C||!z)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=z,C.fillStyle=E,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[c,u,h,_]=C.getImageData(0,0,1,1).data,_!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(c,u,h,_),css:E}}})(w||(o.css=w={})),(function(y){function C(z,E,T){const j=z/255,M=E/255,D=T/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))}y.relativeLuminance=function(z){return C(z>>16&255,z>>8&255,255&z)},y.relativeLuminance2=C})(k||(o.rgb=k={})),(function(y){function C(E,T,j){const M=E>>24&255,D=E>>16&255,I=E>>8&255;let $=T>>24&255,q=T>>16&255,H=T>>8&255,Q=x(k.relativeLuminance2($,q,H),k.relativeLuminance2(M,D,I));for(;Q0||q>0||H>0);)$-=Math.max(0,Math.ceil(.1*$)),q-=Math.max(0,Math.ceil(.1*q)),H-=Math.max(0,Math.ceil(.1*H)),Q=x(k.relativeLuminance2($,q,H),k.relativeLuminance2(M,D,I));return($<<24|q<<16|H<<8|255)>>>0}function z(E,T,j){const M=E>>24&255,D=E>>16&255,I=E>>8&255;let $=T>>24&255,q=T>>16&255,H=T>>8&255,Q=x(k.relativeLuminance2($,q,H),k.relativeLuminance2(M,D,I));for(;Q>>0}y.blend=function(E,T){if(_=(255&T)/255,_===1)return T;const j=T>>24&255,M=T>>16&255,D=T>>8&255,I=E>>24&255,$=E>>16&255,q=E>>8&255;return c=I+Math.round((j-I)*_),u=$+Math.round((M-$)*_),h=q+Math.round((D-q)*_),p.toRgba(c,u,h)},y.ensureContrastRatio=function(E,T,j){const M=k.relativeLuminance(E>>8),D=k.relativeLuminance(T>>8);if(x(M,D)>8));if(Hx(M,k.relativeLuminance(Q>>8))?q:Q}return q}const I=z(E,T,j),$=x(M,k.relativeLuminance(I>>8));if($x(M,k.relativeLuminance(q>>8))?I:q}return I}},y.reduceLuminance=C,y.increaseLuminance=z,y.toChannels=function(E){return[E>>24&255,E>>16&255,E>>8&255,255&E]}})(v||(o.rgba=v={})),o.toPaddedHex=b,o.contrastRatio=x},8969:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=c(844),h=c(2585),_=c(4348),p=c(7866),m=c(744),w=c(7302),k=c(6975),v=c(8460),b=c(1753),x=c(1480),y=c(7994),C=c(9282),z=c(5435),E=c(5981),T=c(2660);let j=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((I=>{var $;($=this._onScrollApi)==null||$.fire(I.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(I){for(const $ in I)this.optionsService.options[$]=I[$]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new _.InstantiationService,this.optionsService=this.register(new w.OptionsService(I)),this._instantiationService.setService(h.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(h.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(h.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(k.CoreService)),this._instantiationService.setService(h.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(h.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(x.UnicodeService)),this._instantiationService.setService(h.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(h.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(h.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new z.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.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(($=>{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(($=>{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((($,q)=>this._inputHandler.parse($,q)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,$){this._writeBuffer.write(I,$)}writeSync(I,$){this._logService.logLevel<=h.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(I,$)}input(I,$=!0){this.coreService.triggerDataEvent(I,$)}resize(I,$){isNaN(I)||isNaN($)||(I=Math.max(I,m.MINIMUM_COLS),$=Math.max($,m.MINIMUM_ROWS),this._bufferService.resize(I,$))}scroll(I,$=!1){this._bufferService.scroll(I,$)}scrollLines(I,$,q){this._bufferService.scrollLines(I,$,q)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const $=I-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(I,$){return this._inputHandler.registerEscHandler(I,$)}registerDcsHandler(I,$){return this._inputHandler.registerDcsHandler(I,$)}registerCsiHandler(I,$){return this._inputHandler.registerCsiHandler(I,$)}registerOscHandler(I,$){return this._inputHandler.registerOscHandler(I,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?I=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const $ of I)$.dispose()}))}}}o.CoreTerminal=M},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;uu.fire(h)))},o.runAndSubscribe=function(c,u){return u(void 0),c((h=>u(h)))}},5435:function(a,o,c){var u=this&&this.__decorate||function(Y,B,L,F){var U,K=arguments.length,ne=K<3?B:F===null?F=Object.getOwnPropertyDescriptor(B,L):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(Y,B,L,F);else for(var oe=Y.length-1;oe>=0;oe--)(U=Y[oe])&&(ne=(K<3?U(ne):K>3?U(B,L,ne):U(B,L))||ne);return K>3&&ne&&Object.defineProperty(B,L,ne),ne},h=this&&this.__param||function(Y,B){return function(L,F){B(L,F,Y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const _=c(2584),p=c(7116),m=c(2015),w=c(844),k=c(482),v=c(8437),b=c(8460),x=c(643),y=c(511),C=c(3734),z=c(2585),E=c(1480),T=c(6242),j=c(6351),M=c(5941),D={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function $(Y,B){if(Y>24)return B.setWinLines||!1;switch(Y){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var q;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(q||(o.WindowsOptionsReportType=q={}));let H=0;class Q extends w.Disposable{getAttrData(){return this._curAttrData}constructor(B,L,F,U,K,ne,oe,ue,se=new m.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=L,this._coreService=F,this._logService=U,this._optionsService=K,this._oscLinkService=ne,this._coreMouseService=oe,this._unicodeService=ue,this._parser=se,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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.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 V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((G=>this._activeBuffer=G.activeBuffer))),this._parser.setCsiHandlerFallback(((G,ae)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(G),params:ae.toArray()})})),this._parser.setEscHandlerFallback((G=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(G)})})),this._parser.setExecuteHandlerFallback((G=>{this._logService.debug("Unknown EXECUTE code: ",{code:G})})),this._parser.setOscHandlerFallback(((G,ae,ce)=>{this._logService.debug("Unknown OSC code: ",{identifier:G,action:ae,data:ce})})),this._parser.setDcsHandlerFallback(((G,ae,ce)=>{ae==="HOOK"&&(ce=ce.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(G),action:ae,payload:ce})})),this._parser.setPrintHandler(((G,ae,ce)=>this.print(G,ae,ce))),this._parser.registerCsiHandler({final:"@"},(G=>this.insertChars(G))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(G=>this.scrollLeft(G))),this._parser.registerCsiHandler({final:"A"},(G=>this.cursorUp(G))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(G=>this.scrollRight(G))),this._parser.registerCsiHandler({final:"B"},(G=>this.cursorDown(G))),this._parser.registerCsiHandler({final:"C"},(G=>this.cursorForward(G))),this._parser.registerCsiHandler({final:"D"},(G=>this.cursorBackward(G))),this._parser.registerCsiHandler({final:"E"},(G=>this.cursorNextLine(G))),this._parser.registerCsiHandler({final:"F"},(G=>this.cursorPrecedingLine(G))),this._parser.registerCsiHandler({final:"G"},(G=>this.cursorCharAbsolute(G))),this._parser.registerCsiHandler({final:"H"},(G=>this.cursorPosition(G))),this._parser.registerCsiHandler({final:"I"},(G=>this.cursorForwardTab(G))),this._parser.registerCsiHandler({final:"J"},(G=>this.eraseInDisplay(G,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(G=>this.eraseInDisplay(G,!0))),this._parser.registerCsiHandler({final:"K"},(G=>this.eraseInLine(G,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(G=>this.eraseInLine(G,!0))),this._parser.registerCsiHandler({final:"L"},(G=>this.insertLines(G))),this._parser.registerCsiHandler({final:"M"},(G=>this.deleteLines(G))),this._parser.registerCsiHandler({final:"P"},(G=>this.deleteChars(G))),this._parser.registerCsiHandler({final:"S"},(G=>this.scrollUp(G))),this._parser.registerCsiHandler({final:"T"},(G=>this.scrollDown(G))),this._parser.registerCsiHandler({final:"X"},(G=>this.eraseChars(G))),this._parser.registerCsiHandler({final:"Z"},(G=>this.cursorBackwardTab(G))),this._parser.registerCsiHandler({final:"`"},(G=>this.charPosAbsolute(G))),this._parser.registerCsiHandler({final:"a"},(G=>this.hPositionRelative(G))),this._parser.registerCsiHandler({final:"b"},(G=>this.repeatPrecedingCharacter(G))),this._parser.registerCsiHandler({final:"c"},(G=>this.sendDeviceAttributesPrimary(G))),this._parser.registerCsiHandler({prefix:">",final:"c"},(G=>this.sendDeviceAttributesSecondary(G))),this._parser.registerCsiHandler({final:"d"},(G=>this.linePosAbsolute(G))),this._parser.registerCsiHandler({final:"e"},(G=>this.vPositionRelative(G))),this._parser.registerCsiHandler({final:"f"},(G=>this.hVPosition(G))),this._parser.registerCsiHandler({final:"g"},(G=>this.tabClear(G))),this._parser.registerCsiHandler({final:"h"},(G=>this.setMode(G))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(G=>this.setModePrivate(G))),this._parser.registerCsiHandler({final:"l"},(G=>this.resetMode(G))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(G=>this.resetModePrivate(G))),this._parser.registerCsiHandler({final:"m"},(G=>this.charAttributes(G))),this._parser.registerCsiHandler({final:"n"},(G=>this.deviceStatus(G))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(G=>this.deviceStatusPrivate(G))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(G=>this.softReset(G))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(G=>this.setCursorStyle(G))),this._parser.registerCsiHandler({final:"r"},(G=>this.setScrollRegion(G))),this._parser.registerCsiHandler({final:"s"},(G=>this.saveCursor(G))),this._parser.registerCsiHandler({final:"t"},(G=>this.windowOptions(G))),this._parser.registerCsiHandler({final:"u"},(G=>this.restoreCursor(G))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(G=>this.insertColumns(G))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(G=>this.deleteColumns(G))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(G=>this.selectProtected(G))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(G=>this.requestMode(G,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(G=>this.requestMode(G,!1))),this._parser.setExecuteHandler(_.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(_.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(_.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(_.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(_.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(_.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(_.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(_.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(_.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(_.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(_.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(_.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((G=>(this.setTitle(G),this.setIconName(G),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((G=>this.setIconName(G)))),this._parser.registerOscHandler(2,new T.OscHandler((G=>this.setTitle(G)))),this._parser.registerOscHandler(4,new T.OscHandler((G=>this.setOrReportIndexedColor(G)))),this._parser.registerOscHandler(8,new T.OscHandler((G=>this.setHyperlink(G)))),this._parser.registerOscHandler(10,new T.OscHandler((G=>this.setOrReportFgColor(G)))),this._parser.registerOscHandler(11,new T.OscHandler((G=>this.setOrReportBgColor(G)))),this._parser.registerOscHandler(12,new T.OscHandler((G=>this.setOrReportCursorColor(G)))),this._parser.registerOscHandler(104,new T.OscHandler((G=>this.restoreIndexedColor(G)))),this._parser.registerOscHandler(110,new T.OscHandler((G=>this.restoreFgColor(G)))),this._parser.registerOscHandler(111,new T.OscHandler((G=>this.restoreBgColor(G)))),this._parser.registerOscHandler(112,new T.OscHandler((G=>this.restoreCursorColor(G)))),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 G in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:G},(()=>this.selectCharset("("+G))),this._parser.registerEscHandler({intermediates:")",final:G},(()=>this.selectCharset(")"+G))),this._parser.registerEscHandler({intermediates:"*",final:G},(()=>this.selectCharset("*"+G))),this._parser.registerEscHandler({intermediates:"+",final:G},(()=>this.selectCharset("+"+G))),this._parser.registerEscHandler({intermediates:"-",final:G},(()=>this.selectCharset("-"+G))),this._parser.registerEscHandler({intermediates:".",final:G},(()=>this.selectCharset("."+G))),this._parser.registerEscHandler({intermediates:"/",final:G},(()=>this.selectCharset("/"+G)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((G=>(this._logService.error("Parsing error: ",G),G))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((G,ae)=>this.requestStatusString(G,ae))))}_preserveStack(B,L,F,U){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=F,this._parseStack.position=U}_logSlowResolvingAsync(B){this._logService.logLevel<=z.LogLevelEnum.WARN&&Promise.race([B,new Promise(((L,F)=>setTimeout((()=>F("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,L){let F,U=this._activeBuffer.x,K=this._activeBuffer.y,ne=0;const oe=this._parseStack.paused;if(oe){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(F),F;U=this._parseStack.cursorStartX,K=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>I&&(ne=this._parseStack.position+I)}if(this._logService.logLevel<=z.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,(G=>String.fromCharCode(G))).join("")}"`),typeof B=="string"?B.split("").map((G=>G.charCodeAt(0))):B),this._parseBuffer.lengthI)for(let G=ne;G0&&ce.getWidth(this._activeBuffer.x-1)===2&&ce.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ae);let pe=this._parser.precedingJoinState;for(let be=L;beue){if(se){const Ne=ce;let xe=this._activeBuffer.x-We;for(this._activeBuffer.x=We,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),ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),We>0&&ce instanceof v.BufferLine&&ce.copyCellsFrom(Ne,xe,0,We,!1);xe=0;)ce.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}else if(G&&(ce.insertCells(this._activeBuffer.x,K-We,this._activeBuffer.getNullCell(ae)),ce.getWidth(ue-1)===2&&ce.setCellFromCodepoint(ue-1,x.NULL_CELL_CODE,x.NULL_CELL_WIDTH,ae)),ce.setCellFromCodepoint(this._activeBuffer.x++,U,K,ae),K>0)for(;--K;)ce.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}this._parser.precedingJoinState=pe,this._activeBuffer.x0&&ce.getWidth(this._activeBuffer.x)===0&&!ce.hasContent(this._activeBuffer.x)&&ce.setCellFromCodepoint(this._activeBuffer.x,0,1,ae),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,L){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,L):this._parser.registerCsiHandler(B,(F=>!$(F.params[0],this._optionsService.rawOptions.windowOptions)||L(F)))}registerDcsHandler(B,L){return this._parser.registerDcsHandler(B,new j.DcsHandler(L))}registerEscHandler(B,L){return this._parser.registerEscHandler(B,L)}registerOscHandler(B,L){return this._parser.registerOscHandler(B,new T.OscHandler(L))}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 B;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&&((B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&B.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,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(B,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=B,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+L)}cursorUp(B){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const L=B.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=B.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=B.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const L=B.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,L,F,U=!1,K=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);ne.replaceCells(L,F,this._activeBuffer.getNullCell(this._eraseAttrData()),K),U&&(ne.isWrapped=!1)}_resetBufferLine(B,L=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),F.isWrapped=!1)}eraseInDisplay(B,L=!1){let F;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);F=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 3:const U=this._activeBuffer.lines.length-this._bufferService.rows;U>0&&(this._activeBuffer.lines.trimStart(U),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-U,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-U,0),this._onScroll.fire(0))}return!0}eraseInLine(B,L=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let L=B.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 se=ue;for(let G=1;G0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(_.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(_.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(_.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(_.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(_.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let L=0;LDe?1:2,pe=B.params[0];return be=pe,Ae=L?pe===2?4:pe===4?ce(ne.modes.insertMode):pe===12?3:pe===20?ce(ae.convertEol):0:pe===1?ce(F.applicationCursorKeys):pe===3?ae.windowOptions.setWinLines?ue===80?2:ue===132?1:0:0:pe===6?ce(F.origin):pe===7?ce(F.wraparound):pe===8?3:pe===9?ce(U==="X10"):pe===12?ce(ae.cursorBlink):pe===25?ce(!ne.isCursorHidden):pe===45?ce(F.reverseWraparound):pe===66?ce(F.applicationKeypad):pe===67?4:pe===1e3?ce(U==="VT200"):pe===1002?ce(U==="DRAG"):pe===1003?ce(U==="ANY"):pe===1004?ce(F.sendFocus):pe===1005?4:pe===1006?ce(K==="SGR"):pe===1015?4:pe===1016?ce(K==="SGR_PIXELS"):pe===1048?1:pe===47||pe===1047||pe===1049?ce(se===G):pe===2004?ce(F.bracketedPasteMode):0,ne.triggerDataEvent(`${_.C0.ESC}[${L?"":"?"}${be};${Ae}$y`),!0;var be,Ae}_updateAttrColor(B,L,F,U,K){return L===2?(B|=50331648,B&=-16777216,B|=C.AttributeData.fromColorRGB([F,U,K])):L===5&&(B&=-50331904,B|=33554432|255&F),B}_extractColor(B,L,F){const U=[0,0,-1,0,0,0];let K=0,ne=0;do{if(U[ne+K]=B.params[L+ne],B.hasSubParams(L+ne)){const oe=B.getSubParams(L+ne);let ue=0;do U[1]===5&&(K=1),U[ne+ue+1+K]=oe[ue];while(++ue=2||U[1]===2&&ne+K>=5)break;U[1]&&(K=1)}while(++ne+L5)&&(B=1),L.extended.underlineStyle=B,L.fg|=268435456,B===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(B){B.fg=v.DEFAULT_ATTR_DATA.fg,B.bg=v.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=B.length;let F;const U=this._curAttrData;for(let K=0;K=30&&F<=37?(U.fg&=-50331904,U.fg|=16777216|F-30):F>=40&&F<=47?(U.bg&=-50331904,U.bg|=16777216|F-40):F>=90&&F<=97?(U.fg&=-50331904,U.fg|=16777224|F-90):F>=100&&F<=107?(U.bg&=-50331904,U.bg|=16777224|F-100):F===0?this._processSGR0(U):F===1?U.fg|=134217728:F===3?U.bg|=67108864:F===4?(U.fg|=268435456,this._processUnderline(B.hasSubParams(K)?B.getSubParams(K)[0]:1,U)):F===5?U.fg|=536870912:F===7?U.fg|=67108864:F===8?U.fg|=1073741824:F===9?U.fg|=2147483648:F===2?U.bg|=134217728:F===21?this._processUnderline(2,U):F===22?(U.fg&=-134217729,U.bg&=-134217729):F===23?U.bg&=-67108865:F===24?(U.fg&=-268435457,this._processUnderline(0,U)):F===25?U.fg&=-536870913:F===27?U.fg&=-67108865:F===28?U.fg&=-1073741825:F===29?U.fg&=2147483647:F===39?(U.fg&=-67108864,U.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):F===49?(U.bg&=-67108864,U.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?K+=this._extractColor(B,K,U):F===53?U.bg|=1073741824:F===55?U.bg&=-1073741825:F===59?(U.extended=U.extended.clone(),U.extended.underlineColor=-1,U.updateExtended()):F===100?(U.fg&=-67108864,U.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,U.bg&=-67108864,U.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${_.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${_.C0.ESC}[${L};${F}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${_.C0.ESC}[?${L};${F}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.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(B){const L=B.params[0]||1;switch(L){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 F=L%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(B){const L=B.params[0]||1;let F;return(B.length<2||(F=B.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(B){if(!$(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(q.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(q.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${_.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){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(B){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(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const L=[],F=B.split(";");for(;F.length>1;){const U=F.shift(),K=F.shift();if(/^\d+$/.exec(U)){const ne=parseInt(U);if(Z(ne))if(K==="?")L.push({type:0,index:ne});else{const oe=(0,M.parseColor)(K);oe&&L.push({type:1,index:ne,color:oe})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(B){const L=B.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(B,L){this._getCurrentLinkId()&&this._finishHyperlink();const F=B.split(":");let U;const K=F.findIndex((ne=>ne.startsWith("id=")));return K!==-1&&(U=F[K].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:U,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,L){const F=B.split(";");for(let U=0;U=this._specialColors.length);++U,++L)if(F[U]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const K=(0,M.parseColor)(F[U]);K&&this._onColor.fire([{type:1,index:this._specialColors[L],color:K}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const L=[],F=B.split(";");for(let U=0;U=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 B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new y.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${_.C0.ESC}${K}${_.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[U.cursorStyle]-(U.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,L){this._dirtyRowTracker.markRangeDirty(B,L)}}o.InputHandler=Q;let V=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Ythis.end&&(this.end=Y)}markRangeDirty(Y,B){Y>B&&(H=Y,Y=B,B=H),Ythis.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Z(Y){return 0<=Y&&Y<256}V=u([h(0,z.IBufferService)],V)},844:(a,o)=>{function c(u){for(const h of u)h.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const h=this._disposables.indexOf(u);h!==-1&&this._disposables.splice(h,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var h;this._isDisposed||u===this._value||((h=this._value)==null||h.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=c,o.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(h,_,p){this._data[h]||(this._data[h]={}),this._data[h][_]=p}get(h,_){return this._data[h]?this._data[h][_]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(u,h,_,p,m){this._data.get(u,h)||this._data.set(u,h,new c),this._data.get(u,h).set(_,p,m)}get(u,h,_,p){var m;return(m=this._data.get(u,h))==null?void 0:m.get(_,p)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const h=c.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(c=this._search(this._getKey(u)),this._array.splice(c,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const h=this._getKey(u);if(h===void 0||(c=this._search(h),c===-1)||this._getKey(this._array[c])!==h)return!1;do if(this._array[c]===u)return this._array.splice(c,1),!0;while(++c=this._array.length)&&this._getKey(this._array[c])===u))do yield this._array[c];while(++c=this._array.length)&&this._getKey(this._array[c])===u))do h(this._array[c]);while(++c=h;){let p=h+_>>1;const m=this._getKey(this._array[p]);if(m>u)_=p-1;else{if(!(m0&&this._getKey(this._array[p-1])===u;)p--;return p}h=p+1}}return h}}},7226:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=c(6114);class h{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ib)return v-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-w))}ms`),void this._start();v=b}this.clear()}}class _ extends h{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const w=Date.now()+m;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}o.PriorityTaskQueue=_,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:_,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=c(643);o.updateWindowsModeWrappedState=function(h){const _=h.buffer.lines.get(h.buffer.ybase+h.buffer.y-1),p=_==null?void 0:_.get(h.cols-1),m=h.buffer.lines.get(h.buffer.ybase+h.buffer.y);m&&p&&(m.isWrapped=p[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&p[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(_){return[_>>>16&255,_>>>8&255,255&_]}static fromColorRGB(_){return(255&_[0])<<16|(255&_[1])<<8|255&_[2]}clone(){const _=new c;return _.fg=this.fg,_.bg=this.bg,_.extended=this.extended.clone(),_}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(_){this._ext=_}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(_){this._ext&=-469762049,this._ext|=_<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(_){this._ext&=-67108864,this._ext|=67108863&_}get urlId(){return this._urlId}set urlId(_){this._urlId=_}get underlineVariantOffset(){const _=(3758096384&this._ext)>>29;return _<0?4294967288^_:_}set underlineVariantOffset(_){this._ext&=536870911,this._ext|=_<<29&3758096384}constructor(_=0,p=0){this._ext=0,this._urlId=0,this._ext=_,this._urlId=p}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=c(6349),h=c(7226),_=c(3734),p=c(8437),m=c(4634),w=c(511),k=c(643),v=c(4863),b=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(x,y,C){this._hasScrollback=x,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=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,k.NULL_CELL_CHAR,k.NULL_CELL_WIDTH,k.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,k.WHITESPACE_CELL_CHAR,k.WHITESPACE_CELL_WIDTH,k.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new h.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(x){return x?(this._nullCell.fg=x.fg,this._nullCell.bg=x.bg,this._nullCell.extended=x.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new _.ExtendedAttrs),this._nullCell}getWhitespaceCell(x){return x?(this._whitespaceCell.fg=x.fg,this._whitespaceCell.bg=x.bg,this._whitespaceCell.extended=x.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new _.ExtendedAttrs),this._whitespaceCell}getBlankLine(x,y){return new p.BufferLine(this._bufferService.cols,this.getNullCell(x),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const x=this.ybase+this.y-this.ydisp;return x>=0&&xo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(x){if(this.lines.length===0){x===void 0&&(x=p.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(x))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(x,y){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let z=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+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(x,C)));else for(let j=this._rows;j>y;j--)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(j),this.ybase=Math.max(this.ybase-j,0),this.ydisp=Math.max(this.ydisp-j,0),this.savedY=Math.max(this.savedY-j,0)),this.lines.maxLength=E}this.x=Math.min(this.x,x-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,x-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(x,y),this._cols>x))for(let T=0;T.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let x=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,x=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return x}get _isReflowEnabled(){const x=this._optionsService.rawOptions.windowsPty;return x&&x.buildNumber?this._hasScrollback&&x.backend==="conpty"&&x.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(x,y){this._cols!==x&&(x>this._cols?this._reflowLarger(x,y):this._reflowSmaller(x,y))}_reflowLarger(x,y){const C=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,x,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(C.length>0){const z=(0,m.reflowLargerCreateNewLayout)(this.lines,C);(0,m.reflowLargerApplyNewLayout)(this.lines,z.layout),this._reflowLargerAdjustViewport(x,y,z.countRemoved)}}_reflowLargerAdjustViewport(x,y,C){const z=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=C;for(;E-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;T--){let j=this.lines.get(T);if(!j||!j.isWrapped&&j.getTrimmedLength()<=x)continue;const M=[j];for(;j.isWrapped&&T>0;)j=this.lines.get(--T),M.unshift(j);const D=this.ybase+this.y;if(D>=T&&D0&&(z.push({start:T+M.length+E,newLines:Q}),E+=Q.length),M.push(...Q);let V=$.length-1,Z=$[V];Z===0&&(V--,Z=$[V]);let Y=M.length-q-1,B=I;for(;Y>=0;){const F=Math.min(B,Z);if(M[V]===void 0)break;if(M[V].copyCellsFrom(M[Y],B-F,Z-F,F,!0),Z-=F,Z===0&&(V--,Z=$[V]),B-=F,B===0){Y--;const U=Math.max(Y,0);B=(0,m.getWrappedLineTrimmedLength)(M,U,this._cols)}}for(let F=0;F0;)this.ybase===0?this.y0){const T=[],j=[];for(let V=0;V=0;V--)if($&&$.start>D+q){for(let Z=$.newLines.length-1;Z>=0;Z--)this.lines.set(V--,$.newLines[Z]);V++,T.push({index:D+1,amount:$.newLines.length}),q+=$.newLines.length,$=z[++I]}else this.lines.set(V,j[D--]);let H=0;for(let V=T.length-1;V>=0;V--)T[V].index+=H,this.lines.onInsertEmitter.fire(T[V]),H+=T[V].amount;const Q=Math.max(0,M+E-this.lines.maxLength);Q>0&&this.lines.onTrimEmitter.fire(Q)}}translateBufferLineToString(x,y,C=0,z){const E=this.lines.get(x);return E?E.translateToString(y,C,z):""}getWrappedRangeForLine(x){let y=x,C=x;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return x>=this._cols?this._cols-1:x<0?0:x}nextStop(x){for(x==null&&(x=this.x);!this.tabs[++x]&&x=this._cols?this._cols-1:x<0?0:x}clearMarkers(x){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(x){this._isClearing||this.markers.splice(this.markers.indexOf(x),1)}}},8437:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=c(3734),h=c(511),_=c(643),p=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let m=0;class w{constructor(v,b,x=!1){this.isWrapped=x,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||h.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]);for(let C=0;C>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):x]}set(v,b){this._data[3*v+1]=b[_.CHAR_DATA_ATTR_INDEX],b[_.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[_.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[_.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,p.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return m=3*v,b.content=this._data[m+0],b.fg=this._data[m+1],b.bg=this._data[m+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,x,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|x<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,x){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,p.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,p.stringFromCodePoint)(2097151&y)+(0,p.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,x&&(y&=-12582913,y|=x<<22),this._data[3*v+0]=y}insertCells(v,b,x){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,x),b=0;--C)this.setCell(v+b+C,this.loadCell(v+C,y));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*x)this._data=new Uint32Array(this._data.buffer,0,x);else{const y=new Uint32Array(x);y.set(this._data),this._data=y}for(let y=this.length;y=v&&delete this._combined[E]}const C=Object.keys(this._extendedAttrs);for(let z=0;z=v&&delete this._extendedAttrs[E]}}return this.length=v,4*x*2=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,x,y,C){const z=v._data;if(C)for(let T=y-1;T>=0;T--){for(let j=0;j<3;j++)this._data[3*(x+T)+j]=z[3*(b+T)+j];268435456&z[3*(b+T)+2]&&(this._extendedAttrs[x+T]=v._extendedAttrs[b+T])}else for(let T=0;T=b&&(this._combined[j-b+x]=v._combined[j])}}translateToString(v,b,x,y){b=b??0,x=x??this.length,v&&(x=Math.min(x,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;b>22||1}return y&&y.push(b),C}}o.BufferLine=w},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,u){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 u*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(a,o)=>{function c(u,h,_){if(h===u.length-1)return u[h].getTrimmedLength();const p=!u[h].hasContent(_-1)&&u[h].getWidth(_-1)===1,m=u[h+1].getWidth(0)===2;return p&&m?_-1:_}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,h,_,p,m){const w=[];for(let k=0;k=k&&p0&&(j>y||x[j].getTrimmedLength()===0);j--)T++;T>0&&(w.push(k+x.length-T),w.push(T)),k+=x.length-1}return w},o.reflowLargerCreateNewLayout=function(u,h){const _=[];let p=0,m=h[p],w=0;for(let k=0;kc(u,x,h))).reduce(((b,x)=>b+x));let w=0,k=0,v=0;for(;vb&&(w-=b,k++);const x=u[k].getWidth(w-1)===2;x&&w--;const y=x?_-1:_;p.push(y),v+=y}return p},o.getWrappedLineTrimmedLength=c},5295:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=c(8460),h=c(844),_=c(9092);class p extends h.Disposable{constructor(w,k){super(),this._optionsService=w,this._bufferService=k,this._onBufferActivate=this.register(new u.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 _.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new _.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(w,k){this._normal.resize(w,k),this._alt.resize(w,k),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}o.BufferSet=p},511:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=c(482),h=c(643),_=c(3734);class p extends _.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new _.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const k=new p;return k.setFromCharData(w),k}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let k=!1;if(w[h.CHAR_DATA_CHAR_INDEX].length>2)k=!0;else if(w[h.CHAR_DATA_CHAR_INDEX].length===2){const v=w[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=w[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|w[h.CHAR_DATA_WIDTH_INDEX]<<22:k=!0}else k=!0}else this.content=w[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[h.CHAR_DATA_WIDTH_INDEX]<<22;k&&(this.combinedData=w[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=p},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=c(8460),h=c(844);class _{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=_._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,h.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}o.Marker=_,_._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var c,u,h;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(_){_.NUL="\0",_.SOH="",_.STX="",_.ETX="",_.EOT="",_.ENQ="",_.ACK="",_.BEL="\x07",_.BS="\b",_.HT=" ",_.LF=` +`,_.VT="\v",_.FF="\f",_.CR="\r",_.SO="",_.SI="",_.DLE="",_.DC1="",_.DC2="",_.DC3="",_.DC4="",_.NAK="",_.SYN="",_.ETB="",_.CAN="",_.EM="",_.SUB="",_.ESC="\x1B",_.FS="",_.GS="",_.RS="",_.US="",_.SP=" ",_.DEL=""})(c||(o.C0=c={})),(function(_){_.PAD="€",_.HOP="",_.BPH="‚",_.NBH="ƒ",_.IND="„",_.NEL="…",_.SSA="†",_.ESA="‡",_.HTS="ˆ",_.HTJ="‰",_.VTS="Š",_.PLD="‹",_.PLU="Œ",_.RI="",_.SS2="Ž",_.SS3="",_.DCS="",_.PU1="‘",_.PU2="’",_.STS="“",_.CCH="”",_.MW="•",_.SPA="–",_.EPA="—",_.SOS="˜",_.SGCI="™",_.SCI="š",_.CSI="›",_.ST="œ",_.OSC="",_.PM="ž",_.APC="Ÿ"})(u||(o.C1=u={})),(function(_){_.ST=`${c.ESC}\\`})(h||(o.C1_ESCAPED=h={}))},7399:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=c(2584),h={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(_,p,m,w){const k={type:0,cancel:!1,key:void 0},v=(_.shiftKey?1:0)|(_.altKey?2:0)|(_.ctrlKey?4:0)|(_.metaKey?8:0);switch(_.keyCode){case 0:_.key==="UIKeyInputUpArrow"?k.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A":_.key==="UIKeyInputLeftArrow"?k.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D":_.key==="UIKeyInputRightArrow"?k.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C":_.key==="UIKeyInputDownArrow"&&(k.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:k.key=_.ctrlKey?"\b":u.C0.DEL,_.altKey&&(k.key=u.C0.ESC+k.key);break;case 9:if(_.shiftKey){k.key=u.C0.ESC+"[Z";break}k.key=u.C0.HT,k.cancel=!0;break;case 13:k.key=_.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,k.cancel=!0;break;case 27:k.key=u.C0.ESC,_.altKey&&(k.key=u.C0.ESC+u.C0.ESC),k.cancel=!0;break;case 37:if(_.metaKey)break;v?(k.key=u.C0.ESC+"[1;"+(v+1)+"D",k.key===u.C0.ESC+"[1;3D"&&(k.key=u.C0.ESC+(m?"b":"[1;5D"))):k.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(_.metaKey)break;v?(k.key=u.C0.ESC+"[1;"+(v+1)+"C",k.key===u.C0.ESC+"[1;3C"&&(k.key=u.C0.ESC+(m?"f":"[1;5C"))):k.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(_.metaKey)break;v?(k.key=u.C0.ESC+"[1;"+(v+1)+"A",m||k.key!==u.C0.ESC+"[1;3A"||(k.key=u.C0.ESC+"[1;5A")):k.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(_.metaKey)break;v?(k.key=u.C0.ESC+"[1;"+(v+1)+"B",m||k.key!==u.C0.ESC+"[1;3B"||(k.key=u.C0.ESC+"[1;5B")):k.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:_.shiftKey||_.ctrlKey||(k.key=u.C0.ESC+"[2~");break;case 46:k.key=v?u.C0.ESC+"[3;"+(v+1)+"~":u.C0.ESC+"[3~";break;case 36:k.key=v?u.C0.ESC+"[1;"+(v+1)+"H":p?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:k.key=v?u.C0.ESC+"[1;"+(v+1)+"F":p?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:_.shiftKey?k.type=2:_.ctrlKey?k.key=u.C0.ESC+"[5;"+(v+1)+"~":k.key=u.C0.ESC+"[5~";break;case 34:_.shiftKey?k.type=3:_.ctrlKey?k.key=u.C0.ESC+"[6;"+(v+1)+"~":k.key=u.C0.ESC+"[6~";break;case 112:k.key=v?u.C0.ESC+"[1;"+(v+1)+"P":u.C0.ESC+"OP";break;case 113:k.key=v?u.C0.ESC+"[1;"+(v+1)+"Q":u.C0.ESC+"OQ";break;case 114:k.key=v?u.C0.ESC+"[1;"+(v+1)+"R":u.C0.ESC+"OR";break;case 115:k.key=v?u.C0.ESC+"[1;"+(v+1)+"S":u.C0.ESC+"OS";break;case 116:k.key=v?u.C0.ESC+"[15;"+(v+1)+"~":u.C0.ESC+"[15~";break;case 117:k.key=v?u.C0.ESC+"[17;"+(v+1)+"~":u.C0.ESC+"[17~";break;case 118:k.key=v?u.C0.ESC+"[18;"+(v+1)+"~":u.C0.ESC+"[18~";break;case 119:k.key=v?u.C0.ESC+"[19;"+(v+1)+"~":u.C0.ESC+"[19~";break;case 120:k.key=v?u.C0.ESC+"[20;"+(v+1)+"~":u.C0.ESC+"[20~";break;case 121:k.key=v?u.C0.ESC+"[21;"+(v+1)+"~":u.C0.ESC+"[21~";break;case 122:k.key=v?u.C0.ESC+"[23;"+(v+1)+"~":u.C0.ESC+"[23~";break;case 123:k.key=v?u.C0.ESC+"[24;"+(v+1)+"~":u.C0.ESC+"[24~";break;default:if(!_.ctrlKey||_.shiftKey||_.altKey||_.metaKey)if(m&&!w||!_.altKey||_.metaKey)!m||_.altKey||_.ctrlKey||_.shiftKey||!_.metaKey?_.key&&!_.ctrlKey&&!_.altKey&&!_.metaKey&&_.keyCode>=48&&_.key.length===1?k.key=_.key:_.key&&_.ctrlKey&&(_.key==="_"&&(k.key=u.C0.US),_.key==="@"&&(k.key=u.C0.NUL)):_.keyCode===65&&(k.type=1);else{const b=h[_.keyCode],x=b==null?void 0:b[_.shiftKey?1:0];if(x)k.key=u.C0.ESC+x;else if(_.keyCode>=65&&_.keyCode<=90){const y=_.ctrlKey?_.keyCode-64:_.keyCode+32;let C=String.fromCharCode(y);_.shiftKey&&(C=C.toUpperCase()),k.key=u.C0.ESC+C}else if(_.keyCode===32)k.key=u.C0.ESC+(_.ctrlKey?u.C0.NUL:" ");else if(_.key==="Dead"&&_.code.startsWith("Key")){let y=_.code.slice(3,4);_.shiftKey||(y=y.toLowerCase()),k.key=u.C0.ESC+y,k.cancel=!0}}else _.keyCode>=65&&_.keyCode<=90?k.key=String.fromCharCode(_.keyCode-64):_.keyCode===32?k.key=u.C0.NUL:_.keyCode>=51&&_.keyCode<=55?k.key=String.fromCharCode(_.keyCode-51+27):_.keyCode===56?k.key=u.C0.DEL:_.keyCode===219?k.key=u.C0.ESC:_.keyCode===220?k.key=u.C0.FS:_.keyCode===221&&(k.key=u.C0.GS)}return k}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,u=0,h=c.length){let _="";for(let p=u;p65535?(m-=65536,_+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):_+=String.fromCharCode(m)}return _},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const h=c.length;if(!h)return 0;let _=0,p=0;if(this._interim){const m=c.charCodeAt(p++);56320<=m&&m<=57343?u[_++]=1024*(this._interim-55296)+m-56320+65536:(u[_++]=this._interim,u[_++]=m),this._interim=0}for(let m=p;m=h)return this._interim=w,_;const k=c.charCodeAt(m);56320<=k&&k<=57343?u[_++]=1024*(w-55296)+k-56320+65536:(u[_++]=w,u[_++]=k)}else w!==65279&&(u[_++]=w)}return _}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const h=c.length;if(!h)return 0;let _,p,m,w,k=0,v=0,b=0;if(this.interim[0]){let C=!1,z=this.interim[0];z&=(224&z)==192?31:(240&z)==224?15:7;let E,T=0;for(;(E=63&this.interim[++T])&&T<4;)z<<=6,z|=E;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=j-T;for(;b=h)return 0;if(E=c[b++],(192&E)!=128){b--,C=!0;break}this.interim[T++]=E,z<<=6,z|=63&E}C||(j===2?z<128?b--:u[k++]=z:j===3?z<2048||z>=55296&&z<=57343||z===65279||(u[k++]=z):z<65536||z>1114111||(u[k++]=z)),this.interim.fill(0)}const x=h-4;let y=b;for(;y=h)return this.interim[0]=_,k;if(p=c[y++],(192&p)!=128){y--;continue}if(v=(31&_)<<6|63&p,v<128){y--;continue}u[k++]=v}else if((240&_)==224){if(y>=h)return this.interim[0]=_,k;if(p=c[y++],(192&p)!=128){y--;continue}if(y>=h)return this.interim[0]=_,this.interim[1]=p,k;if(m=c[y++],(192&m)!=128){y--;continue}if(v=(15&_)<<12|(63&p)<<6|63&m,v<2048||v>=55296&&v<=57343||v===65279)continue;u[k++]=v}else if((248&_)==240){if(y>=h)return this.interim[0]=_,k;if(p=c[y++],(192&p)!=128){y--;continue}if(y>=h)return this.interim[0]=_,this.interim[1]=p,k;if(m=c[y++],(192&m)!=128){y--;continue}if(y>=h)return this.interim[0]=_,this.interim[1]=p,this.interim[2]=m,k;if(w=c[y++],(192&w)!=128){y--;continue}if(v=(7&_)<<18|(63&p)<<12|(63&m)<<6|63&w,v<65536||v>1114111)continue;u[k++]=v}}return k}}},225:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=c(1480),h=[[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]],_=[[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 p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;mk[x][1])return!1;for(;x>=b;)if(v=b+x>>1,w>k[v][1])b=v+1;else{if(!(w=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,w){let k=this.wcwidth(m),v=k===0&&w!==0;if(v){const b=u.UnicodeService.extractWidth(w);b===0?v=!1:b>k&&(k=b)}return u.UnicodeService.createPropertyValue(0,k,v)}}},5981:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=c(8460),h=c(844);class _ extends h.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let k;for(this._isSyncWriting=!0;k=this._writeBuffer.shift();){this._action(k);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(w)}_innerWrite(m=0,w=!0){const k=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,w);if(b){const y=C=>Date.now()-k>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(k,C);return void b.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const x=this._callbacks[this._bufferOffset];if(x&&x(),this._bufferOffset++,this._pendingData-=v.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()}}o.WriteBuffer=_},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function h(_,p){const m=_.toString(16),w=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}o.parseColor=function(_){if(!_)return;let p=_.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=c.exec(p);if(m){const w=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/w*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/w*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/w*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),u.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,w=[0,0,0];for(let k=0;k<3;++k){const v=parseInt(p.slice(m*k,m*k+m),16);w[k]=m===1?v<<4:m===2?v:m===3?v>>4:v>>8}return w}},o.toRgbString=function(_,p=16){const[m,w,k]=_;return`rgb:${h(m,p)}/${h(w,p)}/${h(k,p)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=c(482),h=c(8742),_=c(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(w,k){this._handlers[w]===void 0&&(this._handlers[w]=[]);const v=this._handlers[w];return v.push(k),{dispose:()=>{const b=v.indexOf(k);b!==-1&&v.splice(b,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(w,k){if(this.reset(),this._ident=w,this._active=this._handlers[w]||p,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(k);else this._handlerFb(this._ident,"HOOK",k)}put(w,k,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(w,k,v);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(w,k,v))}unhook(w,k=!0){if(this._active.length){let v=!1,b=this._active.length-1,x=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=k,x=this._stack.fallThrough,this._stack.paused=!1),!x&&v===!1){for(;b>=0&&(v=this._active[b].unhook(w),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",w);this._active=p,this._ident=0}};const m=new h.Params;m.addParam(0),o.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=m,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():m,this._data="",this._hitLimit=!1}put(w,k,v){this._hitLimit||(this._data+=(0,u.utf32ToString)(w,k,v),this._data.length>_.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let k=!1;if(this._hitLimit)k=!1;else if(w&&(k=this._handler(this._data,this._params),k instanceof Promise))return k.then((v=>(this._params=m,this._data="",this._hitLimit=!1,v)));return this._params=m,this._data="",this._hitLimit=!1,k}}},2015:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=c(844),h=c(8742),_=c(6242),p=c(6351);class m{constructor(b){this.table=new Uint8Array(b)}setDefault(b,x){this.table.fill(b<<4|x)}add(b,x,y,C){this.table[x<<8|b]=y<<4|C}addMany(b,x,y,C){for(let z=0;zj)),x=(T,j)=>b.slice(T,j),y=x(32,127),C=x(0,24);C.push(25),C.push.apply(C,x(28,32));const z=x(0,14);let E;for(E in v.setDefault(1,0),v.addMany(y,0,2,0),z)v.addMany([24,26,153,154],E,3,0),v.addMany(x(128,144),E,3,0),v.addMany(x(144,152),E,3,0),v.add(156,E,0,0),v.add(27,E,11,1),v.add(157,E,4,8),v.addMany([152,158,159],E,0,7),v.add(155,E,11,3),v.add(144,E,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(x(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(x(64,127),3,7,0),v.addMany(x(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(x(48,60),4,8,4),v.addMany(x(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(x(32,64),6,0,6),v.add(127,6,0,6),v.addMany(x(64,127),6,0,0),v.addMany(x(32,48),3,9,5),v.addMany(x(32,48),5,9,5),v.addMany(x(48,64),5,0,6),v.addMany(x(64,127),5,7,0),v.addMany(x(32,48),4,9,5),v.addMany(x(32,48),1,9,2),v.addMany(x(32,48),2,9,2),v.addMany(x(48,127),2,10,0),v.addMany(x(48,80),1,10,0),v.addMany(x(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(x(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(x(28,32),9,0,9),v.addMany(x(32,48),9,9,12),v.addMany(x(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(x(32,128),11,0,11),v.addMany(x(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(x(28,32),10,0,10),v.addMany(x(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(x(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(x(28,32),12,0,12),v.addMany(x(32,48),12,9,12),v.addMany(x(48,64),12,0,11),v.addMany(x(64,127),12,12,13),v.addMany(x(64,127),10,12,13),v.addMany(x(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(w,0,2,0),v.add(w,8,5,8),v.add(w,6,0,6),v.add(w,11,0,11),v.add(w,13,13,13),v})();class k extends u.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new h.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(x,y,C)=>{},this._executeHandlerFb=x=>{},this._csiHandlerFb=(x,y)=>{},this._escHandlerFb=x=>{},this._errorHandlerFb=x=>x,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new _.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,x=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let z=0;zE||E>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=E}}if(b.final.length!==1)throw new Error("final must be a single byte");const C=b.final.charCodeAt(0);if(x[0]>C||C>x[1])throw new Error(`final must be in range ${x[0]} .. ${x[1]}`);return y<<=8,y|=C,y}identToString(b){const x=[];for(;b;)x.push(String.fromCharCode(255&b)),b>>=8;return x.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,x){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(x),{dispose:()=>{const z=C.indexOf(x);z!==-1&&C.splice(z,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,x){this._executeHandlers[b.charCodeAt(0)]=x}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,x){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(x),{dispose:()=>{const z=C.indexOf(x);z!==-1&&C.splice(z,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,x){return this._dcsParser.registerHandler(this._identifier(b),x)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,x){return this._oscParser.registerHandler(b,x)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}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(b,x,y,C,z){this._parseStack.state=b,this._parseStack.handlers=x,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=z}parse(b,x,y){let C,z=0,E=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=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 j=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](this._params),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 6:if(z=b[this._parseStack.chunkPos],C=this._dcsParser.unhook(z!==24&&z!==26,y),C)return C;z===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(z=b[this._parseStack.chunkPos],C=this._oscParser.end(z!==24&&z!==26,y),C)return C;z===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let j=T;j>4){case 2:for(let q=j+1;;++q){if(q>=x||(z=b[q])<32||z>126&&z=x||(z=b[q])<32||z>126&&z=x||(z=b[q])<32||z>126&&z=x||(z=b[q])<32||z>126&&z=0&&(C=M[D](this._params),C!==!0);D--)if(C instanceof Promise)return this._preserveStack(3,M,D,E,j),C;D<0&&this._csiHandlerFb(this._collect<<8|z,this._params),this.precedingJoinState=0;break;case 8:do switch(z){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(z-48)}while(++j47&&z<60);j--;break;case 9:this._collect<<=8,this._collect|=z;break;case 10:const I=this._escHandlers[this._collect<<8|z];let $=I?I.length-1:-1;for(;$>=0&&(C=I[$](),C!==!0);$--)if(C instanceof Promise)return this._preserveStack(4,I,$,E,j),C;$<0&&this._escHandlerFb(this._collect<<8|z),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|z,this._params);break;case 13:for(let q=j+1;;++q)if(q>=x||(z=b[q])===24||z===26||z===27||z>127&&z=x||(z=b[q])<32||z>127&&z{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=c(5770),h=c(482),_=[];o.OscParser=class{constructor(){this._state=0,this._active=_,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const w=this._handlers[p];return w.push(m),{dispose:()=>{const k=w.indexOf(m);k!==-1&&w.splice(k,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=_,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||_,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,w){if(this._active.length)for(let k=this._active.length-1;k>=0;k--)this._active[k].put(p,m,w);else this._handlerFb(this._id,"PUT",(0,h.utf32ToString)(p,m,w))}start(){this.reset(),this._state=1}put(p,m,w){if(this._state!==3){if(this._state===1)for(;m0&&this._put(p,m,w)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,k=this._active.length-1,v=!1;if(this._stack.paused&&(k=this._stack.loopPosition-1,w=m,v=this._stack.fallThrough,this._stack.paused=!1),!v&&w===!1){for(;k>=0&&(w=this._active[k].end(p),w!==!0);k--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!1,w;k--}for(;k>=0;k--)if(w=this._active[k].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",p);this._active=_,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,w){this._hitLimit||(this._data+=(0,h.utf32ToString)(p,m,w),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,m}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class u{static fromArray(_){const p=new u;if(!_.length)return p;for(let m=Array.isArray(_[0])?1:0;m<_.length;++m){const w=_[m];if(Array.isArray(w))for(let k=0;k256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(_),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(_),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const _=new u(this.maxLength,this.maxSubParamsLength);return _.params.set(this.params),_.length=this.length,_._subParams.set(this._subParams),_._subParamsLength=this._subParamsLength,_._subParamsIdx.set(this._subParamsIdx),_._rejectDigits=this._rejectDigits,_._rejectSubDigits=this._rejectSubDigits,_._digitIsSub=this._digitIsSub,_}toArray(){const _=[];for(let p=0;p>8,w=255&this._subParamsIdx[p];w-m>0&&_.push(Array.prototype.slice.call(this._subParams,m,w))}return _}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(_){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(_<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=_>c?c:_}}addSubParam(_){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(_<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=_>c?c:_,this._subParamsIdx[this.length-1]++}}hasSubParams(_){return(255&this._subParamsIdx[_])-(this._subParamsIdx[_]>>8)>0}getSubParams(_){const p=this._subParamsIdx[_]>>8,m=255&this._subParamsIdx[_];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const _={};for(let p=0;p>8,w=255&this._subParamsIdx[p];w-m>0&&(_[p]=this._subParams.slice(m,w))}return _}addDigit(_){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,w=m[p-1];m[p-1]=~w?Math.min(10*w+_,c):_}}o.Params=u},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,u){const h={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(h),u.dispose=()=>this._wrappedAddonDispose(h),u.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let u=-1;for(let h=0;h{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=c(3785),h=c(511);o.BufferApiView=class{constructor(_,p){this._buffer=_,this.type=p}init(_){return this._buffer=_,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(_){const p=this._buffer.lines.get(_);if(p)return new u.BufferLineApiView(p)}getNullCell(){return new h.CellData}}},3785:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=c(511);o.BufferLineApiView=class{constructor(h){this._line=h}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(h,_){if(!(h<0||h>=this._line.length))return _?(this._line.loadCell(h,_),_):this._line.loadCell(h,new u.CellData)}translateToString(h,_,p){return this._line.translateToString(h,_,p)}}},8285:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=c(8771),h=c(8460),_=c(844);class p extends _.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new h.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=p},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,u){return this._core.registerCsiHandler(c,(h=>u(h.toArray())))}addCsiHandler(c,u){return this.registerCsiHandler(c,u)}registerDcsHandler(c,u){return this._core.registerDcsHandler(c,((h,_)=>u(h,_.toArray())))}addDcsHandler(c,u){return this.registerDcsHandler(c,u)}registerEscHandler(c,u){return this._core.registerEscHandler(c,u)}addEscHandler(c,u){return this.registerEscHandler(c,u)}registerOscHandler(c,u){return this._core.registerOscHandler(c,u)}addOscHandler(c,u){return this.registerOscHandler(c,u)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(a,o,c){var u=this&&this.__decorate||function(v,b,x,y){var C,z=arguments.length,E=z<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,b,x,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(E=(z<3?C(E):z>3?C(b,x,E):C(b,x))||E);return z>3&&E&&Object.defineProperty(b,x,E),E},h=this&&this.__param||function(v,b){return function(x,y){b(x,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const _=c(8460),p=c(844),m=c(5295),w=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let k=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new _.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const x=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=x.getBlankLine(v,b),this._cachedBlankLine=y),y.isWrapped=b;const C=x.ybase+x.scrollTop,z=x.ybase+x.scrollBottom;if(x.scrollTop===0){const E=x.lines.isFull;z===x.lines.length-1?E?x.lines.recycle().copyFrom(y):x.lines.push(y.clone()):x.lines.splice(z+1,0,y.clone()),E?this.isUserScrolling&&(x.ydisp=Math.max(x.ydisp-1,0)):(x.ybase++,this.isUserScrolling||x.ydisp++)}else{const E=z-C+1;x.lines.shiftElements(C+1,E-1,-1),x.lines.set(z,y.clone())}this.isUserScrolling||(x.ydisp=x.ybase),this._onScroll.fire(x.ydisp)}scrollLines(v,b,x){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),C!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};o.BufferService=k=u([h(0,w.IOptionsService)],k)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,u){this._charsets[c]=u,this.glevel===c&&(this.charset=u)}}},1753:function(a,o,c){var u=this&&this.__decorate||function(y,C,z,E){var T,j=arguments.length,M=j<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,z):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,z,E);else for(var D=y.length-1;D>=0;D--)(T=y[D])&&(M=(j<3?T(M):j>3?T(C,z,M):T(C,z))||M);return j>3&&M&&Object.defineProperty(C,z,M),M},h=this&&this.__param||function(y,C){return function(z,E){C(z,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const _=c(2585),p=c(8460),m=c(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function k(y,C){let z=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(z|=64,z|=y.action):(z|=3&y.button,4&y.button&&(z|=64),8&y.button&&(z|=128),y.action===32?z|=32:y.action!==0||C||(z|=3)),z}const v=String.fromCharCode,b={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${v(C[0])}${v(C[1])}${v(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 x=o.CoreMouseService=class extends m.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 p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const z of Object.keys(w))this.addProtocol(z,w[z]);for(const z of Object.keys(b))this.addEncoding(z,b[z]);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,z){if(z){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}};o.CoreMouseService=x=u([h(0,_.IBufferService),h(1,_.ICoreService)],x)},6975:function(a,o,c){var u=this&&this.__decorate||function(x,y,C,z){var E,T=arguments.length,j=T<3?y:z===null?z=Object.getOwnPropertyDescriptor(y,C):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(x,y,C,z);else for(var M=x.length-1;M>=0;M--)(E=x[M])&&(j=(T<3?E(j):T>3?E(y,C,j):E(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},h=this&&this.__param||function(x,y){return function(C,z){y(C,z,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const _=c(1439),p=c(8460),m=c(844),w=c(2585),k=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends m.Disposable{constructor(x,y,C){super(),this._bufferService=x,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,_.clone)(k),this.decPrivateModes=(0,_.clone)(v)}reset(){this.modes=(0,_.clone)(k),this.decPrivateModes=(0,_.clone)(v)}triggerDataEvent(x,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 "${x}"`,(()=>x.split("").map((z=>z.charCodeAt(0))))),this._onData.fire(x)}triggerBinaryEvent(x){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${x}"`,(()=>x.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(x))}};o.CoreService=b=u([h(0,w.IBufferService),h(1,w.ILogService),h(2,w.IOptionsService)],b)},9074:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=c(8055),h=c(8460),_=c(844),p=c(6106);let m=0,w=0;class k extends _.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((x=>x==null?void 0:x.marker.line)),this._onDecorationRegistered=this.register(new h.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new h.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,_.toDisposable)((()=>this.reset())))}registerDecoration(x){if(x.marker.isDisposed)return;const y=new v(x);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 x of this._decorations.values())x.dispose();this._decorations.clear()}*getDecorationsAtCell(x,y,C){let z=0,E=0;for(const T of this._decorations.getKeyIterator(y))z=T.options.x??0,E=z+(T.options.width??1),x>=z&&x{m=E.options.x??0,w=m+(E.options.width??1),x>=m&&x{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=c(2585),h=c(8343);class _{constructor(...m){this._entries=new Map;for(const[w,k]of m)this.set(w,k)}set(m,w){const k=this._entries.get(m);return this._entries.set(m,w),k}forEach(m){for(const[w,k]of this._entries.entries())m(w,k)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}o.ServiceCollection=_,o.InstantiationService=class{constructor(){this._services=new _,this._services.set(u.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const w=(0,h.getServiceDependencies)(p).sort(((b,x)=>b.index-x.index)),k=[];for(const b of w){const x=this._services.get(b.id);if(!x)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${b.id}.`);k.push(x)}const v=w.length>0?w[0].index:m.length;if(m.length!==v)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${v+1} conflicts with ${m.length} static arguments`);return new p(...m,...k)}}},7866:function(a,o,c){var u=this&&this.__decorate||function(v,b,x,y){var C,z=arguments.length,E=z<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,b,x,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(E=(z<3?C(E):z>3?C(b,x,E):C(b,x))||E);return z>3&&E&&Object.defineProperty(b,x,E),E},h=this&&this.__param||function(v,b){return function(x,y){b(x,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const _=c(844),p=c(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,k=o.LogService=class extends _.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(E))).join(", ")})`);const z=y.apply(this,C);return w.trace(`GlyphRenderer#${y.name} return`,z),z}}},7302:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=c(8460),h=c(844),_=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:_.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends h.Disposable{constructor(k){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const b in k)if(b in v)try{const x=k[b];v[b]=this._sanitizeAndValidateOption(b,x)}catch(x){console.error(x)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,h.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(k,v){return this.onOptionChange((b=>{b===k&&v(this.rawOptions[k])}))}onMultipleOptionChange(k,v){return this.onOptionChange((b=>{k.indexOf(b)!==-1&&v()}))}_setupOptions(){const k=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,x)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);x=this._sanitizeAndValidateOption(b,x),this.rawOptions[b]!==x&&(this.rawOptions[b]=x,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const x={get:k.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,x)}}_sanitizeAndValidateOption(k,v){switch(k){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[k]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${k}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[k]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=p.includes(v)?v:o.DEFAULT_OPTIONS[k];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${k} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${k} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${k} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${k} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=m},2660:function(a,o,c){var u=this&&this.__decorate||function(m,w,k,v){var b,x=arguments.length,y=x<3?w:v===null?v=Object.getOwnPropertyDescriptor(w,k):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,w,k,v);else for(var C=m.length-1;C>=0;C--)(b=m[C])&&(y=(x<3?b(y):x>3?b(w,k,y):b(w,k))||y);return x>3&&y&&Object.defineProperty(w,k,y),y},h=this&&this.__param||function(m,w){return function(k,v){w(k,v,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const _=c(2585);let p=o.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const w=this._bufferService.buffer;if(m.id===void 0){const C=w.addMarker(w.ybase+w.y),z={data:m,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(z,C))),this._dataByLinkId.set(z.id,z),z.id}const k=m,v=this._getEntryIdKey(k),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,w.ybase+w.y),b.id;const x=w.addMarker(w.ybase+w.y),y={id:this._nextId++,key:this._getEntryIdKey(k),data:k,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(y,x))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(m,w){const k=this._dataByLinkId.get(m);if(k&&k.lines.every((v=>v.line!==w))){const v=this._bufferService.buffer.addMarker(w);k.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(k,v)))}}getLinkData(m){var w;return(w=this._dataByLinkId.get(m))==null?void 0:w.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,w){const k=m.lines.indexOf(w);k!==-1&&(m.lines.splice(k,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};o.OscLinkService=p=u([h(0,_.IBufferService)],p)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(h){return h[u]||[]},o.createDecorator=function(h){if(o.serviceRegistry.has(h))return o.serviceRegistry.get(h);const _=function(p,m,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(k,v,b){v[c]===v?v[u].push({id:k,index:b}):(v[u]=[{id:k,index:b}],v[c]=v)})(_,p,w)};return _.toString=()=>h,o.serviceRegistry.set(h,_),_}},2585:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=c(8343);var h;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(_){_[_.TRACE=0]="TRACE",_[_.DEBUG=1]="DEBUG",_[_.INFO=2]="INFO",_[_.WARN=3]="WARN",_[_.ERROR=4]="ERROR",_[_.OFF=5]="OFF"})(h||(o.LogLevelEnum=h={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=c(8460),h=c(225);class _{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,w,k=!1){return(16777215&m)<<3|(3&w)<<1|(k?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const m=new h.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let w=0,k=0;const v=m.length;for(let b=0;b=v)return w+this.wcwidth(x);const z=m.charCodeAt(b);56320<=z&&z<=57343?x=1024*(x-55296)+z-56320+65536:w+=this.wcwidth(z)}const y=this.charProperties(x,k);let C=_.extractWidth(y);_.extractShouldJoin(y)&&(C-=_.extractWidth(k)),w+=C,k=y}return w}charProperties(m,w){return this._activeProvider.charProperties(m,w)}}o.UnicodeService=_}},r={};function s(a){var o=r[a];if(o!==void 0)return o.exports;var c=r[a]={exports:{}};return t[a].call(c.exports,c,c.exports,s),c.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=s(9042),c=s(3236),u=s(844),h=s(5741),_=s(8285),p=s(7975),m=s(7090),w=["cols","rows"];class k extends u.Disposable{constructor(b){super(),this._core=this.register(new c.Terminal(b)),this._addonManager=this.register(new h.AddonManager),this._publicOptions={...this._core.options};const x=C=>this._core.options[C],y=(C,z)=>{this._checkReadonlyOptions(C),this._core.options[C]=z};for(const C in this._core.options){const z={get:x.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,z)}}_checkReadonlyOptions(b){if(w.includes(b))throw new Error(`Option "${b}" 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 p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.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 _.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let x="none";switch(this._core.coreMouseService.activeProtocol){case"X10":x="x10";break;case"VT200":x="vt200";break;case"DRAG":x="drag";break;case"ANY":x="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:x,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const x in b)this._publicOptions[x]=b[x]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,x=!0){this._core.input(b,x)}resize(b,x){this._verifyIntegers(b,x),this._core.resize(b,x)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,x,y){this._verifyIntegers(b,x,y),this._core.select(b,x,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,x){this._verifyIntegers(b,x),this._core.selectLines(b,x)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,x){this._core.write(b,x)}writeln(b,x){this._core.write(b),this._core.write(`\r +`,x)}paste(b){this._core.paste(b)}refresh(b,x){this._verifyIntegers(b,x),this._core.refresh(b,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const x of b)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const x of b)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}a.Terminal=k})(),i})()))})(_w)),_w.exports}var t$=pkn();const mkn=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"];function xj(e,n){const t=document.documentElement,r=getComputedStyle(t),s=a=>r.getPropertyValue(n==="app"?`--term-app-${a}`:`--term-${a}`).trim(),i={};if(n==="app"&&t.dataset.theme!=="dark")for(const a of mkn){const o=r.getPropertyValue(`--term-app-ansi-${a.replace(/[A-Z]/g,c=>`-${c.toLowerCase()}`)}`).trim();o&&(i[a]=o)}return{...i,background:s("bg"),foreground:s("foreground"),cursor:s(e?"bg":"foreground"),cursorAccent:s("bg"),selectionBackground:s("selection")}}function Fb(e,n,t=!1,r="dark"){const s=getComputedStyle(document.documentElement),i=new t$.Terminal({convertEol:!0,disableStdin:n,cursorBlink:!n,cursorStyle:"bar",cursorWidth:2,fontSize:12,fontFamily:s.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:xj(n,r)}),a=r==="app"?new MutationObserver(()=>{i.options.theme=xj(i.options.disableStdin??n,r)}):null;a==null||a.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const o=new fkn.FitAddon;i.loadAddon(o),t&&i.loadAddon(new hkn.WebLinksAddon((x,y)=>{let C;try{C=new URL(y)}catch{return}(C.protocol==="http:"||C.protocol==="https:")&&window.open(C,"_blank","noopener,noreferrer")}));const c=e.style.overflowY;e.style.overflowY="auto",i.open(e);let u=!0,h=null;const _=()=>{if(h===e.scrollTop){h=null;return}h=null,u=e.scrollTop+e.clientHeight>=e.scrollHeight-1};e.addEventListener("scroll",_);const p=()=>{var j;const x=i.element,y=x==null?void 0:x.querySelector(".xterm-screen"),C=x==null?void 0:x.querySelector(".xterm-viewport");if(!x||!(y instanceof HTMLElement)||!(C instanceof HTMLElement))return;const z=i.buffer.active;let E=Math.max(0,z.baseY+z.cursorY-z.viewportY+1);for(let M=i.rows-1;M>=E;M--)if((j=z.getLine(z.viewportY+M))!=null&&j.translateToString(!0).trim()){E=M+1;break}const T=y.getBoundingClientRect().height;x.style.height=`${Math.max(e.clientHeight,Math.min(E,i.rows)*T/i.rows)}px`,x.style.overflow="hidden",C.style.height=`${T}px`},m=()=>{try{const x=o.proposeDimensions();x&&(i.resize(x.cols,Math.max(x.rows,n?1:40)),p())}catch{}};m();const w=new ResizeObserver(m);w.observe(e);const k=i.onWriteParsed(()=>{var y;const x=u&&i.buffer.active.viewportY===i.buffer.active.baseY;if(p(),x){const C=(y=i.element)==null?void 0:y.querySelector(".xterm-screen");if(C instanceof HTMLElement){const z=(i.buffer.active.cursorY+1)*C.getBoundingClientRect().height/i.rows;e.scrollTop=Math.max(0,z-e.clientHeight),h=e.scrollTop}}}),v=i.onScroll(p),b=x=>{(x.deltaY<0?e.scrollTop>0:e.scrollTop+e.clientHeighttypeof n=="string")}function gkn(e){return Nf(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||r$(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function vkn(e){return Nf(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&r$(e.partitions)&&(e.error===null||typeof e.error=="string")}function bkn(e){return!Nf(e)||e.type!=="complete"?null:e.backend==="ssh"&&gkn(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&vkn(e.result)?{backend:"slurm",result:e.result}:null}function s$(e){return Nf(e)&&e.type==="complete"}function ykn(e){return Nf(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function CS({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(Hb,{path:`${t}?${a}`,label:RL({host:Ce(e)}),active:r,onError:i,onComplete:o=>{const c=bkn(o);return c?(s(c),!0):!1}})}function xkn({login:e,onComplete:n,onError:t}){return f.jsx(Hb,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-96",onError:t,onComplete:r=>s$(r)?(n(),!0):!1})}function wkn({path:e,label:n,onComplete:t,onError:r,onClose:s}){const[i,a]=A.useState("running");return f.jsxs("div",{className:"mt-4 overflow-hidden rounded-lg border border-border",children:[f.jsxs("div",{className:"flex h-9 items-center gap-3 border-b border-b-border-variant bg-surface ps-3 pe-1.5",children:[f.jsx("code",{dir:"ltr",className:"min-w-0 flex-1 truncate font-mono text-xs text-subtext",children:n}),f.jsx("span",{role:"status",className:"flex shrink-0 items-center gap-1.5 text-xs text-subtext",children:i==="running"?f.jsxs(f.Fragment,{children:[f.jsx(jt,{className:"border-t-accent-amber"})," ",Kzt()]}):i==="done"?f.jsxs(f.Fragment,{children:[f.jsx(Pi,{size:13,strokeWidth:2.5,className:"text-accent-green"})," ",Mzt()]}):i==="failed"?f.jsxs(f.Fragment,{children:[f.jsx(_r,{size:13,strokeWidth:2.5,className:"text-accent-red"})," ",Pzt()]}):Ezt()}),f.jsx("button",{type:"button",onClick:s,"aria-label":zz(),title:zz(),className:"ms-1 inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted [&:hover]:bg-highlight [&:hover]:text-text",children:f.jsx(_r,{size:14})})]}),f.jsx(Hb,{path:e,label:n,heightClass:"h-80",frame:"bare",palette:"app",shellAfter:!0,onError:(o,c)=>{a("failed"),c&&r(o)},onComplete:o=>s$(o)?(a("done"),t(),!0):!1,onClosed:()=>a(o=>o==="running"?"closed":o)})]})}function Hb({path:e,label:n,command:t,heightClass:r="h-40",frame:s="card",palette:i="dark",shellAfter:a=!1,active:o=!0,awaitingApproval:c=!1,onComplete:u,onError:h,onClosed:_}){const p=A.useRef(null),m=A.useRef(null),w=A.useRef(u),k=A.useRef(h),v=A.useRef(_),[b,x]=A.useState(null);return w.current=u,k.current=h,v.current=_,A.useEffect(()=>{const y=p.current;if(!y)return;const{terminal:C,dispose:z}=Fb(y,c,!0,i);if(m.current=C,c)return t&&C.writeln(`$ ${t}`),()=>{m.current=null,z()};C.focus();const E=location.protocol==="https:"?"wss:":"ws:",T=new URL(e,`${E}//${location.host}`),j=new WebSocket(T);j.binaryType="arraybuffer";let M=!1,D=!1,I=!1;const $=(Q,V)=>{var Z;if(D){V||C.writeln(Q);return}D=!0,(!I||a)&&C.writeln(Q),(Z=k.current)==null||Z.call(k,Q,V),!(a&&!V)&&(C.options.disableStdin=!0,C.blur(),x(Q))},q=C.onData(Q=>{j.readyState===WebSocket.OPEN&&j.send(new TextEncoder().encode(Q))}),H=C.onResize(({cols:Q,rows:V})=>{j.readyState===WebSocket.OPEN&&j.send(JSON.stringify({type:"resize",cols:Q,rows:V}))});return j.onopen=()=>{t&&C.writeln(`$ ${t}`),j.send(JSON.stringify({type:"resize",cols:C.cols,rows:C.rows}))},j.onmessage=Q=>{if(Q.data instanceof ArrayBuffer){I=!0,C.write(new Uint8Array(Q.data));return}if(typeof Q.data!="string")return;let V;try{V=JSON.parse(Q.data)}catch{return}if(w.current(V)){M=!0,a||j.close();return}const Z=ykn(V);Z&&(M?C.writeln(Z):$(Z,!a))},j.onerror=()=>$(jv(),!0),j.onclose=()=>{var Q;if(!M&&!D){$(jv(),!0);return}a&&(C.options.disableStdin=!0,C.blur(),(Q=v.current)==null||Q.call(v))},()=>{j.onopen=null,j.onmessage=null,j.onerror=null,j.onclose=null,q.dispose(),H.dispose(),j.close(),m.current=null,z()}},[e,t,c,i,a]),A.useEffect(()=>{const y=m.current;y&&(y.options.disableStdin=c||!o||b!==null,!c&&o&&b===null?y.focus():y.blur())},[o,b,c]),f.jsxs("div",{className:s==="card"?"mt-3":void 0,children:[f.jsx("div",{className:`${r} ${s==="card"?n$:`overflow-hidden p-3 ${i==="app"?"bg-terminal-app":"bg-terminal"}`}`,role:"group","aria-label":n,children:f.jsx("div",{ref:p,className:"h-full overflow-hidden"})}),b?f.jsx("p",{role:"alert",className:"sr-only",children:b}):null]})}function kkn({host:e,transcript:n}){const t=A.useRef(null);return A.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=Fb(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${n$}`,role:"group","aria-label":RL({host:Ce(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}let $v=null,s0=0;const ES=()=>$v;function i$(){const e=s0;return JI(async(n,t)=>{if(e!==s0)return;const r=await Wbn(n,t);e===s0&&Je.setQueryData(Em().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===s0&&bn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Ys(),onClick:()=>void qb.retry()}})})}let Y1=i$();function Skn(){s0++,$v=null,Y1=i$()}const qb={flush:(e=!1)=>Y1.flush(e),retry:()=>Y1.retry(),queue(e,n=0){const t=$v;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||($v=e,Y1.queue(e,n))}};window.addEventListener("pagehide",()=>void qb.flush(!0));function rl(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function fo(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function a$(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.terminalTabOpen&&r.push("terminal"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[Lt(u),u])),a=e.contentTabOrder.flatMap(u=>{const h=i.get(u);return h?[h]:[]}),o=Lt(e.rightTab);return{tabs:[...r,...a].map(u=>rl(u,Lt(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?rl(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?Lt(e.previewTab):null,history:e.tabHistory.map(Lt),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[Lt(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function Ckn(e,n){const t=zS();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>Lt(fo(a))===Lt(fo(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=fo(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0),a==="terminal"&&(t.terminalTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[Lt(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(Lt(a))}const s=new Map(r.map(i=>{const a=fo(i);return[Lt(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?fo(n):e!=null&&e.active?fo(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,c$(t,n)}const fw=(e,n)=>e.id===n.id&&e.view===n.view,b_=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,NS=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Bs=(e,n,t)=>`${e}:${n??""}:${NS(t)}`,o$=e=>({...e,lineScrollRequest:void 0});function c1(e){return typeof e=="object"&&"path"in e?o$(e):e}const dd=(e,n)=>e.branch===n.branch;function Lt(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:${NS(e)}`:`experiment:${e.id}:${e.view}`}function qp(e,n){const t=e.filter(r=>Lt(r)!==n);return t.length===e.length?e:t}function Ekn(e){return e!==void 0}function zS(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,terminalTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===Id&&n){const r="experiments";return{...t,rightTab:r,tabHistory:[r],experimentsTabOpen:!0,panelOpen:!0}}if(e===Rb){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{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Lt),panelOpen:!0}}if(e===Mb){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Lt),panelOpen:!0}}return t}function jS(e,n){const t=zS(e,n);return t.panelOpen?a$(t,{},{}):void 0}function c$(e,n){if(!n)return e;const t=fo(n),r=Lt(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(c=>Lt(c)===r),i=(c,u)=>{const h=c.findIndex(_=>Lt(_)===r);return h<0?[...c,u]:JSON.stringify(rl(c[h]))===JSON.stringify(rl(u))?c:c.map((_,p)=>p===h?{..._,...u}:_)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:t==="terminal"?a.terminalTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&Lt(o)===r&&JSON.stringify(rl(o))===JSON.stringify(rl(t))||(a.tabHistory=[...e.tabHistory.filter(c=>Lt(c)!==r),t]),a}let ho=0;const O0=new Map,Bv=new Map,F3=new Set,H3=()=>{for(const e of F3)e()},Nkn=e=>(F3.add(e),()=>{F3.delete(e)}),D0=new Map,po=new Map,l$=e=>po.get(e);function zkn(){ho++,po.clear(),D0.clear(),O0.clear(),Bv.clear(),H3()}function jkn(e,n){const t=po.get(e);if(!(t!=null&&t.tasks.new)||Tu(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const c=fo(o);if(typeof c=="string"||!("path"in c))return[];const u=Bs(e,null,c);return u in a?[[Bs(e,n,c),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,D0.set(e,n),po.set(e,{...t,tasks:i})}function Tkn(e){let n=O0.get(e);if(!n){const t=ho;n=JI(async(r,s)=>{if(t!==ho)return;const i=await Kbn(e,r,s);t===ho&&Je.setQueryData(lS(e).queryKey,i),t===ho&&Bv.delete(e)&&H3()},r=>{t===ho&&(Bv.set(e,r instanceof Error?r.message:String(r)),H3())}),O0.set(e,n)}return n}function dw(e,n,t,r){const s=po.get(e);if(!s||t==="new"&&D0.has(e))return;const i=Pb(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?Tu(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const c={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});po.set(e,c),Tkn(e).queue(c,u?250:0)}function wj(e,n,t,r){const s=new Set(e.state.fileTabs.map(h=>Bs(t,r==="new"?null:r,h))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([h])=>s.has(h))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([h])=>s.has(h))),o=a$(e.state,i,a),c=e.pane??(n==null?void 0:n.active),u=c?Lt(fo(c)):null;return o.active=o.tabs.find(h=>Lt(fo(h))===u)??null,o}function Akn(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,firstDemoOpen:a,state:o,apply:c,getScroll:u,sourceModes:h,revision:_}=e,p=A.useRef(gj()),m=A.useSyncExternalStore(Nkn,()=>n?Bv.get(n)??null:null),[w,k]=A.useState(null),[v,b]=A.useState(0),[x,y]=A.useState(null),[C,z]=A.useState(null),E=A.useRef(null),T=A.useRef(null),j=A.useRef(null),M=A.useRef(e);M.current=e;const D=JSON.stringify([n,t,i]),I=JSON.stringify(s??null),$=A.useCallback(()=>{const H=j.current;if(!H)return;const Q=wj({...M.current,state:H.state,pane:H.pane},Tu(po.get(H.projectId),H.taskKey),H.projectId,H.taskKey);dw(H.projectId,H.location,H.taskKey,Q)},[]);A.useEffect(()=>{let H=!0;const Q=ho;if(k(null),y(null),!!n)return po.has(n)?y(n):Je.fetchQuery(lS(n)).then(V=>{!H||Q!==ho||(po.set(n,V??gj()),y(n))}).catch(V=>{H&&Q===ho&&k(V instanceof Error?V.message:String(V))}),()=>{H=!1}},[n,v]),A.useLayoutEffect(()=>{if(j.current&&j.current.scope!==D){const V=j.current.projectId;$(),D0.get(V)===t&&D0.delete(V),j.current=null}if(!n||x!==n)return;const H=po.get(n);if(!H)return;if(p.current=H,E.current!==D){if(E.current=D,T.current=I,i){const V=Tu(H,t)??(Vc(n)?jS(t,a):void 0);c(Ckn(V,s),V,!0)}z(D);return}if(C!==D)return;let Q=o;T.current!==I&&(T.current=I,i&&s&&(Q=c$(o,s),c(Q,void 0,!1))),i?(dw(n,r,t,wj({state:Q,pane:s,getScroll:u,sourceModes:h},Tu(H,t),n,t)),j.current={projectId:n,taskKey:t,scope:D,location:r,pane:s,state:Q}):dw(n,r),p.current=po.get(n)??H},[n,t,r,s,I,i,a,o,c,u,h,_,x,D,C,$]),A.useEffect(()=>{const H=ho,Q=Z=>{if(H===ho){$();for(const Y of O0.values())Y.flush(Z)}},V=()=>Q(!0);return window.addEventListener("pagehide",V),()=>{window.removeEventListener("pagehide",V),Q(!1)}},[$]);const q=A.useCallback(()=>{var H;n&&(w?b(Q=>Q+1):(H=O0.get(n))==null||H.retry())},[n,w]);return{ready:n===null||x===n&&C===D,loaded:n===null||x===n,error:w??m,retry:q,capture:$,workspace:p}}const Rkn="data:image/svg+xml,"+encodeURIComponent(''),q3=A.createContext(null);function Mkn(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function u$(){const e=A.useContext(q3);if(!e)throw new Error("Runtime is not connected");return e}function Okn(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?Rkn:"/favicon.svg")}function kj(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function Dkn(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!kj("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&mI(n),!kj("orx:locale")&&t&&mD(t)&&hI(t)}function Lkn(e){return e.includes("ssh ")&&e.includes("failed")}function Sj({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:cL({host:Ce(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:f3()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:fkt()})]})})}function Cj({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,D,I;const{session:s}=e,[i,a]=A.useState(s.installPaths),[o,c]=A.useState(!1),[u,h]=A.useState(null);A.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(D=s.installPaths)==null?void 0:D.database,(I=s.installPaths)==null?void 0:I.cache]);async function _(){if(i){c(!0);try{await _xn(i)}catch($){bn($ instanceof Error?$.message:String($),"error")}finally{c(!1)}}}async function p($=!1){r($?s.error:null),c(!0);try{await fxn()}catch(q){bn(q instanceof Error?q.message:String(q),"error")}finally{c(!1)}}async function m(){c(!0);try{await QL()}catch($){bn($ instanceof Error?$.message:String($),"error")}finally{c(!1)}}async function w(){c(!0);try{h(await XL())}catch($){bn($ instanceof Error?$.message:String($),"error")}finally{c(!1)}}async function k(){if(u){c(!0);try{await YL(u),h(null)}catch($){h(null),bn($ instanceof Error?$.message:String($),"error")}finally{c(!1)}}}async function v(){c(!0);try{await dxn()}catch($){bn($ instanceof Error?$.message:String($),"error")}finally{c(!1)}}const b=s.status==="applying"||o,x=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&x,z=["connecting","applying","reconnecting"].includes(s.status),E=s.status==="disconnected"&&s.error!==null&&Lkn(s.error)&&t!==s.error&&!s.canStartNewHost,T=x?eSt():y?X7t():s.status==="applying"?M3t({host:Ce(s.host)}):s.status==="reconnecting"?p6t({host:Ce(s.host)}):s.status==="disconnected"?s.error?ikt({host:Ce(s.host)}):s.canStartNewHost?Ekt({host:Ce(s.host)}):cL({host:Ce(s.host)}):d5t({host:Ce(s.host)}),j=s.error??(s.canStartNewHost?bkt():x?xSt({user:Ce(s.user??""),host:Ce(s.host)}):y?q7t({host:Ce(s.host)}):s.status==="applying"?E3t():s.status==="reconnecting"?c6t():s.status==="disconnected"?V5t():a5t());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[z&&f.jsx(jt,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:T}),!E&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j})]})]}),E&&f.jsx(CS,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:Kkt()}),[["binary",Mkt()],["database",Pkt()]].map(([$,q])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[q,f.jsx(Ur,{value:i[$],onChange:H=>a({...i,[$]:H.target.value}),disabled:b,dir:"ltr"})]},$)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(Oe,{variant:"primary",disabled:b,onClick:()=>void _(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",oSt()]}):y?Sz():yL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(Oe,{variant:"primary",disabled:b,onClick:()=>void _(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",r8t()]}):Sz()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(Oe,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(jt,{}):null,s.error?wz():O6t()]}):f.jsxs(Oe,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(jt,{}):null,wz()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(Oe,{disabled:o,onClick:()=>void m(),children:m3()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(Oe,{disabled:o,onClick:()=>void m(),children:m3()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(jt,{}):null,xz()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid w(),children:[o?f.jsx(jt,{}):null,lL()]})]}),x&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(Oe,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(jt,{}):null,xz()]})})]})}),u&&f.jsx(DI,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||h(null)},onConfirm:()=>void k()})]})}function Ikn({children:e}){const n=A.useRef(null);return A.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function $kn(){A.useSyncExternalStore(tE,cK),A.useEffect(()=>tE(()=>{Skn(),zkn()}),[]);const e=dQ({select:w=>w.pathname==="/remote-launch"}),[n,t]=A.useState(null),[r,s]=A.useState(null),i=A.useRef(!1),a=A.useRef(!1),o=A.useRef(!1),c=A.useRef(null),[u,h]=A.useState(null),_=ut({...T2n(),enabled:!e,refetchInterval:w=>{var k;return w.state.status==="error"||((k=w.state.data)==null?void 0:k.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(A.useEffect(()=>{var v,b;if(e)return;const w=_.data;if(!w){s(((v=_.error)==null?void 0:v.message)??null);return}const k=Mkn(w);lK(k),c.current!==null&&c.current!==k&&(i.current=!1,a.current=!1,o.current=!1),c.current=k,w.kind==="ssh"&&(o.current||(o.current=!0,Dkn(w)),w.session.status==="connected"?(i.current=!0,a.current=!0,h(null)):w.session.status==="disconnected"&&w.session.error===null&&(a.current=!1)),t(w),s(((b=_.error)==null?void 0:b.message)??null)},[e,_.data,_.error]),A.useEffect(()=>{const w=(n==null?void 0:n.kind)==="ssh";Okn(w),w&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(jt,{})," ",QSt()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(Oe,{onClick:()=>location.reload(),children:Ys()})]}):f.jsx(jt,{})});if(n.kind==="local")return f.jsxs(q3,{value:n,children:[f.jsx(nj,{}),f.jsx(z0,{})]},Va()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(Sj,{host:n.session.host}):f.jsx(Cj,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:h});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(q3,{value:n,children:[f.jsx(nj,{}),f.jsx(z0,{})]},Va()[1])}),m&&f.jsx(Ikn,{children:r?f.jsx(Sj,{host:n.session.host,overlay:!0}):f.jsx(Cj,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:h})})]})}const Ub=XW()({component:$kn}),TS="orx:demo-read-sessions";function _$(){try{const e=JSON.parse(sessionStorage.getItem(TS)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function Bkn(e){try{const n=_$();n.add(e),sessionStorage.setItem(TS,JSON.stringify([...n]))}catch{}}function Pkn(){try{sessionStorage.removeItem(TS)}catch{}}function f$(e,n){const t=cf(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function Fkn(e=Je){var i;const[n,t]=await Promise.all([e.fetchQuery(Em()),e.fetchQuery(hh())]),r=Pb((i=ES()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=cf(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!f$(r,await e.fetchQuery(Ga(s.projectId)))?"/projects":r}async function Hkn(e,n=Je){var h;const[t,r]=await Promise.all([n.fetchQuery(lS(e)),n.fetchQuery(Ga(e))]),s=l$(e)??t,i=Pb(s==null?void 0:s.lastLocation);if(i&&((h=cf(i.split("?")[0]))==null?void 0:h.projectId)===e&&f$(i,r))return i;const a=r.find(_=>!_.archived),o=Vc(e)?jS(a==null?void 0:a.id,!(await n.fetchQuery(Em())).tourCompleted):void 0,c=Tu(s,(a==null?void 0:a.id)??"new"),u=c?c.active:o==null?void 0:o.active;return X1(e,(a==null?void 0:a.id)??null,u)}const Pv=360,qkn=272,Ukn=380,Gkn=qkn+56;function i0(){return Math.max(Pv,window.innerWidth-Gkn-Ukn)}function d$(){const e=i0();return Math.max(Pv,Math.min(480,e,Math.round(window.innerWidth*.25)))}function AS(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.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 hw(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx(AS,{}),"OpenResearch"]})}const Ej="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";function Vkn({cmd:e,onRun:n}){const[t,r]=A.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{dir:"ltr",className:"font-mono text-sm",children:e}),n&&f.jsx("button",{type:"button",className:`cmd-inline-run ${Ej}`,onClick:n,"aria-label":HE({value:Ce(e)}),title:HE({value:Ce(e)}),children:f.jsx(D5n,{size:11})}),f.jsx("button",{type:"button",className:`cmd-inline-copy ${Ej}`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})},"aria-label":t?tf():IX({value:Ce(e)}),title:t?tf():Yk(),children:t?f.jsx(Pi,{size:11,strokeWidth:3}):f.jsx(Sf,{size:11})})]})}function vh(e,n){return e?e.split(/`([^`]+)`/).map((t,r)=>r%2===1?f.jsx(Vkn,{cmd:t,onRun:n!=null&&n.canRun(t)?()=>n.onRun(t):void 0},r):t):null}function bh({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.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"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):e==="antigravity"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"13 18 85 80",fill:"#3186FF","aria-hidden":"true",children:f.jsx("path",{d:"M89.6992 93.695C94.3659 97.195 101.366 94.8617 94.9492 88.445C75.6992 69.7783 79.7825 18.445 55.8659 18.445C31.9492 18.445 36.0325 69.7783 16.7825 88.445C9.78251 95.445 17.3658 97.195 22.0325 93.695C40.1159 81.445 38.9492 59.8617 55.8659 59.8617C72.7825 59.8617 71.6159 81.445 89.6992 93.695Z"})}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.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"})})}function U3(e){return!e.installed||e.installBroken?"install":e.authState==="unsupported"&&!e.needsConfigRepair?"update":"login"}function Kkn(e,n){return e.needsConfigRepair?"error":n==="login"?"running":"preview"}function Nj(e,n){return n||e==="preview"}function Wkn(e,n){if(!e||e.needsConfigRepair)return null;const t=U3(e);return t===n?null:t}function h$({harness:e,commands:n,onReady:t,onClose:r}){const s=A.useRef(null),i=A.useRef(!1),[a,o]=A.useState(()=>U3(e)),[c,u]=A.useState(0),[h,_]=A.useState(()=>Kkn(e,U3(e))),[p,m]=A.useState(h==="running"),[w,k]=A.useState(e.needsConfigRepair),[v,b]=A.useState(e.needsConfigRepair?e.agentNote??null:null),x=h==="running"||h==="checking",y=n[a].includes(` +`)?void 0:n[a];A.useEffect(()=>{i.current=!1;const z=s.current;return z==null||z.showModal(),()=>{i.current=!0,z==null||z.close()}},[]);const C=async()=>{_("checking"),b(null);try{const z=await af(!0,!0);if(i.current)return;const E=z.find(T=>T.id===e.id);if(k((E==null?void 0:E.needsConfigRepair)??!1),E!=null&&E.agentReady&&(a!=="login"||E.authenticated))t==null||t(E),_("success"),e.id==="antigravity"&&a==="login"&&r();else if(a!=="login"&&(E!=null&&E.installed)&&!E.installBroken&&!E.needsConfigRepair&&E.authState==="needsLogin")o("login"),m(!0),_("running");else{const T=Wkn(E,a);T&&(o(T),m(!1)),b((E==null?void 0:E.agentNote)??GD()),_("error")}}catch(z){if(i.current)return;b(z instanceof Error?z.message:String(z)),_("error")}};return f.jsxs("dialog",{ref:s,className:"m-auto w-180 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"harness-setup-title",onKeyDown:z=>{z.key==="Escape"&&x&&z.preventDefault()},onCancel:z=>{z.preventDefault(),x||r()},children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(bh,{harness:e.id,size:26}),f.jsx("h2",{id:"harness-setup-title",className:"m-0 text-xl font-medium",children:GN({agent:e.name})})]}),h==="preview"?f.jsx("p",{className:"my-4 text-sm text-subtext",children:a==="install"?jWe({agent:e.name}):DQe({agent:e.name})}):y&&Nj(h,p)?f.jsx("p",{className:"my-4 text-sm text-subtext [&_.cmd-inline]:mx-2 [&_.cmd-inline]:gap-2",children:vh(pQe({command:y}))}):null,h!=="running"&&h!=="preview"&&f.jsxs("p",{className:"my-4 flex items-center gap-2 text-sm",role:"status",children:[h==="checking"&&f.jsx(jt,{}),h==="success"?lWe({agent:e.name}):h==="error"?qD():nWe()]}),a==="install"&&n.requiresNpm&&f.jsx("p",{className:"text-sm text-subtext",children:cQe()}),Nj(h,p)&&f.jsx(Hb,{path:`/api/harnesses/setup?${new URLSearchParams({harness:e.id,action:a})}`,label:GN({agent:e.name}),command:y,heightClass:"h-96",active:h==="running",awaitingApproval:h==="preview",onComplete:z=>typeof z!="object"||z===null||!("type"in z)||z.type!=="complete"?!1:(C(),!0),onError:z=>{b(z),_("error")}},`${a}-${c}`),v&&f.jsx("p",{role:"alert",className:"text-sm text-accent-red",children:vh(v)}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[h==="error"&&f.jsx(Oe,{variant:"ghost",onClick:()=>{b(null),C()},children:Nv()}),h==="error"&&!w&&f.jsx(Oe,{onClick:()=>{b(null),m(!0),_("running"),u(z=>z+1)},children:Ys()}),f.jsx(Oe,{variant:h==="success"?"primary":"default",onClick:r,children:h==="success"?LL():x?QKe():A0()}),h==="preview"&&f.jsx(Oe,{variant:"primary",onClick:()=>{m(!0),_("running")},children:HKe()})]})]})}const Qkn={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function L0({variant:e="list",className:n,...t}){return f.jsx("span",{className:ys("title",Qkn[e],n),...t})}const zj=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),Q_=["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(" "),pw=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),p$=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Xkn=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),Ykn=[{id:"AI/ML",label:Vlt},{id:"Biology",label:Jlt},{id:"Physics",label:dut},{id:"Other",label:aut}],Zkn=["welcome","environment","profile"];function Jkn({onDone:e,preferredAgent:n,remote:t}){var ht;const r=dn({mutationFn:Le=>Xbn(...Le)}),[s,i]=A.useState(0);A.useEffect(()=>{const Le=Zkn[s];Le&&du({name:"onboarding_step_viewed",step:Le})},[s]);const a=ut(Mu()),o=ut(h0()),c=ut(aI()),[u,h]=A.useState(null),[_,p]=A.useState(!1),m=A.useRef(null),w=A.useRef(""),k=A.useRef(null),v=A.useRef(!1);A.useEffect(()=>()=>{var Le;return(Le=m.current)==null?void 0:Le.close()},[]);const b=a.data??null,x=(ht=o.data)==null?void 0:ht.gitVersion,[y,C]=A.useState(!1),[z,E]=A.useState(null),[T,j]=A.useState(""),[M,D]=A.useState(null),[I,$]=A.useState(!1),[q,H]=A.useState([]),[Q,V]=A.useState(""),[Z,Y]=A.useState(""),[B,L]=A.useState([]),[F,U]=A.useState(""),[K,ne]=A.useState([]),[oe,ue]=A.useState(!1),se=A.useRef(0),[G,ae]=A.useState(!1),[ce,pe]=A.useState(!1),be=(b==null?void 0:b.some(Le=>Le.agentReady&&!Le.catalogPending))??!1,Ae=(b==null?void 0:b.some(Le=>Le.catalogPending))??!1,De=x!=null,We=A.useRef(0),Ne=(Le,me=!1)=>{const Te=++We.current;$(!0),ae(!1),pe(!1);const He=()=>Te===We.current;Promise.allSettled([af(Le,me),Je.fetchQuery({...h0(),staleTime:Le?0:3e4})]).then(([nt,_t])=>{He()&&(nt.status==="rejected"&&ae(!0),_t.status==="rejected"&&pe(!0))}).finally(()=>He()&&$(!1))};A.useEffect(()=>Ne(!1),[]),A.useEffect(()=>{if(b===null)return;const Le=b.filter(me=>me.agentReady&&!me.catalogPending);D(me=>{var He;if(me&&Le.some(nt=>nt.id===me))return me;const Te=n&&Le.find(nt=>nt.id===n.harness);return(Te==null?void 0:Te.id)??((He=Le[0])==null?void 0:He.id)??null})},[b,n]),A.useEffect(()=>ae(a.isError),[a.isError,a.dataUpdatedAt]),A.useEffect(()=>pe(o.isError),[o.isError,o.dataUpdatedAt]),A.useEffect(()=>{Je.fetchQuery(R2n()).then(Le=>{H(Le.researchAreas),V(Le.otherArea??""),Y(Le.background??""),L(Le.papers)}).catch(()=>{})},[]),A.useEffect(()=>{const Le=F.trim();if(Le.length<3){ne([]),ue(!1);return}const me=++se.current;ue(!0);const Te=setTimeout(()=>{Je.fetchQuery(dI(Le)).then(He=>me===se.current&&ne(He)).catch(()=>me===se.current&&ne([])).finally(()=>me===se.current&&ue(!1))},350);return()=>clearTimeout(Te)},[F]);const xe=Le=>{const me=B.some(Te=>Te.paperId===Le.paperId);L(Te=>Te.some(He=>He.paperId===Le.paperId)?Te:[...Te,{paperId:Le.paperId,title:jj(Le.title)}]),U(""),ne([]),me||Je.fetchQuery(D3(Le.paperId)).then(Te=>{var nt;const He=(nt=Te.title)==null?void 0:nt.trim();He&&L(_t=>_t.map(St=>St.paperId===Le.paperId?{...St,title:He}:St))}).catch(()=>{})},rt=Le=>L(me=>me.filter(Te=>Te.paperId!==Le)),Ze=Le=>{H(me=>me.includes(Le)?me.filter(Te=>Te!==Le):[...me,Le])},ct=q.length>0&&(!q.includes("Other")||Q.trim().length>0),Ct=()=>{if(k.current)return k.current;w.current="",v.current=!0,p(!0);const Le=(async()=>{await new Promise((He,nt)=>{const _t=location.protocol==="https:"?"wss:":"ws:",St=new WebSocket(`${_t}//${location.host}/api/harnesses/setup?harness=opencode&action=install&trigger=automatic`);St.binaryType="arraybuffer";const yt=new TextDecoder,Zt=new t$.Terminal;Zt.onData(At=>{St.readyState===WebSocket.OPEN&&St.send(new TextEncoder().encode(At))}),m.current=St;let un=!1;St.onmessage=At=>{if(At.data instanceof ArrayBuffer){Zt.write(new Uint8Array(At.data)),w.current=(w.current+yt.decode(At.data,{stream:!0})).slice(-65536);return}if(typeof At.data!="string")return;let pt;try{pt=JSON.parse(At.data)}catch{return}typeof pt!="object"||pt===null||!("type"in pt)||(pt.type==="complete"?(un=!0,St.close(),He()):pt.type==="error"&&(St.close(),nt(new Error("error"in pt&&typeof pt.error=="string"?pt.error:qD()))))},St.onerror=()=>{St.close(),nt(new Error(jv()))},St.onclose=()=>{Zt.dispose(),m.current=null,un||nt(new Error(jv()))}});const Te=(await af(!0,!0)).find(He=>He.id==="opencode"&&He.agentReady);if(!Te)throw new Error(Kdt());return D("opencode"),Te})();return k.current=Le,Le.catch(()=>{}),Le};A.useEffect(()=>{t||v.current||!(b!=null&&b.length)||b.some(Le=>Le.catalogPending)||!b.every(Le=>!Le.installed&&!Le.installBroken)||Ct()},[b,t]),A.useEffect(()=>{s===1&&_&&i(2)},[s,_]);const qt=()=>{i(_?2:1)},dt=async(Le="complete")=>{var me;if(!(y||Le==="complete"&&(!ct||!De))){C(!0),E(null),j("");try{const Te=_?await Ct():b==null?void 0:b.find(_t=>_t.id===M&&_t.agentReady&&!_t.catalogPending);if(!Te)throw new Error(GD());if(Le==="setup")return;const He=tSn(Te,((me=Te.models[0])==null?void 0:me.id)??null),nt=await r.mutateAsync([He,{researchAreas:q,otherArea:q.includes("Other")?Q:null,background:Z||null,papers:B}]);e(nt.project,nt.selection)}catch(Te){_&&(k.current=null);const He=Te instanceof Error?Te.message:String(Te);E(He),j([w.current,He].filter(Boolean).join(` -`))}finally{C(!1)}}};return f.jsxs("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${s===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:[!t&&u&&c.data&&f.jsx(_$,{harness:u,commands:c.data[u.id],onReady:Ie=>{D(Ie.id)},onClose:()=>{h(null)}}),f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${s===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:s===0?f.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:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(fw,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:plt()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:k_t()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:g0t()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:Tft()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:Lpt()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:uft()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:imt()})]})})]})]}),f.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:f.jsxs(De,{variant:"primary",size:"large",onClick:Ft,disabled:I&&b===null,children:[I&&b===null?f.jsx(Nt,{}):null,uz()," ",f.jsx(Q1,{size:20})]})})]}):s===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(fw,{}),f.jsx("span",{children:qpt()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:Dut()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:jdt()}),b!==null&&!be&&!Me&&f.jsx("p",{className:Ej,children:wpt()}),b!==null&&be&&M===null&&f.jsx("p",{className:Ej,children:Hut()}),(w===null||le)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(zj,{gitVersion:w,error:le}),le?f.jsx("p",{className:dw,children:ew()}):f.jsx("p",{className:dw,children:_z()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:b!==null?b.map(Ie=>{var me;return f.jsx(V5n,{h:Ie,remote:t,selected:M===Ie.id,onSelect:()=>D(Ie.id),commands:(me=c.data)==null?void 0:me[Ie.id],onSetup:()=>h(Ie)},Ie.id)}):G?f.jsx("div",{className:F_,children:ew()}):f.jsxs(Gr,{className:"py-2",children:[f.jsx(Nt,{})," ",q_t()]})}),c.isError&&f.jsxs("p",{className:F_,children:[CWe()," ",f.jsx(De,{variant:"ghost",onClick:()=>void c.refetch(),children:Qs()})]}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(De,{variant:"ghost",onClick:()=>i(0),children:[f.jsx(R0,{size:12})," ",lz()]}),f.jsxs(De,{variant:"ghost",onClick:()=>je(!0,!0),disabled:I,children:[f.jsx(Pa,{size:12,className:I?"animate-[spin_0.9s_linear_infinite]":""})," ",Nv()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(De,{variant:"primary",onClick:()=>i(2),disabled:I||!be||M===null||!Le,title:I||!be&&Me?G0t():be?M===null?m_t():le?cht():w===void 0?$0t():w===null?Uft():void 0:ppt(),children:[uz()," ",f.jsx(Q1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(fw,{}),!_&&f.jsx("span",{children:Xpt()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:r0t()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:f$,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:Z0t()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:l_t()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:P5n.map(Ie=>f.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:[f.jsx("input",{type:"checkbox",checked:q.includes(Ie.id),onChange:()=>Ze(Ie.id),disabled:y}),f.jsx("span",{children:Ie.label()})]},Ie.id))}),q.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:Q,onChange:Ie=>V(Ie.target.value),disabled:y,placeholder:u0t(),"aria-label":qdt()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:wht()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:J,onChange:Ie=>Z(Ie.target.value),disabled:y,rows:4,placeholder:X_t()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:pht()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:wlt()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:F,onChange:Ie=>U(Ie.target.value),disabled:y,placeholder:Dht()}),ce?f.jsx("div",{className:F_,children:Hht()}):K.length>0?f.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-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:K.map(Ie=>f.jsxs("button",{type:"button",onClick:()=>we(Ie),disabled:y,children:[f.jsx(D0,{children:Nj(Ie.title)}),f.jsx("span",{className:"id",children:Ie.paperId})]},Ie.paperId))}):null]}),B.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:B.map(Ie=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-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]: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:[f.jsx(D0,{children:Ie.title||Ie.paperId}),f.jsx("span",{className:"id",children:Ie.paperId}),f.jsx("button",{type:"button","aria-label":KZ({name:Ne(Ie.paperId)}),onClick:()=>rt(Ie.paperId),disabled:y,children:f.jsx(lr,{size:12})})]},Ie.paperId))})]})}),!at&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:q.length===0?n_t():L_t()}),_&&!Le&&f.jsxs("div",{className:"mt-5",role:"status",children:[f.jsx(zj,{gitVersion:w,error:le}),f.jsx("p",{className:dw,children:le?ew():_z()}),f.jsx(De,{onClick:()=>je(!0,!0),disabled:I,children:Nv()})]}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(De,{variant:"ghost",onClick:()=>i(_?0:1),disabled:y,children:[f.jsx(R0,{size:12})," ",lz()]}),f.jsx("div",{className:"flex-1"}),f.jsx(De,{variant:"primary",onClick:()=>void ut(),disabled:y||!Le||!_&&M===null||!at,children:y?f.jsxs(f.Fragment,{children:[f.jsx(Nt,{})," ",cpt()]}):f.jsxs(f.Fragment,{children:[gft()," ",f.jsx(Q1,{size:13})]})})]}),M===null&&!_&&f.jsx("p",{className:B5n,children:fmt()}),N&&f.jsxs("div",{role:"alert",className:"mt-8 grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2.5 rounded-md border border-danger-notice-border bg-accent-red-subtle px-3 py-2",children:[f.jsx(dS,{size:16,className:"shrink-0 text-accent-red"}),f.jsx("p",{className:"m-0 min-w-0 flex-1 text-sm text-text break-words",children:N}),_&&f.jsx(De,{size:"small",onClick:()=>void ut(at&&Le?"complete":"setup"),disabled:y,children:Qs()}),_&&f.jsx(De,{variant:"ghost",size:"small",className:"col-start-2 justify-self-start",disabled:y,onClick:()=>{p(!1),z(null),i(1)},children:Qut()}),f.jsxs("details",{className:"col-start-2 col-span-2 min-w-0 text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:rft()}),f.jsx("pre",{className:"mt-2 mb-0 max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-md border border-danger-notice-border bg-background px-2 py-1.5 font-mono text-xs",children:T||N})]})]})]})})]})}function Nj(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function q5n(e){return e.catalogPending?{tone:"warning",label:W_()}:e.agentReady?{tone:"success",label:e.authMethod==="local"||!e.authenticated?Yk():jpt()}:e.installed?e.installBroken?{tone:"warning",label:Ift()}:e.authMethod==="local"?{tone:"warning",label:ZD()}:e.needsConfigRepair||e.authState==="unknown"?{tone:"warning",label:S0t()}:e.authState==="unsupported"?{tone:"warning",label:A0t()}:e.installed?{tone:"warning",label:YD()}:{tone:"neutral",label:fz()}:{tone:"neutral",label:fz()}}function U5n(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:Ob(e,n).defaultId}}function G5n({harness:e}){return f.jsx(vh,{harness:e,size:26})}function V5n({h:e,remote:n,selected:t,onSelect:r,commands:s,onSetup:i}){var x;const a=!n&&!e.needsConfigRepair&&!e.catalogPending&&(!e.installed||e.installBroken||e.authState==="unsupported"||e.authMethod!=="local"&&e.authMethod!=="apiKey"&&(e.authState==="needsLogin"||e.authState==="unknown")),o=!e.agentReady&&a,c=a&&(!e.installed||!e.agentReady&&e.authState==="needsLogin"),u=q5n(e),h=t?{tone:"success",label:Qht()}:u,_=(x=e.version)==null?void 0:x.replace(/\s*\(.*\)$/,""),p=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan].filter(Boolean).join(" · "),m=f.jsxs("div",{className:"onb-card-head flex flex-wrap items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(G5n,{harness:e.id}),f.jsxs("span",{className:"flex flex-col gap-1",children:[f.jsxs("span",{className:"onb-card-name flex flex-wrap items-center gap-2 text-base font-semibold tracking-[-0.01em]",children:[e.name,c&&f.jsx(Id,{tone:u.tone,className:"font-normal",children:u.label})]}),o&&!c&&f.jsx(Id,{tone:h.tone,children:h.label})]})]}),o?f.jsxs(De,{size:"small",onClick:i,disabled:!s,"aria-haspopup":"dialog",title:UWe(),children:[f.jsx(lo,{size:14}),!e.installed||e.installBroken?_We():e.authState==="unsupported"?gQe():HD()]}):f.jsx(Id,{tone:h.tone,children:h.label})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-4 px-4 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${t?" selected":""}`,"aria-pressed":t,onClick:r,children:[m,e.id!=="opencode"&&f.jsx("div",{className:"onb-card-detail flex items-center gap-1.5 text-sm",children:e.accountLoading?f.jsxs(f.Fragment,{children:[f.jsx(Nt,{})," ",Yft()]}):f.jsxs(f.Fragment,{children:[e.account??(e.authMethod==="apiKey"?Xk():null),e.plan?` · ${e.plan}`:""]})}),p&&f.jsx("div",{className:F_,children:p})]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-4 px-4 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[m,e.authState==="unsupported"&&_&&f.jsx("div",{className:F_,children:_}),!o&&e.agentNote&&f.jsx("div",{className:`${F_} [&_code]:whitespace-pre-wrap break-words`,children:gh(e.agentNote)})]})}function zj({gitVersion:e,error:n}){return f.jsxs("div",{className:f$,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:sdt()}),f.jsx(Id,{tone:e?"success":n||e===null?"danger":"warning",children:e?Yk():n?put():e===null?XD():W_()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:F_,children:e??zut()})]})}const K5n="/assets/slurm-logo-aGSXVZcE.svg",W5n="/assets/thinking-machines-BOdslTfm.png";function Q5n(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 OD();case"tinker_job":return"Tinker";default:return e||"—"}}function X5n({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.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"}),f.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"}),f.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"}),f.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"}),f.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"}),f.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"}),f.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 Y5n({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.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"}),f.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)"}),f.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)"}),f.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"}),f.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"}),f.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)"}),f.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)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function Z5n({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.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 J5n({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.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 ekn({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.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 tkn({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:W5n,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function nkn({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:K5n,width:e,height:e,alt:"","aria-hidden":"true"})}function qb({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.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 $h({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Y5n,{size:n});case"hf_job":return f.jsx(X5n,{size:n});case"k8s_job":return f.jsx(Z5n,{size:n});case"ssh_job":return f.jsx(hj,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(nkn,{size:n});case"ray_job":return f.jsx(J5n,{size:n});case"openresearch_job":return f.jsx(ekn,{size:n});case"tinker_job":return f.jsx(tkn,{size:n});case"local_job":return f.jsx(Y4n,{size:n,strokeWidth:1.5});default:return f.jsx(hj,{size:n})}}function AS({backend:e}){const n=iS(e),t=axn(e);return n?f.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:[f.jsx($h,{kind:n}),f.jsx("span",{className:"backend-name",children:Q5n(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.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 hw(e,n){const[t,r]=A.useState(e);return A.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function l1(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function rkn(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function skn(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function ikn(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function akn({onCreated:e,onCancel:n,remote:t=!1}){var wr,un,dn,Tn;const[r,s]=A.useState("blank"),[i,a]=A.useState(""),[o,c]=A.useState(!1),[u,h]=A.useState(""),[_,p]=A.useState(!1),[m,x]=A.useState(!1),[k,v]=A.useState(!1),[b,w]=A.useState(null),[y,C]=A.useState(!1),[N,z]=A.useState(!1),[T,j]=A.useState(""),[M,D]=A.useState(null),[I,$]=A.useState(!1),q=A.useRef(0),H=A.useRef(0),Q=A.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),V=r==="paper"?skn(M==null?void 0:M.repoUrl):null,J=i.trim()?`~/OpenResearch/${l1(i,48)}`:"",Z=`~/OpenResearch/${l1(i||(M==null?void 0:M.title)||(M==null?void 0:M.paperId)||"")}`,B=r==="blank"&&!_?J:r==="paper"&&M&&!_?Z:u,L=hw(B.trim(),200),F=ct({...d0(L),enabled:!!L&&L===B.trim()}),U=L===B.trim()?F.data??null:null,K=L===B.trim()?((wr=F.error)==null?void 0:wr.message)??null:null,ne=!!B.trim()&&(L!==B.trim()||F.isFetching),ce=V??(r==="folder"&&(U!=null&&U.githubOwner)&&U.githubRepo?{owner:U.githubOwner,repo:U.githubRepo}:null),_e=ct(Yxn()),se=((un=_e.data)==null?void 0:un.login)??(_e.isPending?void 0:null),G=ct(aS()),oe=A.useRef(!1);A.useEffect(()=>{oe.current||!G.data||(oe.current=!0,z(G.data.githubForNewProjects))},[G.data]);const le=hw(i.trim(),150),pe=ct({...Zxn(le),enabled:le===i.trim()}),be=le===i.trim()?((dn=pe.data)==null?void 0:dn.repo)??l1(i,48):l1(i,48),Me=le!==i.trim()||pe.isFetching,Le=ct({...Jz((ce==null?void 0:ce.owner)??"",(ce==null?void 0:ce.repo)??""),enabled:!!ce,subscribed:!!ce}),Ke=!!ce&&Le.isFetching,je=ce&&((Tn=Le.data)!=null&&Tn.canPush)?`github.com/${ce.owner}/${ce.repo}`:null,we=hw(T.trim(),350),rt=rkn(we),Ze=r==="paper"&&!M&&we===T.trim(),at=ct({...uI(we),enabled:Ze&&!rt&&we.length>=3,subscribed:Ze&&!rt&&we.length>=3}),St=ct({...R3(rt??""),enabled:Ze&&!!rt,subscribed:Ze&&!!rt}),Ft=Ze&&!rt?at.data??[]:[],ut=Ze&&at.isSuccess?we:"",dt=I||r==="paper"&&!M&&(we!==T.trim()||(rt?St.isFetching:at.isFetching));A.useEffect(()=>{var wt;!Ze||!rt||!St.data||(D(St.data),o||a(((wt=St.data.title)==null?void 0:wt.trim())||St.data.paperId))},[Ze,rt,St.data,o]),A.useEffect(()=>{const wt=rt?St.error:at.error;Ze&&wt&&w(wt.message)},[Ze,rt,St.error,at.error]);const Ie=an({mutationFn:qvn});async function me(wt){var zn;const Mt=++q.current;$(!0),w(null);try{const hr=await et.fetchQuery(R3(wt));if(Mt!==q.current)return;D(hr),o||a(((zn=hr.title)==null?void 0:zn.trim())||hr.paperId)}catch(hr){Mt===q.current&&w(hr instanceof Error?hr.message:String(hr))}finally{Mt===q.current&&$(!1)}}function Ae(){q.current+=1,H.current+=1,D(null),j(""),$(!1),x(!1),h(""),p(!1),Q.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function Pe(wt){if(wt===r)return;q.current+=1,H.current+=1,Q.current[r]={name:i,nameTouched:o,path:u,pathTouched:_};const Mt=Q.current[wt];s(wt),w(null),$(!1),x(!1),a(Mt.name),c(Mt.nameTouched),h(Mt.path),p(Mt.pathTouched)}async function nt(){if(m)return;const wt=++H.current;x(!0),w(null);try{const Mt=await Hvn();if(wt!==H.current||!Mt)return;if(p(!0),h(Mt),et.invalidateQueries(d0(Mt)),r==="folder"&&!o){const zn=Mt.replace(/[\\/]+$/,"").split(/[\\/]/).pop();zn&&a(zn)}}catch(Mt){wt===H.current&&w(Mt instanceof Error?Mt.message:String(Mt))}finally{wt===H.current&&x(!1)}}async function _t(wt){if(wt.preventDefault(),!!Ct){v(!0),w(null);try{const Mt=await et.fetchQuery({...d0(B.trim()),staleTime:0});if(Mt.exists&&Mt.directory===!1)throw new Error(Z2());if(r==="blank"&&Mt.exists)throw new Error(rz());if(r==="paper"&&Mt.empty===!1)throw new Error(cz());N&&ce&&await et.fetchQuery({...Jz(ce.owner,ce.repo),staleTime:0}).catch(()=>null);const zn=await Ie.mutateAsync({name:i.trim(),path:B.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:N,locale:E(),...r==="paper"&&M?{paperId:M.paperId,cloneUrl:M.repoUrl??void 0}:{}});e(zn.project,zn.githubPublicationError)}catch(Mt){w(Mt instanceof Error?Mt.message:String(Mt))}finally{v(!1)}}}const pt=i.trim(),yt=r==="paper"&&M&&!M.repoUrl?M.paperId:null,Zt=r==="folder"&&(U==null?void 0:U.gitState)==="ready"?U.resolvedPath??null:null,nn=pt!==""&&(yt!==null||Zt!==null);A.useEffect(()=>{if(!nn)return;const wt=window.setTimeout(()=>{Qvn({name:pt,paperId:yt??void 0,path:Zt??void 0,locale:E()}).catch(()=>{})},1200);return()=>window.clearTimeout(wt)},[nn,pt,yt,Zt]);const jt=(U==null?void 0:U.gitVersion)===null,mt=r==="folder"&&!!B.trim()&&U!==null&&U.exists===!1,ft=r==="blank"&&(U==null?void 0:U.exists)===!0,en=!!B.trim()&&(U==null?void 0:U.exists)===!0&&U.directory===!1,An=r==="paper"&&!!(M!=null&&M.repoUrl)&&(U==null?void 0:U.empty)===!1,xr=r==="paper"&&!!M&&!(M!=null&&M.repoUrl)&&(U==null?void 0:U.empty)===!1,kn=r==="folder"&&((U==null?void 0:U.gitState)==="detached"||(U==null?void 0:U.gitState)==="invalid"),Ln=_&&!B.trim()||en||An||xr,Un=_&&!B.trim()||en||ft,dr=_&&!B.trim()?oz():en?Z2():ft?rz():null,es=_&&!B.trim()?oz():en?Z2():An?cz():xr?nst():null,Ct=!!(i.trim()&&B.trim())&&!k&&!m&&!ne&&U!==null&&!K&&!jt&&!mt&&!ft&&!en&&!An&&!xr&&!kn&&(r!=="paper"||!!M)&&(!N||typeof se=="string"&&!Me&&!Ke),on=je??`github.com/${se??"you"}/${be}`,cn=se===void 0||Me||Ke,fn=r==="paper"&&!M&&T.trim().length>=3&&ut===T.trim()&&!dt&&Ft.length===0&&!b;return f.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-normal [&_.repo-hint]:text-sm [&_.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-start [&_.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-control-subtle [&_.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-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.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]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-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-danger-notice-border [&_.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-start [&_.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-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.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-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_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 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:_t,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>Pe("blank"),children:hit()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>Pe("folder"),children:tat()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>Pe("paper"),children:pat()})]}),r==="paper"&&!M&&f.jsxs("label",{className:"!font-normal",children:[not(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:T,onChange:wt=>{w(null),j(wt.target.value)},placeholder:xot()}),!fn&&f.jsx("span",{className:"repo-hint",children:dt?Qct():Dct()}),fn&&f.jsx("span",{className:"project-path-notice block",children:Dat()}),Ft.length>0&&f.jsx("div",{className:"paper-results",children:Ft.map(wt=>f.jsxs("button",{type:"button",onClick:()=>void me(wt.paperId),children:[f.jsx(D0,{children:wt.title}),f.jsx("span",{className:"id",children:wt.paperId})]},wt.paperId))})]}),M&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(D0,{className:"block",children:M.title||M.paperId}),M.repoUrl&&f.jsx("div",{className:"id",children:ikn(M.repoUrl)})]}),f.jsx(De,{size:"small",type:"button","aria-label":Dit(),onClick:Ae,children:zit()})]}),!M.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(dS,{size:16})," ",Hat()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:Qat()})]})]}),(r!=="paper"||M)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:az()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:wt=>{c(!0),a(wt.target.value)},placeholder:iz()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:M!=null&&M.repoUrl?jst():J2()}),f.jsx("input",{className:"text-sm font-normal",value:B,onChange:wt=>{p(!0),h(wt.target.value)},"aria-describedby":Ln?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),ne&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:sz()}),Ln&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:es})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?lst({path:Ne(u)}):tz(),disabled:m,title:u||void 0,onClick:()=>void nt(),children:[f.jsx(Su,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?wst():u||tz()}),f.jsx(Ba,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:J2()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:wt=>{p(!0),h(wt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:J2()}),f.jsx("input",{className:"text-sm font-normal",value:B,onChange:wt=>{p(!0),h(wt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":Un?"blank-destination-description":void 0,spellCheck:!1}),ne&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:sz()}),Un&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:dr})]}):null,r!=="blank"&&B&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:az()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:wt=>{c(!0),a(wt.target.value)},placeholder:iz()})]}),jt&&f.jsx("div",{className:"project-path-notice error",children:wat()}),!jt&&r==="folder"&&u.trim()&&!ne&&(U==null?void 0:U.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:Dot()}),!jt&&r==="folder"&&u.trim()&&!ne&&en&&f.jsx("div",{className:"project-path-notice error",children:Qot()}),!jt&&r==="folder"&&!ne&&(U==null?void 0:U.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:Hit()}),!jt&&r==="folder"&&!ne&&(U==null?void 0:U.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:Hot()}),K&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:K})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||M)&&B&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${N&&se===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(wt=>!wt),children:[N?se===null?Hrt():Qrt():QD(),f.jsx(rc,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:N,onChange:wt=>z(wt.target.checked),disabled:k}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:zot()})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:cn?nct({repository:Ne(on)}):je?mct({repository:Ne(on)}):lct({repository:Ne(on)})}),f.jsx("span",{children:cat()}),se===null&&f.jsx("span",{children:Hct({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(De,{type:"button",onClick:n,children:xit()}),f.jsx(De,{variant:"primary",className:"ms-auto",disabled:!Ct,children:k?Qst():r==="paper"?M!=null&&M.repoUrl?Lst():nz():r==="folder"?nlt():nz()})]})]})}function d$({onClose:e,onCreated:n,remote:t=!1}){const r=A.useRef(null),s=A.useRef(e);return s.current=e,A.useEffect(()=>{const i=r.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"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const c=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.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 h=o();if(h.length===0){u.preventDefault(),i.focus();return}const _=h[0],p=h[h.length-1];u.shiftKey&&document.activeElement===_?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),_.focus())};return document.addEventListener("keydown",c,!0),()=>{document.removeEventListener("keydown",c,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:iL()}),f.jsx(akn,{onCancel:e,onCreated:n,remote:t})]})})}function okn({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=A.useRef(null),a=A.useRef(r),o=A.useRef(n);a.current=r,o.current=n,A.useEffect(()=>{const u=i.current;if(!u)return;const h=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(_()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=_();if(x.length===0){m.preventDefault(),u.focus();return}const k=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===k?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),k.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),h==null||h.focus()}},[]);const c=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:mwt()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:L2t({name:Wi(e.name)})}),f.jsx("p",{className:"m-0",children:c?qwt():Xwt()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(De,{disabled:n,onClick:r,children:nwt()}),f.jsx(De,{variant:"danger",disabled:n,onClick:s,children:n?Twt():kwt()})]})]})})}function jj(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function ckn({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=A.useState(!1),[o,c]=A.useState(null),[u,h]=A.useState(null),[_,p]=A.useState(null),m=ct(Xxn()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function k(v){c(v.id),h(null);try{await Zvn(v.id),h(null),p(null),r(v.id)}catch(b){h(b instanceof Error?b.message:String(b))}finally{c(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:k4t()}),f.jsxs(De,{onClick:()=>a(!0),children:[f.jsx(Ih,{size:15})," ",iL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:m4t()}),f.jsx("span",{children:mz()}),f.jsx("span",{children:gz()}),f.jsx("span",{children:vz()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:l4t()}):[...e].sort((v,b)=>{var C,N;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((N=x[b.id])==null?void 0:N.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):zv(),C=b?b.activeAgents>0?w2t({count:Xt(b.activeAgents)}):L4t():"—",N=b?b.totalAgents===1?Q4t():j2t({count:Xt(b.totalAgents)}):"—",z=b?b.runningExperiments>0?n3t({count:Xt(b.runningExperiments)}):b.totalExperiments===0?eS():bz({count:Xt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?bz({count:Xt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":JY({name:Wi(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[lwt()," ",co(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[Q2t()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":i3({name:Wi(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),h(null),p(v)},children:f.jsx(bf,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:mz()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(jj,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:N})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gz()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(jj,{}),z]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:vz()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":Cv({name:Wi(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(qb,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(d$,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),_&&f.jsx(okn,{project:_,deleting:o===_.id,error:u,onClose:()=>{h(null),p(null)},onConfirm:()=>void k(_)})]})}function h$(){const e=A.useSyncExternalStore(Gxn,Xz,Xz);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":u3()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(dS,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:u3()})]})]})}function lkn({onClose:e,onConfigureSsh:n}){var v,b,w;const t=an({mutationFn:y=>Jbn(...y)}),r=ct(nI()),s=ct(yxn()),i=((v=r.data)==null?void 0:v.hosts)??null,a=s.data??[],[o,c]=A.useState(""),u=i?null:((b=r.error)==null?void 0:b.message)??((w=s.error)==null?void 0:w.message)??null,[h,_]=A.useState(null),p=A.useRef(null);Em(p,e);async function m(y){const C=window.open("/remote-launch","_blank");if(!C){bn(ASt(),"error");return}_(y);try{const N=await t.mutateAsync([y,{theme:r2n(),locale:E()}]);C.location.replace(N.gatewayUrl),e()}catch(N){C.close(),bn(N instanceof Error?N.message:String(N),"error")}finally{_(null)}}const x=i==null?void 0:i.filter(y=>y.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),k=new Map(a.map(y=>[y.host,y]));return Mi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx($t,{className:"absolute end-3.5 top-3.5","aria-label":l5t(),onClick:e,children:f.jsx(lr,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:d3()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:m5t()}),f.jsx(qr,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:y=>c(y.target.value),placeholder:wz(),"aria-label":wz()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(Nt,{})," ",kL()]}):(x==null?void 0:x.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:rSt()}):x==null?void 0:x.map(y=>{const C=k.get(y.host);return f.jsxs(De,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:h===y.host,onClick:()=>void m(y.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:y.host}),h===y.host?f.jsx(Nt,{}):C?f.jsx("span",{className:"text-sm text-subtext",children:gSt()}):null]},y.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(De,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(QI,{size:15}),ML()]})})]})}),document.body)}function Pv({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}const ukn="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",_kn="/assets/ollama-logo-Bt9O-2K_.png",fkn="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",p$={id:"lmstudio",label:"LM Studio",icon:ukn,url:"http://127.0.0.1:1234/v1"},Z1=[p$,{id:"omlx",label:"oMLX",icon:fkn,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:_kn,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function m$({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var V,J;const s=ct({...jxn(),enabled:!t}),i=ct(ku()),a=(V=i.data)==null?void 0:V.find(Z=>Z.id==="opencode"),[o,c]=A.useState(t),u=()=>{c(!1),r==null||r()},[h,_]=A.useState("lmstudio"),p=Z1.find(Z=>Z.id===h)??p$,[m,x]=A.useState({}),k=m[p.id]??{baseUrl:p.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:v,models:b,model:w,contextWindow:y,error:C}=k,N=p.id==="ollama"?"":k.apiKey,z=Z=>{x(B=>({...B,[p.id]:{...B[p.id]??k,...Z}}))},T=an({mutationFn:cxn}),j=an({mutationFn:async Z=>{var F;const B=await lxn(Z);if(!((F=(await Y_(!0)).find(U=>U.id==="opencode"))!=null&&F.models.some(U=>U.id===B.model)))throw new Error(_Je());return B}}),M=an({mutationFn:_xn}),D=Number(y),I=T.isPending||j.isPending,$=(Z={})=>z({models:[],model:null,error:null,...Z}),q=async()=>{$();try{const Z=await T.mutateAsync({baseUrl:v.trim(),apiKey:N});z({models:Z.models,model:Z.models[0]??null})}catch(Z){z({error:Z instanceof Error?Z.message:String(Z)})}},H=async()=>{if(w){z({error:null});try{const Z=await j.mutateAsync({name:p.label,baseUrl:v.trim(),apiKey:N,model:w,contextWindow:D});u(),n==null||n(Z.model)}catch(Z){z({error:Z instanceof Error?Z.message:String(Z)})}}},Q=async Z=>{try{await M.mutateAsync(Z)}catch(B){bn(B instanceof Error?B.message:String(B),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":YN(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:YN()}),f.jsxs(De,{disabled:I,onClick:()=>c(!0),"aria-haspopup":"dialog",children:[f.jsx(Ih,{size:14}),UD()]})]}),s.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:s.error.message}),f.jsx("div",{className:"space-y-3",children:(J=s.data)==null?void 0:J.map(Z=>f.jsx(dkn,{connection:Z,harnessReady:(a==null?void 0:a.agentReady)??!1,availableModels:(a==null?void 0:a.models.map(B=>B.id))??[],checking:i.isFetching||((a==null?void 0:a.catalogPending)??!1),unknown:i.isError||!i.data,disabled:I||M.isPending,onRemove:()=>void Q(Z.id)},Z.id))})]}),o&&f.jsx(hkn,{busy:I,onClose:u,footer:f.jsxs(De,{variant:"primary",disabled:I||!e||b.length>0&&(!w||!Number.isSafeInteger(D)||D<4096),onClick:()=>void(b.length>0?H():q()),children:[I&&f.jsx(Nt,{}),b.length>0?yet():ZZe()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:iet()}),f.jsx(ph,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:ZJe()})]}),f.jsx(Yo,{choices:Z1,value:h,title:XN(),header:XN(),variant:"field",floating:!0,dropDown:!0,disabled:I,renderLabel:Z=>f.jsxs(f.Fragment,{children:[Z.id==="openai-compatible"?Wk():Z.label,Z.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:GD()})]}),renderIcon:Z=>{var L;const B=(L=Z1.find(F=>F.id===Z.id))==null?void 0:L.icon;return B?f.jsx("img",{src:B,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${Z.id==="ollama"?" dark:invert":""}`}):f.jsx(UI,{size:14,className:"shrink-0"})},onSelect:_}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:GZe()}),f.jsx(qr,{value:v,disabled:I,onChange:Z=>{$({baseUrl:Z.target.value})}})]}),p.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:dL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:p.id==="lmstudio"?Pet():det()}),f.jsx(qr,{type:"password",autoComplete:"off",value:N,disabled:I,onChange:Z=>$({apiKey:Z.target.value})})]})]},p.id),b.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Yo,{choices:b.map(Z=>({id:Z,label:Z})),value:w,searchPlaceholder:WD(),title:f0(),header:f0(),variant:"field",floating:!0,dropDown:!0,disabled:I,onSelect:Z=>{z({model:Z})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:CJe()}),f.jsx(qr,{type:"number",min:4096,step:1024,value:y,disabled:I,onChange:Z=>{z({contextWindow:Z.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:RJe()})]}),C&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:C})]})})]})}function dkn({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=an({mutationFn:async()=>{try{await uxn(e.id)}finally{await Y_(!0)}}}),c=Z1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),h=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),_=o.isPending||r,p=s,m=h;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[c!=null&&c.icon?f.jsx("img",{src:c.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${c.id==="ollama"?" dark:invert":""}`}):f.jsx(UI,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(c==null?void 0:c.id)==="openai-compatible"?Wk():(c==null?void 0:c.label)??e.name,(c==null?void 0:c.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:GD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Gt,{variant:_||p?"default":m?"success":"warning",children:_?ra():p?CL():m?vJe():ro()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(De,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Pa,{size:14}),Nv()]}),f.jsx($t,{"aria-label":GJe({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(bf,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function hkn({busy:e,onClose:n,footer:t,children:r}){const s=A.useRef(null),i=()=>{e||n()};return Em(s,i,"input"),Mi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:UD()})}),f.jsx($t,{className:"absolute end-3.5 top-3.5","aria-label":Q_(),onClick:i,disabled:e,children:f.jsx(lr,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(De,{onClick:i,disabled:e,children:Q_()}),t]})]})}),document.body)}const g$=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Tj=["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-sm text-muted"].join(" "),su={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor",antigravity:"Google Antigravity"};function pkn(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:Rv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:Ob(n,t).defaultId}}function _o(e){const[n,t]=A.useState(!1),r=A.useRef(null);return A.useEffect(()=>{if(!n)return;const s=a=>{var o,c;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((c=e==null?void 0:e.current)!=null&&c.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function mkn({value:e,onSelect:n,onOpenSettings:t,permissionChoices:r=[],defaultPermissionId:s,onSelectPermission:i,reasoningChoices:a=[],defaultReasoningId:o,onSelectReasoning:c,lockHarness:u=!1,openRequest:h=0,className:_}){var le,pe,be,Me,Le,Ke,je;const{data:p=gkn}=ct(ku()),m=ym(),[x,k]=A.useState(!1),v=A.useRef(null),b=A.useRef(null),{open:w,setOpen:y,ref:C}=_o(v),[N,z]=A.useState(""),[T,j]=A.useState("root"),M=()=>{y(!1),j("root"),z("")},D=A.useRef(h);A.useEffect(()=>{h!==D.current&&(D.current=h,j("models"),z(""),y(!0))},[h,y]),A.useEffect(()=>{var we;w&&(T==="reasoning"||T==="speed"||T==="permissions")&&((we=b.current)==null||we.focus())},[w,T]);const I=A.useMemo(()=>{const we=N.trim().toLowerCase();return(u&&e?p.filter(Ze=>Ze.id===e.harness):p).map(Ze=>{let at=Ze.models;return we?at=at.filter(St=>`${St.id} ${K1(St)}`.toLowerCase().includes(we)):(Ze.id==="opencode"||Ze.id==="cursor"||Ze.id==="antigravity")&&(at=at.slice(0,5)),{harness:Ze,models:at,hidden:we?0:Ze.models.length-at.length}})},[p,N,u,e]),$=(we,rt)=>{var at;const Ze=(e==null?void 0:e.harness)===we.id;n({harness:we.id,model:rt,serviceTier:Rv(we,rt,Ze?e==null?void 0:e.serviceTier:null),permissionMode:Ze?e.permissionMode:((at=we.options)==null?void 0:at.defaultPermissionMode)??null,reasoningLevel:JL(we,rt,Ze?e.reasoningLevel:null)}),M()},q=(e==null?void 0:e.model)!=null?(le=p.find(we=>we.id===e.harness))==null?void 0:le.models.find(we=>we.id===e.model):void 0,H=e?e.model?q?K1(q):w3(e.model):ZN():f0(),Q=(e==null?void 0:e.reasoningLevel)??o??((pe=a[0])==null?void 0:pe.id),V=(be=a.find(we=>we.id===Q))==null?void 0:be.label,J=(e==null?void 0:e.permissionMode)??s??((Me=r[0])==null?void 0:Me.id),Z=(Le=r.find(we=>we.id===J))==null?void 0:Le.label,B=(e==null?void 0:e.harness)==="opencode"?wrt():snt(),L=p.find(we=>we.id===(e==null?void 0:e.harness)),F=ZL(L,e==null?void 0:e.model),U=Rv(L,e==null?void 0:e.model,e==null?void 0:e.serviceTier),K=(Ke=F.find(we=>we.id===U))==null?void 0:Ke.label,ne=we=>{c==null||c(we),M()},ce=we=>{i==null||i(we),M()},_e=we=>{e&&n({...e,serviceTier:we}),M()},se=(we,rt,Ze)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>j(Ze),children:[f.jsx("span",{className:"flex-1",children:we}),rt&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:rt}),f.jsx(Ba,{size:14,className:"shrink-0 text-muted"})]}),G=we=>f.jsxs("div",{className:"flex shrink-0 items-center border-b border-border-variant px-1 py-1",children:[f.jsx($t,{ref:b,type:"button",size:"small",className:"model-submenu-header","aria-label":sL(),onClick:()=>{j("root"),z("")},children:f.jsx(LI,{size:15})}),f.jsx("span",{className:"min-w-0 flex-1 text-sm font-medium text-text",children:we}),T==="models"&&f.jsx($t,{type:"button",size:"small","aria-label":m3(),onClick:()=>{M(),t()},children:f.jsx(yS,{size:15,"aria-hidden":"true"})})]}),oe=(we,rt,Ze,at)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:we.map(St=>f.jsxs(Jn,{onClick:()=>at(St.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[St.label,St.id===Ze&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",KD()]})]}),St.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:St.description})]}),St.id===rt&&f.jsx(Ri,{size:13})]},St.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:C,children:[f.jsxs("button",{ref:v,type:"button",className:bs("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",_),title:iX({label:`${H}${V?` · ${V}`:""}${K?` · ${K}`:""}`}),"aria-haspopup":"menu","aria-expanded":w,onClick:()=>{w?M():(j("root"),y(!0))},children:[U==="priority"?f.jsx(Y3n,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(vh,{harness:e.harness,size:14}):null,U==="priority"&&f.jsxs("span",{className:"sr-only",children:[_nt()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[H,V&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:V})]}),f.jsx(rc,{size:14,className:"shrink-0 text-muted"})]}),w&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-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:[T==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[se(f0(),H,"models"),a.length>0&&se(B,V,"reasoning"),F.length>0&&se(ez(),K,"speed"),r.length>0&&se(JN(),Z,"permissions")]}),T==="models"&&f.jsxs(f.Fragment,{children:[G(f0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:WD(),value:N,onChange:we=>z(we.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[I.map(({harness:we,models:rt,hidden:Ze})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:g$,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(vh,{harness:we.id,size:14}),we.name]}),!we.agentReady&&f.jsx("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:we.catalogPending?W_():f.jsxs(f.Fragment,{children:[f.jsx(dj,{size:10})," ",ro()]})})]}),we.agentReady?f.jsxs(f.Fragment,{children:[we.models.length===0&&f.jsxs(Jn,{onClick:()=>$(we,null),children:[f.jsxs("span",{children:[ZN(),f.jsx("span",{className:"model-id",children:VD()})]}),(e==null?void 0:e.harness)===we.id&&(e==null?void 0:e.model)===null&&f.jsx(Ri,{size:13})]}),rt.map(at=>f.jsxs(Jn,{title:at.id,onClick:()=>$(we,at.id),children:[f.jsx("span",{children:K1(at)}),(e==null?void 0:e.harness)===we.id&&(e==null?void 0:e.model)===at.id&&f.jsx(Ri,{size:13})]},at.id)),N.trim().length>0&&!we.models.some(at=>at.id===N.trim())&&f.jsx(Jn,{onClick:()=>$(we,N.trim()),children:f.jsx("span",{children:prt({id:Ne(N.trim())})})})]}):f.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-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:we.catalogPending?W_():we.agentNote?gh(we.agentNote):Int()}),we.id==="opencode"&&f.jsx(Jn,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var at;M(),(at=v.current)==null||at.focus(),k(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[Ett(),f.jsx(Ih,{size:14,"aria-hidden":"true"})]})}),we.agentReady&&Ze>0&&f.jsx("div",{className:Tj,children:Tnt({count:Xt(Ze)})})]},we.id)),p.length===0&&f.jsx("div",{className:Tj,children:Ytt()})]}),u&&e&&p.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(dj,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),Xnt()]})]}),T==="reasoning"&&f.jsxs(f.Fragment,{children:[G(B),oe(a,Q,o,ne)]}),T==="permissions"&&f.jsxs(f.Fragment,{children:[G(JN()),oe(r,J,s,ce)]}),T==="speed"&&f.jsxs(f.Fragment,{children:[G(ez()),oe(F,U??void 0,"default",_e)]})]}),x&&f.jsx(m$,{dialogOnly:!0,installed:((je=p.find(we=>we.id==="opencode"))==null?void 0:je.installed)??!1,onClose:()=>k(!1),onConnected:we=>{var Ze;const rt=(Ze=m.getQueryData(ku().queryKey))==null?void 0:Ze.find(at=>at.id==="opencode");rt&&(!u||(e==null?void 0:e.harness)==="opencode")&&$(rt,we)}})]})}function Yo({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:c,numbered:u=!1,searchPlaceholder:h,renderIcon:_,renderLabel:p,floating:m=!1,onSelect:x,className:k}){var Q,V;const v=A.useRef(null),{open:b,setOpen:w,ref:y}=_o(v),C=A.useRef(null),[N,z]=A.useState("");if(A.useLayoutEffect(()=>{var L;const J=C.current,Z=y.current;if(!b||!m||!J||!Z)return;J.matches(":popover-open")||(J.showPopover(),(L=J.querySelector("input"))==null||L.focus());const B=()=>{const F=Z.getBoundingClientRect(),U=window.innerHeight-F.bottom-12,K=F.top-12,ne=Math.min(380,J.scrollHeight),ce=i?U>=ne||U>=K:KK;J.style.width=`${F.width}px`,J.style.minWidth="0",J.style.maxHeight=`${Math.max(0,Math.min(380,ce?U:K))}px`,J.style.left=`${F.left}px`,J.style.top=`${ce?F.bottom+4:F.top-J.getBoundingClientRect().height-4}px`};return B(),window.addEventListener("resize",B),window.addEventListener("scroll",B,!0),()=>{window.removeEventListener("resize",B),window.removeEventListener("scroll",B,!0)}},[b,m,i,N,e.length,y]),e.length===0)return null;const T=n??t??((Q=e[0])==null?void 0:Q.id)??null,j=e.find(J=>J.id===T),M=e.find(J=>J.id===t),D=o==="bare"&&(M==null?void 0:M.id)===Av?M:void 0,$=(D?e.filter(J=>J.id!==D.id):e).filter(J=>`${J.label} ${J.id}`.toLowerCase().includes(N.toLowerCase())),q=(j==null?void 0:j.label)??((V=e[0])==null?void 0:V.label)??"",H=J=>{var Z;x(J),w(!1),(Z=v.current)==null||Z.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:bs(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,k),title:c,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{z(""),w(J=>!J)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(_==null?void 0:_(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??q:q})]}),f.jsx(rc,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(J=>J.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:g$,children:r}),h&&f.jsx("input",{autoFocus:!0,"aria-label":h,placeholder:h,value:N,onChange:J=>z(J.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[D&&f.jsxs(f.Fragment,{children:[f.jsxs(Jn,{type:"button",onClick:()=>H(D.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[_==null?void 0:_(D),f.jsxs("span",{children:[(p==null?void 0:p(D))??D.label,f.jsx("span",{className:"option-default text-muted font-normal",children:VD()})]})]}),T===D.id&&f.jsx(Ri,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((J,Z)=>f.jsxs(Jn,{type:"button",onClick:()=>H(J.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[_==null?void 0:_(J),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(J))??J.label,!D&&J.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",KD()]})]}),J.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:J.description})]})]}),T===J.id?f.jsx(Ri,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:Z+1})]},J.id))]})]})]})}const gkn=[];function q3({runtime:e,corner:n=!1}){const[t,r]=A.useState(!1),[s,i]=A.useState(!1),[a,o]=A.useState(!1),[c,u]=A.useState(null),h=_o();async function _(){if(c){o(!0);try{await WL(c),u(null)}catch(p){u(null),bn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:h.ref,children:[h.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:H3t({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(Jn,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await VL(),h.setOpen(!1)}catch(p){bn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?D3t():h3()}),f.jsx(fS,{content:SSt(),className:"me-2 shrink-0 text-subtext",children:f.jsx(mS,{size:15})})]}),f.jsx(Jn,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await KL()),h.setOpen(!1)}catch(p){bn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:oL()})]}),n?f.jsxs(De,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":h.open,onClick:()=>h.setOpen(p=>!p),children:[f.jsx(Pv,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:tw({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx($t,{size:"small","aria-label":tw({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":h.open,onClick:()=>h.setOpen(p=>!p),children:f.jsx(Pv,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:tw({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),c&&f.jsx(RI,{host:e.session.host,preview:c,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void _()})]})}const Fv="code-source-text",v$="code-source-wrap",b$="file-view-gutter text-right text-muted select-none";function y$(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}const vkn={cjs:"javascript",console:"bash",cts:"typescript",fish:"bash",html:"markup",js:"javascript",jsx:"javascript",md:"markdown",mjs:"javascript",mts:"typescript",py:"python",rb:"ruby",sh:"bash",shell:"bash",svg:"markup",terminal:"bash",ts:"typescript",tsx:"typescript",xml:"markup",yml:"yaml",zsh:"bash"},bkn={containerfile:"docker",dockerfile:"docker",justfile:"makefile",makefile:"makefile"};function U3(e){const n=e.trim().toLowerCase();return vkn[n]??n}function RS(e){var s;if(!e)return null;const n=((s=e.split("/").pop())==null?void 0:s.toLowerCase())??"",t=bkn[n];if(t)return U3(t);const r=n.lastIndexOf(".");return r===-1||r===n.length-1?null:U3(n.slice(r+1))}sc.displayName="clike";sc.aliases=[];function sc(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}zm.displayName="c";zm.aliases=[];function zm(e){e.register(sc),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}Ub.displayName="cpp";Ub.aliases=[];function Ub(e){e.register(zm),(function(n){var t=/\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 t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.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:t,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/}),n.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}}),n.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:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}MS.displayName="arduino";MS.aliases=["ino"];function MS(e){e.register(Ub),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}OS.displayName="bash";OS.aliases=["sh","shell"];function OS(e){(function(n){var t="\\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},s={bash:r,environment:{pattern:RegExp("\\$"+t),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("(\\{)"+t),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})/};n.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;|&]|[<>]\\()"+t),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:s},{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:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.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=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(U,K){return"(?:"+F[+K]+")"})}function r(L,F,U){return RegExp(t(L,F),"")}function s(L,F){for(var U=0;U>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={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 a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),c=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),h=a(i.type+" "+i.typeDeclaration+" "+i.other),_=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,x=t(/<<0>>(?:\s*<<1>>)?/.source,[m,_]),k=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,x]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[k,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[_,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,k,v]),N={keyword:c,punctuation:/[<>()?,.:[\]]/},z=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[T]),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,[m,C]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,x]),lookbehind:!0,inside:N},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[k]),lookbehind:!0,inside:N},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:N},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,h,m]),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:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),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,[m,_]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(_),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,[o,x,m,C,c.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[x,p]),lookbehind:!0,greedy:!0,inside:n.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 M=T+"|"+z,D=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),I=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[D]),2),$=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,q=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[k,I]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[$,q]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[$]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[I]),inside:n.languages.csharp},"class-name":{pattern:RegExp(k),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var H=/:[^}\r\n]+/.source,Q=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[D]),2),V=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Q,H]),J=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),Z=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[J,H]);function B(L,F){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[F,H]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[V]),lookbehind:!0,greedy:!0,inside:B(V,Q)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[Z]),lookbehind:!0,greedy:!0,inside:B(Z,J)}],char:{pattern:RegExp(z),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}jm.displayName="markup";jm.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function jm(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(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\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:[t,"language-"+t],inside:e.languages[t]},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}Bh.displayName="css";Bh.aliases=[];function Bh(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.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\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,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:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}LS.displayName="diff";LS.aliases=[];function LS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r +`))}finally{C(!1)}}};return f.jsxs("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${s===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:[!t&&u&&c.data&&f.jsx(h$,{harness:u,commands:c.data[u.id],onReady:Le=>{D(Le.id)},onClose:()=>{h(null)}}),f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${s===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:s===0?f.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:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(hw,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:Elt()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:O_t()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:z0t()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:Fft()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:Kpt()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:xft()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:mmt()})]})})]})]}),f.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:f.jsxs(Oe,{variant:"primary",size:"large",onClick:qt,disabled:I&&b===null,children:[I&&b===null?f.jsx(jt,{}):null,_z()," ",f.jsx(Q1,{size:20})]})})]}):s===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(hw,{}),f.jsx("span",{children:e0t()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:Vut()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:Pdt()}),b!==null&&!be&&!Ae&&f.jsx("p",{className:zj,children:Mpt()}),b!==null&&be&&M===null&&f.jsx("p",{className:zj,children:Jut()}),(x===null||ce)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(Tj,{gitVersion:x,error:ce}),ce?f.jsx("p",{className:pw,children:nw()}):f.jsx("p",{className:pw,children:fz()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:b!==null?b.map(Le=>{var me;return f.jsx(rSn,{h:Le,remote:t,selected:M===Le.id,onSelect:()=>D(Le.id),commands:(me=c.data)==null?void 0:me[Le.id],onSetup:()=>h(Le)},Le.id)}):G?f.jsx("div",{className:Q_,children:nw()}):f.jsxs(Vr,{className:"py-2",children:[f.jsx(jt,{})," ",eft()]})}),c.isError&&f.jsxs("p",{className:Q_,children:[LWe()," ",f.jsx(Oe,{variant:"ghost",onClick:()=>void c.refetch(),children:Ys()})]}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Oe,{variant:"ghost",onClick:()=>i(0),children:[f.jsx(M0,{size:12})," ",uz()]}),f.jsxs(Oe,{variant:"ghost",onClick:()=>Ne(!0,!0),disabled:I,children:[f.jsx(Qa,{size:12,className:I?"animate-[spin_0.9s_linear_infinite]":""})," ",Nv()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Oe,{variant:"primary",onClick:()=>i(2),disabled:I||!be||M===null||!De,title:I||!be&&Ae?nmt():be?M===null?N_t():ce?bht():x===void 0?Q0t():x===null?tdt():void 0:Ept(),children:[_z()," ",f.jsx(Q1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(hw,{}),!_&&f.jsx("span",{children:o0t()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:h0t()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:p$,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:lmt()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:y_t()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:Ykn.map(Le=>f.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:[f.jsx("input",{type:"checkbox",checked:q.includes(Le.id),onChange:()=>Ze(Le.id),disabled:y}),f.jsx("span",{children:Le.label()})]},Le.id))}),q.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:Q,onChange:Le=>V(Le.target.value),disabled:y,placeholder:x0t(),"aria-label":eht()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:Mht()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:Z,onChange:Le=>Y(Le.target.value),disabled:y,rows:4,placeholder:oft()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:Eht()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:Mlt()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:F,onChange:Le=>U(Le.target.value),disabled:y,placeholder:Vht()}),oe?f.jsx("div",{className:Q_,children:Jht()}):K.length>0?f.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-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:K.map(Le=>f.jsxs("button",{type:"button",onClick:()=>xe(Le),disabled:y,children:[f.jsx(L0,{children:jj(Le.title)}),f.jsx("span",{className:"id",children:Le.paperId})]},Le.paperId))}):null]}),B.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:B.map(Le=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-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]: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:[f.jsx(L0,{children:Le.title||Le.paperId}),f.jsx("span",{className:"id",children:Le.paperId}),f.jsx("button",{type:"button","aria-label":YZ({name:Ce(Le.paperId)}),onClick:()=>rt(Le.paperId),disabled:y,children:f.jsx(_r,{size:12})})]},Le.paperId))})]})}),!ct&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:q.length===0?d_t():K_t()}),_&&!De&&f.jsxs("div",{className:"mt-5",role:"status",children:[f.jsx(Tj,{gitVersion:x,error:ce}),f.jsx("p",{className:pw,children:ce?nw():fz()}),f.jsx(Oe,{onClick:()=>Ne(!0,!0),disabled:I,children:Nv()})]}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Oe,{variant:"ghost",onClick:()=>i(_?0:1),disabled:y,children:[f.jsx(M0,{size:12})," ",uz()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Oe,{variant:"primary",onClick:()=>void dt(),disabled:y||!De||!_&&M===null||!ct,children:y?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",bpt()]}):f.jsxs(f.Fragment,{children:[zft()," ",f.jsx(Q1,{size:13})]})})]}),M===null&&!_&&f.jsx("p",{className:Xkn,children:kmt()}),z&&f.jsxs("div",{role:"alert",className:"mt-8 grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2.5 rounded-md border border-danger-notice-border bg-accent-red-subtle px-3 py-2",children:[f.jsx(pS,{size:16,className:"shrink-0 text-accent-red"}),f.jsx("p",{className:"m-0 min-w-0 flex-1 text-sm text-text break-words",children:z}),_&&f.jsx(Oe,{size:"small",onClick:()=>void dt(ct&&De?"complete":"setup"),disabled:y,children:Ys()}),_&&f.jsx(Oe,{variant:"ghost",size:"small",className:"col-start-2 justify-self-start",disabled:y,onClick:()=>{p(!1),E(null),i(1)},children:a_t()}),f.jsxs("details",{className:"col-start-2 col-span-2 min-w-0 text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:hft()}),f.jsx("pre",{className:"mt-2 mb-0 max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-md border border-danger-notice-border bg-background px-2 py-1.5 font-mono text-xs",children:T||z})]})]})]})})]})}function jj(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function eSn(e){return e.catalogPending?{tone:"warning",label:nf()}:e.agentReady?{tone:"success",label:e.authMethod==="local"||!e.authenticated?Jk():Ppt()}:e.installed?e.installBroken?{tone:"warning",label:Wft()}:e.authMethod==="local"?{tone:"warning",label:eL()}:e.needsConfigRepair||e.authState==="unknown"?{tone:"warning",label:D0t()}:e.authState==="unsupported"?{tone:"warning",label:H0t()}:e.installed?{tone:"warning",label:JD()}:{tone:"neutral",label:dz()}:{tone:"neutral",label:dz()}}function tSn(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:Db(e,n).defaultId}}function nSn({harness:e}){return f.jsx(bh,{harness:e,size:26})}function rSn({h:e,remote:n,selected:t,onSelect:r,commands:s,onSetup:i}){var w;const a=!n&&!e.needsConfigRepair&&!e.catalogPending&&(!e.installed||e.installBroken||e.authState==="unsupported"||e.authMethod!=="local"&&e.authMethod!=="apiKey"&&(e.authState==="needsLogin"||e.authState==="unknown")),o=!e.agentReady&&a,c=a&&(!e.installed||!e.agentReady&&e.authState==="needsLogin"),u=eSn(e),h=t?{tone:"success",label:apt()}:u,_=(w=e.version)==null?void 0:w.replace(/\s*\(.*\)$/,""),p=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan].filter(Boolean).join(" · "),m=f.jsxs("div",{className:"onb-card-head flex flex-wrap items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(nSn,{harness:e.id}),f.jsxs("span",{className:"flex flex-col gap-1",children:[f.jsxs("span",{className:"onb-card-name flex flex-wrap items-center gap-2 text-base font-semibold tracking-[-0.01em]",children:[e.name,c&&f.jsx($d,{tone:u.tone,className:"font-normal",children:u.label})]}),o&&!c&&f.jsx($d,{tone:h.tone,children:h.label})]})]}),o?f.jsxs(Oe,{size:"small",onClick:i,disabled:!s,"aria-haspopup":"dialog",title:tQe(),children:[f.jsx(ko,{size:14}),!e.installed||e.installBroken?wWe():e.authState==="unsupported"?zQe():UD()]}):f.jsx($d,{tone:h.tone,children:h.label})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-4 px-4 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${t?" selected":""}`,"aria-pressed":t,onClick:r,children:[m,e.id!=="opencode"&&f.jsx("div",{className:"onb-card-detail flex items-center gap-1.5 text-sm",children:e.accountLoading?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",cdt()]}):f.jsxs(f.Fragment,{children:[e.account??(e.authMethod==="apiKey"?Zk():null),e.plan?` · ${e.plan}`:""]})}),p&&f.jsx("div",{className:Q_,children:p})]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-4 px-4 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[m,e.authState==="unsupported"&&_&&f.jsx("div",{className:Q_,children:_}),!o&&e.agentNote&&f.jsx("div",{className:`${Q_} [&_code]:whitespace-pre-wrap break-words`,children:vh(e.agentNote)})]})}function Tj({gitVersion:e,error:n}){return f.jsxs("div",{className:p$,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:pdt()}),f.jsx($d,{tone:e?"success":n||e===null?"danger":"warning",children:e?Jk():n?Eut():e===null?ZD():nf()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:Q_,children:e??But()})]})}const sSn="/assets/slurm-logo-aGSXVZcE.svg",iSn="/assets/thinking-machines-BOdslTfm.png";function aSn(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 LD();case"tinker_job":return"Tinker";default:return e||"—"}}function oSn({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.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"}),f.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"}),f.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"}),f.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"}),f.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"}),f.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"}),f.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 cSn({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.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"}),f.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)"}),f.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)"}),f.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"}),f.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"}),f.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)"}),f.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)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function lSn({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.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 uSn({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.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 _Sn({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.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 fSn({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:iSn,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function dSn({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:sSn,width:e,height:e,alt:"","aria-hidden":"true"})}function Gb({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.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 Bh({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(cSn,{size:n});case"hf_job":return f.jsx(oSn,{size:n});case"k8s_job":return f.jsx(lSn,{size:n});case"ssh_job":return f.jsx(mj,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(dSn,{size:n});case"ray_job":return f.jsx(uSn,{size:n});case"openresearch_job":return f.jsx(_Sn,{size:n});case"tinker_job":return f.jsx(fSn,{size:n});case"local_job":return f.jsx(c5n,{size:n,strokeWidth:1.5});default:return f.jsx(mj,{size:n})}}function RS({backend:e}){const n=oS(e),t=g2n(e);return n?f.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:[f.jsx(Bh,{kind:n}),f.jsx("span",{className:"backend-name",children:aSn(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.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 mw(e,n){const[t,r]=A.useState(e);return A.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function l1(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function hSn(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function pSn(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function mSn(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function gSn({onCreated:e,onCancel:n,remote:t=!1}){var Ir,mn,gn,Ln;const[r,s]=A.useState("blank"),[i,a]=A.useState(""),[o,c]=A.useState(!1),[u,h]=A.useState(""),[_,p]=A.useState(!1),[m,w]=A.useState(!1),[k,v]=A.useState(!1),[b,x]=A.useState(null),[y,C]=A.useState(!1),[z,E]=A.useState(!1),[T,j]=A.useState(""),[M,D]=A.useState(null),[I,$]=A.useState(!1),q=A.useRef(0),H=A.useRef(0),Q=A.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),V=r==="paper"?pSn(M==null?void 0:M.repoUrl):null,Z=i.trim()?`~/OpenResearch/${l1(i,48)}`:"",Y=`~/OpenResearch/${l1(i||(M==null?void 0:M.title)||(M==null?void 0:M.paperId)||"")}`,B=r==="blank"&&!_?Z:r==="paper"&&M&&!_?Y:u,L=mw(B.trim(),200),F=ut({...h0(L),enabled:!!L&&L===B.trim()}),U=L===B.trim()?F.data??null:null,K=L===B.trim()?((Ir=F.error)==null?void 0:Ir.message)??null:null,ne=!!B.trim()&&(L!==B.trim()||F.isFetching),oe=V??(r==="folder"&&(U!=null&&U.githubOwner)&&U.githubRepo?{owner:U.githubOwner,repo:U.githubRepo}:null),ue=ut(cwn()),se=((mn=ue.data)==null?void 0:mn.login)??(ue.isPending?void 0:null),G=ut(cS()),ae=A.useRef(!1);A.useEffect(()=>{ae.current||!G.data||(ae.current=!0,E(G.data.githubForNewProjects))},[G.data]);const ce=mw(i.trim(),150),pe=ut({...lwn(ce),enabled:ce===i.trim()}),be=ce===i.trim()?((gn=pe.data)==null?void 0:gn.repo)??l1(i,48):l1(i,48),Ae=ce!==i.trim()||pe.isFetching,De=ut({...tj((oe==null?void 0:oe.owner)??"",(oe==null?void 0:oe.repo)??""),enabled:!!oe,subscribed:!!oe}),We=!!oe&&De.isFetching,Ne=oe&&((Ln=De.data)!=null&&Ln.canPush)?`github.com/${oe.owner}/${oe.repo}`:null,xe=mw(T.trim(),350),rt=hSn(xe),Ze=r==="paper"&&!M&&xe===T.trim(),ct=ut({...dI(xe),enabled:Ze&&!rt&&xe.length>=3,subscribed:Ze&&!rt&&xe.length>=3}),Ct=ut({...D3(rt??""),enabled:Ze&&!!rt,subscribed:Ze&&!!rt}),qt=Ze&&!rt?ct.data??[]:[],dt=Ze&&ct.isSuccess?xe:"",ht=I||r==="paper"&&!M&&(xe!==T.trim()||(rt?Ct.isFetching:ct.isFetching));A.useEffect(()=>{var Nt;!Ze||!rt||!Ct.data||(D(Ct.data),o||a(((Nt=Ct.data.title)==null?void 0:Nt.trim())||Ct.data.paperId))},[Ze,rt,Ct.data,o]),A.useEffect(()=>{const Nt=rt?Ct.error:ct.error;Ze&&Nt&&x(Nt.message)},[Ze,rt,Ct.error,ct.error]);const Le=dn({mutationFn:Jbn});async function me(Nt){var Hn;const Ot=++q.current;$(!0),x(null);try{const zr=await Je.fetchQuery(D3(Nt));if(Ot!==q.current)return;D(zr),o||a(((Hn=zr.title)==null?void 0:Hn.trim())||zr.paperId)}catch(zr){Ot===q.current&&x(zr instanceof Error?zr.message:String(zr))}finally{Ot===q.current&&$(!1)}}function Te(){q.current+=1,H.current+=1,D(null),j(""),$(!1),w(!1),h(""),p(!1),Q.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function He(Nt){if(Nt===r)return;q.current+=1,H.current+=1,Q.current[r]={name:i,nameTouched:o,path:u,pathTouched:_};const Ot=Q.current[Nt];s(Nt),x(null),$(!1),w(!1),a(Ot.name),c(Ot.nameTouched),h(Ot.path),p(Ot.pathTouched)}async function nt(){if(m)return;const Nt=++H.current;w(!0),x(null);try{const Ot=await Zbn();if(Nt!==H.current||!Ot)return;if(p(!0),h(Ot),Je.invalidateQueries(h0(Ot)),r==="folder"&&!o){const Hn=Ot.replace(/[\\/]+$/,"").split(/[\\/]/).pop();Hn&&a(Hn)}}catch(Ot){Nt===H.current&&x(Ot instanceof Error?Ot.message:String(Ot))}finally{Nt===H.current&&w(!1)}}async function _t(Nt){if(Nt.preventDefault(),!!Et){v(!0),x(null);try{const Ot=await Je.fetchQuery({...h0(B.trim()),staleTime:0});if(Ot.exists&&Ot.directory===!1)throw new Error(ew());if(r==="blank"&&Ot.exists)throw new Error(sz());if(r==="paper"&&Ot.empty===!1)throw new Error(lz());z&&oe&&await Je.fetchQuery({...tj(oe.owner,oe.repo),staleTime:0}).catch(()=>null);const Hn=await Le.mutateAsync({name:i.trim(),path:B.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:z,locale:N(),...r==="paper"&&M?{paperId:M.paperId,cloneUrl:M.repoUrl??void 0}:{}});e(Hn.project,Hn.githubPublicationError)}catch(Ot){x(Ot instanceof Error?Ot.message:String(Ot))}finally{v(!1)}}}const St=i.trim(),yt=r==="paper"&&M&&!M.repoUrl?M.paperId:null,Zt=r==="folder"&&(U==null?void 0:U.gitState)==="ready"?U.resolvedPath??null:null,un=St!==""&&(yt!==null||Zt!==null);A.useEffect(()=>{if(!un)return;const Nt=window.setTimeout(()=>{iyn({name:St,paperId:yt??void 0,path:Zt??void 0,locale:N()}).catch(()=>{})},1200);return()=>window.clearTimeout(Nt)},[un,St,yt,Zt]);const At=(U==null?void 0:U.gitVersion)===null,pt=r==="folder"&&!!B.trim()&&U!==null&&U.exists===!1,mt=r==="blank"&&(U==null?void 0:U.exists)===!0,_n=!!B.trim()&&(U==null?void 0:U.exists)===!0&&U.directory===!1,us=r==="paper"&&!!(M!=null&&M.repoUrl)&&(U==null?void 0:U.empty)===!1,xr=r==="paper"&&!!M&&!(M!=null&&M.repoUrl)&&(U==null?void 0:U.empty)===!1,Qt=r==="folder"&&((U==null?void 0:U.gitState)==="detached"||(U==null?void 0:U.gitState)==="invalid"),Mn=_&&!B.trim()||_n||us||xr,mr=_&&!B.trim()||_n||mt,gr=_&&!B.trim()?cz():_n?ew():mt?sz():null,_s=_&&!B.trim()?cz():_n?ew():us?lz():xr?dst():null,Et=!!(i.trim()&&B.trim())&&!k&&!m&&!ne&&U!==null&&!K&&!At&&!pt&&!mt&&!_n&&!us&&!xr&&!Qt&&(r!=="paper"||!!M)&&(!z||typeof se=="string"&&!Ae&&!We),fn=Ne??`github.com/${se??"you"}/${be}`,an=se===void 0||Ae||We,xn=r==="paper"&&!M&&T.trim().length>=3&&dt===T.trim()&&!ht&&qt.length===0&&!b;return f.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-normal [&_.repo-hint]:text-sm [&_.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-start [&_.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-control-subtle [&_.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-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.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]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-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-danger-notice-border [&_.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-start [&_.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-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.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-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_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 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:_t,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>He("blank"),children:Cit()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>He("folder"),children:fat()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>He("paper"),children:Eat()})]}),r==="paper"&&!M&&f.jsxs("label",{className:"!font-normal",children:[dot(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:T,onChange:Nt=>{x(null),j(Nt.target.value)},placeholder:Rot()}),!xn&&f.jsx("span",{className:"repo-hint",children:ht?alt():Vct()}),xn&&f.jsx("span",{className:"project-path-notice block",children:Vat()}),qt.length>0&&f.jsx("div",{className:"paper-results",children:qt.map(Nt=>f.jsxs("button",{type:"button",onClick:()=>void me(Nt.paperId),children:[f.jsx(L0,{children:Nt.title}),f.jsx("span",{className:"id",children:Nt.paperId})]},Nt.paperId))})]}),M&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(L0,{className:"block",children:M.title||M.paperId}),M.repoUrl&&f.jsx("div",{className:"id",children:mSn(M.repoUrl)})]}),f.jsx(Oe,{size:"small",type:"button","aria-label":Vit(),onClick:Te,children:Bit()})]}),!M.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(pS,{size:16})," ",Jat()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:aot()})]})]}),(r!=="paper"||M)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oz()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:Nt=>{c(!0),a(Nt.target.value)},placeholder:az()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:M!=null&&M.repoUrl?Pst():tw()}),f.jsx("input",{className:"text-sm font-normal",value:B,onChange:Nt=>{p(!0),h(Nt.target.value)},"aria-describedby":Mn?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),ne&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iz()}),Mn&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:_s})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?yst({path:Ce(u)}):nz(),disabled:m,title:u||void 0,onClick:()=>void nt(),children:[f.jsx(Ou,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?Mst():u||nz()}),f.jsx(Wa,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:tw()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:Nt=>{p(!0),h(Nt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:tw()}),f.jsx("input",{className:"text-sm font-normal",value:B,onChange:Nt=>{p(!0),h(Nt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":mr?"blank-destination-description":void 0,spellCheck:!1}),ne&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iz()}),mr&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:gr})]}):null,r!=="blank"&&B&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oz()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:Nt=>{c(!0),a(Nt.target.value)},placeholder:az()})]}),At&&f.jsx("div",{className:"project-path-notice error",children:Mat()}),!At&&r==="folder"&&u.trim()&&!ne&&(U==null?void 0:U.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:Vot()}),!At&&r==="folder"&&u.trim()&&!ne&&_n&&f.jsx("div",{className:"project-path-notice error",children:act()}),!At&&r==="folder"&&!ne&&(U==null?void 0:U.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:Jit()}),!At&&r==="folder"&&!ne&&(U==null?void 0:U.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:Jot()}),K&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:K})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||M)&&B&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${z&&se===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(Nt=>!Nt),children:[z?se===null?Jrt():ast():YD(),f.jsx(ac,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:z,onChange:Nt=>E(Nt.target.checked),disabled:k}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:Bot()})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:an?dct({repository:Ce(fn)}):Ne?Nct({repository:Ce(fn)}):yct({repository:Ce(fn)})}),f.jsx("span",{children:bat()}),se===null&&f.jsx("span",{children:Jct({command:Ce("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Oe,{type:"button",onClick:n,children:Rit()}),f.jsx(Oe,{variant:"primary",className:"ms-auto",disabled:!Et,children:k?ait():r==="paper"?M!=null&&M.repoUrl?Kst():rz():r==="folder"?dlt():rz()})]})]})}function m$({onClose:e,onCreated:n,remote:t=!1}){const r=A.useRef(null),s=A.useRef(e);return s.current=e,A.useEffect(()=>{const i=r.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"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const c=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.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 h=o();if(h.length===0){u.preventDefault(),i.focus();return}const _=h[0],p=h[h.length-1];u.shiftKey&&document.activeElement===_?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),_.focus())};return document.addEventListener("keydown",c,!0),()=>{document.removeEventListener("keydown",c,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:oL()}),f.jsx(gSn,{onCancel:e,onCreated:n,remote:t})]})})}function vSn({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=A.useRef(null),a=A.useRef(r),o=A.useRef(n);a.current=r,o.current=n,A.useEffect(()=>{const u=i.current;if(!u)return;const h=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(_()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const w=_();if(w.length===0){m.preventDefault(),u.focus();return}const k=w[0],v=w[w.length-1];m.shiftKey&&document.activeElement===k?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),k.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),h==null||h.focus()}},[]);const c=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:Nwt()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:K2t({name:ia(e.name)})}),f.jsx("p",{className:"m-0",children:c?e4t():o4t()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Oe,{disabled:n,onClick:r,children:dwt()}),f.jsx(Oe,{variant:"danger",disabled:n,onClick:s,children:n?Fwt():Owt()})]})]})})}function Aj(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function bSn({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=A.useState(!1),[o,c]=A.useState(null),[u,h]=A.useState(null),[_,p]=A.useState(null),m=ut(own()),w=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function k(v){c(v.id),h(null);try{await cyn(v.id),h(null),p(null),r(v.id)}catch(b){h(b instanceof Error?b.message:String(b))}finally{c(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:O4t()}),f.jsxs(Oe,{onClick:()=>a(!0),children:[f.jsx($h,{size:15})," ",oL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:N4t()}),f.jsx("span",{children:gz()}),f.jsx("span",{children:vz()}),f.jsx("span",{children:bz()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:y4t()}):[...e].sort((v,b)=>{var C,z;const x=((C=w[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((z=w[b.id])==null?void 0:z.lastMessageAt)??b.createdAt)-x||v.name.localeCompare(b.name)}).map(v=>{const b=w[v.id],x=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=x?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:x.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):zv(),C=b?b.activeAgents>0?M2t({count:tn(b.activeAgents)}):K4t():"—",z=b?b.totalAgents===1?a3t():P2t({count:tn(b.totalAgents)}):"—",E=b?b.runningExperiments>0?d3t({count:tn(b.runningExperiments)}):b.totalExperiments===0?nS():yz({count:tn(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?yz({count:tn(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":rZ({name:ia(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[ywt()," ",wo(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[awt()," ",Ce(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":o3({name:ia(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),h(null),p(v)},children:f.jsx(Ef,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gz()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Aj,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:z})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vz()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Aj,{}),E]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:bz()}),x?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:x,target:"_blank",rel:"noreferrer","aria-label":Cv({name:ia(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(Gb,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ce(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(m$,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),_&&f.jsx(vSn,{project:_,deleting:o===_.id,error:u,onClose:()=>{h(null),p(null)},onConfirm:()=>void k(_)})]})}function g$(){const e=A.useSyncExternalStore(nwn,Zz,Zz);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":f3()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(pS,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:f3()})]})]})}function ySn({onClose:e,onConfigureSsh:n}){var v,b,x;const t=dn({mutationFn:y=>uxn(...y)}),r=ut(iI()),s=ut(A2n()),i=((v=r.data)==null?void 0:v.hosts)??null,a=s.data??[],[o,c]=A.useState(""),u=i?null:((b=r.error)==null?void 0:b.message)??((x=s.error)==null?void 0:x.message)??null,[h,_]=A.useState(null),p=A.useRef(null);Nm(p,e);async function m(y){const C=window.open("/remote-launch","_blank");if(!C){bn(HSt(),"error");return}_(y);try{const z=await t.mutateAsync([y,{theme:hwn(),locale:N()}]);C.location.replace(z.gatewayUrl),e()}catch(z){C.close(),bn(z instanceof Error?z.message:String(z),"error")}finally{_(null)}}const w=i==null?void 0:i.filter(y=>y.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),k=new Map(a.map(y=>[y.host,y]));return Fi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Ft,{className:"absolute end-3.5 top-3.5","aria-label":y5t(),onClick:e,children:f.jsx(_r,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:p3()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:N5t()}),f.jsx(Ur,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:y=>c(y.target.value),placeholder:kz(),"aria-label":kz()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",CL()]}):(w==null?void 0:w.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:hSt()}):w==null?void 0:w.map(y=>{const C=k.get(y.host);return f.jsxs(Oe,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:h===y.host,onClick:()=>void m(y.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:y.host}),h===y.host?f.jsx(jt,{}):C?f.jsx("span",{className:"text-sm text-subtext",children:zSt()}):null]},y.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(Oe,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(ZI,{size:15}),DL()]})})]})}),document.body)}function Fv({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}const xSn="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",wSn="/assets/ollama-logo-Bt9O-2K_.png",kSn="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",v$={id:"lmstudio",label:"LM Studio",icon:xSn,url:"http://127.0.0.1:1234/v1"},Z1=[v$,{id:"omlx",label:"oMLX",icon:kSn,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:wSn,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function b$({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var V,Z;const s=ut({...P2n(),enabled:!t}),i=ut(Mu()),a=(V=i.data)==null?void 0:V.find(Y=>Y.id==="opencode"),[o,c]=A.useState(t),u=()=>{c(!1),r==null||r()},[h,_]=A.useState("lmstudio"),p=Z1.find(Y=>Y.id===h)??v$,[m,w]=A.useState({}),k=m[p.id]??{baseUrl:p.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:v,models:b,model:x,contextWindow:y,error:C}=k,z=p.id==="ollama"?"":k.apiKey,E=Y=>{w(B=>({...B,[p.id]:{...B[p.id]??k,...Y}}))},T=dn({mutationFn:b2n}),j=dn({mutationFn:async Y=>{var F;const B=await y2n(Y);if(!((F=(await af(!0)).find(U=>U.id==="opencode"))!=null&&F.models.some(U=>U.id===B.model)))throw new Error(wJe());return B}}),M=dn({mutationFn:w2n}),D=Number(y),I=T.isPending||j.isPending,$=(Y={})=>E({models:[],model:null,error:null,...Y}),q=async()=>{$();try{const Y=await T.mutateAsync({baseUrl:v.trim(),apiKey:z});E({models:Y.models,model:Y.models[0]??null})}catch(Y){E({error:Y instanceof Error?Y.message:String(Y)})}},H=async()=>{if(x){E({error:null});try{const Y=await j.mutateAsync({name:p.label,baseUrl:v.trim(),apiKey:z,model:x,contextWindow:D});u(),n==null||n(Y.model)}catch(Y){E({error:Y instanceof Error?Y.message:String(Y)})}}},Q=async Y=>{try{await M.mutateAsync(Y)}catch(B){bn(B instanceof Error?B.message:String(B),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":ZN(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:ZN()}),f.jsxs(Oe,{disabled:I,onClick:()=>c(!0),"aria-haspopup":"dialog",children:[f.jsx($h,{size:14}),VD()]})]}),s.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:s.error.message}),f.jsx("div",{className:"space-y-3",children:(Z=s.data)==null?void 0:Z.map(Y=>f.jsx(SSn,{connection:Y,harnessReady:(a==null?void 0:a.agentReady)??!1,availableModels:(a==null?void 0:a.models.map(B=>B.id))??[],checking:i.isFetching||((a==null?void 0:a.catalogPending)??!1),unknown:i.isError||!i.data,disabled:I||M.isPending,onRemove:()=>void Q(Y.id)},Y.id))})]}),o&&f.jsx(CSn,{busy:I,onClose:u,footer:f.jsxs(Oe,{variant:"primary",disabled:I||!e||b.length>0&&(!x||!Number.isSafeInteger(D)||D<4096),onClick:()=>void(b.length>0?H():q()),children:[I&&f.jsx(jt,{}),b.length>0?Ret():lJe()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:get()}),f.jsx(mh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:uet()})]}),f.jsx(ec,{choices:Z1,value:h,title:YN(),header:YN(),variant:"field",floating:!0,dropDown:!0,disabled:I,renderLabel:Y=>f.jsxs(f.Fragment,{children:[Y.id==="openai-compatible"?Xk():Y.label,Y.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:KD()})]}),renderIcon:Y=>{var L;const B=(L=Z1.find(F=>F.id===Y.id))==null?void 0:L.icon;return B?f.jsx("img",{src:B,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${Y.id==="ollama"?" dark:invert":""}`}):f.jsx(KI,{size:14,className:"shrink-0"})},onSelect:_}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:nJe()}),f.jsx(Ur,{value:v,disabled:I,onChange:Y=>{$({baseUrl:Y.target.value})}})]}),p.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:pL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:p.id==="lmstudio"?Yet():Cet()}),f.jsx(Ur,{type:"password",autoComplete:"off",value:z,disabled:I,onChange:Y=>$({apiKey:Y.target.value})})]})]},p.id),b.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(ec,{choices:b.map(Y=>({id:Y,label:Y})),value:x,searchPlaceholder:XD(),title:d0(),header:d0(),variant:"field",floating:!0,dropDown:!0,disabled:I,onSelect:Y=>{E({model:Y})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:LJe()}),f.jsx(Ur,{type:"number",min:4096,step:1024,value:y,disabled:I,onChange:Y=>{E({contextWindow:Y.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:qJe()})]}),C&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:C})]})})]})}function SSn({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=dn({mutationFn:async()=>{try{await x2n(e.id)}finally{await af(!0)}}}),c=Z1.find(w=>w.label===e.name||w.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),h=u.length>0&&n&&u.every(w=>t.includes(`${e.id}/${w}`)),_=o.isPending||r,p=s,m=h;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[c!=null&&c.icon?f.jsx("img",{src:c.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${c.id==="ollama"?" dark:invert":""}`}):f.jsx(KI,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(c==null?void 0:c.id)==="openai-compatible"?Xk():(c==null?void 0:c.label)??e.name,(c==null?void 0:c.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:KD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Wt,{variant:_||p?"default":m?"success":"warning",children:_?ha():p?NL():m?jJe():go()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Oe,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Qa,{size:14}),Nv()]}),f.jsx(Ft,{"aria-label":net({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Ef,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function CSn({busy:e,onClose:n,footer:t,children:r}){const s=A.useRef(null),i=()=>{e||n()};return Nm(s,i,"input"),Fi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:VD()})}),f.jsx(Ft,{className:"absolute end-3.5 top-3.5","aria-label":rf(),onClick:i,disabled:e,children:f.jsx(_r,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Oe,{onClick:i,disabled:e,children:rf()}),t]})]})}),document.body)}const y$=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Rj=["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-sm text-muted"].join(" "),hu={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor",antigravity:"Google Antigravity"};function ESn(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:Rv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:Db(n,t).defaultId}}function Xa(e){const[n,t]=A.useState(!1),r=A.useRef(null);return A.useEffect(()=>{if(!n)return;const s=a=>{var o,c;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((c=e==null?void 0:e.current)!=null&&c.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function NSn({value:e,onSelect:n,onOpenSettings:t,permissionChoices:r=[],defaultPermissionId:s,onSelectPermission:i,reasoningChoices:a=[],defaultReasoningId:o,onSelectReasoning:c,lockHarness:u=!1,openRequest:h=0,className:_}){var ce,pe,be,Ae,De,We,Ne;const{data:p=zSn}=ut(Mu()),m=xm(),[w,k]=A.useState(!1),v=A.useRef(null),b=A.useRef(null),{open:x,setOpen:y,ref:C}=Xa(v),[z,E]=A.useState(""),[T,j]=A.useState("root"),M=()=>{y(!1),j("root"),E("")},D=A.useRef(h);A.useEffect(()=>{h!==D.current&&(D.current=h,j("models"),E(""),y(!0))},[h,y]),A.useEffect(()=>{var xe;x&&(T==="reasoning"||T==="speed"||T==="permissions")&&((xe=b.current)==null||xe.focus())},[x,T]);const I=A.useMemo(()=>{const xe=z.trim().toLowerCase();return(u&&e?p.filter(Ze=>Ze.id===e.harness):p).map(Ze=>{let ct=Ze.models;return xe?ct=ct.filter(Ct=>`${Ct.id} ${K1(Ct)}`.toLowerCase().includes(xe)):(Ze.id==="opencode"||Ze.id==="cursor"||Ze.id==="antigravity")&&(ct=ct.slice(0,5)),{harness:Ze,models:ct,hidden:xe?0:Ze.models.length-ct.length}})},[p,z,u,e]),$=(xe,rt)=>{var ct;const Ze=(e==null?void 0:e.harness)===xe.id;n({harness:xe.id,model:rt,serviceTier:Rv(xe,rt,Ze?e==null?void 0:e.serviceTier:null),permissionMode:Ze?e.permissionMode:((ct=xe.options)==null?void 0:ct.defaultPermissionMode)??null,reasoningLevel:nI(xe,rt,Ze?e.reasoningLevel:null)}),M()},q=(e==null?void 0:e.model)!=null?(ce=p.find(xe=>xe.id===e.harness))==null?void 0:ce.models.find(xe=>xe.id===e.model):void 0,H=e?e.model?q?K1(q):C3(e.model):JN():d0(),Q=(e==null?void 0:e.reasoningLevel)??o??((pe=a[0])==null?void 0:pe.id),V=(be=a.find(xe=>xe.id===Q))==null?void 0:be.label,Z=(e==null?void 0:e.permissionMode)??s??((Ae=r[0])==null?void 0:Ae.id),Y=(De=r.find(xe=>xe.id===Z))==null?void 0:De.label,B=(e==null?void 0:e.harness)==="opencode"?Mrt():pnt(),L=p.find(xe=>xe.id===(e==null?void 0:e.harness)),F=tI(L,e==null?void 0:e.model),U=Rv(L,e==null?void 0:e.model,e==null?void 0:e.serviceTier),K=(We=F.find(xe=>xe.id===U))==null?void 0:We.label,ne=xe=>{c==null||c(xe),M()},oe=xe=>{i==null||i(xe),M()},ue=xe=>{e&&n({...e,serviceTier:xe}),M()},se=(xe,rt,Ze)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>j(Ze),children:[f.jsx("span",{className:"flex-1",children:xe}),rt&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:rt}),f.jsx(Wa,{size:14,className:"shrink-0 text-muted"})]}),G=xe=>f.jsxs("div",{className:"flex shrink-0 items-center border-b border-border-variant px-1 py-1",children:[f.jsx(Ft,{ref:b,type:"button",size:"small",className:"model-submenu-header","aria-label":aL(),onClick:()=>{j("root"),E("")},children:f.jsx(BI,{size:15})}),f.jsx("span",{className:"min-w-0 flex-1 text-sm font-medium text-text",children:xe}),T==="models"&&f.jsx(Ft,{type:"button",size:"small","aria-label":v3(),onClick:()=>{M(),t()},children:f.jsx(xS,{size:15,"aria-hidden":"true"})})]}),ae=(xe,rt,Ze,ct)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:xe.map(Ct=>f.jsxs(Dn,{onClick:()=>ct(Ct.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[Ct.label,Ct.id===Ze&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",QD()]})]}),Ct.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:Ct.description})]}),Ct.id===rt&&f.jsx(Pi,{size:13})]},Ct.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:C,children:[f.jsxs("button",{ref:v,type:"button",className:ys("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",_),title:lX({label:`${H}${V?` · ${V}`:""}${K?` · ${K}`:""}`}),"aria-haspopup":"menu","aria-expanded":x,onClick:()=>{x?M():(j("root"),y(!0))},children:[U==="priority"?f.jsx(ckn,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(bh,{harness:e.harness,size:14}):null,U==="priority"&&f.jsxs("span",{className:"sr-only",children:[wnt()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[H,V&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:V})]}),f.jsx(ac,{size:14,className:"shrink-0 text-muted"})]}),x&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-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:[T==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[se(d0(),H,"models"),a.length>0&&se(B,V,"reasoning"),F.length>0&&se(tz(),K,"speed"),r.length>0&&se(ez(),Y,"permissions")]}),T==="models"&&f.jsxs(f.Fragment,{children:[G(d0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:XD(),value:z,onChange:xe=>E(xe.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[I.map(({harness:xe,models:rt,hidden:Ze})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:y$,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(bh,{harness:xe.id,size:14}),xe.name]}),!xe.agentReady&&f.jsx("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:xe.catalogPending?nf():f.jsxs(f.Fragment,{children:[f.jsx(pj,{size:10})," ",go()]})})]}),xe.agentReady?f.jsxs(f.Fragment,{children:[xe.models.length===0&&f.jsxs(Dn,{onClick:()=>$(xe,null),children:[f.jsxs("span",{children:[JN(),f.jsx("span",{className:"model-id",children:WD()})]}),(e==null?void 0:e.harness)===xe.id&&(e==null?void 0:e.model)===null&&f.jsx(Pi,{size:13})]}),rt.map(ct=>f.jsxs(Dn,{title:ct.id,onClick:()=>$(xe,ct.id),children:[f.jsx("span",{children:K1(ct)}),(e==null?void 0:e.harness)===xe.id&&(e==null?void 0:e.model)===ct.id&&f.jsx(Pi,{size:13})]},ct.id)),z.trim().length>0&&!xe.models.some(ct=>ct.id===z.trim())&&f.jsx(Dn,{onClick:()=>$(xe,z.trim()),children:f.jsx("span",{children:Ert({id:Ce(z.trim())})})})]}):f.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-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:xe.catalogPending?nf():xe.agentNote?vh(xe.agentNote):Wnt()}),xe.id==="opencode"&&f.jsx(Dn,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var ct;M(),(ct=v.current)==null||ct.focus(),k(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[Itt(),f.jsx($h,{size:14,"aria-hidden":"true"})]})}),xe.agentReady&&Ze>0&&f.jsx("div",{className:Rj,children:Fnt({count:tn(Ze)})})]},xe.id)),p.length===0&&f.jsx("div",{className:Rj,children:cnt()})]}),u&&e&&p.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(pj,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),ort()]})]}),T==="reasoning"&&f.jsxs(f.Fragment,{children:[G(B),ae(a,Q,o,ne)]}),T==="permissions"&&f.jsxs(f.Fragment,{children:[G(ez()),ae(r,Z,s,oe)]}),T==="speed"&&f.jsxs(f.Fragment,{children:[G(tz()),ae(F,U??void 0,"default",ue)]})]}),w&&f.jsx(b$,{dialogOnly:!0,installed:((Ne=p.find(xe=>xe.id==="opencode"))==null?void 0:Ne.installed)??!1,onClose:()=>k(!1),onConnected:xe=>{var Ze;const rt=(Ze=m.getQueryData(Mu().queryKey))==null?void 0:Ze.find(ct=>ct.id==="opencode");rt&&(!u||(e==null?void 0:e.harness)==="opencode")&&$(rt,xe)}})]})}function ec({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:c,numbered:u=!1,searchPlaceholder:h,renderIcon:_,renderLabel:p,floating:m=!1,onSelect:w,className:k}){var Q,V;const v=A.useRef(null),{open:b,setOpen:x,ref:y}=Xa(v),C=A.useRef(null),[z,E]=A.useState("");if(A.useLayoutEffect(()=>{var L;const Z=C.current,Y=y.current;if(!b||!m||!Z||!Y)return;Z.matches(":popover-open")||(Z.showPopover(),(L=Z.querySelector("input"))==null||L.focus());const B=()=>{const F=Y.getBoundingClientRect(),U=window.innerHeight-F.bottom-12,K=F.top-12,ne=Math.min(380,Z.scrollHeight),oe=i?U>=ne||U>=K:KK;Z.style.width=`${F.width}px`,Z.style.minWidth="0",Z.style.maxHeight=`${Math.max(0,Math.min(380,oe?U:K))}px`,Z.style.left=`${F.left}px`,Z.style.top=`${oe?F.bottom+4:F.top-Z.getBoundingClientRect().height-4}px`};return B(),window.addEventListener("resize",B),window.addEventListener("scroll",B,!0),()=>{window.removeEventListener("resize",B),window.removeEventListener("scroll",B,!0)}},[b,m,i,z,e.length,y]),e.length===0)return null;const T=n??t??((Q=e[0])==null?void 0:Q.id)??null,j=e.find(Z=>Z.id===T),M=e.find(Z=>Z.id===t),D=o==="bare"&&(M==null?void 0:M.id)===Av?M:void 0,$=(D?e.filter(Z=>Z.id!==D.id):e).filter(Z=>`${Z.label} ${Z.id}`.toLowerCase().includes(z.toLowerCase())),q=(j==null?void 0:j.label)??((V=e[0])==null?void 0:V.label)??"",H=Z=>{var Y;w(Z),x(!1),(Y=v.current)==null||Y.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:ys(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,k),title:c,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{E(""),x(Z=>!Z)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(_==null?void 0:_(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??q:q})]}),f.jsx(ac,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(Z=>Z.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:y$,children:r}),h&&f.jsx("input",{autoFocus:!0,"aria-label":h,placeholder:h,value:z,onChange:Z=>E(Z.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[D&&f.jsxs(f.Fragment,{children:[f.jsxs(Dn,{type:"button",onClick:()=>H(D.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[_==null?void 0:_(D),f.jsxs("span",{children:[(p==null?void 0:p(D))??D.label,f.jsx("span",{className:"option-default text-muted font-normal",children:WD()})]})]}),T===D.id&&f.jsx(Pi,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((Z,Y)=>f.jsxs(Dn,{type:"button",onClick:()=>H(Z.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[_==null?void 0:_(Z),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(Z))??Z.label,!D&&Z.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",QD()]})]}),Z.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:Z.description})]})]}),T===Z.id?f.jsx(Pi,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:Y+1})]},Z.id))]})]})]})}const zSn=[];function G3({runtime:e,corner:n=!1}){const[t,r]=A.useState(!1),[s,i]=A.useState(!1),[a,o]=A.useState(!1),[c,u]=A.useState(null),h=Xa();async function _(){if(c){o(!0);try{await YL(c),u(null)}catch(p){u(null),bn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:h.ref,children:[h.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:J3t({host:Ce(e.session.host),user:Ce(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ce(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(Dn,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await QL(),h.setOpen(!1)}catch(p){bn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?V3t():m3()}),f.jsx(hS,{content:DSt(),className:"me-2 shrink-0 text-subtext",children:f.jsx(gS,{size:15})})]}),f.jsx(Dn,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await XL()),h.setOpen(!1)}catch(p){bn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:lL()})]}),n?f.jsxs(Oe,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":h.open,onClick:()=>h.setOpen(p=>!p),children:[f.jsx(Fv,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:rw({host:Ce(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Ft,{size:"small","aria-label":rw({host:Ce(e.session.host)}),"aria-haspopup":"menu","aria-expanded":h.open,onClick:()=>h.setOpen(p=>!p),children:f.jsx(Fv,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:rw({host:Ce(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ce(e.session.version??"…")]})]})]})]}),c&&f.jsx(DI,{host:e.session.host,preview:c,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void _()})]})}const Hv="code-source-text",x$="code-source-wrap",w$="file-view-gutter text-right text-muted select-none";function k$(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}const jSn={cjs:"javascript",console:"bash",cts:"typescript",fish:"bash",html:"markup",js:"javascript",jsx:"javascript",md:"markdown",mjs:"javascript",mts:"typescript",py:"python",rb:"ruby",sh:"bash",shell:"bash",svg:"markup",terminal:"bash",ts:"typescript",tsx:"typescript",xml:"markup",yml:"yaml",zsh:"bash"},TSn={containerfile:"docker",dockerfile:"docker",justfile:"makefile",makefile:"makefile"};function V3(e){const n=e.trim().toLowerCase();return jSn[n]??n}function MS(e){var s;if(!e)return null;const n=((s=e.split("/").pop())==null?void 0:s.toLowerCase())??"",t=TSn[n];if(t)return V3(t);const r=n.lastIndexOf(".");return r===-1||r===n.length-1?null:V3(n.slice(r+1))}oc.displayName="clike";oc.aliases=[];function oc(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}jm.displayName="c";jm.aliases=[];function jm(e){e.register(oc),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}Vb.displayName="cpp";Vb.aliases=[];function Vb(e){e.register(jm),(function(n){var t=/\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 t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.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:t,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/}),n.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}}),n.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:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}OS.displayName="arduino";OS.aliases=["ino"];function OS(e){e.register(Vb),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}DS.displayName="bash";DS.aliases=["sh","shell"];function DS(e){(function(n){var t="\\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},s={bash:r,environment:{pattern:RegExp("\\$"+t),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("(\\{)"+t),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})/};n.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;|&]|[<>]\\()"+t),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:s},{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:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.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=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(U,K){return"(?:"+F[+K]+")"})}function r(L,F,U){return RegExp(t(L,F),"")}function s(L,F){for(var U=0;U>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={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 a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),c=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),h=a(i.type+" "+i.typeDeclaration+" "+i.other),_=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,w=t(/<<0>>(?:\s*<<1>>)?/.source,[m,_]),k=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,w]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[k,v]),x=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[_,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,k,v]),z={keyword:c,punctuation:/[<>()?,.:[\]]/},E=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[k]),lookbehind:!0,inside:z},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,C]),lookbehind:!0,inside:z},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,w]),lookbehind:!0,inside:z},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[k]),lookbehind:!0,inside:z},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:z},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,h,m]),inside:z}],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:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),lookbehind:!0,alias:"class-name",inside:z},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,k]),inside:z,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:z,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,_]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(_),alias:"class-name",inside:z}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,w,m,C,c.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[w,p]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:c,"class-name":{pattern:RegExp(C),greedy:!0,inside:z},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 M=T+"|"+E,D=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),I=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[D]),2),$=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,q=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[k,I]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[$,q]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[$]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[I]),inside:n.languages.csharp},"class-name":{pattern:RegExp(k),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var H=/:[^}\r\n]+/.source,Q=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[D]),2),V=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Q,H]),Z=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),Y=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Z,H]);function B(L,F){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[F,H]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[V]),lookbehind:!0,greedy:!0,inside:B(V,Q)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[Y]),lookbehind:!0,greedy:!0,inside:B(Y,Z)}],char:{pattern:RegExp(E),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}Tm.displayName="markup";Tm.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function Tm(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(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\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:[t,"language-"+t],inside:e.languages[t]},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}Ph.displayName="css";Ph.aliases=[];function Ph(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.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\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,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:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}IS.displayName="diff";IS.aliases=[];function IS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r ?| -|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:t})})(e)}IS.displayName="go";IS.aliases=[];function IS(e){e.register(sc),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"]}$S.displayName="ini";$S.aliases=[];function $S(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:/=/}}BS.displayName="java";BS.aliases=[];function BS(e){e.register(sc),(function(n){var t=/\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,s={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:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.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/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.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":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.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 t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}PS.displayName="regex";PS.aliases=[];function PS(e){(function(n){var t={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]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,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}FS.displayName="json";FS.aliases=["webmanifest"];function FS(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}HS.displayName="kotlin";HS.aliases=["kt","kts"];function HS(e){e.register(sc),(function(n){n.languages.kotlin=n.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 n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}qS.displayName="less";qS.aliases=[];function qS(e){e.register(Bh),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"}})}US.displayName="lua";US.aliases=[];function US(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:/[\[\](){},;]|\.+|:+/}}GS.displayName="makefile";GS.aliases=[];function GS(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:/[:;(){}]/}}VS.displayName="yaml";VS.aliases=["yml"];function VS(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\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}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,u){u=(u||"").replace(/m/g,"")+"m";var h=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return c});return RegExp(h,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}KS.displayName="markdown";KS.aliases=["md"];function KS(e){e.register(jm),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.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:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.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(o){["url","bold","italic","strike","code-snippet"].forEach(function(c){o!==c&&(n.languages.markdown[o].inside.content.inside[c]=n.languages.markdown[c])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function c(u){if(!(!u||typeof u=="string"))for(var h=0,_=u.length;h<_;h++){var p=u[h];if(p.type!=="code"){c(p.content);continue}var m=p.content[1],x=p.content[3];if(m&&x&&m.type==="code-language"&&x.type==="code-block"&&typeof m.content=="string"){var k=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");k=(/[a-z][\w-]*/i.exec(k)||[""])[0].toLowerCase();var v="language-"+k;x.alias?typeof x.alias=="string"?x.alias=[x.alias,v]:x.alias.push(v):x.alias=[v]}}}c(o.tokens)}),n.hooks.add("wrap",function(o){if(o.type==="code-block"){for(var c="",u=0,h=o.classes.length;u]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}QS.displayName="perl";QS.aliases=[];function QS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.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,t].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,t].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,t+/\s*/.source+t].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)}Vb.displayName="markup-templating";Vb.aliases=[];function Vb(e){e.register(jm),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(c){if(typeof a=="function"&&!a(c))return c;for(var u=o.length,h;r.code.indexOf(h=t(s,u))!==-1;)++u;return o[u]=c,h}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(c){for(var u=0;u=a.length);u++){var h=c[u];if(typeof h=="string"||h.content&&typeof h.content=="string"){var _=a[i],p=r.tokenStack[_],m=typeof h=="string"?h:h.content,x=t(s,_),k=m.indexOf(x);if(k>-1){++i;var v=m.substring(0,k),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),w=m.substring(k+x.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),w&&y.push.apply(y,o([w])),typeof h=="string"?c.splice.apply(c,[u,1].concat(y)):h.content=y}}else h.content&&o(h.content)}return c}o(r.tokens)}}})})(e)}XS.displayName="php";XS.aliases=[];function XS(e){e.register(Vb),(function(n){var t=/\/\*[\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*\()/],s=/\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,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,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:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.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:t,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:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var h=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",h)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}YS.displayName="python";YS.aliases=["py"];function YS(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}ZS.displayName="r";ZS.aliases=[];function ZS(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:/[(){}\[\],;]/}}JS.displayName="ruby";JS.aliases=["rb"];function JS(e){e.register(sc),(function(n){n.languages.ruby=n.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:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.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("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.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:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,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:t,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:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.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)/}),n.languages.rb=n.languages.ruby})(e)}e6.displayName="rust";e6.aliases=[];function e6(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}t6.displayName="sass";t6.aliases=[];function t6(e){e.register(Bh),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.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)}n6.displayName="scss";n6.aliases=[];function n6(e){e.register(Bh),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}r6.displayName="sql";r6.aliases=[];function r6(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:/[;[\]()`,.]/}}s6.displayName="swift";s6.aliases=[];function s6(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(n){n.inside.interpolation.inside=e.languages.swift})}i6.displayName="typescript";i6.aliases=["ts"];function i6(e){e.register(Gb),(function(n){n.languages.typescript=n.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/}),n.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 n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.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:t}}}}),n.languages.ts=n.languages.typescript})(e)}Kb.displayName="basic";Kb.aliases=[];function Kb(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:/[,;:()]/}}a6.displayName="vbnet";a6.aliases=[];function a6(e){e.register(Kb),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:/[,;:(){}]/})}class Tm{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Tm.prototype.normal={};Tm.prototype.property={};Tm.prototype.space=void 0;function x$(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new Tm(t,r,n)}function L0(e){return e.toLowerCase()}class Oi{constructor(n,t){this.attribute=t,this.property=n}}Oi.prototype.attribute="";Oi.prototype.booleanish=!1;Oi.prototype.boolean=!1;Oi.prototype.commaOrSpaceSeparated=!1;Oi.prototype.commaSeparated=!1;Oi.prototype.defined=!1;Oi.prototype.mustUseProperty=!1;Oi.prototype.number=!1;Oi.prototype.overloadedBoolean=!1;Oi.prototype.property="";Oi.prototype.spaceSeparated=!1;Oi.prototype.space=void 0;let ykn=0;const Qt=xf(),cs=xf(),G3=xf(),Qe=xf(),cr=xf(),H_=xf(),Vi=xf();function xf(){return 2**++ykn}const V3=Object.freeze(Object.defineProperty({__proto__:null,boolean:Qt,booleanish:cs,commaOrSpaceSeparated:Vi,commaSeparated:H_,number:Qe,overloadedBoolean:G3,spaceSeparated:cr},Symbol.toStringTag,{value:"Module"})),pw=Object.keys(V3);class o6 extends Oi{constructor(n,t,r,s){let i=-1;if(super(n,t),Aj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&Ckn.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(Rj,Nkn);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!Rj.test(i)){let a=i.replace(Skn,Ekn);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=o6}return new s(r,n)}function Ekn(e){return"-"+e.toLowerCase()}function Nkn(e){return e.charAt(1).toUpperCase()}const j$=x$([w$,xkn,C$,E$,N$],"html"),Wb=x$([w$,wkn,C$,E$,N$],"svg");function Mj(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function zkn(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Oj=/[#.]/g;function jkn(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function $kn(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function Bkn(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function $j(e){return Bkn(e)||R$(e)}const Bj=document.createElement("i");function I0(e){const n="&"+e+";";Bj.innerHTML=n;const t=Bj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const Pkn=["","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 Fkn(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",c,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,c=t.position.start):c=t.position);let h=(c?c.line:0)||1,_=(c?c.column:0)||1,p=x(),m;for(i--;++i<=e.length;)if(m===10&&(_=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),_++;continue}const w=i+1;let y=w,C=w,N;if(b===35){C=++y;const q=e.charCodeAt(C);q===88||q===120?(N="hexadecimal",C=++y):N="decimal"}else N="named";let z="",T="",j="";const M=N==="named"?$j:N==="decimal"?R$:$kn;for(C--;++C<=e.length;){const q=e.charCodeAt(C);if(!M(q))break;j+=String.fromCharCode(q),N==="named"&&Ikn.includes(j)&&(z=j,T=I0(j))}let D=e.charCodeAt(C)===59;if(D){C++;const q=N==="named"?I0(j):!1;q&&(z=j,T=q)}let I=1+C-w,$="";if(!(!D&&t.nonTerminated===!1))if(!j)N!=="named"&&k(4,I);else if(N==="named"){if(D&&!T)k(5,1);else if(z!==j&&(C=y+z.length,I=1+C-y,D=!1),!D){const q=z?1:3;if(t.attribute){const H=e.charCodeAt(C);H===61?(k(q,I),T=""):$j(H)?T="":k(q,I)}else k(q,I)}$=T}else{D||k(2,I);let q=Number.parseInt(j,N==="hexadecimal"?16:10);if(Hkn(q))k(7,I),$="�";else if(q in Ij)k(6,I),$=Ij[q];else{let H="";qkn(q)&&k(6,I),q>65535&&(q-=65536,H+=String.fromCharCode(q>>>10|55296),q=56320|q&1023),$=H+String.fromCharCode(q)}}if($){v(),p=x(),i=C-1,_+=C-w+1,s.push($);const q=x();q.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,$,{start:p,end:q},e.slice(w-1,C)),p=q}else j=e.slice(w-1,C),o+=j,_+=j.length,i=C-1}else m===10&&(h++,a++,_=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),_++);return s.join("");function x(){return{line:h,column:_,offset:i+((c?c.offset:0)||0)}}function k(b,w){let y;t.warning&&(y=x(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,Pkn[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:x()}),o="")}}function Hkn(e){return e>=55296&&e<=57343||e>1114111}function qkn(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 Ukn=0,u1={},Cs={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Ukn}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Cs.util.type(n)){case"Object":if(s=Cs.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Cs.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:u1,plaintext:u1,text:u1,txt:u1,extend:function(e,n){var t=Cs.util.clone(Cs.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Cs.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var c=r[e];return r[e]=i,Cs.languages.DFS(Cs.languages,function(u,h){h===c&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Cs.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],c=Cs.util.type(o);c==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):c==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Cs.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Cs.tokenize(r.code,r.grammar),Cs.hooks.run("after-tokenize",r),h0.stringify(Cs.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new Gkn;return J1(s,s.head,e),M$(e,s,n,s.head,0),Kkn(s)},hooks:{all:{},add:function(e,n){var t=Cs.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Cs.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:h0};function h0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function Pj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function M$(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var c=0;c=i.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof h0)){var y=1,C;if(p){if(C=Pj(k,b,e,_),!C||C.index>=e.length)break;var j=C.index,N=C.index+C[0].length,z=b;for(z+=v.value.length;j>=z;)v=v.next,z+=v.value.length;if(z-=v.value.length,b=z,v.value instanceof h0)continue;for(var T=v;T!==n.tail&&(zi.reach&&(i.reach=$);var q=v.prev;D&&(q=J1(n,q,D),b+=D.length),Vkn(n,q,y);var H=new h0(a,h?Cs.tokenize(M,h):M,m,M);if(v=J1(n,q,H),I&&J1(n,v,I),y>1){var Q={cause:a+","+c,reach:$};M$(e,n,t,v.prev,b,Q),i&&Q.reach>i.reach&&(i.reach=Q.reach)}}}}}}function Gkn(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function J1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function Vkn(e,n,t){for(var r=n.next,s=0;st)return null;try{return Dt.highlight(e,n).children}catch{return null}}function I$(e,n){var t;return e.type==="text"?e.value??"":e.type!=="element"?null:f.jsx("span",{className:(((t=e.properties)==null?void 0:t.className)??[]).join(" "),children:(e.children??[]).map(I$)},n)}function tSn(e,n,t=3e5){var r;return((r=L$(e,n,t))==null?void 0:r.map(I$))??e}function $$(e,n,t=3e5){const r=L$(e,n,t);if(!r)return e.split(` +|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:t})})(e)}$S.displayName="go";$S.aliases=[];function $S(e){e.register(oc),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"]}BS.displayName="ini";BS.aliases=[];function BS(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:/=/}}PS.displayName="java";PS.aliases=[];function PS(e){e.register(oc),(function(n){var t=/\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,s={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:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.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/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.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":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.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 t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}FS.displayName="regex";FS.aliases=[];function FS(e){(function(n){var t={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]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,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}HS.displayName="json";HS.aliases=["webmanifest"];function HS(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}qS.displayName="kotlin";qS.aliases=["kt","kts"];function qS(e){e.register(oc),(function(n){n.languages.kotlin=n.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 n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}US.displayName="less";US.aliases=[];function US(e){e.register(Ph),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"}})}GS.displayName="lua";GS.aliases=[];function GS(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:/[\[\](){},;]|\.+|:+/}}VS.displayName="makefile";VS.aliases=[];function VS(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:/[:;(){}]/}}KS.displayName="yaml";KS.aliases=["yml"];function KS(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\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}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,u){u=(u||"").replace(/m/g,"")+"m";var h=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return c});return RegExp(h,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}WS.displayName="markdown";WS.aliases=["md"];function WS(e){e.register(Tm),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.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:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.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(o){["url","bold","italic","strike","code-snippet"].forEach(function(c){o!==c&&(n.languages.markdown[o].inside.content.inside[c]=n.languages.markdown[c])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function c(u){if(!(!u||typeof u=="string"))for(var h=0,_=u.length;h<_;h++){var p=u[h];if(p.type!=="code"){c(p.content);continue}var m=p.content[1],w=p.content[3];if(m&&w&&m.type==="code-language"&&w.type==="code-block"&&typeof m.content=="string"){var k=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");k=(/[a-z][\w-]*/i.exec(k)||[""])[0].toLowerCase();var v="language-"+k;w.alias?typeof w.alias=="string"?w.alias=[w.alias,v]:w.alias.push(v):w.alias=[v]}}}c(o.tokens)}),n.hooks.add("wrap",function(o){if(o.type==="code-block"){for(var c="",u=0,h=o.classes.length;u]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}XS.displayName="perl";XS.aliases=[];function XS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.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,t].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,t].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,t+/\s*/.source+t].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)}Wb.displayName="markup-templating";Wb.aliases=[];function Wb(e){e.register(Tm),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(c){if(typeof a=="function"&&!a(c))return c;for(var u=o.length,h;r.code.indexOf(h=t(s,u))!==-1;)++u;return o[u]=c,h}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(c){for(var u=0;u=a.length);u++){var h=c[u];if(typeof h=="string"||h.content&&typeof h.content=="string"){var _=a[i],p=r.tokenStack[_],m=typeof h=="string"?h:h.content,w=t(s,_),k=m.indexOf(w);if(k>-1){++i;var v=m.substring(0,k),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),x=m.substring(k+w.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),x&&y.push.apply(y,o([x])),typeof h=="string"?c.splice.apply(c,[u,1].concat(y)):h.content=y}}else h.content&&o(h.content)}return c}o(r.tokens)}}})})(e)}YS.displayName="php";YS.aliases=[];function YS(e){e.register(Wb),(function(n){var t=/\/\*[\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*\()/],s=/\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,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,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:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.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:t,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:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var h=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",h)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}ZS.displayName="python";ZS.aliases=["py"];function ZS(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}JS.displayName="r";JS.aliases=[];function JS(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:/[(){}\[\],;]/}}e6.displayName="ruby";e6.aliases=["rb"];function e6(e){e.register(oc),(function(n){n.languages.ruby=n.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:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.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("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.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:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,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:t,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:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.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)/}),n.languages.rb=n.languages.ruby})(e)}t6.displayName="rust";t6.aliases=[];function t6(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}n6.displayName="sass";n6.aliases=[];function n6(e){e.register(Ph),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.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)}r6.displayName="scss";r6.aliases=[];function r6(e){e.register(Ph),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}s6.displayName="sql";s6.aliases=[];function s6(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:/[;[\]()`,.]/}}i6.displayName="swift";i6.aliases=[];function i6(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(n){n.inside.interpolation.inside=e.languages.swift})}a6.displayName="typescript";a6.aliases=["ts"];function a6(e){e.register(Kb),(function(n){n.languages.typescript=n.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/}),n.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 n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.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:t}}}}),n.languages.ts=n.languages.typescript})(e)}Qb.displayName="basic";Qb.aliases=[];function Qb(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:/[,;:()]/}}o6.displayName="vbnet";o6.aliases=[];function o6(e){e.register(Qb),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:/[,;:(){}]/})}class Am{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Am.prototype.normal={};Am.prototype.property={};Am.prototype.space=void 0;function S$(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new Am(t,r,n)}function I0(e){return e.toLowerCase()}class Hi{constructor(n,t){this.attribute=t,this.property=n}}Hi.prototype.attribute="";Hi.prototype.booleanish=!1;Hi.prototype.boolean=!1;Hi.prototype.commaOrSpaceSeparated=!1;Hi.prototype.commaSeparated=!1;Hi.prototype.defined=!1;Hi.prototype.mustUseProperty=!1;Hi.prototype.number=!1;Hi.prototype.overloadedBoolean=!1;Hi.prototype.property="";Hi.prototype.spaceSeparated=!1;Hi.prototype.space=void 0;let ASn=0;const en=zf(),is=zf(),K3=zf(),Qe=zf(),ur=zf(),X_=zf(),ra=zf();function zf(){return 2**++ASn}const W3=Object.freeze(Object.defineProperty({__proto__:null,boolean:en,booleanish:is,commaOrSpaceSeparated:ra,commaSeparated:X_,number:Qe,overloadedBoolean:K3,spaceSeparated:ur},Symbol.toStringTag,{value:"Module"})),gw=Object.keys(W3);class c6 extends Hi{constructor(n,t,r,s){let i=-1;if(super(n,t),Mj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&LSn.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(Oj,$Sn);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!Oj.test(i)){let a=i.replace(DSn,ISn);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=c6}return new s(r,n)}function ISn(e){return"-"+e.toLowerCase()}function $Sn(e){return e.charAt(1).toUpperCase()}const R$=S$([C$,RSn,z$,j$,T$],"html"),Xb=S$([C$,MSn,z$,j$,T$],"svg");function Dj(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function BSn(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Lj=/[#.]/g;function PSn(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function QSn(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function XSn(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function Pj(e){return XSn(e)||D$(e)}const Fj=document.createElement("i");function $0(e){const n="&"+e+";";Fj.innerHTML=n;const t=Fj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const YSn=["","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 ZSn(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",c,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,c=t.position.start):c=t.position);let h=(c?c.line:0)||1,_=(c?c.column:0)||1,p=w(),m;for(i--;++i<=e.length;)if(m===10&&(_=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),_++;continue}const x=i+1;let y=x,C=x,z;if(b===35){C=++y;const q=e.charCodeAt(C);q===88||q===120?(z="hexadecimal",C=++y):z="decimal"}else z="named";let E="",T="",j="";const M=z==="named"?Pj:z==="decimal"?D$:QSn;for(C--;++C<=e.length;){const q=e.charCodeAt(C);if(!M(q))break;j+=String.fromCharCode(q),z==="named"&&WSn.includes(j)&&(E=j,T=$0(j))}let D=e.charCodeAt(C)===59;if(D){C++;const q=z==="named"?$0(j):!1;q&&(E=j,T=q)}let I=1+C-x,$="";if(!(!D&&t.nonTerminated===!1))if(!j)z!=="named"&&k(4,I);else if(z==="named"){if(D&&!T)k(5,1);else if(E!==j&&(C=y+E.length,I=1+C-y,D=!1),!D){const q=E?1:3;if(t.attribute){const H=e.charCodeAt(C);H===61?(k(q,I),T=""):Pj(H)?T="":k(q,I)}else k(q,I)}$=T}else{D||k(2,I);let q=Number.parseInt(j,z==="hexadecimal"?16:10);if(JSn(q))k(7,I),$="�";else if(q in Bj)k(6,I),$=Bj[q];else{let H="";e6n(q)&&k(6,I),q>65535&&(q-=65536,H+=String.fromCharCode(q>>>10|55296),q=56320|q&1023),$=H+String.fromCharCode(q)}}if($){v(),p=w(),i=C-1,_+=C-x+1,s.push($);const q=w();q.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,$,{start:p,end:q},e.slice(x-1,C)),p=q}else j=e.slice(x-1,C),o+=j,_+=j.length,i=C-1}else m===10&&(h++,a++,_=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),_++);return s.join("");function w(){return{line:h,column:_,offset:i+((c?c.offset:0)||0)}}function k(b,x){let y;t.warning&&(y=w(),y.column+=x,y.offset+=x,t.warning.call(t.warningContext||void 0,YSn[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:w()}),o="")}}function JSn(e){return e>=55296&&e<=57343||e>1114111}function e6n(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 t6n=0,u1={},Ts={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t6n}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ts.util.type(n)){case"Object":if(s=Ts.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Ts.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:u1,plaintext:u1,text:u1,txt:u1,extend:function(e,n){var t=Ts.util.clone(Ts.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ts.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var c=r[e];return r[e]=i,Ts.languages.DFS(Ts.languages,function(u,h){h===c&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Ts.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],c=Ts.util.type(o);c==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):c==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ts.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ts.tokenize(r.code,r.grammar),Ts.hooks.run("after-tokenize",r),p0.stringify(Ts.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new n6n;return J1(s,s.head,e),L$(e,s,n,s.head,0),s6n(s)},hooks:{all:{},add:function(e,n){var t=Ts.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ts.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:p0};function p0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function Hj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function L$(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var c=0;c=i.reach);b+=v.value.length,v=v.next){var x=v.value;if(n.length>e.length)return;if(!(x instanceof p0)){var y=1,C;if(p){if(C=Hj(k,b,e,_),!C||C.index>=e.length)break;var j=C.index,z=C.index+C[0].length,E=b;for(E+=v.value.length;j>=E;)v=v.next,E+=v.value.length;if(E-=v.value.length,b=E,v.value instanceof p0)continue;for(var T=v;T!==n.tail&&(Ei.reach&&(i.reach=$);var q=v.prev;D&&(q=J1(n,q,D),b+=D.length),r6n(n,q,y);var H=new p0(a,h?Ts.tokenize(M,h):M,m,M);if(v=J1(n,q,H),I&&J1(n,v,I),y>1){var Q={cause:a+","+c,reach:$};L$(e,n,t,v.prev,b,Q),i&&Q.reach>i.reach&&(i.reach=Q.reach)}}}}}}function n6n(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function J1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function r6n(e,n,t){for(var r=n.next,s=0;st)return null;try{return It.highlight(e,n).children}catch{return null}}function P$(e,n){var t;return e.type==="text"?e.value??"":e.type!=="element"?null:f.jsx("span",{className:(((t=e.properties)==null?void 0:t.className)??[]).join(" "),children:(e.children??[]).map(P$)},n)}function f6n(e,n,t=3e5){var r;return((r=B$(e,n,t))==null?void 0:r.map(P$))??e}function F$(e,n,t=3e5){const r=B$(e,n,t);if(!r)return e.split(` `);const s=[];let i=[];const a=[];let o=0;const c=h=>{let _=h;for(let p=a.length-1;p>=0;p--)_=f.jsx("span",{className:a[p],children:_},o++);i.push(_)},u=h=>{var _;if(h.type==="text"){(h.value??"").split(` -`).forEach((p,m)=>{m>0&&(s.push(i),i=[]),p&&c(p)});return}h.type==="element"&&(a.push((((_=h.properties)==null?void 0:_.className)??[]).join(" ")),(h.children??[]).forEach(u),a.pop())};return r.forEach(u),s.push(i),s}function B$(e){return Array.isArray(e)?e.length===0:e===""}function P$({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:c,scrollPosition:u,onScrollPositionChange:h}){const _=A.useMemo(()=>$$(e,RS(i)),[e,i]),{ruleCh:p,codeCh:m}=y$(_.length),x=A.useRef(null),k=A.useRef(null),v=()=>{const C=x.current;C&&k.current&&(k.current.scrollTop=C.scrollTop)},b=A.useRef(u);A.useLayoutEffect(()=>{const C=x.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),A.useLayoutEffect(v,[e]),A.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const N=e.split(` -`),z=Math.min(Math.max(Math.trunc(a),1),N.length);let T=0;for(let D=0;D{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const N=C.currentTarget,{selectionStart:z,selectionEnd:T}=N,j=e.slice(0,z)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{N.selectionStart=N.selectionEnd=z+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${Fv} ${v$} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${Fv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:k,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:_.map((C,N)=>f.jsxs("div",{"data-line":N+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${b$} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:N+1}),B$(C)?f.jsx("br",{}):C]},N))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),h==null||h({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function F$({onClose:e,onSaved:n}){const t=vxn(),r=ct(t),[s,i]=A.useState(()=>r.data??null),[a,o]=A.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),c=!s&&r.error?r.error.message:null,u=an({mutationFn:({content:y,previous:C})=>Qbn(y,C)}),[h,_]=A.useState(!1),p=A.useRef(null),m=A.useRef(e),x=s!==null&&a!==s.content,k=A.useRef(x),v=A.useRef(h);k.current=x,v.current=h,m.current=e,A.useEffect(()=>{!r.data||k.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||k.current&&!window.confirm($cn())||m.current()};Em(p,b,"textarea");async function w(){if(!(!s||!x||h)){_(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Dn(t.queryKey))return;Jr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),bn(Zcn(),"success")}catch(y){bn(y instanceof Error?y.message:String(y),"error")}finally{_(!1)}}}return Mi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:iln()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx($t,{className:"absolute end-3.5 top-3.5","aria-label":Acn(),onClick:b,disabled:h,children:f.jsx(lr,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:c?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:c}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(Nt,{})," ",Gcn()]}):f.jsx(P$,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(De,{onClick:b,disabled:h,children:Q_()}),f.jsx(De,{variant:"primary",onClick:()=>void w(),disabled:!x||h,children:h?oa():nc()})]})]})}),document.body)}function H$({runtime:e,corner:n=!1}){const[t,r]=A.useState(null);return e.kind==="ssh"?f.jsx(q3,{runtime:e,corner:n}):f.jsxs(f.Fragment,{children:[n?f.jsx("div",{className:"fixed bottom-0 start-0 z-50",children:f.jsxs(De,{className:"h-auto max-w-48 justify-start rounded-none border-b-0 border-s-0 px-2.5 py-1.5 font-normal",title:d3(),"aria-haspopup":"dialog",onClick:()=>r("hosts"),children:[f.jsx(Pv,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:zv()})]})}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx($t,{size:"small","aria-label":d3(),"aria-haspopup":"dialog",onClick:()=>r("hosts"),children:f.jsx(Pv,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:zv()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.version)]})]})]})}),t==="hosts"&&f.jsx(lkn,{onClose:()=>r(null),onConfigureSsh:()=>r("config")}),t==="config"&&f.jsx(F$,{onClose:()=>r("hosts")})]})}function l6(e=!0){var r;const n=Mv(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Jr(n.queryKey,s)}}const nSn=6e4,rSn=500;function q$(e){const[n,t]=A.useState(!1),[r,s]=A.useState(null),i=A.useRef(!1);A.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const c=Mv(),u=()=>i.current||!Dn(c.queryKey);t(!0),s(null),(async()=>{try{if(await Rbn(),u())return;const h=Date.now()+nSn;for(;Date.now()setTimeout(p,rSn)),u())return;const _=await et.fetchQuery({...c,staleTime:0}).catch(()=>null);if(u())return;if(_&&_.instance!==a){window.location.reload();return}}throw new Error(omn())}catch(h){if(u())return;s(h instanceof Error?h.message:String(h)),t(!1)}})()}}}function U$({status:e}){const[n,t]=A.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=q$(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Pa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?IL({error:i}):D0n({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(De,{type:"button",size:"small",disabled:s,onClick:a,children:s?$L():LL()}),f.jsx($t,{type:"button",size:"small",className:"ms-auto","aria-label":H0n(),disabled:s,onClick:()=>t(r),children:f.jsx(lr,{size:13})})]})}function u6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(Nt,{})})}function sSn(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:ro()}),f.jsx(Nb,{to:"/projects",children:_0()})]})}function _6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(De,{onClick:n,children:Qs()}),f.jsx(Nb,{to:"/projects",children:_0()})]})}function G$({projectId:e}){const{queryClient:n}=Bk({from:"__root__"}),t=Eb(),[r,s]=A.useState(null),[i,a]=A.useState(0);return A.useEffect(()=>{let o=!0;return s(null),(e?A5n(e,n):T5n(n)).then(c=>{o&&t({href:c,replace:!0})}).catch(c=>{o&&(HV(c)?a(u=>u+1):s(c instanceof Error?c:new Error(String(c))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(_6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(u6,{})}function iSn(){return f.jsx(G$,{})}function aSn({projectId:e}){return f.jsx(G$,{projectId:e})}function oSn(){const e=o$(),n=Eb(),t=dh(),r=ct(t),s=ct(Cm()),i=r.data,a=s.data,o=(i==null?void 0:i.length)===0&&(a==null?void 0:a.onboardingCompleted)===!1,c=r.error??s.error,u=()=>{r.refetch(),s.refetch()},{status:h}=l6(e.kind==="local");A.useEffect(()=>{document.title="OpenResearch",a&&Fb.queue({...CS()??a.workspace??{railOpen:!0,panelWidth:u$(),experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=p=>void n({to:"/projects/$projectId",params:{projectId:p}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(h$,{}),f.jsx(U$,{status:h})]}),c&&(!i||!a)?f.jsx(_6,{error:c,reset:u}):!i||!a?f.jsx(u6,{}):o?f.jsx(H5n,{remote:e.kind==="ssh",preferredAgent:a.preferredAgent,onDone:p=>{j5n(),_(p.id)}}):f.jsx(ckn,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(p,m)=>{m?(bn(m,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:p.id,tab:"git"}})):_(p.id)},onDeleted:p=>Jr(t.queryKey,m=>m==null?void 0:m.filter(x=>x.id!==p))}),(e.kind==="ssh"||i&&a&&!o)&&f.jsx(H$,{runtime:e,corner:!0})]})}const cSn=tc()({component:iSn}),lSn=tc()({component:N0}),uSn=tc()({}),_Sn=tc()({component:oSn}),fSn=e=>({queryKey:zt("getRunDiff",e),queryFn:({signal:n})=>nbn(e,n),staleTime:3e4}),V$=e=>({queryKey:zt("getExperimentDiff",e),queryFn:({signal:n})=>rbn(e,n),staleTime:3e4}),Hv=(e,n,t={})=>({queryKey:zt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>sbn(e,n,t,r),staleTime:t.ref?fh(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),K$=e=>({queryKey:zt("getAbsoluteFile",e),queryFn:({signal:n})=>ibn(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),W$=(e,n={})=>({queryKey:zt("getCodeTree",e,{...n}),queryFn:({signal:t})=>Sbn(e,n,t),staleTime:n.ref&&fh(n.ref)?1/0:3e4}),qv=e=>({queryKey:zt("getSessionWorktree",e),queryFn:({signal:n})=>Cbn(e,n),staleTime:3e4}),dSn=e=>({queryKey:zt("getArtifacts",e),queryFn:({signal:n})=>fyn(e,n),staleTime:3e4}),f6=(e,n)=>({queryKey:zt("getArtifactFileText",e,n),queryFn:({signal:t})=>myn(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Q$=(e,n)=>({queryKey:zt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>vyn(e,n,t),staleTime:2e3}),hSn=()=>({queryKey:zt("getLatexEngine"),queryFn:({signal:e})=>ubn(e),staleTime:3e5}),pSn=()=>({queryKey:zt("getOverleafSettings"),queryFn:({signal:e})=>fbn(e),staleTime:3e5}),mSn=(e,n,t={})=>({queryKey:zt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>vbn(e,n,t,r),staleTime:3e5}),gSn=(e,n,t={})=>({queryKey:zt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>wbn(e,n,t,r),staleTime:3e4}),X$=(e,n,t,r,s)=>({queryKey:zt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!fh(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},c=t==="abs",u=t==="artifacts",h=async()=>{const m=await o(Q$(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",k=m&&x?await o(f6(e,n)):null,v=m===null||x&&k===null;return{path:n,content:(k==null?void 0:k.content)??"",truncated:(k==null?void 0:k.truncated)??!1,binary:(k==null?void 0:k.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:k?k.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},_=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(Hv(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(c?o(K$(n)).then(m=>({source:"absolute",file:m})):u?h().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await _();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(Hv(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?h().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function vSn(e,n,t,r,s){if(fh(s))return;const i=X$(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[K$(n).queryKey]:[Hv(e,n,{sessionId:r,ref:s}).queryKey,Hv(e,`artifacts/${n}`,{sessionId:r}).queryKey,f6(e,n).queryKey,Q$(e,n).queryKey]];await Promise.all(a.map(o=>et.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>et.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await et.invalidateQueries({queryKey:i.queryKey,exact:!0})}function bSn(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const Fj={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function ySn(e){return Fj[e]??Fj.idle}const xSn={done:OL,failed:Eun,running:Pun,starting:Kun,cancelling:aun,cancelled:Jln,editing:bun,idle:Mun};function d6(e){const n=xSn[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function al({status:e,label:n,className:t}){const r=ySn(e);return f.jsx(Id,{tone:r.tone,live:r.live,className:t,children:n??d6(e)})}const ef={local:OD,tinker:pRe,hf:hAe,modal:OAe,k8s:xAe,ssh:cRe,slurm:tRe,ray:WAe,openresearch:FAe};function Hj(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function $n(e){for(var n=1;n=0||(h[c]=a[c]);return h})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function Nn(e,n){return Z$(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,c,u=[],h=!0,_=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;h=!1}else for(;!(h=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(p){_=!0,a=p}finally{try{if(!h&&s.return!=null&&(c=s.return(),Object(c)!==c))return}finally{if(_)throw a}}return u}})(e,n)||Qb(e,n)||eB()}function Y$(e){return Z$(e)||J$(e)||Qb(e)||eB()}function Ji(e){return(function(n){if(Array.isArray(n))return X3(n)})(e)||J$(e)||Qb(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 Z$(e){if(Array.isArray(e))return e}function J$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qb(e,n){if(e){if(typeof e=="string")return X3(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?X3(e,n):void 0}}function X3(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:s}}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 i,a=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var c=t.next();return a=c.done,c},e:function(c){o=!0,i=c},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw i}}}}var _1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Am(e,n){return e(n={exports:{}},n.exports),n.exports}var Yi=Am((function(e){/*! +`).forEach((p,m)=>{m>0&&(s.push(i),i=[]),p&&c(p)});return}h.type==="element"&&(a.push((((_=h.properties)==null?void 0:_.className)??[]).join(" ")),(h.children??[]).forEach(u),a.pop())};return r.forEach(u),s.push(i),s}function H$(e){return Array.isArray(e)?e.length===0:e===""}function q$({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:c,scrollPosition:u,onScrollPositionChange:h}){const _=A.useMemo(()=>F$(e,MS(i)),[e,i]),{ruleCh:p,codeCh:m}=k$(_.length),w=A.useRef(null),k=A.useRef(null),v=()=>{const C=w.current;C&&k.current&&(k.current.scrollTop=C.scrollTop)},b=A.useRef(u);A.useLayoutEffect(()=>{const C=w.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),A.useLayoutEffect(v,[e]),A.useLayoutEffect(()=>{var M;const C=w.current;if(!C||!a||o===void 0)return;const z=e.split(` +`),E=Math.min(Math.max(Math.trunc(a),1),z.length);let T=0;for(let D=0;D{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const z=C.currentTarget,{selectionStart:E,selectionEnd:T}=z,j=e.slice(0,E)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{z.selectionStart=z.selectionEnd=E+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${Hv} ${x$} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${Hv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:k,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:_.map((C,z)=>f.jsxs("div",{"data-line":z+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${w$} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:z+1}),H$(C)?f.jsx("br",{}):C]},z))}),f.jsx("textarea",{ref:w,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),h==null||h({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:x,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function U$({onClose:e,onSaved:n}){const t=j2n(),r=ut(t),[s,i]=A.useState(()=>r.data??null),[a,o]=A.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),c=!s&&r.error?r.error.message:null,u=dn({mutationFn:({content:y,previous:C})=>axn(y,C)}),[h,_]=A.useState(!1),p=A.useRef(null),m=A.useRef(e),w=s!==null&&a!==s.content,k=A.useRef(w),v=A.useRef(h);k.current=w,v.current=h,m.current=e,A.useEffect(()=>{!r.data||k.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||k.current&&!window.confirm(Qcn())||m.current()};Nm(p,b,"textarea");async function x(){if(!(!s||!w||h)){_(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Yr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),bn(lln(),"success")}catch(y){bn(y instanceof Error?y.message:String(y),"error")}finally{_(!1)}}}return Fi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:mln()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Ft,{className:"absolute end-3.5 top-3.5","aria-label":Hcn(),onClick:b,disabled:h,children:f.jsx(_r,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:c?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:c}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(jt,{})," ",nln()]}):f.jsx(q$,{value:a,onChange:o,onSave:()=>void x(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Oe,{onClick:b,disabled:h,children:rf()}),f.jsx(Oe,{variant:"primary",onClick:()=>void x(),disabled:!w||h,children:h?va():ic()})]})]})}),document.body)}function G$({runtime:e,corner:n=!1}){const[t,r]=A.useState(null);return e.kind==="ssh"?f.jsx(G3,{runtime:e,corner:n}):f.jsxs(f.Fragment,{children:[n?f.jsx("div",{className:"fixed bottom-0 start-0 z-50",children:f.jsxs(Oe,{className:"h-auto max-w-48 justify-start rounded-none border-b-0 border-s-0 px-2.5 py-1.5 font-normal",title:p3(),"aria-haspopup":"dialog",onClick:()=>r("hosts"),children:[f.jsx(Fv,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:zv()})]})}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Ft,{size:"small","aria-label":p3(),"aria-haspopup":"dialog",onClick:()=>r("hosts"),children:f.jsx(Fv,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:zv()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ce(e.version)]})]})]})}),t==="hosts"&&f.jsx(ySn,{onClose:()=>r(null),onConfigureSsh:()=>r("config")}),t==="config"&&f.jsx(U$,{onClose:()=>r("hosts")})]})}function u6(e=!0){var r;const n=Mv(),t=ut({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Yr(n.queryKey,s)}}const d6n=6e4,h6n=500;function V$(e){const[n,t]=A.useState(!1),[r,s]=A.useState(null),i=A.useRef(!1);A.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const c=Mv(),u=()=>i.current||!Fn(c.queryKey);t(!0),s(null),(async()=>{try{if(await qyn(),u())return;const h=Date.now()+d6n;for(;Date.now()setTimeout(p,h6n)),u())return;const _=await Je.fetchQuery({...c,staleTime:0}).catch(()=>null);if(u())return;if(_&&_.instance!==a){window.location.reload();return}}throw new Error(ggn())}catch(h){if(u())return;s(h instanceof Error?h.message:String(h)),t(!1)}})()}}}function K$({status:e}){const[n,t]=A.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=V$(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Qa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?PL({error:i}):Gmn({version:Ce(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Oe,{type:"button",size:"small",disabled:s,onClick:a,children:s?FL():BL()}),f.jsx(Ft,{type:"button",size:"small",className:"ms-auto","aria-label":Zmn(),disabled:s,onClick:()=>t(r),children:f.jsx(_r,{size:13})})]})}function _6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(jt,{})})}function p6n(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:go()}),f.jsx(zb,{to:"/projects",children:f0()})]})}function f6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Oe,{onClick:n,children:Ys()}),f.jsx(zb,{to:"/projects",children:f0()})]})}function W$({projectId:e}){const{queryClient:n}=Fk({from:"__root__"}),t=Nb(),[r,s]=A.useState(null),[i,a]=A.useState(0);return A.useEffect(()=>{let o=!0;return s(null),(e?Hkn(e,n):Fkn(n)).then(c=>{o&&t({href:c,replace:!0})}).catch(c=>{o&&(VV(c)?a(u=>u+1):s(c instanceof Error?c:new Error(String(c))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(f6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(_6,{})}function m6n(){return f.jsx(W$,{})}function g6n({projectId:e}){return f.jsx(W$,{projectId:e})}function v6n(){const e=u$(),n=Nb(),t=hh(),r=ut(t),s=ut(Em()),i=r.data,a=s.data,o=(i==null?void 0:i.length)===0&&(a==null?void 0:a.onboardingCompleted)===!1,c=r.error??s.error,u=()=>{r.refetch(),s.refetch()},{status:h}=u6(e.kind==="local");A.useEffect(()=>{document.title="OpenResearch",a&&qb.queue({...ES()??a.workspace??{railOpen:!0,panelWidth:d$(),experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=p=>void n({to:"/projects/$projectId",params:{projectId:p}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(g$,{}),f.jsx(K$,{status:h})]}),c&&(!i||!a)?f.jsx(f6,{error:c,reset:u}):!i||!a?f.jsx(_6,{}):o?f.jsx(Jkn,{remote:e.kind==="ssh",preferredAgent:a.preferredAgent,onDone:p=>{Pkn(),_(p.id)}}):f.jsx(bSn,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(p,m)=>{m?(bn(m,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:p.id,tab:"git"}})):_(p.id)},onDeleted:p=>Yr(t.queryKey,m=>m==null?void 0:m.filter(w=>w.id!==p))}),(e.kind==="ssh"||i&&a&&!o)&&f.jsx(G$,{runtime:e,corner:!0})]})}const b6n=sc()({component:m6n}),y6n=sc()({component:z0}),x6n=sc()({}),w6n=sc()({component:v6n}),k6n=e=>({queryKey:Tt("getRunDiff",e),queryFn:({signal:n})=>dyn(e,n),staleTime:3e4}),Q$=e=>({queryKey:Tt("getExperimentDiff",e),queryFn:({signal:n})=>hyn(e,n),staleTime:3e4}),qv=(e,n,t={})=>({queryKey:Tt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>pyn(e,n,t,r),staleTime:t.ref?dh(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),X$=e=>({queryKey:Tt("getAbsoluteFile",e),queryFn:({signal:n})=>myn(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Y$=(e,n={})=>({queryKey:Tt("getCodeTree",e,{...n}),queryFn:({signal:t})=>Dyn(e,n,t),staleTime:n.ref&&dh(n.ref)?1/0:3e4}),Uv=e=>({queryKey:Tt("getSessionWorktree",e),queryFn:({signal:n})=>Lyn(e,n),staleTime:3e4}),S6n=e=>({queryKey:Tt("getArtifacts",e),queryFn:({signal:n})=>kxn(e,n),staleTime:3e4}),d6=(e,n)=>({queryKey:Tt("getArtifactFileText",e,n),queryFn:({signal:t})=>Nxn(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Z$=(e,n)=>({queryKey:Tt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>jxn(e,n,t),staleTime:2e3}),C6n=()=>({queryKey:Tt("getLatexEngine"),queryFn:({signal:e})=>xyn(e),staleTime:3e5}),E6n=()=>({queryKey:Tt("getOverleafSettings"),queryFn:({signal:e})=>kyn(e),staleTime:3e5}),N6n=(e,n,t={})=>({queryKey:Tt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>jyn(e,n,t,r),staleTime:3e5}),z6n=(e,n,t={})=>({queryKey:Tt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>Myn(e,n,t,r),staleTime:3e4}),J$=(e,n,t,r,s)=>({queryKey:Tt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!dh(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const w=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),w},c=t==="abs",u=t==="artifacts",h=async()=>{const m=await o(Z$(e,n)),w=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",k=m&&w?await o(d6(e,n)):null,v=m===null||w&&k===null;return{path:n,content:(k==null?void 0:k.content)??"",truncated:(k==null?void 0:k.truncated)??!1,binary:(k==null?void 0:k.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:k?k.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},_=async()=>{for(const m of[`artifacts/${n}`,n]){const w=await o(qv(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(w&&!w.notFound)return w}return null},p=await(c?o(X$(n)).then(m=>({source:"absolute",file:m})):u?h().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const w=await _();return w?{source:"checkout",file:w}:{source:"artifact",file:m}}):o(qv(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?h().then(w=>w.notFound?{source:"checkout",file:m}:{source:"artifact",file:w,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function j6n(e,n,t,r,s){if(dh(s))return;const i=J$(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[X$(n).queryKey]:[qv(e,n,{sessionId:r,ref:s}).queryKey,qv(e,`artifacts/${n}`,{sessionId:r}).queryKey,d6(e,n).queryKey,Z$(e,n).queryKey]];await Promise.all(a.map(o=>Je.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>Je.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await Je.invalidateQueries({queryKey:i.queryKey,exact:!0})}function T6n(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const qj={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function A6n(e){return qj[e]??qj.idle}const R6n={done:LL,failed:Iun,running:Yun,starting:s_n,cancelling:gun,cancelled:uun,editing:Tun,idle:Uun};function h6(e){const n=R6n[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function cl({status:e,label:n,className:t}){const r=A6n(e);return f.jsx($d,{tone:r.tone,live:r.live,className:t,children:n??h6(e)})}const lf={local:LD,tinker:ERe,hf:CAe,modal:GAe,k8s:RAe,ssh:bRe,slurm:fRe,ray:iRe,openresearch:ZAe};function Uj(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Un(e){for(var n=1;n=0||(h[c]=a[c]);return h})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function An(e,n){return tB(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,c,u=[],h=!0,_=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;h=!1}else for(;!(h=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);h=!0);}catch(p){_=!0,a=p}finally{try{if(!h&&s.return!=null&&(c=s.return(),Object(c)!==c))return}finally{if(_)throw a}}return u}})(e,n)||Yb(e,n)||rB()}function eB(e){return tB(e)||nB(e)||Yb(e)||rB()}function ua(e){return(function(n){if(Array.isArray(n))return Z3(n)})(e)||nB(e)||Yb(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 tB(e){if(Array.isArray(e))return e}function nB(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yb(e,n){if(e){if(typeof e=="string")return Z3(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Z3(e,n):void 0}}function Z3(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:s}}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 i,a=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var c=t.next();return a=c.done,c},e:function(c){o=!0,i=c},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw i}}}}var _1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rm(e,n){return e(n={exports:{}},n.exports),n.exports}var ca=Rm((function(e){/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(){var n={}.hasOwnProperty;function t(){for(var r=[],s=0;s-1?b.slice(0,y):C;switch(C){case"diff":k--;break e;case"deleted":case"new":var N=b.slice(y+1);N.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=N.slice(10));break;case"similarity":a.similarity=parseInt(b.split(" ")[2],10);break;case"index":var z=b.slice(y+1).split(" "),T=z[0].split("..");a.oldRevision=T[0],a.newRevision=T[1],z[1]&&(a.oldMode=a.newMode=z[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?a.oldPath=j.slice(5):a.newPath=j.slice(3),w=C;break;case"---":var M=b.slice(y+1),D=m[++k].slice(4);M==="/dev/null"?(D=D.slice(2),w="add"):D==="/dev/null"?(M=M.slice(2),w="delete"):(w="modify",M=M.slice(2),D=D.slice(2)),M&&(a.oldPath=M),D&&(a.newPath=D),p=5;break e}}a.type=w||"modify"}else if(v.indexOf("Binary")===0)a.isBinary=!0,a.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(v.indexOf("@@")===0){var I=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:I[1]-0,newStart:I[4]-0,oldLines:I[3]-0||1,newLines:I[6]-0||1,changes:[]},a.hunks.push(o),c=o.oldStart,u=o.newStart}else{var $=v.slice(0,1),q={content:v.slice(1)};switch($){case"+":q.type="insert",q.isInsert=!0,q.lineNumber=u,u++;break;case"-":q.type="delete",q.isDelete=!0,q.lineNumber=c,c++;break;case" ":q.type="normal",q.isNormal=!0,q.oldLineNumber=c,q.newLineNumber=u,c++,u++;break;case"\\":var H=o.changes[o.changes.length-1];H.isDelete||(a.newEndingNewLine=!1),H.isInsert||(a.oldEndingNewLine=!1)}q.type&&o.changes.push(q)}k++}return _}};e.exports=s})()}));function Du(e){return e.type==="insert"}function ea(e){return e.type==="delete"}function ul(e){return e.type==="normal"}function CSn(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var c=Nn(i,3),u=c[0],h=c[1],_=c[2];return h?Du(a)&&_>=0?(u.splice(_+1,0,a),[u,a,_+2]):(u.push(a),[u,a,ea(a)&&ea(h)?_:o]):(u.push(a),[u,a,ea(a)?o:-1])}),[[],null,-1]);return Nn(s,1)[0]})(e.changes):e.changes;return $n($n({},e),{},{isPlain:!1,changes:t})}function Y3(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` +*/(function(){var n={}.hasOwnProperty;function t(){for(var r=[],s=0;s-1?b.slice(0,y):C;switch(C){case"diff":k--;break e;case"deleted":case"new":var z=b.slice(y+1);z.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=z.slice(10));break;case"similarity":a.similarity=parseInt(b.split(" ")[2],10);break;case"index":var E=b.slice(y+1).split(" "),T=E[0].split("..");a.oldRevision=T[0],a.newRevision=T[1],E[1]&&(a.oldMode=a.newMode=E[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?a.oldPath=j.slice(5):a.newPath=j.slice(3),x=C;break;case"---":var M=b.slice(y+1),D=m[++k].slice(4);M==="/dev/null"?(D=D.slice(2),x="add"):D==="/dev/null"?(M=M.slice(2),x="delete"):(x="modify",M=M.slice(2),D=D.slice(2)),M&&(a.oldPath=M),D&&(a.newPath=D),p=5;break e}}a.type=x||"modify"}else if(v.indexOf("Binary")===0)a.isBinary=!0,a.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(v.indexOf("@@")===0){var I=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:I[1]-0,newStart:I[4]-0,oldLines:I[3]-0||1,newLines:I[6]-0||1,changes:[]},a.hunks.push(o),c=o.oldStart,u=o.newStart}else{var $=v.slice(0,1),q={content:v.slice(1)};switch($){case"+":q.type="insert",q.isInsert=!0,q.lineNumber=u,u++;break;case"-":q.type="delete",q.isDelete=!0,q.lineNumber=c,c++;break;case" ":q.type="normal",q.isNormal=!0,q.oldLineNumber=c,q.newLineNumber=u,c++,u++;break;case"\\":var H=o.changes[o.changes.length-1];H.isDelete||(a.newEndingNewLine=!1),H.isInsert||(a.oldEndingNewLine=!1)}q.type&&o.changes.push(q)}k++}return _}};e.exports=s})()}));function Vu(e){return e.type==="insert"}function _a(e){return e.type==="delete"}function fl(e){return e.type==="normal"}function L6n(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var c=An(i,3),u=c[0],h=c[1],_=c[2];return h?Vu(a)&&_>=0?(u.splice(_+1,0,a),[u,a,_+2]):(u.push(a),[u,a,_a(a)&&_a(h)?_:o]):(u.push(a),[u,a,_a(a)?o:-1])}),[[],null,-1]);return An(s,1)[0]})(e.changes):e.changes;return Un(Un({},e),{},{isPlain:!1,changes:t})}function J3(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` `),i=r.indexOf(` `,s+1),a=r.slice(0,s),o=r.slice(s+1,i),c=a.split(" ").slice(1,-3).join(" "),u=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(c," b/").concat(u),"index 1111111..2222222 100644","--- a/".concat(c),"+++ b/".concat(u),r.slice(i+1)].join(` -`)})(e.trimStart());return SSn.parse(t).map((function(r){return(function(s,i){var a=s.hunks.map((function(o){return CSn(o,i)}));return $n($n({},s),{},{hunks:a})})(r,n)}))}function ESn(e){return e[0]}function NSn(e){return e[e.length-1]}function Z3(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function $0(e){return e==="old"?function(n){return Du(n)?-1:ul(n)?n.oldLineNumber:n.lineNumber}:function(n){return ea(n)?-1:ul(n)?n.newLineNumber:n.lineNumber}}function nB(e,n){return function(t,r){var s=t[e],i=s+t[n];return r>=s&&r=i&&s-1},DSn=function(e,n){var t=this.__data__,r=Xb(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function wd(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),h=i.get(n);if(u&&h)return u==n&&h==e;var _=-1,p=!0,m=2&t?new v6n:void 0;for(i.set(e,n),i.set(n,e);++_-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},yr={};yr["[object Float32Array]"]=yr["[object Float64Array]"]=yr["[object Int8Array]"]=yr["[object Int16Array]"]=yr["[object Int32Array]"]=yr["[object Uint8Array]"]=yr["[object Uint8ClampedArray]"]=yr["[object Uint16Array]"]=yr["[object Uint32Array]"]=!0,yr["[object Arguments]"]=yr["[object Array]"]=yr["[object ArrayBuffer]"]=yr["[object Boolean]"]=yr["[object DataView]"]=yr["[object Date]"]=yr["[object Error]"]=yr["[object Function]"]=yr["[object Map]"]=yr["[object Number]"]=yr["[object Object]"]=yr["[object RegExp]"]=yr["[object Set]"]=yr["[object String]"]=yr["[object WeakMap]"]=!1;var O6n=function(e){return bh(e)&&m6(e.length)&&!!yr[Fh(e)]},D6n=function(e){return function(n){return e(n)}},Xj=Am((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&iB.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),Yj=Xj&&Xj.isTypedArray,g6=Yj?D6n(Yj):O6n,L6n=Object.prototype.hasOwnProperty,I6n=function(e,n){var t=sa(e),r=!t&&ey(e),s=!t&&!r&&Uv(e),i=!t&&!r&&!s&&g6(e),a=t||r||s||i,o=a?j6n(e.length,String):[],c=o.length;for(var u in e)!L6n.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||_B(u,c))||o.push(u);return o},$6n=Object.prototype,fB=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||$6n)},B6n=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),P6n=Object.prototype.hasOwnProperty,dB=function(e){if(!fB(e))return B6n(e);var n=[];for(var t in Object(e))P6n.call(e,t)&&t!="constructor"&&n.push(t);return n},ty=function(e){return e!=null&&m6(e.length)&&!oB(e)},v6=function(e){return ty(e)?I6n(e):dB(e)},Zj=function(e){return S6n(e,v6,z6n)},F6n=Object.prototype.hasOwnProperty,H6n=function(e,n,t,r,s,i){var a=1&t,o=Zj(e),c=o.length;if(c!=Zj(n).length&&!a)return!1;for(var u=c;u--;){var h=o[u];if(!(a?h in n:F6n.call(n,h)))return!1}var _=i.get(e),p=i.get(n);if(_&&p)return _==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var x=a;++u1)return!1;if(e.length===1){var n=Nn(e,1)[0];return n.type==="text"&&!n.value}return!0}function TCn(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=Cu(e,zCn),a=s?function(o,c){return s(o,rT,c)}:rT;return f.jsx("td",$n($n({},i),{},{"data-change-key":n,children:r?jCn(r)?" ":r.map(a):t||" "}))}var xB=A.memo(TCn);function wB(e,n){return function(){var t=n==="old"?ay(e):oy(e);return t===-1?void 0:t}}function kB(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function Gv(e,n){return n?function(t){e(),n(t)}:e}function sT(e,n,t,r){return A.useMemo((function(){var s=yB(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=Gv(t,s.onMouseEnter),s.onMouseLeave=Gv(r,s.onMouseLeave),s}),[e,t,r,n])}function iT(e,n,t,r,s,i,a,o,c){var u={change:n,side:r,inHoverState:o,renderDefault:wB(n,r),wrapInAnchor:kB(s,i)};return f.jsx("td",$n($n({className:e},a),{},{"data-change-key":t,children:c(u)}))}function ACn(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,c=e.generateLineClassName,u=e.gutterClassName,h=e.codeClassName,_=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.gutterAnchor,k=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=xu(s),N=(n=Nn(A.useState(!1),2),t=n[0],r=n[1],[t,A.useCallback((function(){return r(!0)}),[]),A.useCallback((function(){return r(!1)}),[])]),z=Nn(N,3),T=z[0],j=z[1],M=z[2],D=A.useMemo((function(){return{change:s}}),[s]),I=sT(_,D,j,M),$=sT(p,D,j,M),q=k(s),H=c({changes:[s],defaultGenerate:function(){return o}}),Q=Yi("diff-gutter","diff-gutter-".concat(w),u,{"diff-gutter-selected":i}),V=Yi("diff-code","diff-code-".concat(w),h,{"diff-code-selected":i});return f.jsxs("tr",{id:q,className:Yi("diff-line",H),children:[!m&&iT(Q,s,C,"old",x,q,I,T,b),!m&&iT(Q,s,C,"new",x,q,I,T,b),f.jsx(xB,$n({className:V,changeKey:C,text:y,tokens:a,renderToken:v},$))]})}var RCn=A.memo(ACn);function MCn(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var OCn=["hideGutter","selectedChanges","tokens","lineClassName"],DCn=["hunk","widgets","className"];function LCn(e){var n=e.hunk,t=e.widgets,r=e.className,s=Cu(e,DCn),i=(function(a,o){return a.reduce((function(c,u){var h=xu(u);c.push(["change",h,u]);var _=o[h];return _&&c.push(["widget",h,_]),c}),[])})(n.changes,t);return f.jsx("tbody",{className:Yi("diff-hunk",r),children:i.map((function(a){return(function(o,c){var u=Nn(o,3),h=u[0],_=u[1],p=u[2],m=c.hideGutter,x=c.selectedChanges,k=c.tokens,v=c.lineClassName,b=Cu(c,OCn);if(h==="change"){var w=ea(p)?"old":"new",y=ea(p)?ay(p):oy(p),C=k?k[w][y-1]:null;return f.jsx(RCn,$n({className:v,change:p,hideGutter:m,selected:x.includes(_),tokens:C},b),"change".concat(_))}return h==="widget"?f.jsx(MCn,{hideGutter:m,element:p},"widget".concat(_)):null})(a,s)}))})}var SB=0;function d1(e,n,t,r){var s=A.useCallback((function(){return n(e)}),[e,n]),i=A.useCallback((function(){return n("")}),[n]);return A.useMemo((function(){var a=yB(r,(function(o){return function(c){return o&&o({side:e,change:t},c)}}));return a.onMouseEnter=Gv(s,a.onMouseEnter),a.onMouseLeave=Gv(i,a.onMouseLeave),a}),[t,r,s,e,i])}function vw(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,c=e.codeEvents,u=e.anchorID,h=e.gutterAnchor,_=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,x=e.renderToken,k=e.renderGutter;if(!n){var v=Yi("diff-gutter","diff-gutter-omit",i),b=Yi("diff-code","diff-code-omit",a);return[!p&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=xu(n),N=t===SB?"old":"new",z=$n({id:u||void 0,className:Yi("diff-gutter","diff-gutter-".concat(w),Q3({"diff-gutter-selected":r},"diff-line-hover-"+N,m),i),children:k({change:n,side:N,inHoverState:m,renderDefault:wB(n,N),wrapInAnchor:kB(h,_)})},o),T=Yi("diff-code","diff-code-".concat(w),Q3({"diff-code-selected":r},"diff-line-hover-"+N,m),a);return[!p&&f.jsx("td",$n($n({},z),{},{"data-change-key":C}),"gutter"),f.jsx(xB,$n({className:T,changeKey:C,text:y,tokens:s,renderToken:x},c),"code")]}function ICn(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,c=e.monotonous,u=e.gutterClassName,h=e.codeClassName,_=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.generateAnchorID,k=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=Nn(A.useState(""),2),C=y[0],N=y[1],z=d1("old",N,t,_),T=d1("new",N,r,_),j=d1("old",N,t,p),M=d1("new",N,r,p),D=t&&x(t),I=r&&x(r),$=k({changes:[t,r],defaultGenerate:function(){return n}}),q={monotonous:c,hideGutter:m,gutterClassName:u,codeClassName:h,gutterEvents:_,codeEvents:p,renderToken:b,renderGutter:w},H=$n($n({},q),{},{change:t,side:SB,selected:s,tokens:a,gutterEvents:z,codeEvents:j,anchorID:D,gutterAnchor:v,gutterAnchorTarget:D,hover:C==="old"}),Q=$n($n({},q),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:T,codeEvents:M,anchorID:t===r?null:I,gutterAnchor:v,gutterAnchorTarget:t===r?D:I,hover:C==="new"});if(c)return f.jsx("tr",{className:Yi("diff-line",$),children:vw(t?H:Q)});var V=(function(J,Z){return J&&!Z?"diff-line-old-only":!J&&Z?"diff-line-new-only":J===Z?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:Yi("diff-line",V,$),children:[vw(H),vw(Q)]})}var $Cn=A.memo(ICn);function BCn(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var PCn=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],FCn=["hunk","widgets","className"];function h1(e,n){return(e?xu(e):"00")+(n?xu(n):"00")}function HCn(e){var n=e.hunk,t=e.widgets,r=e.className,s=Cu(e,FCn),i=(function(a,o){for(var c=function(b){if(!b)return null;var w=xu(b);return o[w]||null},u=[],h=0;h=s&&r=i&&s-1},V6n=function(e,n){var t=this.__data__,r=Zb(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function kd(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),h=i.get(n);if(u&&h)return u==n&&h==e;var _=-1,p=!0,m=2&t?new jCn:void 0;for(i.set(e,n),i.set(n,e);++_-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},yr={};yr["[object Float32Array]"]=yr["[object Float64Array]"]=yr["[object Int8Array]"]=yr["[object Int16Array]"]=yr["[object Int32Array]"]=yr["[object Uint8Array]"]=yr["[object Uint8ClampedArray]"]=yr["[object Uint16Array]"]=yr["[object Uint32Array]"]=!0,yr["[object Arguments]"]=yr["[object Array]"]=yr["[object ArrayBuffer]"]=yr["[object Boolean]"]=yr["[object DataView]"]=yr["[object Date]"]=yr["[object Error]"]=yr["[object Function]"]=yr["[object Map]"]=yr["[object Number]"]=yr["[object Object]"]=yr["[object RegExp]"]=yr["[object Set]"]=yr["[object String]"]=yr["[object WeakMap]"]=!1;var GCn=function(e){return yh(e)&&g6(e.length)&&!!yr[Hh(e)]},VCn=function(e){return function(n){return e(n)}},Zj=Rm((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&cB.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),Jj=Zj&&Zj.isTypedArray,v6=Jj?VCn(Jj):GCn,KCn=Object.prototype.hasOwnProperty,WCn=function(e,n){var t=pa(e),r=!t&&ny(e),s=!t&&!r&&Gv(e),i=!t&&!r&&!s&&v6(e),a=t||r||s||i,o=a?PCn(e.length,String):[],c=o.length;for(var u in e)!KCn.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||hB(u,c))||o.push(u);return o},QCn=Object.prototype,pB=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||QCn)},XCn=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),YCn=Object.prototype.hasOwnProperty,mB=function(e){if(!pB(e))return XCn(e);var n=[];for(var t in Object(e))YCn.call(e,t)&&t!="constructor"&&n.push(t);return n},ry=function(e){return e!=null&&g6(e.length)&&!uB(e)},b6=function(e){return ry(e)?WCn(e):mB(e)},eT=function(e){return DCn(e,b6,BCn)},ZCn=Object.prototype.hasOwnProperty,JCn=function(e,n,t,r,s,i){var a=1&t,o=eT(e),c=o.length;if(c!=eT(n).length&&!a)return!1;for(var u=c;u--;){var h=o[u];if(!(a?h in n:ZCn.call(n,h)))return!1}var _=i.get(e),p=i.get(n);if(_&&p)return _==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var w=a;++u1)return!1;if(e.length===1){var n=An(e,1)[0];return n.type==="text"&&!n.value}return!0}function F7n(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=Du(e,B7n),a=s?function(o,c){return s(o,iT,c)}:iT;return f.jsx("td",Un(Un({},i),{},{"data-change-key":n,children:r?P7n(r)?" ":r.map(a):t||" "}))}var SB=A.memo(F7n);function CB(e,n){return function(){var t=n==="old"?cy(e):ly(e);return t===-1?void 0:t}}function EB(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function Vv(e,n){return n?function(t){e(),n(t)}:e}function aT(e,n,t,r){return A.useMemo((function(){var s=kB(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=Vv(t,s.onMouseEnter),s.onMouseLeave=Vv(r,s.onMouseLeave),s}),[e,t,r,n])}function oT(e,n,t,r,s,i,a,o,c){var u={change:n,side:r,inHoverState:o,renderDefault:CB(n,r),wrapInAnchor:EB(s,i)};return f.jsx("td",Un(Un({className:e},a),{},{"data-change-key":t,children:c(u)}))}function H7n(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,c=e.generateLineClassName,u=e.gutterClassName,h=e.codeClassName,_=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,w=e.gutterAnchor,k=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,x=s.type,y=s.content,C=Au(s),z=(n=An(A.useState(!1),2),t=n[0],r=n[1],[t,A.useCallback((function(){return r(!0)}),[]),A.useCallback((function(){return r(!1)}),[])]),E=An(z,3),T=E[0],j=E[1],M=E[2],D=A.useMemo((function(){return{change:s}}),[s]),I=aT(_,D,j,M),$=aT(p,D,j,M),q=k(s),H=c({changes:[s],defaultGenerate:function(){return o}}),Q=ca("diff-gutter","diff-gutter-".concat(x),u,{"diff-gutter-selected":i}),V=ca("diff-code","diff-code-".concat(x),h,{"diff-code-selected":i});return f.jsxs("tr",{id:q,className:ca("diff-line",H),children:[!m&&oT(Q,s,C,"old",w,q,I,T,b),!m&&oT(Q,s,C,"new",w,q,I,T,b),f.jsx(SB,Un({className:V,changeKey:C,text:y,tokens:a,renderToken:v},$))]})}var q7n=A.memo(H7n);function U7n(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var G7n=["hideGutter","selectedChanges","tokens","lineClassName"],V7n=["hunk","widgets","className"];function K7n(e){var n=e.hunk,t=e.widgets,r=e.className,s=Du(e,V7n),i=(function(a,o){return a.reduce((function(c,u){var h=Au(u);c.push(["change",h,u]);var _=o[h];return _&&c.push(["widget",h,_]),c}),[])})(n.changes,t);return f.jsx("tbody",{className:ca("diff-hunk",r),children:i.map((function(a){return(function(o,c){var u=An(o,3),h=u[0],_=u[1],p=u[2],m=c.hideGutter,w=c.selectedChanges,k=c.tokens,v=c.lineClassName,b=Du(c,G7n);if(h==="change"){var x=_a(p)?"old":"new",y=_a(p)?cy(p):ly(p),C=k?k[x][y-1]:null;return f.jsx(q7n,Un({className:v,change:p,hideGutter:m,selected:w.includes(_),tokens:C},b),"change".concat(_))}return h==="widget"?f.jsx(U7n,{hideGutter:m,element:p},"widget".concat(_)):null})(a,s)}))})}var NB=0;function d1(e,n,t,r){var s=A.useCallback((function(){return n(e)}),[e,n]),i=A.useCallback((function(){return n("")}),[n]);return A.useMemo((function(){var a=kB(r,(function(o){return function(c){return o&&o({side:e,change:t},c)}}));return a.onMouseEnter=Vv(s,a.onMouseEnter),a.onMouseLeave=Vv(i,a.onMouseLeave),a}),[t,r,s,e,i])}function yw(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,c=e.codeEvents,u=e.anchorID,h=e.gutterAnchor,_=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,w=e.renderToken,k=e.renderGutter;if(!n){var v=ca("diff-gutter","diff-gutter-omit",i),b=ca("diff-code","diff-code-omit",a);return[!p&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var x=n.type,y=n.content,C=Au(n),z=t===NB?"old":"new",E=Un({id:u||void 0,className:ca("diff-gutter","diff-gutter-".concat(x),Y3({"diff-gutter-selected":r},"diff-line-hover-"+z,m),i),children:k({change:n,side:z,inHoverState:m,renderDefault:CB(n,z),wrapInAnchor:EB(h,_)})},o),T=ca("diff-code","diff-code-".concat(x),Y3({"diff-code-selected":r},"diff-line-hover-"+z,m),a);return[!p&&f.jsx("td",Un(Un({},E),{},{"data-change-key":C}),"gutter"),f.jsx(SB,Un({className:T,changeKey:C,text:y,tokens:s,renderToken:w},c),"code")]}function W7n(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,c=e.monotonous,u=e.gutterClassName,h=e.codeClassName,_=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,w=e.generateAnchorID,k=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,x=e.renderGutter,y=An(A.useState(""),2),C=y[0],z=y[1],E=d1("old",z,t,_),T=d1("new",z,r,_),j=d1("old",z,t,p),M=d1("new",z,r,p),D=t&&w(t),I=r&&w(r),$=k({changes:[t,r],defaultGenerate:function(){return n}}),q={monotonous:c,hideGutter:m,gutterClassName:u,codeClassName:h,gutterEvents:_,codeEvents:p,renderToken:b,renderGutter:x},H=Un(Un({},q),{},{change:t,side:NB,selected:s,tokens:a,gutterEvents:E,codeEvents:j,anchorID:D,gutterAnchor:v,gutterAnchorTarget:D,hover:C==="old"}),Q=Un(Un({},q),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:T,codeEvents:M,anchorID:t===r?null:I,gutterAnchor:v,gutterAnchorTarget:t===r?D:I,hover:C==="new"});if(c)return f.jsx("tr",{className:ca("diff-line",$),children:yw(t?H:Q)});var V=(function(Z,Y){return Z&&!Y?"diff-line-old-only":!Z&&Y?"diff-line-new-only":Z===Y?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:ca("diff-line",V,$),children:[yw(H),yw(Q)]})}var Q7n=A.memo(W7n);function X7n(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var Y7n=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],Z7n=["hunk","widgets","className"];function h1(e,n){return(e?Au(e):"00")+(n?Au(n):"00")}function J7n(e){var n=e.hunk,t=e.widgets,r=e.className,s=Du(e,Z7n),i=(function(a,o){for(var c=function(b){if(!b)return null;var x=Au(b);return o[x]||null},u=[],h=0;h=(i==null?void 0:i.value.length))return[e];var o=function(_,p){var m=i.value.slice(_,p);return[].concat(Ji(s),[$n($n({},i),{},{value:m})])};if(n>0){var c=o(0,n);a.push(zd(c))}var u=o(Math.max(n,0),t);if(a.push(r?(function(_,p){return[p].concat(Ji(zd(_)))})(u,r):zd(u)),t1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,s=Cu(e,c7n);t.push(s);var i,a=h6(r);try{for(a.s();!(i=a.n()).done;)zB(i.value,n,t)}catch(o){a.e(o)}finally{a.f()}t.pop()}else n.push(zd([].concat(Ji(t.slice(1)),[e])));return n}function l7n(e){return e.reduce((function(n,t){var r=n[n.length-1],s=(function(c){var u=k6(c);return u.value.includes(` +`)})(n.oldSource,e),r=n.highlight?function(c){return n.refractor.highlight(c,n.language)}:function(c){return[{type:"text",value:c}]};return[p1(r(n.oldSource)),p1(r(t))]}var s=An(h8n(e),2),i=s[0],a=s[1],o=n.highlight?function(c){return p1(n.refractor.highlight(c,n.language))}:function(c){return p1([{type:"text",value:c}])};return[o(i),o(a)]}function jd(e){return e.map((function(n){return Un({},n)}))}function m8n(e,n){return[].concat(ua(jd(e.slice(0,-1))),[n])}function g8n(e){return e.type==="text"}function S6(e){var n=e[e.length-1];if(g8n(n))return n;throw new Error("Invalid token path with leaf of type ".concat(n.type))}function v8n(e,n,t,r){var s=e.slice(0,-1),i=S6(e),a=[];if(t<=0||n>=(i==null?void 0:i.value.length))return[e];var o=function(_,p){var m=i.value.slice(_,p);return[].concat(ua(s),[Un(Un({},i),{},{value:m})])};if(n>0){var c=o(0,n);a.push(jd(c))}var u=o(Math.max(n,0),t);if(a.push(r?(function(_,p){return[p].concat(ua(jd(_)))})(u,r):jd(u)),t1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,s=Du(e,b8n);t.push(s);var i,a=p6(r);try{for(a.s();!(i=a.n()).done;)AB(i.value,n,t)}catch(o){a.e(o)}finally{a.f()}t.pop()}else n.push(jd([].concat(ua(t.slice(1)),[e])));return n}function y8n(e){return e.reduce((function(n,t){var r=n[n.length-1],s=(function(c){var u=S6(c);return u.value.includes(` `)?u.value.split(` -`).map((function(h){return i7n(c,$n($n({},u),{},{value:h}))})):[c]})(t),i=Y$(s),a=i[0],o=i.slice(1);return[].concat(Ji(n.slice(0,-1)),[[].concat(Ji(r),[a])],Ji(o.map((function(c){return[c]}))))}),[[]])}function lT(e){return l7n(zB(e))}var u7n=function(e,n,t){var r=(t=typeof t=="function"?t:void 0)?t(e,n):void 0;return r===void 0?ny(e,n,void 0,t):!!r},_7n=function(e,n){return ny(e,n)},f7n=function(e){var n=e==null?0:e.length;return n?e[n-1]:void 0};function d7n(e,n){if(!e.children)throw new Error("parent node missing children property");var t,r,s=f7n(e.children);return s&&(r=n,(t=s).type===r.type&&(t.type==="text"||t.children&&r.children&&u7n(t,r,(function(i,a,o){return o==="chlidren"||_7n(i,a)}))))?e.children[e.children.length-1]=(function(i,a){return"value"in i&&"value"in a?$n($n({},i),{},{value:"".concat(i.value).concat(a.value)}):i})(s,n):e.children.push(n),e.children[e.children.length-1]}function uT(e){var n,t={type:"root",children:[]},r=h6(e);try{var s=function(){var i=n.value;i.reduce((function(a,o,c){return d7n(a,c===i.length-1?$n({},o):$n($n({},o),{},{children:[]}))}),t)};for(r.s();!(n=r.n()).done;)s()}catch(i){r.e(i)}finally{r.f()}return t}var h7n=Object.prototype.hasOwnProperty,p7n=EB((function(e,n,t){h7n.call(e,t)?e[t].push(n):x6(e,t,[n])})),m7n=Object.prototype.hasOwnProperty,g7n=function(e){if(e==null)return!0;if(ty(e)&&(sa(e)||typeof e=="string"||typeof e.splice=="function"||Uv(e)||g6(e)||ey(e)))return!e.length;var n=r5(e);if(n=="[object Map]"||n=="[object Set]")return!e.size;if(fB(e))return!dB(e).length;for(var t in e)if(m7n.call(e,t))return!1;return!0},v7n=function(e,n){var t=n.start,r=n.length,s=t+r,i=e.reduce((function(a,o){var c=Nn(a,2),u=c[0],h=c[1],_=h+k6(o).value.length;if(h>s||_r.length?t:r,c=t.length>r.length?r:t,u=o.indexOf(c);if(u!=-1)return a=[new n.Diff(1,o.substring(0,u)),new n.Diff(0,c),new n.Diff(1,o.substring(u+c.length))],t.length>r.length&&(a[0][0]=a[2][0]=-1),a;if(c.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var h=this.diff_halfMatch_(t,r);if(h){var _=h[0],p=h[1],m=h[2],x=h[3],k=h[4],v=this.diff_main(_,m,s,i),b=this.diff_main(p,x,s,i);return v.concat([new n.Diff(0,k)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,i):this.diff_bisect_(t,r,i)},n.prototype.diff_lineMode_=function(t,r,s){var i=this.diff_linesToChars_(t,r);t=i.chars1,r=i.chars2;var a=i.lineArray,o=this.diff_main(t,r,!1,s);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new n.Diff(0,""));for(var c=0,u=0,h=0,_="",p="";c=1&&h>=1){o.splice(c-u-h,u+h),c=c-u-h;for(var m=this.diff_main(_,p,!1,s),x=m.length-1;x>=0;x--)o.splice(c,0,m[x]);c+=m.length}h=0,u=0,_="",p=""}c++}return o.pop(),o},n.prototype.diff_bisect_=function(t,r,s){for(var i=t.length,a=r.length,o=Math.ceil((i+a)/2),c=o,u=2*o,h=new Array(u),_=new Array(u),p=0;ps);y++){for(var C=-y+k;C<=y-v;C+=2){for(var N=c+C,z=(I=C==-y||C!=y&&h[N-1]i)v+=2;else if(z>a)k+=2;else if(x&&(M=c+m-C)>=0&&M=(j=i-_[M]))return this.diff_bisectSplit_(t,r,I,z,s)}for(var T=-y+b;T<=y-w;T+=2){for(var j,M=c+T,D=(j=T==-y||T!=y&&_[M-1]<_[M+1]?_[M+1]:_[M-1]+1)-T;ji)w+=2;else if(D>a)b+=2;else if(!x&&(N=c+m-T)>=0&&N=(j=i-j))return this.diff_bisectSplit_(t,r,I,z,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,i,a){var o=t.substring(0,s),c=r.substring(0,i),u=t.substring(s),h=r.substring(i),_=this.diff_main(o,c,!1,a),p=this.diff_main(u,h,!1,a);return _.concat(p)},n.prototype.diff_linesToChars_=function(t,r){var s=[],i={};function a(u){for(var h="",_=0,p=-1,m=s.length;pi?t=t.substring(s-i):sr.length?t:r,i=t.length>r.length?r:t;if(s.length<4||2*i.length=k.length?[w,y,C,N,j]:null}var c,u,h,_,p,m=o(s,i,Math.ceil(s.length/4)),x=o(s,i,Math.ceil(s.length/2));return m||x?(c=x?m&&m[4].length>x[4].length?m:x:m,t.length>r.length?(u=c[0],h=c[1],_=c[2],p=c[3]):(_=c[0],p=c[1],u=c[2],h=c[3]),[u,h,_,p,c[4]]):null},n.prototype.diff_cleanupSemantic=function(t){for(var r=!1,s=[],i=0,a=null,o=0,c=0,u=0,h=0,_=0;o0?s[i-1]:-1,c=0,u=0,h=0,_=0,a=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),o=1;o=k?(x>=p.length/2||x>=m.length/2)&&(t.splice(o,0,new n.Diff(0,m.substring(0,x))),t[o-1][1]=p.substring(0,p.length-x),t[o+1][1]=m.substring(x),o++):(k>=p.length/2||k>=m.length/2)&&(t.splice(o,0,new n.Diff(0,p.substring(0,k))),t[o-1][0]=1,t[o-1][1]=m.substring(0,m.length-k),t[o+1][0]=-1,t[o+1][1]=p.substring(k),o++),o++}o++}},n.prototype.diff_cleanupSemanticLossless=function(t){function r(k,v){if(!k||!v)return 6;var b=k.charAt(k.length-1),w=v.charAt(0),y=b.match(n.nonAlphaNumericRegex_),C=w.match(n.nonAlphaNumericRegex_),N=y&&b.match(n.whitespaceRegex_),z=C&&w.match(n.whitespaceRegex_),T=N&&b.match(n.linebreakRegex_),j=z&&w.match(n.linebreakRegex_),M=T&&k.match(n.blanklineEndRegex_),D=j&&v.match(n.blanklineStartRegex_);return M||D?5:T||j?4:y&&!N&&z?3:N||z?2:y||C?1:0}for(var s=1;s=m&&(m=x,h=i,_=a,p=o)}t[s-1][1]!=h&&(h?t[s-1][1]=h:(t.splice(s-1,1),s--),t[s][1]=_,p?t[s+1][1]=p:(t.splice(s+1,1),s--))}s++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){for(var r=!1,s=[],i=0,a=null,o=0,c=!1,u=!1,h=!1,_=!1;o0?s[i-1]:-1,h=_=!1),r=!0)),o++;r&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(0,""));for(var r,s=0,i=0,a=0,o="",c="";s1?(i!==0&&a!==0&&((r=this.diff_commonPrefix(c,o))!==0&&(s-i-a>0&&t[s-i-a-1][0]==0?t[s-i-a-1][1]+=c.substring(0,r):(t.splice(0,0,new n.Diff(0,c.substring(0,r))),s++),c=c.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(c,o))!==0&&(t[s][1]=c.substring(c.length-r)+t[s][1],c=c.substring(0,c.length-r),o=o.substring(0,o.length-r))),s-=i+a,t.splice(s,i+a),o.length&&(t.splice(s,0,new n.Diff(-1,o)),s++),c.length&&(t.splice(s,0,new n.Diff(1,c)),s++),s++):s!==0&&t[s-1][0]==0?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,a=0,i=0,o="",c=""}t[t.length-1][1]===""&&t.pop();var u=!1;for(s=1;sr));s++)o=i,c=a;return t.length!=s&&t[s][0]===-1?c:c+(r-o)},n.prototype.diff_prettyHtml=function(t){for(var r=[],s=/&/g,i=//g,o=/\n/g,c=0;c");switch(u){case 1:r[c]=''+h+"";break;case-1:r[c]=''+h+"";break;case 0:r[c]=""+h+""}}return r.join("")},n.prototype.diff_text1=function(t){for(var r=[],s=0;sthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(r),a=this;function o(z,T){var j=z/r.length,M=Math.abs(s-T);return a.Match_Distance?j+M/a.Match_Distance:M?1:j}var c=this.Match_Threshold,u=t.indexOf(r,s);u!=-1&&(c=Math.min(o(0,u),c),(u=t.lastIndexOf(r,s+r.length))!=-1&&(c=Math.min(o(0,u),c)));var h,_,p=1<=v;y--){var C=i[t.charAt(y-1)];if(w[y]=k===0?(w[y+1]<<1|1)&C:(w[y+1]<<1|1)&C|(m[y+1]|m[y])<<1|1|m[y+1],w[y]&p){var N=o(k,y-1);if(N<=c){if(c=N,!((u=y-1)>s))break;v=Math.max(1,2*s-u)}}}if(o(k+1,s)>c)break;m=w}return u},n.prototype.match_alphabet_=function(t){for(var r={},s=0;s2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(t&&typeof t=="object"&&r===void 0&&s===void 0)a=t,i=this.diff_text1(a);else if(typeof t=="string"&&r&&typeof r=="object"&&s===void 0)i=t,a=r;else{if(typeof t!="string"||typeof r!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");i=t,a=s}if(a.length===0)return[];for(var o=[],c=new n.patch_obj,u=0,h=0,_=0,p=i,m=i,x=0;x=2*this.Patch_Margin&&u&&(this.patch_addContext_(c,p),o.push(c),c=new n.patch_obj,u=0,p=m,h=_)}k!==1&&(h+=v.length),k!==-1&&(_+=v.length)}return u&&(this.patch_addContext_(c,p),o.push(c)),o},n.prototype.patch_deepCopy=function(t){for(var r=[],s=0;sthis.Match_MaxBits?(c=this.match_main(r,_.substring(0,this.Match_MaxBits),h))!=-1&&((p=this.match_main(r,_.substring(_.length-this.Match_MaxBits),h+_.length-this.Match_MaxBits))==-1||c>=p)&&(c=-1):c=this.match_main(r,_,h),c==-1)a[o]=!1,i-=t[o].length2-t[o].length1;else if(a[o]=!0,i=c-h,_==(u=p==-1?r.substring(c,c+_.length):r.substring(c,p+this.Match_MaxBits)))r=r.substring(0,c)+this.diff_text2(t[o].diffs)+r.substring(c+_.length);else{var m=this.diff_main(_,u,!1);if(_.length>this.Match_MaxBits&&this.diff_levenshtein(m)/_.length>this.Patch_DeleteThreshold)a[o]=!1;else{this.diff_cleanupSemanticLossless(m);for(var x,k=0,v=0;vo[0][1].length){var c=r-o[0][1].length;o[0][1]=s.substring(o[0][1].length)+o[0][1],a.start1-=c,a.start2-=c,a.length1+=c,a.length2+=c}return(o=(a=t[t.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new n.Diff(0,s)),a.length1+=r,a.length2+=r):r>o[o.length-1][1].length&&(c=r-o[o.length-1][1].length,o[o.length-1][1]+=s.substring(0,c),a.length1+=c,a.length2+=c),s},n.prototype.patch_splitMax=function(t){for(var r=this.Match_MaxBits,s=0;s2*r?(u.length1+=p.length,a+=p.length,h=!1,u.diffs.push(new n.Diff(_,p)),i.diffs.shift()):(p=p.substring(0,r-u.length1-this.Patch_Margin),u.length1+=p.length,a+=p.length,_===0?(u.length2+=p.length,o+=p.length):h=!1,u.diffs.push(new n.Diff(_,p)),p==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(p.length))}c=(c=this.diff_text2(u.diffs)).substring(c.length-this.Patch_Margin);var m=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);m!==""&&(u.length1+=m.length,u.length2+=m.length,u.diffs.length!==0&&u.diffs[u.diffs.length-1][0]===0?u.diffs[u.diffs.length-1][1]+=m:u.diffs.push(new n.Diff(0,m))),h||t.splice(++s,0,u)}}},n.prototype.patch_toText=function(t){for(var r=[],s=0;ss||_r.length?t:r,c=t.length>r.length?r:t,u=o.indexOf(c);if(u!=-1)return a=[new n.Diff(1,o.substring(0,u)),new n.Diff(0,c),new n.Diff(1,o.substring(u+c.length))],t.length>r.length&&(a[0][0]=a[2][0]=-1),a;if(c.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var h=this.diff_halfMatch_(t,r);if(h){var _=h[0],p=h[1],m=h[2],w=h[3],k=h[4],v=this.diff_main(_,m,s,i),b=this.diff_main(p,w,s,i);return v.concat([new n.Diff(0,k)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,i):this.diff_bisect_(t,r,i)},n.prototype.diff_lineMode_=function(t,r,s){var i=this.diff_linesToChars_(t,r);t=i.chars1,r=i.chars2;var a=i.lineArray,o=this.diff_main(t,r,!1,s);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new n.Diff(0,""));for(var c=0,u=0,h=0,_="",p="";c=1&&h>=1){o.splice(c-u-h,u+h),c=c-u-h;for(var m=this.diff_main(_,p,!1,s),w=m.length-1;w>=0;w--)o.splice(c,0,m[w]);c+=m.length}h=0,u=0,_="",p=""}c++}return o.pop(),o},n.prototype.diff_bisect_=function(t,r,s){for(var i=t.length,a=r.length,o=Math.ceil((i+a)/2),c=o,u=2*o,h=new Array(u),_=new Array(u),p=0;ps);y++){for(var C=-y+k;C<=y-v;C+=2){for(var z=c+C,E=(I=C==-y||C!=y&&h[z-1]i)v+=2;else if(E>a)k+=2;else if(w&&(M=c+m-C)>=0&&M=(j=i-_[M]))return this.diff_bisectSplit_(t,r,I,E,s)}for(var T=-y+b;T<=y-x;T+=2){for(var j,M=c+T,D=(j=T==-y||T!=y&&_[M-1]<_[M+1]?_[M+1]:_[M-1]+1)-T;ji)x+=2;else if(D>a)b+=2;else if(!w&&(z=c+m-T)>=0&&z=(j=i-j))return this.diff_bisectSplit_(t,r,I,E,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,i,a){var o=t.substring(0,s),c=r.substring(0,i),u=t.substring(s),h=r.substring(i),_=this.diff_main(o,c,!1,a),p=this.diff_main(u,h,!1,a);return _.concat(p)},n.prototype.diff_linesToChars_=function(t,r){var s=[],i={};function a(u){for(var h="",_=0,p=-1,m=s.length;pi?t=t.substring(s-i):sr.length?t:r,i=t.length>r.length?r:t;if(s.length<4||2*i.length=k.length?[x,y,C,z,j]:null}var c,u,h,_,p,m=o(s,i,Math.ceil(s.length/4)),w=o(s,i,Math.ceil(s.length/2));return m||w?(c=w?m&&m[4].length>w[4].length?m:w:m,t.length>r.length?(u=c[0],h=c[1],_=c[2],p=c[3]):(_=c[0],p=c[1],u=c[2],h=c[3]),[u,h,_,p,c[4]]):null},n.prototype.diff_cleanupSemantic=function(t){for(var r=!1,s=[],i=0,a=null,o=0,c=0,u=0,h=0,_=0;o0?s[i-1]:-1,c=0,u=0,h=0,_=0,a=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),o=1;o=k?(w>=p.length/2||w>=m.length/2)&&(t.splice(o,0,new n.Diff(0,m.substring(0,w))),t[o-1][1]=p.substring(0,p.length-w),t[o+1][1]=m.substring(w),o++):(k>=p.length/2||k>=m.length/2)&&(t.splice(o,0,new n.Diff(0,p.substring(0,k))),t[o-1][0]=1,t[o-1][1]=m.substring(0,m.length-k),t[o+1][0]=-1,t[o+1][1]=p.substring(k),o++),o++}o++}},n.prototype.diff_cleanupSemanticLossless=function(t){function r(k,v){if(!k||!v)return 6;var b=k.charAt(k.length-1),x=v.charAt(0),y=b.match(n.nonAlphaNumericRegex_),C=x.match(n.nonAlphaNumericRegex_),z=y&&b.match(n.whitespaceRegex_),E=C&&x.match(n.whitespaceRegex_),T=z&&b.match(n.linebreakRegex_),j=E&&x.match(n.linebreakRegex_),M=T&&k.match(n.blanklineEndRegex_),D=j&&v.match(n.blanklineStartRegex_);return M||D?5:T||j?4:y&&!z&&E?3:z||E?2:y||C?1:0}for(var s=1;s=m&&(m=w,h=i,_=a,p=o)}t[s-1][1]!=h&&(h?t[s-1][1]=h:(t.splice(s-1,1),s--),t[s][1]=_,p?t[s+1][1]=p:(t.splice(s+1,1),s--))}s++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){for(var r=!1,s=[],i=0,a=null,o=0,c=!1,u=!1,h=!1,_=!1;o0?s[i-1]:-1,h=_=!1),r=!0)),o++;r&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(0,""));for(var r,s=0,i=0,a=0,o="",c="";s1?(i!==0&&a!==0&&((r=this.diff_commonPrefix(c,o))!==0&&(s-i-a>0&&t[s-i-a-1][0]==0?t[s-i-a-1][1]+=c.substring(0,r):(t.splice(0,0,new n.Diff(0,c.substring(0,r))),s++),c=c.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(c,o))!==0&&(t[s][1]=c.substring(c.length-r)+t[s][1],c=c.substring(0,c.length-r),o=o.substring(0,o.length-r))),s-=i+a,t.splice(s,i+a),o.length&&(t.splice(s,0,new n.Diff(-1,o)),s++),c.length&&(t.splice(s,0,new n.Diff(1,c)),s++),s++):s!==0&&t[s-1][0]==0?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,a=0,i=0,o="",c=""}t[t.length-1][1]===""&&t.pop();var u=!1;for(s=1;sr));s++)o=i,c=a;return t.length!=s&&t[s][0]===-1?c:c+(r-o)},n.prototype.diff_prettyHtml=function(t){for(var r=[],s=/&/g,i=//g,o=/\n/g,c=0;c");switch(u){case 1:r[c]=''+h+"";break;case-1:r[c]=''+h+"";break;case 0:r[c]=""+h+""}}return r.join("")},n.prototype.diff_text1=function(t){for(var r=[],s=0;sthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(r),a=this;function o(E,T){var j=E/r.length,M=Math.abs(s-T);return a.Match_Distance?j+M/a.Match_Distance:M?1:j}var c=this.Match_Threshold,u=t.indexOf(r,s);u!=-1&&(c=Math.min(o(0,u),c),(u=t.lastIndexOf(r,s+r.length))!=-1&&(c=Math.min(o(0,u),c)));var h,_,p=1<=v;y--){var C=i[t.charAt(y-1)];if(x[y]=k===0?(x[y+1]<<1|1)&C:(x[y+1]<<1|1)&C|(m[y+1]|m[y])<<1|1|m[y+1],x[y]&p){var z=o(k,y-1);if(z<=c){if(c=z,!((u=y-1)>s))break;v=Math.max(1,2*s-u)}}}if(o(k+1,s)>c)break;m=x}return u},n.prototype.match_alphabet_=function(t){for(var r={},s=0;s2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(t&&typeof t=="object"&&r===void 0&&s===void 0)a=t,i=this.diff_text1(a);else if(typeof t=="string"&&r&&typeof r=="object"&&s===void 0)i=t,a=r;else{if(typeof t!="string"||typeof r!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");i=t,a=s}if(a.length===0)return[];for(var o=[],c=new n.patch_obj,u=0,h=0,_=0,p=i,m=i,w=0;w=2*this.Patch_Margin&&u&&(this.patch_addContext_(c,p),o.push(c),c=new n.patch_obj,u=0,p=m,h=_)}k!==1&&(h+=v.length),k!==-1&&(_+=v.length)}return u&&(this.patch_addContext_(c,p),o.push(c)),o},n.prototype.patch_deepCopy=function(t){for(var r=[],s=0;sthis.Match_MaxBits?(c=this.match_main(r,_.substring(0,this.Match_MaxBits),h))!=-1&&((p=this.match_main(r,_.substring(_.length-this.Match_MaxBits),h+_.length-this.Match_MaxBits))==-1||c>=p)&&(c=-1):c=this.match_main(r,_,h),c==-1)a[o]=!1,i-=t[o].length2-t[o].length1;else if(a[o]=!0,i=c-h,_==(u=p==-1?r.substring(c,c+_.length):r.substring(c,p+this.Match_MaxBits)))r=r.substring(0,c)+this.diff_text2(t[o].diffs)+r.substring(c+_.length);else{var m=this.diff_main(_,u,!1);if(_.length>this.Match_MaxBits&&this.diff_levenshtein(m)/_.length>this.Patch_DeleteThreshold)a[o]=!1;else{this.diff_cleanupSemanticLossless(m);for(var w,k=0,v=0;vo[0][1].length){var c=r-o[0][1].length;o[0][1]=s.substring(o[0][1].length)+o[0][1],a.start1-=c,a.start2-=c,a.length1+=c,a.length2+=c}return(o=(a=t[t.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new n.Diff(0,s)),a.length1+=r,a.length2+=r):r>o[o.length-1][1].length&&(c=r-o[o.length-1][1].length,o[o.length-1][1]+=s.substring(0,c),a.length1+=c,a.length2+=c),s},n.prototype.patch_splitMax=function(t){for(var r=this.Match_MaxBits,s=0;s2*r?(u.length1+=p.length,a+=p.length,h=!1,u.diffs.push(new n.Diff(_,p)),i.diffs.shift()):(p=p.substring(0,r-u.length1-this.Patch_Margin),u.length1+=p.length,a+=p.length,_===0?(u.length2+=p.length,o+=p.length):h=!1,u.diffs.push(new n.Diff(_,p)),p==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(p.length))}c=(c=this.diff_text2(u.diffs)).substring(c.length-this.Patch_Margin);var m=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);m!==""&&(u.length1+=m.length,u.length2+=m.length,u.diffs.length!==0&&u.diffs[u.diffs.length-1][0]===0?u.diffs[u.diffs.length-1][1]+=m:u.diffs.push(new n.Diff(0,m))),h||t.splice(++s,0,u)}}},n.prototype.patch_toText=function(t){for(var r=[],s=0;s1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?S7n:C7n,r=w6(e.map((function(o){return o.changes})),jB).map(t).reduce((function(o,c){var u=Nn(o,2),h=u[0],_=u[1],p=Nn(c,2),m=p[0],x=p[1];return[h.concat(m),_.concat(x)]}),[[],[]]),s=Nn(r,2),i=s[0],a=s[1];return b7n(fT(i),fT(a))}var N7n=["enhancers"],mT=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=Nn(s7n(e,Cu(t,N7n)),2),a=i[0],o=i[1],c=[lT(a),lT(o)],u=(n=[c[0],c[1]],s.reduce((function(k,v){return v(k)}),n)),h=Nn(u,2),_=h[0],p=h[1],m=[_.map(uT),p.map(uT)],x=m[1];return{old:m[0].map((function(k){var v;return(v=k.children)!==null&&v!==void 0?v:[]})),new:x.map((function(k){var v;return(v=k.children)!==null&&v!==void 0?v:[]}))}};const i5=["openresearch-diff flex flex-col gap-4","[&_.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(--color-diff-selection)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-background-color:var(--color-diff-gutter-selection)]","[&_.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(--color-diff-insert-gutter)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-text-color:var(--accent-red)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-background-color:var(--color-diff-delete-gutter)]","[&_.openresearch-diff-file]:[--diff-code-insert-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-background-color:var(--color-diff-insert-code)]","[&_.openresearch-diff-file]:[--diff-code-delete-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-background-color:var(--color-diff-delete-code)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-background-color:var(--color-diff-insert-edit)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-background-color:var(--color-diff-delete-edit)]","[&_.openresearch-diff-file]:[--diff-omit-gutter-line-color:var(--color-diff-omit-gutter)]","[&_.openresearch-diff-file]:w-full","[&_.openresearch-diff-file.diff-unified]:table-fixed","[&_.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_.diff-line_>_td:first-child]:p-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-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)]:ps-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-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.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:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:ps-[2ch] [&_.openresearch-diff-file_.diff-code]:pe-4","[&_.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-border"].join(" "),z7n=2e3,j7n={highlight(e,n){return Dt.highlight(e,n).children}};function T7n(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function ly(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function A7n(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function a5(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 R7n(e){const n=[E7n(e.hunks,{type:"line"})],t=RS(A7n(e));return t&&Dt.registered(t)?mT(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:j7n}):mT(e.hunks,{enhancers:n,highlight:!1})}function AB(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:Y3(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:Y3(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const M7n=({change:e,side:n})=>n==="old"?null:T7n(e);function RB({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:nVe()}),f.jsx("p",{children:rKe({limit:Ne(el(n)),read:Ne(el(e))})})]})}function MB({file:e,defaultExpanded:n}){const[t,r]=A.useState(n),{additions:s,deletions:i}=A.useMemo(()=>ly(e),[e]),a=t&&s+i<=z7n,o=A.useMemo(()=>{if(a)try{return R7n(e)}catch{return}},[e,a]);return f.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 ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.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-medium [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(c=>!c),children:[f.jsx("span",{className:"chev",children:t?f.jsx(rc,{size:14}):f.jsx(Ba,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:a5(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:TVe()}):f.jsx("div",{className:"diff-file-body min-w-0 py-3.5 bg-background",children:f.jsx(WCn,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:M7n,tokens:o,viewType:"unified"})}))]})}function O7n({files:e,className:n}){return f.jsx("div",{className:n?`${i5} ${n}`:i5,children:e.map((t,r)=>f.jsx(MB,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function D7n(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 OB({diff:e,partial:n=!1}){var p;const t=A.useMemo(()=>AB(e,n),[e,n]),r=t.files,s=A.useMemo(()=>r.map((m,x)=>({file:m,key:`${m.oldPath}→${m.newPath}#${x}`,changes:ly(m)})),[r]),[i,a]=A.useState(null),[o,c]=A.useState(!1),u=o&&!n,h=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,_=s.find(m=>m.key===h)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?kVe():XVe()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:mVe()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.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-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{className:"font-medium",children:n?s.length===1?qVe():lVe({count:Xt(s.length)}):s.length===1?PD():BD({count:Xt(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>c(m=>!m),children:u?LGe():uKe()})]}),u?f.jsx(O7n,{files:r}):f.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:[f.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-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_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":QGe(),children:s.map(m=>f.jsxs("button",{type:"button",className:m.key===h?"active":"","aria-pressed":m.key===h,onClick:()=>a(m.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:D7n(m.file)}),f.jsx("code",{title:a5(m.file),children:a5(m.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),f.jsx("div",{className:`${i5} diff-explorer-preview min-w-0`,children:_&&f.jsx(MB,{file:_.file,defaultExpanded:!0},_.key)})]})]})}function L7n({expanded:e,experiments:n,runs:t,onOpenExperiment:r,rightOffset:s,activeView:i,projectId:a,onCompute:o,sessionId:c,busy:u,onChanges:h,onFiles:_,onTerminal:p,onArtifacts:m,onExperiments:x}){var C,N;const k=bSn(n,t,c),v=ct({...tI(a),enabled:e}),b=((C=v.data)==null?void 0:C.configuredDefaultBackend)??((N=v.data)==null?void 0:N.defaultBackend),w=b?ef[b]():v.isPending?"…":v.isError?ro():p3(),y=[{id:"files",label:a3(),Icon:Su,onClick:_},{id:"terminal",label:Tv(),Icon:lo,onClick:p},{id:"artifacts",label:yD(),Icon:gS,onClick:m},{id:"experiments",label:xD(),Icon:mh,onClick:x}];return f.jsx("div",{className:"workspace-tools absolute end-3.5 top-7 z-30",style:{insetInlineEnd:s},children:e?f.jsxs("nav",{"aria-label":nw(),className:"workspace-tools-card flex w-60 flex-col gap-0.5 rounded-xl border border-border bg-background px-1.5 py-2 shadow-elevated",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:nw()}),y.filter(z=>z.id!=="files"&&z.id!=="terminal").map(({id:z,label:T,Icon:j,onClick:M})=>f.jsx(Jn,{className:"min-h-7 py-1","data-onboarding":z==="artifacts"?"nav-artifacts":void 0,onClick:M,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(j,{size:15}),T]})},z)),f.jsx(Jn,{className:"py-1",onClick:o,children:f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-4 text-sm text-text",children:[f.jsx(hS,{size:15,className:"shrink-0"}),qgn()]}),f.jsxs("span",{className:"flex items-center gap-1.5 ps-[31px] text-menu text-subtext",children:[b&&f.jsx($h,{kind:`${b}_job`,size:12}),f.jsx("span",{className:"wrap-anywhere",children:w})]})]})}),f.jsxs("div",{className:"mt-2 border-t border-border/50 pt-3",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:w1n()}),f.jsx(Jn,{className:"min-h-7 py-1",onClick:_,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(Su,{size:15}),a3()]})}),f.jsx(Jn,{className:"min-h-7 py-1",onClick:p,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(lo,{size:15}),Tv()]})}),c&&f.jsx(I7n,{sessionId:c,busy:u,onChanges:h},c),k.length>0&&f.jsxs("div",{children:[f.jsxs("h2",{className:"m-0 flex items-center gap-4 px-2 py-1 text-sm font-normal text-text",children:[f.jsx("span",{className:"flex w-[15px] shrink-0 justify-center",children:f.jsx(Id,{tone:"success",live:!0})}),f.jsx("span",{children:Lgn()})]}),k.map(z=>f.jsx(Jn,{className:"min-h-7 py-1",onClick:()=>r(z.experiment.id,z.run.id),children:f.jsx("span",{className:"min-w-0 truncate ps-[31px] text-menu text-subtext",title:`${z.experiment.title||z.experiment.slug} · ${d6(Zi(z.run))}`,children:z.experiment.title||z.experiment.slug})},z.run.id))]})]})]}):f.jsx("nav",{"aria-label":nw(),className:"flex items-center justify-end gap-3",children:y.map(({id:z,label:T,Icon:j,onClick:M})=>f.jsx($t,{active:i===z,className:"text-text [&.active]:text-text","data-tip":T,"data-tip-align":z==="experiments"?"end":void 0,"aria-label":T,"aria-pressed":i===z,onClick:M,children:f.jsx(j,{size:15})},z))})})}function I7n({sessionId:e,busy:n,onChanges:t}){var c,u;const r=ct({...qv(e),refetchInterval:n?5e3:!1}),s=A.useRef(n),{refetch:i}=r;A.useEffect(()=>{s.current&&!n&&i(),s.current=n},[n,i]);const a=r.data,o=A.useMemo(()=>{if(!(a!=null&&a.diff)||a.diff.truncated)return null;const h=AB(a.diff.diff,!1);return h.failed?null:h.files.map(ly).reduce((_,p)=>({additions:_.additions+p.additions,deletions:_.deletions+p.deletions}),{additions:0,deletions:0})},[a==null?void 0:a.diff]);return a!=null&&a.exists?f.jsxs(Jn,{className:"min-h-7 py-1",onClick:t,title:a.branch??Jk(),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[f.jsx(Nm,{size:15,className:"shrink-0"}),f.jsx("span",{children:AD()})]}),o?f.jsxs("span",{className:"flex shrink-0 gap-1 text-xs tabular-nums",children:[f.jsxs("span",{className:"text-accent-green",children:["+",Xt(o.additions)]}),f.jsxs("span",{className:"text-accent-red",children:["−",Xt(o.deletions)]})]}):f.jsx("span",{className:"shrink-0 text-xs text-subtext",children:((c=a.files)==null?void 0:c.length)===1?PD():BD({count:Xt(((u=a.files)==null?void 0:u.length)??0)})})]}):null}function $7n({projectId:e,sessionId:n,active:t}){const r=A.useRef(null),s=A.useRef(null),[i,a]=A.useState(null),[o,c]=A.useState(0);return A.useEffect(()=>{const u=r.current;if(!u)return;const h=Bb(u,!1,!0,"app"),{terminal:_,dispose:p}=h;s.current=h,a(null);const m=location.protocol==="https:"?"wss:":"ws:",x=new URL(`/api/projects/${encodeURIComponent(e)}/terminal`,`${m}//${location.host}`);n&&x.searchParams.set("sessionId",n);const k=new WebSocket(x);k.binaryType="arraybuffer";let v=!1;const b=C=>{v||(v=!0,_.options.disableStdin=!0,_.blur(),_.writeln(`\r -${C}`),a(C))},w=_.onData(C=>{k.readyState===WebSocket.OPEN&&k.send(new TextEncoder().encode(C))}),y=_.onResize(({cols:C,rows:N})=>{k.readyState===WebSocket.OPEN&&k.send(JSON.stringify({type:"resize",cols:C,rows:N}))});return k.onopen=()=>{k.send(JSON.stringify({type:"resize",cols:_.cols,rows:_.rows}))},k.onmessage=C=>{if(C.data instanceof ArrayBuffer){_.write(new Uint8Array(C.data));return}if(typeof C.data!="string")return;let N;try{N=JSON.parse(C.data)}catch{return}yf(N)&&(N.type==="exit"?b(c1n({code:String(N.code)})):N.type==="error"&&typeof N.error=="string"&&b(N.error))},k.onclose=()=>b(Bz()),k.onerror=()=>b(Bz()),()=>{k.onopen=null,k.onmessage=null,k.onerror=null,k.onclose=null,w.dispose(),y.dispose(),k.close(),s.current=null,p()}},[e,n,o]),A.useEffect(()=>{if(!t||i!==null)return;const u=requestAnimationFrame(()=>{var h,_;(h=s.current)==null||h.fit(),(_=s.current)==null||_.terminal.focus()});return()=>cancelAnimationFrame(u)},[t,i,o]),f.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-terminal-app p-2",role:"group","aria-label":Tv(),children:[f.jsx("div",{ref:r,className:"min-h-0 flex-1 overflow-hidden"}),f.jsx("p",{role:"status","aria-live":"polite",className:"sr-only",children:i??""}),i!==null&&f.jsx("div",{className:"flex shrink-0 justify-end pt-2",children:f.jsx(De,{autoFocus:!0,onClick:()=>c(u=>u+1),children:p1n()})})]})}function S6(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function o5(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),c=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const h=u.startsWith("/"),_=h?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(_.length===0)return null;_.pop();continue}_.push(p)}return _.length===0?null:{path:`${t&&(h||e.startsWith("/"))?"/":""}${_.join("/")}`,query:c,hash:i}}function B7n(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}function C6(e){return/^[a-z]:[\\/]/i.test(e)}function DB(e){const n=C6(e);if(!n&&S6(e))return null;const t=o5("",n?e.replaceAll("\\","/"):e,!0);if(!t)return null;const r={path:t.path,hash:t.hash};return r.path.startsWith("/")||r.path.startsWith("~/")||n?{...r,source:"absolute"}:r.path.startsWith("artifacts/")?{...r,path:r.path.slice(10),source:"artifact"}:{...r,source:"checkout"}}function P7n(e,n,t){const r=new Array(e);return new Proxy(r,{get(s,i,a){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const c=+i;if(Number.isInteger(c)&&c>=0&&cr[h]!==u))&&(r=o,s=n(...o),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return a.updateDeps=o=>{r=o},a}function gT(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const F7n=(e,n)=>Math.abs(e-n)<1.01,H7n=(e,n,t)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)},{cancel:()=>{e.clearTimeout(r)}})};let Up;const bw=()=>{if(Up!==void 0)return Up;if(typeof navigator>"u")return Up=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Up=!0;const e=navigator.maxTouchPoints;return Up=navigator.platform==="MacIntel"&&e!==void 0&&e>0},vT=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},q7n=e=>e,LB=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(r);for(let i=0;i{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:c}=a;n({width:Math.round(o),height:Math.round(c)})};if(s(vT(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const c=a[0];if(c!=null&&c.borderBoxSize){const u=c.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(vT(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},Vv={passive:!0},G7n=typeof window>"u"?!0:"onscrollend"in window,V7n=(e,n,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const i=e.options.useScrollendEvent&&G7n;let a=0;const o=i?null:H7n(s,()=>n(a,!1),e.options.isScrollingResetDelay),c=_=>()=>{a=t(r),o==null||o(),n(a,_)},u=c(!0),h=c(!1);return r.addEventListener("scroll",u,Vv),i&&r.addEventListener("scrollend",h,Vv),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",h),o==null||o.cancel()}},K7n=(e,n)=>V7n(e,n,t=>{const{horizontal:r,isRtl:s}=e.options;return r?t.scrollLeft*(s&&-1||1):t.scrollTop}),W7n=(e,n,t)=>{if(t.options.useCachedMeasurements){const r=t.indexFromElement(e),s=t.options.getItemKey(r);return t.itemSizeCache.get(s)??t.options.estimateSize(r)}if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const r=t.indexFromElement(e),s=t.options.getItemKey(r),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},Q7n=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:e+n,behavior:t})},X7n=Q7n;class Y7n{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,r,s;return((s=(r=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{const o=i.target,c=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[u,h]of this.elementsCache)if(h===o){this.elementsCache.delete(u);break}return}this.isIndexInRange(c)&&this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(o,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var r,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:q7n,rangeExtractor:LB,onChange:()=>{},measureElement:W7n,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in t){const m=t[p];m!==void 0&&(i[p]=m)}const a=this.options;let o=null,c=null,u=!1;if(a!==void 0&&a.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=a.count,m=i.count,x=this.getMeasurements(),k=p>0?((r=x[0])==null?void 0:r.key)??a.getItemKey(0):null,v=p>0?((s=x[p-1])==null?void 0:s.key)??a.getItemKey(p-1):null;if(m!==p||p>0&&m>0&&(i.getItemKey(0)!==k||i.getItemKey(m-1)!==v)){u=!0;const y=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;y&&(o=[y.key,this.getScrollOffset()-y.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&m>p&&this.isAtEnd(a.scrollEndThreshold)&&(p===0||i.getItemKey(m-1)!==v)&&(c=C)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let h=!1,_=0;if(o&&this.scrollOffset!==null){const[p,m]=o,x=this.getMeasurements(),{count:k,getItemKey:v}=this.options;let b=0;for(;b{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=dd(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===i?this.scrollDirection:o{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!bw()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,Vv),i.addEventListener("touchend",o,Vv),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,a,o,c]=s;i!==null&&!o&&(bw()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?c!==0&&(this._iosDeferredAdjustment+=c):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:t,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=t>s+.5?{target:t,maxAtWrite:s}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),r=this.getMaxScrollOffset();if(t<0||t>r)return;if(this._iosDeferredAdjustment<0&&t>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=dd(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,r,s,i,a,o,c,u)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:c,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:c,gap:u},h)=>{const _=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),o===1){const b=t*2;let w=this._flatMeasurements;if(!w||w.length0&&N.set(w.subarray(0,p*2)),w=N,this._flatMeasurements=w}let y;if(p===0)y=r+s;else{const N=p-1;y=w[N*2]+w[N*2+1]+u}for(let N=p;N1){C=y;const D=x[C],I=D!==void 0?m[D]:void 0;N=I?I.end+u:r+s}else if(v===o){let D=0,I=k[0],$=x[0];for(let q=1;qthis.options.debug}),this.calculateRange=dd(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>t.length===0||r===0?(this.range=null,null):(this.range=J7n(t,r,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=dd(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-i),o=Math.min(this.options.count-1,s+i);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(t);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,r)=>{var s,i;if(!this.isIndexInRange(t))return;let a,o,c;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)c=this.options.getItemKey(t),o=u[t*2],a=u[t*2+1];else{const p=this.measurementsCache[t];if(!p)return;c=p.key,o=p.start,a=p.size}const h=this.itemSizeCache.get(c)??a,_=r-h;if(_!==0){const p=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=p?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(c)?o[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,a=IB(0,r.length-1,i?o=>s[o*2]:o=>gT(r[o]).start,t);return gT(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(r==="auto")if(a.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(a.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(t,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(t,r),a=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,r);if(!i)return;const[a,o]=i,c=this.now();this.scrollState={index:t,align:o,behavior:s,startedAt:c,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,a=this._flatMeasurements;a!=null?s=a[i*2]+a[i*2+1]:s=((t=r[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=t+(r??0),this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){if(n===0)return!1;if(bw()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=n,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+n,s=this.scrollElement,i=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&r>i+.5?{target:r,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,i=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&F7n(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,c=Math.abs(s-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&c>o;this.scrollState.lastTargetOffset=s,u||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const IB=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(ir)n=s-1;else return s}return e>0?e-1:0};function Z7n(e,n,t){let r=0;for(;r<=n;){const s=(r+n)/2|0,i=e[s*2];if(it)n=s-1;else return s}return r>0?r-1:0}function J7n(e,n,t,r,s){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&s!==null){const u=Z7n(s,i,t);let h=u;const _=t+n;for(;he[u].start,t),c=o;if(r===1)for(;c1){const u=Array(r).fill(0);for(;c_=0&&h.some(_=>_>=t);){const _=e[o];h[_.lane]=_.start,o--}o=Math.max(0,o-o%r),c=Math.min(i,c+(r-1-c%r))}return{startIndex:o,endIndex:c}}const yw=typeof document<"u"?A.useLayoutEffect:A.useEffect;function e8n({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...r}){const s=A.useReducer(h=>h+1,0)[1],i=A.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const a=h=>{const _=i.current;if(!_.enabled||!_.container)return;const p=h.getTotalSize();if(p!==_.lastSize){_.lastSize=p;const m=h.options.horizontal?"width":"height";_.container.style[m]=`${p}px`}},o=h=>{const _=i.current;if(!_.enabled||!_.container)return;a(h);const p=!!h.options.horizontal,m=_.mode==="transform",x=p?"left":"top",k=h.options.scrollMargin,v=h.getVirtualItems();for(const b of v){const w=b.start-k,y=h.elementsCache.get(b.key);y&&_.lastPositions.get(y)!==w&&(_.lastPositions.set(y,w),m?y.style.transform=p?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:y.style[x]=`${w}px`)}},c={...r,onChange:(h,_)=>{var p;const m=i.current;let x=!0;if(m.enabled){o(h);const k=h.range,v=m.prevRange;x=!v||v.isScrolling!==h.isScrolling||v.startIndex!==(k==null?void 0:k.startIndex)||v.endIndex!==(k==null?void 0:k.endIndex),x&&(m.prevRange=k?{startIndex:k.startIndex,endIndex:k.endIndex,isScrolling:h.isScrolling}:null)}x&&(e&&_?Mi.flushSync(s):s()),(p=r.onChange)==null||p.call(r,h,_)}},[u]=A.useState(()=>{const h=new Y7n(c);return Object.assign(h,{containerRef:_=>{const p=i.current;if(p.container=_,p.lastSize=null,_&&p.enabled){const m=h.getTotalSize();p.lastSize=m;const x=h.options.horizontal?"width":"height";_.style[x]=`${m}px`}}})});return u.setOptions(c),yw(()=>u._didMount(),[]),yw(()=>(a(u),u._willUpdate())),yw(()=>{o(u)}),u}function t8n(e){return e8n({observeElementRect:U7n,observeElementOffset:K7n,scrollToFn:X7n,...e})}function n8n(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function r8n(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function s8n(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const h=u.parentId??null,_=a.get(h);_?_.push(u):a.set(h,[u])}const o=new Set(n.map(u=>u.id)),c=new Map;for(const u of t){const h=r8n(u,i,a),_=h.findIndex(p=>o.has(p.id));c.set(u.id,{count:h.length,index:_,prevId:_>0?h[_-1].id:void 0,nextId:_=0;i--)for(const a of e[i].parts)if(!(a.type!=="prompt"||(r=a.prompt)!=null&&r.resolved||((s=a.prompt)==null?void 0:s.kind)!=="question"))return a.prompt.nativeId&&!t?null:a.id;return null}function yh(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function Rm(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function $B(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||Rm(r)||!yh(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function BB(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=$B(n.parts);return t?{messageId:n.id,toolId:t}:null}function a8n(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||Rm(r)))return r.type==="text"&&!!r.text}return!1}function o8n(e,n,t,r,s){const i=[...n].filter(o=>!t.has(o)&&r.some(c=>c.id===o)&&o!==s);if(i.length===0&&!(s&&e.has(s)))return e;const a=new Set(e);for(const o of i)a.add(o);return s&&a.delete(s),a}function PB(e,n){if(e.some(r=>{var s;return r.type==="prompt"&&!((s=r.prompt)!=null&&s.resolved)}))return{work:[],answer:e};let t=e.findIndex(r=>r.type==="text"&&r.phase==="final_answer");if(t<0&&!n&&!e.some(r=>r.phase))for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type!=="reasoning"){if(s.type!=="text")break;s.text&&(t=r)}}return t<0||!n&&!e.slice(t).some(r=>yh(r))||!e.slice(0,t).some(r=>yh(r))?{work:[],answer:e}:{work:e.slice(0,t),answer:e.slice(t)}}function FB(e){return e.flatMap(n=>{var r;const t=n.type==="text"?(r=n.text)==null?void 0:r.trim():void 0;return t?[t]:[]}).join(` +`:"")+h.content]}),["",""]),t=An(n,2),r=An(MB(t[0],t[1]),2),s=r[0],i=r[1];if(s.length===0&&i.length===0)return[[],[]];var a=function(u){if(u&&!fl(u))return u.lineNumber},o=a(e.find(_a)),c=a(e.find(Vu));if(o===void 0||c===void 0)throw new Error("Could not find start line number for edit");return[gT(mT(s),o),gT(mT(i),c)]}function L8n(e){var n=e.reduce((function(r,s){var i=An(r,3),a=i[0],o=i[1],c=i[2];if(!c||!_a(c)||!Vu(s))return[a,o,s];var u=An(MB(c.content,s.content),2),h=u[0],_=u[1];return[a.concat(a5(h,c.lineNumber)),o.concat(a5(_,s.lineNumber)),s]}),[[],[],null]),t=An(n,2);return[t[0],t[1]]}function I8n(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?D8n:L8n,r=k6(e.map((function(o){return o.changes})),RB).map(t).reduce((function(o,c){var u=An(o,2),h=u[0],_=u[1],p=An(c,2),m=p[0],w=p[1];return[h.concat(m),_.concat(w)]}),[[],[]]),s=An(r,2),i=s[0],a=s[1];return T8n(hT(i),hT(a))}var $8n=["enhancers"],vT=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=An(p8n(e,Du(t,$8n)),2),a=i[0],o=i[1],c=[_T(a),_T(o)],u=(n=[c[0],c[1]],s.reduce((function(k,v){return v(k)}),n)),h=An(u,2),_=h[0],p=h[1],m=[_.map(fT),p.map(fT)],w=m[1];return{old:m[0].map((function(k){var v;return(v=k.children)!==null&&v!==void 0?v:[]})),new:w.map((function(k){var v;return(v=k.children)!==null&&v!==void 0?v:[]}))}};const o5=["openresearch-diff flex flex-col gap-4","[&_.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(--color-diff-selection)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-background-color:var(--color-diff-gutter-selection)]","[&_.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(--color-diff-insert-gutter)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-text-color:var(--accent-red)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-background-color:var(--color-diff-delete-gutter)]","[&_.openresearch-diff-file]:[--diff-code-insert-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-background-color:var(--color-diff-insert-code)]","[&_.openresearch-diff-file]:[--diff-code-delete-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-background-color:var(--color-diff-delete-code)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-background-color:var(--color-diff-insert-edit)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-background-color:var(--color-diff-delete-edit)]","[&_.openresearch-diff-file]:[--diff-omit-gutter-line-color:var(--color-diff-omit-gutter)]","[&_.openresearch-diff-file]:w-full","[&_.openresearch-diff-file.diff-unified]:table-fixed","[&_.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_.diff-line_>_td:first-child]:p-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-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)]:ps-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-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.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:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:ps-[2ch] [&_.openresearch-diff-file_.diff-code]:pe-4","[&_.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-border"].join(" "),B8n=2e3,P8n={highlight(e,n){return It.highlight(e,n).children}};function F8n(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function _y(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function H8n(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function c5(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 q8n(e){const n=[I8n(e.hunks,{type:"line"})],t=MS(H8n(e));return t&&It.registered(t)?vT(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:P8n}):vT(e.hunks,{enhancers:n,highlight:!1})}function OB(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:J3(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:J3(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const U8n=({change:e,side:n})=>n==="old"?null:F8n(e);function DB({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:dVe()}),f.jsx("p",{children:hKe({limit:Ce(nl(n)),read:Ce(nl(e))})})]})}function LB({file:e,defaultExpanded:n}){const[t,r]=A.useState(n),{additions:s,deletions:i}=A.useMemo(()=>_y(e),[e]),a=t&&s+i<=B8n,o=A.useMemo(()=>{if(a)try{return q8n(e)}catch{return}},[e,a]);return f.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 ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.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-medium [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(c=>!c),children:[f.jsx("span",{className:"chev",children:t?f.jsx(ac,{size:14}):f.jsx(Wa,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:c5(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:FVe()}):f.jsx("div",{className:"diff-file-body min-w-0 py-3.5 bg-background",children:f.jsx(i8n,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:U8n,tokens:o,viewType:"unified"})}))]})}function G8n({files:e,className:n}){return f.jsx("div",{className:n?`${o5} ${n}`:o5,children:e.map((t,r)=>f.jsx(LB,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function V8n(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 IB({diff:e,partial:n=!1}){var p;const t=A.useMemo(()=>OB(e,n),[e,n]),r=t.files,s=A.useMemo(()=>r.map((m,w)=>({file:m,key:`${m.oldPath}→${m.newPath}#${w}`,changes:_y(m)})),[r]),[i,a]=A.useState(null),[o,c]=A.useState(!1),u=o&&!n,h=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,_=s.find(m=>m.key===h)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?OVe():oKe()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:NVe()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.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-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{className:"font-medium",children:n?s.length===1?eKe():yVe({count:tn(s.length)}):s.length===1?HD():FD({count:tn(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>c(m=>!m),children:u?KGe():xKe()})]}),u?f.jsx(G8n,{files:r}):f.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:[f.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-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_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":aVe(),children:s.map(m=>f.jsxs("button",{type:"button",className:m.key===h?"active":"","aria-pressed":m.key===h,onClick:()=>a(m.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:V8n(m.file)}),f.jsx("code",{title:c5(m.file),children:c5(m.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),f.jsx("div",{className:`${o5} diff-explorer-preview min-w-0`,children:_&&f.jsx(LB,{file:_.file,defaultExpanded:!0},_.key)})]})]})}function K8n({expanded:e,experiments:n,runs:t,onOpenExperiment:r,rightOffset:s,activeView:i,projectId:a,onCompute:o,sessionId:c,busy:u,onChanges:h,onFiles:_,onTerminal:p,onArtifacts:m,onExperiments:w}){var C,z;const k=T6n(n,t,c),v=ut({...sI(a),enabled:e}),b=((C=v.data)==null?void 0:C.configuredDefaultBackend)??((z=v.data)==null?void 0:z.defaultBackend),x=b?lf[b]():v.isPending?"…":v.isError?go():g3(),y=[{id:"files",label:c3(),Icon:Ou,onClick:_},{id:"terminal",label:Tv(),Icon:ko,onClick:p},{id:"artifacts",label:wD(),Icon:vS,onClick:m},{id:"experiments",label:kD(),Icon:gh,onClick:w}];return f.jsx("div",{className:"workspace-tools absolute end-3.5 top-7 z-30",style:{insetInlineEnd:s},children:e?f.jsxs("nav",{"aria-label":sw(),className:"workspace-tools-card flex w-60 flex-col gap-0.5 rounded-xl border border-border bg-background px-1.5 py-2 shadow-elevated",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:sw()}),y.filter(E=>E.id!=="files"&&E.id!=="terminal").map(({id:E,label:T,Icon:j,onClick:M})=>f.jsx(Dn,{className:"min-h-7 py-1","data-onboarding":E==="artifacts"?"nav-artifacts":void 0,onClick:M,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(j,{size:15}),T]})},E)),f.jsx(Dn,{className:"py-1",onClick:o,children:f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-4 text-sm text-text",children:[f.jsx(mS,{size:15,className:"shrink-0"}),J1n()]}),f.jsxs("span",{className:"flex items-center gap-1.5 ps-[31px] text-menu text-subtext",children:[b&&f.jsx(Bh,{kind:`${b}_job`,size:12}),f.jsx("span",{className:"wrap-anywhere",children:x})]})]})}),f.jsxs("div",{className:"mt-2 border-t border-border/50 pt-3",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:Rvn()}),f.jsx(Dn,{className:"min-h-7 py-1",onClick:_,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(Ou,{size:15}),c3()]})}),f.jsx(Dn,{className:"min-h-7 py-1",onClick:p,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(ko,{size:15}),Tv()]})}),c&&f.jsx(W8n,{sessionId:c,busy:u,onChanges:h},c),k.length>0&&f.jsxs("div",{children:[f.jsxs("h2",{className:"m-0 flex items-center gap-4 px-2 py-1 text-sm font-normal text-text",children:[f.jsx("span",{className:"flex w-[15px] shrink-0 justify-center",children:f.jsx($d,{tone:"success",live:!0})}),f.jsx("span",{children:V1n()})]}),k.map(E=>f.jsx(Dn,{className:"min-h-7 py-1",onClick:()=>r(E.experiment.id,E.run.id),children:f.jsx("span",{className:"min-w-0 truncate ps-[31px] text-menu text-subtext",title:`${E.experiment.title||E.experiment.slug} · ${h6(la(E.run))}`,children:E.experiment.title||E.experiment.slug})},E.run.id))]})]})]}):f.jsx("nav",{"aria-label":sw(),className:"flex items-center justify-end gap-3",children:y.map(({id:E,label:T,Icon:j,onClick:M})=>f.jsx(Ft,{active:i===E,className:"text-text [&.active]:text-text","data-tip":T,"data-tip-align":E==="experiments"?"end":void 0,"aria-label":T,"aria-pressed":i===E,onClick:M,children:f.jsx(j,{size:15})},E))})})}function W8n({sessionId:e,busy:n,onChanges:t}){var c,u;const r=ut({...Uv(e),refetchInterval:n?5e3:!1}),s=A.useRef(n),{refetch:i}=r;A.useEffect(()=>{s.current&&!n&&i(),s.current=n},[n,i]);const a=r.data,o=A.useMemo(()=>{if(!(a!=null&&a.diff)||a.diff.truncated)return null;const h=OB(a.diff.diff,!1);return h.failed?null:h.files.map(_y).reduce((_,p)=>({additions:_.additions+p.additions,deletions:_.deletions+p.deletions}),{additions:0,deletions:0})},[a==null?void 0:a.diff]);return a!=null&&a.exists?f.jsxs(Dn,{className:"min-h-7 py-1",onClick:t,title:a.branch??tS(),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[f.jsx(zm,{size:15,className:"shrink-0"}),f.jsx("span",{children:MD()})]}),o?f.jsxs("span",{className:"flex shrink-0 gap-1 text-xs tabular-nums",children:[f.jsxs("span",{className:"text-accent-green",children:["+",tn(o.additions)]}),f.jsxs("span",{className:"text-accent-red",children:["−",tn(o.deletions)]})]}):f.jsx("span",{className:"shrink-0 text-xs text-subtext",children:((c=a.files)==null?void 0:c.length)===1?HD():FD({count:tn(((u=a.files)==null?void 0:u.length)??0)})})]}):null}function Q8n({projectId:e,sessionId:n,active:t}){const r=A.useRef(null),s=A.useRef(null),[i,a]=A.useState(null),[o,c]=A.useState(0);return A.useEffect(()=>{const u=r.current;if(!u)return;const h=Fb(u,!1,!0,"app"),{terminal:_,dispose:p}=h;s.current=h,a(null);const m=location.protocol==="https:"?"wss:":"ws:",w=new URL(`/api/projects/${encodeURIComponent(e)}/terminal`,`${m}//${location.host}`);n&&w.searchParams.set("sessionId",n);const k=new WebSocket(w);k.binaryType="arraybuffer";let v=!1;const b=C=>{v||(v=!0,_.options.disableStdin=!0,_.blur(),_.writeln(`\r +${C}`),a(C))},x=_.onData(C=>{k.readyState===WebSocket.OPEN&&k.send(new TextEncoder().encode(C))}),y=_.onResize(({cols:C,rows:z})=>{k.readyState===WebSocket.OPEN&&k.send(JSON.stringify({type:"resize",cols:C,rows:z}))});return k.onopen=()=>{k.send(JSON.stringify({type:"resize",cols:_.cols,rows:_.rows}))},k.onmessage=C=>{if(C.data instanceof ArrayBuffer){_.write(new Uint8Array(C.data));return}if(typeof C.data!="string")return;let z;try{z=JSON.parse(C.data)}catch{return}Nf(z)&&(z.type==="exit"?b(vvn({code:String(z.code)})):z.type==="error"&&typeof z.error=="string"&&b(z.error))},k.onclose=()=>b(Fz()),k.onerror=()=>b(Fz()),()=>{k.onopen=null,k.onmessage=null,k.onerror=null,k.onclose=null,x.dispose(),y.dispose(),k.close(),s.current=null,p()}},[e,n,o]),A.useEffect(()=>{if(!t||i!==null)return;const u=requestAnimationFrame(()=>{var h,_;(h=s.current)==null||h.fit(),(_=s.current)==null||_.terminal.focus()});return()=>cancelAnimationFrame(u)},[t,i,o]),f.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-terminal-app p-2",role:"group","aria-label":Tv(),children:[f.jsx("div",{ref:r,className:"min-h-0 flex-1 overflow-hidden"}),f.jsx("p",{role:"status","aria-live":"polite",className:"sr-only",children:i??""}),i!==null&&f.jsx("div",{className:"flex shrink-0 justify-end pt-2",children:f.jsx(Oe,{autoFocus:!0,onClick:()=>c(u=>u+1),children:Cvn()})})]})}function C6(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function l5(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),c=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const h=u.startsWith("/"),_=h?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(_.length===0)return null;_.pop();continue}_.push(p)}return _.length===0?null:{path:`${t&&(h||e.startsWith("/"))?"/":""}${_.join("/")}`,query:c,hash:i}}function X8n(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}function E6(e){return/^[a-z]:[\\/]/i.test(e)}function $B(e){const n=E6(e);if(!n&&C6(e))return null;const t=l5("",n?e.replaceAll("\\","/"):e,!0);if(!t)return null;const r={path:t.path,hash:t.hash};return r.path.startsWith("/")||r.path.startsWith("~/")||n?{...r,source:"absolute"}:r.path.startsWith("artifacts/")?{...r,path:r.path.slice(10),source:"artifact"}:{...r,source:"checkout"}}function Y8n(e,n,t){const r=new Array(e);return new Proxy(r,{get(s,i,a){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const c=+i;if(Number.isInteger(c)&&c>=0&&cr[h]!==u))&&(r=o,s=n(...o),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return a.updateDeps=o=>{r=o},a}function bT(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Z8n=(e,n)=>Math.abs(e-n)<1.01,J8n=(e,n,t)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)},{cancel:()=>{e.clearTimeout(r)}})};let Gp;const xw=()=>{if(Gp!==void 0)return Gp;if(typeof navigator>"u")return Gp=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Gp=!0;const e=navigator.maxTouchPoints;return Gp=navigator.platform==="MacIntel"&&e!==void 0&&e>0},yT=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},e9n=e=>e,BB=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(r);for(let i=0;i{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:c}=a;n({width:Math.round(o),height:Math.round(c)})};if(s(yT(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const c=a[0];if(c!=null&&c.borderBoxSize){const u=c.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(yT(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},Kv={passive:!0},n9n=typeof window>"u"?!0:"onscrollend"in window,r9n=(e,n,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const i=e.options.useScrollendEvent&&n9n;let a=0;const o=i?null:J8n(s,()=>n(a,!1),e.options.isScrollingResetDelay),c=_=>()=>{a=t(r),o==null||o(),n(a,_)},u=c(!0),h=c(!1);return r.addEventListener("scroll",u,Kv),i&&r.addEventListener("scrollend",h,Kv),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",h),o==null||o.cancel()}},s9n=(e,n)=>r9n(e,n,t=>{const{horizontal:r,isRtl:s}=e.options;return r?t.scrollLeft*(s&&-1||1):t.scrollTop}),i9n=(e,n,t)=>{if(t.options.useCachedMeasurements){const r=t.indexFromElement(e),s=t.options.getItemKey(r);return t.itemSizeCache.get(s)??t.options.estimateSize(r)}if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const r=t.indexFromElement(e),s=t.options.getItemKey(r),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},a9n=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:e+n,behavior:t})},o9n=a9n;class c9n{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,r,s;return((s=(r=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{const o=i.target,c=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[u,h]of this.elementsCache)if(h===o){this.elementsCache.delete(u);break}return}this.isIndexInRange(c)&&this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(o,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var r,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:e9n,rangeExtractor:BB,onChange:()=>{},measureElement:i9n,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in t){const m=t[p];m!==void 0&&(i[p]=m)}const a=this.options;let o=null,c=null,u=!1;if(a!==void 0&&a.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=a.count,m=i.count,w=this.getMeasurements(),k=p>0?((r=w[0])==null?void 0:r.key)??a.getItemKey(0):null,v=p>0?((s=w[p-1])==null?void 0:s.key)??a.getItemKey(p-1):null;if(m!==p||p>0&&m>0&&(i.getItemKey(0)!==k||i.getItemKey(m-1)!==v)){u=!0;const y=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??w[0]:null;y&&(o=[y.key,this.getScrollOffset()-y.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&m>p&&this.isAtEnd(a.scrollEndThreshold)&&(p===0||i.getItemKey(m-1)!==v)&&(c=C)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let h=!1,_=0;if(o&&this.scrollOffset!==null){const[p,m]=o,w=this.getMeasurements(),{count:k,getItemKey:v}=this.options;let b=0;for(;b{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=hd(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===i?this.scrollDirection:o{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!xw()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,Kv),i.addEventListener("touchend",o,Kv),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,a,o,c]=s;i!==null&&!o&&(xw()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?c!==0&&(this._iosDeferredAdjustment+=c):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:t,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=t>s+.5?{target:t,maxAtWrite:s}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),r=this.getMaxScrollOffset();if(t<0||t>r)return;if(this._iosDeferredAdjustment<0&&t>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=hd(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,r,s,i,a,o,c,u)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:c,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:c,gap:u},h)=>{const _=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),o===1){const b=t*2;let x=this._flatMeasurements;if(!x||x.length0&&z.set(x.subarray(0,p*2)),x=z,this._flatMeasurements=x}let y;if(p===0)y=r+s;else{const z=p-1;y=x[z*2]+x[z*2+1]+u}for(let z=p;z1){C=y;const D=w[C],I=D!==void 0?m[D]:void 0;z=I?I.end+u:r+s}else if(v===o){let D=0,I=k[0],$=w[0];for(let q=1;qthis.options.debug}),this.calculateRange=hd(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>t.length===0||r===0?(this.range=null,null):(this.range=u9n(t,r,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=hd(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-i),o=Math.min(this.options.count-1,s+i);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(t);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,r)=>{var s,i;if(!this.isIndexInRange(t))return;let a,o,c;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)c=this.options.getItemKey(t),o=u[t*2],a=u[t*2+1];else{const p=this.measurementsCache[t];if(!p)return;c=p.key,o=p.start,a=p.size}const h=this.itemSizeCache.get(c)??a,_=r-h;if(_!==0){const p=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=p?this.getTotalSize():0,w=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(c)?o[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,a=PB(0,r.length-1,i?o=>s[o*2]:o=>bT(r[o]).start,t);return bT(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(r==="auto")if(a.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(a.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(t,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(t,r),a=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,r);if(!i)return;const[a,o]=i,c=this.now();this.scrollState={index:t,align:o,behavior:s,startedAt:c,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,a=this._flatMeasurements;a!=null?s=a[i*2]+a[i*2+1]:s=((t=r[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=t+(r??0),this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){if(n===0)return!1;if(xw()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=n,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+n,s=this.scrollElement,i=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&r>i+.5?{target:r,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,i=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&Z8n(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,c=Math.abs(s-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&c>o;this.scrollState.lastTargetOffset=s,u||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const PB=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(ir)n=s-1;else return s}return e>0?e-1:0};function l9n(e,n,t){let r=0;for(;r<=n;){const s=(r+n)/2|0,i=e[s*2];if(it)n=s-1;else return s}return r>0?r-1:0}function u9n(e,n,t,r,s){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&s!==null){const u=l9n(s,i,t);let h=u;const _=t+n;for(;he[u].start,t),c=o;if(r===1)for(;c1){const u=Array(r).fill(0);for(;c_=0&&h.some(_=>_>=t);){const _=e[o];h[_.lane]=_.start,o--}o=Math.max(0,o-o%r),c=Math.min(i,c+(r-1-c%r))}return{startIndex:o,endIndex:c}}const ww=typeof document<"u"?A.useLayoutEffect:A.useEffect;function _9n({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...r}){const s=A.useReducer(h=>h+1,0)[1],i=A.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const a=h=>{const _=i.current;if(!_.enabled||!_.container)return;const p=h.getTotalSize();if(p!==_.lastSize){_.lastSize=p;const m=h.options.horizontal?"width":"height";_.container.style[m]=`${p}px`}},o=h=>{const _=i.current;if(!_.enabled||!_.container)return;a(h);const p=!!h.options.horizontal,m=_.mode==="transform",w=p?"left":"top",k=h.options.scrollMargin,v=h.getVirtualItems();for(const b of v){const x=b.start-k,y=h.elementsCache.get(b.key);y&&_.lastPositions.get(y)!==x&&(_.lastPositions.set(y,x),m?y.style.transform=p?`translate3d(${x}px, 0, 0)`:`translate3d(0, ${x}px, 0)`:y.style[w]=`${x}px`)}},c={...r,onChange:(h,_)=>{var p;const m=i.current;let w=!0;if(m.enabled){o(h);const k=h.range,v=m.prevRange;w=!v||v.isScrolling!==h.isScrolling||v.startIndex!==(k==null?void 0:k.startIndex)||v.endIndex!==(k==null?void 0:k.endIndex),w&&(m.prevRange=k?{startIndex:k.startIndex,endIndex:k.endIndex,isScrolling:h.isScrolling}:null)}w&&(e&&_?Fi.flushSync(s):s()),(p=r.onChange)==null||p.call(r,h,_)}},[u]=A.useState(()=>{const h=new c9n(c);return Object.assign(h,{containerRef:_=>{const p=i.current;if(p.container=_,p.lastSize=null,_&&p.enabled){const m=h.getTotalSize();p.lastSize=m;const w=h.options.horizontal?"width":"height";_.style[w]=`${m}px`}}})});return u.setOptions(c),ww(()=>u._didMount(),[]),ww(()=>(a(u),u._willUpdate())),ww(()=>{o(u)}),u}function f9n(e){return _9n({observeElementRect:t9n,observeElementOffset:s9n,scrollToFn:o9n,...e})}function d9n(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function h9n(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function p9n(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const h=u.parentId??null,_=a.get(h);_?_.push(u):a.set(h,[u])}const o=new Set(n.map(u=>u.id)),c=new Map;for(const u of t){const h=h9n(u,i,a),_=h.findIndex(p=>o.has(p.id));c.set(u.id,{count:h.length,index:_,prevId:_>0?h[_-1].id:void 0,nextId:_=0;i--)for(const a of e[i].parts)if(!(a.type!=="prompt"||(r=a.prompt)!=null&&r.resolved||((s=a.prompt)==null?void 0:s.kind)!=="question"))return a.prompt.nativeId&&!t?null:a.id;return null}function xh(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function Mm(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function FB(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||Mm(r)||!xh(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function HB(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=FB(n.parts);return t?{messageId:n.id,toolId:t}:null}function g9n(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||Mm(r)))return r.type==="text"&&!!r.text}return!1}function v9n(e,n,t,r,s){const i=[...n].filter(o=>!t.has(o)&&r.some(c=>c.id===o)&&o!==s);if(i.length===0&&!(s&&e.has(s)))return e;const a=new Set(e);for(const o of i)a.add(o);return s&&a.delete(s),a}function qB(e,n){if(e.some(r=>{var s;return r.type==="prompt"&&!((s=r.prompt)!=null&&s.resolved)}))return{work:[],answer:e};let t=e.findIndex(r=>r.type==="text"&&r.phase==="final_answer");if(t<0&&!n&&!e.some(r=>r.phase))for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type!=="reasoning"){if(s.type!=="text")break;s.text&&(t=r)}}return t<0||!n&&!e.slice(t).some(r=>xh(r))||!e.slice(0,t).some(r=>xh(r))?{work:[],answer:e}:{work:e.slice(0,t),answer:e.slice(t)}}function UB(e){return e.flatMap(n=>{var r;const t=n.type==="text"?(r=n.text)==null?void 0:r.trim():void 0;return t?[t]:[]}).join(` -`)}function HB(e){return FB(PB(e.parts,!1).answer)}function c8n(e){for(let n=e.length-1;n>=0;n--){if(e[n].role!=="assistant")continue;const t=HB(e[n]);if(t)return t}return""}function l8n(e,n,t){const r=n.flatMap(s=>{const i=FB(s.parts);return i?[`## ${s.role==="user"?t.user:t.assistant} +`)}function GB(e){return UB(qB(e.parts,!1).answer)}function b9n(e){for(let n=e.length-1;n>=0;n--){if(e[n].role!=="assistant")continue;const t=GB(e[n]);if(t)return t}return""}function y9n(e,n,t){const r=n.flatMap(s=>{const i=UB(s.parts);return i?[`## ${s.role==="user"?t.user:t.assistant} ${i}`]:[]});return r.length===0?null:[`# ${e}`,...r].join(` `)+` -`}function u8n(e){return`${e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").slice(0,80).replace(/^-+|-+$/g,"")||"chat"}.md`}function qB(e){var n,t;return e.type==="tool"&&e.tool==="error"&&/^(?:ActionRequiredError:\s*)?Named models unavailable\b/i.test(((t=(n=e.state)==null?void 0:n.error)==null?void 0:t.trim())??"")}function c5(e){var t,r,s;if(qB(e)||((r=(t=e.state)==null?void 0:t.input)==null?void 0:r.errorKind)==="claude_usage_limit")return!0;const n=e.type==="text"?e.text:e.tool==="error"?(s=e.state)==null?void 0:s.error:null;return e.type==="tool"&&e.tool==="error"&&n&&/usageLimitExceeded|rateLimitExceeded|insufficient_quota|(?:usage|rate|session) limit|(?:exceeded|exhausted) (?:your |the |current )*quota|insufficient (?:credits|balance)|(?:credit|quota)[ _-](?:exhausted|exceeded)/i.test(n)?!0:!!(n&&(/^(?:claude: )?you(?:'ve| have) reached your .+ limit\./i.test(n.trim())&&n.includes("claude.ai/settings/usage")||/^(?:claude: )?you(?:'ve| have) hit your session limit · resets /i.test(n.trim())))}const Lo=e=>new Intl.NumberFormat(E()).format(e);function _8n(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?M9t():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?b9t({attempt:Lo(e.attempt),maximum:Lo(e.maximum),seconds:Lo(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?f9t({attempt:Lo(e.attempt),maximum:Lo(e.maximum)}):typeof e.attempt=="number"&&t!=null?E9t({attempt:Lo(e.attempt),seconds:Lo(t)}):typeof e.attempt=="number"?i9t({attempt:Lo(e.attempt)}):t!=null?P9t({seconds:Lo(t)}):cL()}function f8n(e,n){if(typeof e!="number")return K9t();const t=Math.max(0,Math.ceil((e-n)/1e3));return eEt({seconds:Lo(t)})}function UB(e){return e==="retry"||e==="continue"?e:null}function d8n(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}const xw={draft:"",attachments:[],annotations:[]};function h8n(e,n){return(e.draft===""||e.draft===n)&&e.attachments.length===0&&e.annotations.length===0?null:{...e,annotations:e.annotations.map(({range:r,...s})=>s)}}function p8n(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function bT(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"||e==="pubmed"?e:void 0}function m8n(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";if(t.includes("pubmed.ncbi.nlm.nih.gov")||t.includes("ncbi.nlm.nih.gov/pubmed")||t.startsWith("pmid:"))return"pubmed";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":/^\d{1,9}$/.test(n)?"pubmed":"alphaxiv"}function E6(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;anew Intl.NumberFormat(N()).format(e);function w9n(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?U9t():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?T9t({attempt:Bo(e.attempt),maximum:Bo(e.maximum),seconds:Bo(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?k9t({attempt:Bo(e.attempt),maximum:Bo(e.maximum)}):typeof e.attempt=="number"&&t!=null?I9t({attempt:Bo(e.attempt),seconds:Bo(t)}):typeof e.attempt=="number"?m9t({attempt:Bo(e.attempt)}):t!=null?Y9t({seconds:Bo(t)}):uL()}function k9n(e,n){if(typeof e!="number")return sEt();const t=Math.max(0,Math.ceil((e-n)/1e3));return _Et({seconds:Bo(t)})}function KB(e){return e==="retry"||e==="continue"?e:null}function S9n(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}const kw={draft:"",attachments:[],annotations:[]};function C9n(e,n){return(e.draft===""||e.draft===n)&&e.attachments.length===0&&e.annotations.length===0?null:{...e,annotations:e.annotations.map(({range:r,...s})=>s)}}function E9n(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function xT(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"||e==="pubmed"?e:void 0}function N9n(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";if(t.includes("pubmed.ncbi.nlm.nih.gov")||t.includes("ncbi.nlm.nih.gov/pubmed")||t.startsWith("pmid:"))return"pubmed";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":/^\d{1,9}$/.test(n)?"pubmed":"alphaxiv"}function N6(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;a"||o==="&")break;/\s/.test(o)?i():(t+=o,r=!0)}return i(),n}function g8n(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=E6(e);if(t.length===1)return t[0]}return e}function v8n(e){var t,r,s;let n=0;for(;["do","then","else","if","while","until"].includes(e[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="env")for(n++;(t=e[n])!=null&&t.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="command"){if(n++,["-v","-V"].includes(e[n]))return null;for(;(r=e[n])!=null&&r.startsWith("-");)n++}return((s=e[n])==null?void 0:s.split("/").pop())!=="orx"?null:e.slice(n+1)}function xh(e){return v8n(typeof e=="string"?E6(e):e)}function b8n(e){var t;const n=(t=e[0])==null?void 0:t.split("/").pop();return!n||!["sh","bash","zsh"].includes(n)||e[1]!=="-lc"?null:e[2]??null}function y8n(e,n){const t=xh(e);return t===null?!1:n.split("\\s+").every((s,i)=>t[i]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[i]))}function x8n(e){var c;const n=xh(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],i=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let u=1;u +`&&(t+=c,r=!0);continue}if(s){o===s?s=null:t+=o,r=!0;continue}if(o==='"'||o==="'"){s=o,r=!0;continue}if(o==="|"||o===";"||o===">"||o==="&")break;/\s/.test(o)?i():(t+=o,r=!0)}return i(),n}function z9n(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=N6(e);if(t.length===1)return t[0]}return e}function j9n(e){var t,r,s;let n=0;for(;["do","then","else","if","while","until"].includes(e[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="env")for(n++;(t=e[n])!=null&&t.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="command"){if(n++,["-v","-V"].includes(e[n]))return null;for(;(r=e[n])!=null&&r.startsWith("-");)n++}return((s=e[n])==null?void 0:s.split("/").pop())!=="orx"?null:e.slice(n+1)}function wh(e){return j9n(typeof e=="string"?N6(e):e)}function T9n(e){var t;const n=(t=e[0])==null?void 0:t.split("/").pop();return!n||!["sh","bash","zsh"].includes(n)||e[1]!=="-lc"?null:e[2]??null}function A9n(e,n){const t=wh(e);return t===null?!1:n.split("\\s+").every((s,i)=>t[i]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[i]))}function R9n(e){var c;const n=wh(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],i=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let u=1;u -`,k8n='',S8n=` +`,O9n='',D9n=` -`,C8n=`Pm -`,GB={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv",pubmed:"PubMed"},E8n={alphaxiv:w8n,openalex:S8n,biorxiv:k8n,pubmed:C8n};function VB({source:e,size:n=16,decorative:t=!1,className:r=""}){return f.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-logo [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:n,height:n},...t?{"aria-hidden":!0}:{role:"img","aria-label":GB[e]},dangerouslySetInnerHTML:{__html:E8n[e]}})}function N8n(e){const t=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return t?t[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function z8n(e,n){const t=n.trim();if(e==="alphaxiv"){const i=(t.split(/[?#]/)[0].split("/").pop()||t).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(i)}`}if(e==="pubmed"){const s=t.split(/[?#]/)[0],i=/^pmid:/i.test(s)?s.slice(5).trim():s.replace(/\/+$/,"").split("/").pop();if(i&&/^\d{1,9}$/.test(i))return`https://pubmed.ncbi.nlm.nih.gov/${i}/`}const r=N8n(t);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const s=t.split("/").pop()||t;return`https://openalex.org/${encodeURIComponent(s)}`}return`https://doi.org/${t}`}const j8n=["alphaxiv","openalex","biorxiv","pubmed"];function T8n(){const e=wxn(),{data:n}=ct(e),t=an({mutationFn:xyn,onSuccess:i=>Jr(e.queryKey,i)}),r=t.isPending,s=i=>{n&&!r&&t.mutate({...n,[i]:!n[i]})};return n?f.jsx("div",{className:"flex flex-col",children:j8n.map(i=>{const a=n[i];return f.jsxs(Jn,{type:"button",role:"switch","aria-checked":a,disabled:r,onClick:()=>s(i),children:[f.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[f.jsx(VB,{source:i,size:16,decorative:!0}),GB[i]]}),f.jsx(awn,{checked:a,"aria-hidden":"true"})]},i)})}):f.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:RZe()})}function ww(e,n){if(!e)throw new Error("Assertion Error")}function f_(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function A8n(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function R8n(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` -`}]}function M8n(e,n){const t=n.value?n.value+` -`:"",r={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function O8n(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function D8n(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const _i=Lu(/[A-Za-z]/),Ws=Lu(/[\dA-Za-z]/),L8n=Lu(/[#-'*+\--9=?A-Z^-~]/);function Kv(e){return e!==null&&(e<32||e===127)}const l5=Lu(/\d/),I8n=Lu(/[\dA-Fa-f]/),$8n=Lu(/[!-/:-@[-`{-~]/);function Tt(e){return e!==null&&e<-2}function ur(e){return e!==null&&(e<0||e===32)}function yn(e){return e===-2||e===-1||e===32}const uy=Lu(new RegExp("\\p{P}|\\p{S}","u")),tf=Lu(/\s/);function Lu(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Hh(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&i<57344){const o=e.charCodeAt(t+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+s+1,a=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function B8n(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=Hh(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,u),e.applyData(n,u)}function P8n(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function F8n(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function KB(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const s=e.all(n),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function H8n(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return KB(e,n);const s={src:Hh(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,i),e.applyData(n,i)}function q8n(e,n){const t={src:Hh(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function U8n(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function G8n(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return KB(e,n);const s={href:Hh(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function V8n(e,n){const t={href:Hh(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function K8n(e,n,t){const r=e.all(n),s=t?W8n(t):WB(n),i={},a=[];if(typeof n.checked=="boolean"){const h=r[0];let _;h&&h.type==="element"&&h.tagName==="p"?_=h:(_={type:"element",tagName:"p",properties:{},children:[]},r.unshift(_)),_.children.length>0&&_.children.unshift({type:"text",value:" "}),_.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++oPm +`,WB={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv",pubmed:"PubMed"},I9n={alphaxiv:M9n,openalex:D9n,biorxiv:O9n,pubmed:L9n};function QB({source:e,size:n=16,decorative:t=!1,className:r=""}){return f.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-logo [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:n,height:n},...t?{"aria-hidden":!0}:{role:"img","aria-label":WB[e]},dangerouslySetInnerHTML:{__html:I9n[e]}})}function $9n(e){const t=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return t?t[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function B9n(e,n){const t=n.trim();if(e==="alphaxiv"){const i=(t.split(/[?#]/)[0].split("/").pop()||t).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(i)}`}if(e==="pubmed"){const s=t.split(/[?#]/)[0],i=/^pmid:/i.test(s)?s.slice(5).trim():s.replace(/\/+$/,"").split("/").pop();if(i&&/^\d{1,9}$/.test(i))return`https://pubmed.ncbi.nlm.nih.gov/${i}/`}const r=$9n(t);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const s=t.split("/").pop()||t;return`https://openalex.org/${encodeURIComponent(s)}`}return`https://doi.org/${t}`}const P9n=["alphaxiv","openalex","biorxiv","pubmed"];function F9n(){const e=M2n(),{data:n}=ut(e),t=dn({mutationFn:Rxn,onSuccess:i=>Yr(e.queryKey,i)}),r=t.isPending,s=i=>{n&&!r&&t.mutate({...n,[i]:!n[i]})};return n?f.jsx("div",{className:"flex flex-col",children:P9n.map(i=>{const a=n[i];return f.jsxs(Dn,{type:"button",role:"switch","aria-checked":a,disabled:r,onClick:()=>s(i),children:[f.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[f.jsx(QB,{source:i,size:16,decorative:!0}),WB[i]]}),f.jsx(g4n,{checked:a,"aria-hidden":"true"})]},i)})}):f.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:qZe()})}function Sw(e,n){if(!e)throw new Error("Assertion Error")}function y_(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function H9n(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function q9n(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` +`}]}function U9n(e,n){const t=n.value?n.value+` +`:"",r={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function G9n(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function V9n(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const di=Ku(/[A-Za-z]/),Xs=Ku(/[\dA-Za-z]/),K9n=Ku(/[#-'*+\--9=?A-Z^-~]/);function Wv(e){return e!==null&&(e<32||e===127)}const _5=Ku(/\d/),W9n=Ku(/[\dA-Fa-f]/),Q9n=Ku(/[!-/:-@[-`{-~]/);function Rt(e){return e!==null&&e<-2}function fr(e){return e!==null&&(e<0||e===32)}function Cn(e){return e===-2||e===-1||e===32}const fy=Ku(new RegExp("\\p{P}|\\p{S}","u")),uf=Ku(/\s/);function Ku(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function qh(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&i<57344){const o=e.charCodeAt(t+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+s+1,a=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function X9n(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=qh(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,u),e.applyData(n,u)}function Y9n(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Z9n(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function XB(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const s=e.all(n),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function J9n(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return XB(e,n);const s={src:qh(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,i),e.applyData(n,i)}function eEn(e,n){const t={src:qh(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function tEn(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function nEn(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return XB(e,n);const s={href:qh(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function rEn(e,n){const t={href:qh(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function sEn(e,n,t){const r=e.all(n),s=t?iEn(t):YB(n),i={},a=[];if(typeof n.checked=="boolean"){const h=r[0];let _;h&&h.type==="element"&&h.tagName==="p"?_=h:(_={type:"element",tagName:"p",properties:{},children:[]},r.unshift(_)),_.children.length>0&&_.children.unshift({type:"text",value:" "}),_.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o1}function Q8n(e,n){const t={},r=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++s0&&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 J8n(e){const n=N6(e),t=QB(e);if(n&&t)return{start:n,end:t}}function e9n(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),s.push(a)}if(t.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=N6(n.children[1]),c=QB(n.children[n.children.length-1]);o&&c&&(a.position={start:o,end:c}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,i),e.applyData(n,i)}function t9n(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",a=t&&t.type==="table"?t.align:void 0,o=a?a.length:n.children.length;let c=-1;const u=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return i.push(wT(n.slice(s),s>0,!1)),i.join("")}function wT(e,n,t){let r=0,s=e.length;if(n){let i=e.codePointAt(r);for(;i===yT||i===xT;)r++,i=e.codePointAt(r)}if(t){let i=e.codePointAt(s-1);for(;i===yT||i===xT;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function s9n(e,n){const t={type:"text",value:r9n(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function i9n(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const a9n={blockquote:A8n,break:R8n,code:M8n,delete:O8n,emphasis:D8n,footnoteReference:B8n,heading:P8n,html:F8n,imageReference:H8n,image:q8n,inlineCode:U8n,linkReference:G8n,link:V8n,listItem:K8n,list:Q8n,paragraph:X8n,root:Y8n,strong:Z8n,table:e9n,tableCell:n9n,tableRow:t9n,text:s9n,thematicBreak:i9n,toml:m1,yaml:m1,definition:m1,footnoteDefinition:m1};function m1(){}const YB=-1,_y=0,p0=1,Wv=2,z6=3,j6=4,T6=5,A6=6,ZB=7,JB=8,o9n=typeof self=="object"?self:globalThis,kT=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new o9n[e](n)},c9n=(e,n)=>{const t=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case _y:case YB:return t(a,s);case p0:{const o=t([],s);for(const c of a)o.push(r(c));return o}case Wv:{const o=t({},s);for(const[c,u]of a)o[r(c)]=r(u);return o}case z6:return t(new Date(a),s);case j6:{const{source:o,flags:c}=a;return t(new RegExp(o,c),s)}case T6:{const o=t(new Map,s);for(const[c,u]of a)o.set(r(c),r(u));return o}case A6:{const o=t(new Set,s);for(const c of a)o.add(r(c));return o}case ZB:{const{name:o,message:c}=a;return t(kT(o,c),s)}case JB:return t(BigInt(a),s);case"BigInt":return t(Object(BigInt(a)),s);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return t(new DataView(o),a)}}return t(kT(i,a),s)};return r},ST=e=>c9n(new Map,e)(0),g_="",{toString:l9n}={},{keys:u9n}=Object,Gp=e=>{const n=typeof e;if(n!=="object"||!e)return[_y,n];const t=l9n.call(e).slice(8,-1);switch(t){case"Array":return[p0,g_];case"Object":return[Wv,g_];case"Date":return[z6,g_];case"RegExp":return[j6,g_];case"Map":return[T6,g_];case"Set":return[A6,g_];case"DataView":return[p0,t]}return t.includes("Array")?[p0,t]:t.includes("Error")?[ZB,t]:[Wv,t]},g1=([e,n])=>e===_y&&(n==="function"||n==="symbol"),_9n=(e,n,t,r)=>{const s=(a,o)=>{const c=r.push(a)-1;return t.set(o,c),c},i=a=>{if(t.has(a))return t.get(a);let[o,c]=Gp(a);switch(o){case _y:{let h=a;switch(c){case"bigint":o=JB,h=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return s([YB],a)}return s([o,h],a)}case p0:{if(c){let p=a;return c==="DataView"?p=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(a)),s([c,[...p]],a)}const h=[],_=s([o,h],a);for(const p of a)h.push(i(p));return _}case Wv:{if(c)switch(c){case"BigInt":return s([c,a.toString()],a);case"Boolean":case"Number":case"String":return s([c,a.valueOf()],a)}if(n&&"toJSON"in a)return i(a.toJSON());const h=[],_=s([o,h],a);for(const p of u9n(a))(e||!g1(Gp(a[p])))&&h.push([i(p),i(a[p])]);return _}case z6:return s([o,isNaN(a.getTime())?g_:a.toISOString()],a);case j6:{const{source:h,flags:_}=a;return s([o,{source:h,flags:_}],a)}case T6:{const h=[],_=s([o,h],a);for(const[p,m]of a)(e||!(g1(Gp(p))||g1(Gp(m))))&&h.push([i(p),i(m)]);return _}case A6:{const h=[],_=s([o,h],a);for(const p of a)(e||!g1(Gp(p)))&&h.push(i(p));return _}}const{message:u}=a;return s([o,{name:c,message:u}],a)};return i},CT=(e,{json:n,lossy:t}={})=>{const r=[];return _9n(!(n||t),!!n,new Map,r)(e),r},Qv=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?ST(CT(e,n)):structuredClone(e):(e,n)=>ST(CT(e,n));function f9n(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function d9n(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function h9n(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||f9n,r=e.options.footnoteBackLabel||d9n,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c0&&x.push({type:"text",value:" "});let w=typeof t=="string"?t:t(c,m);typeof w=="string"&&(w={type:"text",value:w}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=h[h.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else h.push(...x);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(h,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Qv(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:i,children:a};return e.patch(n,u),e.applyData(n,u)}function iEn(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r1}function aEn(e,n){const t={},r=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++s0&&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 uEn(e){const n=z6(e),t=ZB(e);if(n&&t)return{start:n,end:t}}function _En(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),s.push(a)}if(t.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=z6(n.children[1]),c=ZB(n.children[n.children.length-1]);o&&c&&(a.position={start:o,end:c}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,i),e.applyData(n,i)}function fEn(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",a=t&&t.type==="table"?t.align:void 0,o=a?a.length:n.children.length;let c=-1;const u=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return i.push(ST(n.slice(s),s>0,!1)),i.join("")}function ST(e,n,t){let r=0,s=e.length;if(n){let i=e.codePointAt(r);for(;i===wT||i===kT;)r++,i=e.codePointAt(r)}if(t){let i=e.codePointAt(s-1);for(;i===wT||i===kT;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function pEn(e,n){const t={type:"text",value:hEn(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function mEn(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const gEn={blockquote:H9n,break:q9n,code:U9n,delete:G9n,emphasis:V9n,footnoteReference:X9n,heading:Y9n,html:Z9n,imageReference:J9n,image:eEn,inlineCode:tEn,linkReference:nEn,link:rEn,listItem:sEn,list:aEn,paragraph:oEn,root:cEn,strong:lEn,table:_En,tableCell:dEn,tableRow:fEn,text:pEn,thematicBreak:mEn,toml:m1,yaml:m1,definition:m1,footnoteDefinition:m1};function m1(){}const eP=-1,dy=0,m0=1,Qv=2,j6=3,T6=4,A6=5,R6=6,tP=7,nP=8,vEn=typeof self=="object"?self:globalThis,CT=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new vEn[e](n)},bEn=(e,n)=>{const t=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case dy:case eP:return t(a,s);case m0:{const o=t([],s);for(const c of a)o.push(r(c));return o}case Qv:{const o=t({},s);for(const[c,u]of a)o[r(c)]=r(u);return o}case j6:return t(new Date(a),s);case T6:{const{source:o,flags:c}=a;return t(new RegExp(o,c),s)}case A6:{const o=t(new Map,s);for(const[c,u]of a)o.set(r(c),r(u));return o}case R6:{const o=t(new Set,s);for(const c of a)o.add(r(c));return o}case tP:{const{name:o,message:c}=a;return t(CT(o,c),s)}case nP:return t(BigInt(a),s);case"BigInt":return t(Object(BigInt(a)),s);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return t(new DataView(o),a)}}return t(CT(i,a),s)};return r},ET=e=>bEn(new Map,e)(0),C_="",{toString:yEn}={},{keys:xEn}=Object,Vp=e=>{const n=typeof e;if(n!=="object"||!e)return[dy,n];const t=yEn.call(e).slice(8,-1);switch(t){case"Array":return[m0,C_];case"Object":return[Qv,C_];case"Date":return[j6,C_];case"RegExp":return[T6,C_];case"Map":return[A6,C_];case"Set":return[R6,C_];case"DataView":return[m0,t]}return t.includes("Array")?[m0,t]:t.includes("Error")?[tP,t]:[Qv,t]},g1=([e,n])=>e===dy&&(n==="function"||n==="symbol"),wEn=(e,n,t,r)=>{const s=(a,o)=>{const c=r.push(a)-1;return t.set(o,c),c},i=a=>{if(t.has(a))return t.get(a);let[o,c]=Vp(a);switch(o){case dy:{let h=a;switch(c){case"bigint":o=nP,h=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return s([eP],a)}return s([o,h],a)}case m0:{if(c){let p=a;return c==="DataView"?p=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(a)),s([c,[...p]],a)}const h=[],_=s([o,h],a);for(const p of a)h.push(i(p));return _}case Qv:{if(c)switch(c){case"BigInt":return s([c,a.toString()],a);case"Boolean":case"Number":case"String":return s([c,a.valueOf()],a)}if(n&&"toJSON"in a)return i(a.toJSON());const h=[],_=s([o,h],a);for(const p of xEn(a))(e||!g1(Vp(a[p])))&&h.push([i(p),i(a[p])]);return _}case j6:return s([o,isNaN(a.getTime())?C_:a.toISOString()],a);case T6:{const{source:h,flags:_}=a;return s([o,{source:h,flags:_}],a)}case A6:{const h=[],_=s([o,h],a);for(const[p,m]of a)(e||!(g1(Vp(p))||g1(Vp(m))))&&h.push([i(p),i(m)]);return _}case R6:{const h=[],_=s([o,h],a);for(const p of a)(e||!g1(Vp(p)))&&h.push(i(p));return _}}const{message:u}=a;return s([o,{name:c,message:u}],a)};return i},NT=(e,{json:n,lossy:t}={})=>{const r=[];return wEn(!(n||t),!!n,new Map,r)(e),r},Xv=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?ET(NT(e,n)):structuredClone(e):(e,n)=>ET(NT(e,n));function kEn(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function SEn(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function CEn(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||kEn,r=e.options.footnoteBackLabel||SEn,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c0&&w.push({type:"text",value:" "});let x=typeof t=="string"?t:t(c,m);typeof x=="string"&&(x={type:"text",value:x}),w.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,m),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const v=h[h.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...w)}else h.push(...w);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(h,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Xv(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const Mm=(function(e){if(e==null)return v9n;if(typeof e=="function")return fy(e);if(typeof e=="object")return Array.isArray(e)?p9n(e):m9n(e);if(typeof e=="string")return g9n(e);throw new Error("Expected function, string, or object as test")});function p9n(e){const n=[];let t=-1;for(;++t":""))+")"})}return p;function p(){let m=eP,x,k,v;if((!n||i(c,u,h[h.length-1]||void 0))&&(m=x9n(t(c,h)),m[0]===u5))return m;if("children"in c&&c.children){const b=c;if(b.children&&m[0]!==tP)for(k=(r?b.children.length:-1)+a,v=h.concat(b);k>-1&&k":""))+")"})}return p;function p(){let m=rP,w,k,v;if((!n||i(c,u,h[h.length-1]||void 0))&&(m=REn(t(c,h)),m[0]===f5))return m;if("children"in c&&c.children){const b=c;if(b.children&&m[0]!==sP)for(k=(r?b.children.length:-1)+a,v=h.concat(b);k>-1&&k0&&t.push({type:"text",value:` -`}),t}function ET(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function NT(e,n){const t=k9n(e,n),r=t.one(e,void 0),s=h9n(t),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function Xv(e,n){return e&&"run"in e?async function(t,r){const s=NT(t,{file:r,...n});await e.run(s,r)}:function(t,r){return NT(t,{file:r,...e||n})}}function zT(e){if(e)throw e}var kw,jT;function z9n(){if(jT)return kw;jT=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},i=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var h=e.call(u,"constructor"),_=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!h&&!_)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},a=function(u,h){t&&h.name==="__proto__"?t(u,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):u[h.name]=h.newValue},o=function(u,h){if(h==="__proto__")if(e.call(u,h)){if(r)return r(u,h).value}else return;return u[h]};return kw=function c(){var u,h,_,p,m,x,k=arguments[0],v=1,b=arguments.length,w=!1;for(typeof k=="boolean"&&(w=k,k=arguments[1]||{},v=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});va.length;let c;o&&a.push(s);try{c=e.apply(this,a)}catch(u){const h=u;if(o&&t)throw h;return s(h)}o||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...o){t||(t=!0,n(a,...o))}function i(a){s(null,a)}}function m0(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?TT(e.position):"start"in e||"end"in e?TT(e):"line"in e||"column"in e?d5(e):""}function d5(e){return AT(e&&e.line)+":"+AT(e&&e.column)}function TT(e){return d5(e&&e.start)+"-"+d5(e&&e.end)}function AT(e){return e&&typeof e=="number"?e:1}class Ys extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},a=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(a=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=m0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ys.prototype.file="";Ys.prototype.name="";Ys.prototype.reason="";Ys.prototype.message="";Ys.prototype.stack="";Ys.prototype.column=void 0;Ys.prototype.line=void 0;Ys.prototype.ancestors=void 0;Ys.prototype.cause=void 0;Ys.prototype.fatal=void 0;Ys.prototype.place=void 0;Ys.prototype.ruleId=void 0;Ys.prototype.source=void 0;const Io={basename:R9n,dirname:M9n,extname:O9n,join:D9n,sep:"/"};function R9n(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Om(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function M9n(e){if(Om(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function O9n(e){Om(e);let n=e.length,t=-1,r=0,s=-1,i=0,a;for(;n--;){const o=e.codePointAt(n);if(o===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function D9n(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function I9n(e,n){let t="",r=0,s=-1,i=0,a=-1,o,c;for(;++a<=e.length;){if(a2){if(c=t.lastIndexOf("/"),c!==t.length-1){c<0?(t="",r=0):(t=t.slice(0,c),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length>0){t="",r=0,s=a,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,a):t=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return t}function Om(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $9n={cwd:B9n};function B9n(){return"/"}function h5(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function P9n(e){if(typeof e=="string")e=new URL(e);else if(!h5(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return F9n(e)}function F9n(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 n=e.pathname;let t=-1;for(;++t0){let[m,...x]=h;const k=r[p][1];f5(k)&&f5(m)&&(m=Sw(!0,k,m)),r[p]=[u,m,...x]}}}}const dy=new O6().freeze();function zw(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function jw(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Tw(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function MT(e){if(!f5(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function OT(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function v1(e){return G9n(e)?e:new nP(e)}function G9n(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function V9n(e){return typeof e=="string"||K9n(e)}function K9n(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var DT=Object.prototype.hasOwnProperty;function LT(e,n,t){for(t of e.keys())if(g0(t,n))return t}function g0(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&g0(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=LT(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=LT(n,s),!s)||!g0(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(DT.call(e,t)&&++r&&!DT.call(n,t)||!(t in n)||!g0(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const W9n=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Q9n=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,X9n={};function IT(e,n){return(X9n.jsx?Q9n:W9n).test(e)}const Y9n=/[ \t\n\f\r]/g;function Z9n(e){return typeof e=="object"?e.type==="text"?$T(e.value):!1:$T(e)}function $T(e){return e.replace(Y9n,"")===""}var hd={},Aw,BT;function J9n(){if(BT)return Aw;BT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,c=` -`,u="/",h="*",_="",p="comment",m="declaration";function x(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var w=1,y=1;function C(H){var Q=H.match(n);Q&&(w+=Q.length);var V=H.lastIndexOf(c);y=~V?H.length-V:y+H.length}function N(){var H={line:w,column:y};return function(Q){return Q.position=new z(H),M(),Q}}function z(H){this.start=H,this.end={line:w,column:y},this.source=b.source}z.prototype.content=v;function T(H){var Q=new Error(b.source+":"+w+":"+y+": "+H);if(Q.reason=H,Q.filename=b.source,Q.line=w,Q.column=y,Q.source=v,!b.silent)throw Q}function j(H){var Q=H.exec(v);if(Q){var V=Q[0];return C(V),v=v.slice(V.length),Q}}function M(){j(t)}function D(H){var Q;for(H=H||[];Q=I();)Q!==!1&&H.push(Q);return H}function I(){var H=N();if(!(u!=v.charAt(0)||h!=v.charAt(1))){for(var Q=2;_!=v.charAt(Q)&&(h!=v.charAt(Q)||u!=v.charAt(Q+1));)++Q;if(Q+=2,_===v.charAt(Q-1))return T("End of comment missing");var V=v.slice(2,Q-2);return y+=2,C(V),v=v.slice(Q),y+=2,H({type:p,comment:V})}}function $(){var H=N(),Q=j(r);if(Q){if(I(),!j(s))return T("property missing ':'");var V=j(i),J=H({type:m,property:k(Q[0].replace(e,_)),value:V?k(V[0].replace(e,_)):_});return j(a),J}}function q(){var H=[];D(H);for(var Q;Q=$();)Q!==!1&&(H.push(Q),D(H));return H}return M(),q()}function k(v){return v?v.replace(o,_):_}return Aw=x,Aw}var PT;function eEn(){if(PT)return hd;PT=1;var e=hd&&hd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(hd,"__esModule",{value:!0}),hd.default=t;const n=e(J9n());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,n.default)(r),o=typeof s=="function";return a.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:h}=c;o?s(u,h,c):h&&(i=i||{},i[u]=h)}),i}return hd}var Vp={},FT;function tEn(){if(FT)return Vp;FT=1,Object.defineProperty(Vp,"__esModule",{value:!0}),Vp.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,h){return h.toUpperCase()},o=function(u,h){return"".concat(h,"-")},c=function(u,h){return h===void 0&&(h={}),i(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return Vp.camelCase=c,Vp}var Kp,HT;function nEn(){if(HT)return Kp;HT=1;var e=Kp&&Kp.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(eEn()),t=tEn();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,c){o&&c&&(a[(0,t.camelCase)(o,i)]=c)}),a}return r.default=r,Kp=r,Kp}var rEn=nEn();const sEn=vm(rEn),D6={}.hasOwnProperty,iEn=new Map,aEn=/[A-Z]/g,oEn=new Set(["table","tbody","thead","tfoot","tr"]),cEn=new Set(["td","th"]),rP="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sP(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=mEn(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=pEn(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Wb:j$,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=iP(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function iP(e,n,t){if(n.type==="element")return lEn(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return uEn(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return fEn(e,n,t);if(n.type==="mdxjsEsm")return _En(e,n);if(n.type==="root")return dEn(e,n,t);if(n.type==="text")return hEn(e,n)}function lEn(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Wb,e.schema=s),e.ancestors.push(n);const i=oP(e,n.tagName,!1),a=gEn(e,n);let o=I6(e,n);return oEn.has(n.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!Z9n(c):!0})),aP(e,a,i,n),L6(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function uEn(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}H0(e,n.position)}function _En(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);H0(e,n.position)}function fEn(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Wb,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:oP(e,n.name,!0),a=vEn(e,n),o=I6(e,n);return aP(e,a,i,n),L6(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function dEn(e,n,t){const r={};return L6(r,I6(e,n)),e.create(n,e.Fragment,r,t)}function hEn(e,n){return n.value}function aP(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function L6(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function pEn(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function mEn(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),c=N6(r);return n(s,i,a,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function gEn(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&D6.call(n.properties,s)){const i=bEn(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&cEn.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function vEn(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else H0(e,n.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else H0(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function I6(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:iEn;for(;++ry.key).filter(y=>y!==void 0));let u=0;for(;u=e.children.length-h&&(z=s.length-(e.children.length-y)),z>=0&&(N=((b=s[z])==null?void 0:b.key)??N);N&&c.has(N)&&((w=s[z])==null?void 0:w.key)!==N;)N=`${N}+`;N&&c.add(N);const T=cP(C,s[z]??null,t,N);i.push(T),T.react!==void 0&&a.push(T.react)}const _=n!==null&&NEn(e,n.node);if(n&&n.key===r&&_&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const p=e.type==="element"&&SEn.has(e.tagName)?a.filter(y=>typeof y!="string"||!CEn.test(y)):a,m=p.length>0?p.length===1?p[0]:p:null;let x=_?n==null?void 0:n.shell:null;if(!x){const y=sP({...e,children:[]},t);x={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(x.type,{...x.props,children:m},r),shell:x}}function NEn(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return g0(s,o)}function $d(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(ta(e,e.length,0,n),e):n}const UT={}.hasOwnProperty;function uP(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function ao(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function _n(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return yn(c)?(e.enter(t),o(c)):n(c)}function o(c){return yn(c)&&i++a))return;const T=n.events.length;let j=T,M,D;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(M){D=n.events[j][1].end;break}M=!0}for(b(r),z=T;zy;){const N=t[C];n.containerState=N[1],N[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function LEn(e,n,t){return _n(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wh(e){if(e===null||ur(e)||tf(e))return 1;if(uy(e))return 2}function hy(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const _={...e[r][1].end},p={...e[t][1].start};VT(_,-c),VT(p,c),a={type:c>1?"strongSequence":"emphasisSequence",start:_,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:c>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ma(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Ma(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Ma(u,hy(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Ma(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(h=2,u=Ma(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):h=0,ta(e,r-1,t-r+3,u),t=r+u.length-h-2;break}}for(t=-1;++t0&&yn(z)?_n(e,w,"linePrefix",i+1)(z):w(z)}function w(z){return z===null||Tt(z)?e.check(KT,k,C)(z):(e.enter("codeFlowValue"),y(z))}function y(z){return z===null||Tt(z)?(e.exit("codeFlowValue"),w(z)):(e.consume(z),y)}function C(z){return e.exit("codeFenced"),n(z)}function N(z,T,j){let M=0;return D;function D(Q){return z.enter("lineEnding"),z.consume(Q),z.exit("lineEnding"),I}function I(Q){return z.enter("codeFencedFence"),yn(Q)?_n(z,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):$(Q)}function $(Q){return Q===o?(z.enter("codeFencedFenceSequence"),q(Q)):j(Q)}function q(Q){return Q===o?(M++,z.consume(Q),q):M>=a?(z.exit("codeFencedFenceSequence"),yn(Q)?_n(z,H,"whitespace")(Q):H(Q)):j(Q)}function H(Q){return Q===null||Tt(Q)?(z.exit("codeFencedFence"),T(Q)):j(Q)}}}function WEn(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const Rw={name:"codeIndented",tokenize:XEn},QEn={partial:!0,tokenize:YEn};function XEn(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),_n(e,i,"linePrefix",5)(u)}function i(u){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?c(u):Tt(u)?e.attempt(QEn,a,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Tt(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),n(u)}}function YEn(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):Tt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):_n(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):Tt(a)?s(a):t(a)}}const ZEn={name:"codeText",previous:eNn,resolve:JEn,tokenize:tNn};function JEn(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Wp(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Wp(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Wp(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function mP(e,n,t,r,s,i,a,o,c){const u=c||Number.POSITIVE_INFINITY;let h=0;return _;function _(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),p):b===null||b===32||b===41||Kv(b)?t(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),k(b))}function p(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(o),p(b)):b===null||b===60||Tt(b)?t(b):(e.consume(b),b===92?x:m)}function x(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function k(b){return!h&&(b===null||b===41||ur(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(b)):h999||m===null||m===91||m===93&&!c||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):Tt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),_(m))}function _(m){return m===null||m===91||m===93||Tt(m)||o++>999?(e.exit("chunkString"),h(m)):(e.consume(m),c||(c=!yn(m)),m===92?p:_)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,_):_(m)}}function vP(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,c):t(p)}function c(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),c(a)):p===null?t(p):Tt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),_n(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===a||p===null||Tt(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?_:h)}function _(p){return p===a||p===92?(e.consume(p),h):h(p)}}function v0(e,n){let t;return r;function r(s){return Tt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):yn(s)?_n(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const lNn={name:"definition",tokenize:_Nn},uNn={partial:!0,tokenize:fNn};function _Nn(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return gP.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=ao(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):t(m)}function c(m){return ur(m)?v0(e,u)(m):u(m)}function u(m){return mP(e,h,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function h(m){return e.attempt(uNn,_,_)(m)}function _(m){return yn(m)?_n(e,p,"whitespace")(m):p(m)}function p(m){return m===null||Tt(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function fNn(e,n,t){return r;function r(o){return ur(o)?v0(e,s)(o):t(o)}function s(o){return vP(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return yn(o)?_n(e,a,"whitespace")(o):a(o)}function a(o){return o===null||Tt(o)?n(o):t(o)}}const dNn={name:"hardBreakEscape",tokenize:hNn};function hNn(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Tt(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const pNn={name:"headingAtx",resolve:mNn,tokenize:gNn};function mNn(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},ta(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function gNn(e,n,t){let r=0;return s;function s(h){return e.enter("atxHeading"),i(h)}function i(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||ur(h)?(e.exit("atxHeadingSequence"),o(h)):t(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||Tt(h)?(e.exit("atxHeading"),n(h)):yn(h)?_n(e,o,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function c(h){return h===35?(e.consume(h),c):(e.exit("atxHeadingSequence"),o(h))}function u(h){return h===null||h===35||ur(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),u)}}const vNn=["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"],QT=["pre","script","style","textarea"],bNn={concrete:!0,name:"htmlFlow",resolveTo:wNn,tokenize:kNn},yNn={partial:!0,tokenize:CNn},xNn={partial:!0,tokenize:SNn};function wNn(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function kNn(e,n,t){const r=this;let s,i,a,o,c;return u;function u(K){return h(K)}function h(K){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(K),_}function _(K){return K===33?(e.consume(K),p):K===47?(e.consume(K),i=!0,k):K===63?(e.consume(K),s=3,r.interrupt?n:L):_i(K)?(e.consume(K),a=String.fromCharCode(K),v):t(K)}function p(K){return K===45?(e.consume(K),s=2,m):K===91?(e.consume(K),s=5,o=0,x):_i(K)?(e.consume(K),s=4,r.interrupt?n:L):t(K)}function m(K){return K===45?(e.consume(K),r.interrupt?n:L):t(K)}function x(K){const ne="CDATA[";return K===ne.charCodeAt(o++)?(e.consume(K),o===ne.length?r.interrupt?n:$:x):t(K)}function k(K){return _i(K)?(e.consume(K),a=String.fromCharCode(K),v):t(K)}function v(K){if(K===null||K===47||K===62||ur(K)){const ne=K===47,ce=a.toLowerCase();return!ne&&!i&&QT.includes(ce)?(s=1,r.interrupt?n(K):$(K)):vNn.includes(a.toLowerCase())?(s=6,ne?(e.consume(K),b):r.interrupt?n(K):$(K)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(K):i?w(K):y(K))}return K===45||Ws(K)?(e.consume(K),a+=String.fromCharCode(K),v):t(K)}function b(K){return K===62?(e.consume(K),r.interrupt?n:$):t(K)}function w(K){return yn(K)?(e.consume(K),w):D(K)}function y(K){return K===47?(e.consume(K),D):K===58||K===95||_i(K)?(e.consume(K),C):yn(K)?(e.consume(K),y):D(K)}function C(K){return K===45||K===46||K===58||K===95||Ws(K)?(e.consume(K),C):N(K)}function N(K){return K===61?(e.consume(K),z):yn(K)?(e.consume(K),N):y(K)}function z(K){return K===null||K===60||K===61||K===62||K===96?t(K):K===34||K===39?(e.consume(K),c=K,T):yn(K)?(e.consume(K),z):j(K)}function T(K){return K===c?(e.consume(K),c=null,M):K===null||Tt(K)?t(K):(e.consume(K),T)}function j(K){return K===null||K===34||K===39||K===47||K===60||K===61||K===62||K===96||ur(K)?N(K):(e.consume(K),j)}function M(K){return K===47||K===62||yn(K)?y(K):t(K)}function D(K){return K===62?(e.consume(K),I):t(K)}function I(K){return K===null||Tt(K)?$(K):yn(K)?(e.consume(K),I):t(K)}function $(K){return K===45&&s===2?(e.consume(K),V):K===60&&s===1?(e.consume(K),J):K===62&&s===4?(e.consume(K),F):K===63&&s===3?(e.consume(K),L):K===93&&s===5?(e.consume(K),B):Tt(K)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(yNn,U,q)(K)):K===null||Tt(K)?(e.exit("htmlFlowData"),q(K)):(e.consume(K),$)}function q(K){return e.check(xNn,H,U)(K)}function H(K){return e.enter("lineEnding"),e.consume(K),e.exit("lineEnding"),Q}function Q(K){return K===null||Tt(K)?q(K):(e.enter("htmlFlowData"),$(K))}function V(K){return K===45?(e.consume(K),L):$(K)}function J(K){return K===47?(e.consume(K),a="",Z):$(K)}function Z(K){if(K===62){const ne=a.toLowerCase();return QT.includes(ne)?(e.consume(K),F):$(K)}return _i(K)&&a.length<8?(e.consume(K),a+=String.fromCharCode(K),Z):$(K)}function B(K){return K===93?(e.consume(K),L):$(K)}function L(K){return K===62?(e.consume(K),F):K===45&&s===2?(e.consume(K),L):$(K)}function F(K){return K===null||Tt(K)?(e.exit("htmlFlowData"),U(K)):(e.consume(K),F)}function U(K){return e.exit("htmlFlow"),n(K)}}function SNn(e,n,t){const r=this;return s;function s(a){return Tt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function CNn(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Dm,n,t)}}const ENn={name:"htmlText",tokenize:NNn};function NNn(e,n,t){const r=this;let s,i,a;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),c}function c(L){return L===33?(e.consume(L),u):L===47?(e.consume(L),N):L===63?(e.consume(L),y):_i(L)?(e.consume(L),j):t(L)}function u(L){return L===45?(e.consume(L),h):L===91?(e.consume(L),i=0,x):_i(L)?(e.consume(L),w):t(L)}function h(L){return L===45?(e.consume(L),m):t(L)}function _(L){return L===null?t(L):L===45?(e.consume(L),p):Tt(L)?(a=_,J(L)):(e.consume(L),_)}function p(L){return L===45?(e.consume(L),m):_(L)}function m(L){return L===62?V(L):L===45?p(L):_(L)}function x(L){const F="CDATA[";return L===F.charCodeAt(i++)?(e.consume(L),i===F.length?k:x):t(L)}function k(L){return L===null?t(L):L===93?(e.consume(L),v):Tt(L)?(a=k,J(L)):(e.consume(L),k)}function v(L){return L===93?(e.consume(L),b):k(L)}function b(L){return L===62?V(L):L===93?(e.consume(L),b):k(L)}function w(L){return L===null||L===62?V(L):Tt(L)?(a=w,J(L)):(e.consume(L),w)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):Tt(L)?(a=y,J(L)):(e.consume(L),y)}function C(L){return L===62?V(L):y(L)}function N(L){return _i(L)?(e.consume(L),z):t(L)}function z(L){return L===45||Ws(L)?(e.consume(L),z):T(L)}function T(L){return Tt(L)?(a=T,J(L)):yn(L)?(e.consume(L),T):V(L)}function j(L){return L===45||Ws(L)?(e.consume(L),j):L===47||L===62||ur(L)?M(L):t(L)}function M(L){return L===47?(e.consume(L),V):L===58||L===95||_i(L)?(e.consume(L),D):Tt(L)?(a=M,J(L)):yn(L)?(e.consume(L),M):V(L)}function D(L){return L===45||L===46||L===58||L===95||Ws(L)?(e.consume(L),D):I(L)}function I(L){return L===61?(e.consume(L),$):Tt(L)?(a=I,J(L)):yn(L)?(e.consume(L),I):M(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,q):Tt(L)?(a=$,J(L)):yn(L)?(e.consume(L),$):(e.consume(L),H)}function q(L){return L===s?(e.consume(L),s=void 0,Q):L===null?t(L):Tt(L)?(a=q,J(L)):(e.consume(L),q)}function H(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||ur(L)?M(L):(e.consume(L),H)}function Q(L){return L===47||L===62||ur(L)?M(L):t(L)}function V(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function J(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),Z}function Z(L){return yn(L)?_n(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):B(L)}function B(L){return e.enter("htmlTextData"),a(L)}}const B6={name:"labelEnd",resolveAll:ANn,resolveTo:RNn,tokenize:MNn},zNn={tokenize:ONn},jNn={tokenize:DNn},TNn={tokenize:LNn};function ANn(e){let n=-1;const t=[];for(;++n=3&&(u===null||Tt(u))?(e.exit("thematicBreak"),n(u)):t(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),yn(u)?_n(e,o,"whitespace")(u):o(u))}}const Ni={continuation:{tokenize:VNn},exit:WNn,name:"list",tokenize:GNn},qNn={partial:!0,tokenize:QNn},UNn={partial:!0,tokenize:KNn};function GNn(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const x=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:l5(m)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(nv,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return t(m)}function c(m){return l5(m)&&++a<10?(e.consume(m),c):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Dm,r.interrupt?t:h,e.attempt(qNn,p,_))}function h(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function _(m){return yn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function VNn(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Dm,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,_n(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!yn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(UNn,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,_n(e,e.attempt(Ni,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function KNn(e,n,t){const r=this;return _n(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function WNn(e){e.exit(this.containerState.type)}function QNn(e,n,t){const r=this;return _n(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!yn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const XT={name:"setextUnderline",resolveTo:XNn,tokenize:YNn};function XNn(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function YNn(e,n,t){const r=this;let s;return i;function i(u){let h=r.events.length,_;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){_=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||_)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),yn(u)?_n(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Tt(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const ZNn={tokenize:JNn};function JNn(e){const n=this,t=e.attempt(Dm,r,e.attempt(this.parser.constructs.flowInitial,s,_n(e,e.attempt(this.parser.constructs.flow,s,e.attempt(sNn,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const ezn={resolveAll:yP()},tzn=bP("string"),nzn=bP("text");function bP(e){return{resolveAll:yP(e==="text"?rzn:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(h){return u(h)?i(h):o(h)}function o(h){if(h===null){t.consume(h);return}return t.enter("data"),t.consume(h),c}function c(h){return u(h)?(t.exit("data"),i(h)):(t.consume(h),c)}function u(h){if(h===null)return!0;const _=s[h];let p=-1;if(_)for(;++p<_.length;){const m=_[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function yP(e){return n;function n(t,r){let s=-1,i;for(;++s<=t.length;)i===void 0?t[s]&&t[s][1].type==="data"&&(i=s,s++):(!t[s]||t[s][1].type!=="data")&&(s!==i+2&&(t[i][1].end=t[s-1][1].end,t.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(t,r):t}}function rzn(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],s=n.sliceStream(r);let i=s.length,a=-1,o=0,c;for(;i--;){const u=s[i];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)c=!0,o++;else if(u!==-1){i++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(o=0),o){const u={type:t===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(t,0,["enter",u,n],["exit",u,n]),t+=2)}t++}return e}const szn={42:Ni,43:Ni,45:Ni,48:Ni,49:Ni,50:Ni,51:Ni,52:Ni,53:Ni,54:Ni,55:Ni,56:Ni,57:Ni,62:fP},izn={91:lNn},azn={[-2]:Rw,[-1]:Rw,32:Rw},ozn={35:pNn,42:nv,45:[XT,nv],60:bNn,61:XT,95:nv,96:WT,126:WT},czn={38:hP,92:dP},lzn={[-5]:Mw,[-4]:Mw,[-3]:Mw,33:INn,38:hP,42:p5,60:[BEn,ENn],91:BNn,92:[dNn,dP],93:B6,95:p5,96:ZEn},uzn={null:[p5,ezn]},_zn={null:[42,95]},fzn={null:[]},dzn=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_zn,contentInitial:izn,disable:fzn,document:szn,flow:ozn,flowInitial:azn,insideSpan:uzn,string:czn,text:lzn},Symbol.toStringTag,{value:"Module"}));function hzn(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const s={},i=[];let a=[],o=[];const c={attempt:T(N),check:T(z),consume:w,enter:y,exit:C,interrupt:T(z,{interrupt:!0})},u={code:null,containerState:{},defineSkip:k,events:[],now:x,parser:e,previous:null,sliceSerialize:p,sliceStream:m,write:_};let h=n.tokenize.call(u,c);return n.resolveAll&&i.push(n),u;function _(I){return a=Ma(a,I),v(),a[a.length-1]!==null?[]:(j(n,0),u.events=hy(i,u.events,u),u.events)}function p(I,$){return mzn(m(I),$)}function m(I){return pzn(a,I)}function x(){const{_bufferIndex:I,_index:$,line:q,column:H,offset:Q}=r;return{_bufferIndex:I,_index:$,line:q,column:H,offset:Q}}function k(I){s[I.line]=I.column,D()}function v(){let I;for(;r._index-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function mzn(e,n){let t=-1;const r=[];let s;for(;++t"u"||e.call(u,p)},a=function(u,h){t&&h.name==="__proto__"?t(u,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):u[h.name]=h.newValue},o=function(u,h){if(h==="__proto__")if(e.call(u,h)){if(r)return r(u,h).value}else return;return u[h]};return Cw=function c(){var u,h,_,p,m,w,k=arguments[0],v=1,b=arguments.length,x=!1;for(typeof k=="boolean"&&(x=k,k=arguments[1]||{},v=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});va.length;let c;o&&a.push(s);try{c=e.apply(this,a)}catch(u){const h=u;if(o&&t)throw h;return s(h)}o||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...o){t||(t=!0,n(a,...o))}function i(a){s(null,a)}}function g0(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?RT(e.position):"start"in e||"end"in e?RT(e):"line"in e||"column"in e?p5(e):""}function p5(e){return MT(e&&e.line)+":"+MT(e&&e.column)}function RT(e){return p5(e&&e.start)+"-"+p5(e&&e.end)}function MT(e){return e&&typeof e=="number"?e:1}class Js extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},a=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(a=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=g0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Js.prototype.file="";Js.prototype.name="";Js.prototype.reason="";Js.prototype.message="";Js.prototype.stack="";Js.prototype.column=void 0;Js.prototype.line=void 0;Js.prototype.ancestors=void 0;Js.prototype.cause=void 0;Js.prototype.fatal=void 0;Js.prototype.place=void 0;Js.prototype.ruleId=void 0;Js.prototype.source=void 0;const Po={basename:qEn,dirname:UEn,extname:GEn,join:VEn,sep:"/"};function qEn(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Dm(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function UEn(e){if(Dm(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function GEn(e){Dm(e);let n=e.length,t=-1,r=0,s=-1,i=0,a;for(;n--;){const o=e.codePointAt(n);if(o===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function VEn(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function WEn(e,n){let t="",r=0,s=-1,i=0,a=-1,o,c;for(;++a<=e.length;){if(a2){if(c=t.lastIndexOf("/"),c!==t.length-1){c<0?(t="",r=0):(t=t.slice(0,c),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length>0){t="",r=0,s=a,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,a):t=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return t}function Dm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const QEn={cwd:XEn};function XEn(){return"/"}function m5(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function YEn(e){if(typeof e=="string")e=new URL(e);else if(!m5(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return ZEn(e)}function ZEn(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 n=e.pathname;let t=-1;for(;++t0){let[m,...w]=h;const k=r[p][1];h5(k)&&h5(m)&&(m=Ew(!0,k,m)),r[p]=[u,m,...w]}}}}const py=new D6().freeze();function Tw(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Aw(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Rw(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function DT(e){if(!h5(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function LT(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function v1(e){return nNn(e)?e:new iP(e)}function nNn(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function rNn(e){return typeof e=="string"||sNn(e)}function sNn(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var IT=Object.prototype.hasOwnProperty;function $T(e,n,t){for(t of e.keys())if(v0(t,n))return t}function v0(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&v0(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=$T(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=$T(n,s),!s)||!v0(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(IT.call(e,t)&&++r&&!IT.call(n,t)||!(t in n)||!v0(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const iNn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aNn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oNn={};function BT(e,n){return(oNn.jsx?aNn:iNn).test(e)}const cNn=/[ \t\n\f\r]/g;function lNn(e){return typeof e=="object"?e.type==="text"?PT(e.value):!1:PT(e)}function PT(e){return e.replace(cNn,"")===""}var pd={},Mw,FT;function uNn(){if(FT)return Mw;FT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,c=` +`,u="/",h="*",_="",p="comment",m="declaration";function w(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var x=1,y=1;function C(H){var Q=H.match(n);Q&&(x+=Q.length);var V=H.lastIndexOf(c);y=~V?H.length-V:y+H.length}function z(){var H={line:x,column:y};return function(Q){return Q.position=new E(H),M(),Q}}function E(H){this.start=H,this.end={line:x,column:y},this.source=b.source}E.prototype.content=v;function T(H){var Q=new Error(b.source+":"+x+":"+y+": "+H);if(Q.reason=H,Q.filename=b.source,Q.line=x,Q.column=y,Q.source=v,!b.silent)throw Q}function j(H){var Q=H.exec(v);if(Q){var V=Q[0];return C(V),v=v.slice(V.length),Q}}function M(){j(t)}function D(H){var Q;for(H=H||[];Q=I();)Q!==!1&&H.push(Q);return H}function I(){var H=z();if(!(u!=v.charAt(0)||h!=v.charAt(1))){for(var Q=2;_!=v.charAt(Q)&&(h!=v.charAt(Q)||u!=v.charAt(Q+1));)++Q;if(Q+=2,_===v.charAt(Q-1))return T("End of comment missing");var V=v.slice(2,Q-2);return y+=2,C(V),v=v.slice(Q),y+=2,H({type:p,comment:V})}}function $(){var H=z(),Q=j(r);if(Q){if(I(),!j(s))return T("property missing ':'");var V=j(i),Z=H({type:m,property:k(Q[0].replace(e,_)),value:V?k(V[0].replace(e,_)):_});return j(a),Z}}function q(){var H=[];D(H);for(var Q;Q=$();)Q!==!1&&(H.push(Q),D(H));return H}return M(),q()}function k(v){return v?v.replace(o,_):_}return Mw=w,Mw}var HT;function _Nn(){if(HT)return pd;HT=1;var e=pd&&pd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pd,"__esModule",{value:!0}),pd.default=t;const n=e(uNn());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,n.default)(r),o=typeof s=="function";return a.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:h}=c;o?s(u,h,c):h&&(i=i||{},i[u]=h)}),i}return pd}var Kp={},qT;function fNn(){if(qT)return Kp;qT=1,Object.defineProperty(Kp,"__esModule",{value:!0}),Kp.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,h){return h.toUpperCase()},o=function(u,h){return"".concat(h,"-")},c=function(u,h){return h===void 0&&(h={}),i(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return Kp.camelCase=c,Kp}var Wp,UT;function dNn(){if(UT)return Wp;UT=1;var e=Wp&&Wp.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(_Nn()),t=fNn();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,c){o&&c&&(a[(0,t.camelCase)(o,i)]=c)}),a}return r.default=r,Wp=r,Wp}var hNn=dNn();const pNn=bm(hNn),L6={}.hasOwnProperty,mNn=new Map,gNn=/[A-Z]/g,vNn=new Set(["table","tbody","thead","tfoot","tr"]),bNn=new Set(["td","th"]),aP="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function oP(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=NNn(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=ENn(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Xb:R$,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=cP(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function cP(e,n,t){if(n.type==="element")return yNn(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return xNn(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return kNn(e,n,t);if(n.type==="mdxjsEsm")return wNn(e,n);if(n.type==="root")return SNn(e,n,t);if(n.type==="text")return CNn(e,n)}function yNn(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Xb,e.schema=s),e.ancestors.push(n);const i=uP(e,n.tagName,!1),a=zNn(e,n);let o=$6(e,n);return vNn.has(n.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!lNn(c):!0})),lP(e,a,i,n),I6(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function xNn(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}q0(e,n.position)}function wNn(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);q0(e,n.position)}function kNn(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Xb,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:uP(e,n.name,!0),a=jNn(e,n),o=$6(e,n);return lP(e,a,i,n),I6(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function SNn(e,n,t){const r={};return I6(r,$6(e,n)),e.create(n,e.Fragment,r,t)}function CNn(e,n){return n.value}function lP(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function I6(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function ENn(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function NNn(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),c=z6(r);return n(s,i,a,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function zNn(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&L6.call(n.properties,s)){const i=TNn(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&bNn.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function jNn(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else q0(e,n.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else q0(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function $6(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:mNn;for(;++ry.key).filter(y=>y!==void 0));let u=0;for(;u=e.children.length-h&&(E=s.length-(e.children.length-y)),E>=0&&(z=((b=s[E])==null?void 0:b.key)??z);z&&c.has(z)&&((x=s[E])==null?void 0:x.key)!==z;)z=`${z}+`;z&&c.add(z);const T=_P(C,s[E]??null,t,z);i.push(T),T.react!==void 0&&a.push(T.react)}const _=n!==null&&$Nn(e,n.node);if(n&&n.key===r&&_&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const p=e.type==="element"&&DNn.has(e.tagName)?a.filter(y=>typeof y!="string"||!LNn.test(y)):a,m=p.length>0?p.length===1?p[0]:p:null;let w=_?n==null?void 0:n.shell:null;if(!w){const y=oP({...e,children:[]},t);w={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(w.type,{...w.props,children:m},r),shell:w}}function $Nn(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return v0(s,o)}function Bd(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(fa(e,e.length,0,n),e):n}const VT={}.hasOwnProperty;function dP(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function yo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function yn(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return Cn(c)?(e.enter(t),o(c)):n(c)}function o(c){return Cn(c)&&i++a))return;const T=n.events.length;let j=T,M,D;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(M){D=n.events[j][1].end;break}M=!0}for(b(r),E=T;Ey;){const z=t[C];n.containerState=z[1],z[0].exit.call(n,e)}t.length=y}function x(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function KNn(e,n,t){return yn(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function kh(e){if(e===null||fr(e)||uf(e))return 1;if(fy(e))return 2}function my(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const _={...e[r][1].end},p={...e[t][1].start};WT(_,-c),WT(p,c),a={type:c>1?"strongSequence":"emphasisSequence",start:_,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:c>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ha(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Ha(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Ha(u,my(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Ha(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(h=2,u=Ha(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):h=0,fa(e,r-1,t-r+3,u),t=r+u.length-h-2;break}}for(t=-1;++t0&&Cn(E)?yn(e,x,"linePrefix",i+1)(E):x(E)}function x(E){return E===null||Rt(E)?e.check(QT,k,C)(E):(e.enter("codeFlowValue"),y(E))}function y(E){return E===null||Rt(E)?(e.exit("codeFlowValue"),x(E)):(e.consume(E),y)}function C(E){return e.exit("codeFenced"),n(E)}function z(E,T,j){let M=0;return D;function D(Q){return E.enter("lineEnding"),E.consume(Q),E.exit("lineEnding"),I}function I(Q){return E.enter("codeFencedFence"),Cn(Q)?yn(E,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):$(Q)}function $(Q){return Q===o?(E.enter("codeFencedFenceSequence"),q(Q)):j(Q)}function q(Q){return Q===o?(M++,E.consume(Q),q):M>=a?(E.exit("codeFencedFenceSequence"),Cn(Q)?yn(E,H,"whitespace")(Q):H(Q)):j(Q)}function H(Q){return Q===null||Rt(Q)?(E.exit("codeFencedFence"),T(Q)):j(Q)}}}function izn(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const Ow={name:"codeIndented",tokenize:ozn},azn={partial:!0,tokenize:czn};function ozn(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),yn(e,i,"linePrefix",5)(u)}function i(u){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?c(u):Rt(u)?e.attempt(azn,a,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Rt(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),n(u)}}function czn(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):Rt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):yn(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):Rt(a)?s(a):t(a)}}const lzn={name:"codeText",previous:_zn,resolve:uzn,tokenize:fzn};function uzn(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Qp(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Qp(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Qp(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function bP(e,n,t,r,s,i,a,o,c){const u=c||Number.POSITIVE_INFINITY;let h=0;return _;function _(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),p):b===null||b===32||b===41||Wv(b)?t(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),k(b))}function p(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(o),p(b)):b===null||b===60||Rt(b)?t(b):(e.consume(b),b===92?w:m)}function w(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function k(b){return!h&&(b===null||b===41||fr(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(b)):h999||m===null||m===91||m===93&&!c||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):Rt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),_(m))}function _(m){return m===null||m===91||m===93||Rt(m)||o++>999?(e.exit("chunkString"),h(m)):(e.consume(m),c||(c=!Cn(m)),m===92?p:_)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,_):_(m)}}function xP(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,c):t(p)}function c(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),c(a)):p===null?t(p):Rt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),yn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===a||p===null||Rt(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?_:h)}function _(p){return p===a||p===92?(e.consume(p),h):h(p)}}function b0(e,n){let t;return r;function r(s){return Rt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):Cn(s)?yn(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const yzn={name:"definition",tokenize:wzn},xzn={partial:!0,tokenize:kzn};function wzn(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return yP.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=yo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):t(m)}function c(m){return fr(m)?b0(e,u)(m):u(m)}function u(m){return bP(e,h,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function h(m){return e.attempt(xzn,_,_)(m)}function _(m){return Cn(m)?yn(e,p,"whitespace")(m):p(m)}function p(m){return m===null||Rt(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function kzn(e,n,t){return r;function r(o){return fr(o)?b0(e,s)(o):t(o)}function s(o){return xP(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Cn(o)?yn(e,a,"whitespace")(o):a(o)}function a(o){return o===null||Rt(o)?n(o):t(o)}}const Szn={name:"hardBreakEscape",tokenize:Czn};function Czn(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Rt(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const Ezn={name:"headingAtx",resolve:Nzn,tokenize:zzn};function Nzn(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},fa(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function zzn(e,n,t){let r=0;return s;function s(h){return e.enter("atxHeading"),i(h)}function i(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||fr(h)?(e.exit("atxHeadingSequence"),o(h)):t(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||Rt(h)?(e.exit("atxHeading"),n(h)):Cn(h)?yn(e,o,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function c(h){return h===35?(e.consume(h),c):(e.exit("atxHeadingSequence"),o(h))}function u(h){return h===null||h===35||fr(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),u)}}const jzn=["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"],YT=["pre","script","style","textarea"],Tzn={concrete:!0,name:"htmlFlow",resolveTo:Mzn,tokenize:Ozn},Azn={partial:!0,tokenize:Lzn},Rzn={partial:!0,tokenize:Dzn};function Mzn(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Ozn(e,n,t){const r=this;let s,i,a,o,c;return u;function u(K){return h(K)}function h(K){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(K),_}function _(K){return K===33?(e.consume(K),p):K===47?(e.consume(K),i=!0,k):K===63?(e.consume(K),s=3,r.interrupt?n:L):di(K)?(e.consume(K),a=String.fromCharCode(K),v):t(K)}function p(K){return K===45?(e.consume(K),s=2,m):K===91?(e.consume(K),s=5,o=0,w):di(K)?(e.consume(K),s=4,r.interrupt?n:L):t(K)}function m(K){return K===45?(e.consume(K),r.interrupt?n:L):t(K)}function w(K){const ne="CDATA[";return K===ne.charCodeAt(o++)?(e.consume(K),o===ne.length?r.interrupt?n:$:w):t(K)}function k(K){return di(K)?(e.consume(K),a=String.fromCharCode(K),v):t(K)}function v(K){if(K===null||K===47||K===62||fr(K)){const ne=K===47,oe=a.toLowerCase();return!ne&&!i&&YT.includes(oe)?(s=1,r.interrupt?n(K):$(K)):jzn.includes(a.toLowerCase())?(s=6,ne?(e.consume(K),b):r.interrupt?n(K):$(K)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(K):i?x(K):y(K))}return K===45||Xs(K)?(e.consume(K),a+=String.fromCharCode(K),v):t(K)}function b(K){return K===62?(e.consume(K),r.interrupt?n:$):t(K)}function x(K){return Cn(K)?(e.consume(K),x):D(K)}function y(K){return K===47?(e.consume(K),D):K===58||K===95||di(K)?(e.consume(K),C):Cn(K)?(e.consume(K),y):D(K)}function C(K){return K===45||K===46||K===58||K===95||Xs(K)?(e.consume(K),C):z(K)}function z(K){return K===61?(e.consume(K),E):Cn(K)?(e.consume(K),z):y(K)}function E(K){return K===null||K===60||K===61||K===62||K===96?t(K):K===34||K===39?(e.consume(K),c=K,T):Cn(K)?(e.consume(K),E):j(K)}function T(K){return K===c?(e.consume(K),c=null,M):K===null||Rt(K)?t(K):(e.consume(K),T)}function j(K){return K===null||K===34||K===39||K===47||K===60||K===61||K===62||K===96||fr(K)?z(K):(e.consume(K),j)}function M(K){return K===47||K===62||Cn(K)?y(K):t(K)}function D(K){return K===62?(e.consume(K),I):t(K)}function I(K){return K===null||Rt(K)?$(K):Cn(K)?(e.consume(K),I):t(K)}function $(K){return K===45&&s===2?(e.consume(K),V):K===60&&s===1?(e.consume(K),Z):K===62&&s===4?(e.consume(K),F):K===63&&s===3?(e.consume(K),L):K===93&&s===5?(e.consume(K),B):Rt(K)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Azn,U,q)(K)):K===null||Rt(K)?(e.exit("htmlFlowData"),q(K)):(e.consume(K),$)}function q(K){return e.check(Rzn,H,U)(K)}function H(K){return e.enter("lineEnding"),e.consume(K),e.exit("lineEnding"),Q}function Q(K){return K===null||Rt(K)?q(K):(e.enter("htmlFlowData"),$(K))}function V(K){return K===45?(e.consume(K),L):$(K)}function Z(K){return K===47?(e.consume(K),a="",Y):$(K)}function Y(K){if(K===62){const ne=a.toLowerCase();return YT.includes(ne)?(e.consume(K),F):$(K)}return di(K)&&a.length<8?(e.consume(K),a+=String.fromCharCode(K),Y):$(K)}function B(K){return K===93?(e.consume(K),L):$(K)}function L(K){return K===62?(e.consume(K),F):K===45&&s===2?(e.consume(K),L):$(K)}function F(K){return K===null||Rt(K)?(e.exit("htmlFlowData"),U(K)):(e.consume(K),F)}function U(K){return e.exit("htmlFlow"),n(K)}}function Dzn(e,n,t){const r=this;return s;function s(a){return Rt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function Lzn(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Lm,n,t)}}const Izn={name:"htmlText",tokenize:$zn};function $zn(e,n,t){const r=this;let s,i,a;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),c}function c(L){return L===33?(e.consume(L),u):L===47?(e.consume(L),z):L===63?(e.consume(L),y):di(L)?(e.consume(L),j):t(L)}function u(L){return L===45?(e.consume(L),h):L===91?(e.consume(L),i=0,w):di(L)?(e.consume(L),x):t(L)}function h(L){return L===45?(e.consume(L),m):t(L)}function _(L){return L===null?t(L):L===45?(e.consume(L),p):Rt(L)?(a=_,Z(L)):(e.consume(L),_)}function p(L){return L===45?(e.consume(L),m):_(L)}function m(L){return L===62?V(L):L===45?p(L):_(L)}function w(L){const F="CDATA[";return L===F.charCodeAt(i++)?(e.consume(L),i===F.length?k:w):t(L)}function k(L){return L===null?t(L):L===93?(e.consume(L),v):Rt(L)?(a=k,Z(L)):(e.consume(L),k)}function v(L){return L===93?(e.consume(L),b):k(L)}function b(L){return L===62?V(L):L===93?(e.consume(L),b):k(L)}function x(L){return L===null||L===62?V(L):Rt(L)?(a=x,Z(L)):(e.consume(L),x)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):Rt(L)?(a=y,Z(L)):(e.consume(L),y)}function C(L){return L===62?V(L):y(L)}function z(L){return di(L)?(e.consume(L),E):t(L)}function E(L){return L===45||Xs(L)?(e.consume(L),E):T(L)}function T(L){return Rt(L)?(a=T,Z(L)):Cn(L)?(e.consume(L),T):V(L)}function j(L){return L===45||Xs(L)?(e.consume(L),j):L===47||L===62||fr(L)?M(L):t(L)}function M(L){return L===47?(e.consume(L),V):L===58||L===95||di(L)?(e.consume(L),D):Rt(L)?(a=M,Z(L)):Cn(L)?(e.consume(L),M):V(L)}function D(L){return L===45||L===46||L===58||L===95||Xs(L)?(e.consume(L),D):I(L)}function I(L){return L===61?(e.consume(L),$):Rt(L)?(a=I,Z(L)):Cn(L)?(e.consume(L),I):M(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,q):Rt(L)?(a=$,Z(L)):Cn(L)?(e.consume(L),$):(e.consume(L),H)}function q(L){return L===s?(e.consume(L),s=void 0,Q):L===null?t(L):Rt(L)?(a=q,Z(L)):(e.consume(L),q)}function H(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||fr(L)?M(L):(e.consume(L),H)}function Q(L){return L===47||L===62||fr(L)?M(L):t(L)}function V(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function Z(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),Y}function Y(L){return Cn(L)?yn(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):B(L)}function B(L){return e.enter("htmlTextData"),a(L)}}const P6={name:"labelEnd",resolveAll:Hzn,resolveTo:qzn,tokenize:Uzn},Bzn={tokenize:Gzn},Pzn={tokenize:Vzn},Fzn={tokenize:Kzn};function Hzn(e){let n=-1;const t=[];for(;++n=3&&(u===null||Rt(u))?(e.exit("thematicBreak"),n(u)):t(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Cn(u)?yn(e,o,"whitespace")(u):o(u))}}const Di={continuation:{tokenize:rjn},exit:ijn,name:"list",tokenize:njn},ejn={partial:!0,tokenize:ajn},tjn={partial:!0,tokenize:sjn};function njn(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const w=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:_5(m)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(nv,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return t(m)}function c(m){return _5(m)&&++a<10?(e.consume(m),c):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Lm,r.interrupt?t:h,e.attempt(ejn,p,_))}function h(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function _(m){return Cn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function rjn(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Lm,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,yn(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!Cn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(tjn,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,yn(e,e.attempt(Di,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function sjn(e,n,t){const r=this;return yn(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function ijn(e){e.exit(this.containerState.type)}function ajn(e,n,t){const r=this;return yn(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!Cn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const ZT={name:"setextUnderline",resolveTo:ojn,tokenize:cjn};function ojn(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function cjn(e,n,t){const r=this;let s;return i;function i(u){let h=r.events.length,_;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){_=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||_)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),Cn(u)?yn(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Rt(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const ljn={tokenize:ujn};function ujn(e){const n=this,t=e.attempt(Lm,r,e.attempt(this.parser.constructs.flowInitial,s,yn(e,e.attempt(this.parser.constructs.flow,s,e.attempt(pzn,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const _jn={resolveAll:kP()},fjn=wP("string"),djn=wP("text");function wP(e){return{resolveAll:kP(e==="text"?hjn:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(h){return u(h)?i(h):o(h)}function o(h){if(h===null){t.consume(h);return}return t.enter("data"),t.consume(h),c}function c(h){return u(h)?(t.exit("data"),i(h)):(t.consume(h),c)}function u(h){if(h===null)return!0;const _=s[h];let p=-1;if(_)for(;++p<_.length;){const m=_[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function kP(e){return n;function n(t,r){let s=-1,i;for(;++s<=t.length;)i===void 0?t[s]&&t[s][1].type==="data"&&(i=s,s++):(!t[s]||t[s][1].type!=="data")&&(s!==i+2&&(t[i][1].end=t[s-1][1].end,t.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(t,r):t}}function hjn(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],s=n.sliceStream(r);let i=s.length,a=-1,o=0,c;for(;i--;){const u=s[i];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)c=!0,o++;else if(u!==-1){i++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(o=0),o){const u={type:t===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(t,0,["enter",u,n],["exit",u,n]),t+=2)}t++}return e}const pjn={42:Di,43:Di,45:Di,48:Di,49:Di,50:Di,51:Di,52:Di,53:Di,54:Di,55:Di,56:Di,57:Di,62:pP},mjn={91:yzn},gjn={[-2]:Ow,[-1]:Ow,32:Ow},vjn={35:Ezn,42:nv,45:[ZT,nv],60:Tzn,61:ZT,95:nv,96:XT,126:XT},bjn={38:gP,92:mP},yjn={[-5]:Dw,[-4]:Dw,[-3]:Dw,33:Wzn,38:gP,42:g5,60:[XNn,Izn],91:Xzn,92:[Szn,mP],93:P6,95:g5,96:lzn},xjn={null:[g5,_jn]},wjn={null:[42,95]},kjn={null:[]},Sjn=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:wjn,contentInitial:mjn,disable:kjn,document:pjn,flow:vjn,flowInitial:gjn,insideSpan:xjn,string:bjn,text:yjn},Symbol.toStringTag,{value:"Module"}));function Cjn(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const s={},i=[];let a=[],o=[];const c={attempt:T(z),check:T(E),consume:x,enter:y,exit:C,interrupt:T(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:k,events:[],now:w,parser:e,previous:null,sliceSerialize:p,sliceStream:m,write:_};let h=n.tokenize.call(u,c);return n.resolveAll&&i.push(n),u;function _(I){return a=Ha(a,I),v(),a[a.length-1]!==null?[]:(j(n,0),u.events=my(i,u.events,u),u.events)}function p(I,$){return Njn(m(I),$)}function m(I){return Ejn(a,I)}function w(){const{_bufferIndex:I,_index:$,line:q,column:H,offset:Q}=r;return{_bufferIndex:I,_index:$,line:q,column:H,offset:Q}}function k(I){s[I.line]=I.column,D()}function v(){let I;for(;r._index-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function Njn(e,n){let t=-1;const r=[];let s;for(;++t0){const pt=Pe.tokenStack[Pe.tokenStack.length-1];(pt[1]||ZT).call(Pe,void 0,pt[0])}for(Ae.position={start:Xl(me.length>0?me[0][1].start:{line:1,column:1,offset:0}),end:Xl(me.length>0?me[me.length-2][1].end:{line:1,column:1,offset:0})},_t=-1;++_t0&&(qe(this,hu,ue(this,hu)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=JT(t)),ue(this,hu)+$zn(t,r)}}hu=new WeakMap;const Nzn=new Set(["*","**","_","__"]);function JT(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;t0){const St=He.tokenStack[He.tokenStack.length-1];(St[1]||eA).call(He,void 0,St[0])}for(Te.position={start:au(me.length>0?me[0][1].start:{line:1,column:1,offset:0}),end:au(me.length>0?me[me.length-2][1].end:{line:1,column:1,offset:0})},_t=-1;++_t0&&(Ue(this,Su,le(this,Su)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=tA(t)),le(this,Su)+Qjn(t,r)}}Su=new WeakMap;const $jn=new Set(["*","**","_","__"]);function tA(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;tt){t=s-1;continue}if(n.exclusive)continue;if(Izn(n)){eA(n,t,r);continue}const i=Rzn(n,e,t);if(i>t){t=i-1;continue}const a=Mzn(n,e,t);if(a>t){t=a-1;continue}oo(e,t)||eA(n,t,r)}return n}function zzn(e,n,t){const r=n[t];return r==="`"?jzn(e,n,t):r==="$"?Tzn(e,n,t):r==="~"?Azn(e,n,t):t}function jzn(e,n,t){const r=P6(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&Yv(n,t)&&!oo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!oo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||oo(n,t)?t+r:r>=3&&Yv(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function Tzn(e,n,t){const r=P6(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!oo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||oo(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function Azn(e,n,t){const r=P6(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(Yv(n,t)&&!oo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!Yv(n,t)||oo(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function Rzn(e,n,t){if(n[t]!=="<"||oo(n,t))return t;const r=n[t+1];if(r!==void 0&&!CP(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` -`)return e.pendingHtml=null,s+1;return n.length}function Mzn(e,n,t){const r=Ozn(n,t);if(!r)return t;if(oo(n,t))return t+r.length;const s=e.delims.findLastIndex(i=>i.token===r);return s!==-1?(e.delims.splice(s,1),t+r.length):t+r.length===n.length?(e.pendingDelim={start:t,token:r},t+r.length):(Dzn(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function Ozn(e,n){const t=e[n];if(t==="*")return e.startsWith("***",n)?"***":e.startsWith("**",n)?"**":"*";if(t==="_")return e.startsWith("__",n)?"__":"_";if(t==="~"&&e.startsWith("~~",n))return"~~"}function Dzn(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!rA(s)||!rA(r)}function eA(e,n,t){const r=e.links.at(-1);if(t==="["){e.links.push({phase:"text",start:n});return}if(t==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:n};return}if(t==="("&&(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(t==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(t===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function Lzn(e){var n,t;e.delims.length=0,e.links.length=0,((n=e.exclusive)==null?void 0:n.kind)!=="fence"&&(((t=e.exclusive)==null?void 0:t.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function Izn(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function $zn(e,n){n.pendingHtml!==null&&(e=e.slice(0,Fzn(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return Do(Bzn(e,t));const r=Pzn(n);if(r)return Do(jd(e,r));const s=Uzn(n);return s?s.kind==="delim"?Do(m5(e,s.start,s.token.length)?kP(e,s.token):e.slice(0,s.start)):m5(e,s.start,s.token.length)?s.kind==="fence"?Do(e):s.kind==="code"?Do(jd(e,s.token)):s.token==="$$"?Do(jd(e,(e.endsWith(` +`){Kjn(n),n.exclusive||(n.commitIndex=t+1);continue}const s=Bjn(n,e,t);if(s>t){t=s-1;continue}if(n.exclusive)continue;if(Wjn(n)){nA(n,t,r);continue}const i=qjn(n,e,t);if(i>t){t=i-1;continue}const a=Ujn(n,e,t);if(a>t){t=a-1;continue}xo(e,t)||nA(n,t,r)}return n}function Bjn(e,n,t){const r=n[t];return r==="`"?Pjn(e,n,t):r==="$"?Fjn(e,n,t):r==="~"?Hjn(e,n,t):t}function Pjn(e,n,t){const r=F6(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&Zv(n,t)&&!xo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!xo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||xo(n,t)?t+r:r>=3&&Zv(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function Fjn(e,n,t){const r=F6(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!xo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||xo(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function Hjn(e,n,t){const r=F6(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(Zv(n,t)&&!xo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!Zv(n,t)||xo(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function qjn(e,n,t){if(n[t]!=="<"||xo(n,t))return t;const r=n[t+1];if(r!==void 0&&!zP(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` +`)return e.pendingHtml=null,s+1;return n.length}function Ujn(e,n,t){const r=Gjn(n,t);if(!r)return t;if(xo(n,t))return t+r.length;const s=e.delims.findLastIndex(i=>i.token===r);return s!==-1?(e.delims.splice(s,1),t+r.length):t+r.length===n.length?(e.pendingDelim={start:t,token:r},t+r.length):(Vjn(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function Gjn(e,n){const t=e[n];if(t==="*")return e.startsWith("***",n)?"***":e.startsWith("**",n)?"**":"*";if(t==="_")return e.startsWith("__",n)?"__":"_";if(t==="~"&&e.startsWith("~~",n))return"~~"}function Vjn(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!iA(s)||!iA(r)}function nA(e,n,t){const r=e.links.at(-1);if(t==="["){e.links.push({phase:"text",start:n});return}if(t==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:n};return}if(t==="("&&(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(t==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(t===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function Kjn(e){var n,t;e.delims.length=0,e.links.length=0,((n=e.exclusive)==null?void 0:n.kind)!=="fence"&&(((t=e.exclusive)==null?void 0:t.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function Wjn(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function Qjn(e,n){n.pendingHtml!==null&&(e=e.slice(0,Zjn(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return $o(Xjn(e,t));const r=Yjn(n);if(r)return $o(Td(e,r));const s=tTn(n);return s?s.kind==="delim"?$o(v5(e,s.start,s.token.length)?EP(e,s.token):e.slice(0,s.start)):v5(e,s.start,s.token.length)?s.kind==="fence"?$o(e):s.kind==="code"?$o(Td(e,s.token)):s.token==="$$"?$o(Td(e,(e.endsWith(` `)?"":` -`)+"$$")):/\s/.test(e[e.length-1]??"")?Do(e):Do(jd(e,"$")):Do(s.kind==="fence"?e:e.slice(0,s.start)):Do(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function Bzn(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return m5(e,n.start,1)?t+e.slice(n.start+1):t;const r=e.slice(n.start+1,n.textEnd);return n.phase==="url_wait"?t+r+e.slice(n.textEnd+1):t+r}function Pzn(e){const n=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;n.push(e.exclusive.token)}for(let t=e.delims.length-1;t>=0;t--){const r=e.delims[t].token;if(!Nzn.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function Fzn(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!Hzn(e,s,r))break;t=s,r=s}return t}function Hzn(e,n,t){if(e[t-1]!==">"||oo(e,n))return!1;const r=e[n+1];if(r!==void 0&&!CP(r))return!1;for(let s=n+1;s"||i===` -`)return!1}return!0}function Do(e){var v;const n=e.lastIndexOf(` +`)+"$$")):/\s/.test(e[e.length-1]??"")?$o(e):$o(Td(e,"$")):$o(s.kind==="fence"?e:e.slice(0,s.start)):$o(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function Xjn(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return v5(e,n.start,1)?t+e.slice(n.start+1):t;const r=e.slice(n.start+1,n.textEnd);return n.phase==="url_wait"?t+r+e.slice(n.textEnd+1):t+r}function Yjn(e){const n=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;n.push(e.exclusive.token)}for(let t=e.delims.length-1;t>=0;t--){const r=e.delims[t].token;if(!$jn.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function Zjn(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!Jjn(e,s,r))break;t=s,r=s}return t}function Jjn(e,n,t){if(e[t-1]!==">"||xo(e,n))return!1;const r=e[n+1];if(r!==void 0&&!zP(r))return!1;for(let s=n+1;s"||i===` +`)return!1}return!0}function $o(e){var v;const n=e.lastIndexOf(` `),t=n===-1?0:n+2,r=e.slice(0,t),s=e.slice(t),i=s.indexOf(` -`),a=i===-1?s:s.slice(0,i),o=(v=a.match(/^( *)\|/))==null?void 0:v[1];if(o===void 0)return e;if(tA(a)<2&&!Gzn(a,o))return r;const c=a.trimEnd().endsWith("|")?a:kP(a," |"),u=tA(c),h=u<2?0:c.trimEnd().endsWith("|")?u-1:u;if(h===0)return e;const _=i===-1?"":s.slice(i+1),p=nA(o,Array.from({length:h},()=>"-"));if(_.length===0)return r+c+` +`),a=i===-1?s:s.slice(0,i),o=(v=a.match(/^( *)\|/))==null?void 0:v[1];if(o===void 0)return e;if(rA(a)<2&&!nTn(a,o))return r;const c=a.trimEnd().endsWith("|")?a:EP(a," |"),u=rA(c),h=u<2?0:c.trimEnd().endsWith("|")?u-1:u;if(h===0)return e;const _=i===-1?"":s.slice(i+1),p=sA(o,Array.from({length:h},()=>"-"));if(_.length===0)return r+c+` `+p;const m=_.indexOf(` -`),x=m===-1?_:_.slice(0,m),k=m===-1?"":_.slice(m);if(Vzn(x,o,h))return e;if(x.startsWith(o+"|")&&/^[ |:\-\t]*$/.test(x.slice(o.length))){const b=SP(x,o).map(w=>{const y=w.trim();if(y.length===0)return"-";let C=0;for(let N=0;N1&&y.endsWith(":")?":":"")});for(;b.length{const y=x.trim();if(y.length===0)return"-";let C=0;for(let z=0;z1&&y.endsWith(":")?":":"")});for(;b.length0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function Uzn(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function tA(e){let n=0;for(let t=0;t0}function nA(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function SP(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function Vzn(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=SP(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function P6(e,n){let t=n+1;for(;tn+t}function Yv(e,n){return n===0||e[n-1]===` -`}function oo(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function rA(e){return!!e&&/[A-Za-z0-9]/.test(e)}function CP(e){return!!e&&/[A-Za-z]/.test(e)}const EP=dy().use(py);var dm,ah,oh,L_,ch,hm,pm,mm,I_,gm,$_;class Kzn{constructor(){ot(this,dm,EP);ot(this,ah,null);ot(this,oh,{});ot(this,L_,null);ot(this,ch,"");ot(this,hm,[]);ot(this,pm,[]);ot(this,mm,[]);ot(this,I_,0);ot(this,gm,[]);ot(this,$_,[])}reconfigure(n,t,r){ue(this,ah)!==null&&ue(this,dm)===n&&NP(ue(this,oh),r)&&!!ue(this,L_)===t||(qe(this,dm,n),n.attachers.some(s=>s[0]===Xv)||(n=n(),n.use(Xv),n.freeze()),qe(this,ah,n),qe(this,oh,r),qe(this,ch,""),qe(this,hm,[]),qe(this,pm,[]),qe(this,mm,[]),qe(this,I_,0),qe(this,gm,[]),qe(this,L_,t?new Ezn:null))}update(n){ue(this,L_)&&(n=ue(this,L_).update(n));let t=ue(this,ch);if(n===t)return ue(this,$_);const r=ue(this,hm),s=Wzn(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=f_(ue(this,ah)),c=ue(this,pm),u=c.slice(i).some(z=>z.some(g5));let h=o.parse(n.slice(a)),_=h.children.map(z=>f_(f_(z.position).start.offset)+a);qe(this,ch,n),ww(r.length===c.length),r.splice(i,r.length-i,..._);{const z=Ow(h,_,a);ww(z.length===_.length),c.splice(i,c.length-i,...z)}if(u||g5(h)){i=0,a=0,h=o.parse(n),_=h.children.map(T=>f_(f_(T.position).start.offset)+a),r.splice(0,r.length,..._);const z=Ow(h,_,a);ww(z.length===_.length),c.splice(0,c.length,...z)}const p=Ow(o.runSync(h),_,a),m=ue(this,mm),x=ue(this,gm),k=ue(this,$_),v=x.length;let b=null,w=0;for(;wv&&(m.length=x.length=r.length);for(let z=r.length=C?M=v-(r.length-T):T=v){m[T]=String(ue(this,I_)),qe(this,I_,ue(this,I_)+1),x[T]=null,b&&(b[T]=void 0);continue}m[T]=m[M]??String(Op(this,I_)._++),x[T]=x[M]??null,b&&(b[T]=k[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||tjn.test(e.slice(0,n))?e:""}const Lw={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function ojn(e,n){return jP(e,{})||{type:"root",children:[]}}function jP(e,n){const t=cjn(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function cjn(e,n){switch(e.nodeType){case 1:return fjn(e,n);case 3:return ujn(e);case 8:return _jn(e);case 9:return oA(e,n);case 10:return ljn();case 11:return oA(e,n);default:return}}function oA(e,n){return{type:"root",children:TP(e,n)}}function ljn(){return{type:"doctype"}}function ujn(e){return{type:"text",value:e.nodeValue||""}}function _jn(e){return{type:"comment",value:e.nodeValue||""}}function fjn(e,n){const t=e.namespaceURI,r=t===Lw.svg?Lkn:A$,s=t===Lw.html?e.tagName.toLowerCase():e.tagName,i=t===Lw.html&&s==="template"?e.content:e,a=e.getAttributeNames(),o={};let c=-1;for(;++cu&&(u=h):h&&(u!==void 0&&u>-1&&c.push(` -`.repeat(u)||" "),u=-1,c.push(h))}return c.join("")}function RP(e,n,t){return e.type==="element"?wjn(e,n,t):e.type==="text"?t.whitespace==="normal"?MP(e,t):kjn(e):[]}function wjn(e,n,t){const r=OP(e,t),s=e.children||[];let i=-1,a=[];if(yjn(e))return a;let o,c;for(v5(e)||fA(e)&&cA(n,e,fA)?c=` -`:bjn(e)?(o=2,c=2):AP(e)&&(o=1,c=1);++i15?u="…"+o.slice(s-15,s):u=o.slice(0,s);var h;i+15e.replace(zjn,"-$1").toLowerCase(),Tjn={"&":"&",">":">","<":"<",'"':""","'":"'"},Ajn=/[&><"']/g,Xs=e=>String(e).replace(Ajn,n=>Tjn[n]),rv=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?rv(e.body[0]):e:e.type==="font"?rv(e.body):e,Rjn=new Set(["mathord","textord","atom"]),hl=e=>Rjn.has(rv(e).type),Mjn=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},b5={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,n)=>(n.push(e),n)},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 Ojn(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 Djn(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return Ojn(n)}function Ljn(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:Djn(r)}class H6{constructor(n){n===void 0&&(n={}),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,n=n||{};for(var t of Object.keys(b5)){var r=b5[t];r&&Ljn(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Xe("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=Mjn(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class Yl{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return qo[Ijn[this.id]]}sub(){return qo[$jn[this.id]]}fracNum(){return qo[Bjn[this.id]]}fracDen(){return qo[Pjn[this.id]]}cramp(){return qo[Fjn[this.id]]}text(){return qo[Hjn[this.id]]}isTight(){return this.size>=2}}var q6=0,Zv=1,Bd=2,ol=3,q0=4,Oa=5,kh=6,fi=7,qo=[new Yl(q6,0,!1),new Yl(Zv,0,!0),new Yl(Bd,1,!1),new Yl(ol,1,!0),new Yl(q0,2,!1),new Yl(Oa,2,!0),new Yl(kh,3,!1),new Yl(fi,3,!0)],Ijn=[q0,Oa,q0,Oa,kh,fi,kh,fi],$jn=[Oa,Oa,Oa,Oa,fi,fi,fi,fi],Bjn=[Bd,ol,q0,Oa,kh,fi,kh,fi],Pjn=[ol,ol,Oa,Oa,fi,fi,fi,fi],Fjn=[Zv,Zv,ol,ol,Oa,Oa,fi,fi],Hjn=[q6,Zv,Bd,ol,Bd,ol,Bd,ol],Yt={DISPLAY:qo[q6],TEXT:qo[Bd],SCRIPT:qo[q0],SCRIPTSCRIPT:qo[kh]},y5=[{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 qjn(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var sv=[];y5.forEach(e=>e.blocks.forEach(n=>sv.push(...n)));function DP(e){for(var n=0;n=sv[n]&&e<=sv[n+1])return!0;return!1}var vs=e=>e+" "+e,pd=80,Ujn=function(n,t){return"M95,"+(622+n+t)+` +`+_}function Td(e,n){return e+n.slice(eTn(e,n))}function EP(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return Td(e,n);const r=e.slice(0,-t.length);return Td(r,n)+t}function eTn(e,n){for(let t=Math.min(e.length,n.length);t>0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function tTn(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function rA(e){let n=0;for(let t=0;t0}function sA(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function NP(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function rTn(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=NP(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function F6(e,n){let t=n+1;for(;tn+t}function Zv(e,n){return n===0||e[n-1]===` +`}function xo(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function iA(e){return!!e&&/[A-Za-z0-9]/.test(e)}function zP(e){return!!e&&/[A-Za-z]/.test(e)}const jP=py().use(gy);var hm,oh,ch,U_,lh,pm,mm,gm,G_,vm,V_;class sTn{constructor(){lt(this,hm,jP);lt(this,oh,null);lt(this,ch,{});lt(this,U_,null);lt(this,lh,"");lt(this,pm,[]);lt(this,mm,[]);lt(this,gm,[]);lt(this,G_,0);lt(this,vm,[]);lt(this,V_,[])}reconfigure(n,t,r){le(this,oh)!==null&&le(this,hm)===n&&TP(le(this,ch),r)&&!!le(this,U_)===t||(Ue(this,hm,n),n.attachers.some(s=>s[0]===Yv)||(n=n(),n.use(Yv),n.freeze()),Ue(this,oh,n),Ue(this,ch,r),Ue(this,lh,""),Ue(this,pm,[]),Ue(this,mm,[]),Ue(this,gm,[]),Ue(this,G_,0),Ue(this,vm,[]),Ue(this,U_,t?new Ijn:null))}update(n){le(this,U_)&&(n=le(this,U_).update(n));let t=le(this,lh);if(n===t)return le(this,V_);const r=le(this,pm),s=iTn(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=y_(le(this,oh)),c=le(this,mm),u=c.slice(i).some(E=>E.some(b5));let h=o.parse(n.slice(a)),_=h.children.map(E=>y_(y_(E.position).start.offset)+a);Ue(this,lh,n),Sw(r.length===c.length),r.splice(i,r.length-i,..._);{const E=Lw(h,_,a);Sw(E.length===_.length),c.splice(i,c.length-i,...E)}if(u||b5(h)){i=0,a=0,h=o.parse(n),_=h.children.map(T=>y_(y_(T.position).start.offset)+a),r.splice(0,r.length,..._);const E=Lw(h,_,a);Sw(E.length===_.length),c.splice(0,c.length,...E)}const p=Lw(o.runSync(h),_,a),m=le(this,gm),w=le(this,vm),k=le(this,V_),v=w.length;let b=null,x=0;for(;xv&&(m.length=w.length=r.length);for(let E=r.length=C?M=v-(r.length-T):T=v){m[T]=String(le(this,G_)),Ue(this,G_,le(this,G_)+1),w[T]=null,b&&(b[T]=void 0);continue}m[T]=m[M]??String(Dp(this,G_)._++),w[T]=w[M]??null,b&&(b[T]=k[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||fTn.test(e.slice(0,n))?e:""}const $w={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function vTn(e,n){return RP(e,{})||{type:"root",children:[]}}function RP(e,n){const t=bTn(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function bTn(e,n){switch(e.nodeType){case 1:return kTn(e,n);case 3:return xTn(e);case 8:return wTn(e);case 9:return lA(e,n);case 10:return yTn();case 11:return lA(e,n);default:return}}function lA(e,n){return{type:"root",children:MP(e,n)}}function yTn(){return{type:"doctype"}}function xTn(e){return{type:"text",value:e.nodeValue||""}}function wTn(e){return{type:"comment",value:e.nodeValue||""}}function kTn(e,n){const t=e.namespaceURI,r=t===$w.svg?KSn:O$,s=t===$w.html?e.tagName.toLowerCase():e.tagName,i=t===$w.html&&s==="template"?e.content:e,a=e.getAttributeNames(),o={};let c=-1;for(;++cu&&(u=h):h&&(u!==void 0&&u>-1&&c.push(` +`.repeat(u)||" "),u=-1,c.push(h))}return c.join("")}function DP(e,n,t){return e.type==="element"?MTn(e,n,t):e.type==="text"?t.whitespace==="normal"?LP(e,t):OTn(e):[]}function MTn(e,n,t){const r=IP(e,t),s=e.children||[];let i=-1,a=[];if(ATn(e))return a;let o,c;for(y5(e)||hA(e)&&uA(n,e,hA)?c=` +`:TTn(e)?(o=2,c=2):OP(e)&&(o=1,c=1);++i15?u="…"+o.slice(s-15,s):u=o.slice(0,s);var h;i+15e.replace(BTn,"-$1").toLowerCase(),FTn={"&":"&",">":">","<":"<",'"':""","'":"'"},HTn=/[&><"']/g,Zs=e=>String(e).replace(HTn,n=>FTn[n]),rv=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?rv(e.body[0]):e:e.type==="font"?rv(e.body):e,qTn=new Set(["mathord","textord","atom"]),ml=e=>qTn.has(rv(e).type),UTn=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},x5={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,n)=>(n.push(e),n)},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 GTn(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 VTn(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return GTn(n)}function KTn(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:VTn(r)}class q6{constructor(n){n===void 0&&(n={}),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,n=n||{};for(var t of Object.keys(x5)){var r=x5[t];r&&KTn(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Xe("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=UTn(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class ou{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return Vo[WTn[this.id]]}sub(){return Vo[QTn[this.id]]}fracNum(){return Vo[XTn[this.id]]}fracDen(){return Vo[YTn[this.id]]}cramp(){return Vo[ZTn[this.id]]}text(){return Vo[JTn[this.id]]}isTight(){return this.size>=2}}var U6=0,Jv=1,Pd=2,ll=3,U0=4,qa=5,Sh=6,hi=7,Vo=[new ou(U6,0,!1),new ou(Jv,0,!0),new ou(Pd,1,!1),new ou(ll,1,!0),new ou(U0,2,!1),new ou(qa,2,!0),new ou(Sh,3,!1),new ou(hi,3,!0)],WTn=[U0,qa,U0,qa,Sh,hi,Sh,hi],QTn=[qa,qa,qa,qa,hi,hi,hi,hi],XTn=[Pd,ll,U0,qa,Sh,hi,Sh,hi],YTn=[ll,ll,qa,qa,hi,hi,hi,hi],ZTn=[Jv,Jv,ll,ll,qa,qa,hi,hi],JTn=[U6,Jv,Pd,ll,Pd,ll,Pd,ll],nn={DISPLAY:Vo[U6],TEXT:Vo[Pd],SCRIPT:Vo[U0],SCRIPTSCRIPT:Vo[Sh]},w5=[{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 eAn(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var sv=[];w5.forEach(e=>e.blocks.forEach(n=>sv.push(...n)));function $P(e){for(var n=0;n=sv[n]&&e<=sv[n+1])return!0;return!1}var bs=e=>e+" "+e,md=80,tAn=function(n,t){return"M95,"+(622+n+t)+` 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 @@ -772,7 +772,7 @@ c5.3,-9.3,12,-14,20,-14 H400000v`+(40+n)+`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+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},Gjn=function(n,t){return"M263,"+(601+n+t)+`c0.7,0,18,39.7,52,119 +M`+(834+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},nAn=function(n,t){return"M263,"+(601+n+t)+`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`+n/2.084+" -"+n+` @@ -782,7 +782,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+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},Vjn=function(n,t){return"M983 "+(10+n+t)+` +M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},rAn=function(n,t){return"M983 "+(10+n+t)+` l`+n/3.13+" -"+n+` c4,-6.7,10,-10,18,-10 H400000v`+(40+n)+` 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 @@ -791,7 +791,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+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},Kjn=function(n,t){return"M424,"+(2398+n+t)+` +M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},sAn=function(n,t){return"M424,"+(2398+n+t)+` 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 @@ -801,18 +801,18 @@ v`+(40+n)+`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+n)+" "+t+` -h400000v`+(40+n)+"h-400000z"},Wjn=function(n,t){return"M473,"+(2713+n+t)+` +h400000v`+(40+n)+"h-400000z"},iAn=function(n,t){return"M473,"+(2713+n+t)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+n/5.298+" -"+n+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+n)+`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+n)+" "+t+"h400000v"+(40+n)+"H1017.7z"},Qjn=function(n){var t=n/2;return"M400000 "+n+" H0 L"+t+" 0 l65 45 L145 "+(n-80)+" H400000z"},Xjn=function(n,t,r){var s=r-54-t-n;return"M702 "+(n+t)+"H400000"+(40+n)+` +606zM`+(1001+n)+" "+t+"h400000v"+(40+n)+"H1017.7z"},aAn=function(n){var t=n/2;return"M400000 "+n+" H0 L"+t+" 0 l65 45 L145 "+(n-80)+" H400000z"},oAn=function(n,t,r){var s=r-54-t-n;return"M702 "+(n+t)+"H400000"+(40+n)+` H742v`+s+`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 `+t+"H400000v"+(40+n)+"H742z"},Yjn=function(n,t,r){t=1e3*t;var s="";switch(n){case"sqrtMain":s=Ujn(t,pd);break;case"sqrtSize1":s=Gjn(t,pd);break;case"sqrtSize2":s=Vjn(t,pd);break;case"sqrtSize3":s=Kjn(t,pd);break;case"sqrtSize4":s=Wjn(t,pd);break;case"sqrtTall":s=Xjn(t,pd,r)}return s},Zjn=function(n,t){switch(n){case"⎜":return vs("M291 0 H417 V"+t+" H291z");case"∣":return vs("M145 0 H188 V"+t+" H145z");case"∥":return vs("M145 0 H188 V"+t+" H145z")+vs("M367 0 H410 V"+t+" H367z");case"⎟":return vs("M457 0 H583 V"+t+" H457z");case"⎢":return vs("M319 0 H403 V"+t+" H319z");case"⎥":return vs("M263 0 H347 V"+t+" H263z");case"⎪":return vs("M384 0 H504 V"+t+" H384z");case"⏐":return vs("M312 0 H355 V"+t+" H312z");case"‖":return vs("M257 0 H300 V"+t+" H257z")+vs("M478 0 H521 V"+t+" H478z");default:return""}},dA={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+t+"H400000v"+(40+n)+"H742z"},cAn=function(n,t,r){t=1e3*t;var s="";switch(n){case"sqrtMain":s=tAn(t,md);break;case"sqrtSize1":s=nAn(t,md);break;case"sqrtSize2":s=rAn(t,md);break;case"sqrtSize3":s=sAn(t,md);break;case"sqrtSize4":s=iAn(t,md);break;case"sqrtTall":s=oAn(t,md,r)}return s},lAn=function(n,t){switch(n){case"⎜":return bs("M291 0 H417 V"+t+" H291z");case"∣":return bs("M145 0 H188 V"+t+" H145z");case"∥":return bs("M145 0 H188 V"+t+" H145z")+bs("M367 0 H410 V"+t+" H367z");case"⎟":return bs("M457 0 H583 V"+t+" H457z");case"⎢":return bs("M319 0 H403 V"+t+" H319z");case"⎥":return bs("M263 0 H347 V"+t+" H263z");case"⎪":return bs("M384 0 H504 V"+t+" H384z");case"⏐":return bs("M312 0 H355 V"+t+" H312z");case"‖":return bs("M257 0 H300 V"+t+" H257z")+bs("M478 0 H521 V"+t+" H478z");default:return""}},pA={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 @@ -858,10 +858,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:vs("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:vs("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:vs("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:vs("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:bs("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:bs("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:bs("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:bs("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:vs("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:bs("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 @@ -910,7 +910,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:vs("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:vs("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:vs("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:bs("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:bs("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:bs("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 @@ -983,7 +983,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`},Jjn=function(n,t){switch(n){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},uAn=function(n,t){switch(n){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -1011,71 +1011,71 @@ 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,-`+(t+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 eTn(e){return"toText"in e}class qh{constructor(n){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=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(eTn(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var x5={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},tTn={ex:!0,em:!0,mu:!0},LP=function(n){return typeof n!="string"&&(n=n.unit),n in x5||n in tTn||n==="ex"},Dr=function(n,t){var r;if(n.unit in x5)r=x5[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Xe("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},tt=function(n){return+n.toFixed(4)+"em"},Eu=function(n){return n.filter(t=>t).join(" ")},U6=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=jjn(r)+":"+s+";")}return t},IP=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},$P=function(n){var t=document.createElement(n);t.className=Eu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,BP=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Xs(Eu(this.classes))+'"');var r=U6(this.style);r&&(t+=' style="'+Xs(r)+'"');for(var s of Object.keys(this.attributes)){if(nTn.test(s))throw new Xe("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Xs(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class Uh{constructor(n,t,r,s){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,IP.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return $P.call(this,"span")}toMarkup(){return BP.call(this,"span")}}class my{constructor(n,t,r,s){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,IP.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return $P.call(this,"a")}toMarkup(){return BP.call(this,"a")}}class rTn{constructor(n,t,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=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Xs(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=tt(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=Eu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+tt(this.italic)+";"),r+=U6(this.style),r&&(n=!0,t+=' style="'+Xs(r)+'"');var s=Xs(this.text);return n?(t+=">",t+=s,t+="",t):s}}class _l{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class w5{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var oTn=e=>e instanceof Uh||e instanceof my||e instanceof qh,Go={"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]}},b1={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]},hA={Å:"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 cTn(e,n){Go[e]=n}function G6(e,n,t){if(!Go[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Go[n][r];if(!s&&e[0]in hA&&(r=hA[e[0]].charCodeAt(0),s=Go[n][r]),!s&&t==="text"&&DP(r)&&(s=Go[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var Iw={};function lTn(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!Iw[n]){var t=Iw[n]={cssEmPerMu:b1.quad[n]/18};for(var r in b1)b1.hasOwnProperty(r)&&(t[r]=b1[r][n])}return Iw[n]}var Er={math:{},text:{}};function P(e,n,t,r,s,i){Er[e][s]={font:n,group:t,replace:r},i&&r&&(Er[e][r]=Er[e][s])}var W="math",Ue="text",ee="main",fe="ams",zr="accent-token",ht="bin",pi="close",Gh="inner",qt="mathord",_s="op-token",la="open",Lm="punct",de="rel",pl="spacing",ye="textord";P(W,ee,de,"≡","\\equiv",!0);P(W,ee,de,"≺","\\prec",!0);P(W,ee,de,"≻","\\succ",!0);P(W,ee,de,"∼","\\sim",!0);P(W,ee,de,"⊥","\\perp");P(W,ee,de,"⪯","\\preceq",!0);P(W,ee,de,"⪰","\\succeq",!0);P(W,ee,de,"≃","\\simeq",!0);P(W,ee,de,"∣","\\mid",!0);P(W,ee,de,"≪","\\ll",!0);P(W,ee,de,"≫","\\gg",!0);P(W,ee,de,"≍","\\asymp",!0);P(W,ee,de,"∥","\\parallel");P(W,ee,de,"⋈","\\bowtie",!0);P(W,ee,de,"⌣","\\smile",!0);P(W,ee,de,"⊑","\\sqsubseteq",!0);P(W,ee,de,"⊒","\\sqsupseteq",!0);P(W,ee,de,"≐","\\doteq",!0);P(W,ee,de,"⌢","\\frown",!0);P(W,ee,de,"∋","\\ni",!0);P(W,ee,de,"∝","\\propto",!0);P(W,ee,de,"⊢","\\vdash",!0);P(W,ee,de,"⊣","\\dashv",!0);P(W,ee,de,"∋","\\owns");P(W,ee,Lm,".","\\ldotp");P(W,ee,Lm,"⋅","\\cdotp");P(W,ee,Lm,"⋅","·");P(Ue,ee,ye,"⋅","·");P(W,ee,ye,"#","\\#");P(Ue,ee,ye,"#","\\#");P(W,ee,ye,"&","\\&");P(Ue,ee,ye,"&","\\&");P(W,ee,ye,"ℵ","\\aleph",!0);P(W,ee,ye,"∀","\\forall",!0);P(W,ee,ye,"ℏ","\\hbar",!0);P(W,ee,ye,"∃","\\exists",!0);P(W,ee,ye,"∇","\\nabla",!0);P(W,ee,ye,"♭","\\flat",!0);P(W,ee,ye,"ℓ","\\ell",!0);P(W,ee,ye,"♮","\\natural",!0);P(W,ee,ye,"♣","\\clubsuit",!0);P(W,ee,ye,"℘","\\wp",!0);P(W,ee,ye,"♯","\\sharp",!0);P(W,ee,ye,"♢","\\diamondsuit",!0);P(W,ee,ye,"ℜ","\\Re",!0);P(W,ee,ye,"♡","\\heartsuit",!0);P(W,ee,ye,"ℑ","\\Im",!0);P(W,ee,ye,"♠","\\spadesuit",!0);P(W,ee,ye,"§","\\S",!0);P(Ue,ee,ye,"§","\\S");P(W,ee,ye,"¶","\\P",!0);P(Ue,ee,ye,"¶","\\P");P(W,ee,ye,"†","\\dag");P(Ue,ee,ye,"†","\\dag");P(Ue,ee,ye,"†","\\textdagger");P(W,ee,ye,"‡","\\ddag");P(Ue,ee,ye,"‡","\\ddag");P(Ue,ee,ye,"‡","\\textdaggerdbl");P(W,ee,pi,"⎱","\\rmoustache",!0);P(W,ee,la,"⎰","\\lmoustache",!0);P(W,ee,pi,"⟯","\\rgroup",!0);P(W,ee,la,"⟮","\\lgroup",!0);P(W,ee,ht,"∓","\\mp",!0);P(W,ee,ht,"⊖","\\ominus",!0);P(W,ee,ht,"⊎","\\uplus",!0);P(W,ee,ht,"⊓","\\sqcap",!0);P(W,ee,ht,"∗","\\ast");P(W,ee,ht,"⊔","\\sqcup",!0);P(W,ee,ht,"◯","\\bigcirc",!0);P(W,ee,ht,"∙","\\bullet",!0);P(W,ee,ht,"‡","\\ddagger");P(W,ee,ht,"≀","\\wr",!0);P(W,ee,ht,"⨿","\\amalg");P(W,ee,ht,"&","\\And");P(W,ee,de,"⟵","\\longleftarrow",!0);P(W,ee,de,"⇐","\\Leftarrow",!0);P(W,ee,de,"⟸","\\Longleftarrow",!0);P(W,ee,de,"⟶","\\longrightarrow",!0);P(W,ee,de,"⇒","\\Rightarrow",!0);P(W,ee,de,"⟹","\\Longrightarrow",!0);P(W,ee,de,"↔","\\leftrightarrow",!0);P(W,ee,de,"⟷","\\longleftrightarrow",!0);P(W,ee,de,"⇔","\\Leftrightarrow",!0);P(W,ee,de,"⟺","\\Longleftrightarrow",!0);P(W,ee,de,"↦","\\mapsto",!0);P(W,ee,de,"⟼","\\longmapsto",!0);P(W,ee,de,"↗","\\nearrow",!0);P(W,ee,de,"↩","\\hookleftarrow",!0);P(W,ee,de,"↪","\\hookrightarrow",!0);P(W,ee,de,"↘","\\searrow",!0);P(W,ee,de,"↼","\\leftharpoonup",!0);P(W,ee,de,"⇀","\\rightharpoonup",!0);P(W,ee,de,"↙","\\swarrow",!0);P(W,ee,de,"↽","\\leftharpoondown",!0);P(W,ee,de,"⇁","\\rightharpoondown",!0);P(W,ee,de,"↖","\\nwarrow",!0);P(W,ee,de,"⇌","\\rightleftharpoons",!0);P(W,fe,de,"≮","\\nless",!0);P(W,fe,de,"","\\@nleqslant");P(W,fe,de,"","\\@nleqq");P(W,fe,de,"⪇","\\lneq",!0);P(W,fe,de,"≨","\\lneqq",!0);P(W,fe,de,"","\\@lvertneqq");P(W,fe,de,"⋦","\\lnsim",!0);P(W,fe,de,"⪉","\\lnapprox",!0);P(W,fe,de,"⊀","\\nprec",!0);P(W,fe,de,"⋠","\\npreceq",!0);P(W,fe,de,"⋨","\\precnsim",!0);P(W,fe,de,"⪹","\\precnapprox",!0);P(W,fe,de,"≁","\\nsim",!0);P(W,fe,de,"","\\@nshortmid");P(W,fe,de,"∤","\\nmid",!0);P(W,fe,de,"⊬","\\nvdash",!0);P(W,fe,de,"⊭","\\nvDash",!0);P(W,fe,de,"⋪","\\ntriangleleft");P(W,fe,de,"⋬","\\ntrianglelefteq",!0);P(W,fe,de,"⊊","\\subsetneq",!0);P(W,fe,de,"","\\@varsubsetneq");P(W,fe,de,"⫋","\\subsetneqq",!0);P(W,fe,de,"","\\@varsubsetneqq");P(W,fe,de,"≯","\\ngtr",!0);P(W,fe,de,"","\\@ngeqslant");P(W,fe,de,"","\\@ngeqq");P(W,fe,de,"⪈","\\gneq",!0);P(W,fe,de,"≩","\\gneqq",!0);P(W,fe,de,"","\\@gvertneqq");P(W,fe,de,"⋧","\\gnsim",!0);P(W,fe,de,"⪊","\\gnapprox",!0);P(W,fe,de,"⊁","\\nsucc",!0);P(W,fe,de,"⋡","\\nsucceq",!0);P(W,fe,de,"⋩","\\succnsim",!0);P(W,fe,de,"⪺","\\succnapprox",!0);P(W,fe,de,"≆","\\ncong",!0);P(W,fe,de,"","\\@nshortparallel");P(W,fe,de,"∦","\\nparallel",!0);P(W,fe,de,"⊯","\\nVDash",!0);P(W,fe,de,"⋫","\\ntriangleright");P(W,fe,de,"⋭","\\ntrianglerighteq",!0);P(W,fe,de,"","\\@nsupseteqq");P(W,fe,de,"⊋","\\supsetneq",!0);P(W,fe,de,"","\\@varsupsetneq");P(W,fe,de,"⫌","\\supsetneqq",!0);P(W,fe,de,"","\\@varsupsetneqq");P(W,fe,de,"⊮","\\nVdash",!0);P(W,fe,de,"⪵","\\precneqq",!0);P(W,fe,de,"⪶","\\succneqq",!0);P(W,fe,de,"","\\@nsubseteqq");P(W,fe,ht,"⊴","\\unlhd");P(W,fe,ht,"⊵","\\unrhd");P(W,fe,de,"↚","\\nleftarrow",!0);P(W,fe,de,"↛","\\nrightarrow",!0);P(W,fe,de,"⇍","\\nLeftarrow",!0);P(W,fe,de,"⇏","\\nRightarrow",!0);P(W,fe,de,"↮","\\nleftrightarrow",!0);P(W,fe,de,"⇎","\\nLeftrightarrow",!0);P(W,fe,de,"△","\\vartriangle");P(W,fe,ye,"ℏ","\\hslash");P(W,fe,ye,"▽","\\triangledown");P(W,fe,ye,"◊","\\lozenge");P(W,fe,ye,"Ⓢ","\\circledS");P(W,fe,ye,"®","\\circledR");P(Ue,fe,ye,"®","\\circledR");P(W,fe,ye,"∡","\\measuredangle",!0);P(W,fe,ye,"∄","\\nexists");P(W,fe,ye,"℧","\\mho");P(W,fe,ye,"Ⅎ","\\Finv",!0);P(W,fe,ye,"⅁","\\Game",!0);P(W,fe,ye,"‵","\\backprime");P(W,fe,ye,"▲","\\blacktriangle");P(W,fe,ye,"▼","\\blacktriangledown");P(W,fe,ye,"■","\\blacksquare");P(W,fe,ye,"⧫","\\blacklozenge");P(W,fe,ye,"★","\\bigstar");P(W,fe,ye,"∢","\\sphericalangle",!0);P(W,fe,ye,"∁","\\complement",!0);P(W,fe,ye,"ð","\\eth",!0);P(Ue,ee,ye,"ð","ð");P(W,fe,ye,"╱","\\diagup");P(W,fe,ye,"╲","\\diagdown");P(W,fe,ye,"□","\\square");P(W,fe,ye,"□","\\Box");P(W,fe,ye,"◊","\\Diamond");P(W,fe,ye,"¥","\\yen",!0);P(Ue,fe,ye,"¥","\\yen",!0);P(W,fe,ye,"✓","\\checkmark",!0);P(Ue,fe,ye,"✓","\\checkmark");P(W,fe,ye,"ℶ","\\beth",!0);P(W,fe,ye,"ℸ","\\daleth",!0);P(W,fe,ye,"ℷ","\\gimel",!0);P(W,fe,ye,"ϝ","\\digamma",!0);P(W,fe,ye,"ϰ","\\varkappa");P(W,fe,la,"┌","\\@ulcorner",!0);P(W,fe,pi,"┐","\\@urcorner",!0);P(W,fe,la,"└","\\@llcorner",!0);P(W,fe,pi,"┘","\\@lrcorner",!0);P(W,fe,de,"≦","\\leqq",!0);P(W,fe,de,"⩽","\\leqslant",!0);P(W,fe,de,"⪕","\\eqslantless",!0);P(W,fe,de,"≲","\\lesssim",!0);P(W,fe,de,"⪅","\\lessapprox",!0);P(W,fe,de,"≊","\\approxeq",!0);P(W,fe,ht,"⋖","\\lessdot");P(W,fe,de,"⋘","\\lll",!0);P(W,fe,de,"≶","\\lessgtr",!0);P(W,fe,de,"⋚","\\lesseqgtr",!0);P(W,fe,de,"⪋","\\lesseqqgtr",!0);P(W,fe,de,"≑","\\doteqdot");P(W,fe,de,"≓","\\risingdotseq",!0);P(W,fe,de,"≒","\\fallingdotseq",!0);P(W,fe,de,"∽","\\backsim",!0);P(W,fe,de,"⋍","\\backsimeq",!0);P(W,fe,de,"⫅","\\subseteqq",!0);P(W,fe,de,"⋐","\\Subset",!0);P(W,fe,de,"⊏","\\sqsubset",!0);P(W,fe,de,"≼","\\preccurlyeq",!0);P(W,fe,de,"⋞","\\curlyeqprec",!0);P(W,fe,de,"≾","\\precsim",!0);P(W,fe,de,"⪷","\\precapprox",!0);P(W,fe,de,"⊲","\\vartriangleleft");P(W,fe,de,"⊴","\\trianglelefteq");P(W,fe,de,"⊨","\\vDash",!0);P(W,fe,de,"⊪","\\Vvdash",!0);P(W,fe,de,"⌣","\\smallsmile");P(W,fe,de,"⌢","\\smallfrown");P(W,fe,de,"≏","\\bumpeq",!0);P(W,fe,de,"≎","\\Bumpeq",!0);P(W,fe,de,"≧","\\geqq",!0);P(W,fe,de,"⩾","\\geqslant",!0);P(W,fe,de,"⪖","\\eqslantgtr",!0);P(W,fe,de,"≳","\\gtrsim",!0);P(W,fe,de,"⪆","\\gtrapprox",!0);P(W,fe,ht,"⋗","\\gtrdot");P(W,fe,de,"⋙","\\ggg",!0);P(W,fe,de,"≷","\\gtrless",!0);P(W,fe,de,"⋛","\\gtreqless",!0);P(W,fe,de,"⪌","\\gtreqqless",!0);P(W,fe,de,"≖","\\eqcirc",!0);P(W,fe,de,"≗","\\circeq",!0);P(W,fe,de,"≜","\\triangleq",!0);P(W,fe,de,"∼","\\thicksim");P(W,fe,de,"≈","\\thickapprox");P(W,fe,de,"⫆","\\supseteqq",!0);P(W,fe,de,"⋑","\\Supset",!0);P(W,fe,de,"⊐","\\sqsupset",!0);P(W,fe,de,"≽","\\succcurlyeq",!0);P(W,fe,de,"⋟","\\curlyeqsucc",!0);P(W,fe,de,"≿","\\succsim",!0);P(W,fe,de,"⪸","\\succapprox",!0);P(W,fe,de,"⊳","\\vartriangleright");P(W,fe,de,"⊵","\\trianglerighteq");P(W,fe,de,"⊩","\\Vdash",!0);P(W,fe,de,"∣","\\shortmid");P(W,fe,de,"∥","\\shortparallel");P(W,fe,de,"≬","\\between",!0);P(W,fe,de,"⋔","\\pitchfork",!0);P(W,fe,de,"∝","\\varpropto");P(W,fe,de,"◀","\\blacktriangleleft");P(W,fe,de,"∴","\\therefore",!0);P(W,fe,de,"∍","\\backepsilon");P(W,fe,de,"▶","\\blacktriangleright");P(W,fe,de,"∵","\\because",!0);P(W,fe,de,"⋘","\\llless");P(W,fe,de,"⋙","\\gggtr");P(W,fe,ht,"⊲","\\lhd");P(W,fe,ht,"⊳","\\rhd");P(W,fe,de,"≂","\\eqsim",!0);P(W,ee,de,"⋈","\\Join");P(W,fe,de,"≑","\\Doteq",!0);P(W,fe,ht,"∔","\\dotplus",!0);P(W,fe,ht,"∖","\\smallsetminus");P(W,fe,ht,"⋒","\\Cap",!0);P(W,fe,ht,"⋓","\\Cup",!0);P(W,fe,ht,"⩞","\\doublebarwedge",!0);P(W,fe,ht,"⊟","\\boxminus",!0);P(W,fe,ht,"⊞","\\boxplus",!0);P(W,fe,ht,"⋇","\\divideontimes",!0);P(W,fe,ht,"⋉","\\ltimes",!0);P(W,fe,ht,"⋊","\\rtimes",!0);P(W,fe,ht,"⋋","\\leftthreetimes",!0);P(W,fe,ht,"⋌","\\rightthreetimes",!0);P(W,fe,ht,"⋏","\\curlywedge",!0);P(W,fe,ht,"⋎","\\curlyvee",!0);P(W,fe,ht,"⊝","\\circleddash",!0);P(W,fe,ht,"⊛","\\circledast",!0);P(W,fe,ht,"⋅","\\centerdot");P(W,fe,ht,"⊺","\\intercal",!0);P(W,fe,ht,"⋒","\\doublecap");P(W,fe,ht,"⋓","\\doublecup");P(W,fe,ht,"⊠","\\boxtimes",!0);P(W,fe,de,"⇢","\\dashrightarrow",!0);P(W,fe,de,"⇠","\\dashleftarrow",!0);P(W,fe,de,"⇇","\\leftleftarrows",!0);P(W,fe,de,"⇆","\\leftrightarrows",!0);P(W,fe,de,"⇚","\\Lleftarrow",!0);P(W,fe,de,"↞","\\twoheadleftarrow",!0);P(W,fe,de,"↢","\\leftarrowtail",!0);P(W,fe,de,"↫","\\looparrowleft",!0);P(W,fe,de,"⇋","\\leftrightharpoons",!0);P(W,fe,de,"↶","\\curvearrowleft",!0);P(W,fe,de,"↺","\\circlearrowleft",!0);P(W,fe,de,"↰","\\Lsh",!0);P(W,fe,de,"⇈","\\upuparrows",!0);P(W,fe,de,"↿","\\upharpoonleft",!0);P(W,fe,de,"⇃","\\downharpoonleft",!0);P(W,ee,de,"⊶","\\origof",!0);P(W,ee,de,"⊷","\\imageof",!0);P(W,fe,de,"⊸","\\multimap",!0);P(W,fe,de,"↭","\\leftrightsquigarrow",!0);P(W,fe,de,"⇉","\\rightrightarrows",!0);P(W,fe,de,"⇄","\\rightleftarrows",!0);P(W,fe,de,"↠","\\twoheadrightarrow",!0);P(W,fe,de,"↣","\\rightarrowtail",!0);P(W,fe,de,"↬","\\looparrowright",!0);P(W,fe,de,"↷","\\curvearrowright",!0);P(W,fe,de,"↻","\\circlearrowright",!0);P(W,fe,de,"↱","\\Rsh",!0);P(W,fe,de,"⇊","\\downdownarrows",!0);P(W,fe,de,"↾","\\upharpoonright",!0);P(W,fe,de,"⇂","\\downharpoonright",!0);P(W,fe,de,"⇝","\\rightsquigarrow",!0);P(W,fe,de,"⇝","\\leadsto");P(W,fe,de,"⇛","\\Rrightarrow",!0);P(W,fe,de,"↾","\\restriction");P(W,ee,ye,"‘","`");P(W,ee,ye,"$","\\$");P(Ue,ee,ye,"$","\\$");P(Ue,ee,ye,"$","\\textdollar");P(W,ee,ye,"%","\\%");P(Ue,ee,ye,"%","\\%");P(W,ee,ye,"_","\\_");P(Ue,ee,ye,"_","\\_");P(Ue,ee,ye,"_","\\textunderscore");P(W,ee,ye,"∠","\\angle",!0);P(W,ee,ye,"∞","\\infty",!0);P(W,ee,ye,"′","\\prime");P(W,ee,ye,"△","\\triangle");P(W,ee,ye,"Γ","\\Gamma",!0);P(W,ee,ye,"Δ","\\Delta",!0);P(W,ee,ye,"Θ","\\Theta",!0);P(W,ee,ye,"Λ","\\Lambda",!0);P(W,ee,ye,"Ξ","\\Xi",!0);P(W,ee,ye,"Π","\\Pi",!0);P(W,ee,ye,"Σ","\\Sigma",!0);P(W,ee,ye,"Υ","\\Upsilon",!0);P(W,ee,ye,"Φ","\\Phi",!0);P(W,ee,ye,"Ψ","\\Psi",!0);P(W,ee,ye,"Ω","\\Omega",!0);P(W,ee,ye,"A","Α");P(W,ee,ye,"B","Β");P(W,ee,ye,"E","Ε");P(W,ee,ye,"Z","Ζ");P(W,ee,ye,"H","Η");P(W,ee,ye,"I","Ι");P(W,ee,ye,"K","Κ");P(W,ee,ye,"M","Μ");P(W,ee,ye,"N","Ν");P(W,ee,ye,"O","Ο");P(W,ee,ye,"P","Ρ");P(W,ee,ye,"T","Τ");P(W,ee,ye,"X","Χ");P(W,ee,ye,"¬","\\neg",!0);P(W,ee,ye,"¬","\\lnot");P(W,ee,ye,"⊤","\\top");P(W,ee,ye,"⊥","\\bot");P(W,ee,ye,"∅","\\emptyset");P(W,fe,ye,"∅","\\varnothing");P(W,ee,qt,"α","\\alpha",!0);P(W,ee,qt,"β","\\beta",!0);P(W,ee,qt,"γ","\\gamma",!0);P(W,ee,qt,"δ","\\delta",!0);P(W,ee,qt,"ϵ","\\epsilon",!0);P(W,ee,qt,"ζ","\\zeta",!0);P(W,ee,qt,"η","\\eta",!0);P(W,ee,qt,"θ","\\theta",!0);P(W,ee,qt,"ι","\\iota",!0);P(W,ee,qt,"κ","\\kappa",!0);P(W,ee,qt,"λ","\\lambda",!0);P(W,ee,qt,"μ","\\mu",!0);P(W,ee,qt,"ν","\\nu",!0);P(W,ee,qt,"ξ","\\xi",!0);P(W,ee,qt,"ο","\\omicron",!0);P(W,ee,qt,"π","\\pi",!0);P(W,ee,qt,"ρ","\\rho",!0);P(W,ee,qt,"σ","\\sigma",!0);P(W,ee,qt,"τ","\\tau",!0);P(W,ee,qt,"υ","\\upsilon",!0);P(W,ee,qt,"ϕ","\\phi",!0);P(W,ee,qt,"χ","\\chi",!0);P(W,ee,qt,"ψ","\\psi",!0);P(W,ee,qt,"ω","\\omega",!0);P(W,ee,qt,"ε","\\varepsilon",!0);P(W,ee,qt,"ϑ","\\vartheta",!0);P(W,ee,qt,"ϖ","\\varpi",!0);P(W,ee,qt,"ϱ","\\varrho",!0);P(W,ee,qt,"ς","\\varsigma",!0);P(W,ee,qt,"φ","\\varphi",!0);P(W,ee,ht,"∗","*",!0);P(W,ee,ht,"+","+");P(W,ee,ht,"−","-",!0);P(W,ee,ht,"⋅","\\cdot",!0);P(W,ee,ht,"∘","\\circ",!0);P(W,ee,ht,"÷","\\div",!0);P(W,ee,ht,"±","\\pm",!0);P(W,ee,ht,"×","\\times",!0);P(W,ee,ht,"∩","\\cap",!0);P(W,ee,ht,"∪","\\cup",!0);P(W,ee,ht,"∖","\\setminus",!0);P(W,ee,ht,"∧","\\land");P(W,ee,ht,"∨","\\lor");P(W,ee,ht,"∧","\\wedge",!0);P(W,ee,ht,"∨","\\vee",!0);P(W,ee,ye,"√","\\surd");P(W,ee,la,"⟨","\\langle",!0);P(W,ee,la,"∣","\\lvert");P(W,ee,la,"∥","\\lVert");P(W,ee,pi,"?","?");P(W,ee,pi,"!","!");P(W,ee,pi,"⟩","\\rangle",!0);P(W,ee,pi,"∣","\\rvert");P(W,ee,pi,"∥","\\rVert");P(W,ee,de,"=","=");P(W,ee,de,":",":");P(W,ee,de,"≈","\\approx",!0);P(W,ee,de,"≅","\\cong",!0);P(W,ee,de,"≥","\\ge");P(W,ee,de,"≥","\\geq",!0);P(W,ee,de,"←","\\gets");P(W,ee,de,">","\\gt",!0);P(W,ee,de,"∈","\\in",!0);P(W,ee,de,"","\\@not");P(W,ee,de,"⊂","\\subset",!0);P(W,ee,de,"⊃","\\supset",!0);P(W,ee,de,"⊆","\\subseteq",!0);P(W,ee,de,"⊇","\\supseteq",!0);P(W,fe,de,"⊈","\\nsubseteq",!0);P(W,fe,de,"⊉","\\nsupseteq",!0);P(W,ee,de,"⊨","\\models");P(W,ee,de,"←","\\leftarrow",!0);P(W,ee,de,"≤","\\le");P(W,ee,de,"≤","\\leq",!0);P(W,ee,de,"<","\\lt",!0);P(W,ee,de,"→","\\rightarrow",!0);P(W,ee,de,"→","\\to");P(W,fe,de,"≱","\\ngeq",!0);P(W,fe,de,"≰","\\nleq",!0);P(W,ee,pl," ","\\ ");P(W,ee,pl," ","\\space");P(W,ee,pl," ","\\nobreakspace");P(Ue,ee,pl," ","\\ ");P(Ue,ee,pl," "," ");P(Ue,ee,pl," ","\\space");P(Ue,ee,pl," ","\\nobreakspace");P(W,ee,pl,"","\\nobreak");P(W,ee,pl,"","\\allowbreak");P(W,ee,Lm,",",",");P(W,ee,Lm,";",";");P(W,fe,ht,"⊼","\\barwedge",!0);P(W,fe,ht,"⊻","\\veebar",!0);P(W,ee,ht,"⊙","\\odot",!0);P(W,ee,ht,"⊕","\\oplus",!0);P(W,ee,ht,"⊗","\\otimes",!0);P(W,ee,ye,"∂","\\partial",!0);P(W,ee,ht,"⊘","\\oslash",!0);P(W,fe,ht,"⊚","\\circledcirc",!0);P(W,fe,ht,"⊡","\\boxdot",!0);P(W,ee,ht,"△","\\bigtriangleup");P(W,ee,ht,"▽","\\bigtriangledown");P(W,ee,ht,"†","\\dagger");P(W,ee,ht,"⋄","\\diamond");P(W,ee,ht,"⋆","\\star");P(W,ee,ht,"◃","\\triangleleft");P(W,ee,ht,"▹","\\triangleright");P(W,ee,la,"{","\\{");P(Ue,ee,ye,"{","\\{");P(Ue,ee,ye,"{","\\textbraceleft");P(W,ee,pi,"}","\\}");P(Ue,ee,ye,"}","\\}");P(Ue,ee,ye,"}","\\textbraceright");P(W,ee,la,"{","\\lbrace");P(W,ee,pi,"}","\\rbrace");P(W,ee,la,"[","\\lbrack",!0);P(Ue,ee,ye,"[","\\lbrack",!0);P(W,ee,pi,"]","\\rbrack",!0);P(Ue,ee,ye,"]","\\rbrack",!0);P(W,ee,la,"(","\\lparen",!0);P(W,ee,pi,")","\\rparen",!0);P(Ue,ee,ye,"<","\\textless",!0);P(Ue,ee,ye,">","\\textgreater",!0);P(W,ee,la,"⌊","\\lfloor",!0);P(W,ee,pi,"⌋","\\rfloor",!0);P(W,ee,la,"⌈","\\lceil",!0);P(W,ee,pi,"⌉","\\rceil",!0);P(W,ee,ye,"\\","\\backslash");P(W,ee,ye,"∣","|");P(W,ee,ye,"∣","\\vert");P(Ue,ee,ye,"|","\\textbar",!0);P(W,ee,ye,"∥","\\|");P(W,ee,ye,"∥","\\Vert");P(Ue,ee,ye,"∥","\\textbardbl");P(Ue,ee,ye,"~","\\textasciitilde");P(Ue,ee,ye,"\\","\\textbackslash");P(Ue,ee,ye,"^","\\textasciicircum");P(W,ee,de,"↑","\\uparrow",!0);P(W,ee,de,"⇑","\\Uparrow",!0);P(W,ee,de,"↓","\\downarrow",!0);P(W,ee,de,"⇓","\\Downarrow",!0);P(W,ee,de,"↕","\\updownarrow",!0);P(W,ee,de,"⇕","\\Updownarrow",!0);P(W,ee,_s,"∐","\\coprod");P(W,ee,_s,"⋁","\\bigvee");P(W,ee,_s,"⋀","\\bigwedge");P(W,ee,_s,"⨄","\\biguplus");P(W,ee,_s,"⋂","\\bigcap");P(W,ee,_s,"⋃","\\bigcup");P(W,ee,_s,"∫","\\int");P(W,ee,_s,"∫","\\intop");P(W,ee,_s,"∬","\\iint");P(W,ee,_s,"∭","\\iiint");P(W,ee,_s,"∏","\\prod");P(W,ee,_s,"∑","\\sum");P(W,ee,_s,"⨂","\\bigotimes");P(W,ee,_s,"⨁","\\bigoplus");P(W,ee,_s,"⨀","\\bigodot");P(W,ee,_s,"∮","\\oint");P(W,ee,_s,"∯","\\oiint");P(W,ee,_s,"∰","\\oiiint");P(W,ee,_s,"⨆","\\bigsqcup");P(W,ee,_s,"∫","\\smallint");P(Ue,ee,Gh,"…","\\textellipsis");P(W,ee,Gh,"…","\\mathellipsis");P(Ue,ee,Gh,"…","\\ldots",!0);P(W,ee,Gh,"…","\\ldots",!0);P(W,ee,Gh,"⋯","\\@cdots",!0);P(W,ee,Gh,"⋱","\\ddots",!0);P(W,ee,ye,"⋮","\\varvdots");P(Ue,ee,ye,"⋮","\\varvdots");P(W,ee,zr,"ˊ","\\acute");P(W,ee,zr,"ˋ","\\grave");P(W,ee,zr,"¨","\\ddot");P(W,ee,zr,"~","\\tilde");P(W,ee,zr,"ˉ","\\bar");P(W,ee,zr,"˘","\\breve");P(W,ee,zr,"ˇ","\\check");P(W,ee,zr,"^","\\hat");P(W,ee,zr,"⃗","\\vec");P(W,ee,zr,"˙","\\dot");P(W,ee,zr,"˚","\\mathring");P(W,ee,qt,"","\\@imath");P(W,ee,qt,"","\\@jmath");P(W,ee,ye,"ı","ı");P(W,ee,ye,"ȷ","ȷ");P(Ue,ee,ye,"ı","\\i",!0);P(Ue,ee,ye,"ȷ","\\j",!0);P(Ue,ee,ye,"ß","\\ss",!0);P(Ue,ee,ye,"æ","\\ae",!0);P(Ue,ee,ye,"œ","\\oe",!0);P(Ue,ee,ye,"ø","\\o",!0);P(Ue,ee,ye,"Æ","\\AE",!0);P(Ue,ee,ye,"Œ","\\OE",!0);P(Ue,ee,ye,"Ø","\\O",!0);P(Ue,ee,zr,"ˊ","\\'");P(Ue,ee,zr,"ˋ","\\`");P(Ue,ee,zr,"ˆ","\\^");P(Ue,ee,zr,"˜","\\~");P(Ue,ee,zr,"ˉ","\\=");P(Ue,ee,zr,"˘","\\u");P(Ue,ee,zr,"˙","\\.");P(Ue,ee,zr,"¸","\\c");P(Ue,ee,zr,"˚","\\r");P(Ue,ee,zr,"ˇ","\\v");P(Ue,ee,zr,"¨",'\\"');P(Ue,ee,zr,"˝","\\H");P(Ue,ee,zr,"◯","\\textcircled");var PP={"--":!0,"---":!0,"``":!0,"''":!0};P(Ue,ee,ye,"–","--",!0);P(Ue,ee,ye,"–","\\textendash");P(Ue,ee,ye,"—","---",!0);P(Ue,ee,ye,"—","\\textemdash");P(Ue,ee,ye,"‘","`",!0);P(Ue,ee,ye,"‘","\\textquoteleft");P(Ue,ee,ye,"’","'",!0);P(Ue,ee,ye,"’","\\textquoteright");P(Ue,ee,ye,"“","``",!0);P(Ue,ee,ye,"“","\\textquotedblleft");P(Ue,ee,ye,"”","''",!0);P(Ue,ee,ye,"”","\\textquotedblright");P(W,ee,ye,"°","\\degree",!0);P(Ue,ee,ye,"°","\\degree");P(Ue,ee,ye,"°","\\textdegree",!0);P(W,ee,ye,"£","\\pounds");P(W,ee,ye,"£","\\mathsterling",!0);P(Ue,ee,ye,"£","\\pounds");P(Ue,ee,ye,"£","\\textsterling",!0);P(W,fe,ye,"✠","\\maltese");P(Ue,fe,ye,"✠","\\maltese");var pA='0123456789/@."';for(var $w=0;$w{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return CA[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return _Tn[i]}else{if(r===120485||r===120486)return CA[0];if(120486{if(Eu(e.classes)!==Eu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},FP=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ve=function(n,t,r,s){var i=new Uh(n,t,r,s);return K6(i),i},zu=(e,n,t,r)=>new Uh(e,n,t,r),Sh=function(n,t,r){var s=Ve([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=tt(s.height),s.maxFontSize=1,s},pTn=function(n,t,r,s){var i=new my(n,t,r,s);return K6(i),i},ml=function(n){var t=new qh(n);return K6(t),t},Ch=function(n,t){return n instanceof qh?Ve([],[n],t):n},mTn=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ve(["mspace"],[],n),r=Dr(e,n);return t.style.marginRight=tt(r),t},w1=(e,n,t)=>{var r,s;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 n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},z5={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"}},qP={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},UP=function(n,t){var[r,s,i]=qP[n],a=new Nu(r),o=new _l([a],{width:tt(s),height:tt(i),style:"width:"+tt(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),c=zu(["overlay"],[o],t);return c.height=i,c.style.height=tt(i),c.style.width=tt(s),c},Mr={number:3,unit:"mu"},h_={number:4,unit:"mu"},Pc={number:5,unit:"mu"},gTn={mord:{mop:Mr,mbin:h_,mrel:Pc,minner:Mr},mop:{mord:Mr,mop:Mr,mrel:Pc,minner:Mr},mbin:{mord:h_,mop:h_,mopen:h_,minner:h_},mrel:{mord:Pc,mop:Pc,mopen:Pc,minner:Pc},mopen:{},mclose:{mop:Mr,mbin:h_,mrel:Pc,minner:Mr},mpunct:{mord:Mr,mop:Mr,mrel:Pc,mopen:Mr,mclose:Mr,mpunct:Mr,minner:Mr},minner:{mord:Mr,mop:Mr,mbin:h_,mrel:Pc,mopen:Mr,mpunct:Mr,minner:Mr}},vTn={mord:{mop:Mr},mop:{mord:Mr,mop:Mr},mbin:{},mrel:{},mopen:{},mclose:{mop:Mr},mpunct:{},minner:{mop:Mr}},GP={},eb={},tb={};function lt(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,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:s},c=0;c{var v=k.classes[0],b=x.classes[0];v==="mbin"&&yTn.has(b)?k.classes[0]="mord":b==="mbin"&&bTn.has(v)&&(x.classes[0]="mord")},{node:_},p,m),j5(i,(x,k)=>{var v,b,w=A5(k),y=A5(x),C=w&&y?x.hasClass("mtight")?(v=vTn[w])==null?void 0:v[y]:(b=gTn[w])==null?void 0:b[y]:null;if(C)return HP(C,u)},{node:_},p,m),i},j5=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(_+1,0,p),a++})(a)}s&&n.pop()},VP=function(n){return n instanceof qh||n instanceof my||n instanceof Uh&&n.hasClass("enclosing")?n:null},T5=function(n,t){var r=VP(n);if(r){var s=r.children;if(s.length){if(t==="right")return T5(s[s.length-1],"right");if(t==="left")return T5(s[0],"left")}}return n},A5=function(n,t){if(!n)return null;t&&(n=T5(n,t));var r=n.classes[0];return wTn[r]||null},U0=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ve(t.concat(r))},Fn=function(n,t,r){if(!n)return Ve();if(eb[n.type]){var s=eb[n.type](n,t);if(r&&t.size!==r.size){s=Ve(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Xe("Got group of unknown type: '"+n.type+"'")};function k1(e,n){var t=Ve(["base"],e,n),r=Ve(["strut"]);return r.style.height=tt(t.height+t.depth),t.depth&&(r.style.verticalAlign=tt(-t.depth)),t.children.unshift(r),t}function R5(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=ys(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(k1(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(k1(a,n));var u;t?(u=k1(ys(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var h=Ve(["katex-html"],i);if(h.setAttribute("aria-hidden","true"),u){var _=u.children[0];_.style.height=tt(h.height+h.depth),h.depth&&(_.style.verticalAlign=tt(-h.depth))}return h}function KP(e){return new qh(e)}class Ye{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=Eu(this.classes));for(var r=0;r0&&(n+=' class ="'+Xs(Eu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class us{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Xs(this.toText())}toText(){return this.text}}class WP{constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",tt(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var kTn=new Set(["\\imath","\\jmath"]),STn=new Set(["mrow","mtable"]),$a=function(n,t,r){return Er[t][n]&&Er[t][n].replace&&n.charCodeAt(0)!==55349&&!(PP.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Er[t][n].replace),new us(n)},W6=function(n){return n.length===1?n[0]:new Ye("mrow",n)},CTn={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"},Q6=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=CTn[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(kTn.has(i))return null;if(Er[r][i]){var a=Er[r][i].replace;a&&(i=a)}var o=z5[t].fontName;return G6(i,o,r)?z5[t].variant:null};function Hw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof us&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof us&&t.text===","}else return!1}var ua=function(n,t,r){if(n.length===1){var s=_r(n[0],t);return r&&s instanceof Ye&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||Hw(a))){var u=c.children[0];u instanceof Ye&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof us&&h.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var _=c.children[0];_ instanceof us&&_.text.length>0&&(_.text=_.text.slice(0,1)+"̸"+_.text.slice(1),i.pop())}}}i.push(c),a=c}return i},ju=function(n,t,r){return W6(ua(n,t,r))},_r=function(n,t){if(!n)return new Ye("mrow");if(tb[n.type])return tb[n.type](n,t);throw new Xe("Got group of unknown type: '"+n.type+"'")};function EA(e,n,t,r,s){var i=ua(e,t),a;i.length===1&&i[0]instanceof Ye&&STn.has(i[0].type)?a=i[0]:a=new Ye("mrow",i);var o=new Ye("annotation",[new us(n)]);o.setAttribute("encoding","application/x-tex");var c=new Ye("semantics",[a,o]),u=new Ye("math",[c]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var h=s?"katex":"katex-mathml";return Ve([h],[u])}var ETn=[[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]],NA=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],zA=function(n,t){return t.size<2?n:ETn[n-1][t.size-1]};class Kc{constructor(n){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=n.style,this.color=n.color,this.size=n.size||Kc.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=NA[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={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(t,n),new Kc(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:zA(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:NA[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=zA(Kc.BASESIZE,n);return this.size===t&&this.textSize===Kc.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Kc.BASESIZE?["sizing","reset-size"+this.size,"size"+Kc.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=lTn(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Kc.BASESIZE=6;var QP=function(n){return new Kc({style:n.displayMode?Yt.DISPLAY:Yt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},XP=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ve(r,[n])}return n},NTn=function(n,t,r){var s=QP(r),i;if(r.output==="mathml")return EA(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=R5(n,s);i=Ve(["katex"],[a])}else{var o=EA(n,t,s,r.displayMode,!1),c=R5(n,s);i=Ve(["katex"],[o,c])}return XP(i,r)},zTn=function(n,t,r){var s=QP(r),i=R5(n,s),a=Ve(["katex"],[i]);return XP(a,r)},jTn={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":"="},by=function(n){var t=new Ye("mo",[new us(jTn[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},TTn={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]},ATn=new Set(["widehat","widecheck","widetilde","utilde"]),yy=function(n,t){function r(){var o=4e5,c=n.label.slice(1);if(ATn.has(c)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,h,_,p;if(u>5)c==="widehat"||c==="widecheck"?(h=420,o=2364,p=.42,_=c+"4"):(h=312,o=2340,p=.34,_="tilde4");else{var m=[1,1,2,2,3,3][u];c==="widehat"||c==="widecheck"?(o=[0,1062,2364,2364,2364][m],h=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],_=c+m):(o=[0,600,1033,2339,2340][m],h=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],_="tilde"+m)}var x=new Nu(_),k=new _l([x],{width:"100%",height:tt(p),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:zu([],[k],t),minWidth:0,height:p}}else{var v=[],b=TTn[c];if(!b)throw new Error('No SVG data for "'+c+'".');var[w,y,C]=b,N=C/1e3,z=w.length,T,j;if(z===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+c+'".');T=["hide-tail"],j=[b[3]]}else if(z===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(z===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+z+" children.");for(var M=0;M0&&(s.style.minWidth=tt(i)),s},RTn=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ve(["stretchy",t],[],i),t==="fbox"){var c=i.color&&i.getColor();c&&(a.style.borderColor=c)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new w5({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new w5({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new _l(u,{width:"100%",height:tt(o)});a=zu([],[h],i)}return a.height=o,a.style.height=tt(o),a},MTn={bin:1,close:1,inner:1,open:1,punct:1,rel:1},OTn={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function DTn(e){return e in MTn}function sn(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function xy(e){var n=wy(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function wy(e){return e&&(e.type==="atom"||OTn.hasOwnProperty(e.type))?e:null}var YP=e=>{if(e instanceof ia)return e;if(oTn(e)&&e.children.length===1)return YP(e.children[0])},X6=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=sn(e.base,"accent"),t=r.base,e.base=t,s=aTn(Fn(e,n)),e.base=r):(r=sn(e,"accent"),t=r.base);var i=Fn(t,n.havingCrampedStyle()),a=r.isShifty&&hl(t),o=0;if(a){var c,u;o=(c=(u=YP(i))==null?void 0:u.skew)!=null?c:0}var h=r.label==="\\c",_=h?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=yy(r,n),p=Bn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+tt(2*o)+")",marginLeft:tt(2*o)}:void 0}]});else{var m,x;r.label==="\\vec"?(m=UP("vec",n),x=qP.vec[1]):(m=vy({mode:r.mode,text:r.label},n,"textord"),m=iTn(m),m.italic=0,x=m.width,h&&(_+=m.depth)),p=Ve(["accent-body"],[m]);var k=r.label==="\\textcircled";k&&(p.classes.push("accent-full"),_=i.height);var v=o;k||(v-=x/2),p.style.left=tt(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=Bn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-_},{type:"elem",elem:p}]})}var b=Ve(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},ZP=(e,n)=>{var t=e.isStretchy?by(e.label):new Ye("mo",[$a(e.label,e.mode)]),r=new Ye("mover",[_r(e.base,n),t]);return r.setAttribute("accent","true"),r},LTn=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));lt({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,n)=>{var t=nb(n[0]),r=!LTn.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:X6,mathmlBuilder:ZP});lt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[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:t}},htmlBuilder:X6,mathmlBuilder:ZP});lt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Fn(e.base,n),r=yy(e,n),s=e.label==="\\utilde"?.12:0,i=Bn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ve(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=by(e.label),r=new Ye("munder",[_r(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var S1=e=>{var n=new Ye("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};lt({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,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Ch(Fn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Ch(Fn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=yy(e,n),c=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var h;if(a){var _=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;h=Bn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:_}]})}else h=Bn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:c,wrapperClasses:["svg-align"]}]});return Ve(["mrel","x-arrow"],[h],n)},mathmlBuilder(e,n){var t=by(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=S1(_r(e.body,n));if(e.below){var i=S1(_r(e.below,n));r=new Ye("munderover",[t,i,s])}else r=new Ye("mover",[t,s])}else if(e.below){var a=S1(_r(e.below,n));r=new Ye("munder",[t,a])}else r=S1(),r=new Ye("mover",[t,r]);return r}});function JP(e,n){var t=ys(e.body,n,!0);return Ve([e.mclass],t,n)}function eF(e,n){var t,r=ua(e.body,n);return e.mclass==="minner"?t=new Ye("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Ye("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Ye("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}lt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:ls(s),isCharacterBox:hl(s)}},htmlBuilder:JP,mathmlBuilder:eF});var ky=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};lt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:ky(n[0]),body:ls(n[1]),isCharacterBox:hl(n[1])}}});lt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=ky(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ls(s)},c={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[c],isCharacterBox:hl(c)}},htmlBuilder:JP,mathmlBuilder:eF});lt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:ky(n[0]),body:ls(n[0])}},htmlBuilder(e,n){var t=ys(e.body,n,!0),r=Ve([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ua(e.body,n),r=new Ye("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var ITn={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},jA=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),TA=e=>e.type==="textord"&&e.text==="@",$Tn=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function BTn(e,n,t){var r=ITn[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),c={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function PTn(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Xe("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var _=0;_<2;_++){for(var p=!0,m=c+1;mAV=|." after @',a[c]);var x=BTn(u,h,e),k={type:"styling",body:[x],mode:"math",style:"display",resetFont:!0};r.push(k),o=jA()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}lt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Ch(Fn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=tt(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Ye("mrow",[_r(e.label,n)]);return t=new Ye("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Ye("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});lt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Ch(Fn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Ye("mrow",[_r(e.fragment,n)])}});lt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=sn(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Xe("\\@char with invalid code point "+i);return c<=65535?u=String.fromCharCode(c):(c-=65536,u=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var tF=(e,n)=>{var t=ys(e.body,n.withColor(e.color),!1);return ml(t)},nF=(e,n)=>{var t=ua(e.body,n.withColor(e.color)),r=new Ye("mstyle",t);return r.setAttribute("mathcolor",e.color),r};lt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=sn(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:ls(s)}},htmlBuilder:tF,mathmlBuilder:nF});lt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=sn(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:tF,mathmlBuilder:nF});lt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&sn(s,"size").value}},htmlBuilder(e,n){var t=Ve(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=tt(Dr(e.size,n)))),t},mathmlBuilder(e,n){var t=new Ye("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",tt(Dr(e.size,n)))),t}});var M5={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},rF=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Xe("Expected a control sequence",e);return n},FTn=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},sF=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};lt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(M5[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=M5[r.text]),sn(n.parseFunction(),"internal");throw new Xe("Invalid token after macro prefix",r)}});lt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Xe("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Xe('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Xe('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Xe("Expected a macro definition");o[i].push(r.text)}var{tokens:c}=n.gullet.consumeArg();return a&&c.unshift(a),(t==="\\edef"||t==="\\xdef")&&(c=n.gullet.expandTokens(c),c.reverse()),n.gullet.macros.set(s,{tokens:c,numArgs:i,delimiters:o},t===M5[t]),{type:"internal",mode:n.mode}}});lt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=rF(n.gullet.popToken());n.gullet.consumeSpaces();var s=FTn(n);return sF(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});lt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=rF(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return sF(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var i0=function(n,t,r){var s=Er.math[n]&&Er.math[n].replace,i=G6(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},Y6=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ve(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},iF=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=tt(i),n.height-=i,n.depth+=i},HTn=function(n,t,r,s,i,a){var o=ui(n,"Main-Regular",i,s),c=Y6(o,t,s,a);return iF(c,s,t),c},qTn=function(n,t,r,s){return ui(n,"Size"+t+"-Regular",r,s)},aF=function(n,t,r,s,i,a){var o=qTn(n,t,i,s),c=Y6(Ve(["delimsizing","size"+t],[o],s),Yt.TEXT,s,a);return r&&iF(c,s,Yt.TEXT),c},qw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ve(["delimsizinginner",s],[Ve([],[ui(n,t,r)])]);return{type:"elem",elem:i}},Uw=function(n,t,r){var s=Go["Size4-Regular"][n.charCodeAt(0)]?Go["Size4-Regular"][n.charCodeAt(0)][4]:Go["Size1-Regular"][n.charCodeAt(0)][4],i=new Nu("inner",Zjn(n,Math.round(1e3*t))),a=new _l([i],{width:tt(s),height:tt(t),style:"width:"+tt(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=zu([],[a],r);return o.height=t,o.style.height=tt(t),o.style.width=tt(s),{type:"elem",elem:o}},O5=.008,C1={type:"kern",size:-1*O5},UTn=new Set(["|","\\lvert","\\rvert","\\vert"]),GTn=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),oF=function(n,t,r,s,i,a){var o,c,u,h,_="",p=0;o=u=h=n,c=null;var m="Size1-Regular";n==="\\uparrow"?u=h="⏐":n==="\\Uparrow"?u=h="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):UTn.has(n)?(u="∣",_="vert",p=333):GTn.has(n)?(u="∥",_="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",h="⎣",m="Size4-Regular",_="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",h="⎦",m="Size4-Regular",_="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",h="⎣",m="Size4-Regular",_="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=h="⎢",m="Size4-Regular",_="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",h="⎦",m="Size4-Regular",_="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=h="⎥",m="Size4-Regular",_="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",h="⎝",m="Size4-Regular",_="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",h="⎠",m="Size4-Regular",_="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",c="⎨",h="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",c="⎬",h="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",h="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",h="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",h="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",h="⎩",u="⎪",m="Size4-Regular");var x=i0(o,m,i),k=x.height+x.depth,v=i0(u,m,i),b=v.height+v.depth,w=i0(h,m,i),y=w.height+w.depth,C=0,N=1;if(c!==null){var z=i0(c,m,i);C=z.height+z.depth,N=2}var T=k+y+C,j=Math.max(0,Math.ceil((t-T)/(N*b))),M=T+j*N*b,D=s.fontMetrics().axisHeight;r&&(D*=s.sizeMultiplier);var I=M/2-D,$=[];if(_.length>0){var q=M-k-y,H=Math.round(M*1e3),Q=Jjn(_,Math.round(q*1e3)),V=new Nu(_,Q),J=tt(p/1e3),Z=tt(H/1e3),B=new _l([V],{width:J,height:Z,viewBox:"0 0 "+p+" "+H}),L=zu([],[B],s);L.height=H/1e3,L.style.width=J,L.style.height=Z,$.push({type:"elem",elem:L})}else{if($.push(qw(h,m,i)),$.push(C1),c===null){var F=M-k-y+2*O5;$.push(Uw(u,F,s))}else{var U=(M-k-y-C)/2+2*O5;$.push(Uw(u,U,s)),$.push(C1),$.push(qw(c,m,i)),$.push(C1),$.push(Uw(u,U,s))}$.push(C1),$.push(qw(o,m,i))}var K=s.havingBaseStyle(Yt.TEXT),ne=Bn({positionType:"bottom",positionData:I,children:$});return Y6(Ve(["delimsizing","mult"],[ne],K),Yt.TEXT,s,a)},Gw=80,Vw=.08,Kw=function(n,t,r,s,i){var a=Yjn(n,s,r),o=new Nu(n,a),c=new _l([o],{width:"400em",height:tt(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return zu(["hide-tail"],[c],i)},VTn=function(n,t){var r=t.havingBaseSizing(),s=fF("\\surd",n*r.sizeMultiplier,_F,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,c,u,h,_;return s.type==="small"?(h=1e3+1e3*a+Gw,n<1?i=1:n<1.4&&(i=.7),c=(1+a+Vw)/i,u=(1+a)/i,o=Kw("sqrtMain",c,h,a,t),o.style.minWidth="0.853em",_=.833/i):s.type==="large"?(h=(1e3+Gw)*b0[s.size],u=(b0[s.size]+a)/i,c=(b0[s.size]+a+Vw)/i,o=Kw("sqrtSize"+s.size,c,h,a,t),o.style.minWidth="1.02em",_=1/i):(c=n+a+Vw,u=n+a,h=Math.floor(1e3*n+a)+Gw,o=Kw("sqrtTall",c,h,a,t),o.style.minWidth="0.742em",_=1.056),o.height=u,o.style.height=tt(c),{span:o,advanceWidth:_,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},cF=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),KTn=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),lF=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),b0=[0,1.2,1.8,2.4,3],uF=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),cF.has(n)||lF.has(n))return aF(n,t,!1,r,s,i);if(KTn.has(n))return oF(n,b0[t],!1,r,s,i);throw new Xe("Illegal delimiter: '"+n+"'")},WTn=[{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}],QTn=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"stack"}],_F=[{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"}],XTn=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},fF=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},D5=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;lF.has(n)?o=WTn:cF.has(n)?o=_F:o=QTn;var c=fF(n,t,o,s);return c.type==="small"?HTn(n,c.style,r,s,i,a):c.type==="large"?aF(n,c.size,r,s,i,a):oF(n,t,r,s,i,a)},Ww=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,u=5/s.fontMetrics().ptPerEm,h=Math.max(t-o,r+o),_=Math.max(h/500*c,2*h-u);return D5(n,_,!0,s,i,a)},AA={"\\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}},YTn=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 RA(e){return"isMiddle"in e}function Sy(e,n){var t=wy(e);if(t&&YTn.has(t.text))return t;throw t?new Xe("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Xe("Invalid delimiter type '"+e.type+"'",e)}lt({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,n)=>{var t=Sy(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:AA[e.funcName].size,mclass:AA[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ve([e.mclass]):uF(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push($a(e.delim,e.mode));var t=new Ye("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=tt(b0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function MA(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}lt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Xe("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Sy(n[0],e).text,color:t}}});lt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Sy(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=sn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{MA(e);for(var t=ys(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{MA(e);var t=ua(e.body,n);if(e.left!=="."){var r=new Ye("mo",[$a(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Ye("mo",[$a(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return W6(t)}});lt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Sy(n[0],e);if(!e.parser.leftrightDepth)throw new Xe("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=U0(n,[]):(t=uF(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?$a("|","text"):$a(e.delim,e.mode),r=new Ye("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Cy=(e,n)=>{var t=Ch(Fn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=hl(e.body);if(r==="sout")i=Ve(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var c=Dr({number:.6,unit:"pt"},n),u=Dr({number:.35,unit:"ex"},n),h=n.havingBaseSizing();s=s/h.sizeMultiplier;var _=t.height+t.depth+c+u;t.style.paddingLeft=tt(_/2+c);var p=Math.floor(1e3*_*s),m=Qjn(p),x=new _l([new Nu("phase",m)],{width:"400em",height:tt(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=zu(["hide-tail"],[x],n),i.style.height=tt(_),a=t.depth+c+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var k,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),k=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=k):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),k=4*b,v=Math.max(0,.25-t.depth)):(k=o?.2:0,v=k),i=RTn(t,r,k,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=tt(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=tt(b),i.style.borderRightWidth=tt(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=Bn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=Bn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!o?Ve(["mord","cancel-lap"],[w],n):Ve(["mord"],[w],n)},Ey=(e,n)=>{var t,r=new Ye(e.label.includes("colorbox")?"mpadded":"menclose",[_r(e.body,n)]);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(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+tt(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};lt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Cy,mathmlBuilder:Ey});lt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=sn(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Cy,mathmlBuilder:Ey});lt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});lt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Cy,mathmlBuilder:Ey});lt({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Cy,mathmlBuilder:Ey});lt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var dF={};function ic(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},c=0;c{var n=e.parser.settings;if(!n.displayMode)throw new Xe("{"+e.envName+"} can be used only in display mode.")},ZTn=new Set(["gather","gather*"]);function Z6(e){if(!e.includes("ed"))return!e.includes("*")}function Iu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:c,singleRow:u,emptySingleRow:h,maxNumCols:_,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Xe("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var x=[],k=[x],v=[],b=[],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 na("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!c&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(OA(e));;){var N=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var z={type:"ordgroup",mode:e.mode,body:N};t&&(z={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[z]}),x.push(z);var T=e.fetch().text;if(T==="&"){if(_&&x.length===_){if(u||o)throw new Xe("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),x.length===1&&z.type==="styling"&&z.body.length===1&&z.body[0].type==="ordgroup"&&z.body[0].body.length===0&&(k.length>1||!h)&&k.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:Pe[nt]})}for(C(a[0]),r=0;r0&&(I+=w,TPe))for(r=0;r=o)){var oe=void 0;if(s>0||n.hskipBeforeAndAfter){var le,pe;oe=(le=(pe=K)==null?void 0:pe.pregap)!=null?le:p,oe!==0&&(Q=Ve(["arraycolsep"],[]),Q.style.width=tt(oe),H.push(Q))}var be=[];for(r=0;r0){for(var St=Sh("hline",t,h),Ft=Sh("hdashline",t,h),ut=[{type:"elem",elem:at,shift:0}];u.length>0;){var dt=u.pop(),Ie=dt.pos-$;dt.isDashed?ut.push({type:"elem",elem:Ft,shift:Ie}):ut.push({type:"elem",elem:St,shift:Ie})}at=Bn({positionType:"individualShift",children:ut})}if(J.length===0)return Ve(["mord"],[at],t);var me=Bn({positionType:"individualShift",children:J}),Ae=Ve(["tag"],[me],t);return ml([at,Ae])},JTn={c:"center ",l:"left ",r:"right "},oc=function(n,t){for(var r=[],s=new Ye("mtd",[],["mtr-glue"]),i=new Ye("mtd",[],["mml-eqn-num"]),a=0;a0){var x=n.cols,k="",v=!1,b=0,w=x.length;x[0].type==="separator"&&(p+="top ",b=1),x[x.length-1].type==="separator"&&(p+="bottom ",w-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var D=1;D0&&m&&(v=1),r[x]={type:"align",align:k,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};ic({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=wy(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(a){var o=xy(a),c=o.text;if("lcr".includes(c))return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new Xe("Unknown column alignment: "+c,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Iu(e.parser,i,J6(e.envName))},htmlBuilder:ac,mathmlBuilder:oc});ic({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Xe("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Iu(e.parser,r,J6(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:ac,mathmlBuilder:oc});ic({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Iu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:ac,mathmlBuilder:oc});ic({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=wy(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(o){var c=xy(o),u=c.text;if("lc".includes(u))return{type:"align",align:u};throw new Xe("Unknown column alignment: "+u,o)});if(s.length>1)throw new Xe("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Iu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Xe("{subarray} can contain only one column");return a},htmlBuilder:ac,mathmlBuilder:oc});ic({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Iu(e.parser,n,J6(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:ac,mathmlBuilder:oc});ic({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:pF,htmlBuilder:ac,mathmlBuilder:oc});ic({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){ZTn.has(e.envName)&&Ny(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Z6(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Iu(e.parser,n,"display")},htmlBuilder:ac,mathmlBuilder:oc});ic({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:pF,htmlBuilder:ac,mathmlBuilder:oc});ic({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Ny(e);var n={autoTag:Z6(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Iu(e.parser,n,"display")},htmlBuilder:ac,mathmlBuilder:oc});ic({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Ny(e),PTn(e.parser)},htmlBuilder:ac,mathmlBuilder:oc});ie("\\nonumber","\\gdef\\@eqnsw{0}");ie("\\notag","\\nonumber");lt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Xe(e.funcName+" valid only within array environment")}});var DA=dF;lt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Xe("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Fn(e.body,r)},gF=(e,n)=>{var t=e.font,r=n.withFont(t);return _r(e.body,r)},LA={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};lt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=nb(n[0]),i=r;return i in LA&&(i=LA[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:mF,mathmlBuilder:gF});lt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:ky(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:hl(r)}}});lt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:mF,mathmlBuilder:gF});var eAn=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Fn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,c=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?x=3*p:x=7*p,k=n.fontMetrics().denom1):(_>0?(m=n.fontMetrics().num2,x=p):(m=n.fontMetrics().num3,x=3*p),k=n.fontMetrics().denom2);var v;if(h){var w=n.fontMetrics().axisHeight;m-a.depth-(w+.5*_){var t=new Ye("mfrac",[_r(e.numer,n),_r(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Dr(e.barSize,n);t.setAttribute("linethickness",tt(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Ye("mo",[new us(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Ye("mo",[new us(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return W6(s)}return t},vF=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};lt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,c=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",c=")";break;case"\\\\bracefrac":a=!1,o="\\{",c="\\}";break;case"\\\\brackfrac":a=!1,o="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",h=null;return u||r.startsWith("\\d")?h="display":r.startsWith("\\t")&&(h="text"),vF({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:c,barSize:null},h)},htmlBuilder:eAn,mathmlBuilder:tAn});lt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var IA=["display","text","script","scriptscript"],$A=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};lt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=nb(n[0]),a=i.type==="atom"&&i.family==="open"?$A(i.text):null,o=nb(n[1]),c=o.type==="atom"&&o.family==="close"?$A(o.text):null,u=sn(n[2],"size"),h,_=null;u.isBlank?h=!0:(_=u.value,h=_.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var x=sn(m.body[0],"textord");p=IA[Number(x.text)]}}else m=sn(m,"textord"),p=IA[Number(m.text)];return vF({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:h,barSize:_,leftDelim:a,rightDelim:c},p)}});lt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:sn(n[0],"size").value,token:s}}});lt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=sn(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var bF=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Fn(e.sup,n.havingStyle(t.sup()),n):Fn(e.sub,n.havingStyle(t.sub()),n),s=sn(e.base,"horizBrace")):s=sn(e,"horizBrace");var i=Fn(s.base,n.havingBaseStyle(Yt.DISPLAY)),a=yy(s,n),o;if(s.isOver?o=Bn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=Bn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var c=Ve(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=Bn({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=Bn({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]})}return Ve(["minner",s.isOver?"mover":"munder"],[o],n)},nAn=(e,n)=>{var t=by(e.label);return new Ye(e.isOver?"mover":"munder",[_r(e.base,n),t])};lt({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:bF,mathmlBuilder:nAn});lt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=sn(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:ls(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=ys(e.body,n,!1);return pTn(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=ju(e.body,n);return t instanceof Ye||(t=new Ye("mrow",[t])),t.setAttribute("href",e.href),t}});lt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=sn(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=sn(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,c={};switch(r){case"\\htmlClass":c.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),h=0;h{var t=ys(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ve(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>ju(e.body,n)});lt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:ls(n[0]),mathml:ls(n[1])}},htmlBuilder:(e,n)=>{var t=ys(e.html,n,!1);return ml(t)},mathmlBuilder:(e,n)=>ju(e.mathml,n)});var Qw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Xe("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!LP(r))throw new Xe("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};lt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var c=sn(t[0],"raw").string,u=c.split(","),h=0;h{var t=Dr(e.height,n),r=0;e.totalheight.number>0&&(r=Dr(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Dr(e.width,n));var i={height:tt(t+r)};s>0&&(i.width=tt(s)),r>0&&(i.verticalAlign=tt(-r));var a=new rTn(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Ye("mglyph",[]);t.setAttribute("alt",e.alt);var r=Dr(e.height,n),s=0;if(e.totalheight.number>0&&(s=Dr(e.totalheight,n)-r,t.setAttribute("valign",tt(-s))),t.setAttribute("height",tt(r+s)),e.width.number>0){var i=Dr(e.width,n);t.setAttribute("width",tt(i))}return t.setAttribute("src",e.src),t}});lt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=sn(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return HP(e.dimension,n)},mathmlBuilder(e,n){var t=Dr(e.dimension,n);return new WP(t)}});lt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ve([],[Fn(e.body,n)]),t=Ve(["inner"],[t],n)):t=Ve(["inner"],[Fn(e.body,n)]);var r=Ve(["fix"],[]),s=Ve([e.alignment],[t,r],n),i=Ve(["strut"]);return i.style.height=tt(s.height+s.depth),s.depth&&(i.style.verticalAlign=tt(-s.depth)),s.children.unshift(i),s=Ve(["thinbox"],[s],n),Ve(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Ye("mpadded",[_r(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});lt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});lt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Xe("Mismatched "+e.funcName)}});var BA=(e,n)=>{switch(n.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}};lt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:ls(n[0]),text:ls(n[1]),script:ls(n[2]),scriptscript:ls(n[3])}},htmlBuilder:(e,n)=>{var t=BA(e,n),r=ys(t,n,!1);return ml(r)},mathmlBuilder:(e,n)=>{var t=BA(e,n);return ju(t,n)}});var yF=(e,n,t,r,s,i,a)=>{e=Ve([],[e]);var o=t&&hl(t),c,u;if(n){var h=Fn(n,r.havingStyle(s.sup()),r);u={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(t){var _=Fn(t,r.havingStyle(s.sub()),r);c={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-_.height)}}var p;if(u&&c){var m=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+a;p=Bn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:tt(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:tt(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(c){var x=e.height-a;p=Bn({positionType:"top",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:tt(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e}]})}else if(u){var k=e.depth+a;p=Bn({positionType:"bottom",positionData:k,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:tt(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(c&&i!==0&&!o){var b=Ve(["mspace"],[],r);b.style.marginRight=tt(i),v.unshift(b)}return Ve(["mop","op-limits"],v,r)},xF=new Set(["\\smallint"]),Vh=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"op"),s=!0):i=sn(e,"op");var a=n.style,o=!1;a.size===Yt.DISPLAY.size&&i.symbol&&!xF.has(i.name)&&(o=!0);var c,u;if(i.symbol){var h=o?"Size2-Regular":"Size1-Regular",_="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(_=i.name.slice(1),i.name=_==="oiint"?"\\iint":"\\iiint"),c=ui(i.name,h,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=c.italic,_.length>0){var p=UP(_+"Size"+(o?"2":"1"),n);c=Bn({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+_,c.classes.unshift("mop"),c.italic=u}}else if(i.body){var m=ys(i.body,n,!0);m.length===1&&m[0]instanceof ia?(c=m[0],c.classes[0]="mop"):c=Ve(["mop"],m,n)}else{for(var x=[],k=1;k{var t;if(e.symbol)t=new Ye("mo",[$a(e.name,e.mode)]),xF.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Ye("mo",ua(e.body,n));else{t=new Ye("mi",[new us(e.name.slice(1))]);var r=new Ye("mo",[$a("⁡","text")]);e.parentIsSupSub?t=new Ye("mrow",[t,r]):t=KP([t,r])}return t},rAn={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};lt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=rAn[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Vh,mathmlBuilder:Im});lt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ls(r)}},htmlBuilder:Vh,mathmlBuilder:Im});var sAn={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};lt({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:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Vh,mathmlBuilder:Im});lt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Vh,mathmlBuilder:Im});lt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=sAn[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Vh,mathmlBuilder:Im});var wF=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"operatorname"),s=!0):i=sn(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(_=>{var p="text"in _?_.text:void 0;return typeof p=="string"?{type:"textord",mode:_.mode,text:p}:_}),c=ys(o,n.withFont("mathrm"),!0),u=0;u{for(var t=ua(e.body,n.withFont("mathrm")),r=!0,s=0;sh.toText()).join("");t=[new us(o)]}var c=new Ye("mi",t);c.setAttribute("mathvariant","normal");var u=new Ye("mo",[$a("⁡","text")]);return e.parentIsSupSub?new Ye("mrow",[c,u]):KP([c,u])};lt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:ls(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:wF,mathmlBuilder:iAn});ie("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Cf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?ml(ys(e.body,n,!1)):Ve(["mord"],ys(e.body,n,!0),n)},mathmlBuilder(e,n){return ju(e.body,n,!0)}});lt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Fn(e.body,n.havingCrampedStyle()),r=Sh("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=Bn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ve(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Ye("mo",[new us("‾")]);t.setAttribute("stretchy","true");var r=new Ye("mover",[_r(e.body,n),t]);return r.setAttribute("accent","true"),r}});lt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:ls(r)}},htmlBuilder:(e,n)=>{var t=ys(e.body,n.withPhantom(),!1);return ml(t)},mathmlBuilder:(e,n)=>{var t=ua(e.body,n);return new Ye("mphantom",t)}});ie("\\hphantom","\\smash{\\phantom{#1}}");lt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ve(["inner"],[Fn(e.body,n.withPhantom())]),r=Ve(["fix"],[]);return Ve(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ua(ls(e.body),n),r=new Ye("mphantom",t),s=new Ye("mpadded",[r]);return s.setAttribute("width","0px"),s}});lt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=sn(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Fn(e.body,n),r=Dr(e.dy,n);return Bn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ye("mpadded",[_r(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});lt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});lt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=sn(n[0],"size"),a=sn(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&sn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ve(["mord","rule"],[],n),r=Dr(e.width,n),s=Dr(e.height,n),i=e.shift?Dr(e.shift,n):0;return t.style.borderRightWidth=tt(r),t.style.borderTopWidth=tt(s),t.style.bottom=tt(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Dr(e.width,n),r=Dr(e.height,n),s=e.shift?Dr(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Ye("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",tt(t)),a.setAttribute("height",tt(r));var o=new Ye("mpadded",[a]);return s>=0?o.setAttribute("height",tt(s)):(o.setAttribute("height",tt(s)),o.setAttribute("depth",tt(-s))),o.setAttribute("voffset",tt(s)),o}});function kF(e,n,t){for(var r=ys(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return kF(e.body,t,n)};lt({type:"sizing",names:PA,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:PA.indexOf(r)+1,body:i}},htmlBuilder:aAn,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ua(e.body,t),s=new Ye("mstyle",r);return s.setAttribute("mathsize",tt(t.sizeMultiplier)),s}});lt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&sn(t[0],"ordgroup");if(a)for(var o,c=0;c{var t=Ve([],[Fn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ve(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Ye("mpadded",[_r(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});lt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Fn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Ch(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+_-t.height-t.depth)/2);var p=c.height-t.height-a-u;t.style.paddingLeft=tt(h);var m=Bn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:c},{type:"kern",size:u}]});if(e.index){var x=n.havingStyle(Yt.SCRIPTSCRIPT),k=Fn(e.index,x,n),v=.6*(m.height-m.depth),b=Bn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:k}]}),w=Ve(["root"],[b]);return Ve(["mord","sqrt"],[w,m],n)}else return Ve(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Ye("mroot",[_r(t,n),_r(r,n)]):new Ye("msqrt",[_r(t,n)])}});var L5={display:Yt.DISPLAY,text:Yt.TEXT,script:Yt.SCRIPT,scriptscript:Yt.SCRIPTSCRIPT};function oAn(e){return e in L5}lt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!oAn(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=L5[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),kF(e.body,r,n)},mathmlBuilder(e,n){var t=L5[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ua(e.body,r),i=new Ye("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var cAn=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Yt.DISPLAY.size||r.alwaysHandleSupSub);return s?Vh:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Yt.DISPLAY.size||r.limits);return i?wF:null}else{if(r.type==="accent")return hl(r.base)?X6:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?bF:null}else return null}else return null};Cf({type:"supsub",htmlBuilder(e,n){var t=cAn(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Fn(r,n),o,c,u=n.fontMetrics(),h=0,_=0,p=r&&hl(r);if(s){var m=n.havingStyle(n.style.sup());o=Fn(s,m,n),p||(h=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var x=n.havingStyle(n.style.sub());c=Fn(i,x,n),p||(_=a.depth+x.fontMetrics().subDrop*x.sizeMultiplier/n.sizeMultiplier)}var k;n.style===Yt.DISPLAY?k=u.sup1:n.style.cramped?k=u.sup3:k=u.sup2;var v=n.sizeMultiplier,b=tt(.5/u.ptPerEm/v),w=null;if(c){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof ia||y){var C;w=tt(-((C=a.italic)!=null?C:0))}}var N;if(o&&c){h=Math.max(h,k,o.depth+.25*u.xHeight),_=Math.max(_,u.sub2);var z=u.defaultRuleThickness,T=4*z;if(h-o.depth-(c.height-_)0&&(h+=j,_-=j)}var M=[{type:"elem",elem:c,shift:_,marginRight:b,marginLeft:w},{type:"elem",elem:o,shift:-h,marginRight:b}];N=Bn({positionType:"individualShift",children:M})}else if(c){_=Math.max(_,u.sub1,c.height-.8*u.xHeight);var D=[{type:"elem",elem:c,marginLeft:w,marginRight:b}];N=Bn({positionType:"shift",positionData:_,children:D})}else if(o)h=Math.max(h,k,o.depth+.25*u.xHeight),N=Bn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var I=A5(a,"right")||"mord";return Ve([I],[a,Ve(["msupsub"],[N])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[_r(e.base,n)];e.sub&&i.push(_r(e.sub,n)),e.sup&&i.push(_r(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===Yt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===Yt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var c=e.base;c&&c.type==="op"&&c.limits&&(n.style===Yt.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||n.style===Yt.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Yt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Yt.DISPLAY)?a="mover":a="msup"}return new Ye(a,i)}});Cf({type:"atom",htmlBuilder(e,n){return V6(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Ye("mo",[$a(e.text,e.mode)]);if(e.family==="bin"){var r=Q6(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var SF={mi:"italic",mn:"normal",mtext:"normal"};Cf({type:"mathord",htmlBuilder(e,n){return vy(e,n,"mathord")},mathmlBuilder(e,n){var t=new Ye("mi",[$a(e.text,e.mode,n)]),r=Q6(e,n)||"italic";return r!==SF[t.type]&&t.setAttribute("mathvariant",r),t}});Cf({type:"textord",htmlBuilder(e,n){return vy(e,n,"textord")},mathmlBuilder(e,n){var t=$a(e.text,e.mode,n),r=Q6(e,n)||"normal",s;return e.mode==="text"?s=new Ye("mtext",[t]):/[0-9]/.test(e.text)?s=new Ye("mn",[t]):e.text==="\\prime"?s=new Ye("mo",[t]):s=new Ye("mi",[t]),r!==SF[s.type]&&s.setAttribute("mathvariant",r),s}});var Xw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Yw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Cf({type:"spacing",htmlBuilder(e,n){if(Yw.hasOwnProperty(e.text)){var t=Yw[e.text].className||"";if(e.mode==="text"){var r=vy(e,n,"textord");return r.classes.push(t),r}else return Ve(["mspace",t],[V6(e.text,e.mode,n)],n)}else{if(Xw.hasOwnProperty(e.text))return Ve(["mspace",Xw[e.text]],[],n);throw new Xe('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(Yw.hasOwnProperty(e.text))t=new Ye("mtext",[new us(" ")]);else{if(Xw.hasOwnProperty(e.text))return new Ye("mspace");throw new Xe('Unknown type of space "'+e.text+'"')}return t}});var FA=()=>{var e=new Ye("mtd",[]);return e.setAttribute("width","50%"),e};Cf({type:"tag",mathmlBuilder(e,n){var t=new Ye("mtable",[new Ye("mtr",[FA(),new Ye("mtd",[ju(e.body,n)]),FA(),new Ye("mtd",[ju(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var HA={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},qA={"\\textbf":"textbf","\\textmd":"textmd"},lAn={"\\textit":"textit","\\textup":"textup"},UA=(e,n)=>{var t=e.font;if(t){if(HA[t])return n.withTextFontFamily(HA[t]);if(qA[t])return n.withTextFontWeight(qA[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(lAn[t])};lt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:ls(s),font:r}},htmlBuilder(e,n){var t=UA(e,n),r=ys(e.body,t,!0);return Ve(["mord","text"],r,t)},mathmlBuilder(e,n){var t=UA(e,n);return ju(e.body,t)}});lt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Fn(e.body,n),r=Sh("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=Bn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ve(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Ye("mo",[new us("‾")]);t.setAttribute("stretchy","true");var r=new Ye("munder",[_r(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});lt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Fn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return Bn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ye("mpadded",[_r(e.body,n)],["vcenter"]);return new Ye("mrow",[t])}});lt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Xe("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=GA(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),gu=GP,CF=`[ \r - ]`,uAn="\\\\[a-zA-Z@]+",_An="\\\\[^\uD800-\uDFFF]",fAn="("+uAn+")"+CF+"*",dAn=`\\\\( +-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 _An(e){return"toText"in e}class Uh{constructor(n){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=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(_An(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var k5={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},fAn={ex:!0,em:!0,mu:!0},BP=function(n){return typeof n!="string"&&(n=n.unit),n in k5||n in fAn||n==="ex"},Lr=function(n,t){var r;if(n.unit in k5)r=k5[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Xe("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},tt=function(n){return+n.toFixed(4)+"em"},Lu=function(n){return n.filter(t=>t).join(" ")},G6=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=PTn(r)+":"+s+";")}return t},PP=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},FP=function(n){var t=document.createElement(n);t.className=Lu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,HP=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Zs(Lu(this.classes))+'"');var r=G6(this.style);r&&(t+=' style="'+Zs(r)+'"');for(var s of Object.keys(this.attributes)){if(dAn.test(s))throw new Xe("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Zs(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class Gh{constructor(n,t,r,s){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,PP.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return FP.call(this,"span")}toMarkup(){return HP.call(this,"span")}}class vy{constructor(n,t,r,s){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,PP.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return FP.call(this,"a")}toMarkup(){return HP.call(this,"a")}}class hAn{constructor(n,t,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=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Zs(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=tt(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=Lu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+tt(this.italic)+";"),r+=G6(this.style),r&&(n=!0,t+=' style="'+Zs(r)+'"');var s=Zs(this.text);return n?(t+=">",t+=s,t+="",t):s}}class dl{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class S5{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var vAn=e=>e instanceof Gh||e instanceof vy||e instanceof Uh,Wo={"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]}},b1={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]},mA={Å:"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 bAn(e,n){Wo[e]=n}function V6(e,n,t){if(!Wo[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Wo[n][r];if(!s&&e[0]in mA&&(r=mA[e[0]].charCodeAt(0),s=Wo[n][r]),!s&&t==="text"&&$P(r)&&(s=Wo[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var Bw={};function yAn(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!Bw[n]){var t=Bw[n]={cssEmPerMu:b1.quad[n]/18};for(var r in b1)b1.hasOwnProperty(r)&&(t[r]=b1[r][n])}return Bw[n]}var Sr={math:{},text:{}};function P(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var W="math",Ge="text",ee="main",_e="ams",Er="accent-token",vt="bin",gi="close",Vh="inner",Ut="mathord",cs="op-token",ya="open",Im="punct",fe="rel",gl="spacing",ye="textord";P(W,ee,fe,"≡","\\equiv",!0);P(W,ee,fe,"≺","\\prec",!0);P(W,ee,fe,"≻","\\succ",!0);P(W,ee,fe,"∼","\\sim",!0);P(W,ee,fe,"⊥","\\perp");P(W,ee,fe,"⪯","\\preceq",!0);P(W,ee,fe,"⪰","\\succeq",!0);P(W,ee,fe,"≃","\\simeq",!0);P(W,ee,fe,"∣","\\mid",!0);P(W,ee,fe,"≪","\\ll",!0);P(W,ee,fe,"≫","\\gg",!0);P(W,ee,fe,"≍","\\asymp",!0);P(W,ee,fe,"∥","\\parallel");P(W,ee,fe,"⋈","\\bowtie",!0);P(W,ee,fe,"⌣","\\smile",!0);P(W,ee,fe,"⊑","\\sqsubseteq",!0);P(W,ee,fe,"⊒","\\sqsupseteq",!0);P(W,ee,fe,"≐","\\doteq",!0);P(W,ee,fe,"⌢","\\frown",!0);P(W,ee,fe,"∋","\\ni",!0);P(W,ee,fe,"∝","\\propto",!0);P(W,ee,fe,"⊢","\\vdash",!0);P(W,ee,fe,"⊣","\\dashv",!0);P(W,ee,fe,"∋","\\owns");P(W,ee,Im,".","\\ldotp");P(W,ee,Im,"⋅","\\cdotp");P(W,ee,Im,"⋅","·");P(Ge,ee,ye,"⋅","·");P(W,ee,ye,"#","\\#");P(Ge,ee,ye,"#","\\#");P(W,ee,ye,"&","\\&");P(Ge,ee,ye,"&","\\&");P(W,ee,ye,"ℵ","\\aleph",!0);P(W,ee,ye,"∀","\\forall",!0);P(W,ee,ye,"ℏ","\\hbar",!0);P(W,ee,ye,"∃","\\exists",!0);P(W,ee,ye,"∇","\\nabla",!0);P(W,ee,ye,"♭","\\flat",!0);P(W,ee,ye,"ℓ","\\ell",!0);P(W,ee,ye,"♮","\\natural",!0);P(W,ee,ye,"♣","\\clubsuit",!0);P(W,ee,ye,"℘","\\wp",!0);P(W,ee,ye,"♯","\\sharp",!0);P(W,ee,ye,"♢","\\diamondsuit",!0);P(W,ee,ye,"ℜ","\\Re",!0);P(W,ee,ye,"♡","\\heartsuit",!0);P(W,ee,ye,"ℑ","\\Im",!0);P(W,ee,ye,"♠","\\spadesuit",!0);P(W,ee,ye,"§","\\S",!0);P(Ge,ee,ye,"§","\\S");P(W,ee,ye,"¶","\\P",!0);P(Ge,ee,ye,"¶","\\P");P(W,ee,ye,"†","\\dag");P(Ge,ee,ye,"†","\\dag");P(Ge,ee,ye,"†","\\textdagger");P(W,ee,ye,"‡","\\ddag");P(Ge,ee,ye,"‡","\\ddag");P(Ge,ee,ye,"‡","\\textdaggerdbl");P(W,ee,gi,"⎱","\\rmoustache",!0);P(W,ee,ya,"⎰","\\lmoustache",!0);P(W,ee,gi,"⟯","\\rgroup",!0);P(W,ee,ya,"⟮","\\lgroup",!0);P(W,ee,vt,"∓","\\mp",!0);P(W,ee,vt,"⊖","\\ominus",!0);P(W,ee,vt,"⊎","\\uplus",!0);P(W,ee,vt,"⊓","\\sqcap",!0);P(W,ee,vt,"∗","\\ast");P(W,ee,vt,"⊔","\\sqcup",!0);P(W,ee,vt,"◯","\\bigcirc",!0);P(W,ee,vt,"∙","\\bullet",!0);P(W,ee,vt,"‡","\\ddagger");P(W,ee,vt,"≀","\\wr",!0);P(W,ee,vt,"⨿","\\amalg");P(W,ee,vt,"&","\\And");P(W,ee,fe,"⟵","\\longleftarrow",!0);P(W,ee,fe,"⇐","\\Leftarrow",!0);P(W,ee,fe,"⟸","\\Longleftarrow",!0);P(W,ee,fe,"⟶","\\longrightarrow",!0);P(W,ee,fe,"⇒","\\Rightarrow",!0);P(W,ee,fe,"⟹","\\Longrightarrow",!0);P(W,ee,fe,"↔","\\leftrightarrow",!0);P(W,ee,fe,"⟷","\\longleftrightarrow",!0);P(W,ee,fe,"⇔","\\Leftrightarrow",!0);P(W,ee,fe,"⟺","\\Longleftrightarrow",!0);P(W,ee,fe,"↦","\\mapsto",!0);P(W,ee,fe,"⟼","\\longmapsto",!0);P(W,ee,fe,"↗","\\nearrow",!0);P(W,ee,fe,"↩","\\hookleftarrow",!0);P(W,ee,fe,"↪","\\hookrightarrow",!0);P(W,ee,fe,"↘","\\searrow",!0);P(W,ee,fe,"↼","\\leftharpoonup",!0);P(W,ee,fe,"⇀","\\rightharpoonup",!0);P(W,ee,fe,"↙","\\swarrow",!0);P(W,ee,fe,"↽","\\leftharpoondown",!0);P(W,ee,fe,"⇁","\\rightharpoondown",!0);P(W,ee,fe,"↖","\\nwarrow",!0);P(W,ee,fe,"⇌","\\rightleftharpoons",!0);P(W,_e,fe,"≮","\\nless",!0);P(W,_e,fe,"","\\@nleqslant");P(W,_e,fe,"","\\@nleqq");P(W,_e,fe,"⪇","\\lneq",!0);P(W,_e,fe,"≨","\\lneqq",!0);P(W,_e,fe,"","\\@lvertneqq");P(W,_e,fe,"⋦","\\lnsim",!0);P(W,_e,fe,"⪉","\\lnapprox",!0);P(W,_e,fe,"⊀","\\nprec",!0);P(W,_e,fe,"⋠","\\npreceq",!0);P(W,_e,fe,"⋨","\\precnsim",!0);P(W,_e,fe,"⪹","\\precnapprox",!0);P(W,_e,fe,"≁","\\nsim",!0);P(W,_e,fe,"","\\@nshortmid");P(W,_e,fe,"∤","\\nmid",!0);P(W,_e,fe,"⊬","\\nvdash",!0);P(W,_e,fe,"⊭","\\nvDash",!0);P(W,_e,fe,"⋪","\\ntriangleleft");P(W,_e,fe,"⋬","\\ntrianglelefteq",!0);P(W,_e,fe,"⊊","\\subsetneq",!0);P(W,_e,fe,"","\\@varsubsetneq");P(W,_e,fe,"⫋","\\subsetneqq",!0);P(W,_e,fe,"","\\@varsubsetneqq");P(W,_e,fe,"≯","\\ngtr",!0);P(W,_e,fe,"","\\@ngeqslant");P(W,_e,fe,"","\\@ngeqq");P(W,_e,fe,"⪈","\\gneq",!0);P(W,_e,fe,"≩","\\gneqq",!0);P(W,_e,fe,"","\\@gvertneqq");P(W,_e,fe,"⋧","\\gnsim",!0);P(W,_e,fe,"⪊","\\gnapprox",!0);P(W,_e,fe,"⊁","\\nsucc",!0);P(W,_e,fe,"⋡","\\nsucceq",!0);P(W,_e,fe,"⋩","\\succnsim",!0);P(W,_e,fe,"⪺","\\succnapprox",!0);P(W,_e,fe,"≆","\\ncong",!0);P(W,_e,fe,"","\\@nshortparallel");P(W,_e,fe,"∦","\\nparallel",!0);P(W,_e,fe,"⊯","\\nVDash",!0);P(W,_e,fe,"⋫","\\ntriangleright");P(W,_e,fe,"⋭","\\ntrianglerighteq",!0);P(W,_e,fe,"","\\@nsupseteqq");P(W,_e,fe,"⊋","\\supsetneq",!0);P(W,_e,fe,"","\\@varsupsetneq");P(W,_e,fe,"⫌","\\supsetneqq",!0);P(W,_e,fe,"","\\@varsupsetneqq");P(W,_e,fe,"⊮","\\nVdash",!0);P(W,_e,fe,"⪵","\\precneqq",!0);P(W,_e,fe,"⪶","\\succneqq",!0);P(W,_e,fe,"","\\@nsubseteqq");P(W,_e,vt,"⊴","\\unlhd");P(W,_e,vt,"⊵","\\unrhd");P(W,_e,fe,"↚","\\nleftarrow",!0);P(W,_e,fe,"↛","\\nrightarrow",!0);P(W,_e,fe,"⇍","\\nLeftarrow",!0);P(W,_e,fe,"⇏","\\nRightarrow",!0);P(W,_e,fe,"↮","\\nleftrightarrow",!0);P(W,_e,fe,"⇎","\\nLeftrightarrow",!0);P(W,_e,fe,"△","\\vartriangle");P(W,_e,ye,"ℏ","\\hslash");P(W,_e,ye,"▽","\\triangledown");P(W,_e,ye,"◊","\\lozenge");P(W,_e,ye,"Ⓢ","\\circledS");P(W,_e,ye,"®","\\circledR");P(Ge,_e,ye,"®","\\circledR");P(W,_e,ye,"∡","\\measuredangle",!0);P(W,_e,ye,"∄","\\nexists");P(W,_e,ye,"℧","\\mho");P(W,_e,ye,"Ⅎ","\\Finv",!0);P(W,_e,ye,"⅁","\\Game",!0);P(W,_e,ye,"‵","\\backprime");P(W,_e,ye,"▲","\\blacktriangle");P(W,_e,ye,"▼","\\blacktriangledown");P(W,_e,ye,"■","\\blacksquare");P(W,_e,ye,"⧫","\\blacklozenge");P(W,_e,ye,"★","\\bigstar");P(W,_e,ye,"∢","\\sphericalangle",!0);P(W,_e,ye,"∁","\\complement",!0);P(W,_e,ye,"ð","\\eth",!0);P(Ge,ee,ye,"ð","ð");P(W,_e,ye,"╱","\\diagup");P(W,_e,ye,"╲","\\diagdown");P(W,_e,ye,"□","\\square");P(W,_e,ye,"□","\\Box");P(W,_e,ye,"◊","\\Diamond");P(W,_e,ye,"¥","\\yen",!0);P(Ge,_e,ye,"¥","\\yen",!0);P(W,_e,ye,"✓","\\checkmark",!0);P(Ge,_e,ye,"✓","\\checkmark");P(W,_e,ye,"ℶ","\\beth",!0);P(W,_e,ye,"ℸ","\\daleth",!0);P(W,_e,ye,"ℷ","\\gimel",!0);P(W,_e,ye,"ϝ","\\digamma",!0);P(W,_e,ye,"ϰ","\\varkappa");P(W,_e,ya,"┌","\\@ulcorner",!0);P(W,_e,gi,"┐","\\@urcorner",!0);P(W,_e,ya,"└","\\@llcorner",!0);P(W,_e,gi,"┘","\\@lrcorner",!0);P(W,_e,fe,"≦","\\leqq",!0);P(W,_e,fe,"⩽","\\leqslant",!0);P(W,_e,fe,"⪕","\\eqslantless",!0);P(W,_e,fe,"≲","\\lesssim",!0);P(W,_e,fe,"⪅","\\lessapprox",!0);P(W,_e,fe,"≊","\\approxeq",!0);P(W,_e,vt,"⋖","\\lessdot");P(W,_e,fe,"⋘","\\lll",!0);P(W,_e,fe,"≶","\\lessgtr",!0);P(W,_e,fe,"⋚","\\lesseqgtr",!0);P(W,_e,fe,"⪋","\\lesseqqgtr",!0);P(W,_e,fe,"≑","\\doteqdot");P(W,_e,fe,"≓","\\risingdotseq",!0);P(W,_e,fe,"≒","\\fallingdotseq",!0);P(W,_e,fe,"∽","\\backsim",!0);P(W,_e,fe,"⋍","\\backsimeq",!0);P(W,_e,fe,"⫅","\\subseteqq",!0);P(W,_e,fe,"⋐","\\Subset",!0);P(W,_e,fe,"⊏","\\sqsubset",!0);P(W,_e,fe,"≼","\\preccurlyeq",!0);P(W,_e,fe,"⋞","\\curlyeqprec",!0);P(W,_e,fe,"≾","\\precsim",!0);P(W,_e,fe,"⪷","\\precapprox",!0);P(W,_e,fe,"⊲","\\vartriangleleft");P(W,_e,fe,"⊴","\\trianglelefteq");P(W,_e,fe,"⊨","\\vDash",!0);P(W,_e,fe,"⊪","\\Vvdash",!0);P(W,_e,fe,"⌣","\\smallsmile");P(W,_e,fe,"⌢","\\smallfrown");P(W,_e,fe,"≏","\\bumpeq",!0);P(W,_e,fe,"≎","\\Bumpeq",!0);P(W,_e,fe,"≧","\\geqq",!0);P(W,_e,fe,"⩾","\\geqslant",!0);P(W,_e,fe,"⪖","\\eqslantgtr",!0);P(W,_e,fe,"≳","\\gtrsim",!0);P(W,_e,fe,"⪆","\\gtrapprox",!0);P(W,_e,vt,"⋗","\\gtrdot");P(W,_e,fe,"⋙","\\ggg",!0);P(W,_e,fe,"≷","\\gtrless",!0);P(W,_e,fe,"⋛","\\gtreqless",!0);P(W,_e,fe,"⪌","\\gtreqqless",!0);P(W,_e,fe,"≖","\\eqcirc",!0);P(W,_e,fe,"≗","\\circeq",!0);P(W,_e,fe,"≜","\\triangleq",!0);P(W,_e,fe,"∼","\\thicksim");P(W,_e,fe,"≈","\\thickapprox");P(W,_e,fe,"⫆","\\supseteqq",!0);P(W,_e,fe,"⋑","\\Supset",!0);P(W,_e,fe,"⊐","\\sqsupset",!0);P(W,_e,fe,"≽","\\succcurlyeq",!0);P(W,_e,fe,"⋟","\\curlyeqsucc",!0);P(W,_e,fe,"≿","\\succsim",!0);P(W,_e,fe,"⪸","\\succapprox",!0);P(W,_e,fe,"⊳","\\vartriangleright");P(W,_e,fe,"⊵","\\trianglerighteq");P(W,_e,fe,"⊩","\\Vdash",!0);P(W,_e,fe,"∣","\\shortmid");P(W,_e,fe,"∥","\\shortparallel");P(W,_e,fe,"≬","\\between",!0);P(W,_e,fe,"⋔","\\pitchfork",!0);P(W,_e,fe,"∝","\\varpropto");P(W,_e,fe,"◀","\\blacktriangleleft");P(W,_e,fe,"∴","\\therefore",!0);P(W,_e,fe,"∍","\\backepsilon");P(W,_e,fe,"▶","\\blacktriangleright");P(W,_e,fe,"∵","\\because",!0);P(W,_e,fe,"⋘","\\llless");P(W,_e,fe,"⋙","\\gggtr");P(W,_e,vt,"⊲","\\lhd");P(W,_e,vt,"⊳","\\rhd");P(W,_e,fe,"≂","\\eqsim",!0);P(W,ee,fe,"⋈","\\Join");P(W,_e,fe,"≑","\\Doteq",!0);P(W,_e,vt,"∔","\\dotplus",!0);P(W,_e,vt,"∖","\\smallsetminus");P(W,_e,vt,"⋒","\\Cap",!0);P(W,_e,vt,"⋓","\\Cup",!0);P(W,_e,vt,"⩞","\\doublebarwedge",!0);P(W,_e,vt,"⊟","\\boxminus",!0);P(W,_e,vt,"⊞","\\boxplus",!0);P(W,_e,vt,"⋇","\\divideontimes",!0);P(W,_e,vt,"⋉","\\ltimes",!0);P(W,_e,vt,"⋊","\\rtimes",!0);P(W,_e,vt,"⋋","\\leftthreetimes",!0);P(W,_e,vt,"⋌","\\rightthreetimes",!0);P(W,_e,vt,"⋏","\\curlywedge",!0);P(W,_e,vt,"⋎","\\curlyvee",!0);P(W,_e,vt,"⊝","\\circleddash",!0);P(W,_e,vt,"⊛","\\circledast",!0);P(W,_e,vt,"⋅","\\centerdot");P(W,_e,vt,"⊺","\\intercal",!0);P(W,_e,vt,"⋒","\\doublecap");P(W,_e,vt,"⋓","\\doublecup");P(W,_e,vt,"⊠","\\boxtimes",!0);P(W,_e,fe,"⇢","\\dashrightarrow",!0);P(W,_e,fe,"⇠","\\dashleftarrow",!0);P(W,_e,fe,"⇇","\\leftleftarrows",!0);P(W,_e,fe,"⇆","\\leftrightarrows",!0);P(W,_e,fe,"⇚","\\Lleftarrow",!0);P(W,_e,fe,"↞","\\twoheadleftarrow",!0);P(W,_e,fe,"↢","\\leftarrowtail",!0);P(W,_e,fe,"↫","\\looparrowleft",!0);P(W,_e,fe,"⇋","\\leftrightharpoons",!0);P(W,_e,fe,"↶","\\curvearrowleft",!0);P(W,_e,fe,"↺","\\circlearrowleft",!0);P(W,_e,fe,"↰","\\Lsh",!0);P(W,_e,fe,"⇈","\\upuparrows",!0);P(W,_e,fe,"↿","\\upharpoonleft",!0);P(W,_e,fe,"⇃","\\downharpoonleft",!0);P(W,ee,fe,"⊶","\\origof",!0);P(W,ee,fe,"⊷","\\imageof",!0);P(W,_e,fe,"⊸","\\multimap",!0);P(W,_e,fe,"↭","\\leftrightsquigarrow",!0);P(W,_e,fe,"⇉","\\rightrightarrows",!0);P(W,_e,fe,"⇄","\\rightleftarrows",!0);P(W,_e,fe,"↠","\\twoheadrightarrow",!0);P(W,_e,fe,"↣","\\rightarrowtail",!0);P(W,_e,fe,"↬","\\looparrowright",!0);P(W,_e,fe,"↷","\\curvearrowright",!0);P(W,_e,fe,"↻","\\circlearrowright",!0);P(W,_e,fe,"↱","\\Rsh",!0);P(W,_e,fe,"⇊","\\downdownarrows",!0);P(W,_e,fe,"↾","\\upharpoonright",!0);P(W,_e,fe,"⇂","\\downharpoonright",!0);P(W,_e,fe,"⇝","\\rightsquigarrow",!0);P(W,_e,fe,"⇝","\\leadsto");P(W,_e,fe,"⇛","\\Rrightarrow",!0);P(W,_e,fe,"↾","\\restriction");P(W,ee,ye,"‘","`");P(W,ee,ye,"$","\\$");P(Ge,ee,ye,"$","\\$");P(Ge,ee,ye,"$","\\textdollar");P(W,ee,ye,"%","\\%");P(Ge,ee,ye,"%","\\%");P(W,ee,ye,"_","\\_");P(Ge,ee,ye,"_","\\_");P(Ge,ee,ye,"_","\\textunderscore");P(W,ee,ye,"∠","\\angle",!0);P(W,ee,ye,"∞","\\infty",!0);P(W,ee,ye,"′","\\prime");P(W,ee,ye,"△","\\triangle");P(W,ee,ye,"Γ","\\Gamma",!0);P(W,ee,ye,"Δ","\\Delta",!0);P(W,ee,ye,"Θ","\\Theta",!0);P(W,ee,ye,"Λ","\\Lambda",!0);P(W,ee,ye,"Ξ","\\Xi",!0);P(W,ee,ye,"Π","\\Pi",!0);P(W,ee,ye,"Σ","\\Sigma",!0);P(W,ee,ye,"Υ","\\Upsilon",!0);P(W,ee,ye,"Φ","\\Phi",!0);P(W,ee,ye,"Ψ","\\Psi",!0);P(W,ee,ye,"Ω","\\Omega",!0);P(W,ee,ye,"A","Α");P(W,ee,ye,"B","Β");P(W,ee,ye,"E","Ε");P(W,ee,ye,"Z","Ζ");P(W,ee,ye,"H","Η");P(W,ee,ye,"I","Ι");P(W,ee,ye,"K","Κ");P(W,ee,ye,"M","Μ");P(W,ee,ye,"N","Ν");P(W,ee,ye,"O","Ο");P(W,ee,ye,"P","Ρ");P(W,ee,ye,"T","Τ");P(W,ee,ye,"X","Χ");P(W,ee,ye,"¬","\\neg",!0);P(W,ee,ye,"¬","\\lnot");P(W,ee,ye,"⊤","\\top");P(W,ee,ye,"⊥","\\bot");P(W,ee,ye,"∅","\\emptyset");P(W,_e,ye,"∅","\\varnothing");P(W,ee,Ut,"α","\\alpha",!0);P(W,ee,Ut,"β","\\beta",!0);P(W,ee,Ut,"γ","\\gamma",!0);P(W,ee,Ut,"δ","\\delta",!0);P(W,ee,Ut,"ϵ","\\epsilon",!0);P(W,ee,Ut,"ζ","\\zeta",!0);P(W,ee,Ut,"η","\\eta",!0);P(W,ee,Ut,"θ","\\theta",!0);P(W,ee,Ut,"ι","\\iota",!0);P(W,ee,Ut,"κ","\\kappa",!0);P(W,ee,Ut,"λ","\\lambda",!0);P(W,ee,Ut,"μ","\\mu",!0);P(W,ee,Ut,"ν","\\nu",!0);P(W,ee,Ut,"ξ","\\xi",!0);P(W,ee,Ut,"ο","\\omicron",!0);P(W,ee,Ut,"π","\\pi",!0);P(W,ee,Ut,"ρ","\\rho",!0);P(W,ee,Ut,"σ","\\sigma",!0);P(W,ee,Ut,"τ","\\tau",!0);P(W,ee,Ut,"υ","\\upsilon",!0);P(W,ee,Ut,"ϕ","\\phi",!0);P(W,ee,Ut,"χ","\\chi",!0);P(W,ee,Ut,"ψ","\\psi",!0);P(W,ee,Ut,"ω","\\omega",!0);P(W,ee,Ut,"ε","\\varepsilon",!0);P(W,ee,Ut,"ϑ","\\vartheta",!0);P(W,ee,Ut,"ϖ","\\varpi",!0);P(W,ee,Ut,"ϱ","\\varrho",!0);P(W,ee,Ut,"ς","\\varsigma",!0);P(W,ee,Ut,"φ","\\varphi",!0);P(W,ee,vt,"∗","*",!0);P(W,ee,vt,"+","+");P(W,ee,vt,"−","-",!0);P(W,ee,vt,"⋅","\\cdot",!0);P(W,ee,vt,"∘","\\circ",!0);P(W,ee,vt,"÷","\\div",!0);P(W,ee,vt,"±","\\pm",!0);P(W,ee,vt,"×","\\times",!0);P(W,ee,vt,"∩","\\cap",!0);P(W,ee,vt,"∪","\\cup",!0);P(W,ee,vt,"∖","\\setminus",!0);P(W,ee,vt,"∧","\\land");P(W,ee,vt,"∨","\\lor");P(W,ee,vt,"∧","\\wedge",!0);P(W,ee,vt,"∨","\\vee",!0);P(W,ee,ye,"√","\\surd");P(W,ee,ya,"⟨","\\langle",!0);P(W,ee,ya,"∣","\\lvert");P(W,ee,ya,"∥","\\lVert");P(W,ee,gi,"?","?");P(W,ee,gi,"!","!");P(W,ee,gi,"⟩","\\rangle",!0);P(W,ee,gi,"∣","\\rvert");P(W,ee,gi,"∥","\\rVert");P(W,ee,fe,"=","=");P(W,ee,fe,":",":");P(W,ee,fe,"≈","\\approx",!0);P(W,ee,fe,"≅","\\cong",!0);P(W,ee,fe,"≥","\\ge");P(W,ee,fe,"≥","\\geq",!0);P(W,ee,fe,"←","\\gets");P(W,ee,fe,">","\\gt",!0);P(W,ee,fe,"∈","\\in",!0);P(W,ee,fe,"","\\@not");P(W,ee,fe,"⊂","\\subset",!0);P(W,ee,fe,"⊃","\\supset",!0);P(W,ee,fe,"⊆","\\subseteq",!0);P(W,ee,fe,"⊇","\\supseteq",!0);P(W,_e,fe,"⊈","\\nsubseteq",!0);P(W,_e,fe,"⊉","\\nsupseteq",!0);P(W,ee,fe,"⊨","\\models");P(W,ee,fe,"←","\\leftarrow",!0);P(W,ee,fe,"≤","\\le");P(W,ee,fe,"≤","\\leq",!0);P(W,ee,fe,"<","\\lt",!0);P(W,ee,fe,"→","\\rightarrow",!0);P(W,ee,fe,"→","\\to");P(W,_e,fe,"≱","\\ngeq",!0);P(W,_e,fe,"≰","\\nleq",!0);P(W,ee,gl," ","\\ ");P(W,ee,gl," ","\\space");P(W,ee,gl," ","\\nobreakspace");P(Ge,ee,gl," ","\\ ");P(Ge,ee,gl," "," ");P(Ge,ee,gl," ","\\space");P(Ge,ee,gl," ","\\nobreakspace");P(W,ee,gl,"","\\nobreak");P(W,ee,gl,"","\\allowbreak");P(W,ee,Im,",",",");P(W,ee,Im,";",";");P(W,_e,vt,"⊼","\\barwedge",!0);P(W,_e,vt,"⊻","\\veebar",!0);P(W,ee,vt,"⊙","\\odot",!0);P(W,ee,vt,"⊕","\\oplus",!0);P(W,ee,vt,"⊗","\\otimes",!0);P(W,ee,ye,"∂","\\partial",!0);P(W,ee,vt,"⊘","\\oslash",!0);P(W,_e,vt,"⊚","\\circledcirc",!0);P(W,_e,vt,"⊡","\\boxdot",!0);P(W,ee,vt,"△","\\bigtriangleup");P(W,ee,vt,"▽","\\bigtriangledown");P(W,ee,vt,"†","\\dagger");P(W,ee,vt,"⋄","\\diamond");P(W,ee,vt,"⋆","\\star");P(W,ee,vt,"◃","\\triangleleft");P(W,ee,vt,"▹","\\triangleright");P(W,ee,ya,"{","\\{");P(Ge,ee,ye,"{","\\{");P(Ge,ee,ye,"{","\\textbraceleft");P(W,ee,gi,"}","\\}");P(Ge,ee,ye,"}","\\}");P(Ge,ee,ye,"}","\\textbraceright");P(W,ee,ya,"{","\\lbrace");P(W,ee,gi,"}","\\rbrace");P(W,ee,ya,"[","\\lbrack",!0);P(Ge,ee,ye,"[","\\lbrack",!0);P(W,ee,gi,"]","\\rbrack",!0);P(Ge,ee,ye,"]","\\rbrack",!0);P(W,ee,ya,"(","\\lparen",!0);P(W,ee,gi,")","\\rparen",!0);P(Ge,ee,ye,"<","\\textless",!0);P(Ge,ee,ye,">","\\textgreater",!0);P(W,ee,ya,"⌊","\\lfloor",!0);P(W,ee,gi,"⌋","\\rfloor",!0);P(W,ee,ya,"⌈","\\lceil",!0);P(W,ee,gi,"⌉","\\rceil",!0);P(W,ee,ye,"\\","\\backslash");P(W,ee,ye,"∣","|");P(W,ee,ye,"∣","\\vert");P(Ge,ee,ye,"|","\\textbar",!0);P(W,ee,ye,"∥","\\|");P(W,ee,ye,"∥","\\Vert");P(Ge,ee,ye,"∥","\\textbardbl");P(Ge,ee,ye,"~","\\textasciitilde");P(Ge,ee,ye,"\\","\\textbackslash");P(Ge,ee,ye,"^","\\textasciicircum");P(W,ee,fe,"↑","\\uparrow",!0);P(W,ee,fe,"⇑","\\Uparrow",!0);P(W,ee,fe,"↓","\\downarrow",!0);P(W,ee,fe,"⇓","\\Downarrow",!0);P(W,ee,fe,"↕","\\updownarrow",!0);P(W,ee,fe,"⇕","\\Updownarrow",!0);P(W,ee,cs,"∐","\\coprod");P(W,ee,cs,"⋁","\\bigvee");P(W,ee,cs,"⋀","\\bigwedge");P(W,ee,cs,"⨄","\\biguplus");P(W,ee,cs,"⋂","\\bigcap");P(W,ee,cs,"⋃","\\bigcup");P(W,ee,cs,"∫","\\int");P(W,ee,cs,"∫","\\intop");P(W,ee,cs,"∬","\\iint");P(W,ee,cs,"∭","\\iiint");P(W,ee,cs,"∏","\\prod");P(W,ee,cs,"∑","\\sum");P(W,ee,cs,"⨂","\\bigotimes");P(W,ee,cs,"⨁","\\bigoplus");P(W,ee,cs,"⨀","\\bigodot");P(W,ee,cs,"∮","\\oint");P(W,ee,cs,"∯","\\oiint");P(W,ee,cs,"∰","\\oiiint");P(W,ee,cs,"⨆","\\bigsqcup");P(W,ee,cs,"∫","\\smallint");P(Ge,ee,Vh,"…","\\textellipsis");P(W,ee,Vh,"…","\\mathellipsis");P(Ge,ee,Vh,"…","\\ldots",!0);P(W,ee,Vh,"…","\\ldots",!0);P(W,ee,Vh,"⋯","\\@cdots",!0);P(W,ee,Vh,"⋱","\\ddots",!0);P(W,ee,ye,"⋮","\\varvdots");P(Ge,ee,ye,"⋮","\\varvdots");P(W,ee,Er,"ˊ","\\acute");P(W,ee,Er,"ˋ","\\grave");P(W,ee,Er,"¨","\\ddot");P(W,ee,Er,"~","\\tilde");P(W,ee,Er,"ˉ","\\bar");P(W,ee,Er,"˘","\\breve");P(W,ee,Er,"ˇ","\\check");P(W,ee,Er,"^","\\hat");P(W,ee,Er,"⃗","\\vec");P(W,ee,Er,"˙","\\dot");P(W,ee,Er,"˚","\\mathring");P(W,ee,Ut,"","\\@imath");P(W,ee,Ut,"","\\@jmath");P(W,ee,ye,"ı","ı");P(W,ee,ye,"ȷ","ȷ");P(Ge,ee,ye,"ı","\\i",!0);P(Ge,ee,ye,"ȷ","\\j",!0);P(Ge,ee,ye,"ß","\\ss",!0);P(Ge,ee,ye,"æ","\\ae",!0);P(Ge,ee,ye,"œ","\\oe",!0);P(Ge,ee,ye,"ø","\\o",!0);P(Ge,ee,ye,"Æ","\\AE",!0);P(Ge,ee,ye,"Œ","\\OE",!0);P(Ge,ee,ye,"Ø","\\O",!0);P(Ge,ee,Er,"ˊ","\\'");P(Ge,ee,Er,"ˋ","\\`");P(Ge,ee,Er,"ˆ","\\^");P(Ge,ee,Er,"˜","\\~");P(Ge,ee,Er,"ˉ","\\=");P(Ge,ee,Er,"˘","\\u");P(Ge,ee,Er,"˙","\\.");P(Ge,ee,Er,"¸","\\c");P(Ge,ee,Er,"˚","\\r");P(Ge,ee,Er,"ˇ","\\v");P(Ge,ee,Er,"¨",'\\"');P(Ge,ee,Er,"˝","\\H");P(Ge,ee,Er,"◯","\\textcircled");var qP={"--":!0,"---":!0,"``":!0,"''":!0};P(Ge,ee,ye,"–","--",!0);P(Ge,ee,ye,"–","\\textendash");P(Ge,ee,ye,"—","---",!0);P(Ge,ee,ye,"—","\\textemdash");P(Ge,ee,ye,"‘","`",!0);P(Ge,ee,ye,"‘","\\textquoteleft");P(Ge,ee,ye,"’","'",!0);P(Ge,ee,ye,"’","\\textquoteright");P(Ge,ee,ye,"“","``",!0);P(Ge,ee,ye,"“","\\textquotedblleft");P(Ge,ee,ye,"”","''",!0);P(Ge,ee,ye,"”","\\textquotedblright");P(W,ee,ye,"°","\\degree",!0);P(Ge,ee,ye,"°","\\degree");P(Ge,ee,ye,"°","\\textdegree",!0);P(W,ee,ye,"£","\\pounds");P(W,ee,ye,"£","\\mathsterling",!0);P(Ge,ee,ye,"£","\\pounds");P(Ge,ee,ye,"£","\\textsterling",!0);P(W,_e,ye,"✠","\\maltese");P(Ge,_e,ye,"✠","\\maltese");var gA='0123456789/@."';for(var Pw=0;Pw{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return NA[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return wAn[i]}else{if(r===120485||r===120486)return NA[0];if(120486{if(Lu(e.classes)!==Lu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},UP=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ve=function(n,t,r,s){var i=new Gh(n,t,r,s);return W6(i),i},$u=(e,n,t,r)=>new Gh(e,n,t,r),Ch=function(n,t,r){var s=Ve([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=tt(s.height),s.maxFontSize=1,s},EAn=function(n,t,r,s){var i=new vy(n,t,r,s);return W6(i),i},vl=function(n){var t=new Uh(n);return W6(t),t},Eh=function(n,t){return n instanceof Uh?Ve([],[n],t):n},NAn=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ve(["mspace"],[],n),r=Lr(e,n);return t.style.marginRight=tt(r),t},w1=(e,n,t)=>{var r,s;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 n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},T5={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"}},VP={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},KP=function(n,t){var[r,s,i]=VP[n],a=new Iu(r),o=new dl([a],{width:tt(s),height:tt(i),style:"width:"+tt(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),c=$u(["overlay"],[o],t);return c.height=i,c.style.height=tt(i),c.style.width=tt(s),c},Or={number:3,unit:"mu"},w_={number:4,unit:"mu"},Hc={number:5,unit:"mu"},zAn={mord:{mop:Or,mbin:w_,mrel:Hc,minner:Or},mop:{mord:Or,mop:Or,mrel:Hc,minner:Or},mbin:{mord:w_,mop:w_,mopen:w_,minner:w_},mrel:{mord:Hc,mop:Hc,mopen:Hc,minner:Hc},mopen:{},mclose:{mop:Or,mbin:w_,mrel:Hc,minner:Or},mpunct:{mord:Or,mop:Or,mrel:Hc,mopen:Or,mclose:Or,mpunct:Or,minner:Or},minner:{mord:Or,mop:Or,mbin:w_,mrel:Hc,mopen:Or,mpunct:Or,minner:Or}},jAn={mord:{mop:Or},mop:{mord:Or,mop:Or},mbin:{},mrel:{},mopen:{},mclose:{mop:Or},mpunct:{},minner:{mop:Or}},WP={},tb={},nb={};function ft(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,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:s},c=0;c{var v=k.classes[0],b=w.classes[0];v==="mbin"&&AAn.has(b)?k.classes[0]="mord":b==="mbin"&&TAn.has(v)&&(w.classes[0]="mord")},{node:_},p,m),A5(i,(w,k)=>{var v,b,x=M5(k),y=M5(w),C=x&&y?w.hasClass("mtight")?(v=jAn[x])==null?void 0:v[y]:(b=zAn[x])==null?void 0:b[y]:null;if(C)return GP(C,u)},{node:_},p,m),i},A5=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(_+1,0,p),a++})(a)}s&&n.pop()},QP=function(n){return n instanceof Uh||n instanceof vy||n instanceof Gh&&n.hasClass("enclosing")?n:null},R5=function(n,t){var r=QP(n);if(r){var s=r.children;if(s.length){if(t==="right")return R5(s[s.length-1],"right");if(t==="left")return R5(s[0],"left")}}return n},M5=function(n,t){if(!n)return null;t&&(n=R5(n,t));var r=n.classes[0];return MAn[r]||null},G0=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ve(t.concat(r))},Kn=function(n,t,r){if(!n)return Ve();if(tb[n.type]){var s=tb[n.type](n,t);if(r&&t.size!==r.size){s=Ve(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Xe("Got group of unknown type: '"+n.type+"'")};function k1(e,n){var t=Ve(["base"],e,n),r=Ve(["strut"]);return r.style.height=tt(t.height+t.depth),t.depth&&(r.style.verticalAlign=tt(-t.depth)),t.children.unshift(r),t}function O5(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=xs(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(k1(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(k1(a,n));var u;t?(u=k1(xs(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var h=Ve(["katex-html"],i);if(h.setAttribute("aria-hidden","true"),u){var _=u.children[0];_.style.height=tt(h.height+h.depth),h.depth&&(_.style.verticalAlign=tt(-h.depth))}return h}function XP(e){return new Uh(e)}class Ye{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=Lu(this.classes));for(var r=0;r0&&(n+=' class ="'+Zs(Lu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class os{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Zs(this.toText())}toText(){return this.text}}class YP{constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",tt(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var OAn=new Set(["\\imath","\\jmath"]),DAn=new Set(["mrow","mtable"]),Ka=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(qP.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new os(n)},Q6=function(n){return n.length===1?n[0]:new Ye("mrow",n)},LAn={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"},X6=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=LAn[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(OAn.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=T5[t].fontName;return V6(i,o,r)?T5[t].variant:null};function Uw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof os&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof os&&t.text===","}else return!1}var xa=function(n,t,r){if(n.length===1){var s=dr(n[0],t);return r&&s instanceof Ye&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||Uw(a))){var u=c.children[0];u instanceof Ye&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof os&&h.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var _=c.children[0];_ instanceof os&&_.text.length>0&&(_.text=_.text.slice(0,1)+"̸"+_.text.slice(1),i.pop())}}}i.push(c),a=c}return i},Bu=function(n,t,r){return Q6(xa(n,t,r))},dr=function(n,t){if(!n)return new Ye("mrow");if(nb[n.type])return nb[n.type](n,t);throw new Xe("Got group of unknown type: '"+n.type+"'")};function zA(e,n,t,r,s){var i=xa(e,t),a;i.length===1&&i[0]instanceof Ye&&DAn.has(i[0].type)?a=i[0]:a=new Ye("mrow",i);var o=new Ye("annotation",[new os(n)]);o.setAttribute("encoding","application/x-tex");var c=new Ye("semantics",[a,o]),u=new Ye("math",[c]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var h=s?"katex":"katex-mathml";return Ve([h],[u])}var IAn=[[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]],jA=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],TA=function(n,t){return t.size<2?n:IAn[n-1][t.size-1]};class Qc{constructor(n){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=n.style,this.color=n.color,this.size=n.size||Qc.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=jA[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={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(t,n),new Qc(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:TA(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:jA[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=TA(Qc.BASESIZE,n);return this.size===t&&this.textSize===Qc.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Qc.BASESIZE?["sizing","reset-size"+this.size,"size"+Qc.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=yAn(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Qc.BASESIZE=6;var ZP=function(n){return new Qc({style:n.displayMode?nn.DISPLAY:nn.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},JP=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ve(r,[n])}return n},$An=function(n,t,r){var s=ZP(r),i;if(r.output==="mathml")return zA(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=O5(n,s);i=Ve(["katex"],[a])}else{var o=zA(n,t,s,r.displayMode,!1),c=O5(n,s);i=Ve(["katex"],[o,c])}return JP(i,r)},BAn=function(n,t,r){var s=ZP(r),i=O5(n,s),a=Ve(["katex"],[i]);return JP(a,r)},PAn={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":"="},xy=function(n){var t=new Ye("mo",[new os(PAn[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},FAn={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]},HAn=new Set(["widehat","widecheck","widetilde","utilde"]),wy=function(n,t){function r(){var o=4e5,c=n.label.slice(1);if(HAn.has(c)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,h,_,p;if(u>5)c==="widehat"||c==="widecheck"?(h=420,o=2364,p=.42,_=c+"4"):(h=312,o=2340,p=.34,_="tilde4");else{var m=[1,1,2,2,3,3][u];c==="widehat"||c==="widecheck"?(o=[0,1062,2364,2364,2364][m],h=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],_=c+m):(o=[0,600,1033,2339,2340][m],h=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],_="tilde"+m)}var w=new Iu(_),k=new dl([w],{width:"100%",height:tt(p),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:$u([],[k],t),minWidth:0,height:p}}else{var v=[],b=FAn[c];if(!b)throw new Error('No SVG data for "'+c+'".');var[x,y,C]=b,z=C/1e3,E=x.length,T,j;if(E===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+c+'".');T=["hide-tail"],j=[b[3]]}else if(E===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(E===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+E+" children.");for(var M=0;M0&&(s.style.minWidth=tt(i)),s},qAn=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ve(["stretchy",t],[],i),t==="fbox"){var c=i.color&&i.getColor();c&&(a.style.borderColor=c)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new S5({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new S5({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new dl(u,{width:"100%",height:tt(o)});a=$u([],[h],i)}return a.height=o,a.style.height=tt(o),a},UAn={bin:1,close:1,inner:1,open:1,punct:1,rel:1},GAn={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function VAn(e){return e in UAn}function ln(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function ky(e){var n=Sy(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Sy(e){return e&&(e.type==="atom"||GAn.hasOwnProperty(e.type))?e:null}var eF=e=>{if(e instanceof ma)return e;if(vAn(e)&&e.children.length===1)return eF(e.children[0])},Y6=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=ln(e.base,"accent"),t=r.base,e.base=t,s=gAn(Kn(e,n)),e.base=r):(r=ln(e,"accent"),t=r.base);var i=Kn(t,n.havingCrampedStyle()),a=r.isShifty&&ml(t),o=0;if(a){var c,u;o=(c=(u=eF(i))==null?void 0:u.skew)!=null?c:0}var h=r.label==="\\c",_=h?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=wy(r,n),p=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+tt(2*o)+")",marginLeft:tt(2*o)}:void 0}]});else{var m,w;r.label==="\\vec"?(m=KP("vec",n),w=VP.vec[1]):(m=yy({mode:r.mode,text:r.label},n,"textord"),m=mAn(m),m.italic=0,w=m.width,h&&(_+=m.depth)),p=Ve(["accent-body"],[m]);var k=r.label==="\\textcircled";k&&(p.classes.push("accent-full"),_=i.height);var v=o;k||(v-=w/2),p.style.left=tt(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-_},{type:"elem",elem:p}]})}var b=Ve(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},tF=(e,n)=>{var t=e.isStretchy?xy(e.label):new Ye("mo",[Ka(e.label,e.mode)]),r=new Ye("mover",[dr(e.base,n),t]);return r.setAttribute("accent","true"),r},KAn=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ft({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,n)=>{var t=rb(n[0]),r=!KAn.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:Y6,mathmlBuilder:tF});ft({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[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:t}},htmlBuilder:Y6,mathmlBuilder:tF});ft({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Kn(e.base,n),r=wy(e,n),s=e.label==="\\utilde"?.12:0,i=Gn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ve(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=xy(e.label),r=new Ye("munder",[dr(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var S1=e=>{var n=new Ye("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ft({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,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Eh(Kn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Eh(Kn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=wy(e,n),c=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var h;if(a){var _=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;h=Gn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:_}]})}else h=Gn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:c,wrapperClasses:["svg-align"]}]});return Ve(["mrel","x-arrow"],[h],n)},mathmlBuilder(e,n){var t=xy(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=S1(dr(e.body,n));if(e.below){var i=S1(dr(e.below,n));r=new Ye("munderover",[t,i,s])}else r=new Ye("mover",[t,s])}else if(e.below){var a=S1(dr(e.below,n));r=new Ye("munder",[t,a])}else r=S1(),r=new Ye("mover",[t,r]);return r}});function nF(e,n){var t=xs(e.body,n,!0);return Ve([e.mclass],t,n)}function rF(e,n){var t,r=xa(e.body,n);return e.mclass==="minner"?t=new Ye("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Ye("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Ye("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ft({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:as(s),isCharacterBox:ml(s)}},htmlBuilder:nF,mathmlBuilder:rF});var Cy=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};ft({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Cy(n[0]),body:as(n[1]),isCharacterBox:ml(n[1])}}});ft({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Cy(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:as(s)},c={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[c],isCharacterBox:ml(c)}},htmlBuilder:nF,mathmlBuilder:rF});ft({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Cy(n[0]),body:as(n[0])}},htmlBuilder(e,n){var t=xs(e.body,n,!0),r=Ve([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=xa(e.body,n),r=new Ye("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var WAn={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},AA=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),RA=e=>e.type==="textord"&&e.text==="@",QAn=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function XAn(e,n,t){var r=WAn[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),c={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function YAn(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Xe("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var _=0;_<2;_++){for(var p=!0,m=c+1;mAV=|." after @',a[c]);var w=XAn(u,h,e),k={type:"styling",body:[w],mode:"math",style:"display",resetFont:!0};r.push(k),o=AA()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ft({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Eh(Kn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=tt(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Ye("mrow",[dr(e.label,n)]);return t=new Ye("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Ye("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ft({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Eh(Kn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Ye("mrow",[dr(e.fragment,n)])}});ft({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=ln(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Xe("\\@char with invalid code point "+i);return c<=65535?u=String.fromCharCode(c):(c-=65536,u=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var sF=(e,n)=>{var t=xs(e.body,n.withColor(e.color),!1);return vl(t)},iF=(e,n)=>{var t=xa(e.body,n.withColor(e.color)),r=new Ye("mstyle",t);return r.setAttribute("mathcolor",e.color),r};ft({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=ln(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:as(s)}},htmlBuilder:sF,mathmlBuilder:iF});ft({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=ln(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:sF,mathmlBuilder:iF});ft({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&ln(s,"size").value}},htmlBuilder(e,n){var t=Ve(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=tt(Lr(e.size,n)))),t},mathmlBuilder(e,n){var t=new Ye("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",tt(Lr(e.size,n)))),t}});var D5={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},aF=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Xe("Expected a control sequence",e);return n},ZAn=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},oF=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};ft({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(D5[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=D5[r.text]),ln(n.parseFunction(),"internal");throw new Xe("Invalid token after macro prefix",r)}});ft({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Xe("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Xe('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Xe('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Xe("Expected a macro definition");o[i].push(r.text)}var{tokens:c}=n.gullet.consumeArg();return a&&c.unshift(a),(t==="\\edef"||t==="\\xdef")&&(c=n.gullet.expandTokens(c),c.reverse()),n.gullet.macros.set(s,{tokens:c,numArgs:i,delimiters:o},t===D5[t]),{type:"internal",mode:n.mode}}});ft({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=aF(n.gullet.popToken());n.gullet.consumeSpaces();var s=ZAn(n);return oF(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});ft({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=aF(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return oF(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var a0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=V6(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},Z6=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ve(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},cF=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=tt(i),n.height-=i,n.depth+=i},JAn=function(n,t,r,s,i,a){var o=fi(n,"Main-Regular",i,s),c=Z6(o,t,s,a);return cF(c,s,t),c},eRn=function(n,t,r,s){return fi(n,"Size"+t+"-Regular",r,s)},lF=function(n,t,r,s,i,a){var o=eRn(n,t,i,s),c=Z6(Ve(["delimsizing","size"+t],[o],s),nn.TEXT,s,a);return r&&cF(c,s,nn.TEXT),c},Gw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ve(["delimsizinginner",s],[Ve([],[fi(n,t,r)])]);return{type:"elem",elem:i}},Vw=function(n,t,r){var s=Wo["Size4-Regular"][n.charCodeAt(0)]?Wo["Size4-Regular"][n.charCodeAt(0)][4]:Wo["Size1-Regular"][n.charCodeAt(0)][4],i=new Iu("inner",lAn(n,Math.round(1e3*t))),a=new dl([i],{width:tt(s),height:tt(t),style:"width:"+tt(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=$u([],[a],r);return o.height=t,o.style.height=tt(t),o.style.width=tt(s),{type:"elem",elem:o}},L5=.008,C1={type:"kern",size:-1*L5},tRn=new Set(["|","\\lvert","\\rvert","\\vert"]),nRn=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),uF=function(n,t,r,s,i,a){var o,c,u,h,_="",p=0;o=u=h=n,c=null;var m="Size1-Regular";n==="\\uparrow"?u=h="⏐":n==="\\Uparrow"?u=h="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):tRn.has(n)?(u="∣",_="vert",p=333):nRn.has(n)?(u="∥",_="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",h="⎣",m="Size4-Regular",_="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",h="⎦",m="Size4-Regular",_="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",h="⎣",m="Size4-Regular",_="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=h="⎢",m="Size4-Regular",_="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",h="⎦",m="Size4-Regular",_="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=h="⎥",m="Size4-Regular",_="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",h="⎝",m="Size4-Regular",_="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",h="⎠",m="Size4-Regular",_="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",c="⎨",h="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",c="⎬",h="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",h="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",h="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",h="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",h="⎩",u="⎪",m="Size4-Regular");var w=a0(o,m,i),k=w.height+w.depth,v=a0(u,m,i),b=v.height+v.depth,x=a0(h,m,i),y=x.height+x.depth,C=0,z=1;if(c!==null){var E=a0(c,m,i);C=E.height+E.depth,z=2}var T=k+y+C,j=Math.max(0,Math.ceil((t-T)/(z*b))),M=T+j*z*b,D=s.fontMetrics().axisHeight;r&&(D*=s.sizeMultiplier);var I=M/2-D,$=[];if(_.length>0){var q=M-k-y,H=Math.round(M*1e3),Q=uAn(_,Math.round(q*1e3)),V=new Iu(_,Q),Z=tt(p/1e3),Y=tt(H/1e3),B=new dl([V],{width:Z,height:Y,viewBox:"0 0 "+p+" "+H}),L=$u([],[B],s);L.height=H/1e3,L.style.width=Z,L.style.height=Y,$.push({type:"elem",elem:L})}else{if($.push(Gw(h,m,i)),$.push(C1),c===null){var F=M-k-y+2*L5;$.push(Vw(u,F,s))}else{var U=(M-k-y-C)/2+2*L5;$.push(Vw(u,U,s)),$.push(C1),$.push(Gw(c,m,i)),$.push(C1),$.push(Vw(u,U,s))}$.push(C1),$.push(Gw(o,m,i))}var K=s.havingBaseStyle(nn.TEXT),ne=Gn({positionType:"bottom",positionData:I,children:$});return Z6(Ve(["delimsizing","mult"],[ne],K),nn.TEXT,s,a)},Kw=80,Ww=.08,Qw=function(n,t,r,s,i){var a=cAn(n,s,r),o=new Iu(n,a),c=new dl([o],{width:"400em",height:tt(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return $u(["hide-tail"],[c],i)},rRn=function(n,t){var r=t.havingBaseSizing(),s=pF("\\surd",n*r.sizeMultiplier,hF,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,c,u,h,_;return s.type==="small"?(h=1e3+1e3*a+Kw,n<1?i=1:n<1.4&&(i=.7),c=(1+a+Ww)/i,u=(1+a)/i,o=Qw("sqrtMain",c,h,a,t),o.style.minWidth="0.853em",_=.833/i):s.type==="large"?(h=(1e3+Kw)*y0[s.size],u=(y0[s.size]+a)/i,c=(y0[s.size]+a+Ww)/i,o=Qw("sqrtSize"+s.size,c,h,a,t),o.style.minWidth="1.02em",_=1/i):(c=n+a+Ww,u=n+a,h=Math.floor(1e3*n+a)+Kw,o=Qw("sqrtTall",c,h,a,t),o.style.minWidth="0.742em",_=1.056),o.height=u,o.style.height=tt(c),{span:o,advanceWidth:_,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},_F=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),sRn=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),fF=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),y0=[0,1.2,1.8,2.4,3],dF=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),_F.has(n)||fF.has(n))return lF(n,t,!1,r,s,i);if(sRn.has(n))return uF(n,y0[t],!1,r,s,i);throw new Xe("Illegal delimiter: '"+n+"'")},iRn=[{type:"small",style:nn.SCRIPTSCRIPT},{type:"small",style:nn.SCRIPT},{type:"small",style:nn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],aRn=[{type:"small",style:nn.SCRIPTSCRIPT},{type:"small",style:nn.SCRIPT},{type:"small",style:nn.TEXT},{type:"stack"}],hF=[{type:"small",style:nn.SCRIPTSCRIPT},{type:"small",style:nn.SCRIPT},{type:"small",style:nn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],oRn=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},pF=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},I5=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;fF.has(n)?o=iRn:_F.has(n)?o=hF:o=aRn;var c=pF(n,t,o,s);return c.type==="small"?JAn(n,c.style,r,s,i,a):c.type==="large"?lF(n,c.size,r,s,i,a):uF(n,t,r,s,i,a)},Xw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,u=5/s.fontMetrics().ptPerEm,h=Math.max(t-o,r+o),_=Math.max(h/500*c,2*h-u);return I5(n,_,!0,s,i,a)},MA={"\\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}},cRn=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 OA(e){return"isMiddle"in e}function Ey(e,n){var t=Sy(e);if(t&&cRn.has(t.text))return t;throw t?new Xe("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Xe("Invalid delimiter type '"+e.type+"'",e)}ft({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,n)=>{var t=Ey(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:MA[e.funcName].size,mclass:MA[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ve([e.mclass]):dF(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(Ka(e.delim,e.mode));var t=new Ye("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=tt(y0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function DA(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ft({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Xe("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Ey(n[0],e).text,color:t}}});ft({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Ey(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=ln(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{DA(e);for(var t=xs(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{DA(e);var t=xa(e.body,n);if(e.left!=="."){var r=new Ye("mo",[Ka(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Ye("mo",[Ka(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return Q6(t)}});ft({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Ey(n[0],e);if(!e.parser.leftrightDepth)throw new Xe("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=G0(n,[]):(t=dF(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?Ka("|","text"):Ka(e.delim,e.mode),r=new Ye("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Ny=(e,n)=>{var t=Eh(Kn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=ml(e.body);if(r==="sout")i=Ve(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var c=Lr({number:.6,unit:"pt"},n),u=Lr({number:.35,unit:"ex"},n),h=n.havingBaseSizing();s=s/h.sizeMultiplier;var _=t.height+t.depth+c+u;t.style.paddingLeft=tt(_/2+c);var p=Math.floor(1e3*_*s),m=aAn(p),w=new dl([new Iu("phase",m)],{width:"400em",height:tt(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=$u(["hide-tail"],[w],n),i.style.height=tt(_),a=t.depth+c+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var k,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),k=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=k):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),k=4*b,v=Math.max(0,.25-t.depth)):(k=o?.2:0,v=k),i=qAn(t,r,k,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=tt(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=tt(b),i.style.borderRightWidth=tt(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var x;if(e.backgroundColor)x=Gn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];x=Gn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(x.height=t.height,x.depth=t.depth),/cancel/.test(r)&&!o?Ve(["mord","cancel-lap"],[x],n):Ve(["mord"],[x],n)},zy=(e,n)=>{var t,r=new Ye(e.label.includes("colorbox")?"mpadded":"menclose",[dr(e.body,n)]);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(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+tt(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ft({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=ln(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Ny,mathmlBuilder:zy});ft({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=ln(n[0],"color-token").color,a=ln(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Ny,mathmlBuilder:zy});ft({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});ft({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Ny,mathmlBuilder:zy});ft({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Ny,mathmlBuilder:zy});ft({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var mF={};function cc(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},c=0;c{var n=e.parser.settings;if(!n.displayMode)throw new Xe("{"+e.envName+"} can be used only in display mode.")},lRn=new Set(["gather","gather*"]);function J6(e){if(!e.includes("ed"))return!e.includes("*")}function Wu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:c,singleRow:u,emptySingleRow:h,maxNumCols:_,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Xe("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var w=[],k=[w],v=[],b=[],x=c!=null?[]:void 0;function y(){c&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){x&&(e.gullet.macros.get("\\df@tag")?(x.push(e.subparse([new da("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!c&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(LA(e));;){var z=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var E={type:"ordgroup",mode:e.mode,body:z};t&&(E={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[E]}),w.push(E);var T=e.fetch().text;if(T==="&"){if(_&&w.length===_){if(u||o)throw new Xe("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),w.length===1&&E.type==="styling"&&E.body.length===1&&E.body[0].type==="ordgroup"&&E.body[0].body.length===0&&(k.length>1||!h)&&k.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:He[nt]})}for(C(a[0]),r=0;r0&&(I+=x,THe))for(r=0;r=o)){var ae=void 0;if(s>0||n.hskipBeforeAndAfter){var ce,pe;ae=(ce=(pe=K)==null?void 0:pe.pregap)!=null?ce:p,ae!==0&&(Q=Ve(["arraycolsep"],[]),Q.style.width=tt(ae),H.push(Q))}var be=[];for(r=0;r0){for(var Ct=Ch("hline",t,h),qt=Ch("hdashline",t,h),dt=[{type:"elem",elem:ct,shift:0}];u.length>0;){var ht=u.pop(),Le=ht.pos-$;ht.isDashed?dt.push({type:"elem",elem:qt,shift:Le}):dt.push({type:"elem",elem:Ct,shift:Le})}ct=Gn({positionType:"individualShift",children:dt})}if(Z.length===0)return Ve(["mord"],[ct],t);var me=Gn({positionType:"individualShift",children:Z}),Te=Ve(["tag"],[me],t);return vl([ct,Te])},uRn={c:"center ",l:"left ",r:"right "},uc=function(n,t){for(var r=[],s=new Ye("mtd",[],["mtr-glue"]),i=new Ye("mtd",[],["mml-eqn-num"]),a=0;a0){var w=n.cols,k="",v=!1,b=0,x=w.length;w[0].type==="separator"&&(p+="top ",b=1),w[w.length-1].type==="separator"&&(p+="bottom ",x-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var D=1;D0&&m&&(v=1),r[w]={type:"align",align:k,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};cc({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Sy(n[0]),r=t?[n[0]]:ln(n[0],"ordgroup").body,s=r.map(function(a){var o=ky(a),c=o.text;if("lcr".includes(c))return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new Xe("Unknown column alignment: "+c,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Wu(e.parser,i,eC(e.envName))},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Xe("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Wu(e.parser,r,eC(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Wu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Sy(n[0]),r=t?[n[0]]:ln(n[0],"ordgroup").body,s=r.map(function(o){var c=ky(o),u=c.text;if("lc".includes(u))return{type:"align",align:u};throw new Xe("Unknown column alignment: "+u,o)});if(s.length>1)throw new Xe("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Wu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Xe("{subarray} can contain only one column");return a},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Wu(e.parser,n,eC(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:vF,htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){lRn.has(e.envName)&&jy(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:J6(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Wu(e.parser,n,"display")},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:vF,htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){jy(e);var n={autoTag:J6(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Wu(e.parser,n,"display")},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["CD"],props:{numArgs:0},handler(e){return jy(e),YAn(e.parser)},htmlBuilder:lc,mathmlBuilder:uc});ie("\\nonumber","\\gdef\\@eqnsw{0}");ie("\\notag","\\nonumber");ft({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Xe(e.funcName+" valid only within array environment")}});var IA=mF;ft({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Xe("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Kn(e.body,r)},yF=(e,n)=>{var t=e.font,r=n.withFont(t);return dr(e.body,r)},$A={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ft({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=rb(n[0]),i=r;return i in $A&&(i=$A[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:bF,mathmlBuilder:yF});ft({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Cy(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:ml(r)}}});ft({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:bF,mathmlBuilder:yF});var _Rn=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Kn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,c=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?w=3*p:w=7*p,k=n.fontMetrics().denom1):(_>0?(m=n.fontMetrics().num2,w=p):(m=n.fontMetrics().num3,w=3*p),k=n.fontMetrics().denom2);var v;if(h){var x=n.fontMetrics().axisHeight;m-a.depth-(x+.5*_){var t=new Ye("mfrac",[dr(e.numer,n),dr(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Lr(e.barSize,n);t.setAttribute("linethickness",tt(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Ye("mo",[new os(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Ye("mo",[new os(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return Q6(s)}return t},xF=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};ft({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,c=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",c=")";break;case"\\\\bracefrac":a=!1,o="\\{",c="\\}";break;case"\\\\brackfrac":a=!1,o="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",h=null;return u||r.startsWith("\\d")?h="display":r.startsWith("\\t")&&(h="text"),xF({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:c,barSize:null},h)},htmlBuilder:_Rn,mathmlBuilder:fRn});ft({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var BA=["display","text","script","scriptscript"],PA=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};ft({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=rb(n[0]),a=i.type==="atom"&&i.family==="open"?PA(i.text):null,o=rb(n[1]),c=o.type==="atom"&&o.family==="close"?PA(o.text):null,u=ln(n[2],"size"),h,_=null;u.isBlank?h=!0:(_=u.value,h=_.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var w=ln(m.body[0],"textord");p=BA[Number(w.text)]}}else m=ln(m,"textord"),p=BA[Number(m.text)];return xF({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:h,barSize:_,leftDelim:a,rightDelim:c},p)}});ft({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:ln(n[0],"size").value,token:s}}});ft({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=ln(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var wF=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Kn(e.sup,n.havingStyle(t.sup()),n):Kn(e.sub,n.havingStyle(t.sub()),n),s=ln(e.base,"horizBrace")):s=ln(e,"horizBrace");var i=Kn(s.base,n.havingBaseStyle(nn.DISPLAY)),a=wy(s,n),o;if(s.isOver?o=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=Gn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var c=Ve(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=Gn({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]})}return Ve(["minner",s.isOver?"mover":"munder"],[o],n)},dRn=(e,n)=>{var t=xy(e.label);return new Ye(e.isOver?"mover":"munder",[dr(e.base,n),t])};ft({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:wF,mathmlBuilder:dRn});ft({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=ln(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:as(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=xs(e.body,n,!1);return EAn(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=Bu(e.body,n);return t instanceof Ye||(t=new Ye("mrow",[t])),t.setAttribute("href",e.href),t}});ft({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=ln(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=ln(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,c={};switch(r){case"\\htmlClass":c.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),h=0;h{var t=xs(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ve(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>Bu(e.body,n)});ft({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:as(n[0]),mathml:as(n[1])}},htmlBuilder:(e,n)=>{var t=xs(e.html,n,!1);return vl(t)},mathmlBuilder:(e,n)=>Bu(e.mathml,n)});var Yw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Xe("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!BP(r))throw new Xe("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ft({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var c=ln(t[0],"raw").string,u=c.split(","),h=0;h{var t=Lr(e.height,n),r=0;e.totalheight.number>0&&(r=Lr(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Lr(e.width,n));var i={height:tt(t+r)};s>0&&(i.width=tt(s)),r>0&&(i.verticalAlign=tt(-r));var a=new hAn(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Ye("mglyph",[]);t.setAttribute("alt",e.alt);var r=Lr(e.height,n),s=0;if(e.totalheight.number>0&&(s=Lr(e.totalheight,n)-r,t.setAttribute("valign",tt(-s))),t.setAttribute("height",tt(r+s)),e.width.number>0){var i=Lr(e.width,n);t.setAttribute("width",tt(i))}return t.setAttribute("src",e.src),t}});ft({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=ln(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return GP(e.dimension,n)},mathmlBuilder(e,n){var t=Lr(e.dimension,n);return new YP(t)}});ft({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ve([],[Kn(e.body,n)]),t=Ve(["inner"],[t],n)):t=Ve(["inner"],[Kn(e.body,n)]);var r=Ve(["fix"],[]),s=Ve([e.alignment],[t,r],n),i=Ve(["strut"]);return i.style.height=tt(s.height+s.depth),s.depth&&(i.style.verticalAlign=tt(-s.depth)),s.children.unshift(i),s=Ve(["thinbox"],[s],n),Ve(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Ye("mpadded",[dr(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});ft({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ft({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Xe("Mismatched "+e.funcName)}});var FA=(e,n)=>{switch(n.style.size){case nn.DISPLAY.size:return e.display;case nn.TEXT.size:return e.text;case nn.SCRIPT.size:return e.script;case nn.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ft({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:as(n[0]),text:as(n[1]),script:as(n[2]),scriptscript:as(n[3])}},htmlBuilder:(e,n)=>{var t=FA(e,n),r=xs(t,n,!1);return vl(r)},mathmlBuilder:(e,n)=>{var t=FA(e,n);return Bu(t,n)}});var kF=(e,n,t,r,s,i,a)=>{e=Ve([],[e]);var o=t&&ml(t),c,u;if(n){var h=Kn(n,r.havingStyle(s.sup()),r);u={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(t){var _=Kn(t,r.havingStyle(s.sub()),r);c={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-_.height)}}var p;if(u&&c){var m=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+a;p=Gn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:tt(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:tt(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(c){var w=e.height-a;p=Gn({positionType:"top",positionData:w,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:tt(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e}]})}else if(u){var k=e.depth+a;p=Gn({positionType:"bottom",positionData:k,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:tt(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(c&&i!==0&&!o){var b=Ve(["mspace"],[],r);b.style.marginRight=tt(i),v.unshift(b)}return Ve(["mop","op-limits"],v,r)},SF=new Set(["\\smallint"]),Kh=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=ln(e.base,"op"),s=!0):i=ln(e,"op");var a=n.style,o=!1;a.size===nn.DISPLAY.size&&i.symbol&&!SF.has(i.name)&&(o=!0);var c,u;if(i.symbol){var h=o?"Size2-Regular":"Size1-Regular",_="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(_=i.name.slice(1),i.name=_==="oiint"?"\\iint":"\\iiint"),c=fi(i.name,h,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=c.italic,_.length>0){var p=KP(_+"Size"+(o?"2":"1"),n);c=Gn({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+_,c.classes.unshift("mop"),c.italic=u}}else if(i.body){var m=xs(i.body,n,!0);m.length===1&&m[0]instanceof ma?(c=m[0],c.classes[0]="mop"):c=Ve(["mop"],m,n)}else{for(var w=[],k=1;k{var t;if(e.symbol)t=new Ye("mo",[Ka(e.name,e.mode)]),SF.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Ye("mo",xa(e.body,n));else{t=new Ye("mi",[new os(e.name.slice(1))]);var r=new Ye("mo",[Ka("⁡","text")]);e.parentIsSupSub?t=new Ye("mrow",[t,r]):t=XP([t,r])}return t},hRn={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ft({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=hRn[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Kh,mathmlBuilder:$m});ft({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:as(r)}},htmlBuilder:Kh,mathmlBuilder:$m});var pRn={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ft({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:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Kh,mathmlBuilder:$m});ft({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Kh,mathmlBuilder:$m});ft({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=pRn[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Kh,mathmlBuilder:$m});var CF=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=ln(e.base,"operatorname"),s=!0):i=ln(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(_=>{var p="text"in _?_.text:void 0;return typeof p=="string"?{type:"textord",mode:_.mode,text:p}:_}),c=xs(o,n.withFont("mathrm"),!0),u=0;u{for(var t=xa(e.body,n.withFont("mathrm")),r=!0,s=0;sh.toText()).join("");t=[new os(o)]}var c=new Ye("mi",t);c.setAttribute("mathvariant","normal");var u=new Ye("mo",[Ka("⁡","text")]);return e.parentIsSupSub?new Ye("mrow",[c,u]):XP([c,u])};ft({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:as(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:CF,mathmlBuilder:mRn});ie("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Rf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?vl(xs(e.body,n,!1)):Ve(["mord"],xs(e.body,n,!0),n)},mathmlBuilder(e,n){return Bu(e.body,n,!0)}});ft({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Kn(e.body,n.havingCrampedStyle()),r=Ch("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ve(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Ye("mo",[new os("‾")]);t.setAttribute("stretchy","true");var r=new Ye("mover",[dr(e.body,n),t]);return r.setAttribute("accent","true"),r}});ft({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:as(r)}},htmlBuilder:(e,n)=>{var t=xs(e.body,n.withPhantom(),!1);return vl(t)},mathmlBuilder:(e,n)=>{var t=xa(e.body,n);return new Ye("mphantom",t)}});ie("\\hphantom","\\smash{\\phantom{#1}}");ft({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ve(["inner"],[Kn(e.body,n.withPhantom())]),r=Ve(["fix"],[]);return Ve(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=xa(as(e.body),n),r=new Ye("mphantom",t),s=new Ye("mpadded",[r]);return s.setAttribute("width","0px"),s}});ft({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=ln(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Kn(e.body,n),r=Lr(e.dy,n);return Gn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ye("mpadded",[dr(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});ft({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});ft({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=ln(n[0],"size"),a=ln(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&ln(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ve(["mord","rule"],[],n),r=Lr(e.width,n),s=Lr(e.height,n),i=e.shift?Lr(e.shift,n):0;return t.style.borderRightWidth=tt(r),t.style.borderTopWidth=tt(s),t.style.bottom=tt(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Lr(e.width,n),r=Lr(e.height,n),s=e.shift?Lr(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Ye("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",tt(t)),a.setAttribute("height",tt(r));var o=new Ye("mpadded",[a]);return s>=0?o.setAttribute("height",tt(s)):(o.setAttribute("height",tt(s)),o.setAttribute("depth",tt(-s))),o.setAttribute("voffset",tt(s)),o}});function EF(e,n,t){for(var r=xs(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return EF(e.body,t,n)};ft({type:"sizing",names:HA,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:HA.indexOf(r)+1,body:i}},htmlBuilder:gRn,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=xa(e.body,t),s=new Ye("mstyle",r);return s.setAttribute("mathsize",tt(t.sizeMultiplier)),s}});ft({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&ln(t[0],"ordgroup");if(a)for(var o,c=0;c{var t=Ve([],[Kn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ve(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Ye("mpadded",[dr(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});ft({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Kn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Eh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+_-t.height-t.depth)/2);var p=c.height-t.height-a-u;t.style.paddingLeft=tt(h);var m=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:c},{type:"kern",size:u}]});if(e.index){var w=n.havingStyle(nn.SCRIPTSCRIPT),k=Kn(e.index,w,n),v=.6*(m.height-m.depth),b=Gn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:k}]}),x=Ve(["root"],[b]);return Ve(["mord","sqrt"],[x,m],n)}else return Ve(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Ye("mroot",[dr(t,n),dr(r,n)]):new Ye("msqrt",[dr(t,n)])}});var $5={display:nn.DISPLAY,text:nn.TEXT,script:nn.SCRIPT,scriptscript:nn.SCRIPTSCRIPT};function vRn(e){return e in $5}ft({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!vRn(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=$5[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),EF(e.body,r,n)},mathmlBuilder(e,n){var t=$5[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=xa(e.body,r),i=new Ye("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var bRn=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===nn.DISPLAY.size||r.alwaysHandleSupSub);return s?Kh:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===nn.DISPLAY.size||r.limits);return i?CF:null}else{if(r.type==="accent")return ml(r.base)?Y6:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?wF:null}else return null}else return null};Rf({type:"supsub",htmlBuilder(e,n){var t=bRn(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Kn(r,n),o,c,u=n.fontMetrics(),h=0,_=0,p=r&&ml(r);if(s){var m=n.havingStyle(n.style.sup());o=Kn(s,m,n),p||(h=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var w=n.havingStyle(n.style.sub());c=Kn(i,w,n),p||(_=a.depth+w.fontMetrics().subDrop*w.sizeMultiplier/n.sizeMultiplier)}var k;n.style===nn.DISPLAY?k=u.sup1:n.style.cramped?k=u.sup3:k=u.sup2;var v=n.sizeMultiplier,b=tt(.5/u.ptPerEm/v),x=null;if(c){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof ma||y){var C;x=tt(-((C=a.italic)!=null?C:0))}}var z;if(o&&c){h=Math.max(h,k,o.depth+.25*u.xHeight),_=Math.max(_,u.sub2);var E=u.defaultRuleThickness,T=4*E;if(h-o.depth-(c.height-_)0&&(h+=j,_-=j)}var M=[{type:"elem",elem:c,shift:_,marginRight:b,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:b}];z=Gn({positionType:"individualShift",children:M})}else if(c){_=Math.max(_,u.sub1,c.height-.8*u.xHeight);var D=[{type:"elem",elem:c,marginLeft:x,marginRight:b}];z=Gn({positionType:"shift",positionData:_,children:D})}else if(o)h=Math.max(h,k,o.depth+.25*u.xHeight),z=Gn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var I=M5(a,"right")||"mord";return Ve([I],[a,Ve(["msupsub"],[z])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[dr(e.base,n)];e.sub&&i.push(dr(e.sub,n)),e.sup&&i.push(dr(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===nn.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===nn.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var c=e.base;c&&c.type==="op"&&c.limits&&(n.style===nn.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||n.style===nn.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===nn.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===nn.DISPLAY)?a="mover":a="msup"}return new Ye(a,i)}});Rf({type:"atom",htmlBuilder(e,n){return K6(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Ye("mo",[Ka(e.text,e.mode)]);if(e.family==="bin"){var r=X6(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var NF={mi:"italic",mn:"normal",mtext:"normal"};Rf({type:"mathord",htmlBuilder(e,n){return yy(e,n,"mathord")},mathmlBuilder(e,n){var t=new Ye("mi",[Ka(e.text,e.mode,n)]),r=X6(e,n)||"italic";return r!==NF[t.type]&&t.setAttribute("mathvariant",r),t}});Rf({type:"textord",htmlBuilder(e,n){return yy(e,n,"textord")},mathmlBuilder(e,n){var t=Ka(e.text,e.mode,n),r=X6(e,n)||"normal",s;return e.mode==="text"?s=new Ye("mtext",[t]):/[0-9]/.test(e.text)?s=new Ye("mn",[t]):e.text==="\\prime"?s=new Ye("mo",[t]):s=new Ye("mi",[t]),r!==NF[s.type]&&s.setAttribute("mathvariant",r),s}});var Zw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Jw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Rf({type:"spacing",htmlBuilder(e,n){if(Jw.hasOwnProperty(e.text)){var t=Jw[e.text].className||"";if(e.mode==="text"){var r=yy(e,n,"textord");return r.classes.push(t),r}else return Ve(["mspace",t],[K6(e.text,e.mode,n)],n)}else{if(Zw.hasOwnProperty(e.text))return Ve(["mspace",Zw[e.text]],[],n);throw new Xe('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(Jw.hasOwnProperty(e.text))t=new Ye("mtext",[new os(" ")]);else{if(Zw.hasOwnProperty(e.text))return new Ye("mspace");throw new Xe('Unknown type of space "'+e.text+'"')}return t}});var qA=()=>{var e=new Ye("mtd",[]);return e.setAttribute("width","50%"),e};Rf({type:"tag",mathmlBuilder(e,n){var t=new Ye("mtable",[new Ye("mtr",[qA(),new Ye("mtd",[Bu(e.body,n)]),qA(),new Ye("mtd",[Bu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var UA={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},GA={"\\textbf":"textbf","\\textmd":"textmd"},yRn={"\\textit":"textit","\\textup":"textup"},VA=(e,n)=>{var t=e.font;if(t){if(UA[t])return n.withTextFontFamily(UA[t]);if(GA[t])return n.withTextFontWeight(GA[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(yRn[t])};ft({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:as(s),font:r}},htmlBuilder(e,n){var t=VA(e,n),r=xs(e.body,t,!0);return Ve(["mord","text"],r,t)},mathmlBuilder(e,n){var t=VA(e,n);return Bu(e.body,t)}});ft({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Kn(e.body,n),r=Ch("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=Gn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ve(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Ye("mo",[new os("‾")]);t.setAttribute("stretchy","true");var r=new Ye("munder",[dr(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});ft({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Kn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return Gn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ye("mpadded",[dr(e.body,n)],["vcenter"]);return new Ye("mrow",[t])}});ft({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Xe("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=KA(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),Nu=WP,zF=`[ \r + ]`,xRn="\\\\[a-zA-Z@]+",wRn="\\\\[^\uD800-\uDFFF]",kRn="("+xRn+")"+zF+"*",SRn=`\\\\( |[ \r ]+ -?)[ \r ]*`,I5="[̀-ͯ]",hAn=new RegExp(I5+"+$"),pAn="("+CF+"+)|"+(dAn+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(I5+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(I5+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+fAn)+("|"+_An+")");class VA{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(pAn,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new na("EOF",new ji(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Xe("Unexpected character: '"+n[t]+"'",new na(n[t],new ji(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` -`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.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=i+1,this.lex()}return new na(s,new ji(this,t,this.tokenRegex.lastIndex))}}class mAn{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Xe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var gAn=hF;ie("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ie("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ie("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ie("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ie("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ie("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ie("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var KA={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};ie("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Xe("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=KA[n.text],r==null||r>=t)throw new Xe("Invalid base-"+t+" digit "+n.text);for(var s;(s=KA[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Xe("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Xe("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Xe("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)c+=u.text,u=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new Xe("Invalid number of arguments: "+c);o=parseInt(c),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ie("\\newcommand",e=>eC(e,!1,!0,!1));ie("\\renewcommand",e=>eC(e,!0,!1,!1));ie("\\providecommand",e=>eC(e,!0,!0,!0));ie("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ie("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ie("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),gu[t],Er.math[t],Er.text[t]),""});ie("\\bgroup","{");ie("\\egroup","}");ie("~","\\nobreakspace");ie("\\lq","`");ie("\\rq","'");ie("\\aa","\\r a");ie("\\AA","\\r A");ie("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ie("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ie("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ie("ℬ","\\mathscr{B}");ie("ℰ","\\mathscr{E}");ie("ℱ","\\mathscr{F}");ie("ℋ","\\mathscr{H}");ie("ℐ","\\mathscr{I}");ie("ℒ","\\mathscr{L}");ie("ℳ","\\mathscr{M}");ie("ℛ","\\mathscr{R}");ie("ℭ","\\mathfrak{C}");ie("ℌ","\\mathfrak{H}");ie("ℨ","\\mathfrak{Z}");ie("\\Bbbk","\\Bbb{k}");ie("\\llap","\\mathllap{\\textrm{#1}}");ie("\\rlap","\\mathrlap{\\textrm{#1}}");ie("\\clap","\\mathclap{\\textrm{#1}}");ie("\\mathstrut","\\vphantom{(}");ie("\\underbar","\\underline{\\text{#1}}");ie("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ie("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ie("\\ne","\\neq");ie("≠","\\neq");ie("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ie("∉","\\notin");ie("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ie("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ie("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ie("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ie("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ie("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ie("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ie("⟂","\\perp");ie("‼","\\mathclose{!\\mkern-0.8mu!}");ie("∌","\\notni");ie("⌜","\\ulcorner");ie("⌝","\\urcorner");ie("⌞","\\llcorner");ie("⌟","\\lrcorner");ie("©","\\copyright");ie("®","\\textregistered");ie("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ie("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ie("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ie("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ie("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ie("⋮","\\vdots");ie("\\varGamma","\\mathit{\\Gamma}");ie("\\varDelta","\\mathit{\\Delta}");ie("\\varTheta","\\mathit{\\Theta}");ie("\\varLambda","\\mathit{\\Lambda}");ie("\\varXi","\\mathit{\\Xi}");ie("\\varPi","\\mathit{\\Pi}");ie("\\varSigma","\\mathit{\\Sigma}");ie("\\varUpsilon","\\mathit{\\Upsilon}");ie("\\varPhi","\\mathit{\\Phi}");ie("\\varPsi","\\mathit{\\Psi}");ie("\\varOmega","\\mathit{\\Omega}");ie("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ie("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ie("\\boxed","\\fbox{$\\displaystyle{#1}$}");ie("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ie("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ie("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ie("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ie("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var WA={",":"\\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"},vAn=new Set(["bin","rel"]);ie("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in WA?n=WA[t]:(t.slice(0,4)==="\\not"||t in Er.math&&vAn.has(Er.math[t].group))&&(n="\\dotsb"),n});var tC={")":!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};ie("\\dotso",function(e){var n=e.future().text;return n in tC?"\\ldots\\,":"\\ldots"});ie("\\dotsc",function(e){var n=e.future().text;return n in tC&&n!==","?"\\ldots\\,":"\\ldots"});ie("\\cdots",function(e){var n=e.future().text;return n in tC?"\\@cdots\\,":"\\@cdots"});ie("\\dotsb","\\cdots");ie("\\dotsm","\\cdots");ie("\\dotsi","\\!\\cdots");ie("\\dotsx","\\ldots\\,");ie("\\DOTSI","\\relax");ie("\\DOTSB","\\relax");ie("\\DOTSX","\\relax");ie("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ie("\\,","\\tmspace+{3mu}{.1667em}");ie("\\thinspace","\\,");ie("\\>","\\mskip{4mu}");ie("\\:","\\tmspace+{4mu}{.2222em}");ie("\\medspace","\\:");ie("\\;","\\tmspace+{5mu}{.2777em}");ie("\\thickspace","\\;");ie("\\!","\\tmspace-{3mu}{.1667em}");ie("\\negthinspace","\\!");ie("\\negmedspace","\\tmspace-{4mu}{.2222em}");ie("\\negthickspace","\\tmspace-{5mu}{.277em}");ie("\\enspace","\\kern.5em ");ie("\\enskip","\\hskip.5em\\relax");ie("\\quad","\\hskip1em\\relax");ie("\\qquad","\\hskip2em\\relax");ie("\\tag","\\@ifstar\\tag@literal\\tag@paren");ie("\\tag@paren","\\tag@literal{({#1})}");ie("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Xe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ie("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ie("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ie("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ie("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ie("\\newline","\\\\\\relax");ie("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var EF=tt(Go["Main-Regular"][84][1]-.7*Go["Main-Regular"][65][1]);ie("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+EF+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ie("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+EF+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ie("\\hspace","\\@ifstar\\@hspacer\\@hspace");ie("\\@hspace","\\hskip #1\\relax");ie("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ie("\\ordinarycolon",":");ie("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ie("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ie("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ie("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ie("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ie("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ie("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ie("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ie("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ie("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ie("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ie("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ie("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ie("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ie("∷","\\dblcolon");ie("∹","\\eqcolon");ie("≔","\\coloneqq");ie("≕","\\eqqcolon");ie("⩴","\\Coloneqq");ie("\\ratio","\\vcentcolon");ie("\\coloncolon","\\dblcolon");ie("\\colonequals","\\coloneqq");ie("\\coloncolonequals","\\Coloneqq");ie("\\equalscolon","\\eqqcolon");ie("\\equalscoloncolon","\\Eqqcolon");ie("\\colonminus","\\coloneq");ie("\\coloncolonminus","\\Coloneq");ie("\\minuscolon","\\eqcolon");ie("\\minuscoloncolon","\\Eqcolon");ie("\\coloncolonapprox","\\Colonapprox");ie("\\coloncolonsim","\\Colonsim");ie("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ie("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ie("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ie("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ie("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ie("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ie("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ie("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ie("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ie("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ie("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ie("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ie("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ie("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ie("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ie("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ie("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ie("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ie("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ie("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ie("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ie("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ie("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ie("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ie("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ie("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ie("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ie("\\imath","\\html@mathml{\\@imath}{ı}");ie("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ie("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ie("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ie("⟦","\\llbracket");ie("⟧","\\rrbracket");ie("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ie("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ie("⦃","\\lBrace");ie("⦄","\\rBrace");ie("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ie("⦵","\\minuso");ie("\\darr","\\downarrow");ie("\\dArr","\\Downarrow");ie("\\Darr","\\Downarrow");ie("\\lang","\\langle");ie("\\rang","\\rangle");ie("\\uarr","\\uparrow");ie("\\uArr","\\Uparrow");ie("\\Uarr","\\Uparrow");ie("\\N","\\mathbb{N}");ie("\\R","\\mathbb{R}");ie("\\Z","\\mathbb{Z}");ie("\\alef","\\aleph");ie("\\alefsym","\\aleph");ie("\\Alpha","\\mathrm{A}");ie("\\Beta","\\mathrm{B}");ie("\\bull","\\bullet");ie("\\Chi","\\mathrm{X}");ie("\\clubs","\\clubsuit");ie("\\cnums","\\mathbb{C}");ie("\\Complex","\\mathbb{C}");ie("\\Dagger","\\ddagger");ie("\\diamonds","\\diamondsuit");ie("\\empty","\\emptyset");ie("\\Epsilon","\\mathrm{E}");ie("\\Eta","\\mathrm{H}");ie("\\exist","\\exists");ie("\\harr","\\leftrightarrow");ie("\\hArr","\\Leftrightarrow");ie("\\Harr","\\Leftrightarrow");ie("\\hearts","\\heartsuit");ie("\\image","\\Im");ie("\\infin","\\infty");ie("\\Iota","\\mathrm{I}");ie("\\isin","\\in");ie("\\Kappa","\\mathrm{K}");ie("\\larr","\\leftarrow");ie("\\lArr","\\Leftarrow");ie("\\Larr","\\Leftarrow");ie("\\lrarr","\\leftrightarrow");ie("\\lrArr","\\Leftrightarrow");ie("\\Lrarr","\\Leftrightarrow");ie("\\Mu","\\mathrm{M}");ie("\\natnums","\\mathbb{N}");ie("\\Nu","\\mathrm{N}");ie("\\Omicron","\\mathrm{O}");ie("\\plusmn","\\pm");ie("\\rarr","\\rightarrow");ie("\\rArr","\\Rightarrow");ie("\\Rarr","\\Rightarrow");ie("\\real","\\Re");ie("\\reals","\\mathbb{R}");ie("\\Reals","\\mathbb{R}");ie("\\Rho","\\mathrm{P}");ie("\\sdot","\\cdot");ie("\\sect","\\S");ie("\\spades","\\spadesuit");ie("\\sub","\\subset");ie("\\sube","\\subseteq");ie("\\supe","\\supseteq");ie("\\Tau","\\mathrm{T}");ie("\\thetasym","\\vartheta");ie("\\weierp","\\wp");ie("\\Zeta","\\mathrm{Z}");ie("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ie("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ie("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ie("\\bra","\\mathinner{\\langle{#1}|}");ie("\\ket","\\mathinner{|{#1}\\rangle}");ie("\\braket","\\mathinner{\\langle{#1}\\rangle}");ie("\\Bra","\\left\\langle#1\\right|");ie("\\Ket","\\left|#1\\right\\rangle");var NF=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var c=_=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=_;if(!_&&s.length){var x=p.future();x.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",c(!1)),s.length&&n.macros.set("\\|",c(!0));var u=n.consumeArg().tokens,h=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ie("\\bra@ket",NF(!1));ie("\\bra@set",NF(!0));ie("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ie("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ie("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ie("\\angln","{\\angl n}");ie("\\blue","\\textcolor{##6495ed}{#1}");ie("\\orange","\\textcolor{##ffa500}{#1}");ie("\\pink","\\textcolor{##ff00af}{#1}");ie("\\red","\\textcolor{##df0030}{#1}");ie("\\green","\\textcolor{##28ae7b}{#1}");ie("\\gray","\\textcolor{gray}{#1}");ie("\\purple","\\textcolor{##9d38bd}{#1}");ie("\\blueA","\\textcolor{##ccfaff}{#1}");ie("\\blueB","\\textcolor{##80f6ff}{#1}");ie("\\blueC","\\textcolor{##63d9ea}{#1}");ie("\\blueD","\\textcolor{##11accd}{#1}");ie("\\blueE","\\textcolor{##0c7f99}{#1}");ie("\\tealA","\\textcolor{##94fff5}{#1}");ie("\\tealB","\\textcolor{##26edd5}{#1}");ie("\\tealC","\\textcolor{##01d1c1}{#1}");ie("\\tealD","\\textcolor{##01a995}{#1}");ie("\\tealE","\\textcolor{##208170}{#1}");ie("\\greenA","\\textcolor{##b6ffb0}{#1}");ie("\\greenB","\\textcolor{##8af281}{#1}");ie("\\greenC","\\textcolor{##74cf70}{#1}");ie("\\greenD","\\textcolor{##1fab54}{#1}");ie("\\greenE","\\textcolor{##0d923f}{#1}");ie("\\goldA","\\textcolor{##ffd0a9}{#1}");ie("\\goldB","\\textcolor{##ffbb71}{#1}");ie("\\goldC","\\textcolor{##ff9c39}{#1}");ie("\\goldD","\\textcolor{##e07d10}{#1}");ie("\\goldE","\\textcolor{##a75a05}{#1}");ie("\\redA","\\textcolor{##fca9a9}{#1}");ie("\\redB","\\textcolor{##ff8482}{#1}");ie("\\redC","\\textcolor{##f9685d}{#1}");ie("\\redD","\\textcolor{##e84d39}{#1}");ie("\\redE","\\textcolor{##bc2612}{#1}");ie("\\maroonA","\\textcolor{##ffbde0}{#1}");ie("\\maroonB","\\textcolor{##ff92c6}{#1}");ie("\\maroonC","\\textcolor{##ed5fa6}{#1}");ie("\\maroonD","\\textcolor{##ca337c}{#1}");ie("\\maroonE","\\textcolor{##9e034e}{#1}");ie("\\purpleA","\\textcolor{##ddd7ff}{#1}");ie("\\purpleB","\\textcolor{##c6b9fc}{#1}");ie("\\purpleC","\\textcolor{##aa87ff}{#1}");ie("\\purpleD","\\textcolor{##7854ab}{#1}");ie("\\purpleE","\\textcolor{##543b78}{#1}");ie("\\mintA","\\textcolor{##f5f9e8}{#1}");ie("\\mintB","\\textcolor{##edf2df}{#1}");ie("\\mintC","\\textcolor{##e0e5cc}{#1}");ie("\\grayA","\\textcolor{##f6f7f7}{#1}");ie("\\grayB","\\textcolor{##f0f1f2}{#1}");ie("\\grayC","\\textcolor{##e3e5e6}{#1}");ie("\\grayD","\\textcolor{##d6d8da}{#1}");ie("\\grayE","\\textcolor{##babec2}{#1}");ie("\\grayF","\\textcolor{##888d93}{#1}");ie("\\grayG","\\textcolor{##626569}{#1}");ie("\\grayH","\\textcolor{##3b3e40}{#1}");ie("\\grayI","\\textcolor{##21242c}{#1}");ie("\\kaBlue","\\textcolor{##314453}{#1}");ie("\\kaGreen","\\textcolor{##71B307}{#1}");var zF={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class bAn{constructor(n,t,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=t,this.expansionCount=0,this.feed(n),this.macros=new mAn(gAn,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new VA(n,this.settings)}switchMode(n){this.mode=n}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(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new na("EOF",r.loc)),this.pushTokens(s),new na("",ji.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Xe("Extra }",i)}else if(i.text==="EOF")throw new Xe("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Xe("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Xe("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Xe("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var c=i[o];if(c.text==="#"){if(o===0)throw new Xe("Incomplete placeholder at end of macro body",c);if(c=i[--o],c.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(c.text))i.splice(o,2,...a[+c.text-1]);else throw new Xe("Not a valid argument number",c)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new na(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new VA(s,this.settings),c=[],u=o.lex();u.text!=="EOF";)c.push(u),u=o.lex();c.reverse();var h={tokens:c,numArgs:i};return h}return s}isDefined(n){return this.macros.has(n)||gu.hasOwnProperty(n)||Er.math.hasOwnProperty(n)||Er.text.hasOwnProperty(n)||zF.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:gu.hasOwnProperty(n)&&!gu[n].primitive}}var QA=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,E1=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Zw={"́":{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"}},XA={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class zy{constructor(n,t){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 bAn(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Xe("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new na("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(zy.endOfExpression.has(s.text)||t&&s.text===t||n&&gu[s.text]&&gu[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(DP(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:ji.range(n),text:t};else return null;if(this.consume(),i)for(var h=0;h0?{type:"text",value:z}:void 0),z===!1?p.lastIndex=C+1:(x!==C&&w.push({type:"text",value:u.value.slice(x,C)}),Array.isArray(z)?w.push(...z):z&&w.push(z),x=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(x?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=ZA(e,"(");let i=ZA(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function RF(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||tf(t)||uy(t))&&(!n||t!==47)}MF.peek=ZAn;function UAn(){this.buffer()}function GAn(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function VAn(){this.buffer()}function KAn(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function WAn(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=ao(this.sliceSerialize(e)).toLowerCase(),t.label=n}function QAn(e){this.exit(e)}function XAn(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=ao(this.sliceSerialize(e)).toLowerCase(),t.label=n}function YAn(e){this.exit(e)}function ZAn(){return"["}function MF(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function JAn(){return{enter:{gfmFootnoteCallString:UAn,gfmFootnoteCall:GAn,gfmFootnoteDefinitionLabelString:VAn,gfmFootnoteDefinition:KAn},exit:{gfmFootnoteCallString:WAn,gfmFootnoteCall:QAn,gfmFootnoteDefinitionLabelString:XAn,gfmFootnoteDefinition:YAn}}}function eRn(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:MF},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let c=o.move("[^");const u=i.enter("footnoteDefinition"),h=i.enter("label");return c+=o.move(i.safe(i.associationId(r),{before:c,after:"]"})),h(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((n?` -`:" ")+i.indentLines(i.containerFlow(r,o.current()),n?OF:tRn))),u(),c}}function tRn(e,n,t){return n===0?e:OF(e,n,t)}function OF(e,n,t){return(t?"":" ")+e}const nRn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];DF.peek=oRn;function rRn(){return{canContainEols:["delete"],enter:{strikethrough:iRn},exit:{strikethrough:aRn}}}function sRn(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:nRn}],handlers:{delete:DF}}}function iRn(e){this.enter({type:"delete",children:[]},e)}function aRn(e){this.exit(e)}function DF(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let a=s.move("~~");return a+=t.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function oRn(){return"~"}function cRn(e){return e.length}function lRn(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||cRn,i=[],a=[],o=[],c=[];let u=0,h=-1;for(;++hu&&(u=e[h].length);++bc[b])&&(c[b]=y)}k.push(w)}a[h]=k,o[h]=v}let _=-1;if(typeof r=="object"&&"length"in r)for(;++_c[_]&&(c[_]=w),m[_]=w),p[_]=y}a.splice(1,0,p),o.splice(1,0,m),h=-1;const x=[];for(;++h "),i.shift(2);const a=t.indentLines(t.containerFlow(e,i.current()),fRn);return s(),a}function fRn(e,n,t){return">"+(t?"":" ")+e}function dRn(e,n){return eR(e,n.inConstruct,!0)&&!eR(e,n.notInConstruct,!1)}function eR(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++ra&&(a=i):i=1,s=r+n.length,r=t.indexOf(n,s);return a}function hRn(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function pRn(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function mRn(e,n,t,r){const s=pRn(t),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(hRn(e,t)){const _=t.enter("codeIndented"),p=t.indentLines(i,gRn);return _(),p}const o=t.createTracker(r),c=s.repeat(Math.max(LF(i,s)+1,3)),u=t.enter("codeFenced");let h=o.move(c);if(e.lang){const _=t.enter(`codeFencedLang${a}`);h+=o.move(t.safe(e.lang,{before:h,after:" ",encode:["`"],...o.current()})),_()}if(e.lang&&e.meta){const _=t.enter(`codeFencedMeta${a}`);h+=o.move(" "),h+=o.move(t.safe(e.meta,{before:h,after:` +?)[ \r ]*`,B5="[̀-ͯ]",CRn=new RegExp(B5+"+$"),ERn="("+zF+"+)|"+(SRn+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(B5+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(B5+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+kRn)+("|"+wRn+")");class WA{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(ERn,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new da("EOF",new Ii(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Xe("Unexpected character: '"+n[t]+"'",new da(n[t],new Ii(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` +`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.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=i+1,this.lex()}return new da(s,new Ii(this,t,this.tokenRegex.lastIndex))}}class NRn{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Xe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var zRn=gF;ie("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ie("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ie("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ie("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ie("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ie("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ie("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var QA={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};ie("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Xe("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=QA[n.text],r==null||r>=t)throw new Xe("Invalid base-"+t+" digit "+n.text);for(var s;(s=QA[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Xe("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Xe("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Xe("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)c+=u.text,u=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new Xe("Invalid number of arguments: "+c);o=parseInt(c),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ie("\\newcommand",e=>tC(e,!1,!0,!1));ie("\\renewcommand",e=>tC(e,!0,!1,!1));ie("\\providecommand",e=>tC(e,!0,!0,!0));ie("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ie("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ie("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),Nu[t],Sr.math[t],Sr.text[t]),""});ie("\\bgroup","{");ie("\\egroup","}");ie("~","\\nobreakspace");ie("\\lq","`");ie("\\rq","'");ie("\\aa","\\r a");ie("\\AA","\\r A");ie("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ie("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ie("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ie("ℬ","\\mathscr{B}");ie("ℰ","\\mathscr{E}");ie("ℱ","\\mathscr{F}");ie("ℋ","\\mathscr{H}");ie("ℐ","\\mathscr{I}");ie("ℒ","\\mathscr{L}");ie("ℳ","\\mathscr{M}");ie("ℛ","\\mathscr{R}");ie("ℭ","\\mathfrak{C}");ie("ℌ","\\mathfrak{H}");ie("ℨ","\\mathfrak{Z}");ie("\\Bbbk","\\Bbb{k}");ie("\\llap","\\mathllap{\\textrm{#1}}");ie("\\rlap","\\mathrlap{\\textrm{#1}}");ie("\\clap","\\mathclap{\\textrm{#1}}");ie("\\mathstrut","\\vphantom{(}");ie("\\underbar","\\underline{\\text{#1}}");ie("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ie("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ie("\\ne","\\neq");ie("≠","\\neq");ie("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ie("∉","\\notin");ie("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ie("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ie("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ie("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ie("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ie("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ie("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ie("⟂","\\perp");ie("‼","\\mathclose{!\\mkern-0.8mu!}");ie("∌","\\notni");ie("⌜","\\ulcorner");ie("⌝","\\urcorner");ie("⌞","\\llcorner");ie("⌟","\\lrcorner");ie("©","\\copyright");ie("®","\\textregistered");ie("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ie("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ie("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ie("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ie("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ie("⋮","\\vdots");ie("\\varGamma","\\mathit{\\Gamma}");ie("\\varDelta","\\mathit{\\Delta}");ie("\\varTheta","\\mathit{\\Theta}");ie("\\varLambda","\\mathit{\\Lambda}");ie("\\varXi","\\mathit{\\Xi}");ie("\\varPi","\\mathit{\\Pi}");ie("\\varSigma","\\mathit{\\Sigma}");ie("\\varUpsilon","\\mathit{\\Upsilon}");ie("\\varPhi","\\mathit{\\Phi}");ie("\\varPsi","\\mathit{\\Psi}");ie("\\varOmega","\\mathit{\\Omega}");ie("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ie("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ie("\\boxed","\\fbox{$\\displaystyle{#1}$}");ie("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ie("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ie("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ie("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ie("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var XA={",":"\\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"},jRn=new Set(["bin","rel"]);ie("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in XA?n=XA[t]:(t.slice(0,4)==="\\not"||t in Sr.math&&jRn.has(Sr.math[t].group))&&(n="\\dotsb"),n});var nC={")":!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};ie("\\dotso",function(e){var n=e.future().text;return n in nC?"\\ldots\\,":"\\ldots"});ie("\\dotsc",function(e){var n=e.future().text;return n in nC&&n!==","?"\\ldots\\,":"\\ldots"});ie("\\cdots",function(e){var n=e.future().text;return n in nC?"\\@cdots\\,":"\\@cdots"});ie("\\dotsb","\\cdots");ie("\\dotsm","\\cdots");ie("\\dotsi","\\!\\cdots");ie("\\dotsx","\\ldots\\,");ie("\\DOTSI","\\relax");ie("\\DOTSB","\\relax");ie("\\DOTSX","\\relax");ie("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ie("\\,","\\tmspace+{3mu}{.1667em}");ie("\\thinspace","\\,");ie("\\>","\\mskip{4mu}");ie("\\:","\\tmspace+{4mu}{.2222em}");ie("\\medspace","\\:");ie("\\;","\\tmspace+{5mu}{.2777em}");ie("\\thickspace","\\;");ie("\\!","\\tmspace-{3mu}{.1667em}");ie("\\negthinspace","\\!");ie("\\negmedspace","\\tmspace-{4mu}{.2222em}");ie("\\negthickspace","\\tmspace-{5mu}{.277em}");ie("\\enspace","\\kern.5em ");ie("\\enskip","\\hskip.5em\\relax");ie("\\quad","\\hskip1em\\relax");ie("\\qquad","\\hskip2em\\relax");ie("\\tag","\\@ifstar\\tag@literal\\tag@paren");ie("\\tag@paren","\\tag@literal{({#1})}");ie("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Xe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ie("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ie("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ie("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ie("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ie("\\newline","\\\\\\relax");ie("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var jF=tt(Wo["Main-Regular"][84][1]-.7*Wo["Main-Regular"][65][1]);ie("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+jF+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ie("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+jF+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ie("\\hspace","\\@ifstar\\@hspacer\\@hspace");ie("\\@hspace","\\hskip #1\\relax");ie("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ie("\\ordinarycolon",":");ie("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ie("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ie("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ie("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ie("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ie("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ie("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ie("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ie("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ie("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ie("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ie("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ie("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ie("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ie("∷","\\dblcolon");ie("∹","\\eqcolon");ie("≔","\\coloneqq");ie("≕","\\eqqcolon");ie("⩴","\\Coloneqq");ie("\\ratio","\\vcentcolon");ie("\\coloncolon","\\dblcolon");ie("\\colonequals","\\coloneqq");ie("\\coloncolonequals","\\Coloneqq");ie("\\equalscolon","\\eqqcolon");ie("\\equalscoloncolon","\\Eqqcolon");ie("\\colonminus","\\coloneq");ie("\\coloncolonminus","\\Coloneq");ie("\\minuscolon","\\eqcolon");ie("\\minuscoloncolon","\\Eqcolon");ie("\\coloncolonapprox","\\Colonapprox");ie("\\coloncolonsim","\\Colonsim");ie("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ie("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ie("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ie("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ie("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ie("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ie("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ie("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ie("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ie("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ie("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ie("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ie("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ie("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ie("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ie("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ie("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ie("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ie("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ie("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ie("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ie("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ie("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ie("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ie("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ie("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ie("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ie("\\imath","\\html@mathml{\\@imath}{ı}");ie("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ie("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ie("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ie("⟦","\\llbracket");ie("⟧","\\rrbracket");ie("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ie("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ie("⦃","\\lBrace");ie("⦄","\\rBrace");ie("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ie("⦵","\\minuso");ie("\\darr","\\downarrow");ie("\\dArr","\\Downarrow");ie("\\Darr","\\Downarrow");ie("\\lang","\\langle");ie("\\rang","\\rangle");ie("\\uarr","\\uparrow");ie("\\uArr","\\Uparrow");ie("\\Uarr","\\Uparrow");ie("\\N","\\mathbb{N}");ie("\\R","\\mathbb{R}");ie("\\Z","\\mathbb{Z}");ie("\\alef","\\aleph");ie("\\alefsym","\\aleph");ie("\\Alpha","\\mathrm{A}");ie("\\Beta","\\mathrm{B}");ie("\\bull","\\bullet");ie("\\Chi","\\mathrm{X}");ie("\\clubs","\\clubsuit");ie("\\cnums","\\mathbb{C}");ie("\\Complex","\\mathbb{C}");ie("\\Dagger","\\ddagger");ie("\\diamonds","\\diamondsuit");ie("\\empty","\\emptyset");ie("\\Epsilon","\\mathrm{E}");ie("\\Eta","\\mathrm{H}");ie("\\exist","\\exists");ie("\\harr","\\leftrightarrow");ie("\\hArr","\\Leftrightarrow");ie("\\Harr","\\Leftrightarrow");ie("\\hearts","\\heartsuit");ie("\\image","\\Im");ie("\\infin","\\infty");ie("\\Iota","\\mathrm{I}");ie("\\isin","\\in");ie("\\Kappa","\\mathrm{K}");ie("\\larr","\\leftarrow");ie("\\lArr","\\Leftarrow");ie("\\Larr","\\Leftarrow");ie("\\lrarr","\\leftrightarrow");ie("\\lrArr","\\Leftrightarrow");ie("\\Lrarr","\\Leftrightarrow");ie("\\Mu","\\mathrm{M}");ie("\\natnums","\\mathbb{N}");ie("\\Nu","\\mathrm{N}");ie("\\Omicron","\\mathrm{O}");ie("\\plusmn","\\pm");ie("\\rarr","\\rightarrow");ie("\\rArr","\\Rightarrow");ie("\\Rarr","\\Rightarrow");ie("\\real","\\Re");ie("\\reals","\\mathbb{R}");ie("\\Reals","\\mathbb{R}");ie("\\Rho","\\mathrm{P}");ie("\\sdot","\\cdot");ie("\\sect","\\S");ie("\\spades","\\spadesuit");ie("\\sub","\\subset");ie("\\sube","\\subseteq");ie("\\supe","\\supseteq");ie("\\Tau","\\mathrm{T}");ie("\\thetasym","\\vartheta");ie("\\weierp","\\wp");ie("\\Zeta","\\mathrm{Z}");ie("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ie("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ie("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ie("\\bra","\\mathinner{\\langle{#1}|}");ie("\\ket","\\mathinner{|{#1}\\rangle}");ie("\\braket","\\mathinner{\\langle{#1}\\rangle}");ie("\\Bra","\\left\\langle#1\\right|");ie("\\Ket","\\left|#1\\right\\rangle");var TF=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var c=_=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=_;if(!_&&s.length){var w=p.future();w.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",c(!1)),s.length&&n.macros.set("\\|",c(!0));var u=n.consumeArg().tokens,h=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ie("\\bra@ket",TF(!1));ie("\\bra@set",TF(!0));ie("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ie("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ie("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ie("\\angln","{\\angl n}");ie("\\blue","\\textcolor{##6495ed}{#1}");ie("\\orange","\\textcolor{##ffa500}{#1}");ie("\\pink","\\textcolor{##ff00af}{#1}");ie("\\red","\\textcolor{##df0030}{#1}");ie("\\green","\\textcolor{##28ae7b}{#1}");ie("\\gray","\\textcolor{gray}{#1}");ie("\\purple","\\textcolor{##9d38bd}{#1}");ie("\\blueA","\\textcolor{##ccfaff}{#1}");ie("\\blueB","\\textcolor{##80f6ff}{#1}");ie("\\blueC","\\textcolor{##63d9ea}{#1}");ie("\\blueD","\\textcolor{##11accd}{#1}");ie("\\blueE","\\textcolor{##0c7f99}{#1}");ie("\\tealA","\\textcolor{##94fff5}{#1}");ie("\\tealB","\\textcolor{##26edd5}{#1}");ie("\\tealC","\\textcolor{##01d1c1}{#1}");ie("\\tealD","\\textcolor{##01a995}{#1}");ie("\\tealE","\\textcolor{##208170}{#1}");ie("\\greenA","\\textcolor{##b6ffb0}{#1}");ie("\\greenB","\\textcolor{##8af281}{#1}");ie("\\greenC","\\textcolor{##74cf70}{#1}");ie("\\greenD","\\textcolor{##1fab54}{#1}");ie("\\greenE","\\textcolor{##0d923f}{#1}");ie("\\goldA","\\textcolor{##ffd0a9}{#1}");ie("\\goldB","\\textcolor{##ffbb71}{#1}");ie("\\goldC","\\textcolor{##ff9c39}{#1}");ie("\\goldD","\\textcolor{##e07d10}{#1}");ie("\\goldE","\\textcolor{##a75a05}{#1}");ie("\\redA","\\textcolor{##fca9a9}{#1}");ie("\\redB","\\textcolor{##ff8482}{#1}");ie("\\redC","\\textcolor{##f9685d}{#1}");ie("\\redD","\\textcolor{##e84d39}{#1}");ie("\\redE","\\textcolor{##bc2612}{#1}");ie("\\maroonA","\\textcolor{##ffbde0}{#1}");ie("\\maroonB","\\textcolor{##ff92c6}{#1}");ie("\\maroonC","\\textcolor{##ed5fa6}{#1}");ie("\\maroonD","\\textcolor{##ca337c}{#1}");ie("\\maroonE","\\textcolor{##9e034e}{#1}");ie("\\purpleA","\\textcolor{##ddd7ff}{#1}");ie("\\purpleB","\\textcolor{##c6b9fc}{#1}");ie("\\purpleC","\\textcolor{##aa87ff}{#1}");ie("\\purpleD","\\textcolor{##7854ab}{#1}");ie("\\purpleE","\\textcolor{##543b78}{#1}");ie("\\mintA","\\textcolor{##f5f9e8}{#1}");ie("\\mintB","\\textcolor{##edf2df}{#1}");ie("\\mintC","\\textcolor{##e0e5cc}{#1}");ie("\\grayA","\\textcolor{##f6f7f7}{#1}");ie("\\grayB","\\textcolor{##f0f1f2}{#1}");ie("\\grayC","\\textcolor{##e3e5e6}{#1}");ie("\\grayD","\\textcolor{##d6d8da}{#1}");ie("\\grayE","\\textcolor{##babec2}{#1}");ie("\\grayF","\\textcolor{##888d93}{#1}");ie("\\grayG","\\textcolor{##626569}{#1}");ie("\\grayH","\\textcolor{##3b3e40}{#1}");ie("\\grayI","\\textcolor{##21242c}{#1}");ie("\\kaBlue","\\textcolor{##314453}{#1}");ie("\\kaGreen","\\textcolor{##71B307}{#1}");var AF={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class TRn{constructor(n,t,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=t,this.expansionCount=0,this.feed(n),this.macros=new NRn(zRn,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new WA(n,this.settings)}switchMode(n){this.mode=n}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(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new da("EOF",r.loc)),this.pushTokens(s),new da("",Ii.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Xe("Extra }",i)}else if(i.text==="EOF")throw new Xe("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Xe("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Xe("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Xe("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var c=i[o];if(c.text==="#"){if(o===0)throw new Xe("Incomplete placeholder at end of macro body",c);if(c=i[--o],c.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(c.text))i.splice(o,2,...a[+c.text-1]);else throw new Xe("Not a valid argument number",c)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new da(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new WA(s,this.settings),c=[],u=o.lex();u.text!=="EOF";)c.push(u),u=o.lex();c.reverse();var h={tokens:c,numArgs:i};return h}return s}isDefined(n){return this.macros.has(n)||Nu.hasOwnProperty(n)||Sr.math.hasOwnProperty(n)||Sr.text.hasOwnProperty(n)||AF.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:Nu.hasOwnProperty(n)&&!Nu[n].primitive}}var YA=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,E1=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),e4={"́":{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"}},ZA={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Ty{constructor(n,t){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 TRn(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Xe("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new da("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Ty.endOfExpression.has(s.text)||t&&s.text===t||n&&Nu[s.text]&&Nu[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&($P(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:Ii.range(n),text:t};else return null;if(this.consume(),i)for(var h=0;h0?{type:"text",value:E}:void 0),E===!1?p.lastIndex=C+1:(w!==C&&x.push({type:"text",value:u.value.slice(w,C)}),Array.isArray(E)?x.push(...E):E&&x.push(E),w=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(w?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=eR(e,"(");let i=eR(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function DF(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||uf(t)||fy(t))&&(!n||t!==47)}LF.peek=lMn;function tMn(){this.buffer()}function nMn(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function rMn(){this.buffer()}function sMn(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function iMn(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=yo(this.sliceSerialize(e)).toLowerCase(),t.label=n}function aMn(e){this.exit(e)}function oMn(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=yo(this.sliceSerialize(e)).toLowerCase(),t.label=n}function cMn(e){this.exit(e)}function lMn(){return"["}function LF(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function uMn(){return{enter:{gfmFootnoteCallString:tMn,gfmFootnoteCall:nMn,gfmFootnoteDefinitionLabelString:rMn,gfmFootnoteDefinition:sMn},exit:{gfmFootnoteCallString:iMn,gfmFootnoteCall:aMn,gfmFootnoteDefinitionLabelString:oMn,gfmFootnoteDefinition:cMn}}}function _Mn(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:LF},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let c=o.move("[^");const u=i.enter("footnoteDefinition"),h=i.enter("label");return c+=o.move(i.safe(i.associationId(r),{before:c,after:"]"})),h(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((n?` +`:" ")+i.indentLines(i.containerFlow(r,o.current()),n?IF:fMn))),u(),c}}function fMn(e,n,t){return n===0?e:IF(e,n,t)}function IF(e,n,t){return(t?"":" ")+e}const dMn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$F.peek=vMn;function hMn(){return{canContainEols:["delete"],enter:{strikethrough:mMn},exit:{strikethrough:gMn}}}function pMn(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:dMn}],handlers:{delete:$F}}}function mMn(e){this.enter({type:"delete",children:[]},e)}function gMn(e){this.exit(e)}function $F(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let a=s.move("~~");return a+=t.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function vMn(){return"~"}function bMn(e){return e.length}function yMn(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||bMn,i=[],a=[],o=[],c=[];let u=0,h=-1;for(;++hu&&(u=e[h].length);++bc[b])&&(c[b]=y)}k.push(x)}a[h]=k,o[h]=v}let _=-1;if(typeof r=="object"&&"length"in r)for(;++_c[_]&&(c[_]=x),m[_]=x),p[_]=y}a.splice(1,0,p),o.splice(1,0,m),h=-1;const w=[];for(;++h "),i.shift(2);const a=t.indentLines(t.containerFlow(e,i.current()),kMn);return s(),a}function kMn(e,n,t){return">"+(t?"":" ")+e}function SMn(e,n){return nR(e,n.inConstruct,!0)&&!nR(e,n.notInConstruct,!1)}function nR(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++ra&&(a=i):i=1,s=r+n.length,r=t.indexOf(n,s);return a}function CMn(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function EMn(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function NMn(e,n,t,r){const s=EMn(t),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(CMn(e,t)){const _=t.enter("codeIndented"),p=t.indentLines(i,zMn);return _(),p}const o=t.createTracker(r),c=s.repeat(Math.max(BF(i,s)+1,3)),u=t.enter("codeFenced");let h=o.move(c);if(e.lang){const _=t.enter(`codeFencedLang${a}`);h+=o.move(t.safe(e.lang,{before:h,after:" ",encode:["`"],...o.current()})),_()}if(e.lang&&e.meta){const _=t.enter(`codeFencedMeta${a}`);h+=o.move(" "),h+=o.move(t.safe(e.meta,{before:h,after:` `,encode:["`"],...o.current()})),_()}return h+=o.move(` `),i&&(h+=o.move(i+` -`)),h+=o.move(c),u(),h}function gRn(e,n,t){return(t?"":" ")+e}function sC(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function vRn(e,n,t,r){const s=sC(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("definition");let o=t.enter("label");const c=t.createTracker(r);let u=c.move("[");return u+=c.move(t.safe(t.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(t.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=t.enter("destinationRaw"),u+=c.move(t.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=c.move(" "+s),u+=c.move(t.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),o()),a(),u}function bRn(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function G0(e){return"&#x"+e.toString(16).toUpperCase()+";"}function rb(e,n,t){const r=wh(e),s=wh(n);return r===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}IF.peek=yRn;function IF(e,n,t,r){const s=bRn(t),i=t.enter("emphasis"),a=t.createTracker(r),o=a.move(s);let c=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=c.charCodeAt(0),h=rb(r.before.charCodeAt(r.before.length-1),u,s);h.inside&&(c=G0(u)+c.slice(1));const _=c.charCodeAt(c.length-1),p=rb(r.after.charCodeAt(0),_,s);p.inside&&(c=c.slice(0,-1)+G0(_));const m=a.move(s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},o+c+m}function yRn(e,n,t){return t.options.emphasis||"*"}function xRn(e,n){let t=!1;return M6(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,u5}),!!((!e.depth||e.depth<3)&&$6(e)&&(n.options.setext||t))}function wRn(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),i=t.createTracker(r);if(xRn(e,t)){const h=t.enter("headingSetext"),_=t.enter("phrasing"),p=t.containerPhrasing(e,{...i.current(),before:` +`)),h+=o.move(c),u(),h}function zMn(e,n,t){return(t?"":" ")+e}function iC(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function jMn(e,n,t,r){const s=iC(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("definition");let o=t.enter("label");const c=t.createTracker(r);let u=c.move("[");return u+=c.move(t.safe(t.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(t.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=t.enter("destinationRaw"),u+=c.move(t.safe(e.url,{before:u,after:e.title?" ":` +`,...c.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=c.move(" "+s),u+=c.move(t.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),o()),a(),u}function TMn(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function V0(e){return"&#x"+e.toString(16).toUpperCase()+";"}function sb(e,n,t){const r=kh(e),s=kh(n);return r===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}PF.peek=AMn;function PF(e,n,t,r){const s=TMn(t),i=t.enter("emphasis"),a=t.createTracker(r),o=a.move(s);let c=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=c.charCodeAt(0),h=sb(r.before.charCodeAt(r.before.length-1),u,s);h.inside&&(c=V0(u)+c.slice(1));const _=c.charCodeAt(c.length-1),p=sb(r.after.charCodeAt(0),_,s);p.inside&&(c=c.slice(0,-1)+V0(_));const m=a.move(s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},o+c+m}function AMn(e,n,t){return t.options.emphasis||"*"}function RMn(e,n){let t=!1;return O6(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,f5}),!!((!e.depth||e.depth<3)&&B6(e)&&(n.options.setext||t))}function MMn(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),i=t.createTracker(r);if(RMn(e,t)){const h=t.enter("headingSetext"),_=t.enter("phrasing"),p=t.containerPhrasing(e,{...i.current(),before:` `,after:` `});return _(),h(),p+` `+(s===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` `))+1))}const a="#".repeat(s),o=t.enter("headingAtx"),c=t.enter("phrasing");i.move(a+" ");let u=t.containerPhrasing(e,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(u)&&(u=G0(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,t.options.closeAtx&&(u+=" "+a),c(),o(),u}$F.peek=kRn;function $F(e){return e.value||""}function kRn(){return"<"}BF.peek=SRn;function BF(e,n,t,r){const s=sC(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("image");let o=t.enter("label");const c=t.createTracker(r);let u=c.move("![");return u+=c.move(t.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(t.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=t.enter("destinationRaw"),u+=c.move(t.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=c.move(" "+s),u+=c.move(t.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),o()),u+=c.move(")"),a(),u}function SRn(){return"!"}PF.peek=CRn;function PF(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let c=o.move("![");const u=t.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const h=t.stack;t.stack=[],a=t.enter("reference");const _=t.safe(t.associationId(e),{before:c,after:"]",...o.current()});return a(),t.stack=h,i(),s==="full"||!u||u!==_?c+=o.move(_+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function CRn(){return"!"}FF.peek=ERn;function FF(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}qF.peek=NRn;function qF(e,n,t,r){const s=sC(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,c;if(HF(e,t)){const h=t.stack;t.stack=[],o=t.enter("autolink");let _=a.move("<");return _+=a.move(t.containerPhrasing(e,{before:_,after:">",...a.current()})),_+=a.move(">"),o(),t.stack=h,_}o=t.enter("link"),c=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),c()),u+=a.move(")"),o(),u}function NRn(e,n,t){return HF(e,t)?"<":"["}UF.peek=zRn;function UF(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let c=o.move("[");const u=t.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const h=t.stack;t.stack=[],a=t.enter("reference");const _=t.safe(t.associationId(e),{before:c,after:"]",...o.current()});return a(),t.stack=h,i(),s==="full"||!u||u!==_?c+=o.move(_+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function zRn(){return"["}function iC(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function jRn(e){const n=iC(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function TRn(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function GF(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function ARn(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?TRn(t):iC(t);const o=e.ordered?a==="."?")":".":jRn(t);let c=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(c=!0),GF(t)===a&&h){let _=-1;for(;++_-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const c=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),h);return c(),u;function h(_,p,m){return p?(m?"":" ".repeat(a))+_:(m?i:i+" ".repeat(a-i.length))+_}}function ORn(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const DRn=Mm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function LRn(e,n,t,r){return(e.children.some(function(a){return DRn(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function IRn(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}VF.peek=$Rn;function VF(e,n,t,r){const s=IRn(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let c=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=c.charCodeAt(0),h=rb(r.before.charCodeAt(r.before.length-1),u,s);h.inside&&(c=G0(u)+c.slice(1));const _=c.charCodeAt(c.length-1),p=rb(r.after.charCodeAt(0),_,s);p.inside&&(c=c.slice(0,-1)+G0(_));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},o+c+m}function $Rn(e,n,t){return t.options.strong||"*"}function BRn(e,n,t,r){return t.safe(e.value,r)}function PRn(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function FRn(e,n,t){const r=(GF(t)+(t.options.ruleSpaces?" ":"")).repeat(PRn(t));return t.options.ruleSpaces?r.slice(0,-1):r}const KF={blockquote:_Rn,break:tR,code:mRn,definition:vRn,emphasis:IF,hardBreak:tR,heading:wRn,html:$F,image:BF,imageReference:PF,inlineCode:FF,link:qF,linkReference:UF,list:ARn,listItem:MRn,paragraph:ORn,root:LRn,strong:VF,text:BRn,thematicBreak:FRn};function HRn(){return{enter:{table:qRn,tableData:nR,tableHeader:nR,tableRow:GRn},exit:{codeText:VRn,table:URn,tableData:n4,tableHeader:n4,tableRow:n4}}}function qRn(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function URn(e){this.exit(e),this.data.inTable=void 0}function GRn(e){this.enter({type:"tableRow",children:[]},e)}function n4(e){this.exit(e)}function nR(e){this.enter({type:"tableCell",children:[]},e)}function VRn(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,KRn));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function KRn(e,n){return n==="|"?n:e}function WRn(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";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:p,table:a,tableCell:c,tableRow:o}};function a(m,x,k,v){return u(h(m,k,v),m.align)}function o(m,x,k,v){const b=_(m,k,v),w=u([b]);return w.slice(0,w.indexOf(` -`))}function c(m,x,k,v){const b=k.enter("tableCell"),w=k.enter("phrasing"),y=k.containerPhrasing(m,{...v,before:i,after:i});return w(),b(),y}function u(m,x){return lRn(m,{align:x,alignDelimiters:r,padding:t,stringLength:s})}function h(m,x,k){const v=m.children;let b=-1;const w=[],y=x.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const fMn={tokenize:yMn,partial:!0};function dMn(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:gMn,continuation:{tokenize:vMn},exit:bMn}},text:{91:{name:"gfmFootnoteCall",tokenize:mMn},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hMn,resolveTo:pMn}}}}function hMn(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!a||!a._balanced)return t(c);const u=ao(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function pMn(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function mMn(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(_){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(_),e.exit("gfmFootnoteCallLabelMarker"),c}function c(_){return _!==94?t(_):(e.enter("gfmFootnoteCallMarker"),e.consume(_),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(_){if(i>999||_===93&&!a||_===null||_===91||ur(_))return t(_);if(_===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(ao(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(_),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(_)}return ur(_)||(a=!0),i++,e.consume(_),_===92?h:u}function h(_){return _===91||_===92||_===93?(e.consume(_),i++,u):u(_)}}function gMn(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return c;function c(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):t(x)}function h(x){if(a>999||x===93&&!o||x===null||x===91||ur(x))return t(x);if(x===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return i=ao(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return ur(x)||(o=!0),a++,e.consume(x),x===92?_:h}function _(x){return x===91||x===92||x===93?(e.consume(x),a++,h):h(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),_n(e,m,"gfmFootnoteDefinitionWhitespace")):t(x)}function m(x){return n(x)}}function vMn(e,n,t){return e.check(Dm,n,e.attempt(fMn,n,t))}function bMn(e){e.exit("gfmFootnoteDefinition")}function yMn(e,n,t){const r=this;return _n(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function xMn(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let c=-1;for(;++c1?c(x):(a.consume(x),_++,m);if(_<2&&!t)return c(x);const v=a.exit("strikethroughSequenceTemporary"),b=wh(x);return v._open=!b||b===2&&!!k,v._close=!k||k===2&&!!b,o(x)}}}class wMn{constructor(){this.map=[]}add(n,t,r){kMn(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function kMn(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const H=r.events[I][1].type;if(H==="lineEnding"||H==="linePrefix")I--;else break}const $=I>-1?r.events[I][1].type:null,q=$==="tableHead"||$==="tableRow"?z:c;return q===z&&r.parser.lazy[r.now().line]?t(D):q(D)}function c(D){return e.enter("tableHead"),e.enter("tableRow"),u(D)}function u(D){return D===124||(a=!0,i+=1),h(D)}function h(D){return D===null?t(D):Tt(D)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),m):t(D):yn(D)?_n(e,h,"whitespace")(D):(i+=1,a&&(a=!1,s+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),a=!0,h):(e.enter("data"),_(D)))}function _(D){return D===null||D===124||ur(D)?(e.exit("data"),h(D)):(e.consume(D),D===92?p:_)}function p(D){return D===92||D===124?(e.consume(D),_):_(D)}function m(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(D):(e.enter("tableDelimiterRow"),a=!1,yn(D)?_n(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):x(D))}function x(D){return D===45||D===58?v(D):D===124?(a=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),k):N(D)}function k(D){return yn(D)?_n(e,v,"whitespace")(D):v(D)}function v(D){return D===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),b):D===45?(i+=1,b(D)):D===null||Tt(D)?C(D):N(D)}function b(D){return D===45?(e.enter("tableDelimiterFiller"),w(D)):N(D)}function w(D){return D===45?(e.consume(D),w):D===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(D))}function y(D){return yn(D)?_n(e,C,"whitespace")(D):C(D)}function C(D){return D===124?x(D):D===null||Tt(D)?!a||s!==i?N(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(D)):N(D)}function N(D){return t(D)}function z(D){return e.enter("tableRow"),T(D)}function T(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),T):D===null||Tt(D)?(e.exit("tableRow"),n(D)):yn(D)?_n(e,T,"whitespace")(D):(e.enter("data"),j(D))}function j(D){return D===null||D===124||ur(D)?(e.exit("data"),T(D)):(e.consume(D),D===92?M:j)}function M(D){return D===92||D===124?(e.consume(D),j):j(D)}}function NMn(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,u,h,_;const p=new wMn;for(;++tt[2]+1){const x=t[2]+1,k=t[3]-t[2]-1;e.add(x,k,[])}}e.add(t[3]+1,0,[["exit",_,n]])}return s!==void 0&&(i.end=Object.assign({},Ed(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function sR(e,n,t,r,s){const i=[],a=Ed(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function Ed(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const zMn={name:"tasklistCheck",tokenize:TMn};function jMn(){return{text:{91:zMn}}}function TMn(e,n,t){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return ur(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):t(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(c)}function o(c){return Tt(c)?n(c):yn(c)?e.check({tokenize:AMn},n,t)(c):t(c)}}function AMn(e,n,t){return _n(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function RMn(e){return uP([rMn(),dMn(),xMn(e),CMn(),jMn()])}const MMn={};function nH(e){const n=this,t=e||MMn,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(RMn(t)),i.push(JRn()),a.push(eMn(t))}function OMn(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(c){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},c)}function n(){this.buffer()}function t(){const c=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=u;const _=h.data.hChildren[0];_.type,_.tagName,_.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function a(c){const u=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=u,h.data.hChildren.push({type:"text",value:u})}function o(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function DMn(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:n?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:r}};function t(i,a,o,c){const u=i.value||"",h=o.createTracker(c),_="$".repeat(Math.max(LF(u,"$")+1,2)),p=o.enter("mathFlow");let m=h.move(_);if(i.meta){const x=o.enter("mathFlowMeta");m+=h.move(o.safe(i.meta,{after:` -`,before:m,encode:["$"],...h.current()})),x()}return m+=h.move(` +`,...i.current()});return/^[\t ]/.test(u)&&(u=V0(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,t.options.closeAtx&&(u+=" "+a),c(),o(),u}FF.peek=OMn;function FF(e){return e.value||""}function OMn(){return"<"}HF.peek=DMn;function HF(e,n,t,r){const s=iC(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("image");let o=t.enter("label");const c=t.createTracker(r);let u=c.move("![");return u+=c.move(t.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(t.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=t.enter("destinationRaw"),u+=c.move(t.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=c.move(" "+s),u+=c.move(t.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),o()),u+=c.move(")"),a(),u}function DMn(){return"!"}qF.peek=LMn;function qF(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let c=o.move("![");const u=t.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const h=t.stack;t.stack=[],a=t.enter("reference");const _=t.safe(t.associationId(e),{before:c,after:"]",...o.current()});return a(),t.stack=h,i(),s==="full"||!u||u!==_?c+=o.move(_+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function LMn(){return"!"}UF.peek=IMn;function UF(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}VF.peek=$Mn;function VF(e,n,t,r){const s=iC(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,c;if(GF(e,t)){const h=t.stack;t.stack=[],o=t.enter("autolink");let _=a.move("<");return _+=a.move(t.containerPhrasing(e,{before:_,after:">",...a.current()})),_+=a.move(">"),o(),t.stack=h,_}o=t.enter("link"),c=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),c()),u+=a.move(")"),o(),u}function $Mn(e,n,t){return GF(e,t)?"<":"["}KF.peek=BMn;function KF(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let c=o.move("[");const u=t.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const h=t.stack;t.stack=[],a=t.enter("reference");const _=t.safe(t.associationId(e),{before:c,after:"]",...o.current()});return a(),t.stack=h,i(),s==="full"||!u||u!==_?c+=o.move(_+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function BMn(){return"["}function aC(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function PMn(e){const n=aC(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function FMn(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function WF(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function HMn(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?FMn(t):aC(t);const o=e.ordered?a==="."?")":".":PMn(t);let c=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(c=!0),WF(t)===a&&h){let _=-1;for(;++_-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const c=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),h);return c(),u;function h(_,p,m){return p?(m?"":" ".repeat(a))+_:(m?i:i+" ".repeat(a-i.length))+_}}function GMn(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const VMn=Om(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function KMn(e,n,t,r){return(e.children.some(function(a){return VMn(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function WMn(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}QF.peek=QMn;function QF(e,n,t,r){const s=WMn(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let c=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=c.charCodeAt(0),h=sb(r.before.charCodeAt(r.before.length-1),u,s);h.inside&&(c=V0(u)+c.slice(1));const _=c.charCodeAt(c.length-1),p=sb(r.after.charCodeAt(0),_,s);p.inside&&(c=c.slice(0,-1)+V0(_));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},o+c+m}function QMn(e,n,t){return t.options.strong||"*"}function XMn(e,n,t,r){return t.safe(e.value,r)}function YMn(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function ZMn(e,n,t){const r=(WF(t)+(t.options.ruleSpaces?" ":"")).repeat(YMn(t));return t.options.ruleSpaces?r.slice(0,-1):r}const XF={blockquote:wMn,break:rR,code:NMn,definition:jMn,emphasis:PF,hardBreak:rR,heading:MMn,html:FF,image:HF,imageReference:qF,inlineCode:UF,link:VF,linkReference:KF,list:HMn,listItem:UMn,paragraph:GMn,root:KMn,strong:QF,text:XMn,thematicBreak:ZMn};function JMn(){return{enter:{table:eOn,tableData:sR,tableHeader:sR,tableRow:nOn},exit:{codeText:rOn,table:tOn,tableData:s4,tableHeader:s4,tableRow:s4}}}function eOn(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function tOn(e){this.exit(e),this.data.inTable=void 0}function nOn(e){this.enter({type:"tableRow",children:[]},e)}function s4(e){this.exit(e)}function sR(e){this.enter({type:"tableCell",children:[]},e)}function rOn(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,sOn));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function sOn(e,n){return n==="|"?n:e}function iOn(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";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:p,table:a,tableCell:c,tableRow:o}};function a(m,w,k,v){return u(h(m,k,v),m.align)}function o(m,w,k,v){const b=_(m,k,v),x=u([b]);return x.slice(0,x.indexOf(` +`))}function c(m,w,k,v){const b=k.enter("tableCell"),x=k.enter("phrasing"),y=k.containerPhrasing(m,{...v,before:i,after:i});return x(),b(),y}function u(m,w){return yMn(m,{align:w,alignDelimiters:r,padding:t,stringLength:s})}function h(m,w,k){const v=m.children;let b=-1;const x=[],y=w.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const kOn={tokenize:AOn,partial:!0};function SOn(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:zOn,continuation:{tokenize:jOn},exit:TOn}},text:{91:{name:"gfmFootnoteCall",tokenize:NOn},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:COn,resolveTo:EOn}}}}function COn(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!a||!a._balanced)return t(c);const u=yo(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function EOn(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function NOn(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(_){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(_),e.exit("gfmFootnoteCallLabelMarker"),c}function c(_){return _!==94?t(_):(e.enter("gfmFootnoteCallMarker"),e.consume(_),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(_){if(i>999||_===93&&!a||_===null||_===91||fr(_))return t(_);if(_===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(yo(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(_),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(_)}return fr(_)||(a=!0),i++,e.consume(_),_===92?h:u}function h(_){return _===91||_===92||_===93?(e.consume(_),i++,u):u(_)}}function zOn(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return c;function c(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):t(w)}function h(w){if(a>999||w===93&&!o||w===null||w===91||fr(w))return t(w);if(w===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return i=yo(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return fr(w)||(o=!0),a++,e.consume(w),w===92?_:h}function _(w){return w===91||w===92||w===93?(e.consume(w),a++,h):h(w)}function p(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(i)||s.push(i),yn(e,m,"gfmFootnoteDefinitionWhitespace")):t(w)}function m(w){return n(w)}}function jOn(e,n,t){return e.check(Lm,n,e.attempt(kOn,n,t))}function TOn(e){e.exit("gfmFootnoteDefinition")}function AOn(e,n,t){const r=this;return yn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function ROn(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let c=-1;for(;++c1?c(w):(a.consume(w),_++,m);if(_<2&&!t)return c(w);const v=a.exit("strikethroughSequenceTemporary"),b=kh(w);return v._open=!b||b===2&&!!k,v._close=!k||k===2&&!!b,o(w)}}}class MOn{constructor(){this.map=[]}add(n,t,r){OOn(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function OOn(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const H=r.events[I][1].type;if(H==="lineEnding"||H==="linePrefix")I--;else break}const $=I>-1?r.events[I][1].type:null,q=$==="tableHead"||$==="tableRow"?E:c;return q===E&&r.parser.lazy[r.now().line]?t(D):q(D)}function c(D){return e.enter("tableHead"),e.enter("tableRow"),u(D)}function u(D){return D===124||(a=!0,i+=1),h(D)}function h(D){return D===null?t(D):Rt(D)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),m):t(D):Cn(D)?yn(e,h,"whitespace")(D):(i+=1,a&&(a=!1,s+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),a=!0,h):(e.enter("data"),_(D)))}function _(D){return D===null||D===124||fr(D)?(e.exit("data"),h(D)):(e.consume(D),D===92?p:_)}function p(D){return D===92||D===124?(e.consume(D),_):_(D)}function m(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(D):(e.enter("tableDelimiterRow"),a=!1,Cn(D)?yn(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):w(D))}function w(D){return D===45||D===58?v(D):D===124?(a=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),k):z(D)}function k(D){return Cn(D)?yn(e,v,"whitespace")(D):v(D)}function v(D){return D===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),b):D===45?(i+=1,b(D)):D===null||Rt(D)?C(D):z(D)}function b(D){return D===45?(e.enter("tableDelimiterFiller"),x(D)):z(D)}function x(D){return D===45?(e.consume(D),x):D===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(D))}function y(D){return Cn(D)?yn(e,C,"whitespace")(D):C(D)}function C(D){return D===124?w(D):D===null||Rt(D)?!a||s!==i?z(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(D)):z(D)}function z(D){return t(D)}function E(D){return e.enter("tableRow"),T(D)}function T(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),T):D===null||Rt(D)?(e.exit("tableRow"),n(D)):Cn(D)?yn(e,T,"whitespace")(D):(e.enter("data"),j(D))}function j(D){return D===null||D===124||fr(D)?(e.exit("data"),T(D)):(e.consume(D),D===92?M:j)}function M(D){return D===92||D===124?(e.consume(D),j):j(D)}}function $On(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,u,h,_;const p=new MOn;for(;++tt[2]+1){const w=t[2]+1,k=t[3]-t[2]-1;e.add(w,k,[])}}e.add(t[3]+1,0,[["exit",_,n]])}return s!==void 0&&(i.end=Object.assign({},Nd(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function aR(e,n,t,r,s){const i=[],a=Nd(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function Nd(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const BOn={name:"tasklistCheck",tokenize:FOn};function POn(){return{text:{91:BOn}}}function FOn(e,n,t){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return fr(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):t(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(c)}function o(c){return Rt(c)?n(c):Cn(c)?e.check({tokenize:HOn},n,t)(c):t(c)}}function HOn(e,n,t){return yn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function qOn(e){return dP([hOn(),SOn(),ROn(e),LOn(),POn()])}const UOn={};function iH(e){const n=this,t=e||UOn,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(qOn(t)),i.push(uOn()),a.push(_On(t))}function GOn(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(c){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},c)}function n(){this.buffer()}function t(){const c=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=u;const _=h.data.hChildren[0];_.type,_.tagName,_.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function a(c){const u=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=u,h.data.hChildren.push({type:"text",value:u})}function o(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function VOn(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`,inConstruct:"mathFlowMeta"},{character:"$",after:n?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:r}};function t(i,a,o,c){const u=i.value||"",h=o.createTracker(c),_="$".repeat(Math.max(BF(u,"$")+1,2)),p=o.enter("mathFlow");let m=h.move(_);if(i.meta){const w=o.enter("mathFlowMeta");m+=h.move(o.safe(i.meta,{after:` +`,before:m,encode:["$"],...h.current()})),w()}return m+=h.move(` `),u&&(m+=h.move(u+` -`)),m+=h.move(_),p(),m}function r(i,a,o){let c=i.value||"",u=1;for(n||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(c);)u++;const h="$".repeat(u);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let _=-1;for(;++_=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function B5(e){var a;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(o){r+=o[0].length,s+=1;continue}const c=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!c)break;r+=c[0].length,t+=c[0].length,n=!0}const i=((a=/^[ \t]*/.exec(e.slice(r)))==null?void 0:a[0].length)??0;return{hasListMarker:n,indentation:i,listIndent:t,offset:r+i,quoteDepth:s}}function VMn(e,n){const t=e[n];if(t!=="`"&&t!=="~"||V0(e,n)||Eh(e,n,t)<3)return!1;const r=e.lastIndexOf(` +`)),m+=h.move(_),p(),m}function r(i,a,o){let c=i.value||"",u=1;for(n||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(c);)u++;const h="$".repeat(u);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let _=-1;for(;++_=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function F5(e){var a;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(o){r+=o[0].length,s+=1;continue}const c=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!c)break;r+=c[0].length,t+=c[0].length,n=!0}const i=((a=/^[ \t]*/.exec(e.slice(r)))==null?void 0:a[0].length)??0;return{hasListMarker:n,indentation:i,listIndent:t,offset:r+i,quoteDepth:s}}function rDn(e,n){const t=e[n];if(t!=="`"&&t!=="~"||K0(e,n)||Nh(e,n,t)<3)return!1;const r=e.lastIndexOf(` `,n-1)+1,s=e.indexOf(` -`,n),i=e.slice(r,s===-1?e.length:s),a=B5(i);return a.indentation<=3&&r+a.offset===n}function KMn(e,n){const t=e[n],r=Eh(e,n,t),s=e.lastIndexOf(` +`,n),i=e.slice(r,s===-1?e.length:s),a=F5(i);return a.indentation<=3&&r+a.offset===n}function sDn(e,n){const t=e[n],r=Nh(e,n,t),s=e.lastIndexOf(` `,n-1)+1,i=e.indexOf(` -`,n),a=B5(e.slice(s,i===-1?e.length:i));let o=e.indexOf(` +`,n),a=F5(e.slice(s,i===-1?e.length:i));let o=e.indexOf(` `,n+r);if(o===-1)return e.length;for(o+=1;o=a.listIndent&&_.indentation<=a.listIndent+3&&m>=r&&/^[ \t\r]*$/.test(e.slice(p+m,u)))return c===-1?e.length:c+1;if(c===-1)return e.length;o=c+1}return e.length}function WMn(e,n,t){const r=Eh(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function XMn(e){const n=[];for(let t=0;t|()[\]-]+$/.test(t)?/^[eE][+-]?\d+$/.test(t)||/[+*/=^_{}\\<>|()]/.test(t)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(t):!1:!0}function ZMn(e,{predictMath:n=!1}={}){const t=XMn(e),r=new Set,s=new Set;for(let u=0;u=a.listIndent&&_.indentation<=a.listIndent+3&&m>=r&&/^[ \t\r]*$/.test(e.slice(p+m,u)))return c===-1?e.length:c+1;if(c===-1)return e.length;o=c+1}return e.length}function iDn(e,n,t){const r=Nh(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function oDn(e){const n=[];for(let t=0;t|()[\]-]+$/.test(t)?/^[eE][+-]?\d+$/.test(t)||/[+*/=^_{}\\<>|()]/.test(t)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(t):!1:!0}function lDn(e,{predictMath:n=!1}={}){const t=oDn(e),r=new Set,s=new Set;for(let u=0;u`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),ZMn(t,n)}function iH(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function tOn(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Ur(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=tOn(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const aH=A.createContext(void 0);function oH({projectId:e,sessionId:n,children:t}){const r=A.useMemo(()=>(s,i=!1)=>{if(/^(https?:)?\/\//i.test(s))return s;const a=DB(s);return a?(a.source==="absolute"?HL(a.path):a.source==="artifact"&&!i?X_(e,a.path):y3(e,a.source==="artifact"?`artifacts/${a.path}`:a.path,{sessionId:n??void 0}))+a.hash:null},[e,n]);return f.jsx(aH,{value:r,children:t})}function nOn({src:e,alt:n,name:t,onClose:r}){const s=A.useRef(null),i=A.useRef(null),[a,o]=A.useState(1),[c,u]=A.useState({width:0,height:0}),[h,_]=A.useState({width:0,height:0});A.useEffect(()=>{const m=s.current;m==null||m.showModal(),m==null||m.focus();const x=i.current,k=new ResizeObserver(([v])=>{u({width:v.contentRect.width,height:v.contentRect.height})});return x&&k.observe(x),()=>{k.disconnect(),m==null||m.close()}},[]);const p=h.width&&c.width?Math.min(1,c.width*.9/h.width,c.height*.9/h.height):1;return Mi.createPortal(f.jsxs("dialog",{ref:s,tabIndex:-1,"aria-label":n||zD(),onCancel:m=>{m.preventDefault(),r()},className:"fixed inset-0 m-0 max-w-none max-h-none w-full h-dvh border-0 outline-none bg-transparent p-0 text-text backdrop:bg-image-backdrop",onClick:m=>{m.stopPropagation(),m.target===m.currentTarget&&r()},children:[f.jsx("div",{ref:i,className:"absolute inset-x-4 sm:inset-x-12 top-16 bottom-32 overflow-auto overscroll-contain",onClick:m=>{m.target===m.currentTarget&&r()},children:f.jsx("div",{className:"flex min-h-full min-w-full w-max pointer-events-none",children:f.jsx("img",{src:e,alt:n,onLoad:m=>_({width:m.currentTarget.naturalWidth,height:m.currentTarget.naturalHeight}),style:h.width?{width:h.width*p*a,height:h.height*p*a}:void 0,className:`pointer-events-auto block m-auto shrink-0 max-w-none rounded-lg shadow-modal ${h.width&&c.width?"visible":"invisible"}`})})}),f.jsxs("div",{className:"absolute top-5 right-5 flex gap-2",children:[f.jsx(Lh,{shape:"circle",href:e,download:t||!0,"aria-label":l3(),title:l3(),className:"bg-background shadow-popover",children:f.jsx(Db,{size:16})}),f.jsx($t,{shape:"circle",onClick:r,"aria-label":v3(),title:v3(),className:"bg-background shadow-popover",children:f.jsx(lr,{size:16})})]}),f.jsxs("div",{className:"absolute bottom-6 inset-x-6 flex flex-col items-center gap-3 pointer-events-none",children:[n&&f.jsx("div",{className:"max-w-xl line-clamp-2 rounded-xl bg-background px-4 py-2 text-center text-sm leading-snug shadow-popover",children:n}),f.jsxs("div",{className:"pointer-events-auto flex items-center gap-1 rounded-full bg-background p-1.5 shadow-popover",children:[f.jsx($t,{shape:"circle",disabled:a<=.25,onClick:()=>o(m=>Math.max(.25,m-.25)),"aria-label":WN(),title:WN(),children:f.jsx(u3n,{size:16})}),f.jsxs(De,{variant:"ghost",className:"min-w-16 tabular-nums",onClick:()=>o(1),title:QN(),"aria-label":QN(),children:[Math.round(a*100),"%"]}),f.jsx($t,{shape:"circle",disabled:a>=4,onClick:()=>o(m=>Math.min(4,m+.25)),"aria-label":KN(),title:KN(),children:f.jsx(Ih,{size:16})})]})]})]}),document.body)}function rOn({src:e,fallbackSrc:n,downloadName:t,alt:r="",...s}){const[i,a]=A.useState(!1),[o,c]=A.useState(!1),u=i&&n?n:e;return f.jsxs(f.Fragment,{children:[f.jsx("img",{...s,src:u,alt:r,role:"button",tabIndex:0,"aria-haspopup":"dialog",onClick:h=>{h.preventDefault(),h.stopPropagation(),c(!0)},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),h.stopPropagation(),c(!0))},onError:!i&&n&&n!==e?()=>a(!0):void 0}),o&&u&&f.jsx(nOn,{src:u,alt:r,name:t,onClose:()=>c(!1)})]})}const sOn=1e5;function iOn({code:e,lang:n}){const[t,r]=A.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx($t,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:Qk(),"aria-label":Jet(),onClick:s,children:t?f.jsx(Ri,{size:13}):f.jsx(gf,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:tSn(e,n,sOn)})})]})}function aOn(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function cR(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),c=aOn(a[2]??"");if(!c[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:s4(e,s,a.index)});const h=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:c},position:s4(e,a.index,h),type:o==="run"?"runMention":"fileMention"}),s=h}return i?(scH(e)}function cOn(){return e=>{const n=t=>{var r;for(const s of["href","src"])if(t.properties&&Object.hasOwn(t.properties,s)){const i=String(t.properties[s]||"");t.properties[s]=s==="src"&&t.tagName==="img"&&C6(i)?i:zP(i)}(r=t.children)==null||r.forEach(n)};n(e)}}function uR({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?VY({path:Ne(e)}):e,...Ur(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(PI,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(KI,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function lOn({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?bZ({id:Ne(e)}):yJ({id:Ne(e)}),...Ur(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(bS,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||DL()}),f.jsx(KI,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const lH={singleDollarTextMath:!0},uOn=dy().use(py).use(nH).use(rH,lH).use(GMn).use(oOn).use(Xv).use(cOn).use(AF);function _On(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const uH={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` -`)))return f.jsx("code",{className:s,...r,children:t});const c=i?U3(i[1]):null;return f.jsx(iOn,{code:a,lang:c})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})};function fOn({children:e}){return f.jsx("figure",{className:"my-6 mx-auto max-w-full text-left [&_img]:mx-auto [&_img]:my-0 [&_img]:w-auto [&_img]:h-auto [&_img]:max-h-[min(480px,60vh)] [&_img]:object-contain [&_img]:border-0 [&_img]:rounded-none",children:e})}const Jo=A.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){pf();const o=A.useContext(aH),c=i??o,u=A.useMemo(()=>({"file-mention":h=>f.jsx(uR,{path:h.path,lines:h.lines,exp:h.exp,onOpenFile:t}),"run-mention":h=>f.jsx(lOn,{id:h.id,label:h.label,onOpenRun:r}),a:({node:h,href:_,children:p,"data-figure-src":m,...x})=>{const k=typeof m=="string"?DB(m):null;if(k&&t){const v=k.source==="artifact"?`artifacts/${k.path}`:k.path,b=s?s(v):v;if(b)return f.jsx("button",{type:"button",className:"text-primary underline cursor-pointer text-start",...Ur(w=>t(b,void 0,void 0,void 0,w)),children:p})}if(_&&_On(_)&&t){let v;try{v=decodeURI(_)}catch{return f.jsx("span",{children:p})}const b=s?s(v):v;return b?f.jsx(uR,{path:b,onOpenFile:t}):f.jsx("span",{children:p})}return f.jsx("a",{href:_,target:"_blank",rel:"noopener noreferrer",...x,children:p})},figure:({children:h})=>f.jsx(fOn,{children:h}),figcaption:({children:h})=>f.jsx("figcaption",{className:"mt-3 text-sm italic leading-relaxed text-text",children:h}),th:({node:h,..._})=>f.jsx("th",{dir:"auto",..._}),td:({node:h,..._})=>f.jsx("td",{dir:"auto",..._}),img:({node:h,src:_,alt:p,className:m,...x})=>{var v;if(!_||typeof _!="string")return null;const k=c?c(_):_;return k?A.createElement(rOn,{...x,key:k,downloadName:(v=_.split(/[\\/]/).pop())==null?void 0:v.split(/[?#]/)[0],src:k,fallbackSrc:i?null:o==null?void 0:o(_,!0),alt:p??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border cursor-zoom-in focus-visible:outline-2 focus-visible:outline-primary ${m??""}`}):null},...uH}),[t,r,s,i,o,c]);return f.jsx("div",{dir:"auto","data-streaming":a||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-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_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-prose-emphasis [&_.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-sm [&_.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-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_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-start [&_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-start [&_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]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-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:f.jsx(Xzn,{content:iH(n,{predictMath:a}),processor:uOn,components:u,predict:a})})}),_R="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function dOn({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,c]=A.useState(!1),u=A.useRef(null),[h,_]=A.useState(!1),[p,m]=A.useState(""),x=A.useRef(null);A.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&c(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),A.useEffect(()=>{var v;h&&((v=x.current)==null||v.focus())},[h]);const k=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),_(!1)};return f.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-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(bS,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?xxt({agent:Ne(n)}):hxt({agent:Ne(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Ur(t),children:Fxt()})]}),h?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:p2t(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),_(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),k())}}),f.jsxs("div",{className:_R,children:[f.jsx(De,{size:"small",onClick:()=>{m(""),_(!1)},children:sL()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(De,{size:"small",variant:"primary",onClick:k,children:[t2t(),f.jsx(BI,{size:13})]})]})]}):f.jsxs("div",{className:_R,children:[f.jsx(De,{size:"small",onClick:i,children:Wxt()}),f.jsx(De,{size:"small",onClick:()=>_(!0),children:c2t()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(De,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:Kyt()}),f.jsx(De,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":Oxt(),onClick:()=>c(v=>!v),children:f.jsx(rc,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(Jn,{onClick:()=>{c(!1),r("bypassPermissions")},children:ext()})})]}):f.jsx(De,{size:"small",variant:"primary",onClick:()=>r(),children:oxt()})]})]})}function fR({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=A.useState(""),[o,c]=A.useState(!1),[u,h]=A.useState(null);async function _(p){if(p.preventDefault(),!(o||!i.trim())){c(!0),h(null);try{n(await e(i.trim())),a("")}catch(m){h(m instanceof Error?m.message:String(m))}finally{c(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:_,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(De,{type:"submit",disabled:o||!i.trim(),children:o?oa():nc()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??gKe()}),u&&f.jsx("div",{className:"error",children:u})]})}function _H({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}function hOn({settings:e}){const[n,t]=A.useState(!1);return f.jsxs("label",{className:"inline-flex max-w-full flex-wrap items-center gap-2 text-sm text-subtext",children:[Cln(),f.jsx("span",{className:"inline-block w-max max-w-full",children:f.jsx(Yo,{variant:"field",dropDown:!0,value:e.defaultHost??"",disabled:n,choices:[{id:"",label:yL()},...e.defaultHost&&!e.hosts.some(r=>r.host===e.defaultHost)?[{id:e.defaultHost,label:e.defaultHost}]:[],...e.hosts.map(r=>({id:r.host,label:r.host}))],onSelect:r=>{t(!0),Vbn(r||null).catch(s=>{bn(s instanceof Error?s.message:String(s),"error")}).finally(()=>t(!1))}})})]})}function pOn({host:e,connecting:n,reference:t,onChange:r}){const s=A.useId(),i=an({mutationFn:Gbn,scope:{id:`ssh-settings-${e.host}`}});function a(o){r(o),i.reset(),!(o!==null&&!o.trim())&&i.mutate({host:e.host,container:(o==null?void 0:o.trim())??null})}return f.jsxs("details",{className:"pb-3",children:[f.jsx("summary",{className:"w-fit cursor-pointer rounded-sm text-sm text-subtext focus-visible:outline-2 focus-visible:outline-text",children:QD()}),f.jsxs("div",{className:"mt-3 grid max-w-xl gap-3",children:[f.jsxs("label",{className:"text-sm text-subtext",children:[Vln(),f.jsx(Yo,{variant:"field",dropDown:!0,value:t!==null?"container":"host",disabled:n,choices:[{id:"host",label:Rln()},{id:"container",label:Bln()}],onSelect:o=>a(o==="container"?"":null)})]}),t!==null&&f.jsxs("label",{className:"text-sm text-subtext",htmlFor:`${s}-container`,children:[vln(),f.jsx(qr,{id:`${s}-container`,value:t,disabled:n,required:!0,onChange:o=>a(o.target.value)})]}),i.error&&f.jsx("p",{className:"m-0 text-sm text-accent-red",role:"status",children:i.error.message})]})]})}const ec=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.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-base [&_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(" "),nf=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),mOn=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),jy="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Da=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),oC=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.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-start","[&_.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-control-subtle","[&_.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-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.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]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-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-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.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-start [&_.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-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.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-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.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","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),nl=["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","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),P5=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.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-base","[&_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-base [&_.kv_.v]:break-normal","[@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(" "),y0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),md=["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(" "),gOn=new Set(["gh auth login","hf auth login","claude auth status"]);function fH(e){return gOn.has(e)?`/api/settings/commands/run?command=${encodeURIComponent(e)}`:void 0}function Ty(){const[e,n]=A.useState(null);return{run:e,start:(r,s,i)=>n(a=>({command:r,path:s,owner:i,attempt:((a==null?void 0:a.attempt)??0)+1})),clear:()=>n(null)}}function cC({note:e,className:n,disabled:t,resolve:r=fH,onRun:s}){return e?f.jsx("p",{className:n,children:gh(e,{canRun:i=>!t&&r(i)!==void 0,onRun:i=>{const a=r(i);a&&s(i,a)}})}):null}function Ay({run:e,onComplete:n,onClose:t}){return e?f.jsx(_5n,{path:e.path,label:e.command,onComplete:n,onError:r=>bn(r,"error"),onClose:t},`${e.command}-${e.attempt}`):null}function i4(e){return e.catalogPending?{cls:"warn",variant:"warning",label:W_()}:e.agentReady&&!e.authenticated&&e.authMethod!=="local"?{cls:"warn",variant:"warning",label:YD()}:e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?Yk():mXt()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:bFt()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:ZD()}:e.needsConfigRepair||e.authState==="unknown"?{cls:"warn",variant:"warning",label:g3()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:TZt()}:{cls:"warn",variant:"warning",label:xL()}:{cls:"warn",variant:"warning",label:UGt()}}function vOn({h:e}){return e.id==="opencode"&&e.agentReady&&!e.authenticated&&!e.authMethod?f.jsx(f.Fragment,{children:eTt()}):e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:zv()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?oDt():Xk()}):f.jsx(f.Fragment,{children:"—"})}function bOn(e,n,t){if(!n)return;const r=n.installUrl!==void 0&&t.includes(n.installUrl),s=t===n.login?"login":t===n.install?"install":t===n.update?"update":r?"install":null;if(s&&!(s!=="install"&&(!e.installed||e.installBroken)))return`/api/harnesses/setup?${new URLSearchParams({harness:e.id,action:s,shell:"true"})}`}function yOn({remote:e}){const n=ku(),{data:t=null}=ct(n),[r,s]=A.useState(null),[i,a]=A.useState(!1),o=Ty(),[c,u]=A.useState(null),h=ct(rI()),_=(x,k=!1)=>{a(!0),Y_(x,k).catch(()=>{}).finally(()=>a(!1))},p=[...t??[]].sort((x,k)=>Number(k.agentReady)-Number(x.agentReady)),m=p.find(x=>x.id===r)??p[0];return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:m3()}),!e&&c&&h.data&&f.jsx(_$,{harness:c,commands:h.data[c.id],onClose:()=>u(null)}),f.jsx("div",{className:"mt-3 mb-3.5 w-fit max-w-full [&_.option-menu]:w-max",children:f.jsx(Yo,{variant:"field",dropDown:!0,title:m3(),choices:p.map(x=>({id:x.id,label:x.name})),value:(m==null?void 0:m.id)??null,onSelect:x=>{const k=p.find(v=>v.id===x);k&&s(k.id)},renderIcon:x=>{const k=p.find(v=>v.id===x.id);return k&&f.jsx(vh,{harness:k.id})},renderLabel:x=>{const k=p.find(b=>b.id===x.id),v=k&&i4(k);return f.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[x.label,v&&f.jsxs(f.Fragment,{children:[f.jsx("span",{"aria-hidden":"true",className:`size-1.5 shrink-0 rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${v.cls}`}),f.jsx("span",{className:"sr-only",children:v.label})]})]})}})}),t?m?f.jsxs("div",{className:ec,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Gt,{variant:i4(m).variant,children:i4(m).label}),f.jsx("div",{className:"spacer flex-1"}),!e&&!m.catalogPending&&m.installed&&!m.installBroken&&!m.authenticated&&!m.needsConfigRepair&&m.authMethod!=="local"&&m.authMethod!=="apiKey"&&m.authState!=="unsupported"&&f.jsxs(De,{size:"small",onClick:()=>u(m),disabled:!h.data,"aria-haspopup":"dialog",children:[f.jsx(vf,{size:14})," ",HD()]}),f.jsxs(De,{size:"small",onClick:()=>_(!0,!0),disabled:i,children:[f.jsx(Pa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Sm()]})]}),f.jsxs("div",{className:bs(nf,"[&_.v]:text-sm"),children:[f.jsx("span",{className:"k",children:PLt()}),f.jsx("span",{className:"v",children:m.binPath??OOt()}),f.jsx("span",{className:"k",children:NL()}),f.jsx("span",{className:"v",children:m.version??"—"}),f.jsx("span",{className:"k",children:oLt()}),f.jsx("span",{className:"v",children:f.jsx(vOn,{h:m})}),m.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:m.id==="opencode"?LJt():tS()}),f.jsx("span",{className:"v",children:m.account})]}),m.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:nKt()}),f.jsx("span",{className:"v",children:m.org})]}),m.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:rWt()}),f.jsx("span",{className:"v",children:m.plan})]}),f.jsx("span",{className:"k",children:WDt()}),f.jsx("span",{className:"v",children:m.catalogPending?W_():m.models.length>0?NMt({count:Xt(m.models.length),models:new Intl.ListFormat(E()).format(m.models.slice(0,4).map(x=>Ne(K1(x))))}):eS()})]}),f.jsx(cC,{note:m.agentNote,className:bs(Da,"text-sm"),disabled:e,resolve:x=>{var k;return bOn(m,(k=h.data)==null?void 0:k[m.id],x)??fH(x)},onRun:(x,k)=>o.start(x,k,m.id)}),o.run&&f.jsx("div",{hidden:o.run.owner!==m.id,children:f.jsx(Ay,{run:o.run,onComplete:()=>_(!0,!0),onClose:o.clear})}),m.id==="opencode"&&f.jsx(m$,{installed:m.installed})]}):null:f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",OBt()]})]})}function xOn({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Gt,{variant:"success",children:f$t()}):f.jsx(Gt,{variant:"error",children:UUt()}):f.jsx(Gt,{variant:"error",children:VIt()}):f.jsx(Gt,{variant:"error",children:aHt()})}function wOn({onEditState:e}){var T;const n=an({mutationFn:Lbn}),t=Uz(),r=ct(t),s=r.data??null,i=j=>{Jr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,c]=A.useState(""),[u,h]=A.useState(""),[_,p]=A.useState(!1),[m,x]=A.useState(!1),[k,v]=A.useState(null),b=j=>{i(j),c(j.context??""),h(j.namespace)},w=A.useRef(null);A.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(c(s.context??""),h(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;A.useEffect(()=>{e==null||e({dirty:C,saving:_})},[C,_,e]);async function N(){if(!(m||_||!y)){x(!0);try{await et.fetchQuery({...Uz(),staleTime:0})}catch(j){bn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function z(j){if(j.preventDefault(),!(_||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:Dh()}),f.jsx("dd",{className:"m-0",children:m||_?f.jsx(Gt,{children:ra()}):C?f.jsx(Gt,{children:$D()}):f.jsx(xOn,{s})})]}),y&&!m&&!_&&s.preflight.error&&f.jsx("p",{className:`${jy} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:z,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[b$t(),f.jsx(Yo,{choices:[{id:"",label:s.currentContext?_Rt({context:Ne(s.currentContext)}):sRt()},...o&&!s.contexts.includes(o)?[{id:o,label:FOt({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:_||m,onSelect:c})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[Qqt(),f.jsx(qr,{type:"text",value:u,disabled:_||m,onChange:j=>h(j.target.value),placeholder:oBt(),autoComplete:"off",spellCheck:!1})]}),k&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:k}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(De,{type:"button",onClick:()=>void N(),disabled:_||m||!y,children:[f.jsx(Pa,{size:13})," ",m?ra():wm()]}),f.jsx(De,{variant:"primary",type:"submit",disabled:_||m||y,children:_?oa():nc()})]})]})]}):f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",dIt()]})})}function kOn(){var y;const e=an({mutationFn:C=>$bn(...C)}),n=Gz(),t=ct(n),r=t.data??null,s=C=>{Jr(n.queryKey,N=>(typeof C=="function"?C(N??null):C)??void 0)},[i,a]=A.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[c,u]=A.useState(""),[h,_]=A.useState(""),[p,m]=A.useState(!1),x=t.isPending||p,[k,v]=A.useState(!1);async function b(){if(!(x||k)){m(!0),a(null);try{await et.fetchQuery({...Gz(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!c.trim()||!h.trim()||x||k||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([c.trim(),h.trim()])),u(""),_("")}catch(N){a(N instanceof Error?N.message:String(N))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",yIt()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Dh()}),f.jsx("dd",{className:"m-0",children:f.jsx(Gt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?rS():Tb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:BRt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?VRt():dMt(),f.jsx(qr,{type:"password",value:c,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?JRt():yMt(),f.jsx(qr,{type:"password",value:h,onChange:C=>_(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:aMt()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(De,{type:"button",disabled:x||k,onClick:()=>void b(),children:[f.jsx(Pa,{size:13})," ",Sm()]}),f.jsx(De,{variant:"primary",type:"submit",disabled:!c.trim()||!h.trim()||x||k||(r==null?void 0:r.processEnv),children:k?oa():nc()})]})]})]})}const dH="rounded-sm border-border-strong bg-surface text-subtext",hH="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",SOn=5e3;function pH(e){const n=Ia(),t=e.map(a=>Vz(a)),r=tK({queries:t.map(a=>({...a,refetchInterval:SOn}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Dn(n)&&Jr(Vz(a).queryKey,{running:!0})}]}function COn({test:e,connecting:n,masterRunning:t,containerFailed:r=!1}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Gt,{className:hH,children:uL()})});if(e===void 0)return f.jsx(Gt,{className:dH,children:bL()});const s=e.missingTools??[],i=e.reachable&&e.toolsFound&&t===!1,a=!e.reachable||r?f.jsx(Gt,{className:"rounded-sm",variant:"error",children:nS()}):e.toolsFound?i?f.jsx(Gt,{className:"rounded-sm",variant:"warning",children:_L()}):f.jsx(Gt,{className:"rounded-sm",variant:"success",children:km()}):f.jsx(Gt,{className:"rounded-sm",variant:"error",children:s.length===1?OMt({tool:Ne(s[0])}):FMt()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[a,!i&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:co(e.testedAt)})]})}function EOn({remote:e=!1}){var I;const n=nI(),t=ct(n),r=((I=t.data)==null?void 0:I.hosts)??(t.isError?[]:null),[s,i]=A.useState(!1),[a,o]=A.useState({}),[c,u]=A.useState({}),h=A.useRef(0),[_,p]=A.useState(!1),[m,x]=A.useState({}),[k,v]=A.useState(null),[b,w]=A.useState(!1),[y,C]=A.useState(0),N=e?[]:(r==null?void 0:r.filter($=>{const q=a[$.host]??$.lastTest;return(q==null?void 0:q.reachable)&&q.toolsFound}).map($=>$.host))??[],[z,T]=pH(N);function j($){h.current+=1,p(!1),w(!1),C(q=>q+1),v($),x(q=>({...q,[$]:!0}))}function M(){h.current+=1,p(!1),w(!1),v(null)}function D($,q){x(H=>({...H,[$]:!q}))}return f.jsxs(f.Fragment,{children:[t.error&&f.jsx("p",{className:"text-sm text-accent-red",children:t.error.message}),f.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3",children:[!e&&t.data&&f.jsx(hOn,{settings:t.data}),f.jsxs(De,{variant:"ghost",className:"ms-auto",onClick:()=>i(!0),children:[f.jsx(yS,{size:14})," ",ML()]})]}),r===null?f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",kL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:IUt()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map($=>{var ne,ce,_e;const q=c[$.host]===void 0?$.container??null:c[$.host],H=a[$.host],Q=q!==null&&((ne=H==null?void 0:H.container)==null?void 0:ne.reference)===q.trim()?H:void 0,V=q!==null?Q:H!=null&&H.container?$.lastTest:H??$.lastTest,J=(ce=Q==null?void 0:Q.container)==null?void 0:ce.error,Z=((_e=Q==null?void 0:Q.container)==null?void 0:_e.ready)===!1,B=(V==null?void 0:V.error)||J,L=k===$.host,F=m[$.host]??!1,U=!e&&(L||!!B),K=`${$.user?`${$.user}@`:""}${$.hostname??$.host}${$.port?`:${$.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3",children:[f.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:$.host,children:$.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:K,children:K})]})}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsxs("div",{className:"flex items-center gap-2 text-start",children:[f.jsx(COn,{test:V,connecting:L&&!b,masterRunning:z[$.host],containerFailed:Z}),U&&f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":F,"aria-label":F?fX({name:Ne($.host)}):ZX({name:Ne($.host)}),onClick:se=>{se.stopPropagation(),D($.host,F)},children:f.jsx(rc,{size:18,className:`text-muted transition-transform duration-120 ease-standard${F?" rotate-180":""}`})})]}),f.jsx(De,{size:"small",type:"button",className:"justify-self-end",onClick:se=>{se.stopPropagation(),L&&!b?M():j($.host)},disabled:!L&&(k!==null&&!b||q!==null&&!q.trim()),children:L?b?Qs():Q_():(V==null?void 0:V.reachable)===!1||Z?Qs():V?zL():Zk()})]})]}),!e&&f.jsx(pOn,{host:$,connecting:L&&!b,reference:q,onChange:se=>{L&&M(),u(G=>({...G,[$.host]:se})),o(G=>{const oe={...G};return delete oe[$.host],oe})}}),U&&(F||L)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3${F?"":" hidden"}`,children:[!L&&B&&f.jsx(f5n,{host:$.host,transcript:B}),L&&!_&&f.jsx(SS,{host:$.host,backend:"ssh",active:F,onComplete:se=>{if(se.backend!=="ssh")return;T($.host);const G=h.current;if(q===null){o(oe=>({...oe,[$.host]:{...se.result,container:null}})),w(!1),v(null);return}p(!0),Kbn($.host,q.trim()).then(oe=>{h.current===G&&o(le=>({...le,[$.host]:{...oe,container:oe.container??{reference:q.trim(),ready:!1,error:oe.error??null}}}))}).catch(oe=>{h.current===G&&o(le=>({...le,[$.host]:{...se.result,container:{reference:q.trim(),ready:!1,error:oe instanceof Error?oe.message:String(oe)}}}))}).finally(()=>{h.current===G&&(p(!1),w(!1),v(null))})},onError:se=>{w(!0),o(G=>({...G,[$.host]:{container:q===null?null:{reference:q.trim(),ready:!1,error:se},reachable:!1,toolsFound:!1,missingTools:[],error:se,testedAt:Date.now()}}))}},y)]})]},$.host)})}),s&&f.jsx(F$,{onClose:()=>i(!1)})]})}function NOn({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Gt,{className:hH,children:uL()}):e===null?f.jsx(Gt,{className:dH,children:bL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Gt,{className:"rounded-sm",variant:"warning",children:_L()}):f.jsx(Gt,{className:"rounded-sm",variant:"success",children:km()}):f.jsx(Gt,{className:"rounded-sm",variant:"error",children:xqt()}):f.jsx(Gt,{className:"rounded-sm",variant:"error",children:vGt()}):f.jsx(Gt,{className:"rounded-sm",variant:"error",children:nS()})}function zOn({remote:e=!1}){var B;const n=an({mutationFn:syn}),t=fxn(),r=ct(t),s=r.data??null,i=L=>{Jr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((B=r.error)==null?void 0:B.message)??null,[o,c]=A.useState(""),[u,h]=A.useState(""),[_,p]=A.useState(""),[m,x]=A.useState(""),[k,v]=A.useState(!1),[b,w]=A.useState(null),[y,C]=A.useState(null),[N,z]=A.useState(!1),[T,j]=A.useState(!1),[M,D]=A.useState(0),I=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,q]=pH(I);function H(){j(!1),D(L=>L+1),z(!0)}const Q=L=>{i(L),c(L.host??""),h(L.partition??""),p(L.account??""),x(L.timeLimit??"")},V=A.useRef(null);A.useEffect(()=>{const L=V.current;V.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&_.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(c(s.host??""),h(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,_,m]);const J=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&_.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function Z(L){if(L.preventDefault(),!k){v(!0),w(null);try{Q(await n.mutateAsync({host:o,partition:u.trim(),account:_.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!N&&(y==null?void 0:y.error)&&f.jsx("p",{className:jy,children:y.error}),f.jsxs("form",{className:oC,onSubmit:Z,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[oqt(),f.jsx(Yo,{choices:[{id:"",label:yL()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:k||N,onSelect:L=>{c(L),C(null),z(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(De,{type:"button",onClick:()=>{N&&!T?(j(!1),z(!1)):H()},disabled:!o,title:o?void 0:jJt(),children:N?T?Qs():Q_():y?zL():Zk()}),f.jsx("span",{role:"status",children:f.jsx(NOn,{test:y,connecting:N&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[qKt(),f.jsx(qr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>h(L.target.value),placeholder:Tz(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[tS(),f.jsx(qr,{type:"text",value:_,onChange:L=>p(L.target.value),placeholder:Tz(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[_Zt(),f.jsx(qr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:BIt(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(De,{variant:"primary",type:"submit",disabled:k||J||N,children:k?oa():nc()})})]}),!e&&N&&f.jsx(SS,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),q(o),j(!1),z(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",MHt()]})})}function jOn(){var C;const e=an({mutationFn:ayn}),n=dxn(),t=ct(n),r=t.data??null,s=N=>{Jr(n.queryKey,z=>(typeof N=="function"?N(z??null):N)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=A.useState(""),[c,u]=A.useState(!1),[h,_]=A.useState(null),[p,m]=A.useState(null),x=p!==null&&p!=="testing"?p:null,k=N=>{s(N),o(N.address??"")},v=A.useRef(null);A.useEffect(()=>{const N=v.current;v.current=r,r&&(!N||a===(N.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(N){if(N.preventDefault(),!c){u(!0),_(null);try{k(await e.mutateAsync({address:a}))}catch(z){_(z instanceof Error?z.message:String(z))}finally{u(!1)}}}async function y(){m("testing");try{m(await oyn(a.trim()||void 0))}catch(N){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:N instanceof Error?N.message:String(N)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:jy,children:x.error}),f.jsxs("form",{className:oC,onSubmit:w,children:[f.jsxs("label",{children:[JFt(),f.jsx(qr,{type:"text",value:a,onChange:N=>{o(N.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[WBt(),": ",Ne(r.resolvedAddress)," · ",SL(),": ",r.source]}),h&&f.jsx("div",{className:"error",children:h}),f.jsxs("div",{className:"actions",children:[f.jsx(De,{variant:"primary",type:"submit",disabled:c||b,children:c?oa():nc()}),f.jsx(De,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:kYt()}),f.jsx(TOn,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[gWt(),": ",x.rayVersion]})]})]}):f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",EHt()]})})}function TOn({test:e}){return e===null?null:e==="testing"?f.jsx(Gt,{children:TYt()}):e.reachable?f.jsx(Gt,{variant:"success",children:SWt()}):f.jsx(Gt,{variant:"error",children:nS()})}function AOn(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:el(e.memBytes),r=e.gpus.length===0?null:DTt({count:e.gpus.length});return[n,e.cpuCount>0?ojt({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function ROn({remote:e}){var p;const n=ct(pxn()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=A.useState(0),[o,c]=A.useState(!0),[u,h]=A.useState(!1),_=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:mOn,children:[f.jsx("span",{className:"k",children:Dh()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Gt,{className:"gap-1.5",role:"status",children:[f.jsx(Nt,{}),u?xDt():ra()]}):r?f.jsx(Gt,{variant:"warning",children:g3()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Gt,{variant:"success",children:km()}):t.sshKeyStatus==="unknown"?f.jsx(Gt,{variant:"warning",children:g3()}):f.jsx(Gt,{variant:"warning",children:Tb()}):f.jsx(Gt,{variant:"warning",children:xL()}):null}),f.jsx("span",{className:"k",children:lKt()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXt()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Gt,{variant:"success",children:kVt()}):t.sshKeyStatus==="no_local_match"?f.jsx(Gt,{variant:"warning",children:sVt()}):t.sshKeyStatus==="none_registered"?f.jsx(Gt,{variant:"error",children:CGt()}):f.jsx(Gt,{children:CL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:CRt({command:Ne("orx login")})}),!e&&i>0&&f.jsx(u5n,{login:o,onComplete:()=>{h(!1),a(0),_()},onError:m=>{h(!1),bn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Da,children:[ODt()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Da,children:[_Gt()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),IYt()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Da,children:QJt({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Da,children:[sGt()," ",f.jsx("code",{children:"ssh-add"}),QVt()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(De,{onClick:()=>void _(),disabled:s||u,children:[f.jsx(Pa,{size:13})," ",s?ra():wm()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(De,{variant:"primary",disabled:s||u,onClick:()=>{c(!t.loggedIn),h(!0),a(m=>m+1)},children:[u?f.jsx(Nt,{}):f.jsx(vf,{size:13})," ",t.loggedIn?Itn():jL()]})]})]})}const MOn={local:bTe,ssh:eAe,tinker:oAe,hf:iTe,modal:ETe,k8s:fTe,slurm:KTe,ray:PTe,openresearch:MTe},Ry={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},dR=["hf","modal","slurm","ray","openresearch"],a4=["hf","modal","openresearch"],mH={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"]},F5=["tinker","hf","modal","ray","k8s"],OOn={tinker:qRe,hf:wRe,modal:jRe,openresearch:LRe},hR="__custom__";function Qp(e,n){return!!(n&&!(mH[e]??[]).includes(n))}function DOn({settings:e,projectId:n,onSaved:t}){const r=an({mutationFn:lyn}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=A.useState(s),[c,u]=A.useState(i),[h,_]=A.useState(Qp(s,i)),[p,m]=A.useState(!1),[x,k]=A.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=dR.includes(a),y=a4.includes(a),C=mH[a]??[],N=a===s&&(!w||c.trim()===i),z=ef[a](),T=OOn[a],j=p?Urn():y&&!c.trim()?DNt({destination:z}):a==="ssh"?tOt():WMt({destination:z});A.useEffect(()=>{o(s),u(i),_(Qp(s,i))},[s,i]);async function M($,q){const H=dR.includes($);if(!(p||a4.includes($)&&!q.trim())){m(!0),k(null);try{t(await r.mutateAsync({backend:$,flavor:H&&q.trim()||null,projectId:n}))}catch(Q){k(Q instanceof Error?Q.message:String(Q)),o(s),u(i),_(Qp(s,i))}finally{m(!1)}}}function D($){const q=e.targets.find(Q=>Q.id===$);if(!q)return;o(q.id);const H=q.id===s?i:"";u(H),_(Qp(q.id,H)),a4.includes(q.id)||M(q.id,H)}function I($){if($===hR){_(!0);return}_(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:yBt()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),N||M(a,c)},children:[f.jsx(Yo,{choices:b.map($=>({id:$.id,label:ef[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const q=e.targets.find(H=>H.id===$.id);return q?f.jsx($h,{kind:Ry[q.id],size:16}):null},onSelect:D}),w&&f.jsx("div",{children:h?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:c,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!c.trim()){a===s&&(u(i),_(Qp(s,i)));return}N||M(a,c)},placeholder:P$t(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":jz(),title:jz(),onMouseDown:$=>$.preventDefault(),onClick:()=>_(!1),children:f.jsx(rc,{size:12})})]}):f.jsx(Yo,{choices:[{id:"",label:y?zNt():pOt()},...c&&!C.includes(c)?[{id:c,label:zjt({value:Ne(c)})}]:[],...C.map($=>({id:$,label:$})),{id:hR,label:K$t()}],value:c,variant:"field",dropDown:!0,disabled:p,onSelect:I})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Da,children:YYt()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function LOn({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?hNt():e.id==="openresearch"?jL():e.id==="ray"?Zk():Ttn();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":ef[e.id](),"aria-describedby":i,"aria-haspopup":F5.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx($h,{kind:Ry[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:ef[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:MOn[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?YAt():mrn()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:Kjt()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?mL():e.configured?!r||F5.includes(e.id)?rS():usn():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(Q1,{size:16})})]})]})}function IOn({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(R0,{size:16})," ",hL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx($h,{kind:Ry[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:ef[e.id]()})]}),n&&f.jsx(Gt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:mL()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(EOn,{remote:r}),e.id==="slurm"&&f.jsx(zOn,{remote:r}),e.id==="openresearch"&&f.jsx(ROn,{remote:r})]})]})}function $On({target:e,remote:n,onClose:t}){const r=A.useRef(null),[s,i]=A.useState({dirty:!1,saving:!1});A.useEffect(()=>{const o=r.current;return o==null||o.showModal(),()=>o==null?void 0:o.close()},[]);const a=()=>{s.saving||s.dirty&&!window.confirm(UAt())||t()};return f.jsxs("dialog",{ref:r,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),a())},onCancel:o=>{o.preventDefault(),a()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx($h,{kind:Ry[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:ef[e.id]()})]}),f.jsx($t,{title:T0(),"aria-label":T0(),onClick:a,disabled:s.saving,children:f.jsx(lr,{size:14})})]}),e.id==="tinker"&&f.jsx(POn,{target:e}),e.id==="hf"&&f.jsx(HOn,{remote:n}),e.id==="modal"&&f.jsx(kOn,{}),e.id==="ray"&&f.jsx(jOn,{}),e.id==="k8s"&&f.jsx(wOn,{onEditState:i})]})}function BOn({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,D;const s=tI(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=I=>{Jr(s.queryKey,$=>(typeof I=="function"?I($??null):I)??void 0)},c=a?null:((M=i.error)==null?void 0:M.message)??null,[u,h]=A.useState(null),[_,p]=A.useState(null),m=hxn(),x=ct(m),k=x.data??null,v=((D=x.error)==null?void 0:D.message)??null;A.useEffect(()=>{h(null),p(null)},[e==null?void 0:e.id]);const b=I=>{o(I),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((I,$)=>+($.id===y)-+(I.id===y)):null,N=(C==null?void 0:C.filter(I=>I.configured))??[],z=(C==null?void 0:C.filter(I=>!I.configured))??[],T=I=>f.jsx(LOn,{target:I,isDefault:y===I.id,summary:I.id==="local"?k?AOn(k):v??NBt():void 0,onOpen:I.id==="local"?void 0:()=>h(I.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${I.id}`),j=u?a==null?void 0:a.targets.find(I=>I.id===u):null;return j&&!F5.includes(j.id)?f.jsx(IOn,{target:j,isDefault:y===j.id,onBack:()=>h(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:i$t()}),f.jsx(iDn,{projectId:e==null?void 0:e.id,onViewHistory:n}),c?f.jsx("div",{className:"error",children:c}):a?f.jsxs(f.Fragment,{children:[_&&f.jsx("div",{className:"error",children:_}),f.jsx(DOn,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:rS()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),z.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:zqt()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:z.map(T)})]}),j&&f.jsx($On,{target:j,remote:r,onClose:()=>h(null)})]}):f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",aIt()]})]})}function POn({target:e}){var w;const n=an({mutationFn:jbn}),[t,r]=A.useState(""),[s,i]=A.useState(!1),[a,o]=A.useState(null),c=qz(),u=ct(c),h=u.data??null,_=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Jr(c.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=A.useState(!1),k=u.isPending||m;async function v(){if(!(k||s)){x(!0),o(null);try{await et.fetchQuery({...qz(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||k)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!h&&k?f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",ra()]}):h&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Dh()}),f.jsx("dd",{className:"m-0",children:f.jsx(Gt,{variant:h.validationStatus==="valid"?"success":h.validationStatus==="invalid"?"error":"warning",children:h.validationStatus==="valid"?km():h.validationStatus==="invalid"?lrn():h.validationStatus==="billingRequired"?Qnn():Tb()})})]}),(h==null?void 0:h.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:Hnn()})}),(h==null?void 0:h.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:nrn()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||h!==null&&h.validationStatus!=="missing"?qen():Xk(),f.jsx(qr,{type:"password",value:t,placeholder:(h==null?void 0:h.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),_&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:_}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(De,{type:"button",disabled:s||k,onClick:()=>void v(),children:[f.jsx(Pa,{size:13})," ",k?ra():wm()]}),f.jsx(De,{variant:"primary",type:"submit",disabled:!t.trim()||s||k,children:s?AL():nc()})]})]})]})}function FOn({settings:e}){return e.validationStatus==="missing"?f.jsx(Gt,{variant:"warning",children:Tb()}):e.validationStatus==="invalid"?f.jsx(Gt,{variant:"error",children:VFt()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Gt,{variant:"success",children:km()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Gt,{variant:"warning",children:YUt()}),f.jsx(fS,{content:nAt(),className:"text-subtext",children:f.jsx(mS,{size:15})})]}):null}function HOn({remote:e}){var w;const n=an({mutationFn:Nbn}),t=Hz(),r=ct(t),s=r.data??null,i=y=>{Jr(t.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},a=s?null:((w=r.error)==null?void 0:w.message)??null,[o,c]=A.useState(""),[u,h]=A.useState(!1),[_,p]=A.useState(!1),[m,x]=A.useState(null),k=Ty();async function v(){if(!(u||_||!s&&!a)){p(!0),x(null);try{await et.fetchQuery({...Hz(),staleTime:0})}catch(y){x(y instanceof Error?y.message:String(y))}finally{p(!1)}}}async function b(y){if(y.preventDefault(),!(!o.trim()||u||_||!s&&!a)){h(!0),x(null);try{const C=await n.mutateAsync(o.trim());i(C),x(null),c("")}catch(C){x(C instanceof Error?C.message:String(C))}finally{h(!1)}}}return f.jsxs(f.Fragment,{children:[a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[s.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:tS()}),f.jsx("dd",{className:"m-0 text-text",children:s.username})]}),(s.validationStatus==="missing"||s.validationStatus==="invalid"||s.validationStatus==="valid"&&s.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Dh()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(FOn,{settings:s})})]})]}),s.validationStatus==="unreachable"&&s.validationError&&f.jsx("p",{className:jy,children:s.validationError}),s.source==="env"&&f.jsx("p",{className:Da,children:JPt()}),s.validationStatus==="valid"&&s.jobsWrite===null&&f.jsx(cC,{note:QTt({login:"`hf auth login`",url:Ne("huggingface.co/settings/tokens")}),className:Da,disabled:e,onRun:k.start}),f.jsx(Ay,{run:k.run,onComplete:()=>void r.refetch(),onClose:k.clear})]}):f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",PHt()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[s!=null&&s.configured?Xen():cOt(),f.jsx(qr,{type:"password",value:o,onChange:y=>c(y.target.value),placeholder:(s==null?void 0:s.maskedToken)??VPt(),autoComplete:"off"})]}),m&&f.jsx("div",{className:"error",children:m}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(De,{type:"button",disabled:u||_||!s&&!a,onClick:()=>void v(),children:[f.jsx(Pa,{size:13})," ",_?ra():wm()]}),f.jsx(De,{variant:"primary",type:"submit",disabled:!o.trim()||u||_||!s&&!a,children:u?AL():nc()})]})]})]})}const gH=/^hf_[A-Za-z0-9]{10,}$/;function vH(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Da,children:[sZt()," ",f.jsx("code",{children:"HF_TOKEN"}),qQt()]})})})}const pR=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function H5(e,n){const t=n instanceof Error?n.message:String(n);bn(t.includes(e)?t:`${e}: ${t}`,"error")}function qOn({name:e,entry:n,onVars:t}){const r=an({mutationFn:_=>GL(..._)}),s=an({mutationFn:Pbn}),[i,a]=A.useState(""),[o,c]=A.useState(!1);async function u(){if(!(!i.trim()||o)){c(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(_){H5(e,_)}finally{c(!1)}}}async function h(){if(!o){c(!0);try{t(await s.mutateAsync(e))}catch(_){H5(e,_)}finally{c(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Gt,{children:LKt()})]}):f.jsx(qr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:_=>a(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),u()),_.key==="Escape"&&!o&&a("")},placeholder:EL(),"aria-label":WJ({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx($t,{className:"[&:hover:not(:disabled)]:text-accent-red",title:i3({name:Ne(e)}),"aria-label":i3({name:Ne(e)}),onClick:()=>void h(),disabled:o,children:f.jsx(bf,{size:13})}):i.trim()&&f.jsx(De,{size:"small",onClick:()=>void u(),disabled:o,children:o?oa():nc()})})]}),!n&&e!=="HF_TOKEN"&&gH.test(i.trim())&&f.jsx(vH,{})]})}function UOn({onVars:e,onDone:n}){const t=an({mutationFn:_=>GL(..._)}),[r,s]=A.useState(""),[i,a]=A.useState(""),[o,c]=A.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){c(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(_){H5(r.trim(),_)}finally{c(!1)}}}const h=_=>{_.key==="Enter"&&(_.preventDefault(),u()),_.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(qr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:_=>s(_.target.value),onKeyDown:h,placeholder:"MY_API_KEY","aria-label":mUt(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(qr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:_=>a(_.target.value),onKeyDown:h,placeholder:EL(),"aria-label":kUt(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(De,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?oa():nc()}),f.jsx($t,{title:Q_(),"aria-label":JLt(),onClick:n,disabled:o,children:f.jsx(lr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&gH.test(i.trim())&&f.jsx(vH,{})]})}function GOn(){var u;const e=mxn(),n=ct(e),t=n.data??null,r=h=>{Jr(e.queryKey,_=>(typeof h=="function"?h(_??null):h)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=A.useState(!1),o=t===null?[]:t.map(h=>h.key).filter(h=>!pR.includes(h)),c=[...pR,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:nJt()}),f.jsxs(De,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(Ih,{size:12})," ",FDt()]})]}),f.jsx("div",{className:ec,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",Ru()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-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-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[c.map(h=>f.jsx(qOn,{name:h,entry:t.find(_=>_.key===h),onVars:r},h)),i&&f.jsx(UOn,{onVars:r,onDone:()=>a(!1)})]})})})]})}const Xp=[{value:"system",label:Dnn,icon:f3n},{value:"light",label:znn,icon:$3n},{value:"dark",label:pnn,icon:h3n}],VOn=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"},{id:"ar",label:"العربية"},{id:"es",label:"Español"},{id:"hi",label:"हिन्दी"}];function KOn(){const e=pf(),[n,t]=hI(),r=s=>{var h;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(_=>_===document.activeElement),u=((o===-1?Xp.findIndex(_=>_.value===n):o)+i+Xp.length)%Xp.length;t(Xp[u].value),(h=a[u])==null||h.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:OEt()}),f.jsxs("div",{className:`${ec} mt-3`,children:[f.jsxs("div",{className:`${nl} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:$z()}),f.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":$z(),onKeyDown:r,children:Xp.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?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 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:nl,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:vRt()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Yo,{choices:VOn,value:e,variant:"field",dropDown:!0,onSelect:s=>{hD(s)&&_I(s)}})})]})]})]})}const WOn={installer:Fmn,"app-bundle":ymn,portable:tgn,cargo:Nmn,homebrew:Omn,nix:Wmn,unknown:cgn},o4={cargo:pgn,homebrew:wgn,nix:jgn};function QOn(){var _;const e=an({mutationFn:p=>Mbn(...p)}),{status:n,error:t,apply:r}=l6(),[s,i]=A.useState(null),[a,o]=A.useState(null),c=q$(n),u=s!==null||c.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:Dz()}),t?f.jsx("div",{className:ec,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",Ru()]})]});const h=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:Dz()}),f.jsxs("div",{className:`${ec} mt-3`,children:[f.jsxs("div",{className:`${nf} pb-3.5`,children:[f.jsx("div",{className:"k",children:NL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:dHt()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:vL()}),f.jsx("div",{className:"v",children:WOn[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:nl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:wQt()}),f.jsx("p",{children:c.error?IL({error:c.error}):utn({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(De,{size:"small",type:"button",disabled:u,onClick:c.restart,children:c.restarting?$L():LL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:nl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Rz()}),f.jsxs("p",{children:[lUt(),n.envDisabled&&Irn()]})]}),f.jsx(_S,{type:"button",checked:n.autoUpdate,"aria-label":Rz(),disabled:u,onClick:()=>void h("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:nl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Trn({version:Ne(n.latest??"—")}):eNt()}),f.jsx("p",{children:n.updateAvailable?IAt():xNt()})]}),f.jsx(De,{size:"small",type:"button",disabled:u,onClick:()=>void h("apply",()=>Abn().then(r)),children:s==="apply"?Gk():n.updateAvailable?krn():oNt()})]})]}):f.jsx("div",{className:nl,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:mKt()}),f.jsx("p",{children:((_=o4[n.channel])==null?void 0:_.call(o4))??nen()})]})}),n.channel==="app-bundle"&&f.jsx(YOn,{busy:s,disabled:u,run:h}),a&&f.jsx("div",{className:"error",children:a})]})]})}function XOn(){var _;const e=an({mutationFn:zyn}),n=Sxn(),t=ct(n),r=t.data??null,s=p=>{Jr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=A.useState(!1),[o,c]=A.useState(null),u=o??((_=t.error)==null?void 0:_.message)??null,h=()=>{!r||i||(a(!0),c(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>c(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZt()}),r?f.jsxs("div",{className:`${ec} mt-3`,children:[f.jsxs("div",{className:nl,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[zz(),r.locked&&r.reason&&f.jsx(fS,{content:`${M$t()} ${r.reason}.`,className:"text-subtext",children:f.jsx(mS,{size:15})})]}),f.jsx("p",{children:TUt()})]}),f.jsx(_S,{type:"button",checked:r.enabled,"aria-label":zz(),disabled:i||r.locked,onClick:h})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",Ru()]})]})}function YOn({busy:e,disabled:n,run:t}){const r=an({mutationFn:Obn}),[s,i]=A.useState(null),[a,o]=A.useState(!1),c=u=>void t("cli",()=>r.mutateAsync(u).then(h=>{i(h),o(!1)}).catch(h=>{throw o(!u&&String((h==null?void 0:h.message)??h).includes("--force")),h}));return f.jsxs("div",{className:nl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:kAt({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?QNt({link:Ne(s.link)}):nzt({link:Ne(s.link)}),!s.onPath&&NEt({directory:Ne(s.dir)})]}):f.jsx("p",{children:mAt({command:Ne("orx")})})]}),f.jsx(De,{size:"small",type:"button",disabled:n,onClick:()=>c(a),children:e==="cli"?Gk():a?Len():s?len():lAt()})]})}function ZOn({remote:e}){var x;const n=an({mutationFn:k=>XL(...k)}),t=aS(),r=ct(t),s=r.data??null,i=k=>{Jr(t.queryKey,v=>(typeof k=="function"?k(v??null):k)??void 0)},[a,o]=A.useState(!1),[c,u]=A.useState(null),h=c??((x=r.error)==null?void 0:x.message)??null,_=async()=>{await r.refetch({cancelRefetch:!1})},p=Ty(),m=()=>{if(!s||a)return;const k=!s.githubForNewProjects;o(!0),u(null),n.mutateAsync([k,!0]).then(i).catch(v=>u(v instanceof Error?v.message:String(v))).finally(()=>o(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:bPt()}),s?f.jsxs("div",{className:`${ec} mt-3 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:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:EPt()}),f.jsx(Gt,{variant:s.githubAuthenticated?"success":s.ghInstalled?"warning":"error",children:s.githubAuthenticated?lL():fL()})]}),f.jsxs("div",{className:nl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Az()}),f.jsx("p",{children:pJt()})]}),f.jsx(_S,{type:"button",checked:s.githubForNewProjects,"aria-label":Az(),disabled:a||!s.githubAuthenticated&&!s.githubForNewProjects,onClick:m})]}),!s.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(bH,{ghInstalled:s.ghInstalled,remote:e,onCheck:_,onRun:p.start})}),f.jsx(Ay,{run:p.run,onComplete:()=>void _(),onClose:p.clear}),h&&f.jsx("div",{className:"error",children:h})]}):h?f.jsx("div",{className:"error",children:h}):f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",Ru()]})]})}function bH({ghInstalled:e,remote:n,onCheck:t,onRun:r}){const[s,i]=A.useState(!1),a=()=>{i(!0),t().finally(()=>i(!1))};return f.jsxs(f.Fragment,{children:[f.jsx(cC,{note:e?gtn():TAt(),className:"git-card-helper m-0 text-sm leading-relaxed text-text",disabled:n||!e,onRun:r}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(ph,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[EFt()," ",f.jsx(Z_,{size:12})]}),f.jsx(De,{type:"button",variant:e?"warning":"default",disabled:s,onClick:a,children:s?ra():wm()})]})]})}function JOn(){var m,x,k;const e=an({mutationFn:dbn}),n=an({mutationFn:hbn}),t=pSn(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Jr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[c,u]=A.useState(!1),[h,_]=A.useState(null),p=h??((k=r.error)==null?void 0:k.message);return f.jsxs("div",{className:P5,children:[f.jsx("h3",{children:wL()}),f.jsxs("div",{className:nf,children:[f.jsx("span",{className:"k",children:MPt()}),f.jsx("span",{className:"v",children:f.jsx(Gt,{variant:s?"success":"default",children:s===null?p?ro():ra():s?Iz():p3()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:wJt()}),s?f.jsx("div",{className:y0,children:f.jsx(De,{disabled:c,onClick:()=>{u(!0),_(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>_(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:c?Lz():ken()})}):f.jsx(fR,{save:qL,onSaved:v=>o(v.hasToken),placeholder:jKt(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:nf,children:[f.jsx("span",{className:"k",children:XQt()}),f.jsx("span",{className:"v",children:f.jsx(Gt,{variant:i?"success":"default",children:i===null?p?ro():ra():i?Iz():p3()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:rXt()}),i?f.jsx("div",{className:y0,children:f.jsx(De,{disabled:c,onClick:()=>{u(!0),_(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>_(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:c?Lz():men()})}):f.jsx(fR,{save:v=>UL(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:_3(),createHref:"https://www.overleaf.com/project",createLabel:y1t()}),p&&f.jsx("div",{className:"error",children:p})]})}function eDn({project:e,onProjectUpdate:n,remote:t}){var M;const r=an({mutationFn:D=>XL(...D)}),s={...kxn((e==null?void 0:e.id)??""),enabled:!!e},i=ct(s),a=Ty(),o=i.data??null,c=D=>{Jr(s.queryKey,I=>(typeof D=="function"?D(I??null):D)??void 0)},[u,h]=A.useState(!1),[_,p]=A.useState(null),m=_??((M=i.error)==null?void 0:M.message)??null,[x,k]=A.useState(!1),[v,b]=A.useState(!1),[w,y]=A.useState(null),C=!!(o!=null&&o.github.owner&&o.github.repo),N=async()=>{await i.refetch({cancelRefetch:!1})},z=D=>{const I=D instanceof Error?D.message:String(D);return I.toLowerCase().includes("archived")?hTt():I.includes("(fetch first)")||I.includes("non-fast-forward")?xTt():I.includes("403")||I.toLowerCase().includes("permission denied")?zTt():I},T=()=>{e&&(h(!0),p(null),Cyn(e.id).then(D=>{c(D.git),n(D.project),et.fetchQuery(aS()).then(I=>{!I.githubForNewProjects&&!I.githubDefaultPromptSeen&&k(!0)}).catch(()=>{})}).catch(D=>p(z(D))).finally(()=>h(!1)))},j=D=>{b(!0),y(null),r.mutateAsync([D,!0]).then(()=>k(!1)).catch(I=>y(I instanceof Error?I.message:String(I))).finally(()=>b(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pQt()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:rtn({project:(e==null?void 0:e.name)??xjt()})}),e?m&&!o?f.jsx("div",{className:"error",children:m}):o?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:P5,children:[f.jsx("h3",{children:eqt()}),f.jsxs("div",{className:nf,children:[f.jsx("span",{className:"k",children:XKt()}),f.jsx("span",{className:"v",children:o.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:o.gitVersion??XD()}),f.jsx("span",{className:"k",children:qXt()}),f.jsx("span",{className:"v",children:o.initialized?oTt({branch:Ne(o.currentBranch??Jk()),state:o.clean?HNt():HTt()}):WOt()}),f.jsx("span",{className:"k",children:MLt()}),f.jsx("span",{className:"v",children:o.baselineBranch}),f.jsx("span",{className:"k",children:cQt()}),f.jsx("span",{className:"v",children:o.remotes.length?o.remotes.map(D=>`${D.name}: ${D.url}`).join(" · "):eS()})]}),!o.initialized&&f.jsx("div",{className:y0,children:f.jsx(De,{variant:"primary",onClick:()=>void Syn(e.id).then(c).catch(D=>p(String(D))),children:aFt()})})]}),f.jsxs("div",{className:P5,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:nf,children:[f.jsx("span",{className:"k",children:dL()}),f.jsx("span",{className:"v",children:f.jsx(Gt,{variant:o.github.authenticated?"success":o.github.ghInstalled?"warning":"error",children:o.github.authenticated?lL():fL()})}),f.jsx("span",{className:"k",children:uWt()}),f.jsx("span",{className:"v",children:C?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[o.github.owner,"/",o.github.repo]}),!o.github.enabled&&f.jsx(Gt,{children:mYt()})]}):f.jsx(Gt,{children:KHt()})}),o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:lYt()}),f.jsx("span",{className:"v",children:o.github.syncStatus})]})]}),!o.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(bH,{ghInstalled:o.github.ghInstalled,remote:t,onCheck:()=>N(),onRun:a.start})}),f.jsx(Ay,{run:a.run,onComplete:()=>void N(),onClose:a.clear}),o.github.authenticated&&!o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:C?Yrn():hjt()}),f.jsxs("div",{className:y0,children:[C&&o.github.url&&f.jsxs(ph,{href:o.github.url,target:"_blank",rel:"noreferrer",children:[Oz()," ",f.jsx(Z_,{size:12})]}),f.jsx(De,{variant:"primary",disabled:u,onClick:T,children:u?d8t():a8t()})]})]}),o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:FBt()}),f.jsxs("div",{className:y0,children:[o.github.url&&f.jsxs(ph,{href:o.github.url,target:"_blank",rel:"noreferrer",children:[Oz()," ",f.jsx(Z_,{size:12})]}),f.jsx(De,{disabled:u,onClick:()=>{h(!0),Eyn(e.id).then(D=>{c(D.git),n(D.project)}).catch(D=>p(D instanceof Error?D.message:String(D))).finally(()=>h(!1))},children:u?y8t():J7t()})]})]})]}),f.jsx(JOn,{}),m&&f.jsx("div",{className:"error",children:z(m)})]}):f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",Ru()]}):f.jsx("div",{className:ec,children:f.jsx("p",{className:Da,children:TVt()})}),x&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>j(!1),children:f.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-modal 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-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:D=>D.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:hqt()}),f.jsx("p",{children:UYt()}),w&&f.jsx("div",{className:"error",children:w}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(De,{disabled:v,onClick:()=>j(!1),children:YGt()}),f.jsx(De,{variant:"primary",disabled:v,onClick:()=>j(!0),children:v?oa():RRt()})]})]})})]})}const tDn={env:lfn,config:mfn,xdg:kfn,default:nfn},c4={preparing:H_n,copying:e_n,verifying:Tfn,finalizing:o_n},nDn=e=>{var n;return((n=c4[e])==null?void 0:n.call(c4))??e};function rDn(){var y;const e=gxn(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=A.useState(""),[a,o]=A.useState(!1),[c,u]=A.useState(null),[h,_]=A.useState({kind:"idle"}),[p,m]=A.useState(null);A.useEffect(()=>{t&&i(C=>C||t.current)},[t]),A.useEffect(()=>lI(C=>{C.type==="progress"?_(N=>{const z=N.kind==="moving"?N.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||z}}):C.type==="done"?(_({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&_({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",k=s.trim(),v=t!==null&&k===t.current;async function b(){if(!(a||!k)){o(!0),m(null),u(null);try{u(await Hbn(k))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(h.kind==="moving"||!k||v)&&(m(null),!!window.confirm(x_n({path:Ne(k)})))){_({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await qbn(k)}catch(N){_({kind:"idle"}),m(N instanceof Error?N.message:String(N))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:nYt()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:nnn()}),r?f.jsx("div",{className:ec,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:ec,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:eBt()})}),f.jsxs("div",{className:nf,children:[f.jsx("span",{className:"k",children:E$t()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:SL()}),f.jsx("span",{className:"v",children:tDn[t.source]()})]}),!x&&f.jsxs("form",{className:oC,onSubmit:w,children:[f.jsxs("label",{children:[nUt(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:h.kind==="moving"})]}),c&&!c.error&&c.ok&&f.jsxs("p",{className:Da,children:[qWt()," ",el(c.treeBytes??0),c.freeBytes!=null&&` — ${h_n({size:Ne(el(c.freeBytes))})}`,c.sameFilesystem?Q_n():"","."]}),c&&c.ok===!1&&c.error&&f.jsx("div",{className:"error",children:c.error}),p&&f.jsx("div",{className:"error",children:p}),h.kind==="moving"&&f.jsx(_H,{value:h.copied,max:h.total,label:nDn(h.phase),caption:h.total>0?f.jsxs("span",{className:"text-sm",children:[el(h.copied)," / ",el(h.total)]}):void 0}),h.kind==="done"&&f.jsxs("p",{className:Da,children:[Hqt(),h.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",hDt({path:Ne(h.oldPathLeft)})]})]}),h.kind==="error"&&f.jsxs("div",{className:"error",children:[Dqt()," ",h.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(De,{type:"button",onClick:b,disabled:a||!k||v||h.kind==="moving",children:a?ra():FEt()}),f.jsx(De,{variant:"primary",type:"submit",disabled:!k||v||h.kind==="moving",children:h.kind==="moving"?D_n():z_n()})]})]})]}):f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",Ru()]})]})}const q5=e=>e==="running"||e==="starting";function sDn(e){return q5(e.status)?A0(Date.now()-e.createdAt):e.endedAt?A0(e.endedAt-e.createdAt):"—"}function yH({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_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-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:ELt()}),f.jsx("th",{children:Dh()}),f.jsx("th",{children:LXt()}),f.jsx("th",{children:LQt()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(AS,{backend:t.backend}),r&&f.jsx(Lh,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:Mz(),"aria-label":Mz(),onClick:i=>i.stopPropagation(),children:f.jsx(Z_,{size:12})})]})}),f.jsx("td",{children:f.jsx(al,{status:Zi(t)})}),f.jsx("td",{children:co(t.createdAt)}),f.jsx("td",{children:sDn(t)})]},t.id)})})]})})}function iDn({projectId:e,onViewHistory:n}){var _;const t=ct({...mu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(_=t.error)==null?void 0:_.message,i=t.isFetching,[,a]=A.useState(0);A.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},c=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>q5(p.status)).sort(c),h=r==null?void 0:r.filter(p=>!q5(p.status)).sort(c);return f.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-8",children:[f.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 [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[jQt(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(De,{size:"small",onClick:o,disabled:i,children:[f.jsx(Pa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Sm()]}),f.jsx(De,{size:"small",onClick:n,children:h!=null&&h.length?vZe({count:Xt(h.length)}):_Ze()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!h?f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",Ru()]}):f.jsx(yH,{instances:u,emptyLabel:e?UYe():sZe()})]})}function aDn({projectId:e,onBack:n}){var c;const t=ct({...mu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(c=t.error)==null?void 0:c.message,i=t.isFetching,[,a]=A.useState(0);A.useEffect(()=>{const u=setInterval(()=>a(h=>h+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.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:n,children:[f.jsx(R0,{size:14})," ",hL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:BFt()}),f.jsxs(De,{size:"small",onClick:o,disabled:i,children:[f.jsx(Pa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Sm()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(yH,{instances:[...r].sort((u,h)=>h.createdAt-u.createdAt),emptyLabel:e?IYe():YYe()}):f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",Ru()]})]})}const xH=["projects","harnesses","storage"],oDn=[{id:"compute",label:pL,icon:f.jsx(hS,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:gL,icon:f.jsx(vf,{size:15}),activeTabs:["environment"]},{id:"settings",label:sS,icon:f.jsx(yS,{size:15}),activeTabs:["settings",...xH]}];function cDn(e){return xH.includes(e)}function lDn({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||cDn(e),a=A.useRef(null);return A.useLayoutEffect(()=>{const o=a.current,c=o==null?void 0:o.parentElement;if(!o||!c)return;const u=()=>o.scrollIntoView({block:"start"}),h=new ResizeObserver(u);h.observe(c),u();const _=()=>h.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,_,{passive:!0});return()=>{_();for(const m of p)window.removeEventListener(m,_)}},[e,n==null?void 0:n.id]),f.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-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:sS()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:md,children:f.jsx(KOn,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:md,children:f.jsx(ZOn,{remote:s})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:md,children:f.jsx(yOn,{remote:s})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:md,children:f.jsx(rDn,{})}),f.jsx("section",{className:md,children:f.jsx(XOn,{})}),!s&&f.jsx("section",{className:md,children:f.jsx(QOn,{})})]})]}),e==="compute"&&f.jsx(BOn,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(aDn,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:gL()}),f.jsx(GOn,{})]}),e==="git"&&f.jsx(eDn,{project:n,onProjectUpdate:t,remote:s})]})}function sb(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function U5(e){return`${e.plugin?`${sb(e.plugin)}: `:""}${sb(e.name)}`}const wH=["plan","goal","new","resume","model","compact","copy","export"],uDn={plan:()=>Pyt(),goal:()=>SKe(),new:()=>jrt(),resume:()=>N8t(),model:()=>btt(),compact:()=>Zje(),copy:()=>SMe(),export:()=>v$e()};function _Dn(e){return{name:e,get description(){return uDn[e]()},source:"command"}}function My(e){return wH.some(n=>n===e)}const ib={clear:"new",summarize:"compact"};function G5(e){const n=e.toLowerCase();return My(n)?n:Object.hasOwn(ib,n)?ib[n]:null}function kH(e){return Object.keys(ib).filter(n=>ib[n]===e)}function fDn(e,n){return e.name.toLowerCase().startsWith(n)||e.plugin&&`${e.plugin}:${e.name}`.toLowerCase().startsWith(n)?!0:e.source==="command"&&My(e.name)&&kH(e.name).some(t=>t.startsWith(n))}function l4(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?h:s}${a.slice(h.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function mR(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function SH(e){return wH.filter(n=>n!=="plan"||e)}function pDn(e,n){const t=e.filter(r=>!G5(r.name));for(const r of SH(n))t.push(_Dn(r));return t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||U5(r).localeCompare(U5(s),void 0,{sensitivity:"base"}))}function u4(e){return e==="plan"||e==="goal"}function mDn(e,n){for(const t of SH(n).sort((r,s)=>+(r==="plan")-+(s==="plan"))){const r=[t,...kH(t)].join("|");if(t==="plan"){const s=new RegExp(`(^|\\s)\\/(?:${r})(?=\\s|$)`,"gi");if(s.test(e))return{name:t,prompt:e.replace(s,"").trim()}}else if(t==="goal"){const s=new RegExp(`^\\/(?:${r})(?=\\s|$)`,"i");if(s.test(e.trim()))return{name:t,prompt:e.trim().replace(s,"").trim()}}else if(new RegExp(`^\\/(?:${r})$`,"i").test(e.trim()))return{name:t,prompt:""}}return null}function _4(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}const gDn=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let vDn=null;function V5(e,n){const t=vDn??(vDn=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(sb(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}const bDn={plan:n3n,goal:HI,new:D3n,resume:qI,model:hS,compact:R4n,copy:gf,export:Db};function CH({name:e,className:n}){const t=My(e)?bDn[e]:W3n;return f.jsx(t,{size:16,strokeWidth:1.5,className:n,"aria-hidden":"true"})}function EH({name:e}){return f.jsxs(f.Fragment,{children:[f.jsx(CH,{name:e,className:"me-1 inline-block align-middle"}),sb(e)]})}function NH(e,n,t,r,s,i=!1){let a=0;return dDn(e,n).map((o,c,u)=>{var m,x;const h=a+o.text.length;a=h;const _=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,_,h,c);let p=o.text;return i||((m=u[c-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(x=u[c+1])!=null&&x.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(EH,{name:_})},c):i?f.jsx("span",{"aria-hidden":"true",children:o.text},c):f.jsx(A.Fragment,{children:p},c)})}function yDn({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=A.useRef(null),o=A.useRef(null),c=A.useRef(null),u=A.useId(),[h,_]=A.useState(!1),p=ct({...Exn(n,s,r.harness),enabled:h,subscribed:h}),m=p.data??null,x=p.isFetching,[k,v]=A.useState({}),b=()=>{c.current!==null&&window.clearTimeout(c.current),c.current=null},w=()=>{const N=a.current;if(!N)return;const z=N.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(z.left-4,window.innerWidth-T-16));v(z.top>300?{bottom:window.innerHeight-z.top+12,left:j,width:T}:{left:j,top:z.bottom+12,width:T})},y=()=>{b(),w(),_(!0)},C=()=>{b(),c.current=window.setTimeout(()=>_(!1),120)};return A.useEffect(()=>()=>b(),[]),A.useEffect(()=>{if(!h)return;const N=()=>w();return window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[h]),f.jsxs(A.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":h,"aria-label":MZ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:N=>{var z,T;if(N.key==="Escape"){_(!1);return}if(N.key==="Enter"||N.key===" "){N.preventDefault(),y();return}h&&(N.key==="ArrowDown"||N.key==="PageDown")&&(N.preventDefault(),(z=o.current)==null||z.scrollBy({top:N.key==="PageDown"?240:48,behavior:"smooth"})),h&&(N.key==="ArrowUp"||N.key==="PageUp")&&(N.preventDefault(),(T=o.current)==null||T.scrollBy({top:N.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:N=>{var z,T;N.preventDefault(),(z=i.current)==null||z.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(EH,{name:n})})})]}),h&&Mi.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":FJ({name:n}),style:{...k,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:N=>N.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Gt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:gsn()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:x&&m===null?f.jsx("span",{className:"text-muted",children:Ssn()}):f.jsx(Jo,{text:m??r.description})})]}),document.body)]})}function xDn({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:NH(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function wDn({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=A.useRef(null);return A.useLayoutEffect(()=>{const o=i.current,c=a.current;if(!o||!c)return;const u=()=>{const _=getComputedStyle(o);for(const p of gDn)c.style.setProperty(p,_.getPropertyValue(p));c.style.width=`${o.clientWidth+parseFloat(_.borderLeftWidth)+parseFloat(_.borderRightWidth)}px`};u();const h=new ResizeObserver(u);return h.observe(o),()=>h.disconnect()},[e,i]),A.useLayoutEffect(()=>{const o=i.current;if(!o)return;const c=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return c(),o.addEventListener("scroll",c),()=>o.removeEventListener("scroll",c)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[NH(e,t,"",void 0,(o,c,u,h)=>{var x;const _=e.slice(u),p=((x=/^[ \t]+/.exec(_))==null?void 0:x[0].length)??0;if(u===n||_&&!_.startsWith(` -`)&&pk.name===c);return m&&m.source!=="command"?f.jsx(yDn,{label:o,name:c,end:u,skill:m,projectId:s,textareaRef:i},`${h}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${h}:${u}`)},!0),"​"]})}function kDn({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=A.useRef(null);return A.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[f.jsx(CH,{name:i.name,className:"shrink-0"}),f.jsx("span",{className:"skill-name shrink-0",children:U5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:Asn()})]},i.name))})}function SDn(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const K5=6.5,gR=2*Math.PI*K5;function CDn({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(EDn,{usage:e})}function EDn({usage:e}){const{open:n,setOpen:t,ref:r}=_o(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":SDn(a),c=a===null?"":new Intl.NumberFormat(E(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:rMe(),onClick:()=>t(u=>!u),children:a===null?e1(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:K5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:K5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${gR*Math.max(a,2)/100} ${gR}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-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:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:XRe()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?uMe({value:Ne(e1(s))}):gMe({used:Ne(e1(s)),total:Ne(e1(i)),percent:Ne(c)})})]}),a!==null&&f.jsx(_H,{value:s,max:i,fillColor:o})]})]})}function NDn(e,n,t){const r=e.map(t);return n<0?r:[...r.slice(0,n),f.jsxs("div",{role:"group","aria-label":Sz(),children:[f.jsx("div",{className:"px-2.5 pb-1 pt-2.5 text-sm font-medium text-subtext",children:Sz()}),r.slice(n)]},"from-terminal")]}function zDn({activeSessionId:e,onClose:n,onResume:t,onImport:r}){const s=A.useRef(null),i=A.useRef(null),{data:a,isPending:o,error:c}=ct(Txn()),{data:u=[]}=ct(dh()),{data:h=[]}=ct(sI()),[_,p]=A.useState(""),[m,x]=A.useState(0);Em(s,n);const k=A.useMemo(()=>new Map(u.map(N=>[N.id,N.name])),[u]),v=A.useMemo(()=>{const N=_.trim().toLowerCase(),z=M=>!N||M.toLowerCase().includes(N),T=(a??[]).filter(M=>M.id!==e).filter(M=>z(`${M.title??""} ${k.get(M.projectId)??""} ${su[M.harness]}`)).map(M=>({kind:"session",key:M.id,session:M})),j=h.filter(M=>z(`${M.title??""} ${M.cwd??""} ${su[M.harness]}`)).map(M=>({kind:"native",key:`${M.harness}:${M.nativeId}`,chat:M}));return[...T,...j]},[a,h,_,e,k]),b=A.useMemo(()=>v.findIndex(N=>N.kind==="native"),[v]),w=Math.min(m,Math.max(0,v.length-1));A.useLayoutEffect(()=>{var N;(N=i.current)==null||N.scrollIntoView({block:"nearest"})},[w,v]);const y=N=>(N==null?void 0:N.split("/").filter(Boolean).at(-1))??"",C=N=>N.kind==="native"?r(N.chat):t(N.session);return Mi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-start justify-center bg-modal-backdrop p-5 pt-[var(--modal-top)]",onClick:N=>{N.target===N.currentTarget&&n()},children:f.jsxs("div",{ref:s,className:"flex max-h-[calc(100vh_-_var(--modal-top)_-_1.25rem)] w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-label":Ez(),tabIndex:-1,children:[f.jsx("div",{className:"border-b border-border p-3",children:f.jsx(qr,{"data-initial-focus":!0,value:_,placeholder:Cz(),"aria-label":Cz(),role:"combobox","aria-autocomplete":"list","aria-expanded":v.length>0,"aria-controls":"resume-options","aria-activedescendant":v[w]?`resume-option-${v[w].key}`:void 0,onChange:N=>{p(N.target.value),x(0)},onKeyDown:N=>{if(!N.nativeEvent.isComposing)if(N.key==="ArrowDown"||N.key==="ArrowUp"){if(N.preventDefault(),v.length===0)return;const z=N.key==="ArrowDown"?1:-1;x((w+z+v.length)%v.length)}else N.key==="Enter"&&v[w]&&(N.preventDefault(),C(v[w]))}})}),f.jsx("div",{id:"resume-options",className:"min-h-0 flex-1 overflow-y-auto p-1.5",role:v.length>0?"listbox":void 0,"aria-label":v.length>0?Ez():void 0,children:o?f.jsxs(Gr,{className:"px-2.5 py-2",role:"status",children:[f.jsx(Nt,{})," ",Kk()]}):c&&!a?f.jsx("div",{className:"px-2.5 py-2 text-sm text-accent-red",role:"alert",children:Vk({error:Ne(c instanceof Error?c.message:String(c))})}):v.length===0?f.jsx("div",{className:"px-2.5 py-2 text-sm text-muted",role:"status",children:O8t()}):NDn(v,b,(N,z)=>{var D;const T=N.kind==="native"?N.chat:null,j=N.kind==="session"?N.session:null;return f.jsxs(Jn,{id:`resume-option-${N.key}`,ref:z===w?i:void 0,type:"button",role:"option","aria-selected":z===w,active:z===w,tabIndex:-1,className:"gap-2.5 text-text",onMouseEnter:()=>x(z),onClick:()=>C(N),children:[f.jsx(vh,{harness:(T==null?void 0:T.harness)??(j==null?void 0:j.harness)??"claude-code"}),f.jsx("span",{dir:"auto",className:"min-w-0 flex-1 truncate",children:((D=(T==null?void 0:T.title)??(j==null?void 0:j.title))==null?void 0:D.trim())||yd()}),f.jsx("span",{dir:"auto",className:"max-w-40 shrink-0 truncate text-muted",title:(T==null?void 0:T.cwd)??void 0,children:T?y(T.cwd):k.get((j==null?void 0:j.projectId)??"")??""}),f.jsx("span",{className:"shrink-0 text-muted tabular-nums",children:co((T==null?void 0:T.updatedAt)??(j==null?void 0:j.updatedAt)??0)})]},N.key)})})]})}),document.body)}const ab="!";function vR(e){return e.startsWith(ab)?e.slice(ab.length).trim():null}function jDn(e){return e.startsWith(ab)?e.slice(ab.length):e}function TDn(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 ADn(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function RDn(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` +`,u+3),p=_===-1?e.length:_;/^[ \t]*$/.test(e.slice(h,u))&&/^[ \t\r]*$/.test(e.slice(u+3,p))&&a.push(u)}for(let u=0;u+1`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),lDn(t,n)}function cH(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function fDn(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Gr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=fDn(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const lH=A.createContext(void 0);function uH({projectId:e,sessionId:n,children:t}){const r=A.useMemo(()=>(s,i=!1)=>{if(/^(https?:)?\/\//i.test(s))return s;const a=$B(s);return a?(a.source==="absolute"?GL(a.path):a.source==="artifact"&&!i?sf(e,a.path):k3(e,a.source==="artifact"?`artifacts/${a.path}`:a.path,{sessionId:n??void 0}))+a.hash:null},[e,n]);return f.jsx(lH,{value:r,children:t})}function dDn({src:e,alt:n,name:t,onClose:r}){const s=A.useRef(null),i=A.useRef(null),[a,o]=A.useState(1),[c,u]=A.useState({width:0,height:0}),[h,_]=A.useState({width:0,height:0});A.useEffect(()=>{const m=s.current;m==null||m.showModal(),m==null||m.focus();const w=i.current,k=new ResizeObserver(([v])=>{u({width:v.contentRect.width,height:v.contentRect.height})});return w&&k.observe(w),()=>{k.disconnect(),m==null||m.close()}},[]);const p=h.width&&c.width?Math.min(1,c.width*.9/h.width,c.height*.9/h.height):1;return Fi.createPortal(f.jsxs("dialog",{ref:s,tabIndex:-1,"aria-label":n||TD(),onCancel:m=>{m.preventDefault(),r()},className:"fixed inset-0 m-0 max-w-none max-h-none w-full h-dvh border-0 outline-none bg-transparent p-0 text-text backdrop:bg-image-backdrop",onClick:m=>{m.stopPropagation(),m.target===m.currentTarget&&r()},children:[f.jsx("div",{ref:i,className:"absolute inset-x-4 sm:inset-x-12 top-16 bottom-32 overflow-auto overscroll-contain",onClick:m=>{m.target===m.currentTarget&&r()},children:f.jsx("div",{className:"flex min-h-full min-w-full w-max pointer-events-none",children:f.jsx("img",{src:e,alt:n,onLoad:m=>_({width:m.currentTarget.naturalWidth,height:m.currentTarget.naturalHeight}),style:h.width?{width:h.width*p*a,height:h.height*p*a}:void 0,className:`pointer-events-auto block m-auto shrink-0 max-w-none rounded-lg shadow-modal ${h.width&&c.width?"visible":"invisible"}`})})}),f.jsxs("div",{className:"absolute top-5 right-5 flex gap-2",children:[f.jsx(Ih,{shape:"circle",href:e,download:t||!0,"aria-label":_3(),title:_3(),className:"bg-background shadow-popover",children:f.jsx(Lb,{size:16})}),f.jsx(Ft,{shape:"circle",onClick:r,"aria-label":y3(),title:y3(),className:"bg-background shadow-popover",children:f.jsx(_r,{size:16})})]}),f.jsxs("div",{className:"absolute bottom-6 inset-x-6 flex flex-col items-center gap-3 pointer-events-none",children:[n&&f.jsx("div",{className:"max-w-xl line-clamp-2 rounded-xl bg-background px-4 py-2 text-center text-sm leading-snug shadow-popover",children:n}),f.jsxs("div",{className:"pointer-events-auto flex items-center gap-1 rounded-full bg-background p-1.5 shadow-popover",children:[f.jsx(Ft,{shape:"circle",disabled:a<=.25,onClick:()=>o(m=>Math.max(.25,m-.25)),"aria-label":QN(),title:QN(),children:f.jsx(x5n,{size:16})}),f.jsxs(Oe,{variant:"ghost",className:"min-w-16 tabular-nums",onClick:()=>o(1),title:XN(),"aria-label":XN(),children:[Math.round(a*100),"%"]}),f.jsx(Ft,{shape:"circle",disabled:a>=4,onClick:()=>o(m=>Math.min(4,m+.25)),"aria-label":WN(),title:WN(),children:f.jsx($h,{size:16})})]})]})]}),document.body)}function hDn({src:e,fallbackSrc:n,downloadName:t,alt:r="",...s}){const[i,a]=A.useState(!1),[o,c]=A.useState(!1),u=i&&n?n:e;return f.jsxs(f.Fragment,{children:[f.jsx("img",{...s,src:u,alt:r,role:"button",tabIndex:0,"aria-haspopup":"dialog",onClick:h=>{h.preventDefault(),h.stopPropagation(),c(!0)},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),h.stopPropagation(),c(!0))},onError:!i&&n&&n!==e?()=>a(!0):void 0}),o&&u&&f.jsx(dDn,{src:u,alt:r,name:t,onClose:()=>c(!1)})]})}const pDn=1e5;function mDn({code:e,lang:n}){const[t,r]=A.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Ft,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:Yk(),"aria-label":utt(),onClick:s,children:t?f.jsx(Pi,{size:13}):f.jsx(Sf,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:f6n(e,n,pDn)})})]})}function gDn(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function uR(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),c=gDn(a[2]??"");if(!c[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:a4(e,s,a.index)});const h=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:c},position:a4(e,a.index,h),type:o==="run"?"runMention":"fileMention"}),s=h}return i?(s_H(e)}function bDn(){return e=>{const n=t=>{var r;for(const s of["href","src"])if(t.properties&&Object.hasOwn(t.properties,s)){const i=String(t.properties[s]||"");t.properties[s]=s==="src"&&t.tagName==="img"&&E6(i)?i:AP(i)}(r=t.children)==null||r.forEach(n)};n(e)}}function fR({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?XY({path:Ce(e)}):e,...Gr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(qI,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(XI,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function yDn({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?kZ({id:Ce(e)}):SJ({id:Ce(e)}),...Gr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(yS,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||$L()}),f.jsx(XI,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const fH={singleDollarTextMath:!0},xDn=py().use(gy).use(iH).use(aH,fH).use(nDn).use(vDn).use(Yv).use(bDn).use(OF);function wDn(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const dH={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` +`)))return f.jsx("code",{className:s,...r,children:t});const c=i?V3(i[1]):null;return f.jsx(mDn,{code:a,lang:c})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})};function kDn({children:e}){return f.jsx("figure",{className:"my-6 mx-auto max-w-full text-left [&_img]:mx-auto [&_img]:my-0 [&_img]:w-auto [&_img]:h-auto [&_img]:max-h-[min(480px,60vh)] [&_img]:object-contain [&_img]:border-0 [&_img]:rounded-none",children:e})}const nc=A.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){wf();const o=A.useContext(lH),c=i??o,u=A.useMemo(()=>({"file-mention":h=>f.jsx(fR,{path:h.path,lines:h.lines,exp:h.exp,onOpenFile:t}),"run-mention":h=>f.jsx(yDn,{id:h.id,label:h.label,onOpenRun:r}),a:({node:h,href:_,children:p,"data-figure-src":m,...w})=>{const k=typeof m=="string"?$B(m):null;if(k&&t){const v=k.source==="artifact"?`artifacts/${k.path}`:k.path,b=s?s(v):v;if(b)return f.jsx("button",{type:"button",className:"text-primary underline cursor-pointer text-start",...Gr(x=>t(b,void 0,void 0,void 0,x)),children:p})}if(_&&wDn(_)&&t){let v;try{v=decodeURI(_)}catch{return f.jsx("span",{children:p})}const b=s?s(v):v;return b?f.jsx(fR,{path:b,onOpenFile:t}):f.jsx("span",{children:p})}return f.jsx("a",{href:_,target:"_blank",rel:"noopener noreferrer",...w,children:p})},figure:({children:h})=>f.jsx(kDn,{children:h}),figcaption:({children:h})=>f.jsx("figcaption",{className:"mt-3 text-sm italic leading-relaxed text-text",children:h}),th:({node:h,..._})=>f.jsx("th",{dir:"auto",..._}),td:({node:h,..._})=>f.jsx("td",{dir:"auto",..._}),img:({node:h,src:_,alt:p,className:m,...w})=>{var v;if(!_||typeof _!="string")return null;const k=c?c(_):_;return k?A.createElement(hDn,{...w,key:k,downloadName:(v=_.split(/[\\/]/).pop())==null?void 0:v.split(/[?#]/)[0],src:k,fallbackSrc:i?null:o==null?void 0:o(_,!0),alt:p??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border cursor-zoom-in focus-visible:outline-2 focus-visible:outline-primary ${m??""}`}):null},...dH}),[t,r,s,i,o,c]);return f.jsx("div",{dir:"auto","data-streaming":a||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-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_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-prose-emphasis [&_.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-sm [&_.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-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_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-start [&_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-start [&_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]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-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:f.jsx(oTn,{content:cH(n,{predictMath:a}),processor:xDn,components:u,predict:a})})}),dR="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function SDn({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,c]=A.useState(!1),u=A.useRef(null),[h,_]=A.useState(!1),[p,m]=A.useState(""),w=A.useRef(null);A.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&c(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),A.useEffect(()=>{var v;h&&((v=w.current)==null||v.focus())},[h]);const k=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),_(!1)};return f.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-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(yS,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?Rxt({agent:Ce(n)}):Cxt({agent:Ce(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Gr(t),children:Zxt()})]}),h?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:w,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:E2t(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),_(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),k())}}),f.jsxs("div",{className:dR,children:[f.jsx(Oe,{size:"small",onClick:()=>{m(""),_(!1)},children:aL()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Oe,{size:"small",variant:"primary",onClick:k,children:[f2t(),f.jsx(HI,{size:13})]})]})]}):f.jsxs("div",{className:dR,children:[f.jsx(Oe,{size:"small",onClick:i,children:i2t()}),f.jsx(Oe,{size:"small",onClick:()=>_(!0),children:b2t()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Oe,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:sxt()}),f.jsx(Oe,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":Gxt(),onClick:()=>c(v=>!v),children:f.jsx(ac,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(Dn,{onClick:()=>{c(!1),r("bypassPermissions")},children:_xt()})})]}):f.jsx(Oe,{size:"small",variant:"primary",onClick:()=>r(),children:vxt()})]})]})}function hR({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=A.useState(""),[o,c]=A.useState(!1),[u,h]=A.useState(null);async function _(p){if(p.preventDefault(),!(o||!i.trim())){c(!0),h(null);try{n(await e(i.trim())),a("")}catch(m){h(m instanceof Error?m.message:String(m))}finally{c(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:_,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Oe,{type:"submit",disabled:o||!i.trim(),children:o?va():ic()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??zKe()}),u&&f.jsx("div",{className:"error",children:u})]})}function hH({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}function CDn({settings:e}){const[n,t]=A.useState(!1);return f.jsxs("label",{className:"inline-flex max-w-full flex-wrap items-center gap-2 text-sm text-subtext",children:[Lln(),f.jsx("span",{className:"inline-block w-max max-w-full",children:f.jsx(ec,{variant:"field",dropDown:!0,value:e.defaultHost??"",disabled:n,choices:[{id:"",label:wL()},...e.defaultHost&&!e.hosts.some(r=>r.host===e.defaultHost)?[{id:e.defaultHost,label:e.defaultHost}]:[],...e.hosts.map(r=>({id:r.host,label:r.host}))],onSelect:r=>{t(!0),rxn(r||null).catch(s=>{bn(s instanceof Error?s.message:String(s),"error")}).finally(()=>t(!1))}})})]})}function EDn({host:e,connecting:n,reference:t,onChange:r}){const s=A.useId(),i=dn({mutationFn:nxn,scope:{id:`ssh-settings-${e.host}`}});function a(o){r(o),i.reset(),!(o!==null&&!o.trim())&&i.mutate({host:e.host,container:(o==null?void 0:o.trim())??null})}return f.jsxs("details",{className:"pb-3",children:[f.jsx("summary",{className:"w-fit cursor-pointer rounded-sm text-sm text-subtext focus-visible:outline-2 focus-visible:outline-text",children:YD()}),f.jsxs("div",{className:"mt-3 grid max-w-xl gap-3",children:[f.jsxs("label",{className:"text-sm text-subtext",children:[run(),f.jsx(ec,{variant:"field",dropDown:!0,value:t!==null?"container":"host",disabled:n,choices:[{id:"host",label:qln()},{id:"container",label:Xln()}],onSelect:o=>a(o==="container"?"":null)})]}),t!==null&&f.jsxs("label",{className:"text-sm text-subtext",htmlFor:`${s}-container`,children:[jln(),f.jsx(Ur,{id:`${s}-container`,value:t,disabled:n,required:!0,onChange:o=>a(o.target.value)})]}),i.error&&f.jsx("p",{className:"m-0 text-sm text-accent-red",role:"status",children:i.error.message})]})]})}const rc=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.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-base [&_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(" "),_f=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),NDn=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Ay="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ua=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),cC=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.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-start","[&_.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-control-subtle","[&_.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-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.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]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-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-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.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-start [&_.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-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.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-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.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","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),sl=["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","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),H5=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.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-base","[&_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-base [&_.kv_.v]:break-normal","[@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(" "),x0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),gd=["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(" "),zDn=new Set(["gh auth login","hf auth login","claude auth status"]);function pH(e){return zDn.has(e)?`/api/settings/commands/run?command=${encodeURIComponent(e)}`:void 0}function Ry(){const[e,n]=A.useState(null);return{run:e,start:(r,s,i)=>n(a=>({command:r,path:s,owner:i,attempt:((a==null?void 0:a.attempt)??0)+1})),clear:()=>n(null)}}function lC({note:e,className:n,disabled:t,resolve:r=pH,onRun:s}){return e?f.jsx("p",{className:n,children:vh(e,{canRun:i=>!t&&r(i)!==void 0,onRun:i=>{const a=r(i);a&&s(i,a)}})}):null}function My({run:e,onComplete:n,onClose:t}){return e?f.jsx(wkn,{path:e.path,label:e.command,onComplete:n,onError:r=>bn(r,"error"),onClose:t},`${e.command}-${e.attempt}`):null}function o4(e){return e.catalogPending?{cls:"warn",variant:"warning",label:nf()}:e.agentReady&&!e.authenticated&&e.authMethod!=="local"?{cls:"warn",variant:"warning",label:JD()}:e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?Jk():NXt()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:TFt()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:eL()}:e.needsConfigRepair||e.authState==="unknown"?{cls:"warn",variant:"warning",label:b3()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:FZt()}:{cls:"warn",variant:"warning",label:kL()}:{cls:"warn",variant:"warning",label:tVt()}}function jDn({h:e}){return e.id==="opencode"&&e.agentReady&&!e.authenticated&&!e.authMethod?f.jsx(f.Fragment,{children:_Tt()}):e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:zv()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?vDt():Zk()}):f.jsx(f.Fragment,{children:"—"})}function TDn(e,n,t){if(!n)return;const r=n.installUrl!==void 0&&t.includes(n.installUrl),s=t===n.login?"login":t===n.install?"install":t===n.update?"update":r?"install":null;if(s&&!(s!=="install"&&(!e.installed||e.installBroken)))return`/api/harnesses/setup?${new URLSearchParams({harness:e.id,action:s,shell:"true"})}`}function ADn({remote:e}){const n=Mu(),{data:t=null}=ut(n),[r,s]=A.useState(null),[i,a]=A.useState(!1),o=Ry(),[c,u]=A.useState(null),h=ut(aI()),_=(w,k=!1)=>{a(!0),af(w,k).catch(()=>{}).finally(()=>a(!1))},p=[...t??[]].sort((w,k)=>Number(k.agentReady)-Number(w.agentReady)),m=p.find(w=>w.id===r)??p[0];return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:v3()}),!e&&c&&h.data&&f.jsx(h$,{harness:c,commands:h.data[c.id],onClose:()=>u(null)}),f.jsx("div",{className:"mt-3 mb-3.5 w-fit max-w-full [&_.option-menu]:w-max",children:f.jsx(ec,{variant:"field",dropDown:!0,title:v3(),choices:p.map(w=>({id:w.id,label:w.name})),value:(m==null?void 0:m.id)??null,onSelect:w=>{const k=p.find(v=>v.id===w);k&&s(k.id)},renderIcon:w=>{const k=p.find(v=>v.id===w.id);return k&&f.jsx(bh,{harness:k.id})},renderLabel:w=>{const k=p.find(b=>b.id===w.id),v=k&&o4(k);return f.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[w.label,v&&f.jsxs(f.Fragment,{children:[f.jsx("span",{"aria-hidden":"true",className:`size-1.5 shrink-0 rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${v.cls}`}),f.jsx("span",{className:"sr-only",children:v.label})]})]})}})}),t?m?f.jsxs("div",{className:rc,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Wt,{variant:o4(m).variant,children:o4(m).label}),f.jsx("div",{className:"spacer flex-1"}),!e&&!m.catalogPending&&m.installed&&!m.installBroken&&!m.authenticated&&!m.needsConfigRepair&&m.authMethod!=="local"&&m.authMethod!=="apiKey"&&m.authState!=="unsupported"&&f.jsxs(Oe,{size:"small",onClick:()=>u(m),disabled:!h.data,"aria-haspopup":"dialog",children:[f.jsx(Cf,{size:14})," ",UD()]}),f.jsxs(Oe,{size:"small",onClick:()=>_(!0,!0),disabled:i,children:[f.jsx(Qa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Cm()]})]}),f.jsxs("div",{className:ys(_f,"[&_.v]:text-sm"),children:[f.jsx("span",{className:"k",children:YLt()}),f.jsx("span",{className:"v",children:m.binPath??GOt()}),f.jsx("span",{className:"k",children:jL()}),f.jsx("span",{className:"v",children:m.version??"—"}),f.jsx("span",{className:"k",children:vLt()}),f.jsx("span",{className:"v",children:f.jsx(jDn,{h:m})}),m.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:m.id==="opencode"?KJt():rS()}),f.jsx("span",{className:"v",children:m.account})]}),m.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:dKt()}),f.jsx("span",{className:"v",children:m.org})]}),m.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:hWt()}),f.jsx("span",{className:"v",children:m.plan})]}),f.jsx("span",{className:"k",children:iLt()}),f.jsx("span",{className:"v",children:m.catalogPending?nf():m.models.length>0?$Mt({count:tn(m.models.length),models:new Intl.ListFormat(N()).format(m.models.slice(0,4).map(w=>Ce(K1(w))))}):nS()})]}),f.jsx(lC,{note:m.agentNote,className:ys(Ua,"text-sm"),disabled:e,resolve:w=>{var k;return TDn(m,(k=h.data)==null?void 0:k[m.id],w)??pH(w)},onRun:(w,k)=>o.start(w,k,m.id)}),o.run&&f.jsx("div",{hidden:o.run.owner!==m.id,children:f.jsx(My,{run:o.run,onComplete:()=>_(!0,!0),onClose:o.clear})}),m.id==="opencode"&&f.jsx(b$,{installed:m.installed})]}):null:f.jsxs(Vr,{children:[f.jsx(jt,{})," ",GBt()]})]})}function RDn({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Wt,{variant:"success",children:k$t()}):f.jsx(Wt,{variant:"error",children:tGt()}):f.jsx(Wt,{variant:"error",children:r$t()}):f.jsx(Wt,{variant:"error",children:gHt()})}function MDn({onEditState:e}){var T;const n=dn({mutationFn:Kyn}),t=Vz(),r=ut(t),s=r.data??null,i=j=>{Yr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,c]=A.useState(""),[u,h]=A.useState(""),[_,p]=A.useState(!1),[m,w]=A.useState(!1),[k,v]=A.useState(null),b=j=>{i(j),c(j.context??""),h(j.namespace)},x=A.useRef(null);A.useEffect(()=>{const j=x.current;x.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(c(s.context??""),h(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;A.useEffect(()=>{e==null||e({dirty:C,saving:_})},[C,_,e]);async function z(){if(!(m||_||!y)){w(!0);try{await Je.fetchQuery({...Vz(),staleTime:0})}catch(j){bn(j instanceof Error?j.message:String(j),"error")}finally{w(!1)}}}async function E(j){if(j.preventDefault(),!(_||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:Lh()}),f.jsx("dd",{className:"m-0",children:m||_?f.jsx(Wt,{children:ha()}):C?f.jsx(Wt,{children:PD()}):f.jsx(RDn,{s})})]}),y&&!m&&!_&&s.preflight.error&&f.jsx("p",{className:`${Ay} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:E,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[T$t(),f.jsx(ec,{choices:[{id:"",label:s.currentContext?wRt({context:Ce(s.currentContext)}):pRt()},...o&&!s.contexts.includes(o)?[{id:o,label:ZOt({context:Ce(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:_||m,onSelect:c})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[aUt(),f.jsx(Ur,{type:"text",value:u,disabled:_||m,onChange:j=>h(j.target.value),placeholder:vBt(),autoComplete:"off",spellCheck:!1})]}),k&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:k}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",onClick:()=>void z(),disabled:_||m||!y,children:[f.jsx(Qa,{size:13})," ",m?ha():km()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:_||m||y,children:_?va():ic()})]})]})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",SIt()]})})}function ODn(){var y;const e=dn({mutationFn:C=>Qyn(...C)}),n=Kz(),t=ut(n),r=t.data??null,s=C=>{Yr(n.queryKey,z=>(typeof C=="function"?C(z??null):C)??void 0)},[i,a]=A.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[c,u]=A.useState(""),[h,_]=A.useState(""),[p,m]=A.useState(!1),w=t.isPending||p,[k,v]=A.useState(!1);async function b(){if(!(w||k)){m(!0),a(null);try{await Je.fetchQuery({...Kz(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function x(C){if(C.preventDefault(),!(!c.trim()||!h.trim()||w||k||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([c.trim(),h.trim()])),u(""),_("")}catch(z){a(z instanceof Error?z.message:String(z))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&w?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",AIt()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Lh()}),f.jsx("dd",{className:"m-0",children:f.jsx(Wt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?iS():Ab()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:XRt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:x,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?rMt():SMt(),f.jsx(Ur,{type:"password",value:c,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?uMt():AMt(),f.jsx(Ur,{type:"password",value:h,onChange:C=>_(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:gMt()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",disabled:w||k,onClick:()=>void b(),children:[f.jsx(Qa,{size:13})," ",Cm()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!c.trim()||!h.trim()||w||k||(r==null?void 0:r.processEnv),children:k?va():ic()})]})]})]})}const mH="rounded-sm border-border-strong bg-surface text-subtext",gH="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",DDn=5e3;function vH(e){const n=Va(),t=e.map(a=>Wz(a)),r=iK({queries:t.map(a=>({...a,refetchInterval:DDn}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Yr(Wz(a).queryKey,{running:!0})}]}function LDn({test:e,connecting:n,masterRunning:t,containerFailed:r=!1}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Wt,{className:gH,children:fL()})});if(e===void 0)return f.jsx(Wt,{className:mH,children:xL()});const s=e.missingTools??[],i=e.reachable&&e.toolsFound&&t===!1,a=!e.reachable||r?f.jsx(Wt,{className:"rounded-sm",variant:"error",children:sS()}):e.toolsFound?i?f.jsx(Wt,{className:"rounded-sm",variant:"warning",children:dL()}):f.jsx(Wt,{className:"rounded-sm",variant:"success",children:Sm()}):f.jsx(Wt,{className:"rounded-sm",variant:"error",children:s.length===1?GMt({tool:Ce(s[0])}):ZMt()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[a,!i&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:wo(e.testedAt)})]})}function IDn({remote:e=!1}){var I;const n=iI(),t=ut(n),r=((I=t.data)==null?void 0:I.hosts)??(t.isError?[]:null),[s,i]=A.useState(!1),[a,o]=A.useState({}),[c,u]=A.useState({}),h=A.useRef(0),[_,p]=A.useState(!1),[m,w]=A.useState({}),[k,v]=A.useState(null),[b,x]=A.useState(!1),[y,C]=A.useState(0),z=e?[]:(r==null?void 0:r.filter($=>{const q=a[$.host]??$.lastTest;return(q==null?void 0:q.reachable)&&q.toolsFound}).map($=>$.host))??[],[E,T]=vH(z);function j($){h.current+=1,p(!1),x(!1),C(q=>q+1),v($),w(q=>({...q,[$]:!0}))}function M(){h.current+=1,p(!1),x(!1),v(null)}function D($,q){w(H=>({...H,[$]:!q}))}return f.jsxs(f.Fragment,{children:[t.error&&f.jsx("p",{className:"text-sm text-accent-red",children:t.error.message}),f.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3",children:[!e&&t.data&&f.jsx(CDn,{settings:t.data}),f.jsxs(Oe,{variant:"ghost",className:"ms-auto",onClick:()=>i(!0),children:[f.jsx(xS,{size:14})," ",DL()]})]}),r===null?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",CL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:WUt()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map($=>{var ne,oe,ue;const q=c[$.host]===void 0?$.container??null:c[$.host],H=a[$.host],Q=q!==null&&((ne=H==null?void 0:H.container)==null?void 0:ne.reference)===q.trim()?H:void 0,V=q!==null?Q:H!=null&&H.container?$.lastTest:H??$.lastTest,Z=(oe=Q==null?void 0:Q.container)==null?void 0:oe.error,Y=((ue=Q==null?void 0:Q.container)==null?void 0:ue.ready)===!1,B=(V==null?void 0:V.error)||Z,L=k===$.host,F=m[$.host]??!1,U=!e&&(L||!!B),K=`${$.user?`${$.user}@`:""}${$.hostname??$.host}${$.port?`:${$.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3",children:[f.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:$.host,children:$.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:K,children:K})]})}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsxs("div",{className:"flex items-center gap-2 text-start",children:[f.jsx(LDn,{test:V,connecting:L&&!b,masterRunning:E[$.host],containerFailed:Y}),U&&f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":F,"aria-label":F?mX({name:Ce($.host)}):nY({name:Ce($.host)}),onClick:se=>{se.stopPropagation(),D($.host,F)},children:f.jsx(ac,{size:18,className:`text-muted transition-transform duration-120 ease-standard${F?" rotate-180":""}`})})]}),f.jsx(Oe,{size:"small",type:"button",className:"justify-self-end",onClick:se=>{se.stopPropagation(),L&&!b?M():j($.host)},disabled:!L&&(k!==null&&!b||q!==null&&!q.trim()),children:L?b?Ys():rf():(V==null?void 0:V.reachable)===!1||Y?Ys():V?TL():eS()})]})]}),!e&&f.jsx(EDn,{host:$,connecting:L&&!b,reference:q,onChange:se=>{L&&M(),u(G=>({...G,[$.host]:se})),o(G=>{const ae={...G};return delete ae[$.host],ae})}}),U&&(F||L)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3${F?"":" hidden"}`,children:[!L&&B&&f.jsx(kkn,{host:$.host,transcript:B}),L&&!_&&f.jsx(CS,{host:$.host,backend:"ssh",active:F,onComplete:se=>{if(se.backend!=="ssh")return;T($.host);const G=h.current;if(q===null){o(ae=>({...ae,[$.host]:{...se.result,container:null}})),x(!1),v(null);return}p(!0),sxn($.host,q.trim()).then(ae=>{h.current===G&&o(ce=>({...ce,[$.host]:{...ae,container:ae.container??{reference:q.trim(),ready:!1,error:ae.error??null}}}))}).catch(ae=>{h.current===G&&o(ce=>({...ce,[$.host]:{...se.result,container:{reference:q.trim(),ready:!1,error:ae instanceof Error?ae.message:String(ae)}}}))}).finally(()=>{h.current===G&&(p(!1),x(!1),v(null))})},onError:se=>{x(!0),o(G=>({...G,[$.host]:{container:q===null?null:{reference:q.trim(),ready:!1,error:se},reachable:!1,toolsFound:!1,missingTools:[],error:se,testedAt:Date.now()}}))}},y)]})]},$.host)})}),s&&f.jsx(U$,{onClose:()=>i(!1)})]})}function $Dn({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Wt,{className:gH,children:fL()}):e===null?f.jsx(Wt,{className:mH,children:xL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Wt,{className:"rounded-sm",variant:"warning",children:dL()}):f.jsx(Wt,{className:"rounded-sm",variant:"success",children:Sm()}):f.jsx(Wt,{className:"rounded-sm",variant:"error",children:Rqt()}):f.jsx(Wt,{className:"rounded-sm",variant:"error",children:jGt()}):f.jsx(Wt,{className:"rounded-sm",variant:"error",children:sS()})}function BDn({remote:e=!1}){var B;const n=dn({mutationFn:pxn}),t=k2n(),r=ut(t),s=r.data??null,i=L=>{Yr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((B=r.error)==null?void 0:B.message)??null,[o,c]=A.useState(""),[u,h]=A.useState(""),[_,p]=A.useState(""),[m,w]=A.useState(""),[k,v]=A.useState(!1),[b,x]=A.useState(null),[y,C]=A.useState(null),[z,E]=A.useState(!1),[T,j]=A.useState(!1),[M,D]=A.useState(0),I=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,q]=vH(I);function H(){j(!1),D(L=>L+1),E(!0)}const Q=L=>{i(L),c(L.host??""),h(L.partition??""),p(L.account??""),w(L.timeLimit??"")},V=A.useRef(null);A.useEffect(()=>{const L=V.current;V.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&_.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(c(s.host??""),h(s.partition??""),p(s.account??""),w(s.timeLimit??""))},[s,o,u,_,m]);const Z=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&_.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function Y(L){if(L.preventDefault(),!k){v(!0),x(null);try{Q(await n.mutateAsync({host:o,partition:u.trim(),account:_.trim(),timeLimit:m.trim()}))}catch(F){x(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!z&&(y==null?void 0:y.error)&&f.jsx("p",{className:Ay,children:y.error}),f.jsxs("form",{className:cC,onSubmit:Y,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vqt(),f.jsx(ec,{choices:[{id:"",label:wL()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:k||z,onSelect:L=>{c(L),C(null),E(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Oe,{type:"button",onClick:()=>{z&&!T?(j(!1),E(!1)):H()},disabled:!o,title:o?void 0:PJt(),children:z?T?Ys():rf():y?TL():eS()}),f.jsx("span",{role:"status",children:f.jsx($Dn,{test:y,connecting:z&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[eWt(),f.jsx(Ur,{type:"text",list:"slurm-partitions",value:u,onChange:L=>h(L.target.value),placeholder:Az(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[rS(),f.jsx(Ur,{type:"text",value:_,onChange:L=>p(L.target.value),placeholder:Az(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[wZt(),f.jsx(Ur,{type:"text",value:m,onChange:L=>w(L.target.value),placeholder:XIt(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Oe,{variant:"primary",type:"submit",disabled:k||Z||z,children:k?va():ic()})})]}),!e&&z&&f.jsx(CS,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),q(o),j(!1),E(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",UHt()]})})}function PDn(){var C;const e=dn({mutationFn:gxn}),n=S2n(),t=ut(n),r=t.data??null,s=z=>{Yr(n.queryKey,E=>(typeof z=="function"?z(E??null):z)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=A.useState(""),[c,u]=A.useState(!1),[h,_]=A.useState(null),[p,m]=A.useState(null),w=p!==null&&p!=="testing"?p:null,k=z=>{s(z),o(z.address??"")},v=A.useRef(null);A.useEffect(()=>{const z=v.current;v.current=r,r&&(!z||a===(z.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function x(z){if(z.preventDefault(),!c){u(!0),_(null);try{k(await e.mutateAsync({address:a}))}catch(E){_(E instanceof Error?E.message:String(E))}finally{u(!1)}}}async function y(){m("testing");try{m(await vxn(a.trim()||void 0))}catch(z){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:z instanceof Error?z.message:String(z)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(w==null?void 0:w.error)&&f.jsx("p",{className:Ay,children:w.error}),f.jsxs("form",{className:cC,onSubmit:x,children:[f.jsxs("label",{children:[uHt(),f.jsx(Ur,{type:"text",value:a,onChange:z=>{o(z.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[iPt(),": ",Ce(r.resolvedAddress)," · ",EL(),": ",r.source]}),h&&f.jsx("div",{className:"error",children:h}),f.jsxs("div",{className:"actions",children:[f.jsx(Oe,{variant:"primary",type:"submit",disabled:c||b,children:c?va():ic()}),f.jsx(Oe,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:OYt()}),f.jsx(FDn,{test:p})]}),(w==null?void 0:w.reachable)&&w.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zWt(),": ",w.rayVersion]})]})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",IHt()]})})}function FDn({test:e}){return e===null?null:e==="testing"?f.jsx(Wt,{children:FYt()}):e.reachable?f.jsx(Wt,{variant:"success",children:DWt()}):f.jsx(Wt,{variant:"error",children:sS()})}function HDn(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:nl(e.memBytes),r=e.gpus.length===0?null:VTt({count:e.gpus.length});return[n,e.cpuCount>0?vjt({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function qDn({remote:e}){var p;const n=ut(E2n()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=A.useState(0),[o,c]=A.useState(!0),[u,h]=A.useState(!1),_=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:NDn,children:[f.jsx("span",{className:"k",children:Lh()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Wt,{className:"gap-1.5",role:"status",children:[f.jsx(jt,{}),u?RDt():ha()]}):r?f.jsx(Wt,{variant:"warning",children:b3()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Wt,{variant:"success",children:Sm()}):t.sshKeyStatus==="unknown"?f.jsx(Wt,{variant:"warning",children:b3()}):f.jsx(Wt,{variant:"warning",children:Ab()}):f.jsx(Wt,{variant:"warning",children:kL()}):null}),f.jsx("span",{className:"k",children:yKt()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:PXt()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Wt,{variant:"success",children:OVt()}):t.sshKeyStatus==="no_local_match"?f.jsx(Wt,{variant:"warning",children:pVt()}):t.sshKeyStatus==="none_registered"?f.jsx(Wt,{variant:"error",children:LGt()}):f.jsx(Wt,{children:NL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:LRt({command:Ce("orx login")})}),!e&&i>0&&f.jsx(xkn,{login:o,onComplete:()=>{h(!1),a(0),_()},onError:m=>{h(!1),bn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ua,children:[GDt()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ua,children:[wGt()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),WYt()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ua,children:aen({register:Ce(`orx ssh-key add ${t.sshKeyPath}`),load:Ce("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ua,children:[pGt()," ",f.jsx("code",{children:"ssh-add"}),aKt()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Oe,{onClick:()=>void _(),disabled:s||u,children:[f.jsx(Qa,{size:13})," ",s?ha():km()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Oe,{variant:"primary",disabled:s||u,onClick:()=>{c(!t.loggedIn),h(!0),a(m=>m+1)},children:[u?f.jsx(jt,{}):f.jsx(Cf,{size:13})," ",t.loggedIn?Wtn():AL()]})]})]})}const UDn={local:TTe,ssh:_Ae,tinker:vAe,hf:mTe,modal:ITe,k8s:kTe,slurm:sAe,ray:YTe,openresearch:UTe},Oy={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},pR=["hf","modal","slurm","ray","openresearch"],c4=["hf","modal","openresearch"],bH={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"]},q5=["tinker","hf","modal","ray","k8s"],GDn={tinker:eMe,hf:MRe,modal:PRe,openresearch:KRe},mR="__custom__";function Xp(e,n){return!!(n&&!(bH[e]??[]).includes(n))}function VDn({settings:e,projectId:n,onSaved:t}){const r=dn({mutationFn:yxn}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=A.useState(s),[c,u]=A.useState(i),[h,_]=A.useState(Xp(s,i)),[p,m]=A.useState(!1),[w,k]=A.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),x=pR.includes(a),y=c4.includes(a),C=bH[a]??[],z=a===s&&(!x||c.trim()===i),E=lf[a](),T=GDn[a],j=p?tsn():y&&!c.trim()?VNt({destination:E}):a==="ssh"?fOt():iOt({destination:E});A.useEffect(()=>{o(s),u(i),_(Xp(s,i))},[s,i]);async function M($,q){const H=pR.includes($);if(!(p||c4.includes($)&&!q.trim())){m(!0),k(null);try{t(await r.mutateAsync({backend:$,flavor:H&&q.trim()||null,projectId:n}))}catch(Q){k(Q instanceof Error?Q.message:String(Q)),o(s),u(i),_(Xp(s,i))}finally{m(!1)}}}function D($){const q=e.targets.find(Q=>Q.id===$);if(!q)return;o(q.id);const H=q.id===s?i:"";u(H),_(Xp(q.id,H)),c4.includes(q.id)||M(q.id,H)}function I($){if($===mR){_(!0);return}_(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:ABt()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),z||M(a,c)},children:[f.jsx(ec,{choices:b.map($=>({id:$.id,label:lf[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const q=e.targets.find(H=>H.id===$.id);return q?f.jsx(Bh,{kind:Oy[q.id],size:16}):null},onSelect:D}),x&&f.jsx("div",{children:h?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:c,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!c.trim()){a===s&&(u(i),_(Xp(s,i)));return}z||M(a,c)},placeholder:Y$t(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":Tz(),title:Tz(),onMouseDown:$=>$.preventDefault(),onClick:()=>_(!1),children:f.jsx(ac,{size:12})})]}):f.jsx(ec,{choices:[{id:"",label:y?BNt():EOt()},...c&&!C.includes(c)?[{id:c,label:Bjt({value:Ce(c)})}]:[],...C.map($=>({id:$,label:$})),{id:mR,label:sBt()}],value:c,variant:"field",dropDown:!0,disabled:p,onSelect:I})})]}),w&&f.jsx("div",{className:"error mt-2.5",children:w}),v&&!v.configured&&f.jsx("p",{className:Ua,children:cZt()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function KDn({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?CNt():e.id==="openresearch"?AL():e.id==="ray"?eS():Ftn();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":lf[e.id](),"aria-describedby":i,"aria-haspopup":q5.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(Bh,{kind:Oy[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:lf[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:UDn[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?cRt():Nrn()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:sTt()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?vL():e.configured?!r||q5.includes(e.id)?iS():xsn():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(Q1,{size:16})})]})]})}function WDn({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(M0,{size:16})," ",mL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(Bh,{kind:Oy[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:lf[e.id]()})]}),n&&f.jsx(Wt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:vL()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(IDn,{remote:r}),e.id==="slurm"&&f.jsx(BDn,{remote:r}),e.id==="openresearch"&&f.jsx(qDn,{remote:r})]})]})}function QDn({target:e,remote:n,onClose:t}){const r=A.useRef(null),[s,i]=A.useState({dirty:!1,saving:!1});A.useEffect(()=>{const o=r.current;return o==null||o.showModal(),()=>o==null?void 0:o.close()},[]);const a=()=>{s.saving||s.dirty&&!window.confirm(tRt())||t()};return f.jsxs("dialog",{ref:r,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),a())},onCancel:o=>{o.preventDefault(),a()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(Bh,{kind:Oy[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:lf[e.id]()})]}),f.jsx(Ft,{title:A0(),"aria-label":A0(),onClick:a,disabled:s.saving,children:f.jsx(_r,{size:14})})]}),e.id==="tinker"&&f.jsx(YDn,{target:e}),e.id==="hf"&&f.jsx(JDn,{remote:n}),e.id==="modal"&&f.jsx(ODn,{}),e.id==="ray"&&f.jsx(PDn,{}),e.id==="k8s"&&f.jsx(MDn,{onEditState:i})]})}function XDn({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,D;const s=sI(e==null?void 0:e.id),i=ut(s),a=i.data??null,o=I=>{Yr(s.queryKey,$=>(typeof I=="function"?I($??null):I)??void 0)},c=a?null:((M=i.error)==null?void 0:M.message)??null,[u,h]=A.useState(null),[_,p]=A.useState(null),m=C2n(),w=ut(m),k=w.data??null,v=((D=w.error)==null?void 0:D.message)??null;A.useEffect(()=>{h(null),p(null)},[e==null?void 0:e.id]);const b=I=>{o(I),p(null)},x=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=x?[...x].sort((I,$)=>+($.id===y)-+(I.id===y)):null,z=(C==null?void 0:C.filter(I=>I.configured))??[],E=(C==null?void 0:C.filter(I=>!I.configured))??[],T=I=>f.jsx(KDn,{target:I,isDefault:y===I.id,summary:I.id==="local"?k?HDn(k):v??$Bt():void 0,onOpen:I.id==="local"?void 0:()=>h(I.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${I.id}`),j=u?a==null?void 0:a.targets.find(I=>I.id===u):null;return j&&!q5.includes(j.id)?f.jsx(WDn,{target:j,isDefault:y===j.id,onBack:()=>h(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:gL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:m$t()}),f.jsx(mLn,{projectId:e==null?void 0:e.id,onViewHistory:n}),c?f.jsx("div",{className:"error",children:c}):a?f.jsxs(f.Fragment,{children:[_&&f.jsx("div",{className:"error",children:_}),f.jsx(VDn,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:iS()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:z.map(T)})]}),E.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:Bqt()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),j&&f.jsx(QDn,{target:j,remote:r,onClose:()=>h(null)})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",gIt()]})]})}function YDn({target:e}){var x;const n=dn({mutationFn:Pyn}),[t,r]=A.useState(""),[s,i]=A.useState(!1),[a,o]=A.useState(null),c=Gz(),u=ut(c),h=u.data??null,_=a??((x=u.error)==null?void 0:x.message)??null,p=y=>{Yr(c.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,w]=A.useState(!1),k=u.isPending||m;async function v(){if(!(k||s)){w(!0),o(null);try{await Je.fetchQuery({...Gz(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{w(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||k)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!h&&k?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",ha()]}):h&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Lh()}),f.jsx("dd",{className:"m-0",children:f.jsx(Wt,{variant:h.validationStatus==="valid"?"success":h.validationStatus==="invalid"?"error":"warning",children:h.validationStatus==="valid"?Sm():h.validationStatus==="invalid"?yrn():h.validationStatus==="billingRequired"?arn():Ab()})})]}),(h==null?void 0:h.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:Jnn()})}),(h==null?void 0:h.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:drn()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||h!==null&&h.validationStatus!=="missing"?etn():Zk(),f.jsx(Ur,{type:"password",value:t,placeholder:(h==null?void 0:h.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),_&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:_}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",disabled:s||k,onClick:()=>void v(),children:[f.jsx(Qa,{size:13})," ",k?ha():km()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!t.trim()||s||k,children:s?ML():ic()})]})]})]})}function ZDn({settings:e}){return e.validationStatus==="missing"?f.jsx(Wt,{variant:"warning",children:Ab()}):e.validationStatus==="invalid"?f.jsx(Wt,{variant:"error",children:rHt()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Wt,{variant:"success",children:Sm()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Wt,{variant:"warning",children:cGt()}),f.jsx(hS,{content:dAt(),className:"text-subtext",children:f.jsx(gS,{size:15})})]}):null}function JDn({remote:e}){var x;const n=dn({mutationFn:$yn}),t=Uz(),r=ut(t),s=r.data??null,i=y=>{Yr(t.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},a=s?null:((x=r.error)==null?void 0:x.message)??null,[o,c]=A.useState(""),[u,h]=A.useState(!1),[_,p]=A.useState(!1),[m,w]=A.useState(null),k=Ry();async function v(){if(!(u||_||!s&&!a)){p(!0),w(null);try{await Je.fetchQuery({...Uz(),staleTime:0})}catch(y){w(y instanceof Error?y.message:String(y))}finally{p(!1)}}}async function b(y){if(y.preventDefault(),!(!o.trim()||u||_||!s&&!a)){h(!0),w(null);try{const C=await n.mutateAsync(o.trim());i(C),w(null),c("")}catch(C){w(C instanceof Error?C.message:String(C))}finally{h(!1)}}}return f.jsxs(f.Fragment,{children:[a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[s.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:rS()}),f.jsx("dd",{className:"m-0 text-text",children:s.username})]}),(s.validationStatus==="missing"||s.validationStatus==="invalid"||s.validationStatus==="valid"&&s.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Lh()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(ZDn,{settings:s})})]})]}),s.validationStatus==="unreachable"&&s.validationError&&f.jsx("p",{className:Ay,children:s.validationError}),s.source==="env"&&f.jsx("p",{className:Ua,children:uFt()}),s.validationStatus==="valid"&&s.jobsWrite===null&&f.jsx(lC,{note:aAt({login:"`hf auth login`",url:Ce("huggingface.co/settings/tokens")}),className:Ua,disabled:e,onRun:k.start}),f.jsx(My,{run:k.run,onComplete:()=>void r.refetch(),onClose:k.clear})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",YHt()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[s!=null&&s.configured?otn():bOt(),f.jsx(Ur,{type:"password",value:o,onChange:y=>c(y.target.value),placeholder:(s==null?void 0:s.maskedToken)??rFt(),autoComplete:"off"})]}),m&&f.jsx("div",{className:"error",children:m}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",disabled:u||_||!s&&!a,onClick:()=>void v(),children:[f.jsx(Qa,{size:13})," ",_?ha():km()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!o.trim()||u||_||!s&&!a,children:u?ML():ic()})]})]})]})}const yH=/^hf_[A-Za-z0-9]{10,}$/;function xH(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ua,children:[pZt()," ",f.jsx("code",{children:"HF_TOKEN"}),eXt()]})})})}const gR=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function U5(e,n){const t=n instanceof Error?n.message:String(n);bn(t.includes(e)?t:`${e}: ${t}`,"error")}function eLn({name:e,entry:n,onVars:t}){const r=dn({mutationFn:_=>WL(..._)}),s=dn({mutationFn:Yyn}),[i,a]=A.useState(""),[o,c]=A.useState(!1);async function u(){if(!(!i.trim()||o)){c(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(_){U5(e,_)}finally{c(!1)}}}async function h(){if(!o){c(!0);try{t(await s.mutateAsync(e))}catch(_){U5(e,_)}finally{c(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Wt,{children:KKt()})]}):f.jsx(Ur,{variant:"inline",className:"text-base",type:"password",value:i,onChange:_=>a(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),u()),_.key==="Escape"&&!o&&a("")},placeholder:zL(),"aria-label":ZJ({name:Ce(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Ft,{className:"[&:hover:not(:disabled)]:text-accent-red",title:o3({name:Ce(e)}),"aria-label":o3({name:Ce(e)}),onClick:()=>void h(),disabled:o,children:f.jsx(Ef,{size:13})}):i.trim()&&f.jsx(Oe,{size:"small",onClick:()=>void u(),disabled:o,children:o?va():ic()})})]}),!n&&e!=="HF_TOKEN"&&yH.test(i.trim())&&f.jsx(xH,{})]})}function tLn({onVars:e,onDone:n}){const t=dn({mutationFn:_=>WL(..._)}),[r,s]=A.useState(""),[i,a]=A.useState(""),[o,c]=A.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){c(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(_){U5(r.trim(),_)}finally{c(!1)}}}const h=_=>{_.key==="Enter"&&(_.preventDefault(),u()),_.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Ur,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:_=>s(_.target.value),onKeyDown:h,placeholder:"MY_API_KEY","aria-label":NUt(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Ur,{variant:"inline",className:"text-base",type:"password",value:i,onChange:_=>a(_.target.value),onKeyDown:h,placeholder:zL(),"aria-label":OUt(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Oe,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?va():ic()}),f.jsx(Ft,{title:rf(),"aria-label":uIt(),onClick:n,disabled:o,children:f.jsx(_r,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&yH.test(i.trim())&&f.jsx(xH,{})]})}function nLn(){var u;const e=N2n(),n=ut(e),t=n.data??null,r=h=>{Yr(e.queryKey,_=>(typeof h=="function"?h(_??null):h)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=A.useState(!1),o=t===null?[]:t.map(h=>h.key).filter(h=>!gR.includes(h)),c=[...gR,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:dJt()}),f.jsxs(Oe,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx($h,{size:12})," ",ZDt()]})]}),f.jsx("div",{className:rc,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-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-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[c.map(h=>f.jsx(eLn,{name:h,entry:t.find(_=>_.key===h),onVars:r},h)),i&&f.jsx(tLn,{onVars:r,onDone:()=>a(!1)})]})})})]})}const Yp=[{value:"system",label:Vnn,icon:k5n},{value:"light",label:Bnn,icon:Q5n},{value:"dark",label:Enn,icon:C5n}],rLn=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"},{id:"ar",label:"العربية"},{id:"es",label:"Español"},{id:"hi",label:"हिन्दी"}];function sLn(){const e=wf(),[n,t]=gI(),r=s=>{var h;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(_=>_===document.activeElement),u=((o===-1?Yp.findIndex(_=>_.value===n):o)+i+Yp.length)%Yp.length;t(Yp[u].value),(h=a[u])==null||h.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:GEt()}),f.jsxs("div",{className:`${rc} mt-3`,children:[f.jsxs("div",{className:`${sl} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Bz()}),f.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":Bz(),onKeyDown:r,children:Yp.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?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 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:sl,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jRt()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(ec,{choices:rLn,value:e,variant:"field",dropDown:!0,onSelect:s=>{mD(s)&&hI(s)}})})]})]})]})}const iLn={installer:Ygn,"app-bundle":Tgn,portable:_1n,cargo:Ign,homebrew:Ugn,nix:s1n,unknown:v1n},l4={cargo:C1n,homebrew:R1n,nix:B1n};function aLn(){var _;const e=dn({mutationFn:p=>Uyn(...p)}),{status:n,error:t,apply:r}=u6(),[s,i]=A.useState(null),[a,o]=A.useState(null),c=V$(n),u=s!==null||c.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:Lz()}),t?f.jsx("div",{className:rc,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]});const h=async(p,m)=>{i(p),o(null);try{await m()}catch(w){o(w instanceof Error?w.message:String(w))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:Lz()}),f.jsxs("div",{className:`${rc} mt-3`,children:[f.jsxs("div",{className:`${_f} pb-3.5`,children:[f.jsx("div",{className:"k",children:jL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:SHt()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:yL()}),f.jsx("div",{className:"v",children:iLn[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:MQt()}),f.jsx("p",{children:c.error?PL({error:c.error}):xtn({installed:Ce(n.installedVersion??"—"),current:Ce(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Oe,{size:"small",type:"button",disabled:u,onClick:c.restart,children:c.restarting?FL():BL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Mz()}),f.jsxs("p",{children:[yUt(),n.envDisabled&&Wrn()]})]}),f.jsx(dS,{type:"button",checked:n.autoUpdate,"aria-label":Mz(),disabled:u,onClick:()=>void h("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Frn({version:Ce(n.latest??"—")}):_Nt()}),f.jsx("p",{children:n.updateAvailable?WAt():RNt()})]}),f.jsx(Oe,{size:"small",type:"button",disabled:u,onClick:()=>void h("apply",()=>Hyn().then(r)),children:s==="apply"?Kk():n.updateAvailable?Orn():vNt()})]})]}):f.jsx("div",{className:sl,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:NKt()}),f.jsx("p",{children:((_=l4[n.channel])==null?void 0:_.call(l4))??den()})]})}),n.channel==="app-bundle"&&f.jsx(cLn,{busy:s,disabled:u,run:h}),a&&f.jsx("div",{className:"error",children:a})]})]})}function oLn(){var _;const e=dn({mutationFn:Bxn}),n=D2n(),t=ut(n),r=t.data??null,s=p=>{Yr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=A.useState(!1),[o,c]=A.useState(null),u=o??((_=t.error)==null?void 0:_.message)??null,h=()=>{!r||i||(a(!0),c(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>c(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:eJt()}),r?f.jsxs("div",{className:`${rc} mt-3`,children:[f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[jz(),r.locked&&r.reason&&f.jsx(hS,{content:`${U$t()} ${r.reason}.`,className:"text-subtext",children:f.jsx(gS,{size:15})})]}),f.jsx("p",{children:FUt()})]}),f.jsx(dS,{type:"button",checked:r.enabled,"aria-label":jz(),disabled:i||r.locked,onClick:h})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]})}function cLn({busy:e,disabled:n,run:t}){const r=dn({mutationFn:Gyn}),[s,i]=A.useState(null),[a,o]=A.useState(!1),c=u=>void t("cli",()=>r.mutateAsync(u).then(h=>{i(h),o(!1)}).catch(h=>{throw o(!u&&String((h==null?void 0:h.message)??h).includes("--force")),h}));return f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:OAt({command:Ce("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?azt({link:Ce(s.link)}):dzt({link:Ce(s.link)}),!s.onPath&&$Et({directory:Ce(s.dir)})]}):f.jsx("p",{children:NAt({command:Ce("orx")})})]}),f.jsx(Oe,{size:"small",type:"button",disabled:n,onClick:()=>c(a),children:e==="cli"?Kk():a?Ken():s?yen():yAt()})]})}function lLn({remote:e}){var w;const n=dn({mutationFn:k=>JL(...k)}),t=cS(),r=ut(t),s=r.data??null,i=k=>{Yr(t.queryKey,v=>(typeof k=="function"?k(v??null):k)??void 0)},[a,o]=A.useState(!1),[c,u]=A.useState(null),h=c??((w=r.error)==null?void 0:w.message)??null,_=async()=>{await r.refetch({cancelRefetch:!1})},p=Ry(),m=()=>{if(!s||a)return;const k=!s.githubForNewProjects;o(!0),u(null),n.mutateAsync([k,!0]).then(i).catch(v=>u(v instanceof Error?v.message:String(v))).finally(()=>o(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:TPt()}),s?f.jsxs("div",{className:`${rc} mt-3 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:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:IPt()}),f.jsx(Wt,{variant:s.githubAuthenticated?"success":s.ghInstalled?"warning":"error",children:s.githubAuthenticated?_L():hL()})]}),f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Rz()}),f.jsx("p",{children:EJt()})]}),f.jsx(dS,{type:"button",checked:s.githubForNewProjects,"aria-label":Rz(),disabled:a||!s.githubAuthenticated&&!s.githubForNewProjects,onClick:m})]}),!s.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(wH,{ghInstalled:s.ghInstalled,remote:e,onCheck:_,onRun:p.start})}),f.jsx(My,{run:p.run,onComplete:()=>void _(),onClose:p.clear}),h&&f.jsx("div",{className:"error",children:h})]}):h?f.jsx("div",{className:"error",children:h}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]})}function wH({ghInstalled:e,remote:n,onCheck:t,onRun:r}){const[s,i]=A.useState(!1),a=()=>{i(!0),t().finally(()=>i(!1))};return f.jsxs(f.Fragment,{children:[f.jsx(lC,{note:e?ztn():FAt(),className:"git-card-helper m-0 text-sm leading-relaxed text-text",disabled:n||!e,onRun:r}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(mh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[IFt()," ",f.jsx(of,{size:12})]}),f.jsx(Oe,{type:"button",variant:e?"warning":"default",disabled:s,onClick:a,children:s?ha():km()})]})]})}function uLn(){var m,w,k;const e=dn({mutationFn:Syn}),n=dn({mutationFn:Cyn}),t=E6n(),r=ut(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((w=r.data)==null?void 0:w.hasSession)??null,a=v=>Yr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[c,u]=A.useState(!1),[h,_]=A.useState(null),p=h??((k=r.error)==null?void 0:k.message);return f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:SL()}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:UPt()}),f.jsx("span",{className:"v",children:f.jsx(Wt,{variant:s?"success":"default",children:s===null?p?go():ha():s?$z():g3()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:MJt()}),s?f.jsx("div",{className:x0,children:f.jsx(Oe,{disabled:c,onClick:()=>{u(!0),_(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>_(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:c?Iz():Oen()})}):f.jsx(hR,{save:VL,onSaved:v=>o(v.hasToken),placeholder:PKt(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:oXt()}),f.jsx("span",{className:"v",children:f.jsx(Wt,{variant:i?"success":"default",children:i===null?p?go():ha():i?$z():g3()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:hXt()}),i?f.jsx("div",{className:x0,children:f.jsx(Oe,{disabled:c,onClick:()=>{u(!0),_(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>_(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:c?Iz():Nen()})}):f.jsx(hR,{save:v=>KL(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:d3(),createHref:"https://www.overleaf.com/project",createLabel:A1t()}),p&&f.jsx("div",{className:"error",children:p})]})}function _Ln({project:e,onProjectUpdate:n,remote:t}){var M;const r=dn({mutationFn:D=>JL(...D)}),s={...O2n((e==null?void 0:e.id)??""),enabled:!!e},i=ut(s),a=Ry(),o=i.data??null,c=D=>{Yr(s.queryKey,I=>(typeof D=="function"?D(I??null):D)??void 0)},[u,h]=A.useState(!1),[_,p]=A.useState(null),m=_??((M=i.error)==null?void 0:M.message)??null,[w,k]=A.useState(!1),[v,b]=A.useState(!1),[x,y]=A.useState(null),C=!!(o!=null&&o.github.owner&&o.github.repo),z=async()=>{await i.refetch({cancelRefetch:!1})},E=D=>{const I=D instanceof Error?D.message:String(D);return I.toLowerCase().includes("archived")?CTt():I.includes("(fetch first)")||I.includes("non-fast-forward")?RTt():I.includes("403")||I.toLowerCase().includes("permission denied")?BTt():I},T=()=>{e&&(h(!0),p(null),Lxn(e.id).then(D=>{c(D.git),n(D.project),Je.fetchQuery(cS()).then(I=>{!I.githubForNewProjects&&!I.githubDefaultPromptSeen&&k(!0)}).catch(()=>{})}).catch(D=>p(E(D))).finally(()=>h(!1)))},j=D=>{b(!0),y(null),r.mutateAsync([D,!0]).then(()=>k(!1)).catch(I=>y(I instanceof Error?I.message:String(I))).finally(()=>b(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:EQt()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:htn({project:(e==null?void 0:e.name)??Rjt()})}),e?m&&!o?f.jsx("div",{className:"error",children:m}):o?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:_qt()}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:oWt()}),f.jsx("span",{className:"v",children:o.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:o.gitVersion??ZD()}),f.jsx("span",{className:"k",children:eYt()}),f.jsx("span",{className:"v",children:o.initialized?vTt({branch:Ce(o.currentBranch??tS()),state:o.clean?JNt():JTt()}):iDt()}),f.jsx("span",{className:"k",children:ULt()}),f.jsx("span",{className:"v",children:o.baselineBranch}),f.jsx("span",{className:"k",children:bQt()}),f.jsx("span",{className:"v",children:o.remotes.length?o.remotes.map(D=>`${D.name}: ${D.url}`).join(" · "):nS()})]}),!o.initialized&&f.jsx("div",{className:x0,children:f.jsx(Oe,{variant:"primary",onClick:()=>void Dxn(e.id).then(c).catch(D=>p(String(D))),children:gFt()})})]}),f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:pL()}),f.jsx("span",{className:"v",children:f.jsx(Wt,{variant:o.github.authenticated?"success":o.github.ghInstalled?"warning":"error",children:o.github.authenticated?_L():hL()})}),f.jsx("span",{className:"k",children:xWt()}),f.jsx("span",{className:"v",children:C?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[o.github.owner,"/",o.github.repo]}),!o.github.enabled&&f.jsx(Wt,{children:NYt()})]}):f.jsx(Wt,{children:sqt()})}),o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:yYt()}),f.jsx("span",{className:"v",children:o.github.syncStatus})]})]}),!o.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(wH,{ghInstalled:o.github.ghInstalled,remote:t,onCheck:()=>z(),onRun:a.start})}),f.jsx(My,{run:a.run,onComplete:()=>void z(),onClose:a.clear}),o.github.authenticated&&!o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:C?csn():Cjt()}),f.jsxs("div",{className:x0,children:[C&&o.github.url&&f.jsxs(mh,{href:o.github.url,target:"_blank",rel:"noreferrer",children:[Dz()," ",f.jsx(of,{size:12})]}),f.jsx(Oe,{variant:"primary",disabled:u,onClick:T,children:u?S8t():g8t()})]})]}),o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:ZBt()}),f.jsxs("div",{className:x0,children:[o.github.url&&f.jsxs(mh,{href:o.github.url,target:"_blank",rel:"noreferrer",children:[Dz()," ",f.jsx(of,{size:12})]}),f.jsx(Oe,{disabled:u,onClick:()=>{h(!0),Ixn(e.id).then(D=>{c(D.git),n(D.project)}).catch(D=>p(D instanceof Error?D.message:String(D))).finally(()=>h(!1))},children:u?A8t():u8t()})]})]})]}),f.jsx(uLn,{}),m&&f.jsx("div",{className:"error",children:E(m)})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]}):f.jsx("div",{className:rc,children:f.jsx("p",{className:Ua,children:FVt()})}),w&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>j(!1),children:f.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-modal 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-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:D=>D.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:Cqt()}),f.jsx("p",{children:tZt()}),x&&f.jsx("div",{className:"error",children:x}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Oe,{disabled:v,onClick:()=>j(!1),children:cVt()}),f.jsx(Oe,{variant:"primary",disabled:v,onClick:()=>j(!0),children:v?va():qRt()})]})]})})]})}const fLn={env:yfn,config:Nfn,xdg:Ofn,default:dfn},u4={preparing:J_n,copying:__n,verifying:Ffn,finalizing:v_n},dLn=e=>{var n;return((n=u4[e])==null?void 0:n.call(u4))??e};function hLn(){var y;const e=z2n(),n=ut(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=A.useState(""),[a,o]=A.useState(!1),[c,u]=A.useState(null),[h,_]=A.useState({kind:"idle"}),[p,m]=A.useState(null);A.useEffect(()=>{t&&i(C=>C||t.current)},[t]),A.useEffect(()=>fI(C=>{C.type==="progress"?_(z=>{const E=z.kind==="moving"?z.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||E}}):C.type==="done"?(_({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&_({kind:"error",message:C.error})}),[]);const w=(t==null?void 0:t.source)==="env",k=s.trim(),v=t!==null&&k===t.current;async function b(){if(!(a||!k)){o(!0),m(null),u(null);try{u(await Jyn(k))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function x(C){if(C.preventDefault(),!(h.kind==="moving"||!k||v)&&(m(null),!!window.confirm(R_n({path:Ce(k)})))){_({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await exn(k)}catch(z){_({kind:"idle"}),m(z instanceof Error?z.message:String(z))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:dYt()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:dnn()}),r?f.jsx("div",{className:rc,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:rc,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:_Bt()})}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:I$t()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:EL()}),f.jsx("span",{className:"v",children:fLn[t.source]()})]}),!w&&f.jsxs("form",{className:cC,onSubmit:x,children:[f.jsxs("label",{children:[dUt(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:h.kind==="moving"})]}),c&&!c.error&&c.ok&&f.jsxs("p",{className:Ua,children:[eQt()," ",nl(c.treeBytes??0),c.freeBytes!=null&&` — ${C_n({size:Ce(nl(c.freeBytes))})}`,c.sameFilesystem?afn():"","."]}),c&&c.ok===!1&&c.error&&f.jsx("div",{className:"error",children:c.error}),p&&f.jsx("div",{className:"error",children:p}),h.kind==="moving"&&f.jsx(hH,{value:h.copied,max:h.total,label:dLn(h.phase),caption:h.total>0?f.jsxs("span",{className:"text-sm",children:[nl(h.copied)," / ",nl(h.total)]}):void 0}),h.kind==="done"&&f.jsxs("p",{className:Ua,children:[Jqt(),h.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",CDt({path:Ce(h.oldPathLeft)})]})]}),h.kind==="error"&&f.jsxs("div",{className:"error",children:[Vqt()," ",h.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Oe,{type:"button",onClick:b,disabled:a||!k||v||h.kind==="moving",children:a?ha():ZEt()}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!k||v||h.kind==="moving",children:h.kind==="moving"?V_n():B_n()})]})]})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]})}const G5=e=>e==="running"||e==="starting";function pLn(e){return G5(e.status)?R0(Date.now()-e.createdAt):e.endedAt?R0(e.endedAt-e.createdAt):"—"}function kH({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_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-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:ILt()}),f.jsx("th",{children:Lh()}),f.jsx("th",{children:KXt()}),f.jsx("th",{children:KQt()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(RS,{backend:t.backend}),r&&f.jsx(Ih,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:Oz(),"aria-label":Oz(),onClick:i=>i.stopPropagation(),children:f.jsx(of,{size:12})})]})}),f.jsx("td",{children:f.jsx(cl,{status:la(t)})}),f.jsx("td",{children:wo(t.createdAt)}),f.jsx("td",{children:pLn(t)})]},t.id)})})]})})}function mLn({projectId:e,onViewHistory:n}){var _;const t=ut({...Eu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(_=t.error)==null?void 0:_.message,i=t.isFetching,[,a]=A.useState(0);A.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},c=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>G5(p.status)).sort(c),h=r==null?void 0:r.filter(p=>!G5(p.status)).sort(c);return f.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-8",children:[f.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 [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[PQt(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Oe,{size:"small",onClick:o,disabled:i,children:[f.jsx(Qa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Cm()]}),f.jsx(Oe,{size:"small",onClick:n,children:h!=null&&h.length?jZe({count:tn(h.length)}):wZe()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!h?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]}):f.jsx(kH,{instances:u,emptyLabel:e?tZe():pZe()})]})}function gLn({projectId:e,onBack:n}){var c;const t=ut({...Eu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(c=t.error)==null?void 0:c.message,i=t.isFetching,[,a]=A.useState(0);A.useEffect(()=>{const u=setInterval(()=>a(h=>h+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.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:n,children:[f.jsx(M0,{size:14})," ",mL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:XFt()}),f.jsxs(Oe,{size:"small",onClick:o,disabled:i,children:[f.jsx(Qa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Cm()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(kH,{instances:[...r].sort((u,h)=>h.createdAt-u.createdAt),emptyLabel:e?WYe():cZe()}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]})}const SH=["projects","harnesses","storage"],vLn=[{id:"compute",label:gL,icon:f.jsx(mS,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:bL,icon:f.jsx(Cf,{size:15}),activeTabs:["environment"]},{id:"settings",label:aS,icon:f.jsx(xS,{size:15}),activeTabs:["settings",...SH]}];function bLn(e){return SH.includes(e)}function yLn({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||bLn(e),a=A.useRef(null);return A.useLayoutEffect(()=>{const o=a.current,c=o==null?void 0:o.parentElement;if(!o||!c)return;const u=()=>o.scrollIntoView({block:"start"}),h=new ResizeObserver(u);h.observe(c),u();const _=()=>h.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,_,{passive:!0});return()=>{_();for(const m of p)window.removeEventListener(m,_)}},[e,n==null?void 0:n.id]),f.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-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:aS()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:gd,children:f.jsx(sLn,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:gd,children:f.jsx(lLn,{remote:s})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:gd,children:f.jsx(ADn,{remote:s})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:gd,children:f.jsx(hLn,{})}),f.jsx("section",{className:gd,children:f.jsx(oLn,{})}),!s&&f.jsx("section",{className:gd,children:f.jsx(aLn,{})})]})]}),e==="compute"&&f.jsx(XDn,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(gLn,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:bL()}),f.jsx(nLn,{})]}),e==="git"&&f.jsx(_Ln,{project:n,onProjectUpdate:t,remote:s})]})}function ib(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function V5(e){return`${e.plugin?`${ib(e.plugin)}: `:""}${ib(e.name)}`}const CH=["plan","goal","new","resume","model","compact","copy","export"],xLn={plan:()=>Yyt(),goal:()=>DKe(),new:()=>Prt(),resume:()=>$8t(),model:()=>Ttt(),compact:()=>lTe(),copy:()=>DMe(),export:()=>j$e()};function wLn(e){return{name:e,get description(){return xLn[e]()},source:"command"}}function Dy(e){return CH.some(n=>n===e)}const ab={clear:"new",summarize:"compact"};function K5(e){const n=e.toLowerCase();return Dy(n)?n:Object.hasOwn(ab,n)?ab[n]:null}function EH(e){return Object.keys(ab).filter(n=>ab[n]===e)}function kLn(e,n){return e.name.toLowerCase().startsWith(n)||e.plugin&&`${e.plugin}:${e.name}`.toLowerCase().startsWith(n)?!0:e.source==="command"&&Dy(e.name)&&EH(e.name).some(t=>t.startsWith(n))}function _4(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?h:s}${a.slice(h.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function vR(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function NH(e){return CH.filter(n=>n!=="plan"||e)}function ELn(e,n){const t=e.filter(r=>!K5(r.name));for(const r of NH(n))t.push(wLn(r));return t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||V5(r).localeCompare(V5(s),void 0,{sensitivity:"base"}))}function f4(e){return e==="plan"||e==="goal"}function NLn(e,n){for(const t of NH(n).sort((r,s)=>+(r==="plan")-+(s==="plan"))){const r=[t,...EH(t)].join("|");if(t==="plan"){const s=new RegExp(`(^|\\s)\\/(?:${r})(?=\\s|$)`,"gi");if(s.test(e))return{name:t,prompt:e.replace(s,"").trim()}}else if(t==="goal"){const s=new RegExp(`^\\/(?:${r})(?=\\s|$)`,"i");if(s.test(e.trim()))return{name:t,prompt:e.trim().replace(s,"").trim()}}else if(new RegExp(`^\\/(?:${r})$`,"i").test(e.trim()))return{name:t,prompt:""}}return null}function d4(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}const zLn=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let jLn=null;function W5(e,n){const t=jLn??(jLn=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(ib(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}const TLn={plan:d5n,goal:GI,new:V5n,resume:VI,model:mS,compact:q3n,copy:Sf,export:Lb};function zH({name:e,className:n}){const t=Dy(e)?TLn[e]:ikn;return f.jsx(t,{size:16,strokeWidth:1.5,className:n,"aria-hidden":"true"})}function jH({name:e}){return f.jsxs(f.Fragment,{children:[f.jsx(zH,{name:e,className:"me-1 inline-block align-middle"}),ib(e)]})}function TH(e,n,t,r,s,i=!1){let a=0;return SLn(e,n).map((o,c,u)=>{var m,w;const h=a+o.text.length;a=h;const _=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,_,h,c);let p=o.text;return i||((m=u[c-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(w=u[c+1])!=null&&w.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(jH,{name:_})},c):i?f.jsx("span",{"aria-hidden":"true",children:o.text},c):f.jsx(A.Fragment,{children:p},c)})}function ALn({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=A.useRef(null),o=A.useRef(null),c=A.useRef(null),u=A.useId(),[h,_]=A.useState(!1),p=ut({...I2n(n,s,r.harness),enabled:h,subscribed:h}),m=p.data??null,w=p.isFetching,[k,v]=A.useState({}),b=()=>{c.current!==null&&window.clearTimeout(c.current),c.current=null},x=()=>{const z=a.current;if(!z)return;const E=z.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(E.left-4,window.innerWidth-T-16));v(E.top>300?{bottom:window.innerHeight-E.top+12,left:j,width:T}:{left:j,top:E.bottom+12,width:T})},y=()=>{b(),x(),_(!0)},C=()=>{b(),c.current=window.setTimeout(()=>_(!1),120)};return A.useEffect(()=>()=>b(),[]),A.useEffect(()=>{if(!h)return;const z=()=>x();return window.addEventListener("resize",z),window.addEventListener("scroll",z,!0),()=>{window.removeEventListener("resize",z),window.removeEventListener("scroll",z,!0)}},[h]),f.jsxs(A.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":h,"aria-label":IZ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:z=>{var E,T;if(z.key==="Escape"){_(!1);return}if(z.key==="Enter"||z.key===" "){z.preventDefault(),y();return}h&&(z.key==="ArrowDown"||z.key==="PageDown")&&(z.preventDefault(),(E=o.current)==null||E.scrollBy({top:z.key==="PageDown"?240:48,behavior:"smooth"})),h&&(z.key==="ArrowUp"||z.key==="PageUp")&&(z.preventDefault(),(T=o.current)==null||T.scrollBy({top:z.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:z=>{var E,T;z.preventDefault(),(E=i.current)==null||E.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(jH,{name:n})})})]}),h&&Fi.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":GJ({name:n}),style:{...k,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:z=>z.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Wt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:zsn()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:w&&m===null?f.jsx("span",{className:"text-muted",children:Dsn()}):f.jsx(nc,{text:m??r.description})})]}),document.body)]})}function RLn({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:TH(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function MLn({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=A.useRef(null);return A.useLayoutEffect(()=>{const o=i.current,c=a.current;if(!o||!c)return;const u=()=>{const _=getComputedStyle(o);for(const p of zLn)c.style.setProperty(p,_.getPropertyValue(p));c.style.width=`${o.clientWidth+parseFloat(_.borderLeftWidth)+parseFloat(_.borderRightWidth)}px`};u();const h=new ResizeObserver(u);return h.observe(o),()=>h.disconnect()},[e,i]),A.useLayoutEffect(()=>{const o=i.current;if(!o)return;const c=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return c(),o.addEventListener("scroll",c),()=>o.removeEventListener("scroll",c)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[TH(e,t,"",void 0,(o,c,u,h)=>{var w;const _=e.slice(u),p=((w=/^[ \t]+/.exec(_))==null?void 0:w[0].length)??0;if(u===n||_&&!_.startsWith(` +`)&&pk.name===c);return m&&m.source!=="command"?f.jsx(ALn,{label:o,name:c,end:u,skill:m,projectId:s,textareaRef:i},`${h}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${h}:${u}`)},!0),"​"]})}function OLn({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=A.useRef(null);return A.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[f.jsx(zH,{name:i.name,className:"shrink-0"}),f.jsx("span",{className:"skill-name shrink-0",children:V5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:Hsn()})]},i.name))})}function DLn(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const Q5=6.5,bR=2*Math.PI*Q5;function LLn({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(ILn,{usage:e})}function ILn({usage:e}){const{open:n,setOpen:t,ref:r}=Xa(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":DLn(a),c=a===null?"":new Intl.NumberFormat(N(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:hMe(),onClick:()=>t(u=>!u),children:a===null?e1(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:Q5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:Q5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${bR*Math.max(a,2)/100} ${bR}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-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:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:oMe()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?xMe({value:Ce(e1(s))}):zMe({used:Ce(e1(s)),total:Ce(e1(i)),percent:Ce(c)})})]}),a!==null&&f.jsx(hH,{value:s,max:i,fillColor:o})]})]})}function $Ln(e,n,t){const r=e.map(t);return n<0?r:[...r.slice(0,n),f.jsxs("div",{role:"group","aria-label":Cz(),children:[f.jsx("div",{className:"px-2.5 pb-1 pt-2.5 text-sm font-medium text-subtext",children:Cz()}),r.slice(n)]},"from-terminal")]}function BLn({activeSessionId:e,onClose:n,onResume:t,onImport:r}){const s=A.useRef(null),i=A.useRef(null),{data:a,isPending:o,error:c}=ut(F2n()),{data:u=[]}=ut(hh()),{data:h=[]}=ut(oI()),[_,p]=A.useState(""),[m,w]=A.useState(0);Nm(s,n);const k=A.useMemo(()=>new Map(u.map(z=>[z.id,z.name])),[u]),v=A.useMemo(()=>{const z=_.trim().toLowerCase(),E=M=>!z||M.toLowerCase().includes(z),T=(a??[]).filter(M=>M.id!==e).filter(M=>E(`${M.title??""} ${k.get(M.projectId)??""} ${hu[M.harness]}`)).map(M=>({kind:"session",key:M.id,session:M})),j=h.filter(M=>E(`${M.title??""} ${M.cwd??""} ${hu[M.harness]}`)).map(M=>({kind:"native",key:`${M.harness}:${M.nativeId}`,chat:M}));return[...T,...j]},[a,h,_,e,k]),b=A.useMemo(()=>v.findIndex(z=>z.kind==="native"),[v]),x=Math.min(m,Math.max(0,v.length-1));A.useLayoutEffect(()=>{var z;(z=i.current)==null||z.scrollIntoView({block:"nearest"})},[x,v]);const y=z=>(z==null?void 0:z.split("/").filter(Boolean).at(-1))??"",C=z=>z.kind==="native"?r(z.chat):t(z.session);return Fi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-start justify-center bg-modal-backdrop p-5 pt-[var(--modal-top)]",onClick:z=>{z.target===z.currentTarget&&n()},children:f.jsxs("div",{ref:s,className:"flex max-h-[calc(100vh_-_var(--modal-top)_-_1.25rem)] w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-label":Nz(),tabIndex:-1,children:[f.jsx("div",{className:"border-b border-border p-3",children:f.jsx(Ur,{"data-initial-focus":!0,value:_,placeholder:Ez(),"aria-label":Ez(),role:"combobox","aria-autocomplete":"list","aria-expanded":v.length>0,"aria-controls":"resume-options","aria-activedescendant":v[x]?`resume-option-${v[x].key}`:void 0,onChange:z=>{p(z.target.value),w(0)},onKeyDown:z=>{if(!z.nativeEvent.isComposing)if(z.key==="ArrowDown"||z.key==="ArrowUp"){if(z.preventDefault(),v.length===0)return;const E=z.key==="ArrowDown"?1:-1;w((x+E+v.length)%v.length)}else z.key==="Enter"&&v[x]&&(z.preventDefault(),C(v[x]))}})}),f.jsx("div",{id:"resume-options",className:"min-h-0 flex-1 overflow-y-auto p-1.5",role:v.length>0?"listbox":void 0,"aria-label":v.length>0?Nz():void 0,children:o?f.jsxs(Vr,{className:"px-2.5 py-2",role:"status",children:[f.jsx(jt,{})," ",Qk()]}):c&&!a?f.jsx("div",{className:"px-2.5 py-2 text-sm text-accent-red",role:"alert",children:Wk({error:Ce(c instanceof Error?c.message:String(c))})}):v.length===0?f.jsx("div",{className:"px-2.5 py-2 text-sm text-muted",role:"status",children:G8t()}):$Ln(v,b,(z,E)=>{var D;const T=z.kind==="native"?z.chat:null,j=z.kind==="session"?z.session:null;return f.jsxs(Dn,{id:`resume-option-${z.key}`,ref:E===x?i:void 0,type:"button",role:"option","aria-selected":E===x,active:E===x,tabIndex:-1,className:"gap-2.5 text-text",onMouseEnter:()=>w(E),onClick:()=>C(z),children:[f.jsx(bh,{harness:(T==null?void 0:T.harness)??(j==null?void 0:j.harness)??"claude-code"}),f.jsx("span",{dir:"auto",className:"min-w-0 flex-1 truncate",children:((D=(T==null?void 0:T.title)??(j==null?void 0:j.title))==null?void 0:D.trim())||xd()}),f.jsx("span",{dir:"auto",className:"max-w-40 shrink-0 truncate text-muted",title:(T==null?void 0:T.cwd)??void 0,children:T?y(T.cwd):k.get((j==null?void 0:j.projectId)??"")??""}),f.jsx("span",{className:"shrink-0 text-muted tabular-nums",children:wo((T==null?void 0:T.updatedAt)??(j==null?void 0:j.updatedAt)??0)})]},z.key)})})]})}),document.body)}const ob="!";function yR(e){return e.startsWith(ob)?e.slice(ob.length).trim():null}function PLn(e){return e.startsWith(ob)?e.slice(ob.length):e}function FLn(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 HLn(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function qLn(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` ${t} ${e.replace(/^\n|\n$/g,"")} ${t} -`}function W5(e,n){return n?` +`}function X5(e,n){return n?` \\[ ${e} \\] -`:`\\(${e}\\)`}function MDn(e,n){const t=n.trim().split(` +`:`\\(${e}\\)`}function ULn(e,n){const t=n.trim().split(` `),r=" ".repeat(e.length+1);return[`${e} ${t[0]??""}`,...t.slice(1).map(s=>s?`${r}${s}`:"")].join(` -`)}function ODn(e,n){if(e.length===0)return"";const t=Math.max(...e.map(a=>a.length)),r=a=>`| ${Array.from({length:t},(o,c)=>a[c]??"").join(" | ")} |`,s=n?e[0]:Array.from({length:t},()=>""),i=n?e.slice(1):e;return[r(s),r(Array.from({length:t},()=>"---")),...i.map(r)].join(` -`)}function DDn(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function LDn(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function IDn(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const zH="tool-line flex-1 min-w-0 line-clamp-2 break-words text-base leading-6",lC="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",Tu=256,jH=1024,TH=2e4,f4=8,z1="chat-annotations";function k_(e){return e instanceof Element?e:e.parentElement}function bR(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function d4(e,n){return bR(e).compareBoundaryPoints(Range.START_TO_START,bR(n))<0}function yR(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const $Dn=new Set(["A","B","CODE","EM","I","STRONG"]);function BDn(e,n){var s,i;const t=k_(e.endContainer);if(Array.from(n.childNodes).every(a=>a.nodeType===Node.TEXT_NODE)){let a=k_(e.startContainer);for(;a&&a.matches(".md *")&&a.contains(t);){if($Dn.has(a.tagName)){const o=a.cloneNode(!1);o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(o))}a=a.parentElement}}const r=(s=k_(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const a=(i=r.querySelector("code"))==null?void 0:i.cloneNode(!1),o=r.cloneNode(!1);o instanceof HTMLElement&&a instanceof HTMLElement&&(a.replaceChildren(...Array.from(n.childNodes)),o.replaceChildren(a),n.replaceChildren(o))}}function PDn(e){e.querySelectorAll("button").forEach(n=>{n.replaceWith(document.createTextNode(n.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(n=>n.remove()),e.querySelectorAll("*").forEach(n=>{for(const t of Array.from(n.attributes))(t.name.toLowerCase().startsWith("on")||t.name==="contenteditable"||t.name==="tabindex")&&n.removeAttribute(t.name)})}function FDn(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const i=Array.from(n.querySelectorAll(".katex")).filter(a=>e.intersectsNode(a));for(const a of i){const o=a.closest(".katex-display")??a,c=document.createRange();c.selectNode(o);const u={container:c.startContainer,offset:c.startOffset},h={container:c.endContainer,offset:c.endOffset};if(d4(s,u)&&t.append(yR(s,u)),t.append(o.cloneNode(!0)),s=h,!d4(s,r))break}return i.length===0?t.append(e.cloneContents()):d4(s,r)&&t.append(yR(s,r)),BDn(e,t),PDn(t),t}function HDn(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>K0(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` +`)}function GLn(e,n){if(e.length===0)return"";const t=Math.max(...e.map(a=>a.length)),r=a=>`| ${Array.from({length:t},(o,c)=>a[c]??"").join(" | ")} |`,s=n?e[0]:Array.from({length:t},()=>""),i=n?e.slice(1):e;return[r(s),r(Array.from({length:t},()=>"---")),...i.map(r)].join(` +`)}function VLn(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function KLn(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function WLn(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const AH="tool-line flex-1 min-w-0 line-clamp-2 break-words text-base leading-6",uC="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",Pu=256,RH=1024,MH=2e4,h4=8,z1="chat-annotations";function A_(e){return e instanceof Element?e:e.parentElement}function xR(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function p4(e,n){return xR(e).compareBoundaryPoints(Range.START_TO_START,xR(n))<0}function wR(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const QLn=new Set(["A","B","CODE","EM","I","STRONG"]);function XLn(e,n){var s,i;const t=A_(e.endContainer);if(Array.from(n.childNodes).every(a=>a.nodeType===Node.TEXT_NODE)){let a=A_(e.startContainer);for(;a&&a.matches(".md *")&&a.contains(t);){if(QLn.has(a.tagName)){const o=a.cloneNode(!1);o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(o))}a=a.parentElement}}const r=(s=A_(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const a=(i=r.querySelector("code"))==null?void 0:i.cloneNode(!1),o=r.cloneNode(!1);o instanceof HTMLElement&&a instanceof HTMLElement&&(a.replaceChildren(...Array.from(n.childNodes)),o.replaceChildren(a),n.replaceChildren(o))}}function YLn(e){e.querySelectorAll("button").forEach(n=>{n.replaceWith(document.createTextNode(n.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(n=>n.remove()),e.querySelectorAll("*").forEach(n=>{for(const t of Array.from(n.attributes))(t.name.toLowerCase().startsWith("on")||t.name==="contenteditable"||t.name==="tabindex")&&n.removeAttribute(t.name)})}function ZLn(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const i=Array.from(n.querySelectorAll(".katex")).filter(a=>e.intersectsNode(a));for(const a of i){const o=a.closest(".katex-display")??a,c=document.createRange();c.selectNode(o);const u={container:c.startContainer,offset:c.startOffset},h={container:c.endContainer,offset:c.endOffset};if(p4(s,u)&&t.append(wR(s,u)),t.append(o.cloneNode(!0)),s=h,!p4(s,r))break}return i.length===0?t.append(e.cloneContents()):p4(s,r)&&t.append(wR(s,r)),XLn(e,t),YLn(t),t}function JLn(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>W0(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` -${ODn(n,!!e.querySelector("tr:first-child th"))} +${GLn(n,!!e.querySelector("tr:first-child th"))} -`:""}function AH(e){const n=e.tagName==="OL",t=e.getAttribute("start"),r=t===null?1:Number(t);let s=Number.isFinite(r)?r:1;const i=[];for(const a of Array.from(e.children).filter(o=>o instanceof HTMLElement&&o.tagName==="LI")){const o=a.getAttribute("value"),c=o===null?s:Number(o),u=Number.isFinite(c)?c:s;s=u+1;const h=Array.from(a.childNodes).map(_=>_ instanceof HTMLElement&&_.matches("UL, OL")?` -${AH(_).trim()} -`:K0(_)).join("").trim();i.push(MDn(n?`${u}.`:"-",h))}return` +`:""}function OH(e){const n=e.tagName==="OL",t=e.getAttribute("start"),r=t===null?1:Number(t);let s=Number.isFinite(r)?r:1;const i=[];for(const a of Array.from(e.children).filter(o=>o instanceof HTMLElement&&o.tagName==="LI")){const o=a.getAttribute("value"),c=o===null?s:Number(o),u=Number.isFinite(c)?c:s;s=u+1;const h=Array.from(a.childNodes).map(_=>_ instanceof HTMLElement&&_.matches("UL, OL")?` +${OH(_).trim()} +`:W0(_)).join("").trim();i.push(ULn(n?`${u}.`:"-",h))}return` ${i.join(` `)} -`}function K0(e){var r,s,i,a,o;if(e.nodeType===Node.TEXT_NODE)return TDn(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(K0).join("");if(e.matches(".katex-display")){const c=(s=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:s.trim();return c?W5(c,!0):""}if(e.matches(".katex")){const c=(a=(i=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:i.textContent)==null?void 0:a.trim();return c?W5(c,!1):""}if(e.tagName==="BR")return` -`;if(e.tagName==="TABLE")return HDn(e);if(e.matches("UL, OL"))return AH(e);if(e.tagName==="CODE"&&((o=e.parentElement)==null?void 0:o.tagName)!=="PRE")return ADn(e.textContent??"");if(e.tagName==="PRE")return RDn(e.textContent??"");const n=Array.from(e.childNodes).map(K0).join("");if(!n)return"";if(e.matches("strong, b"))return`**${n}**`;if(e.matches("em, i"))return`*${n}*`;if(e.tagName==="A"){const c=e.getAttribute("href");return c?`[${n}](${c})`:n}if(e.tagName==="LI")return`${n.trim()} +`}function W0(e){var r,s,i,a,o;if(e.nodeType===Node.TEXT_NODE)return FLn(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(W0).join("");if(e.matches(".katex-display")){const c=(s=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:s.trim();return c?X5(c,!0):""}if(e.matches(".katex")){const c=(a=(i=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:i.textContent)==null?void 0:a.trim();return c?X5(c,!1):""}if(e.tagName==="BR")return` +`;if(e.tagName==="TABLE")return JLn(e);if(e.matches("UL, OL"))return OH(e);if(e.tagName==="CODE"&&((o=e.parentElement)==null?void 0:o.tagName)!=="PRE")return HLn(e.textContent??"");if(e.tagName==="PRE")return qLn(e.textContent??"");const n=Array.from(e.childNodes).map(W0).join("");if(!n)return"";if(e.matches("strong, b"))return`**${n}**`;if(e.matches("em, i"))return`*${n}*`;if(e.tagName==="A"){const c=e.getAttribute("href");return c?`[${n}](${c})`:n}if(e.tagName==="LI")return`${n.trim()} `;if(e.matches("TH, TD"))return`${n.trim()} | `;if(e.tagName==="TR")return`${n.replace(/ \| $/,"")} `;if(e.tagName==="BLOCKQUOTE")return` @@ -1083,7 +1083,7 @@ ${n.trim().split(` `).map(c=>`> ${c}`).join(` `)} -`;const t=DDn(e.tagName,n);return t?` +`;const t=VLn(e.tagName,n);return t?` ${t} @@ -1091,35 +1091,35 @@ ${t} ${n.trim()} -`:n}function qDn(e,n){return K0(e).replace(/\r\n?/g,` +`:n}function eIn(e,n){return W0(e).replace(/\r\n?/g,` `).replace(/[ \t]+\n/g,` `).replace(/\n{3,}/g,` -`).trim()||n}function xR(e){return e.normalize("NFKC").replace(/[\s\u200B-\u200D\u2060\uFEFF]/g,"").toLowerCase()}function UDn(e,n){var s,i,a,o;if(!LDn(e))return;const t=xR(e);if(t.length<8)return;let r;for(const c of n.querySelectorAll(".msg-assistant > .md .katex")){const h=[(s=c.querySelector(".katex-mathml"))==null?void 0:s.textContent,(i=c.querySelector(".katex-html"))==null?void 0:i.textContent,c.textContent].filter(x=>!!x).map(xR).find(x=>IDn(x,t));if(!h)continue;const _=(o=(a=c.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();if(!_)continue;const p=!!c.closest(".katex-display"),m={markdown:W5(_,p).trim(),delta:Math.abs(h.length-t.length)};(!r||m.delta .md .katex")){const h=[(s=c.querySelector(".katex-mathml"))==null?void 0:s.textContent,(i=c.querySelector(".katex-html"))==null?void 0:i.textContent,c.textContent].filter(w=>!!w).map(kR).find(w=>WLn(w,t));if(!h)continue;const _=(o=(a=c.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();if(!_)continue;const p=!!c.closest(".katex-display"),m={markdown:X5(_,p).trim(),delta:Math.abs(h.length-t.length)};(!r||m.deltaj.width>0&&j.height>0),x=m[0]??t.getBoundingClientRect(),k=m.filter(j=>j.topx.top),v=k.length>0?k:[x],b=Math.min(...v.map(j=>j.left)),w=Math.max(...v.map(j=>j.right)),y=Math.min(...v.map(j=>j.top)),C=Math.max(...v.map(j=>j.bottom)),N=34,z=74,T=y>=N+f4?y-N-f4:C+f4;return{text:qDn(p,_),range:t.cloneRange(),x:Math.min(window.innerWidth-z,Math.max(z,b+(w-b)/2)),top:T}}function VDn(e,n){const[t,r]=A.useState(null),s=A.useRef(!1),i=A.useCallback(()=>{const c=e.current;r(c?GDn(c):null)},[e]);A.useEffect(()=>{let c=null;const u=()=>{s.current||i()},h=p=>{const m=e.current,x=p.target;!p.isPrimary||p.button!==0||!m||!(x instanceof Node)||!m.contains(x)||(s.current=!0,r(null))},_=p=>{!p.isPrimary||!s.current||(s.current=!1,c=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",h,!0),window.addEventListener("pointerup",_,!0),window.addEventListener("pointercancel",_,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",h,!0),window.removeEventListener("pointerup",_,!0),window.removeEventListener("pointercancel",_,!0),c!==null&&window.cancelAnimationFrame(c),s.current=!1}},[i]),A.useEffect(()=>{if(!t)return;const c=u=>{const h=u.target;h instanceof Element&&h.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",c,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",c,!0),window.removeEventListener("resize",i)}},[t,i]);const a=A.useCallback(()=>{var c;t&&(n({text:t.text,range:t.range}),r(null),(c=window.getSelection())==null||c.removeAllRanges())},[t,n]),o=A.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function KDn(e){A.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(z1);return}const t=new Highlight(...n);return CSS.highlights.set(z1,t),()=>{CSS.highlights.get(z1)===t&&CSS.highlights.delete(z1)}},[e])}function WDn({annotation:e}){const n=A.useRef(null),[t,r]=A.useState();return A.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?UDn(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx(Jo,{text:t??e.text})})}function QDn({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:$ke()}),f.jsx(WDn,{annotation:t})]}),n&&f.jsx($t,{type:"button",size:"small","data-annotation-remove":!0,title:F5e(),"aria-label":PZ({number:Xt(r+1)}),onClick:()=>n(t.id),children:f.jsx(lr,{size:13})})]},t.id))}function uC({annotations:e,variant:n,onClear:t,onRemove:r}){const s=A.useRef(null),i=A.useRef(null),a=A.useId(),o=_o(s),c=n==="sent",u=A.useRef(null),h=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},_=()=>{u.current=window.setTimeout(()=>{var x;(x=i.current)!=null&&x.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const x=c||!o.open;o.setOpen(x),x&&window.requestAnimationFrame(()=>{var k;return(k=i.current)==null?void 0:k.focus()})},m=x=>{r==null||r(x),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return A.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),f.jsxs("div",{className:c?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:c?h:void 0,onMouseLeave:c?_:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${c?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,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":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[f.jsx(GI,{size:c?13:14,className:"text-muted"}),e.length===1?bve():ype({count:Xt(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:cN(),"aria-label":cN(),onClick:t,children:f.jsx(lr,{size:13})})]}),o.open&&f.jsx("div",{id:a,ref:i,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-popover p-2 text-start ${c?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":Ake(),children:f.jsx(QDn,{annotations:e,onRemove:r?m:void 0})})]})}function XDn(e){return f.jsx(uC,{...e,variant:"composer"})}const YDn=["prompt-collapsed text-muted text-base 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(" "),wR=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),ZDn=["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(" "),JDn=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),Q5="prompt-actions flex flex-wrap gap-2",kR=[],eLn=[],Yp={};function v_(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function h4(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function tLn(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function Vs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function p4(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function m4(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=Tu));s++);return r}function nLn(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function Pd(...e){const n=new Set,t=new RegExp(`^${q_}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=Tu||r++>=jH)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function Oy(e){return e.replace(/^Exit code \d+\s*/i,"").split(` +`).trim();if(!_)return null;const p=ZLn(t,e),m=Array.from(t.getClientRects()).filter(j=>j.width>0&&j.height>0),w=m[0]??t.getBoundingClientRect(),k=m.filter(j=>j.topw.top),v=k.length>0?k:[w],b=Math.min(...v.map(j=>j.left)),x=Math.max(...v.map(j=>j.right)),y=Math.min(...v.map(j=>j.top)),C=Math.max(...v.map(j=>j.bottom)),z=34,E=74,T=y>=z+h4?y-z-h4:C+h4;return{text:eIn(p,_),range:t.cloneRange(),x:Math.min(window.innerWidth-E,Math.max(E,b+(x-b)/2)),top:T}}function rIn(e,n){const[t,r]=A.useState(null),s=A.useRef(!1),i=A.useCallback(()=>{const c=e.current;r(c?nIn(c):null)},[e]);A.useEffect(()=>{let c=null;const u=()=>{s.current||i()},h=p=>{const m=e.current,w=p.target;!p.isPrimary||p.button!==0||!m||!(w instanceof Node)||!m.contains(w)||(s.current=!0,r(null))},_=p=>{!p.isPrimary||!s.current||(s.current=!1,c=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",h,!0),window.addEventListener("pointerup",_,!0),window.addEventListener("pointercancel",_,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",h,!0),window.removeEventListener("pointerup",_,!0),window.removeEventListener("pointercancel",_,!0),c!==null&&window.cancelAnimationFrame(c),s.current=!1}},[i]),A.useEffect(()=>{if(!t)return;const c=u=>{const h=u.target;h instanceof Element&&h.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",c,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",c,!0),window.removeEventListener("resize",i)}},[t,i]);const a=A.useCallback(()=>{var c;t&&(n({text:t.text,range:t.range}),r(null),(c=window.getSelection())==null||c.removeAllRanges())},[t,n]),o=A.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function sIn(e){A.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(z1);return}const t=new Highlight(...n);return CSS.highlights.set(z1,t),()=>{CSS.highlights.get(z1)===t&&CSS.highlights.delete(z1)}},[e])}function iIn({annotation:e}){const n=A.useRef(null),[t,r]=A.useState();return A.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?tIn(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx(nc,{text:t??e.text})})}function aIn({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:Qke()}),f.jsx(iIn,{annotation:t})]}),n&&f.jsx(Ft,{type:"button",size:"small","data-annotation-remove":!0,title:Z5e(),"aria-label":UZ({number:tn(r+1)}),onClick:()=>n(t.id),children:f.jsx(_r,{size:13})})]},t.id))}function _C({annotations:e,variant:n,onClear:t,onRemove:r}){const s=A.useRef(null),i=A.useRef(null),a=A.useId(),o=Xa(s),c=n==="sent",u=A.useRef(null),h=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},_=()=>{u.current=window.setTimeout(()=>{var w;(w=i.current)!=null&&w.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const w=c||!o.open;o.setOpen(w),w&&window.requestAnimationFrame(()=>{var k;return(k=i.current)==null?void 0:k.focus()})},m=w=>{r==null||r(w),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return A.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),f.jsxs("div",{className:c?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:c?h:void 0,onMouseLeave:c?_:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${c?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,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":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[f.jsx(WI,{size:c?13:14,className:"text-muted"}),e.length===1?Tve():Ape({count:tn(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:lN(),"aria-label":lN(),onClick:t,children:f.jsx(_r,{size:13})})]}),o.open&&f.jsx("div",{id:a,ref:i,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-popover p-2 text-start ${c?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":Hke(),children:f.jsx(aIn,{annotations:e,onRemove:r?m:void 0})})]})}function oIn(e){return f.jsx(_C,{...e,variant:"composer"})}const cIn=["prompt-collapsed text-muted text-base 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(" "),SR=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),lIn=["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(" "),uIn=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),Y5="prompt-actions flex flex-wrap gap-2",CR=[],_In=[],Zp={};function E_(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function m4(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function fIn(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function Ws(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function g4(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function v4(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=Pu));s++);return r}function dIn(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function Fd(...e){const n=new Set,t=new RegExp(`^${Y_}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=Pu||r++>=RH)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function Ly(e){return e.replace(/^Exit code \d+\s*/i,"").split(` `).filter(n=>!/^\s*\[orx-(?:run|experiment):[^\]]+\]\s*$/.test(n)).join(` -`).trim()}function rLn(e){const n=e.changes;if(!Array.isArray(n))return null;for(const t of n){if(!t||typeof t!="object"||!("path"in t)||typeof t.path!="string")continue;const r="kind"in t?t.kind:null,s=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:t.path,type:s}}return null}function sLn(e){const n=e.trim(),t=n.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((t==null?void 0:t[1])??n).trim();return r=g8n(r),RH(r)}function RH(e){return aLn(e).replace(/[\t\r ]+/g," ").trim()}function iLn(e){let n=null,t=!1;for(let r=0;r!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&OH(s)?{ref:r,path:s}:null}function lLn(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function SR(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function uLn(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!u.startsWith("-"));if(!o)return null;const c=SR(s,o);if(!c)return null;s=c}return s?SR(s,e):e}const $o="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",_Ln=new RegExp(`\\bchat_(${$o})\\b`,"gi"),q_=`(?:${$o}|[0-9a-f]{8})`;function Fd(e){const n=[];let t="",r="",s=null,i=!1;const a=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=u=>{let h=1,_=null,p=!1;for(let m=u;m{let h=!1;for(let _=u;_y8n(t.raw,n))}function ja(e,n){return Dy(e,n).length>0}function fLn(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,TH).matchAll(_Ln))if(n.add(t[0].toLowerCase()),n.size>=Tu)break;return[...n]}function X5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,TH),s=n==="runs"?[new RegExp(`/runs/(${$o})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${$o})`,"gi"),new RegExp(`^\\s*RUN\\s+(${$o})\\b`,"gim"),new RegExp(`={3,}\\s*(${$o})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${$o})`,"gi"),new RegExp(`^\\s*id:\\s*(${$o})`,"gim"),new RegExp(`={3,}\\s*(${$o})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=Tu)return[...t];const i=new RegExp(`^\\s*(${$o})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=Tu)break;return[...t]}function LH(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function IH(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function $H(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const c=o+a[0].length;c<=t&&/\bdone\b/.test(e.slice(c,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function dLn(e,n,t=[],r=[]){const s=Dy(e,"logs"),i=new Set;if(s.length===0){if(!ja(e,"logs"))return[];const o=t.length>0?[]:X5(n,"runs");for(const c of t.length>0?t:o.length>0?o:r)if(i.add(c),i.size>=Tu)break;return Pd([...i])}let a=!1;for(const{invocation:o,offset:c}of LH(e,s)){const u=xh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const h=u.slice(1);let _=null;for(let v=0;v0?[]:X5(n,"runs"),c=t.length>0?t:o.length>0?o:r;for(const u of c)if(i.add(u),i.size>=Tu)break}return Pd([...i])}function gd(e,n,t=[],r=[]){const s=Dy(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:c}of LH(e,s)){const u=xh(o.raw),h=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let _=!1;h&&new RegExp(`^${q_}$`,"i").test(h)&&(i.add(h),_=!0);const p=h?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(h):null;if(p){const m=p[1],x=IH(e,m,c,q_);if(x.length>0){for(const v of x)i.add(v);_=!0}const k=$H(e,m,c,q_);for(const v of k)i.add(v);k.length>0&&(_=!0)}_||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:X5(n,"experiments"),c=t.length>0?t:o.length>0?o:r;for(const u of c)if(i.add(u),i.size>=Tu)break}return Pd([...i])}const CR=new WeakMap;function rf(e){const n=E(),t=CR.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=hLn(e);return CR.set(e,{locale:n,activity:r}),r}function hLn(e){var b,w,y,C,N,z;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Vs(i,"command","cmd"),o=nLn(i,"commandArgv"),c=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),u=Pd(m4(i,"targetIds")),h=Pd(m4(i,"runTargetIds")),_=Pd(m4(i,"experimentTargetIds")),p=Vs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Vs(i,"description"),x=n.toLowerCase().split(/(?::|\.|__)+/),k=x.at(-1)??n.toLowerCase();if(k==="run"&&x.includes("web")){const T=p4(i,"search_query","q"),j=p4(i,"image_query","q"),M=p4(i,"find","pattern");return T?{kind:"web",label:UE({query:T})}:j?{kind:"web",label:Kie({query:j})}:M?{kind:"web",label:Mae({pattern:M})}:Array.isArray(i.open)?{kind:"web",label:Z4e()}:Array.isArray(i.weather)?{kind:"web",label:bxe()}:Array.isArray(i.finance)?{kind:"web",label:ixe()}:Array.isArray(i.sports)?{kind:"web",label:fxe()}:Array.isArray(i.time)?{kind:"web",label:Zye()}:{kind:"web",label:aN()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["compacted","contextcompaction"],["imported","importedchat"],["subagentactivity","subagent"]]).get(k)??k){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:V3e()};const T=sLn(a??(o==null?void 0:o.join(" "))??""),j=Fd(T);let M=j.map(G=>G.raw);if(o!=null&&o.length){const G=b8n(o);M=G===null?[o]:Fd(RH(G)).map(oe=>oe.raw)}let D=null;for(const G of M)if(D=x8n(G),D)break;const I=M.some(G=>{const oe=xh(G);return oe!==null&&oe[0]!=="discover"&&oe[0]!=="paper"});if(D&&!I){const G=D.kind==="discover"?{keyword:hie(),embedding:xie(),openalex:dae(),biorxiv:zie(),pubmed:yae()}[D.strategy]:null,oe=D.kind==="discover"?D.query?Yte({activity:G??qE(),query:D.query}):G??qE():D.id?Bp({target:Ne(D.id)}):Nre();return{kind:D.kind==="paper"?"read":"search",label:oe,litCall:D}}if(ja(T,"agent\\s+spawn"))return{kind:"agent",label:s2e(),spawnedSessionIds:fLn(c),litCall:D??void 0};const $=j.map(G=>DH(G.raw)),q=ja(T,"exp\\s+status"),H=ja(T,"exp\\s+desc"),Q=Dy(T,"exp\\s+desc").some(G=>(xh(G.raw)??[]).some(le=>le==="--set"||le.startsWith("--set=")||le==="--stdin")),V=Q?zoe():yre(),J=Q?wee():Ose();if(ja(T,"logs")){const G=dLn(T,c,h,u);return{kind:"project",label:G.length===1?yse():Nse(),runIds:G,litCall:D??void 0}}if(ja(T,"exp\\s+run"))return{kind:"project",label:mSe(),litCall:D??void 0};if(ja(T,"exp\\s+wait"))return{kind:"project",label:vCe(),litCall:D??void 0};if(ja(T,"exp\\s+cancel"))return{kind:"project",label:vye(),litCall:D??void 0};const Z=ja(T,"project\\s+view");if(Z&&q&&H)return{kind:"project",label:J,experimentIds:gd(T,c,_,u),litCall:D??void 0};if(Z&&H)return{kind:"project",label:V,experimentIds:gd(T,c,_,u),litCall:D??void 0};if(Z&&q)return{kind:"project",label:oN(),experimentIds:gd(T,c,_,u),litCall:D??void 0};if(Z)return{kind:"project",label:y5e(),litCall:D??void 0};if(q&&H)return{kind:"project",label:J,experimentIds:gd(T,c,_,u),litCall:D??void 0};if(q)return{kind:"project",label:oN(),experimentIds:gd(T,c,_,u),litCall:D??void 0};if(H)return{kind:"project",label:V,experimentIds:gd(T,c,_,u),litCall:D??void 0};if(ja(T,"runs?"))return{kind:"project",label:_4e(),litCall:D??void 0};if(ja(T,"projects"))return{kind:"project",label:v4e(),litCall:D??void 0};if(ja(T,"compute"))return{kind:"project",label:Rye(),litCall:D??void 0};const B=$.map(cLn).find(G=>G!=null);if(B){const G=h4(B.path);return{kind:G?"skill":"read",label:G?W2({name:Ne(G)}):Bp({target:Ne(v_(B.path))}),filePath:B.path,fileRef:B.ref,labelTarget:G?`${G} skill`:v_(B.path)}}const L=$.findIndex(G=>G!=null&&["sed","cat","head","tail"].includes(G.name)),F=L>=0?$[L]:null,U=F?oLn(F):null,K=U?uLn(U,j,L,Vs(i,"cwd","workdir")):null;if(U&&K){const G=h4(K);return{kind:G?"skill":"read",label:G?W2({name:Ne(G)}):Bp({target:Ne(v_(U))}),filePath:K,labelTarget:G?`${G} skill`:v_(U)}}if($.some(G=>(G==null?void 0:G.name)==="find"||(G==null?void 0:G.name)==="ls"||(G==null?void 0:G.name)==="rg"&&G.args.includes("--files")))return{kind:"search",label:gN()};const ne=$.findIndex(G=>(G==null?void 0:G.name)==="rg"||(G==null?void 0:G.name)==="grep");if(ne>=0){const G=lLn(j[ne].raw);return{kind:"search",label:G?X2({pattern:Ne(G)}):Q2(),searchPattern:G??void 0}}const ce=$.find(G=>(G==null?void 0:G.name)==="git"),_e=ce==null?void 0:ce.args[0];if(_e==="grep"){const G=ce==null?void 0:ce.args.slice(1).find(oe=>!oe.startsWith("-"));return{kind:"search",label:G?X2({pattern:Ne(G)}):Q2(),searchPattern:G}}if(_e==="status")return{kind:"command",label:Gye()};if(_e==="diff")return{kind:"command",label:vke()};if(_e==="log")return{kind:"command",label:d5e()};const se=G=>$.some(oe=>!oe||!["cargo","pnpm","npm","yarn"].includes(oe.name)?!1:oe.args[0]===G||oe.args[0]==="run"&&oe.args[1]===G);return se("test")?{kind:"command",label:J3e()}:$.some(G=>(G==null?void 0:G.name)==="tsc")||se("typecheck")?{kind:"command",label:Exe()}:se("lint")?{kind:"command",label:Cye()}:se("build")?{kind:"command",label:sye()}:{kind:"command",label:Jne({command:Ne(T)})}}case"skill":{const T=Vs(i,"skill","name"),j=T?tLn(n,T):null;return{kind:"skill",label:T?Rne({name:Ne(T)}):Cne(),filePath:j??void 0,labelTarget:j&&T?`${T} skill`:void 0}}case"read":{const T=p?v_(p):null,j=p?h4(p):null;return j?{kind:"skill",label:W2({name:Ne(j)}),filePath:p??void 0,labelTarget:`${j} skill`}:T?{kind:"read",label:Bp({target:Ne(T)}),filePath:p??void 0,labelTarget:T}:{kind:"read",label:a5e()}}case"edit":case"write":case"notebookedit":{const T=rLn(i),j=p??(T==null?void 0:T.path)??null,M=j?v_(j):null,D=M?(T==null?void 0:T.type)==="add"?nte({target:Ne(M)}):(T==null?void 0:T.type)==="delete"?kte({target:Ne(M)}):Ite({target:Ne(M)}):null;return M?{kind:"edit",label:D??dN(),filePath:j??void 0,labelTarget:M}:{kind:"edit",label:dN()}}case"grep":{const T=Vs(i,"pattern");return{kind:"search",label:T?X2({pattern:Ne(T)}):Q2(),searchPattern:T??void 0}}case"glob":{const T=Vs(i,"pattern");return{kind:"search",label:T?_ne({pattern:Ne(T)}):gN()}}case"websearch":{const T=Vs(i,"query"),j=Vs(i,"url"),M=Vs(i,"pattern");return T?{kind:"web",label:UE({query:T})}:M&&j?{kind:"web",label:aae({pattern:M})}:j?{kind:"web",label:Vne({target:Ne(j)})}:{kind:"web",label:m??aN()}}case"webfetch":{const T=Vs(i,"url");return{kind:"web",label:T?Bp({target:Ne(T)}):m??Vre()}}case"task":return{kind:"agent",label:m??are()};case"subagent":return{kind:"agent",label:pLn(i)};case"error":return{kind:"command",label:Z6e()};case"importedchat":return{kind:"project",label:sne()};case"contextcompaction":return{kind:"command",label:((C=e.state)==null?void 0:C.status)==="error"?Qee():((N=e.state)==null?void 0:N.status)==="running"?HE():Lee(),progressLabel:HE()};default:{const T=m??p??a??((z=e.state)==null?void 0:z.title)??"";return{kind:"command",label:T?`${n}: ${T}`:n}}}}function pLn(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return eoe();case"sendInput":return Kae();case"resumeAgent":return ase();case"wait":return Doe();case"closeAgent":return jee()}switch(typeof e.kind=="string"?e.kind:""){case"started":return xoe();case"interacted":return tee();case"interrupted":return hoe()}return ooe()}function ob({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(vf,{...t});if(e.litCall)r=f.jsx(VB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx(OI,{...t});break;case"read":case"project":r=f.jsx(DI,{...t});break;case"search":r=f.jsx(WI,{...t});break;case"edit":r=f.jsx(vS,{...t});break;case"web":r=f.jsx(K4n,{...t});break;case"agent":r=f.jsx(wS,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function g4({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=A.useState(!1),a=A.useRef(null),o=A.useRef(!1);return A.useEffect(()=>{var c,u;!s||!o.current||(o.current=!1,(u=(c=a.current)==null?void 0:c.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((c,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Ur(h=>n(c.id,h),{stopPropagation:!0}):{onClick:h=>{h.stopPropagation(),t==null||t(c.id)}},children:c.label}):f.jsx("span",{children:c.label})]},c.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?iY({target:r}):OJ({count:Xt(e.length),target:r}),onClick:c=>{c.preventDefault(),c.stopPropagation(),o.current=!s&&c.detail===0,i(u=>!u)},children:s?RD():Qze({count:Xt(e.length)})})]})}function Y5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,c,u,h;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:z8n(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(Ywn,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const _=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Ur(p=>n(_,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((c=e.spawnedSessionIds)!=null&&c.length&&r){const _=e.spawnedSessionIds,p=_.slice(0,3),m=_.slice(p.length).map((x,k)=>({id:x,label:ZE({number:Xt(p.length+k+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,k)=>f.jsxs("span",{children:[k>0&&", ",f.jsx("button",{className:"tool-target",title:G4e(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(x)},children:ZE({number:Xt(k+1)})})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(g4,{items:m,onSelect:r,targetType:ope()})]})]})}if((u=e.runIds)!=null&&u.length){const _=s?e.runIds.filter(x=>!!s(x)):e.runIds;if(_.length===0)return e.label;const p=_.slice(0,3),m=_.slice(p.length).map(x=>({id:x,label:(s==null?void 0:s(x))||Vc()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,k)=>f.jsxs("span",{children:[k>0&&", ",t?f.jsx("button",{className:"tool-target",title:aZ({run:Ne(x)}),...Ur(v=>t(x,v),{stopPropagation:!0}),children:(s==null?void 0:s(x))||Vc()}):f.jsx("span",{children:(s==null?void 0:s(x))||Vc()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(g4,{items:m,onOpen:t,targetType:C8e()})]})]})}if((h=e.experimentIds)!=null&&h.length){const _=a?e.experimentIds.filter(x=>!!a(x)):e.experimentIds;if(_.length===0)return e.label;const p=_.slice(0,3),m=_.slice(p.length).map(x=>({id:x,label:(a==null?void 0:a(x))||Vc()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,k)=>f.jsxs("span",{children:[k>0&&", ",i?f.jsx("button",{className:"tool-target",title:BY({name:(a==null?void 0:a(x))||Ne(x)}),...Ur(v=>i(x,v),{stopPropagation:!0}),children:(a==null?void 0:a(x))||Vc()}):f.jsx("span",{children:(a==null?void 0:a(x))||Vc()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(g4,{items:m,onOpen:i,targetType:qme()})]})]})}return e.label}function _C(e){const n=e.progressLabel??{skill:Bne(),read:Jre(),search:Pae(),edit:Ute(),project:Fse(),web:pee(),agent:mte(),command:bD()}[e.kind];return{...e,label:n}}function BH(e,n){const t=rf({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:vne(),read:dre(),search:oie(),edit:Tte(),project:dse(),web:cee(),agent:lte(),command:Wse()}[t.kind]}function mLn(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const gLn=250;function vLn(e,n){const[t,r]=A.useState(e),s=A.useRef(Date.now()),i=A.useRef(e);return A.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=gLn-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const bLn=160;function PH(e){const[n,t]=A.useState(!1);return A.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),bLn);return()=>window.clearTimeout(r)},[e]),e&&n}function yLn(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:ND()}}function xLn(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function wLn(e){const n=[];let t=null;for(const r of e){const s=rf(r),i=xLn(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function FH({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var x,k;const i=(x=e.state)==null?void 0:x.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,c]=A.useState(Date.now());if(A.useEffect(()=>{if(typeof a!="number"||(c(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();c(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=_8n(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(Nt,{}),f.jsx("span",{children:v})]})}const u=UB(i==null?void 0:i.recoveryAction),h=i==null?void 0:i.turnId,_=qB(e)?_1e():s?U8e():TN(),p=s?F4n:xS,m=Oy(((k=e.state)==null?void 0:k.error)||TN());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:_}),f.jsx(Ba,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&h&&(u==="retry"||u==="continue")&&f.jsx(De,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(h,u),children:t?v9e():u==="retry"?Qs():nme()})]})}function ER({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:c}){const u=e.state,h=(u==null?void 0:u.status)==="error",_=Oy((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=h&&!!_,[m,x]=A.useState(!1),k=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(FH,{part:e,busy:!1,recovering:!1,usageLimited:c5(e)});const v=f.jsxs(f.Fragment,{children:[h&&f.jsxs("span",{className:"sr-only",children:[Uk()," "]}),h?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx($I,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(ob,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${zH} ${h?"text-accent-red":"text-subtext"}`,children:[f.jsx(Y5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:c}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:bY({count:Xt(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":k,"aria-label":m?fY({activity:n.label}):NJ({activity:n.label}),onClick:()=>x(b=>!b),children:f.jsx(Ba,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:k,children:f.jsx("div",{className:lC,children:_.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function kLn({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,D,I;const[c,u]=A.useState(!1),[h,_]=A.useState(!1),p=()=>{_(!0),u($=>!$)},m=wLn(e),x=m.map(({activity:$})=>$),k=n?m.at(-1):void 0,v=k==null?void 0:k.part,b=k==null?void 0:k.activity,w=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&_C(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(w!=null&&w.progressLabel)&&(mLn((D=v.state)==null?void 0:D.input)||(w==null?void 0:w.kind)==="command"&&!Vs(((I=v.state)==null?void 0:I.input)??{},"command","cmd")),C=vLn(w,y),N=PH(C!=null),z=C??yLn(x),T=C?C.label:ND();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(ob,{activity:C,className:N?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${N?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(Y5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(ER,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(ob,{activity:z,className:N?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${N?"tool-running-shimmer":""}`,title:T,children:f.jsx(Y5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":c,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":c,"aria-label":c?D0e():Lme(),children:f.jsx(Ba,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${c?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${c?"open":""}`,"aria-hidden":!c,inert:!c,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:h&&m.map(({part:$,count:q,activity:H})=>f.jsx(ER,{part:$,repeatCount:q,activity:H,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function SLn({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var h;const s=e.prompt,[i,a]=A.useState([]),o=!n,c=_=>n==null?void 0:n({promptId:e.id,..._});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:f3e(),icon:Ri,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:M3e(),icon:vS,iconClass:"text-accent-amber"}:s.approved===!1?{label:b3e(),icon:lr,iconClass:"text-accent-red"}:{label:E3e(),icon:Lb,iconClass:"text-muted"},x=m.icon;return f.jsxs("details",{className:ZDn,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?jD():NN()}),f.jsx(x,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Ba,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${wR} ms-6`,children:[f.jsx(Jo,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const _=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,x)=>({id:`${e.id}-annotation-${x}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(uC,{annotations:p,variant:"sent"}),f.jsxs("details",{className:YDn,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||g7e()}),f.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 ${_?"chosen":""}`,children:_||_8e()})]}),f.jsxs("div",{className:wR,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var x;return f.jsx("li",{className:(x=s.answers)!=null&&x.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==_&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const _=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?s7e():NN()}),f.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 ${_?"clamped":""}`,children:f.jsx(Jo,{text:s.plan??"",onOpenFile:t})}),_&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Ur(p=>r(s.plan??"",e.id,p)),children:_Ce()}),!o&&!_&&f.jsxs("div",{className:Q5,children:[f.jsx(De,{size:"small",variant:"primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:Bve()}),f.jsx(De,{size:"small",onClick:()=>c({approve:!0,resumeMode:"bypassPermissions"}),children:Vve()}),f.jsx(De,{size:"small",onClick:()=>c({approve:!1}),children:N5e()})]})]})}if(s.kind==="permission"){const _=s.toolInput??{},p=Vs(_,"command","cmd","filePath","file_path","path")||"",m=typeof((h=s.toolInput)==null?void 0:h.reason)=="string"&&s.toolInput.reason||"",x=Vs(_,"description")||"",k=m||x||BH(s.tool,_),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(xS,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:ybe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:k}),p&&f.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:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(De,{size:"small",variant:"ghost",onClick:()=>c({approve:!1}),children:L2e()}),f.jsx(De,{size:"small",variant:"primary",onClick:()=>c({approve:!0}),children:dbe()})]})]})]})}const u=_=>a(p=>s.multiSelect?p.includes(_)?p.filter(m=>m!==_):[...p,_]:[_]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:JDn,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(_=>{const p=i.includes(_.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start 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 ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(_.label):c({answers:[_.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:_.label}),_.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:_.description})]},_.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:Q5,children:f.jsx(De,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>c({answers:i}),children:G6e()})})]})}function CLn(e,n){return e.role==="user"?!0:e.parts.some(t=>yh(t,n))}function ELn(e){const n=e.text??"",t=n.startsWith("data:")?n:Zyn(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}async function fC(e){try{if(!navigator.clipboard)throw new Error(DD());await navigator.clipboard.writeText(e),bn(K_(),"success")}catch(n){bn(n instanceof Error?n.message:String(n),"error")}}function NLn(e,n){const t=URL.createObjectURL(new Blob([n],{type:"text/markdown;charset=utf-8"})),r=document.createElement("a");r.href=t,r.download=e,document.body.append(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(t),1e3)}function zLn({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:c,editDisabled:u}){const h=t>1,_=new Date(n),p=()=>fC(e);return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${h?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[h&&f.jsxs(f.Fragment,{children:[f.jsx($t,{size:"small",title:bN(),"aria-label":bN(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(LI,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx($t,{size:"small",title:vN(),"aria-label":vN(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Ba,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:_.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:_.toLocaleTimeString(E(),{hour:"numeric",minute:"2-digit"})}),f.jsx($t,{size:"small","aria-label":Qk(),disabled:!e,onClick:p,children:f.jsx(gf,{size:13})})]}),f.jsx($t,{size:"small",title:fN(),"aria-label":fN(),disabled:u,onClick:c,children:f.jsx(vS,{size:13})})]})}const jLn=A.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,busy:m=!1,recoveringTurnId:x,onRecover:k,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:N,forkDisabled:z,branchDisabled:T,onFork:j,onSelectFork:M}){var J,Z;pf();const[D,I]=A.useState(null),$=ALn(n);if($)return f.jsx(RLn,{part:$});if(n.role==="user"){const B=n.parts.filter(ce=>ce.type==="text").map(ce=>ce.text??"").join(` -`),L=ce=>!!(v!=null&&v.some(_e=>_e.name===ce)),F=n.parts.filter(ce=>ce.type==="image"&&ce.text).map(ELn),U=F.filter(ce=>!ce.isPdf),K=F.filter(ce=>ce.isPdf),ne=n.parts.filter(ce=>ce.type==="annotation"&&ce.text).map(ce=>({id:ce.id,text:ce.text??""}));if(D!==null){const ce=()=>{const _e=D.trim();!_e||z||(I(null),j(n.id,_e))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":twe(),value:D,autoFocus:!0,onChange:_e=>I(_e.target.value),onKeyDown:_e=>{_e.key==="Escape"?(_e.preventDefault(),I(null)):_e.key==="Enter"&&!_e.shiftKey&&!_e.nativeEvent.isComposing&&(_e.preventDefault(),ce())}}),f.jsxs("div",{className:`${Q5} justify-end`,children:[f.jsx(De,{size:"small",onClick:()=>I(null),children:_ye()}),f.jsx(De,{size:"small",variant:"primary",onClick:ce,disabled:z||!D.trim(),children:o3()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[ne.length>0&&f.jsx(uC,{annotations:ne,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(xDn,{text:B,isCommand:L}),U.length>0&&f.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((ce,_e)=>f.jsx("a",{href:ce.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:ce.src,alt:Wpe()})},_e))}),K.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:K.map((ce,_e)=>f.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:ce.src,target:"_blank",rel:"noreferrer",children:[f.jsx(Lb,{size:15}),f.jsx("span",{children:ce.name})]},_e))})]}),w!==void 0&&f.jsx(zLn,{text:B,createdAt:n.createdAt,count:w,index:y,prevId:C,nextId:N,onSelect:M,pagerDisabled:T,onEdit:()=>I(B),editDisabled:z})]})}const q=n.parts.find(B=>B.type==="tool"&&c5(B)),H=n.parts.find(Rm)??q,Q=n.parts.filter(B=>B!==H&&!(q&&c5(B))),V=b&&!n.completedAt?"":HB(n);return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(TLn,{message:n,parts:Q,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,predictTextTail:b}}),H&&f.jsx(FH,{part:H,usageLimited:!!q,busy:m,recovering:x===((Z=(J=H.state)==null?void 0:J.input)==null?void 0:Z.turnId),onRecover:k}),V&&f.jsx("div",{className:"flex opacity-0 transition-opacity duration-80 ease-standard group-hover/turn:opacity-100 group-focus-within/turn:opacity-100",children:f.jsx($t,{size:"small",title:eN(),"aria-label":eN(),onClick:()=>void fC(V),children:f.jsx(gf,{size:13})})})]})});function TLn({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=PB(n,r),[a,o]=A.useState(!1),[,c]=A.useState(0);if(A.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>c(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:iv(i,t)});const u=e.completedAt??(r?Date.now():null),h=u===null?null:u-e.createdAt,_=h===null?null:h<6e4||h>=36e5?A0(h):ZEe({minutes:Xt(Math.floor(h/6e4)),seconds:Xt(Math.floor(h/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:_===null?GEe():iNe({duration:_})}),f.jsx(Ba,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:iv(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:iv(i,t)})]})}function ALn(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===iI?n:null}function RLn({part:e}){var c;const n=e.state,t=Vs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((c=n==null?void 0:n.input)==null?void 0:c.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` -`),o=r?bD():s&&i!==null?w0e({code:Xt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[SD()," "]}),f.jsx(vf,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${lC} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function iv(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,predictTextTail:m=!1}=n,x=e.filter(C=>C.type!=="steer"&&yh(C,t)).at(-1),k=[];let v=[];const b=()=>{v.length!==0&&(k.push(f.jsx(kLn,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(yh(C,t)){if(C.type==="tool"&&(OLn(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),k.push(f.jsx(LLn,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?k.push(f.jsx(Jo,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(x==null?void 0:x.id)},C.id)):C.type==="steer"?k.push(f.jsx("div",{dir:"auto",role:"note","aria-label":BCe(),className:"msg-steer my-2 ms-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&&k.push(f.jsx(SLn,{part:C,onRespond:h,onOpenFile:s,onOpenPlan:_},C.id))}return b(),k}function MLn(e){return rf(e).label}function OLn(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function HH(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function cb(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&cb(t.children,n);if(r)return r}return null}function DLn({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var x,k,v,b;const o=e.children??[],c=((x=e.state)==null?void 0:x.status)==="running",u=((k=e.state)==null?void 0:k.status)==="error",h=u?Oy(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",_=iv(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:c,pendingTailToolId:c?$B(o):null}),m=o.some(w=>w.type==="text"&&!!w.text)?"":HH(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[Uk()," "]}),h&&f.jsx("div",{className:lC,children:h.slice(0,2e4)}),_.length===0&&!m&&!h?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:c?Gk():A1e()}):f.jsxs(f.Fragment,{children:[_,m&&f.jsx(Jo,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function LLn({part:e,pendingTail:n,onOpenSubagent:t}){var u,h,_,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=Oy(((h=e.state)==null?void 0:h.error)||((_=e.state)==null?void 0:_.output)||""),i=n&&!r?_C(rf(e)):rf(e),a=PH(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!HH(e),c=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[Uk()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx($I,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(ob,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${zH} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:c}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:Eve(),...Ur(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[c,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ba,{size:12})})]})}function ILn(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const c of s){const u=`${i}/${c.id}`;c.type==="tool"&&((a=c.state)!=null&&a.status)&&n.set(u,{status:c.state.status,part:c}),(o=c.children)!=null&&o.length&&r(c.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function dC(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Vs(o,"reason","description")||BH(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function $Ln(e){const[n,t]=A.useState({text:"",sequence:0}),r=A.useRef(null);return A.useEffect(()=>{var x,k,v,b,w;const s=((x=e[0])==null?void 0:x.id)??"",{messageId:i,states:a}=ILn(e),o=dC(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?GE({label:Wi(o.label)}):"",sequence:y.sequence+1}));return}const c=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,h=[...a].filter(([y,C])=>{var N;return((N=c.get(y))==null?void 0:N.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:GE({label:Wi(o.label)}),sequence:y.sequence+1}));return}const _=(k=h.find(([,y])=>Rm(y.part)))==null?void 0:k[1].part;if((_==null?void 0:_.id)==="turn-recovery"){const y=UB((b=(v=_.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${qce()}${y?` ${y==="retry"?cce():tce()}`:""}`,sequence:C.sequence+1}));return}if((_==null?void 0:_.id)==="turn-retry"){t(y=>({text:Woe(),sequence:y.sequence+1}));return}const p=h.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>rf(C.part).label).join(", ");t(C=>({text:p.length===1?jce({labels:y}):Lce({count:Xt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=h.filter(([,y])=>y.status==="running");if(m.length>0){const y=(w=m.at(-1))==null?void 0:w[1].part;t(C=>({text:y?_C(rf(y)).label:pce(),sequence:C.sequence+1}));return}h.some(([,y])=>y.status==="completed")&&t(y=>({text:wce(),sequence:y.sequence+1}))},[e]),n}const BLn=A.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:c,onSelectFork:u,busy:h,onOpenFile:_,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:k,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,recoveringTurnId:C,onRecover:N,skills:z}){var B,L,F;pf();const T=((B=dC(n))==null?void 0:B.id)??null,j=A.useMemo(()=>n.filter(U=>CLn(U,T)),[n,T]),M=A.useMemo(()=>{const U=j.filter(K=>K.role==="user"&&!K.id.startsWith(P_));return s8n(a,n,U,K=>K.startsWith(P_))},[n,j,a]),D=A.useRef(new Set),[I,$]=A.useState(!1),q=A.useCallback(U=>j[U].id,[j]),H=A.useCallback(U=>{if(I)return j.map((ne,ce)=>ce);const K=new Set(LB(U));return j.forEach((ne,ce)=>{D.current.has(ne.id)&&K.add(ce)}),[...K].sort((ne,ce)=>ne-ce)},[j,I]),Q=t8n({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:q,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var U;return Math.max(0,j.length*400-(((U=t.current)==null?void 0:U.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:H});A.useLayoutEffect(()=>{const U=()=>Q.scrollToEnd();return r.current=U,i(),()=>{r.current=null}},[Q,r,i]),A.useEffect(()=>{const U=()=>{var ce;const K=window.getSelection();if(!K||K.isCollapsed||!K.rangeCount)return;const ne=K.getRangeAt(0);for(const _e of((ce=t.current)==null?void 0:ce.querySelectorAll("[data-message-id]"))??[])ne.intersectsNode(_e)&&_e.dataset.messageId&&D.current.add(_e.dataset.messageId)};return document.addEventListener("selectionchange",U),()=>document.removeEventListener("selectionchange",U)},[t]);const V=j.at(-1),J=$Ln(n),Z=h?BB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:J.text},J.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":I,onClick:()=>$(U=>!U),children:s9e()}),f.jsx("div",{className:"relative",style:{height:Q.getTotalSize()},children:Q.getVirtualItems().map(U=>{var se,G,oe,le,pe,be;const K=j[U.index],ne=K.parts.find(Rm),ce=(G=(se=ne==null?void 0:ne.state)==null?void 0:se.input)==null?void 0:G.turnId,_e=ne?h||C!==null:!1;return f.jsx("div",{"data-index":U.index,"data-message-id":K.id,ref:Q.measureElement,className:"absolute left-0 w-full pb-4",style:{top:U.start},onClickCapture:Me=>{!(Me.target instanceof Element)||!Me.target.closest("[data-work-toggle]")||(s.current=!1,Q.setOptions({...Q.options,anchorTo:"start"}))},onPointerDownCapture:()=>D.current.add(K.id),onFocusCapture:()=>D.current.add(K.id),children:f.jsx(jLn,{message:K,forkCount:(oe=M.get(K.id))==null?void 0:oe.count,forkIndex:(le=M.get(K.id))==null?void 0:le.index,forkPrevId:(pe=M.get(K.id))==null?void 0:pe.prevId,forkNextId:(be=M.get(K.id))==null?void 0:be.nextId,forkDisabled:!o,branchDisabled:h,onFork:c,onSelectFork:u,activePermissionId:T,pendingTailToolId:(Z==null?void 0:Z.messageId)===K.id?Z.toolId:null,onOpenFile:_,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:k,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,busy:_e,recoveringTurnId:ce===C?C:null,onRecover:N,skills:z,predictTextTail:h&&K===V&&K.role==="assistant"})},K.id)})})]})}),PLn=(e,n)=>e==="all"?!0:e==="archived"?n:!n,qH=[{id:"active",label:Jve,railLabel:TD},{id:"archived",label:sN,railLabel:sN},{id:"all",label:abe,railLabel:kD}];function FLn({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=_o();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx($t,{size:"small",className:"rail-filter-btn",active:e!=="active",title:mN(),"aria-label":mN(),onClick:()=>r(i=>!i),children:f.jsx(QI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:qH.map(i=>f.jsxs(Jn,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Ri,{size:13})]},i.id))})]})}const HLn=14,qLn=500,ULn=1200;function UH({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.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*HLn,qLn)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function GLn({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:c,onDelete:u}){var N;const{open:h,setOpen:_,ref:p}=_o(),m=((N=e.title)==null?void 0:N.trim())||"Untitled",[x,k]=A.useState(!1),[v,b]=A.useState(""),w=A.useRef(null);function y(){var z;b(((z=e.title)==null?void 0:z.trim())||""),k(!0)}function C(){var T;const z=v.trim();k(!1),z&&z!==(((T=e.title)==null?void 0:T.trim())||"")&&o(z)}return A.useEffect(()=>{var z,T;x&&((z=w.current)==null||z.focus(),(T=w.current)==null||T.select())},[x]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.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]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.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-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]: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-dot]:hidden ${n?"active":""} ${t?"unread":""} ${h?"menu-open":""} ${x?"editing":""}`,title:`${su[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?_9e():""}`,onClick:()=>{x||(h?_(!1):a())},onKeyDown:z=>{z.target===z.currentTarget&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),h?_(!1):a())},children:[e.parentSessionId&&!x&&f.jsx(wS,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),x?f.jsx("input",{ref:w,className:"session-title-input","aria-label":rSe(),value:v,onChange:z=>b(z.target.value),onClick:z=>z.stopPropagation(),onBlur:C,onKeyDown:z=>{z.stopPropagation(),z.key==="Enter"?(z.preventDefault(),C()):z.key==="Escape"&&(z.preventDefault(),k(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(UH,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:SN(),"aria-label":SN(),onClick:z=>{z.stopPropagation(),_(T=>!T)},children:f.jsx(pS,{size:14})}),h&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(Jn,{onClick:z=>{z.stopPropagation(),_(!1),y()},children:f.jsx("span",{children:ED()})}),f.jsx(Jn,{onClick:z=>{z.stopPropagation(),_(!1),c(!e.archived)},children:f.jsx("span",{children:e.archived?CEe():Npe()})}),f.jsx(Jn,{danger:!0,onClick:z=>{z.stopPropagation(),_(!1),u()},children:f.jsx("span",{children:CD()})})]})]})}const NR=[DI,WI,vf,mh],VLn=()=>[{title:TSe(),prompt:kSe()},{title:USe(),prompt:ISe()},{title:s6e(),prompt:YSe()},{title:v6e(),prompt:_6e()}],v4=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],zR="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function KLn({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:c,runExperimentName:u,onOpenExperiment:h,experimentName:_,onOpenPlan:p,onOpenSubagent:m,runtime:x,onOpenDemoWelcome:k,composerFocusNonce:v=0,demoRunningRunId:b=null,activeSessionId:w,onActiveSessionChange:y,preferredAgent:C,onPreferredAgentChange:N,children:z}){var Ku,zo,Wu,ga,yc,$f,ks;const T=an({mutationFn:te=>Wyn(...te)}),j=an({mutationFn:te=>Vyn(...te)}),M=an({mutationFn:te=>Kyn(...te)}),D=an({mutationFn:te=>Pyn(...te)}),I=an({mutationFn:te=>Hyn(...te)}),$=an({mutationFn:te=>Uyn(...te)}),q=an({mutationFn:te=>Gyn(...te)}),H=an({mutationFn:qyn}),Q=A.useMemo(()=>La(e),[e]),{data:V=eLn}=ct(Q),J=A.useCallback(te=>{Jr(Q.queryKey,ve=>{if(!ve)return;const ze=typeof te=="function"?te(ve):te,X=new Map(ve.map(ae=>[ae.id,ae]));for(const ae of ze)X.get(ae.id)!==ae&&Za(et,Q.queryKey,ae.id),X.delete(ae.id);for(const ae of X.keys())Za(et,Q.queryKey,ae);return ze})},[Q]),Z=w,B=A.useRef(y);B.current=y;const L=A.useRef({projectId:e});L.current.projectId!==e&&(L.current={projectId:e});const[F,U]=A.useState(new Set),[K,ne]=A.useState("active"),[ce,_e]=A.useState(""),[se,G]=A.useState(!1),[oe,le]=A.useState(!1),[pe,be]=A.useState([]),Me=A.useRef(0),Le=A.useRef({projectId:e,activeId:Z,mainView:i});(Le.current.projectId!==e||Le.current.activeId!==Z||Le.current.mainView!==i)&&(Le.current={projectId:e,activeId:Z,mainView:i});const[Ke,je]=A.useState([]),[we,rt]=A.useState(null),Ze=Z??"new",at=A.useRef(new Map),St=A.useRef(xw);St.current={draft:ce,attachments:Ke,annotations:pe};const Ft=e===Pp&&V.length>0&&V.every(te=>Rvn[te.id]===te.activeLeafId)?Pz:null,ut=A.useRef(null);Ft!==null&&ut.current===null&&Z!==null&&(ut.current=Ze);const dt=Ze===ut.current?Ft:null;A.useLayoutEffect(()=>{const te=at.current.get(Ze)??xw;return St.current=te,_e(te.draft),je(te.attachments),be(te.annotations),()=>{const ve=h8n(St.current,dt);ve?at.current.set(Ze,ve):at.current.delete(Ze)}},[Ze,dt]);const[Ie,me]=A.useState(null),Ae=A.useRef(Promise.resolve()),Pe=A.useRef(0),nt=A.useRef(0),[_t,pt]=A.useState(null),yt=A.useRef(null),Zt=A.useRef(!1),nn=A.useRef(null),[jt,mt,ft]=Dxn(e,i==="chat"?Z:null),{data:en=QLn}=ct(ku()),[An,xr]=A.useState(C);A.useEffect(()=>xr(C),[C]);const[kn,Ln]=A.useState({}),[Un,dr]=A.useState(Yp),[es,Ct]=A.useState(null),on=A.useRef(!1),cn=A.useRef(null),[fn,wr]=A.useState(null),un=A.useRef(!1),dn=A.useRef(null),[Tn,wt]=A.useState(new Map),Mt=A.useRef(new Map),zn=A.useRef(null),hr=A.useRef(null),Hn=A.useRef(null),hn=A.useRef(!0),[Tr,Ar]=A.useState(!0),Rn=A.useRef(null),[Ge,kt]=A.useState(!1),pr=_o(),Gn=A.useCallback(te=>{var ve;Me.current+=1,be(ze=>[...ze,{id:`annotation-${Me.current}`,...te}]),(ve=Rn.current)==null||ve.focus()},[]),pn=VDn(hr,Gn);KDn(pe),A.useEffect(()=>{kt(!1),pn.dismiss()},[Z,e,pn.dismiss]);const[ts,rr]=A.useState(0),[_a,Vr]=A.useState(!1),[sr,ho]=A.useState(0),[po,Vn]=A.useState(0),Kr=A.useRef(!1);function mo(te){if(!Wn)return;if(!vi&&te.source==="command"&&My(te.name)&&te.name!=="goal"){Fu(te.name,ce,Wn);return}const ve=te.source==="command"?1:V5(te.name,Rn.current),ze=hDn(ce,Wn,te.name,ve);_e(ze.text),window.requestAnimationFrame(()=>{var X,ae;(X=Rn.current)==null||X.focus(),(ae=Rn.current)==null||ae.setSelectionRange(ze.cursor,ze.cursor),Vn(ze.cursor)})}function go(te){if($s)return!1;const ve=te.selectionStart;if(Kr.current||ve!==te.selectionEnd)return!1;const ze=ce.slice(0,ve).replace(/[ \t]+$/,"").length,X=l4(ce,ze);if(!X||X.end!==ze||!yl(X.query)||ve>ze&&ve-ze!==V5(X.query,te))return!1;const ae=mR(ce,{...X,end:ve});return _e(ae.text),Vn(ae.cursor),window.requestAnimationFrame(()=>te.setSelectionRange(ae.cursor,ae.cursor)),!0}function Zs(te){rt(null);let X=Ke.reduce((ae,xe)=>ae+xe.size,0);for(const ae of te){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(ae.type))continue;if(ae.size>31457280){rt(t0e({name:Ne(ae.name)}));continue}if(X+ae.size>41943040){rt(c0e());continue}X+=ae.size;const xe=Z,Re=new FileReader;Re.onload=()=>{const Se={dataUrl:Re.result,mediaType:ae.type,name:ae.name,size:ae.size};if(Le.current.activeId===xe){je(We=>[...We,Se]);return}const He=at.current.get(xe??"new")??xw;at.current.set(xe??"new",{...He,attachments:[...He.attachments,Se]})},Re.readAsDataURL(ae)}}function vo(te){const ve=Array.from(te.clipboardData.items).filter(ze=>ze.kind==="file"&&(ze.type.startsWith("image/")||ze.type==="application/pdf")).map(ze=>ze.getAsFile()).filter(ze=>ze!==null);ve.length>0&&(te.preventDefault(),Zs(ve))}const Vt=V.find(te=>te.id===Z),Fa=An??pkn(en),Kn=Vt?{harness:Vt.harness,model:kn.model??Vt.model,serviceTier:kn.serviceTier!==void 0?kn.serviceTier:Vt.serviceTier,permissionMode:kn.permissionMode??Vt.permissionMode,reasoningLevel:kn.reasoningLevel??Vt.reasoningLevel}:Fa?{...Fa,...kn}:null,{data:Wr=WLn}=ct(Cxn(Kn==null?void 0:Kn.harness)),st=Kn?en.find(te=>te.id===Kn.harness):void 0,Wt=st==null?void 0:st.options,Es=A.useMemo(()=>pDn(Wr,Wt==null?void 0:Wt.planActivation),[Wr,Wt==null?void 0:Wt.planActivation]),Js=vR(ce),mi=Js!==null,Wn=l4(ce,po),mr=(Wn==null?void 0:Wn.query)??null,Is=mr===null?[]:Es.filter(te=>fDn(te,mr)),$s=!mi&&mr!==null&&(Wn==null?void 0:Wn.end)===po&&Is.length>0,Lr=$s&&!_a?Is:[],gi=Lr.length>0,gr=Math.min(ts,Math.max(0,Lr.length-1));A.useEffect(()=>rr(0),[mr]);const Ns=Kn&&st&&!st.catalogPending&&st.models.length>0&&!st.models.some(te=>te.id===Kn.model)?st.models[0].id:(Kn==null?void 0:Kn.model)??null,Bt=Kn&&{...Kn,model:Ns,serviceTier:Rv(st,Ns,Kn.serviceTier),reasoningLevel:JL(st,Ns,Kn.reasoningLevel)},zs=Ob(st,Bt==null?void 0:Bt.model),Ha=te=>{if(!Bt)return;const ve={...Bt,...te},ze={};te.model!==void 0&&te.model!==Bt.model&&(ze.model=te.model),te.serviceTier!==void 0&&te.serviceTier!==Bt.serviceTier&&(ze.serviceTier=te.serviceTier),te.permissionMode!==void 0&&te.permissionMode!==Bt.permissionMode&&(ze.permissionMode=te.permissionMode),te.reasoningLevel!==void 0&&te.reasoningLevel!==Bt.reasoningLevel&&(ze.reasoningLevel=te.reasoningLevel),dr(X=>({...X,...ze})),xr(ve),N(ve).catch(()=>{}),Vt?Ln(X=>({...X,...te})):te.harness&&te.harness!==Bt.harness&&Ln({})},js=A.useCallback(te=>{const ve=Ae.current.catch(()=>{}).then(()=>{if(!Dn(Q.queryKey))throw new DOMException("Workspace changed","AbortError");return te()});return Ae.current=ve.then(()=>{},()=>{}),ve},[Q]),qa=te=>{if(te==="plan"&&(st==null?void 0:st.id)==="claude-code"?(dr(X=>({...X,permissionMode:te})),Ln(X=>({...X,permissionMode:te}))):(Ln(X=>{const ae={...X};return delete ae.permissionMode,ae}),Ha({permissionMode:te})),!Vt)return;const ve=Vt.id,ze=++Pe.current;me(null),js(()=>T.mutateAsync([ve,te])).then(X=>{J(ae=>ae.map(xe=>xe.id===X.id?X:xe)),Pe.current===ze&&Ln(ae=>{const xe={...ae};return delete xe.permissionMode,xe})}).catch(()=>{Pe.current===ze&&(Ln(X=>{const ae={...X};return delete ae.permissionMode,ae}),me($Ee()))})},$u=te=>Ha({reasoningLevel:te}),Bu=((Ku=Vt==null?void 0:Vt.goal)==null?void 0:Ku.trim())||"",bo=(Bt==null?void 0:Bt.harness)==="claude-code"?Bt.permissionMode==="plan":(Wt==null?void 0:Wt.planActivation)==="command"?_t??(Vt==null?void 0:Vt.planMode)??!1:!1;A.useEffect(()=>{_t===null||(Vt==null?void 0:Vt.planMode)!==_t||(yt.current=null,pt(null))},[Vt==null?void 0:Vt.planMode,_t]);async function Ir(te){if(dr(X=>({...X,planMode:te})),yt.current=te,pt(te),!Vt)return;const ve=Vt.id,ze=++nt.current;me(null);try{const X=await js(()=>j.mutateAsync([ve,te]));J(ae=>ae.map(xe=>xe.id===X.id?X:xe)),nt.current===ze&&(yt.current=null,pt(null),me(null))}catch(X){throw nt.current===ze&&(yt.current=null,pt(null)),X}}async function Pu(){if((Bt==null?void 0:Bt.harness)==="claude-code"){qa("auto");return}if(Vt)try{await Ir(!1)}catch{me(jme())}}async function yo(){const te=!bo;try{if((Bt==null?void 0:Bt.harness)==="claude-code")qa(te?"plan":"auto");else if((Wt==null?void 0:Wt.planActivation)==="command")await Ir(te);else throw new Error(Yg())}catch{me(jN())}}function fa(te,ve=""){var ze;switch(te){case"plan":return yo(),!1;case"new":return ns(),!1;case"resume":return kt(!0),!0;case"model":return ho(X=>X+1),!0;case"compact":return bl(),!1;case"goal":return Ga(ve),!1;case"copy":{const X=fr.at(-1),ae=ir&&(X==null?void 0:X.role)==="assistant"&&!X.completedAt,xe=c8n(ae?fr.slice(0,-1):fr);return xe?fC(xe):bn(ive(),"info"),!1}case"export":{const X=((ze=Vt==null?void 0:Vt.title)==null?void 0:ze.trim())||yd(),ae=Vt?l8n(X,fr,{user:Xme(),assistant:su[Vt.harness]}):null;return ae?NLn(u8n(X),ae):bn(fve(),"info"),!1}}}async function Ua(te){me(null);const ve=L.current;try{const ze=await D.mutateAsync([e,te]);if(et.invalidateQueries({queryKey:sI().queryKey}),L.current!==ve)return;J(X=>[ze,...X.filter(ae=>ae.id!==ze.id)]),ne("all"),y(ze.id,{projectId:ze.projectId})}catch(ze){if(L.current!==ve)return;me(Uge({error:Ne(ze instanceof Error?ze.message:String(ze))}))}}async function Ga(te){var Re;const ve=te.trim();if(!ve){const Se=(Re=Vt==null?void 0:Vt.goal)==null?void 0:Re.trim();bn(Se?uge({goal:Wi(Se)}):kge(),"info");return}const ze=Le.current,X=()=>Le.current.activeId===ze.activeId;me(null);let ae=Z;if(!ae){if(!(st!=null&&st.agentReady)||!Bt){me(Yg());return}try{ae=(await ma(Bt,_4(Wt==null?void 0:Wt.planActivation,void 0,yt.current))).id}catch(Se){me(tN({error:Ne(Se instanceof Error?Se.message:String(Se))}));return}}const xe=/^(clear|none|off)$/i.test(ve);try{const Se=await js(()=>M.mutateAsync([ae,xe?null:ve]));J(He=>He.map(We=>We.id===Se.id?Se:We)),bn(xe?rge():Tge(),"success")}catch(Se){if(!X())return;me(tN({error:Ne(Se instanceof Error?Se.message:String(Se))}))}}async function bl(){const te=Z;if(!te){bn(Z1e(),"info");return}if(ir){me(H0e());return}me(null),K==="archived"&&ne("active");const ve=Le.current;try{const{message:ze}=await Jyn(te);mt({type:"upsertMessage",sessionId:te,message:ze})}catch(ze){if(Le.current.activeId!==ve.activeId)return;me(Q0e({error:Ne(ze instanceof Error?ze.message:String(ze))}))}}function Fu(te,ve,ze){const X=mR(ve,ze);_e(X.text),Vr(!0),!fa(te)&&window.requestAnimationFrame(()=>{var ae,xe;(ae=Rn.current)==null||ae.focus(),(xe=Rn.current)==null||xe.setSelectionRange(X.cursor,X.cursor),Vn(X.cursor)})}const Bs=A.useCallback(async(te=!1)=>{const ve=L.current;if(ve.projectId!==e||!Dn(Q.queryKey))return null;const ze=(et.getQueryData(Q.queryKey)??[]).map(X=>X.id);try{const X=await et.fetchQuery({...Q,...te?{staleTime:0}:{}});if(L.current!==ve||!Dn(Q.queryKey))return null;const ae=X.filter(Re=>!ll.has(Re.id)),xe=new Set(ae.map(Re=>Re.id));for(const Re of ze)xe.has(Re)||qu(Re);return Mt.current=new Map(ae.map(Re=>[Re.id,Re.title])),ae}catch{return null}},[e]),ds=A.useCallback(async te=>{L.current.projectId!==e||!Dn(Q.queryKey)||await Promise.all([et.fetchQuery({...il(te),staleTime:0}),Bs(!0)]).catch(()=>{})},[e,Bs]);A.useEffect(()=>{const te=c$();U(e===Pp?new Set([Ab,Rb].filter(ze=>!te.has(ze))):new Set),G(!1),le(!1),wt(new Map),Mt.current=new Map,Bs();const ve=L.current;return()=>{L.current===ve&&(L.current={projectId:e})}},[e,Bs]),A.useEffect(()=>{dr(Yp),dn.current=null},[Z]),A.useEffect(()=>Ov(te=>{switch(te.type){case"session":{if(te.session.projectId!==e||ll.has(te.session.id))return;const ve=Mt.current.has(te.session.id),ze=Mt.current.get(te.session.id)!==te.session.title;Mt.current.set(te.session.id,te.session.title),ve&&ze&&te.session.titleSource==="generated"&&(wt(X=>{const ae=new Map(X);return ae.set(te.session.id,(X.get(te.session.id)??0)+1),ae}),window.setTimeout(()=>{wt(X=>{if(!X.has(te.session.id))return X;const ae=new Map(X);return ae.delete(te.session.id),ae})},ULn));break}case"sessionDeleted":qu(te.sessionId);break}}),[e]),A.useEffect(()=>Ov(te=>{te.type==="reconnected"&&Bs(!0)}),[Bs]);const uc=Z?jt.messagesBySession[Z]??kR:kR,da=Z?jt.activeLeafBySession[Z]??null:null;cn.current=da;const fr=A.useMemo(()=>n8n(uc,da),[uc,da]),_c=A.useRef({projectId:e,ids:jt.busySessions});A.useEffect(()=>{const te=_c.current;_c.current={projectId:e,ids:jt.busySessions},te.projectId===e&&U(ve=>o8n(ve,te.ids,jt.busySessions,V,i==="chat"?Z:null))},[e,jt.busySessions,V,Z,i]);const ir=Z?jt.busySessions.has(Z):!1,Ef=!ir&&!!(st!=null&&st.agentReady),xo=ir&&BB(fr)!=null,wo=ir&&a8n(fr),Di=Z?jt.queuedBySession[Z]??[]:[],Ht=Di.some(te=>te.dispatchState==="retrying"),Ps=Di.findIndex(te=>te.dispatchState==="blocked"),ei=Di.reduce((te,ve)=>ve.dispatchState!=="retrying"||typeof ve.nextRetryAt!="number"?te:te===null?ve.nextRetryAt:Math.min(te,ve.nextRetryAt),null),[ha,Nf]=A.useState(()=>Date.now());A.useEffect(()=>{if(!Ht||ei===null||(Nf(Date.now()),ei<=Date.now()))return;const te=window.setInterval(()=>{const ve=Date.now();Nf(ve),ve>=ei&&window.clearInterval(te)},1e3);return()=>window.clearInterval(te)},[Ht,ei]),A.useEffect(()=>{const te=Di.reduce((ve,ze)=>ze.planMode??ve,void 0);te!==void 0?(Zt.current=!0,yt.current=te,pt(te)):Zt.current&&(Zt.current=!1,yt.current=null,pt(null))},[Di]);const fc=!!Z&&!(Z in jt.messagesBySession)&&ft.isPending,dc=A.useMemo(()=>{const te=new Set;for(const ve of jt.busySessions)(jt.messagesBySession[ve]??[]).some(ze=>ze.parts.some(X=>X.type==="prompt"&&X.prompt&&!X.prompt.resolved&&X.prompt.nativeId))&&te.add(ve);return te},[jt.busySessions,jt.messagesBySession]),Li=Z?dc.has(Z):!1,ar=Vt,hc=ar?Tn.get(ar.id):void 0,Ts=A.useMemo(()=>{var te;for(let ve=fr.length-1;ve>=0;ve--)for(const ze of fr[ve].parts)if(ze.type==="prompt"&&((te=ze.prompt)==null?void 0:te.kind)==="plan"&&!ze.prompt.resolved)return{promptId:ze.id,plan:ze.prompt.plan??"",synthesized:!!ze.prompt.synthesized};return null},[fr]),vi=A.useMemo(()=>Z?i8n(fr,ar==null?void 0:ar.harness,jt.busySessions.has(Z)):null,[fr,ar==null?void 0:ar.harness,Z,jt.busySessions]),Fs=mi&&!vi,yl=te=>{if(vi||mi)return!1;const ve=G5(te),ze=Es.find(X=>X.name===(ve??te));return!ze||ze.source!=="command"?!!ze:ve&&u4(ve)?ve==="plan"||ce.trim().toLowerCase().startsWith(`/${te}`):ce.trim().toLowerCase()===`/${te}`},Ii=A.useMemo(()=>Es.filter(te=>te.source!=="command"),[Es]),[$i,zf]=A.useState(null),ko=$i&&$i.sessionId===Z?$i:null;A.useEffect(()=>{if(!$i)return;const te=jt.busySessions.has($i.sessionId),ve=$i.sessionId===Z&&Ts&&Ts.promptId!==$i.promptId;(!te||ve)&&zf(null)},[$i,Ts,jt.busySessions,Z]);const Wh=A.useMemo(()=>dC(fr),[fr]),pc=ir&&!!(st!=null&&st.supportsSteering)&&!!(st!=null&&st.agentReady)&&!Ts&&!vi&&!Wh&&Ke.length===0&&pe.length===0,mc=A.useMemo(()=>p&&Z?(te,ve,ze)=>p(te,Z,ve,ze):void 0,[p,Z]),jf=A.useMemo(()=>m&&Z?(te,ve,ze)=>m(Z,te,ve,ze):void 0,[m,Z]),Tf=A.useMemo(()=>o&&((te,ve,ze,X,ae)=>o(te,Z??void 0,ve,ze,X,ae)),[o,Z]);A.useEffect(()=>{Pe.current+=1,nt.current+=1;const te=(Z?jt.queuedBySession[Z]??[]:[]).reduce((ve,ze)=>ze.planMode??ve,void 0);Zt.current=te!==void 0,yt.current=te??null,pt(te??null),Ln({}),me(null)},[Z]);const xl=i==="chat"&&(fr.length>0||ir),ti=(Bt==null?void 0:Bt.harness)??null,wl=(Bt==null?void 0:Bt.model)??null,So=ft.data?null:ft.error,Af=i==="chat"&&!xl&&!fc&&!So,gc=ct({...Jxn(e,ti??"claude-code",wl,E()),enabled:Af&&ti!==null,subscribed:Af&&ti!==null}),ni=(zo=gc.data)!=null&&zo.blank?VLn():((Wu=gc.data)==null?void 0:Wu.prompts)??null,Qh=ti!==null&&gc.isPending,Rf=e===Pp?"demo":"project",Xh=te=>{_e(te),Vr(!1),window.requestAnimationFrame(()=>{const ve=Rn.current;ve&&(ve.focus(),ve.setSelectionRange(te.length,te.length),Vn(te.length))})};A.useEffect(()=>{dt&&(_e(te=>te||dt),Vr(!1),Vn(dt.length))},[dt]),A.useEffect(()=>{if(v===0)return;const te=window.requestAnimationFrame(()=>{const ve=Rn.current;ve&&(ve.focus(),ve.setSelectionRange(ve.value.length,ve.value.length),ve.scrollIntoView({block:"nearest"}))});return()=>window.cancelAnimationFrame(te)},[v]);const Mf=A.useId(),kl=e===Pp&&ce===Pz&&!se,Yh=A.useCallback(te=>{const ve=te.scrollHeight-te.scrollTop-te.clientHeight<60;hn.current=ve,Ar(ve)},[]),pa=A.useCallback(()=>{var te;hn.current=!0,Ar(!0),(te=Hn.current)==null||te.call(Hn)},[]);A.useEffect(()=>{const te=zn.current,ve=hr.current;if(!te||!ve)return;const ze=new ResizeObserver(()=>{var X;hn.current?(X=Hn.current)==null||X.call(Hn):Ar(te.scrollHeight-te.scrollTop-te.clientHeight<60)});return ze.observe(te),ze.observe(ve),()=>ze.disconnect()},[xl]);const Of=A.useCallback(te=>{te.currentTarget.blur(),pa()},[pa]);async function Co({queue:te=!1}={}){var Jh,ep,Bf,yi,Xu,si;const ve=ce.trim(),ze=vi?null:mDn(ve,Wt==null?void 0:Wt.planActivation);if(ze&&ze.name!=="plan"){_e(u4(ze.name)?"":ze.prompt),Vr(!1),fa(ze.name,ze.prompt);return}if(ru({name:"first_action",surface:Rf,action:"typed_prompt"}),un.current)return;const X=!!ze,ae=!bo,xe=_4(Wt==null?void 0:Wt.planActivation,X?ae:void 0,yt.current),Re=X&&(st==null?void 0:st.id)==="claude-code"?ae?"plan":"auto":void 0,Se=ze?ze.prompt:ve,He=Ke,We=pe,Lt=We.map(Sn=>({text:Sn.text})),Qn=e,Qr=i;let Xr=Z;const kr=()=>{const Sn=Le.current;return Dn(Q.queryKey)&&Sn.projectId===Qn&&Sn.activeId===Xr&&Sn.mainView===Qr},ri=()=>{kr()&&(_e(Sn=>Sn||ve),je(Sn=>Sn.length?Sn:He),be(Sn=>Sn.length?Sn:We))};if(X&&!Se&&He.length===0&&We.length===0){_e(""),Vr(!1);try{if((st==null?void 0:st.id)==="claude-code")qa(ae?"plan":"auto");else if((Wt==null?void 0:Wt.planActivation)==="command")await Ir(ae);else throw new Error(Yg())}catch{me(jN()),ri()}return}const Xn=Bt?{...Bt,...Re?{permissionMode:Re}:{}}:null;Re&&qa(Re);let va=null;const xc=yt.current;X&&(Wt==null?void 0:Wt.planActivation)==="command"&&(va=++nt.current,yt.current=ae,pt(ae));const ba=()=>{!kr()||va===null||nt.current!==va||(yt.current=xc,pt(xc))};if(!Se&&He.length===0&&We.length===0)return;if((Se||We.length>0)&&vi&&He.length===0){_e(""),be([]),ws({promptId:vi,answers:[],note:Se||void 0,annotations:Lt}).then(Sn=>{Sn||ri()});return}const Um=JSON.stringify({text:Se,images:He.map(Sn=>({mediaType:Sn.mediaType,name:Sn.name,dataUrl:Sn.dataUrl})),annotations:Lt,settings:Xn?{model:Xn.model,serviceTier:Xn.serviceTier,permissionMode:Xn.permissionMode,planMode:xe,reasoningLevel:Xn.reasoningLevel}:null}),Qu=((Jh=dn.current)==null?void 0:Jh.signature)===Um?dn.current.id:`ct_${crypto.randomUUID()}`;if(dn.current={signature:Um,id:Qu},ir){if(!Z||!(st!=null&&st.agentReady)){ba();return}const Sn=Z;_e(""),je([]),be([]),rt(null);const Va=Xn?{model:Xn.model,serviceTier:Xn.serviceTier,permissionMode:Xn.permissionMode,planMode:(Wt==null?void 0:Wt.planActivation)==="command"?xe??(Vt==null?void 0:Vt.planMode):xe,reasoningLevel:Xn.reasoningLevel}:{};kr()&&Ln({});const xa=He.map($r=>({mediaType:$r.mediaType,dataBase64:$r.dataUrl.slice($r.dataUrl.indexOf(",")+1),name:$r.name}));try{(ep=(await js(()=>Fz(Sn,Se,Va,xa.length?xa:void 0,Lt,Qu,pc&&!te&&!X?"steer":void 0))).turn)!=null&&ep.existing&&await ds(Sn),kr()&&dr(Yp),((Bf=dn.current)==null?void 0:Bf.id)===Qu&&(dn.current=null)}catch{ba(),ri()}return}if(!(st!=null&&st.agentReady)){ba();return}if(!Xn){ba();return}let ya=Z;try{_e(qn=>qn===ce?"":qn),je(qn=>qn===He?[]:qn),be(qn=>qn===We?[]:qn),rt(null),un.current=!0;try{if(!ya){const tp=await ma(Xn,xe);ya=tp.id,Xr=tp.id}if(!Dn(Q.queryKey))return;const qn=il(ya);await et.fetchQuery({...qn,...((yi=et.getQueryState(qn.queryKey))==null?void 0:yi.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{un.current=!1}if(!Dn(Q.queryKey))return;mt({type:"optimisticUser",sessionId:ya,text:Se||Fpe(),attachments:He.map(qn=>({url:qn.dataUrl,mediaType:qn.mediaType,name:qn.name})),annotations:We}),mt({type:"busy",sessionId:ya,busy:!0}),kr()&&pa(),kr()&&K==="archived"&&ne("active");const Sn=Xn?{model:Xn.model,serviceTier:Xn.serviceTier,permissionMode:Xn.permissionMode,planMode:xe,reasoningLevel:Xn.reasoningLevel}:{};kr()&&Ln({});const Va=He.map(qn=>({mediaType:qn.mediaType,dataBase64:qn.dataUrl.slice(qn.dataUrl.indexOf(",")+1),name:qn.name})),xa=ya;if(!xa)throw new Error(Y8e());(Xu=(await js(()=>Fz(xa,Se,Sn,Va.length?Va:void 0,Lt,Qu))).turn)!=null&&Xu.existing&&await ds(xa),kr()&&dr(Yp),((si=dn.current)==null?void 0:si.id)===Qu&&(dn.current=null)}catch(Sn){if(!Dn(Q.queryKey)||(ri(),ba(),!ya))return;const Va=Sn instanceof Error?Sn.message:String(Sn);if(!/session is busy/i.test(Va)&&await et.fetchQuery({...La(e),staleTime:0}).then($r=>{var El;return!!((El=$r.find(qn=>qn.id===ya))!=null&&El.busy)}).catch(()=>!1)){kr()&&(_e($r=>$r===Se?"":$r),je($r=>$r===He?[]:$r),be($r=>$r===We?[]:$r));return}mt({type:"busy",sessionId:ya,busy:!1}),mt({type:"localError",sessionId:ya,text:s1e({error:Ne(Va)})})}}async function ma(te,ve){const ze=Le.current,X=L.current,ae=await I.mutateAsync([e,te.harness,{model:te.model,serviceTier:te.serviceTier,permissionMode:te.permissionMode,planMode:ve,reasoningLevel:te.reasoningLevel}]);return L.current===X&&(J(xe=>[ae,...xe.filter(Re=>Re.id!==ae.id)]),et.getQueryData(Q.queryKey)||Bs(!0)),L.current===X&&Le.current===ze&&(B.current(ae.id,{replace:!0}),Le.current={...ze,activeId:ae.id}),ae}function Zh(){const te=jDn(ce);_e(te),window.requestAnimationFrame(()=>{var ve,ze;(ve=Rn.current)==null||ve.focus(),(ze=Rn.current)==null||ze.setSelectionRange(te.length,te.length),Vn(te.length)})}async function Sl(){const te=Js;if(!te)return;if(me(null),ir){me(p0e());return}const ve=ce,ze=Le.current;let X=Z;const ae=()=>{const He=Le.current;return He.projectId===ze.projectId&&He.activeId===X&&He.mainView===ze.mainView},xe=()=>{ae()&&_e(He=>He||ve)};_e(""),Vr(!1);let Re=Z;if(!Re){if(!(st!=null&&st.agentReady)||!Bt){xe(),me(Yg());return}try{const He=_4(Wt==null?void 0:Wt.planActivation,void 0,yt.current);Re=(await ma(Bt,He)).id,X=Re,ae()&&Ln({})}catch(He){xe();const We=He instanceof Error?He.message:String(He);ae()&&me(JE({error:Ne(We)}));return}}ae()&&K==="archived"&&ne("active");const Se=`${P_}shell-${Date.now()}`;mt({type:"localShell",sessionId:Re,id:Se,command:te}),ae()&&pa();try{const{message:He}=await exn(Re,te);mt({type:"upsertMessage",sessionId:Re,message:He})}catch(He){const We=He instanceof Error?He.message:String(He);mt({type:"localShell",sessionId:Re,id:Se,command:te,error:JE({error:Ne(We)})})}}function Eo(){Z&&sxn(Z).catch(()=>{me(R9e())})}const Df=A.useCallback(async(te,ve)=>{if(!(!Z||on.current)){on.current=!0,me(null),Ct(te);try{const ze=d8n({model:Un.model,serviceTier:Un.serviceTier,permissionMode:Un.permissionMode,planMode:Un.planMode,reasoningLevel:Un.reasoningLevel}),X=Z;(await txn(X,te,ve,ze)).turn.existing&&await ds(X),dr(Yp)}catch{me(U7e())}finally{on.current=!1,Ct(null)}}},[Z,Un,ds]),Lf=A.useCallback((te,ve)=>{if(!Z||ir||!(st!=null&&st.agentReady))return;const ze=Z;mt({type:"busy",sessionId:ze,busy:!0}),pa(),js(()=>nxn(ze,te,ve)).catch(X=>{mt({type:"busy",sessionId:ze,busy:!1});const ae=X instanceof Error?X.message:String(X);mt({type:"localError",sessionId:ze,text:s8e({error:Ne(ae)})})})},[Z,ir,st==null?void 0:st.agentReady,pa,js]),As=A.useCallback(te=>{if(!Z||ir)return;const ve=Z,ze=cn.current;mt({type:"activeLeaf",sessionId:ve,leafId:te}),js(()=>rxn(ve,te)).catch(X=>{mt({type:"activeLeaf",sessionId:ve,leafId:ze});const ae=X instanceof Error?X.message:String(X);mt({type:"localError",sessionId:ve,text:B9e({error:Ne(ae)})})})},[Z,ir,js]);function mn(te){if(!Z)return;const ve=Z;Xyn(ve,te).then(({removed:ze})=>{if(ze)return ds(ve)}).catch(()=>me(Y7e()))}async function Hu(te){if(!Z||fn)return;const ve=Z;me(null),wr(te);try{await Yyn(ve,te),await ds(ve)}catch{me(v8e())}finally{wr(null)}}A.useEffect(()=>{if(!ir||i!=="chat")return;function te(ve){var ze;ve.key!=="Escape"||ve.defaultPrevented||(ve.preventDefault(),Eo(),(ze=Rn.current)==null||ze.focus())}return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[ir,Z,i]);function qu(te){jb(te),at.current.delete(te),ut.current===te&&(ut.current=null),Le.current.projectId===e&&Le.current.activeId===te&&Le.current.mainView==="chat"&&(_e(""),je([]),be([]),B.current(null,{replace:!0})),U(ve=>{if(!ve.has(te))return ve;const ze=new Set(ve);return ze.delete(te),ze}),Mt.current.delete(te)}function Cl(te,ve){const ze=te.archived;J(X=>X.map(ae=>ae.id===te.id?{...ae,archived:ve}:ae)),$.mutateAsync([te.id,ve]).catch(()=>{J(X=>X.map(ae=>ae.id===te.id?{...ae,archived:ze}:ae))})}function If(te,ve){const ze=te.title;J(X=>X.map(ae=>ae.id===te.id?{...ae,title:ve}:ae)),q.mutateAsync([te.id,ve]).catch(()=>{J(X=>X.map(ae=>ae.id===te.id?{...ae,title:ze}:ae))})}async function hs(te){var ze;const ve=((ze=te.title)==null?void 0:ze.trim())||yd();if(window.confirm(pme({title:Wi(ve)}))){try{await H.mutateAsync(te.id)}catch(X){bn(wme({title:Wi(ve),error:Ne(X instanceof Error?X.message:String(X))}),"error");return}qu(te.id)}}const ws=A.useCallback(te=>{if(!Z)return Promise.resolve(!1);const ve=Z;return mt({type:"busy",sessionId:ve,busy:!0}),js(()=>ixn(ve,te)).then(()=>!0).catch(()=>!1).finally(()=>{Dn(Q.queryKey)&&(et.fetchQuery({...il(ve),staleTime:0}).catch(()=>{}),et.fetchQuery({...La(e),staleTime:0}).catch(()=>{}))})},[Z,e,js,Q]),bi=V.filter(te=>PLn(K,te.archived)),Uu=/Mac|iPhone|iPad/.test(navigator.platform),No=Uu?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",vc=Uu?"⌘ Enter":"Ctrl + Enter",ns=A.useCallback(()=>{ne("active"),y(null)},[y]),bc=A.useCallback(te=>{ne("all"),y(te)},[y]);A.useEffect(()=>{const te=ve=>{ve.repeat||ve.key!=="Enter"||!ve.metaKey&&!ve.ctrlKey||ve.altKey||!ve.shiftKey||(ve.preventDefault(),ns())};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[ns]);const rs=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":No,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:ns,children:[f.jsx(Ih,{size:15}),R4e()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx(OI,{size:15}),Gxe()]}),oDn.map(te=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&te.activeTabs.includes(i)?"active":""}`,"data-onboarding":te.id==="compute"?"nav-compute":void 0,onClick:()=>a(te.id),children:[te.icon,te.label()]},te.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((ga=qH.find(te=>te.id===K))==null?void 0:ga.railLabel())??TD()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(FLn,{value:K,onChange:ne})})]}),f.jsxs("div",{className:"rail-body",children:[bi.map(te=>f.jsx(GLn,{session:te,active:te.id===Z&&i==="chat",unread:F.has(te.id),busy:jt.busySessions.has(te.id),waiting:dc.has(te.id),revealTitle:Tn.get(te.id),onOpen:()=>{if(y(te.id),e===Pp){z5n(te.id);const ve=Avn[te.id];ve&&(ru({name:"demo_experiment_started",kind:"curated",experiment:ve}),ru({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:ve=>If(te,ve),onSetArchived:ve=>Cl(te,ve),onDelete:()=>void hs(te)},te.id)),bi.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:K==="archived"?$1e():V.length>0?S1e():G1e()})]}),f.jsx(H$,{runtime:x})]}),Gu="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 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",Vu=!r&&f.jsx($t,{title:CN(),"aria-label":CN(),onClick:s,children:f.jsx(VI,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&rs,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:Vu}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:z})]})]}):f.jsxs(f.Fragment,{children:[r&&rs,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[Vu,f.jsxs("div",{className:Gu,children:[f.jsx(D0,{variant:"header",title:ar?((yc=ar.title)==null?void 0:yc.trim())||yd():nN(),children:ar?f.jsx(UH,{title:(($f=ar.title)==null?void 0:$f.trim())||yd(),animate:hc!==void 0},hc??"static"):nN()}),k&&f.jsx($t,{"data-tip":rN(),"aria-label":rN(),onClick:k,children:f.jsx(u4n,{size:15})})]})]}),So?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:So.message}),f.jsx(De,{onClick:()=>void ft.refetch(),children:Qs()})]}):fc?f.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:[f.jsx(Nt,{}),f.jsx("span",{children:C4e()})]}):xl?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:zn,tabIndex:0,role:"region","aria-label":((ks=ar==null?void 0:ar.title)==null?void 0:ks.trim())||yd(),onScroll:te=>{Yh(te.currentTarget),pn.dismiss()},children:f.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:hr,children:[f.jsx(oH,{projectId:e,sessionId:Z,children:f.jsx(BLn,{scrollRef:zn,scrollToEndRef:Hn,stickToBottom:hn,onPinToBottom:pa,messages:fr,allMessages:uc,canFork:Ef,onFork:Lf,onSelectFork:As,busy:ir,onOpenFile:Tf,onOpenRun:c,onOpenSpawnedSession:bc,runExperimentName:u,onOpenExperiment:h,experimentName:_,onRespond:ws,onOpenPlan:mc,onOpenSubagent:jf,recoveringTurnId:es,onRecover:Df,skills:Ii},Z)}),ir&&Li&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:CCe()}),ir&&!Li&&!xo&&!wo&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:J9e()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx(TS,{})}),f.jsx("h2",{children:RCe()}),f.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-medium",children:[f.jsx(Su,{size:19}),f.jsx("span",{children:n})]}),Qh&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:zR,"aria-hidden":"true",children:NR.map((te,ve)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${v4[ve].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${v4[ve].icon}`,children:[f.jsx(te,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},ve))}),f.jsxs(Gr,{className:"mt-3",role:"status",children:[f.jsx(Nt,{}),f.jsx("span",{children:C6e()})]})]}),ni&&ni.length>0&&f.jsx("div",{className:zR,role:"group","aria-label":R6e(),children:ni.map((te,ve)=>{const ze=NR[ve],X=v4[ve];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${X.box}`,onClick:()=>{ru({name:"project_starter_clicked",slot:ve+1}),ru({name:"first_action",surface:Rf,action:"starter_click"}),Xh(te.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(ze,{size:17,className:X.icon}),te.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:te.prompt})]},ve)})})]}),pn.action&&f.jsxs(De,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:pn.action.x,top:pn.action.top,transform:"translateX(-50%)"},onMouseDown:te=>te.preventDefault(),onClick:pn.add,children:[f.jsx(GI,{size:14}),Mbe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_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:[xl&&f.jsx($t,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${Tr?"opacity-0":"opacity-100"}`,title:zN(),"aria-label":zN(),inert:Tr,onClick:Of,children:ir&&!Li?f.jsx(pS,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(Kwn,{size:16})}),Ts&&!(ko&&Ts.promptId===ko.promptId)&&f.jsx(dOn,{synthesized:Ts.synthesized,agentLabel:ar?su[ar.harness]:V9e(),showResumeModes:(ar==null?void 0:ar.harness)==="claude-code",onView:te=>mc==null?void 0:mc(Ts.plan,Ts.promptId,te),onApprove:te=>ws({promptId:Ts.promptId,approve:!0,...te?{resumeMode:te}:{}}),onReject:()=>ws({promptId:Ts.promptId,approve:!1}),onRevise:te=>{Z&&zf({sessionId:Z,promptId:Ts.promptId}),ws({promptId:Ts.promptId,approve:!1,note:te})}}),Di.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Di.map((te,ve)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:te.error?`${te.text} +`).trim()}function hIn(e){const n=e.changes;if(!Array.isArray(n))return null;for(const t of n){if(!t||typeof t!="object"||!("path"in t)||typeof t.path!="string")continue;const r="kind"in t?t.kind:null,s=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:t.path,type:s}}return null}function pIn(e){const n=e.trim(),t=n.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((t==null?void 0:t[1])??n).trim();return r=z9n(r),DH(r)}function DH(e){return gIn(e).replace(/[\t\r ]+/g," ").trim()}function mIn(e){let n=null,t=!1;for(let r=0;r!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&IH(s)?{ref:r,path:s}:null}function yIn(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function ER(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function xIn(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!u.startsWith("-"));if(!o)return null;const c=ER(s,o);if(!c)return null;s=c}return s?ER(s,e):e}const Fo="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",wIn=new RegExp(`\\bchat_(${Fo})\\b`,"gi"),Y_=`(?:${Fo}|[0-9a-f]{8})`;function Hd(e){const n=[];let t="",r="",s=null,i=!1;const a=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=u=>{let h=1,_=null,p=!1;for(let m=u;m{let h=!1;for(let _=u;_A9n(t.raw,n))}function $a(e,n){return Iy(e,n).length>0}function kIn(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,MH).matchAll(wIn))if(n.add(t[0].toLowerCase()),n.size>=Pu)break;return[...n]}function Z5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,MH),s=n==="runs"?[new RegExp(`/runs/(${Fo})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${Fo})`,"gi"),new RegExp(`^\\s*RUN\\s+(${Fo})\\b`,"gim"),new RegExp(`={3,}\\s*(${Fo})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${Fo})`,"gi"),new RegExp(`^\\s*id:\\s*(${Fo})`,"gim"),new RegExp(`={3,}\\s*(${Fo})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=Pu)return[...t];const i=new RegExp(`^\\s*(${Fo})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=Pu)break;return[...t]}function BH(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function PH(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function FH(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const c=o+a[0].length;c<=t&&/\bdone\b/.test(e.slice(c,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function SIn(e,n,t=[],r=[]){const s=Iy(e,"logs"),i=new Set;if(s.length===0){if(!$a(e,"logs"))return[];const o=t.length>0?[]:Z5(n,"runs");for(const c of t.length>0?t:o.length>0?o:r)if(i.add(c),i.size>=Pu)break;return Fd([...i])}let a=!1;for(const{invocation:o,offset:c}of BH(e,s)){const u=wh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const h=u.slice(1);let _=null;for(let v=0;v0?[]:Z5(n,"runs"),c=t.length>0?t:o.length>0?o:r;for(const u of c)if(i.add(u),i.size>=Pu)break}return Fd([...i])}function vd(e,n,t=[],r=[]){const s=Iy(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:c}of BH(e,s)){const u=wh(o.raw),h=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let _=!1;h&&new RegExp(`^${Y_}$`,"i").test(h)&&(i.add(h),_=!0);const p=h?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(h):null;if(p){const m=p[1],w=PH(e,m,c,Y_);if(w.length>0){for(const v of w)i.add(v);_=!0}const k=FH(e,m,c,Y_);for(const v of k)i.add(v);k.length>0&&(_=!0)}_||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:Z5(n,"experiments"),c=t.length>0?t:o.length>0?o:r;for(const u of c)if(i.add(u),i.size>=Pu)break}return Fd([...i])}const NR=new WeakMap;function ff(e){const n=N(),t=NR.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=CIn(e);return NR.set(e,{locale:n,activity:r}),r}function CIn(e){var b,x,y,C,z,E;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Ws(i,"command","cmd"),o=dIn(i,"commandArgv"),c=((x=e.state)==null?void 0:x.output)||((y=e.state)==null?void 0:y.error),u=Fd(v4(i,"targetIds")),h=Fd(v4(i,"runTargetIds")),_=Fd(v4(i,"experimentTargetIds")),p=Ws(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Ws(i,"description"),w=n.toLowerCase().split(/(?::|\.|__)+/),k=w.at(-1)??n.toLowerCase();if(k==="run"&&w.includes("web")){const T=g4(i,"search_query","q"),j=g4(i,"image_query","q"),M=g4(i,"find","pattern");return T?{kind:"web",label:GE({query:T})}:j?{kind:"web",label:Yie({query:j})}:M?{kind:"web",label:Iae({pattern:M})}:Array.isArray(i.open)?{kind:"web",label:l3e()}:Array.isArray(i.weather)?{kind:"web",label:Txe()}:Array.isArray(i.finance)?{kind:"web",label:mxe()}:Array.isArray(i.sports)?{kind:"web",label:kxe()}:Array.isArray(i.time)?{kind:"web",label:lxe()}:{kind:"web",label:oN()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["compacted","contextcompaction"],["imported","importedchat"],["subagentactivity","subagent"]]).get(k)??k){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:r5e()};const T=pIn(a??(o==null?void 0:o.join(" "))??""),j=Hd(T);let M=j.map(G=>G.raw);if(o!=null&&o.length){const G=T9n(o);M=G===null?[o]:Hd(DH(G)).map(ae=>ae.raw)}let D=null;for(const G of M)if(D=R9n(G),D)break;const I=M.some(G=>{const ae=wh(G);return ae!==null&&ae[0]!=="discover"&&ae[0]!=="paper"});if(D&&!I){const G=D.kind==="discover"?{keyword:vie(),embedding:Cie(),openalex:gae(),biorxiv:Rie(),pubmed:Sae()}[D.strategy]:null,ae=D.kind==="discover"?D.query?tne({activity:G??UE(),query:D.query}):G??UE():D.id?Pp({target:Ce(D.id)}):Are();return{kind:D.kind==="paper"?"read":"search",label:ae,litCall:D}}if($a(T,"agent\\s+spawn"))return{kind:"agent",label:p2e(),spawnedSessionIds:kIn(c),litCall:D??void 0};const $=j.map(G=>$H(G.raw)),q=$a(T,"exp\\s+status"),H=$a(T,"exp\\s+desc"),Q=Iy(T,"exp\\s+desc").some(G=>(wh(G.raw)??[]).some(ce=>ce==="--set"||ce.startsWith("--set=")||ce==="--stdin")),V=Q?Roe():Sre(),Z=Q?Eee():$se();if($a(T,"logs")){const G=SIn(T,c,h,u);return{kind:"project",label:G.length===1?Sse():Ase(),runIds:G,litCall:D??void 0}}if($a(T,"exp\\s+run"))return{kind:"project",label:NSe(),litCall:D??void 0};if($a(T,"exp\\s+wait"))return{kind:"project",label:jCe(),litCall:D??void 0};if($a(T,"exp\\s+cancel"))return{kind:"project",label:jye(),litCall:D??void 0};const Y=$a(T,"project\\s+view");if(Y&&q&&H)return{kind:"project",label:Z,experimentIds:vd(T,c,_,u),litCall:D??void 0};if(Y&&H)return{kind:"project",label:V,experimentIds:vd(T,c,_,u),litCall:D??void 0};if(Y&&q)return{kind:"project",label:cN(),experimentIds:vd(T,c,_,u),litCall:D??void 0};if(Y)return{kind:"project",label:A5e(),litCall:D??void 0};if(q&&H)return{kind:"project",label:Z,experimentIds:vd(T,c,_,u),litCall:D??void 0};if(q)return{kind:"project",label:cN(),experimentIds:vd(T,c,_,u),litCall:D??void 0};if(H)return{kind:"project",label:V,experimentIds:vd(T,c,_,u),litCall:D??void 0};if($a(T,"runs?"))return{kind:"project",label:w4e(),litCall:D??void 0};if($a(T,"projects"))return{kind:"project",label:j4e(),litCall:D??void 0};if($a(T,"compute"))return{kind:"project",label:qye(),litCall:D??void 0};const B=$.map(bIn).find(G=>G!=null);if(B){const G=m4(B.path);return{kind:G?"skill":"read",label:G?X2({name:Ce(G)}):Pp({target:Ce(E_(B.path))}),filePath:B.path,fileRef:B.ref,labelTarget:G?`${G} skill`:E_(B.path)}}const L=$.findIndex(G=>G!=null&&["sed","cat","head","tail"].includes(G.name)),F=L>=0?$[L]:null,U=F?vIn(F):null,K=U?xIn(U,j,L,Ws(i,"cwd","workdir")):null;if(U&&K){const G=m4(K);return{kind:G?"skill":"read",label:G?X2({name:Ce(G)}):Pp({target:Ce(E_(U))}),filePath:K,labelTarget:G?`${G} skill`:E_(U)}}if($.some(G=>(G==null?void 0:G.name)==="find"||(G==null?void 0:G.name)==="ls"||(G==null?void 0:G.name)==="rg"&&G.args.includes("--files")))return{kind:"search",label:vN()};const ne=$.findIndex(G=>(G==null?void 0:G.name)==="rg"||(G==null?void 0:G.name)==="grep");if(ne>=0){const G=yIn(j[ne].raw);return{kind:"search",label:G?Z2({pattern:Ce(G)}):Y2(),searchPattern:G??void 0}}const oe=$.find(G=>(G==null?void 0:G.name)==="git"),ue=oe==null?void 0:oe.args[0];if(ue==="grep"){const G=oe==null?void 0:oe.args.slice(1).find(ae=>!ae.startsWith("-"));return{kind:"search",label:G?Z2({pattern:Ce(G)}):Y2(),searchPattern:G}}if(ue==="status")return{kind:"command",label:nxe()};if(ue==="diff")return{kind:"command",label:jke()};if(ue==="log")return{kind:"command",label:S5e()};const se=G=>$.some(ae=>!ae||!["cargo","pnpm","npm","yarn"].includes(ae.name)?!1:ae.args[0]===G||ae.args[0]==="run"&&ae.args[1]===G);return se("test")?{kind:"command",label:u5e()}:$.some(G=>(G==null?void 0:G.name)==="tsc")||se("typecheck")?{kind:"command",label:Ixe()}:se("lint")?{kind:"command",label:Lye()}:se("build")?{kind:"command",label:pye()}:{kind:"command",label:rre({command:Ce(T)})}}case"skill":{const T=Ws(i,"skill","name"),j=T?fIn(n,T):null;return{kind:"skill",label:T?Lne({name:Ce(T)}):jne(),filePath:j??void 0,labelTarget:j&&T?`${T} skill`:void 0}}case"read":{const T=p?E_(p):null,j=p?m4(p):null;return j?{kind:"skill",label:X2({name:Ce(j)}),filePath:p??void 0,labelTarget:`${j} skill`}:T?{kind:"read",label:Pp({target:Ce(T)}),filePath:p??void 0,labelTarget:T}:{kind:"read",label:g5e()}}case"edit":case"write":case"notebookedit":{const T=hIn(i),j=p??(T==null?void 0:T.path)??null,M=j?E_(j):null,D=M?(T==null?void 0:T.type)==="add"?ate({target:Ce(M)}):(T==null?void 0:T.type)==="delete"?Nte({target:Ce(M)}):Fte({target:Ce(M)}):null;return M?{kind:"edit",label:D??hN(),filePath:j??void 0,labelTarget:M}:{kind:"edit",label:hN()}}case"grep":{const T=Ws(i,"pattern");return{kind:"search",label:T?Z2({pattern:Ce(T)}):Y2(),searchPattern:T??void 0}}case"glob":{const T=Ws(i,"pattern");return{kind:"search",label:T?pne({pattern:Ce(T)}):vN()}}case"websearch":{const T=Ws(i,"query"),j=Ws(i,"url"),M=Ws(i,"pattern");return T?{kind:"web",label:GE({query:T})}:M&&j?{kind:"web",label:uae({pattern:M})}:j?{kind:"web",label:Xne({target:Ce(j)})}:{kind:"web",label:m??oN()}}case"webfetch":{const T=Ws(i,"url");return{kind:"web",label:T?Pp({target:Ce(T)}):m??Xre()}}case"task":return{kind:"agent",label:m??ure()};case"subagent":return{kind:"agent",label:EIn(i)};case"error":return{kind:"command",label:lCe()};case"importedchat":return{kind:"project",label:cne()};case"contextcompaction":return{kind:"command",label:((C=e.state)==null?void 0:C.status)==="error"?Jee():((z=e.state)==null?void 0:z.status)==="running"?qE():Pee(),progressLabel:qE()};default:{const T=m??p??a??((E=e.state)==null?void 0:E.title)??"";return{kind:"command",label:T?`${n}: ${T}`:n}}}}function EIn(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return soe();case"sendInput":return Yae();case"resumeAgent":return use();case"wait":return Boe();case"closeAgent":return Mee()}switch(typeof e.kind=="string"?e.kind:""){case"started":return Coe();case"interacted":return iee();case"interrupted":return voe()}return _oe()}function cb({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(Cf,{...t});if(e.litCall)r=f.jsx(QB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx(II,{...t});break;case"read":case"project":r=f.jsx($I,{...t});break;case"search":r=f.jsx(YI,{...t});break;case"edit":r=f.jsx(bS,{...t});break;case"web":r=f.jsx(s5n,{...t});break;case"agent":r=f.jsx(kS,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function b4({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=A.useState(!1),a=A.useRef(null),o=A.useRef(!1);return A.useEffect(()=>{var c,u;!s||!o.current||(o.current=!1,(u=(c=a.current)==null?void 0:c.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((c,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Gr(h=>n(c.id,h),{stopPropagation:!0}):{onClick:h=>{h.stopPropagation(),t==null||t(c.id)}},children:c.label}):f.jsx("span",{children:c.label})]},c.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?lY({target:r}):$J({count:tn(e.length),target:r}),onClick:c=>{c.preventDefault(),c.stopPropagation(),o.current=!s&&c.detail===0,i(u=>!u)},children:s?OD():aje({count:tn(e.length)})})]})}function J5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,c,u,h;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:B9n(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(c3n,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const _=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Gr(p=>n(_,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((c=e.spawnedSessionIds)!=null&&c.length&&r){const _=e.spawnedSessionIds,p=_.slice(0,3),m=_.slice(p.length).map((w,k)=>({id:w,label:JE({number:tn(p.length+k+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((w,k)=>f.jsxs("span",{children:[k>0&&", ",f.jsx("button",{className:"tool-target",title:n3e(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(w)},children:JE({number:tn(k+1)})})]},w)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(b4,{items:m,onSelect:r,targetType:vpe()})]})]})}if((u=e.runIds)!=null&&u.length){const _=s?e.runIds.filter(w=>!!s(w)):e.runIds;if(_.length===0)return e.label;const p=_.slice(0,3),m=_.slice(p.length).map(w=>({id:w,label:(s==null?void 0:s(w))||Wc()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((w,k)=>f.jsxs("span",{children:[k>0&&", ",t?f.jsx("button",{className:"tool-target",title:uZ({run:Ce(w)}),...Gr(v=>t(w,v),{stopPropagation:!0}),children:(s==null?void 0:s(w))||Wc()}):f.jsx("span",{children:(s==null?void 0:s(w))||Wc()})]},w)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(b4,{items:m,onOpen:t,targetType:L8e()})]})]})}if((h=e.experimentIds)!=null&&h.length){const _=a?e.experimentIds.filter(w=>!!a(w)):e.experimentIds;if(_.length===0)return e.label;const p=_.slice(0,3),m=_.slice(p.length).map(w=>({id:w,label:(a==null?void 0:a(w))||Wc()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((w,k)=>f.jsxs("span",{children:[k>0&&", ",i?f.jsx("button",{className:"tool-target",title:qY({name:(a==null?void 0:a(w))||Ce(w)}),...Gr(v=>i(w,v),{stopPropagation:!0}),children:(a==null?void 0:a(w))||Wc()}):f.jsx("span",{children:(a==null?void 0:a(w))||Wc()})]},w)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(b4,{items:m,onOpen:i,targetType:ege()})]})]})}return e.label}function fC(e){const n=e.progressLabel??{skill:qne(),read:rse(),search:Uae(),edit:Wte(),project:Gse(),web:bee(),agent:yte(),command:xD()}[e.kind];return{...e,label:n}}function HH(e,n){const t=ff({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:wne(),read:gre(),search:_ie(),edit:Ote(),project:gse(),web:fee(),agent:dte(),command:Zse()}[t.kind]}function NIn(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const zIn=250;function jIn(e,n){const[t,r]=A.useState(e),s=A.useRef(Date.now()),i=A.useRef(e);return A.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=zIn-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const TIn=160;function qH(e){const[n,t]=A.useState(!1);return A.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),TIn);return()=>window.clearTimeout(r)},[e]),e&&n}function AIn(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:jD()}}function RIn(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function MIn(e){const n=[];let t=null;for(const r of e){const s=ff(r),i=RIn(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function UH({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var w,k;const i=(w=e.state)==null?void 0:w.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,c]=A.useState(Date.now());if(A.useEffect(()=>{if(typeof a!="number"||(c(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();c(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=w9n(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(jt,{}),f.jsx("span",{children:v})]})}const u=KB(i==null?void 0:i.recoveryAction),h=i==null?void 0:i.turnId,_=VB(e)?w1e():s?t9e():AN(),p=s?Z3n:wS,m=Ly(((k=e.state)==null?void 0:k.error)||AN());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:_}),f.jsx(Wa,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&h&&(u==="retry"||u==="continue")&&f.jsx(Oe,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(h,u),children:t?j9e():u==="retry"?Ys():dme()})]})}function zR({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:c}){const u=e.state,h=(u==null?void 0:u.status)==="error",_=Ly((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=h&&!!_,[m,w]=A.useState(!1),k=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(UH,{part:e,busy:!1,recovering:!1,usageLimited:u5(e)});const v=f.jsxs(f.Fragment,{children:[h&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),h?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(FI,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(cb,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${AH} ${h?"text-accent-red":"text-subtext"}`,children:[f.jsx(J5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:c}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:kY({count:tn(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":k,"aria-label":m?mY({activity:n.label}):AJ({activity:n.label}),onClick:()=>w(b=>!b),children:f.jsx(Wa,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:k,children:f.jsx("div",{className:uC,children:_.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function OIn({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,D,I;const[c,u]=A.useState(!1),[h,_]=A.useState(!1),p=()=>{_(!0),u($=>!$)},m=MIn(e),w=m.map(({activity:$})=>$),k=n?m.at(-1):void 0,v=k==null?void 0:k.part,b=k==null?void 0:k.activity,x=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&fC(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(x!=null&&x.progressLabel)&&(NIn((D=v.state)==null?void 0:D.input)||(x==null?void 0:x.kind)==="command"&&!Ws(((I=v.state)==null?void 0:I.input)??{},"command","cmd")),C=jIn(x,y),z=qH(C!=null),E=C??AIn(w),T=C?C.label:jD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(cb,{activity:C,className:z?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${z?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(J5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(zR,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(cb,{activity:E,className:z?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${z?"tool-running-shimmer":""}`,title:T,children:f.jsx(J5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":c,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":c,"aria-label":c?V0e():Kme(),children:f.jsx(Wa,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${c?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${c?"open":""}`,"aria-hidden":!c,inert:!c,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:h&&m.map(({part:$,count:q,activity:H})=>f.jsx(zR,{part:$,repeatCount:q,activity:H,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function DIn({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var h;const s=e.prompt,[i,a]=A.useState([]),o=!n,c=_=>n==null?void 0:n({promptId:e.id,..._});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:k3e(),icon:Pi,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:U3e(),icon:bS,iconClass:"text-accent-amber"}:s.approved===!1?{label:T3e(),icon:_r,iconClass:"text-accent-red"}:{label:I3e(),icon:$b,iconClass:"text-muted"},w=m.icon;return f.jsxs("details",{className:lIn,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?AD():zN()}),f.jsx(w,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Wa,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${SR} ms-6`,children:[f.jsx(nc,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const _=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,w)=>({id:`${e.id}-annotation-${w}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(_C,{annotations:p,variant:"sent"}),f.jsxs("details",{className:cIn,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||z7e()}),f.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 ${_?"chosen":""}`,children:_||w8e()})]}),f.jsxs("div",{className:SR,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var w;return f.jsx("li",{className:(w=s.answers)!=null&&w.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==_&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const _=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?p7e():zN()}),f.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 ${_?"clamped":""}`,children:f.jsx(nc,{text:s.plan??"",onOpenFile:t})}),_&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Gr(p=>r(s.plan??"",e.id,p)),children:wCe()}),!o&&!_&&f.jsxs("div",{className:Y5,children:[f.jsx(Oe,{size:"small",variant:"primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:Xve()}),f.jsx(Oe,{size:"small",onClick:()=>c({approve:!0,resumeMode:"bypassPermissions"}),children:rbe()}),f.jsx(Oe,{size:"small",onClick:()=>c({approve:!1}),children:$5e()})]})]})}if(s.kind==="permission"){const _=s.toolInput??{},p=Ws(_,"command","cmd","filePath","file_path","path")||"",m=typeof((h=s.toolInput)==null?void 0:h.reason)=="string"&&s.toolInput.reason||"",w=Ws(_,"description")||"",k=m||w||HH(s.tool,_),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(wS,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Abe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:k}),p&&f.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:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Oe,{size:"small",variant:"ghost",onClick:()=>c({approve:!1}),children:K2e()}),f.jsx(Oe,{size:"small",variant:"primary",onClick:()=>c({approve:!0}),children:Sbe()})]})]})]})}const u=_=>a(p=>s.multiSelect?p.includes(_)?p.filter(m=>m!==_):[...p,_]:[_]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:uIn,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(_=>{const p=i.includes(_.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start 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 ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(_.label):c({answers:[_.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:_.label}),_.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:_.description})]},_.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:Y5,children:f.jsx(Oe,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>c({answers:i}),children:nCe()})})]})}function LIn(e,n){return e.role==="user"?!0:e.parts.some(t=>xh(t,n))}function IIn(e){const n=e.text??"",t=n.startsWith("data:")?n:l2n(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}async function dC(e){try{if(!navigator.clipboard)throw new Error(ID());await navigator.clipboard.writeText(e),bn(tf(),"success")}catch(n){bn(n instanceof Error?n.message:String(n),"error")}}function $In(e,n){const t=URL.createObjectURL(new Blob([n],{type:"text/markdown;charset=utf-8"})),r=document.createElement("a");r.href=t,r.download=e,document.body.append(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(t),1e3)}function BIn({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:c,editDisabled:u}){const h=t>1,_=new Date(n),p=()=>dC(e);return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${h?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[h&&f.jsxs(f.Fragment,{children:[f.jsx(Ft,{size:"small",title:yN(),"aria-label":yN(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(BI,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Ft,{size:"small",title:bN(),"aria-label":bN(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Wa,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:_.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:_.toLocaleTimeString(N(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Ft,{size:"small","aria-label":Yk(),disabled:!e,onClick:p,children:f.jsx(Sf,{size:13})})]}),f.jsx(Ft,{size:"small",title:dN(),"aria-label":dN(),disabled:u,onClick:c,children:f.jsx(bS,{size:13})})]})}const PIn=A.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,busy:m=!1,recoveringTurnId:w,onRecover:k,skills:v,predictTextTail:b=!1,forkCount:x,forkIndex:y=0,forkPrevId:C,forkNextId:z,forkDisabled:E,branchDisabled:T,onFork:j,onSelectFork:M}){var Z,Y;wf();const[D,I]=A.useState(null),$=HIn(n);if($)return f.jsx(qIn,{part:$});if(n.role==="user"){const B=n.parts.filter(oe=>oe.type==="text").map(oe=>oe.text??"").join(` +`),L=oe=>!!(v!=null&&v.some(ue=>ue.name===oe)),F=n.parts.filter(oe=>oe.type==="image"&&oe.text).map(IIn),U=F.filter(oe=>!oe.isPdf),K=F.filter(oe=>oe.isPdf),ne=n.parts.filter(oe=>oe.type==="annotation"&&oe.text).map(oe=>({id:oe.id,text:oe.text??""}));if(D!==null){const oe=()=>{const ue=D.trim();!ue||E||(I(null),j(n.id,ue))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":fwe(),value:D,autoFocus:!0,onChange:ue=>I(ue.target.value),onKeyDown:ue=>{ue.key==="Escape"?(ue.preventDefault(),I(null)):ue.key==="Enter"&&!ue.shiftKey&&!ue.nativeEvent.isComposing&&(ue.preventDefault(),oe())}}),f.jsxs("div",{className:`${Y5} justify-end`,children:[f.jsx(Oe,{size:"small",onClick:()=>I(null),children:wye()}),f.jsx(Oe,{size:"small",variant:"primary",onClick:oe,disabled:E||!D.trim(),children:l3()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[ne.length>0&&f.jsx(_C,{annotations:ne,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(RLn,{text:B,isCommand:L}),U.length>0&&f.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((oe,ue)=>f.jsx("a",{href:oe.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:oe.src,alt:i0e()})},ue))}),K.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:K.map((oe,ue)=>f.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:oe.src,target:"_blank",rel:"noreferrer",children:[f.jsx($b,{size:15}),f.jsx("span",{children:oe.name})]},ue))})]}),x!==void 0&&f.jsx(BIn,{text:B,createdAt:n.createdAt,count:x,index:y,prevId:C,nextId:z,onSelect:M,pagerDisabled:T,onEdit:()=>I(B),editDisabled:E})]})}const q=n.parts.find(B=>B.type==="tool"&&u5(B)),H=n.parts.find(Mm)??q,Q=n.parts.filter(B=>B!==H&&!(q&&u5(B))),V=b&&!n.completedAt?"":GB(n);return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(FIn,{message:n,parts:Q,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,predictTextTail:b}}),H&&f.jsx(UH,{part:H,usageLimited:!!q,busy:m,recovering:w===((Y=(Z=H.state)==null?void 0:Z.input)==null?void 0:Y.turnId),onRecover:k}),V&&f.jsx("div",{className:"flex opacity-0 transition-opacity duration-80 ease-standard group-hover/turn:opacity-100 group-focus-within/turn:opacity-100",children:f.jsx(Ft,{size:"small",title:tN(),"aria-label":tN(),onClick:()=>void dC(V),children:f.jsx(Sf,{size:13})})})]})});function FIn({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=qB(n,r),[a,o]=A.useState(!1),[,c]=A.useState(0);if(A.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>c(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:iv(i,t)});const u=e.completedAt??(r?Date.now():null),h=u===null?null:u-e.createdAt,_=h===null?null:h<6e4||h>=36e5?R0(h):lNe({minutes:tn(Math.floor(h/6e4)),seconds:tn(Math.floor(h/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:_===null?nNe():mNe({duration:_})}),f.jsx(Wa,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:iv(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:iv(i,t)})]})}function HIn(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===cI?n:null}function qIn({part:e}){var c;const n=e.state,t=Ws((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((c=n==null?void 0:n.input)==null?void 0:c.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` +`),o=r?xD():s&&i!==null?M0e({code:tn(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[ED()," "]}),f.jsx(Cf,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${uC} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function iv(e,n){var x,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,predictTextTail:m=!1}=n,w=e.filter(C=>C.type!=="steer"&&xh(C,t)).at(-1),k=[];let v=[];const b=()=>{v.length!==0&&(k.push(f.jsx(OIn,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(xh(C,t)){if(C.type==="tool"&&(GIn(C.tool)||(((x=C.children)==null?void 0:x.length)??0)>0)){b(),k.push(f.jsx(KIn,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?k.push(f.jsx(nc,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(w==null?void 0:w.id)},C.id)):C.type==="steer"?k.push(f.jsx("div",{dir:"auto",role:"note","aria-label":XCe(),className:"msg-steer my-2 ms-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&&k.push(f.jsx(DIn,{part:C,onRespond:h,onOpenFile:s,onOpenPlan:_},C.id))}return b(),k}function UIn(e){return ff(e).label}function GIn(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function GH(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function lb(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&lb(t.children,n);if(r)return r}return null}function VIn({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var w,k,v,b;const o=e.children??[],c=((w=e.state)==null?void 0:w.status)==="running",u=((k=e.state)==null?void 0:k.status)==="error",h=u?Ly(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",_=iv(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:c,pendingTailToolId:c?FB(o):null}),m=o.some(x=>x.type==="text"&&!!x.text)?"":GH(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),h&&f.jsx("div",{className:uC,children:h.slice(0,2e4)}),_.length===0&&!m&&!h?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:c?Kk():H1e()}):f.jsxs(f.Fragment,{children:[_,m&&f.jsx(nc,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function KIn({part:e,pendingTail:n,onOpenSubagent:t}){var u,h,_,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=Ly(((h=e.state)==null?void 0:h.error)||((_=e.state)==null?void 0:_.output)||""),i=n&&!r?fC(ff(e)):ff(e),a=qH(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!GH(e),c=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(FI,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(cb,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${AH} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:c}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:Ive(),...Gr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[c,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Wa,{size:12})})]})}function WIn(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const c of s){const u=`${i}/${c.id}`;c.type==="tool"&&((a=c.state)!=null&&a.status)&&n.set(u,{status:c.state.status,part:c}),(o=c.children)!=null&&o.length&&r(c.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function hC(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Ws(o,"reason","description")||HH(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function QIn(e){const[n,t]=A.useState({text:"",sequence:0}),r=A.useRef(null);return A.useEffect(()=>{var w,k,v,b,x;const s=((w=e[0])==null?void 0:w.id)??"",{messageId:i,states:a}=WIn(e),o=hC(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?VE({label:ia(o.label)}):"",sequence:y.sequence+1}));return}const c=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,h=[...a].filter(([y,C])=>{var z;return((z=c.get(y))==null?void 0:z.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:VE({label:ia(o.label)}),sequence:y.sequence+1}));return}const _=(k=h.find(([,y])=>Mm(y.part)))==null?void 0:k[1].part;if((_==null?void 0:_.id)==="turn-recovery"){const y=KB((b=(v=_.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${Kce()}${y?` ${y==="retry"?fce():ice()}`:""}`,sequence:C.sequence+1}));return}if((_==null?void 0:_.id)==="turn-retry"){t(y=>({text:Zoe(),sequence:y.sequence+1}));return}const p=h.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>ff(C.part).label).join(", ");t(C=>({text:p.length===1?Mce({labels:y}):Pce({count:tn(p.length),labels:y}),sequence:C.sequence+1}));return}const m=h.filter(([,y])=>y.status==="running");if(m.length>0){const y=(x=m.at(-1))==null?void 0:x[1].part;t(C=>({text:y?fC(ff(y)).label:bce(),sequence:C.sequence+1}));return}h.some(([,y])=>y.status==="completed")&&t(y=>({text:Ece(),sequence:y.sequence+1}))},[e]),n}const XIn=A.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:c,onSelectFork:u,busy:h,onOpenFile:_,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:w,onOpenExperiment:k,experimentName:v,onRespond:b,onOpenPlan:x,onOpenSubagent:y,recoveringTurnId:C,onRecover:z,skills:E}){var B,L,F;wf();const T=((B=hC(n))==null?void 0:B.id)??null,j=A.useMemo(()=>n.filter(U=>LIn(U,T)),[n,T]),M=A.useMemo(()=>{const U=j.filter(K=>K.role==="user"&&!K.id.startsWith(W_));return p9n(a,n,U,K=>K.startsWith(W_))},[n,j,a]),D=A.useRef(new Set),[I,$]=A.useState(!1),q=A.useCallback(U=>j[U].id,[j]),H=A.useCallback(U=>{if(I)return j.map((ne,oe)=>oe);const K=new Set(BB(U));return j.forEach((ne,oe)=>{D.current.has(ne.id)&&K.add(oe)}),[...K].sort((ne,oe)=>ne-oe)},[j,I]),Q=f9n({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:q,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var U;return Math.max(0,j.length*400-(((U=t.current)==null?void 0:U.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:H});A.useLayoutEffect(()=>{const U=()=>Q.scrollToEnd();return r.current=U,i(),()=>{r.current=null}},[Q,r,i]),A.useEffect(()=>{const U=()=>{var oe;const K=window.getSelection();if(!K||K.isCollapsed||!K.rangeCount)return;const ne=K.getRangeAt(0);for(const ue of((oe=t.current)==null?void 0:oe.querySelectorAll("[data-message-id]"))??[])ne.intersectsNode(ue)&&ue.dataset.messageId&&D.current.add(ue.dataset.messageId)};return document.addEventListener("selectionchange",U),()=>document.removeEventListener("selectionchange",U)},[t]);const V=j.at(-1),Z=QIn(n),Y=h?HB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:Z.text},Z.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":I,onClick:()=>$(U=>!U),children:p9e()}),f.jsx("div",{className:"relative",style:{height:Q.getTotalSize()},children:Q.getVirtualItems().map(U=>{var se,G,ae,ce,pe,be;const K=j[U.index],ne=K.parts.find(Mm),oe=(G=(se=ne==null?void 0:ne.state)==null?void 0:se.input)==null?void 0:G.turnId,ue=ne?h||C!==null:!1;return f.jsx("div",{"data-index":U.index,"data-message-id":K.id,ref:Q.measureElement,className:"absolute left-0 w-full pb-4",style:{top:U.start},onClickCapture:Ae=>{!(Ae.target instanceof Element)||!Ae.target.closest("[data-work-toggle]")||(s.current=!1,Q.setOptions({...Q.options,anchorTo:"start"}))},onPointerDownCapture:()=>D.current.add(K.id),onFocusCapture:()=>D.current.add(K.id),children:f.jsx(PIn,{message:K,forkCount:(ae=M.get(K.id))==null?void 0:ae.count,forkIndex:(ce=M.get(K.id))==null?void 0:ce.index,forkPrevId:(pe=M.get(K.id))==null?void 0:pe.prevId,forkNextId:(be=M.get(K.id))==null?void 0:be.nextId,forkDisabled:!o,branchDisabled:h,onFork:c,onSelectFork:u,activePermissionId:T,pendingTailToolId:(Y==null?void 0:Y.messageId)===K.id?Y.toolId:null,onOpenFile:_,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:w,onOpenExperiment:k,experimentName:v,onRespond:b,onOpenPlan:x,onOpenSubagent:y,busy:ue,recoveringTurnId:oe===C?C:null,onRecover:z,skills:E,predictTextTail:h&&K===V&&K.role==="assistant"})},K.id)})})]})}),YIn=(e,n)=>e==="all"?!0:e==="archived"?n:!n,VH=[{id:"active",label:ube,railLabel:RD},{id:"archived",label:iN,railLabel:iN},{id:"all",label:gbe,railLabel:CD}];function ZIn({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=Xa();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Ft,{size:"small",className:"rail-filter-btn",active:e!=="active",title:gN(),"aria-label":gN(),onClick:()=>r(i=>!i),children:f.jsx(ZI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:VH.map(i=>f.jsxs(Dn,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Pi,{size:13})]},i.id))})]})}const JIn=14,e$n=500,t$n=1200;function KH({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.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*JIn,e$n)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function n$n({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:c,onDelete:u}){var z;const{open:h,setOpen:_,ref:p}=Xa(),m=((z=e.title)==null?void 0:z.trim())||"Untitled",[w,k]=A.useState(!1),[v,b]=A.useState(""),x=A.useRef(null);function y(){var E;b(((E=e.title)==null?void 0:E.trim())||""),k(!0)}function C(){var T;const E=v.trim();k(!1),E&&E!==(((T=e.title)==null?void 0:T.trim())||"")&&o(E)}return A.useEffect(()=>{var E,T;w&&((E=x.current)==null||E.focus(),(T=x.current)==null||T.select())},[w]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.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]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.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-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]: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-dot]:hidden ${n?"active":""} ${t?"unread":""} ${h?"menu-open":""} ${w?"editing":""}`,title:`${hu[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?w9e():""}`,onClick:()=>{w||(h?_(!1):a())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),h?_(!1):a())},children:[e.parentSessionId&&!w&&f.jsx(kS,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),w?f.jsx("input",{ref:x,className:"session-title-input","aria-label":hSe(),value:v,onChange:E=>b(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))}}):f.jsx("span",{className:"session-title",children:f.jsx(KH,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:CN(),"aria-label":CN(),onClick:E=>{E.stopPropagation(),_(T=>!T)},children:f.jsx(Ib,{size:14})}),h&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(Dn,{onClick:E=>{E.stopPropagation(),_(!1),y()},children:f.jsx("span",{children:zD()})}),f.jsx(Dn,{onClick:E=>{E.stopPropagation(),_(!1),c(!e.archived)},children:f.jsx("span",{children:e.archived?LEe():$pe()})}),f.jsx(Dn,{danger:!0,onClick:E=>{E.stopPropagation(),_(!1),u()},children:f.jsx("span",{children:ND()})})]})]})}const jR=[$I,YI,Cf,gh],r$n=()=>[{title:FSe(),prompt:OSe()},{title:t6e(),prompt:WSe()},{title:p6e(),prompt:c6e()},{title:j6e(),prompt:w6e()}],y4=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],TR="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function s$n({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:c,runExperimentName:u,onOpenExperiment:h,experimentName:_,onOpenPlan:p,onOpenSubagent:m,runtime:w,onOpenDemoWelcome:k,composerFocusNonce:v=0,demoRunningRunId:b=null,activeSessionId:x,onActiveSessionChange:y,preferredAgent:C,onPreferredAgentChange:z,children:E}){var Cs,Dl,Es,r_,$f,Bf,$r;const T=dn({mutationFn:te=>i2n(...te)}),j=dn({mutationFn:te=>r2n(...te)}),M=dn({mutationFn:te=>s2n(...te)}),D=dn({mutationFn:te=>Yxn(...te)}),I=dn({mutationFn:te=>Jxn(...te)}),$=dn({mutationFn:te=>t2n(...te)}),q=dn({mutationFn:te=>n2n(...te)}),H=dn({mutationFn:e2n}),Q=A.useMemo(()=>Ga(e),[e]),{data:V=_In}=ut(Q),Z=A.useCallback(te=>{Yr(Q.queryKey,ge=>{if(!ge)return;const Ee=typeof te=="function"?te(ge):te,Ie=new Map(ge.map(Pe=>[Pe.id,Pe]));for(const Pe of Ee)Ie.get(Pe.id)!==Pe&&_o(Je,Q.queryKey,Pe.id),Ie.delete(Pe.id);for(const Pe of Ie.keys())_o(Je,Q.queryKey,Pe);return Ee})},[Q]),Y=x,B=A.useRef(y);B.current=y;const L=A.useRef({projectId:e});L.current.projectId!==e&&(L.current={projectId:e});const[F,U]=A.useState(new Set),[K,ne]=A.useState("active"),[oe,ue]=A.useState(""),[se,G]=A.useState(!1),[ae,ce]=A.useState(!1),[pe,be]=A.useState([]),Ae=A.useRef(0),De=A.useRef({projectId:e,activeId:Y,mainView:i});(De.current.projectId!==e||De.current.activeId!==Y||De.current.mainView!==i)&&(De.current={projectId:e,activeId:Y,mainView:i});const[We,Ne]=A.useState([]),[xe,rt]=A.useState(null),Ze=Y??"new",ct=A.useRef(new Map),Ct=A.useRef(kw);Ct.current={draft:oe,attachments:We,annotations:pe};const qt=e===Fp&&V.length>0&&V.every(te=>Hbn[te.id]===te.activeLeafId)?Hz:null,dt=A.useRef(null);qt!==null&&dt.current===null&&Y!==null&&(dt.current=Ze);const ht=Ze===dt.current?qt:null;A.useLayoutEffect(()=>{const te=ct.current.get(Ze)??kw;return Ct.current=te,ue(te.draft),Ne(te.attachments),be(te.annotations),()=>{const ge=C9n(Ct.current,ht);ge?ct.current.set(Ze,ge):ct.current.delete(Ze)}},[Ze,ht]);const[Le,me]=A.useState(null),Te=A.useRef(Promise.resolve()),He=A.useRef(0),nt=A.useRef(0),[_t,St]=A.useState(null),yt=A.useRef(null),Zt=A.useRef(!1),un=A.useRef(null),[At,pt,mt]=V2n(e,i==="chat"?Y:null),{data:_n=a$n}=ut(Mu()),[us,xr]=A.useState(C);A.useEffect(()=>xr(C),[C]);const[Qt,Mn]=A.useState({}),[mr,gr]=A.useState(Zp),[_s,Et]=A.useState(null),fn=A.useRef(!1),an=A.useRef(null),[xn,Ir]=A.useState(null),mn=A.useRef(!1),gn=A.useRef(null),[Ln,Nt]=A.useState(new Map),Ot=A.useRef(new Map),Hn=A.useRef(null),zr=A.useRef(null),nr=A.useRef(null),On=A.useRef(!0),[hr,jr]=A.useState(!0),In=A.useRef(null),[Ke,gt]=A.useState(!1),Zr=Xa(),Wn=A.useCallback(te=>{var ge;Ae.current+=1,be(Ee=>[...Ee,{id:`annotation-${Ae.current}`,...te}]),(ge=In.current)==null||ge.focus()},[]),wn=rIn(zr,Wn);sIn(pe),A.useEffect(()=>{gt(!1),wn.dismiss()},[Y,e,wn.dismiss]);const[Qn,rr]=A.useState(0),[As,Tr]=A.useState(!1),[cr,xl]=A.useState(0),[Ya,Jr]=A.useState(0),Rs=A.useRef(!1);function Za(te){if(!Kr)return;if(!ni&&te.source==="command"&&Dy(te.name)&&te.name!=="goal"){zo(te.name,oe,Kr);return}const ge=te.source==="command"?1:W5(te.name,In.current),Ee=CLn(oe,Kr,te.name,ge);ue(Ee.text),window.requestAnimationFrame(()=>{var Ie,Pe;(Ie=In.current)==null||Ie.focus(),(Pe=In.current)==null||Pe.setSelectionRange(Ee.cursor,Ee.cursor),Jr(Ee.cursor)})}function Eo(te){if(Gi)return!1;const ge=te.selectionStart;if(Rs.current||ge!==te.selectionEnd)return!1;const Ee=oe.slice(0,ge).replace(/[ \t]+$/,"").length,Ie=_4(oe,Ee);if(!Ie||Ie.end!==Ee||!kl(Ie.query)||ge>Ee&&ge-Ee!==W5(Ie.query,te))return!1;const Pe=vR(oe,{...Ie,end:ge});return ue(Pe.text),Jr(Pe.cursor),window.requestAnimationFrame(()=>te.setSelectionRange(Pe.cursor,Pe.cursor)),!0}function wa(te){rt(null);let Ie=We.reduce((Pe,Yt)=>Pe+Yt.size,0);for(const Pe of te){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Pe.type))continue;if(Pe.size>31457280){rt(f0e({name:Ce(Pe.name)}));continue}if(Ie+Pe.size>41943040){rt(b0e());continue}Ie+=Pe.size;const Yt=Y,vn=new FileReader;vn.onload=()=>{const hn={dataUrl:vn.result,mediaType:Pe.type,name:Pe.name,size:Pe.size};if(De.current.activeId===Yt){Ne(he=>[...he,hn]);return}const J=ct.current.get(Yt??"new")??kw;ct.current.set(Yt??"new",{...J,attachments:[...J.attachments,hn]})},vn.readAsDataURL(Pe)}}function Ps(te){const ge=Array.from(te.clipboardData.items).filter(Ee=>Ee.kind==="file"&&(Ee.type.startsWith("image/")||Ee.type==="application/pdf")).map(Ee=>Ee.getAsFile()).filter(Ee=>Ee!==null);ge.length>0&&(te.preventDefault(),wa(ge))}const $t=V.find(te=>te.id===Y),qi=us??ESn(_n),Xn=$t?{harness:$t.harness,model:Qt.model??$t.model,serviceTier:Qt.serviceTier!==void 0?Qt.serviceTier:$t.serviceTier,permissionMode:Qt.permissionMode??$t.permissionMode,reasoningLevel:Qt.reasoningLevel??$t.reasoningLevel}:qi?{...qi,...Qt}:null,{data:Ar=i$n}=ut(L2n(Xn==null?void 0:Xn.harness)),st=Xn?_n.find(te=>te.id===Xn.harness):void 0,Jt=st==null?void 0:st.options,vi=A.useMemo(()=>ELn(Ar,Jt==null?void 0:Jt.planActivation),[Ar,Jt==null?void 0:Jt.planActivation]),bi=yR(oe),yi=bi!==null,Kr=_4(oe,Ya),Wr=(Kr==null?void 0:Kr.query)??null,Ui=Wr===null?[]:vi.filter(te=>kLn(te,Wr)),Gi=!yi&&Wr!==null&&(Kr==null?void 0:Kr.end)===Ya&&Ui.length>0,Fs=Gi&&!As?Ui:[],Rr=Fs.length>0,ei=Math.min(Qn,Math.max(0,Fs.length-1));A.useEffect(()=>rr(0),[Wr]);const xi=Xn&&st&&!st.catalogPending&&st.models.length>0&&!st.models.some(te=>te.id===Xn.model)?st.models[0].id:(Xn==null?void 0:Xn.model)??null,Vt=Xn&&{...Xn,model:xi,serviceTier:Rv(st,xi,Xn.serviceTier),reasoningLevel:nI(st,xi,Xn.reasoningLevel)},wi=Db(st,Vt==null?void 0:Vt.model),dc=te=>{if(!Vt)return;const ge={...Vt,...te},Ee={};te.model!==void 0&&te.model!==Vt.model&&(Ee.model=te.model),te.serviceTier!==void 0&&te.serviceTier!==Vt.serviceTier&&(Ee.serviceTier=te.serviceTier),te.permissionMode!==void 0&&te.permissionMode!==Vt.permissionMode&&(Ee.permissionMode=te.permissionMode),te.reasoningLevel!==void 0&&te.reasoningLevel!==Vt.reasoningLevel&&(Ee.reasoningLevel=te.reasoningLevel),gr(Ie=>({...Ie,...Ee})),xr(ge),z(ge).catch(()=>{}),$t?Mn(Ie=>({...Ie,...te})):te.harness&&te.harness!==Vt.harness&&Mn({})},Yn=A.useCallback(te=>{const ge=Te.current.catch(()=>{}).then(()=>{if(!Fn(Q.queryKey))throw new DOMException("Workspace changed","AbortError");return te()});return Te.current=ge.then(()=>{},()=>{}),ge},[Q]),es=te=>{if(te==="plan"&&(st==null?void 0:st.id)==="claude-code"?(gr(Ie=>({...Ie,permissionMode:te})),Mn(Ie=>({...Ie,permissionMode:te}))):(Mn(Ie=>{const Pe={...Ie};return delete Pe.permissionMode,Pe}),dc({permissionMode:te})),!$t)return;const ge=$t.id,Ee=++He.current;me(null),Yn(()=>T.mutateAsync([ge,te])).then(Ie=>{Z(Pe=>Pe.map(Yt=>Yt.id===Ie.id?Ie:Yt)),He.current===Ee&&Mn(Pe=>{const Yt={...Pe};return delete Yt.permissionMode,Yt})}).catch(()=>{He.current===Ee&&(Mn(Ie=>{const Pe={...Ie};return delete Pe.permissionMode,Pe}),me(QEe()))})},ki=te=>dc({reasoningLevel:te}),ks=((Cs=$t==null?void 0:$t.goal)==null?void 0:Cs.trim())||"",Vi=(Vt==null?void 0:Vt.harness)==="claude-code"?Vt.permissionMode==="plan":(Jt==null?void 0:Jt.planActivation)==="command"?_t??($t==null?void 0:$t.planMode)??!1:!1;A.useEffect(()=>{_t===null||($t==null?void 0:$t.planMode)!==_t||(yt.current=null,St(null))},[$t==null?void 0:$t.planMode,_t]);async function Hs(te){if(gr(Ie=>({...Ie,planMode:te})),yt.current=te,St(te),!$t)return;const ge=$t.id,Ee=++nt.current;me(null);try{const Ie=await Yn(()=>j.mutateAsync([ge,te]));Z(Pe=>Pe.map(Yt=>Yt.id===Ie.id?Ie:Yt)),nt.current===Ee&&(yt.current=null,St(null),me(null))}catch(Ie){throw nt.current===Ee&&(yt.current=null,St(null)),Ie}}async function Qu(){if((Vt==null?void 0:Vt.harness)==="claude-code"){es("auto");return}if($t)try{await Hs(!1)}catch{me(Pme())}}async function hc(){const te=!Vi;try{if((Vt==null?void 0:Vt.harness)==="claude-code")es(te?"plan":"auto");else if((Jt==null?void 0:Jt.planActivation)==="command")await Hs(te);else throw new Error(Yg())}catch{me(TN())}}function Ja(te,ge=""){var Ee;switch(te){case"plan":return hc(),!1;case"new":return Ni(),!1;case"resume":return gt(!0),!0;case"model":return xl(Ie=>Ie+1),!0;case"compact":return Xu(),!1;case"goal":return Si(ge),!1;case"copy":{const Ie=pr.at(-1),Pe=sr&&(Ie==null?void 0:Ie.role)==="assistant"&&!Ie.completedAt,Yt=b9n(Pe?pr.slice(0,-1):pr);return Yt?dC(Yt):bn(mve(),"info"),!1}case"export":{const Ie=((Ee=$t==null?void 0:$t.title)==null?void 0:Ee.trim())||xd(),Pe=$t?y9n(Ie,pr,{user:oge(),assistant:hu[$t.harness]}):null;return Pe?$In(x9n(Ie),Pe):bn(kve(),"info"),!1}}}async function No(te){me(null);const ge=L.current;try{const Ee=await D.mutateAsync([e,te]);if(Je.invalidateQueries({queryKey:oI().queryKey}),L.current!==ge)return;Z(Ie=>[Ee,...Ie.filter(Pe=>Pe.id!==Ee.id)]),ne("all"),y(Ee.id,{projectId:Ee.projectId})}catch(Ee){if(L.current!==ge)return;me(t1e({error:Ce(Ee instanceof Error?Ee.message:String(Ee))}))}}async function Si(te){var vn;const ge=te.trim();if(!ge){const hn=(vn=$t==null?void 0:$t.goal)==null?void 0:vn.trim();bn(hn?xge({goal:ia(hn)}):Oge(),"info");return}const Ee=De.current,Ie=()=>De.current.activeId===Ee.activeId;me(null);let Pe=Y;if(!Pe){if(!(st!=null&&st.agentReady)||!Vt){me(Yg());return}try{Pe=(await Na(Vt,d4(Jt==null?void 0:Jt.planActivation,void 0,yt.current))).id}catch(hn){me(nN({error:Ce(hn instanceof Error?hn.message:String(hn))}));return}}const Yt=/^(clear|none|off)$/i.test(ge);try{const hn=await Yn(()=>M.mutateAsync([Pe,Yt?null:ge]));Z(J=>J.map(he=>he.id===hn.id?hn:he)),bn(Yt?hge():Fge(),"success")}catch(hn){if(!Ie())return;me(nN({error:Ce(hn instanceof Error?hn.message:String(hn))}))}}async function Xu(){const te=Y;if(!te){bn(lve(),"info");return}if(sr){me(J0e());return}me(null),K==="archived"&&ne("active");const ge=De.current;try{const{message:Ee}=await u2n(te);pt({type:"upsertMessage",sessionId:te,message:Ee})}catch(Ee){if(De.current.activeId!==ge.activeId)return;me(ame({error:Ce(Ee instanceof Error?Ee.message:String(Ee))}))}}function zo(te,ge,Ee){const Ie=vR(ge,Ee);ue(Ie.text),Tr(!0),!Ja(te)&&window.requestAnimationFrame(()=>{var Pe,Yt;(Pe=In.current)==null||Pe.focus(),(Yt=In.current)==null||Yt.setSelectionRange(Ie.cursor,Ie.cursor),Jr(Ie.cursor)})}const qs=A.useCallback(async(te=!1)=>{const ge=L.current;if(ge.projectId!==e||!Fn(Q.queryKey))return null;const Ee=(Je.getQueryData(Q.queryKey)??[]).map(Ie=>Ie.id);try{const Ie=await Je.fetchQuery({...Q,...te?{staleTime:0}:{}});if(L.current!==ge||!Fn(Q.queryKey))return null;const Pe=Ie.filter(vn=>!_l.has(vn.id)),Yt=new Set(Pe.map(vn=>vn.id));for(const vn of Ee)Yt.has(vn)||n_(vn);return Ot.current=new Map(Pe.map(vn=>[vn.id,vn.title])),Pe}catch{return null}},[e]),fs=A.useCallback(async te=>{L.current.projectId!==e||!Fn(Q.queryKey)||await Promise.all([Je.fetchQuery({...ol(te),staleTime:0}),qs(!0)]).catch(()=>{})},[e,qs]);A.useEffect(()=>{const te=_$();U(e===Fp?new Set([Rb,Mb].filter(Ee=>!te.has(Ee))):new Set),G(!1),ce(!1),Nt(new Map),Ot.current=new Map,qs();const ge=L.current;return()=>{L.current===ge&&(L.current={projectId:e})}},[e,qs]),A.useEffect(()=>{gr(Zp),gn.current=null},[Y]),A.useEffect(()=>Ov(te=>{switch(te.type){case"session":{if(te.session.projectId!==e||_l.has(te.session.id))return;const ge=Ot.current.has(te.session.id),Ee=Ot.current.get(te.session.id)!==te.session.title;Ot.current.set(te.session.id,te.session.title),ge&&Ee&&te.session.titleSource==="generated"&&(Nt(Ie=>{const Pe=new Map(Ie);return Pe.set(te.session.id,(Ie.get(te.session.id)??0)+1),Pe}),window.setTimeout(()=>{Nt(Ie=>{if(!Ie.has(te.session.id))return Ie;const Pe=new Map(Ie);return Pe.delete(te.session.id),Pe})},t$n));break}case"sessionDeleted":n_(te.sessionId);break}}),[e]),A.useEffect(()=>Ov(te=>{te.type==="reconnected"&&qs(!0)}),[qs]);const Ki=Y?At.messagesBySession[Y]??CR:CR,ka=Y?At.activeLeafBySession[Y]??null:null;an.current=ka;const pr=A.useMemo(()=>d9n(Ki,ka),[Ki,ka]),pc=A.useRef({projectId:e,ids:At.busySessions});A.useEffect(()=>{const te=pc.current;pc.current={projectId:e,ids:At.busySessions},te.projectId===e&&U(ge=>v9n(ge,te.ids,At.busySessions,V,i==="chat"?Y:null))},[e,At.busySessions,V,Y,i]);const sr=Y?At.busySessions.has(Y):!1,Mf=!sr&&!!(st!=null&&st.agentReady),mc=sr&&HB(pr)!=null,wl=sr&&g9n(pr),Ci=Y?At.queuedBySession[Y]??[]:[],ds=Ci.some(te=>te.dispatchState==="retrying"),eo=Ci.findIndex(te=>te.dispatchState==="blocked"),Wi=Ci.reduce((te,ge)=>ge.dispatchState!=="retrying"||typeof ge.nextRetryAt!="number"?te:te===null?ge.nextRetryAt:Math.min(te,ge.nextRetryAt),null),[to,Of]=A.useState(()=>Date.now());A.useEffect(()=>{if(!ds||Wi===null||(Of(Date.now()),Wi<=Date.now()))return;const te=window.setInterval(()=>{const ge=Date.now();Of(ge),ge>=Wi&&window.clearInterval(te)},1e3);return()=>window.clearInterval(te)},[ds,Wi]),A.useEffect(()=>{const te=Ci.reduce((ge,Ee)=>Ee.planMode??ge,void 0);te!==void 0?(Zt.current=!0,yt.current=te,St(te)):Zt.current&&(Zt.current=!1,yt.current=null,St(null))},[Ci]);const on=!!Y&&!(Y in At.messagesBySession)&&mt.isPending,Qi=A.useMemo(()=>{const te=new Set;for(const ge of At.busySessions)(At.messagesBySession[ge]??[]).some(Ee=>Ee.parts.some(Ie=>Ie.type==="prompt"&&Ie.prompt&&!Ie.prompt.resolved&&Ie.prompt.nativeId))&&te.add(ge);return te},[At.busySessions,At.messagesBySession]),ti=Y?Qi.has(Y):!1,Zn=$t,Yu=Zn?Ln.get(Zn.id):void 0,Ss=A.useMemo(()=>{var te;for(let ge=pr.length-1;ge>=0;ge--)for(const Ee of pr[ge].parts)if(Ee.type==="prompt"&&((te=Ee.prompt)==null?void 0:te.kind)==="plan"&&!Ee.prompt.resolved)return{promptId:Ee.id,plan:Ee.prompt.plan??"",synthesized:!!Ee.prompt.synthesized};return null},[pr]),ni=A.useMemo(()=>Y?m9n(pr,Zn==null?void 0:Zn.harness,At.busySessions.has(Y)):null,[pr,Zn==null?void 0:Zn.harness,Y,At.busySessions]),Ei=yi&&!ni,kl=te=>{if(ni||yi)return!1;const ge=K5(te),Ee=vi.find(Ie=>Ie.name===(ge??te));return!Ee||Ee.source!=="command"?!!Ee:ge&&f4(ge)?ge==="plan"||oe.trim().toLowerCase().startsWith(`/${te}`):oe.trim().toLowerCase()===`/${te}`},Zu=A.useMemo(()=>vi.filter(te=>te.source!=="command"),[vi]),[Sa,Df]=A.useState(null),jo=Sa&&Sa.sessionId===Y?Sa:null;A.useEffect(()=>{if(!Sa)return;const te=At.busySessions.has(Sa.sessionId),ge=Sa.sessionId===Y&&Ss&&Ss.promptId!==Sa.promptId;(!te||ge)&&Df(null)},[Sa,Ss,At.busySessions,Y]);const Qh=A.useMemo(()=>hC(pr),[pr]),ri=sr&&!!(st!=null&&st.supportsSteering)&&!!(st!=null&&st.agentReady)&&!Ss&&!ni&&!Qh&&We.length===0&&pe.length===0,gc=A.useMemo(()=>p&&Y?(te,ge,Ee)=>p(te,Y,ge,Ee):void 0,[p,Y]),Xh=A.useMemo(()=>m&&Y?(te,ge,Ee)=>m(Y,te,ge,Ee):void 0,[m,Y]),vc=A.useMemo(()=>o&&((te,ge,Ee,Ie,Pe)=>o(te,Y??void 0,ge,Ee,Ie,Pe)),[o,Y]);A.useEffect(()=>{He.current+=1,nt.current+=1;const te=(Y?At.queuedBySession[Y]??[]:[]).reduce((ge,Ee)=>Ee.planMode??ge,void 0);Zt.current=te!==void 0,yt.current=te??null,St(te??null),Mn({}),me(null)},[Y]);const Sl=i==="chat"&&(pr.length>0||sr),Ca=(Vt==null?void 0:Vt.harness)??null,Lf=(Vt==null?void 0:Vt.model)??null,Cl=mt.data?null:mt.error,Ju=i==="chat"&&!Sl&&!on&&!Cl,El=ut({...uwn(e,Ca??"claude-code",Lf,N()),enabled:Ju&&Ca!==null,subscribed:Ju&&Ca!==null}),Ea=(Dl=El.data)!=null&&Dl.blank?r$n():((Es=El.data)==null?void 0:Es.prompts)??null,Nl=Ca!==null&&El.isPending,bc=e===Fp?"demo":"project",Yh=te=>{ue(te),Tr(!1),window.requestAnimationFrame(()=>{const ge=In.current;ge&&(ge.focus(),ge.setSelectionRange(te.length,te.length),Jr(te.length))})};A.useEffect(()=>{ht&&(ue(te=>te||ht),Tr(!1),Jr(ht.length))},[ht]),A.useEffect(()=>{if(v===0)return;const te=window.requestAnimationFrame(()=>{const ge=In.current;ge&&(ge.focus(),ge.setSelectionRange(ge.value.length,ge.value.length),ge.scrollIntoView({block:"nearest"}))});return()=>window.cancelAnimationFrame(te)},[v]);const e_=A.useId(),si=e===Fp&&oe===Hz&&!se,Zh=A.useCallback(te=>{const ge=te.scrollHeight-te.scrollTop-te.clientHeight<60;On.current=ge,jr(ge)},[]),no=A.useCallback(()=>{var te;On.current=!0,jr(!0),(te=nr.current)==null||te.call(nr)},[]);A.useEffect(()=>{const te=Hn.current,ge=zr.current;if(!te||!ge)return;const Ee=new ResizeObserver(()=>{var Ie;On.current?(Ie=nr.current)==null||Ie.call(nr):jr(te.scrollHeight-te.scrollTop-te.clientHeight<60)});return Ee.observe(te),Ee.observe(ge),()=>Ee.disconnect()},[Sl]);const Jh=A.useCallback(te=>{te.currentTarget.blur(),no()},[no]);async function zl({queue:te=!1}={}){var wc,kc,Pf,zi,s_,ai;const ge=oe.trim(),Ee=ni?null:NLn(ge,Jt==null?void 0:Jt.planActivation);if(Ee&&Ee.name!=="plan"){ue(f4(Ee.name)?"":Ee.prompt),Tr(!1),Ja(Ee.name,Ee.prompt);return}if(du({name:"first_action",surface:bc,action:"typed_prompt"}),mn.current)return;const Ie=!!Ee,Pe=!Vi,Yt=d4(Jt==null?void 0:Jt.planActivation,Ie?Pe:void 0,yt.current),vn=Ie&&(st==null?void 0:st.id)==="claude-code"?Pe?"plan":"auto":void 0,hn=Ee?Ee.prompt:ge,J=We,he=pe,je=he.map(zn=>({text:zn.text})),Be=e,Me=i;let it=Y;const at=()=>{const zn=De.current;return Fn(Q.queryKey)&&zn.projectId===Be&&zn.activeId===it&&zn.mainView===Me},Bt=()=>{at()&&(ue(zn=>zn||ge),Ne(zn=>zn.length?zn:J),be(zn=>zn.length?zn:he))};if(Ie&&!hn&&J.length===0&&he.length===0){ue(""),Tr(!1);try{if((st==null?void 0:st.id)==="claude-code")es(Pe?"plan":"auto");else if((Jt==null?void 0:Jt.planActivation)==="command")await Hs(Pe);else throw new Error(Yg())}catch{me(TN()),Bt()}return}const Kt=Vt?{...Vt,...vn?{permissionMode:vn}:{}}:null;vn&&es(vn);let Ns=null;const Os=yt.current;Ie&&(Jt==null?void 0:Jt.planActivation)==="command"&&(Ns=++nt.current,yt.current=Pe,St(Pe));const ps=()=>{!at()||Ns===null||nt.current!==Ns||(yt.current=Os,St(Os))};if(!hn&&J.length===0&&he.length===0)return;if((hn||he.length>0)&&ni&&J.length===0){ue(""),be([]),ii({promptId:ni,answers:[],note:hn||void 0,annotations:je}).then(zn=>{zn||Bt()});return}const ja=JSON.stringify({text:hn,images:J.map(zn=>({mediaType:zn.mediaType,name:zn.name,dataUrl:zn.dataUrl})),annotations:je,settings:Kt?{model:Kt.model,serviceTier:Kt.serviceTier,permissionMode:Kt.permissionMode,planMode:Yt,reasoningLevel:Kt.reasoningLevel}:null}),so=((wc=gn.current)==null?void 0:wc.signature)===ja?gn.current.id:`ct_${crypto.randomUUID()}`;if(gn.current={signature:ja,id:so},sr){if(!Y||!(st!=null&&st.agentReady)){ps();return}const zn=Y;ue(""),Ne([]),be([]),rt(null);const io=Kt?{model:Kt.model,serviceTier:Kt.serviceTier,permissionMode:Kt.permissionMode,planMode:(Jt==null?void 0:Jt.planActivation)==="command"?Yt??($t==null?void 0:$t.planMode):Yt,reasoningLevel:Kt.reasoningLevel}:{};at()&&Mn({});const Ta=J.map(Br=>({mediaType:Br.mediaType,dataBase64:Br.dataUrl.slice(Br.dataUrl.indexOf(",")+1),name:Br.name}));try{(kc=(await Yn(()=>qz(zn,hn,io,Ta.length?Ta:void 0,je,so,ri&&!te&&!Ie?"steer":void 0))).turn)!=null&&kc.existing&&await fs(zn),at()&&gr(Zp),((Pf=gn.current)==null?void 0:Pf.id)===so&&(gn.current=null)}catch{ps(),Bt()}return}if(!(st!=null&&st.agentReady)){ps();return}if(!Kt){ps();return}let zs=Y;try{ue(Jn=>Jn===oe?"":Jn),Ne(Jn=>Jn===J?[]:Jn),be(Jn=>Jn===he?[]:Jn),rt(null),mn.current=!0;try{if(!zs){const np=await Na(Kt,Yt);zs=np.id,it=np.id}if(!Fn(Q.queryKey))return;const Jn=ol(zs);await Je.fetchQuery({...Jn,...((zi=Je.getQueryState(Jn.queryKey))==null?void 0:zi.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{mn.current=!1}if(!Fn(Q.queryKey))return;pt({type:"optimisticUser",sessionId:zs,text:hn||Zpe(),attachments:J.map(Jn=>({url:Jn.dataUrl,mediaType:Jn.mediaType,name:Jn.name})),annotations:he}),pt({type:"busy",sessionId:zs,busy:!0}),at()&&no(),at()&&K==="archived"&&ne("active");const zn=Kt?{model:Kt.model,serviceTier:Kt.serviceTier,permissionMode:Kt.permissionMode,planMode:Yt,reasoningLevel:Kt.reasoningLevel}:{};at()&&Mn({});const io=J.map(Jn=>({mediaType:Jn.mediaType,dataBase64:Jn.dataUrl.slice(Jn.dataUrl.indexOf(",")+1),name:Jn.name})),Ta=zs;if(!Ta)throw new Error(c9e());(s_=(await Yn(()=>qz(Ta,hn,zn,io.length?io:void 0,je,so))).turn)!=null&&s_.existing&&await fs(Ta),at()&&gr(Zp),((ai=gn.current)==null?void 0:ai.id)===so&&(gn.current=null)}catch(zn){if(!Fn(Q.queryKey)||(Bt(),ps(),!zs))return;const io=zn instanceof Error?zn.message:String(zn);if(!/session is busy/i.test(io)&&await Je.fetchQuery({...Ga(e),staleTime:0}).then(Br=>{var Ll;return!!((Ll=Br.find(Jn=>Jn.id===zs))!=null&&Ll.busy)}).catch(()=>!1)){at()&&(ue(Br=>Br===hn?"":Br),Ne(Br=>Br===J?[]:Br),be(Br=>Br===he?[]:Br));return}pt({type:"busy",sessionId:zs,busy:!1}),pt({type:"localError",sessionId:zs,text:p1e({error:Ce(io)})})}}async function Na(te,ge){const Ee=De.current,Ie=L.current,Pe=await I.mutateAsync([e,te.harness,{model:te.model,serviceTier:te.serviceTier,permissionMode:te.permissionMode,planMode:ge,reasoningLevel:te.reasoningLevel}]);return L.current===Ie&&(Z(Yt=>[Pe,...Yt.filter(vn=>vn.id!==Pe.id)]),Je.getQueryData(Q.queryKey)||qs(!0)),L.current===Ie&&De.current===Ee&&(B.current(Pe.id,{replace:!0}),De.current={...Ee,activeId:Pe.id}),Pe}function ep(){const te=PLn(oe);ue(te),window.requestAnimationFrame(()=>{var ge,Ee;(ge=In.current)==null||ge.focus(),(Ee=In.current)==null||Ee.setSelectionRange(te.length,te.length),Jr(te.length)})}async function jl(){const te=bi;if(!te)return;if(me(null),sr){me(E0e());return}const ge=oe,Ee=De.current;let Ie=Y;const Pe=()=>{const J=De.current;return J.projectId===Ee.projectId&&J.activeId===Ie&&J.mainView===Ee.mainView},Yt=()=>{Pe()&&ue(J=>J||ge)};ue(""),Tr(!1);let vn=Y;if(!vn){if(!(st!=null&&st.agentReady)||!Vt){Yt(),me(Yg());return}try{const J=d4(Jt==null?void 0:Jt.planActivation,void 0,yt.current);vn=(await Na(Vt,J)).id,Ie=vn,Pe()&&Mn({})}catch(J){Yt();const he=J instanceof Error?J.message:String(J);Pe()&&me(eN({error:Ce(he)}));return}}Pe()&&K==="archived"&&ne("active");const hn=`${W_}shell-${Date.now()}`;pt({type:"localShell",sessionId:vn,id:hn,command:te}),Pe()&&no();try{const{message:J}=await _2n(vn,te);pt({type:"upsertMessage",sessionId:vn,message:J})}catch(J){const he=J instanceof Error?J.message:String(J);pt({type:"localShell",sessionId:vn,id:hn,command:te,error:eN({error:Ce(he)})})}}function Tl(){Y&&p2n(Y).catch(()=>{me(q9e())})}const Al=A.useCallback(async(te,ge)=>{if(!(!Y||fn.current)){fn.current=!0,me(null),Et(te);try{const Ee=S9n({model:mr.model,serviceTier:mr.serviceTier,permissionMode:mr.permissionMode,planMode:mr.planMode,reasoningLevel:mr.reasoningLevel}),Ie=Y;(await f2n(Ie,te,ge,Ee)).turn.existing&&await fs(Ie),gr(Zp)}catch{me(t8e())}finally{fn.current=!1,Et(null)}}},[Y,mr,fs]),t_=A.useCallback((te,ge)=>{if(!Y||sr||!(st!=null&&st.agentReady))return;const Ee=Y;pt({type:"busy",sessionId:Ee,busy:!0}),no(),Yn(()=>d2n(Ee,te,ge)).catch(Ie=>{pt({type:"busy",sessionId:Ee,busy:!1});const Pe=Ie instanceof Error?Ie.message:String(Ie);pt({type:"localError",sessionId:Ee,text:p8e({error:Ce(Pe)})})})},[Y,sr,st==null?void 0:st.agentReady,no,Yn]),If=A.useCallback(te=>{if(!Y||sr)return;const ge=Y,Ee=an.current;pt({type:"activeLeaf",sessionId:ge,leafId:te}),Yn(()=>h2n(ge,te)).catch(Ie=>{pt({type:"activeLeaf",sessionId:ge,leafId:Ee});const Pe=Ie instanceof Error?Ie.message:String(Ie);pt({type:"localError",sessionId:ge,text:X9e({error:Ce(Pe)})})})},[Y,sr,Yn]);function za(te){if(!Y)return;const ge=Y;o2n(ge,te).then(({removed:Ee})=>{if(Ee)return fs(ge)}).catch(()=>me(c8e()))}async function Rl(te){if(!Y||xn)return;const ge=Y;me(null),Ir(te);try{await c2n(ge,te),await fs(ge)}catch{me(j8e())}finally{Ir(null)}}A.useEffect(()=>{if(!sr||i!=="chat")return;function te(ge){var Ee;ge.key!=="Escape"||ge.defaultPrevented||(ge.preventDefault(),Tl(),(Ee=In.current)==null||Ee.focus())}return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[sr,Y,i]);function n_(te){Tb(te),ct.current.delete(te),dt.current===te&&(dt.current=null),De.current.projectId===e&&De.current.activeId===te&&De.current.mainView==="chat"&&(ue(""),Ne([]),be([]),B.current(null,{replace:!0})),U(ge=>{if(!ge.has(te))return ge;const Ee=new Set(ge);return Ee.delete(te),Ee}),Ot.current.delete(te)}function tp(te,ge){const Ee=te.archived;Z(Ie=>Ie.map(Pe=>Pe.id===te.id?{...Pe,archived:ge}:Pe)),$.mutateAsync([te.id,ge]).catch(()=>{Z(Ie=>Ie.map(Pe=>Pe.id===te.id?{...Pe,archived:Ee}:Pe))})}function Ms(te,ge){const Ee=te.title;Z(Ie=>Ie.map(Pe=>Pe.id===te.id?{...Pe,title:ge}:Pe)),q.mutateAsync([te.id,ge]).catch(()=>{Z(Ie=>Ie.map(Pe=>Pe.id===te.id?{...Pe,title:Ee}:Pe))})}async function $n(te){var Ee;const ge=((Ee=te.title)==null?void 0:Ee.trim())||xd();if(window.confirm(Eme({title:ia(ge)}))){try{await H.mutateAsync(te.id)}catch(Ie){bn(Mme({title:ia(ge),error:Ce(Ie instanceof Error?Ie.message:String(Ie))}),"error");return}n_(te.id)}}const ii=A.useCallback(te=>{if(!Y)return Promise.resolve(!1);const ge=Y;return pt({type:"busy",sessionId:ge,busy:!0}),Yn(()=>m2n(ge,te)).then(()=>!0).catch(()=>!1).finally(()=>{Fn(Q.queryKey)&&(Je.fetchQuery({...ol(ge),staleTime:0}).catch(()=>{}),Je.fetchQuery({...Ga(e),staleTime:0}).catch(()=>{}))})},[Y,e,Yn,Q]),To=V.filter(te=>YIn(K,te.archived)),yc=/Mac|iPhone|iPad/.test(navigator.platform),Ml=yc?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",hs=yc?"⌘ Enter":"Ctrl + Enter",Ni=A.useCallback(()=>{ne("active"),y(null)},[y]),ro=A.useCallback(te=>{ne("all"),y(te)},[y]);A.useEffect(()=>{const te=ge=>{ge.repeat||ge.key!=="Enter"||!ge.metaKey&&!ge.ctrlKey||ge.altKey||!ge.shiftKey||(ge.preventDefault(),Ni())};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[Ni]);const xc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":Ml,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Ni,children:[f.jsx($h,{size:15}),q4e()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx(II,{size:15}),n2e()]}),vLn.map(te=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&te.activeTabs.includes(i)?"active":""}`,"data-onboarding":te.id==="compute"?"nav-compute":void 0,onClick:()=>a(te.id),children:[te.icon,te.label()]},te.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((r_=VH.find(te=>te.id===K))==null?void 0:r_.railLabel())??RD()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(ZIn,{value:K,onChange:ne})})]}),f.jsxs("div",{className:"rail-body",children:[To.map(te=>f.jsx(n$n,{session:te,active:te.id===Y&&i==="chat",unread:F.has(te.id),busy:At.busySessions.has(te.id),waiting:Qi.has(te.id),revealTitle:Ln.get(te.id),onOpen:()=>{if(y(te.id),e===Fp){Bkn(te.id);const ge=Fbn[te.id];ge&&(du({name:"demo_experiment_started",kind:"curated",experiment:ge}),du({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:ge=>Ms(te,ge),onSetArchived:ge=>tp(te,ge),onDelete:()=>void $n(te)},te.id)),To.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:K==="archived"?Q1e():V.length>0?D1e():nve()})]}),f.jsx(G$,{runtime:w})]}),Ol="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 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",Ao=!r&&f.jsx(Ft,{title:EN(),"aria-label":EN(),onClick:s,children:f.jsx(QI,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&xc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:Ao}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:E})]})]}):f.jsxs(f.Fragment,{children:[r&&xc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[Ao,f.jsxs("div",{className:Ol,children:[f.jsx(L0,{variant:"header",title:Zn?(($f=Zn.title)==null?void 0:$f.trim())||xd():rN(),children:Zn?f.jsx(KH,{title:((Bf=Zn.title)==null?void 0:Bf.trim())||xd(),animate:Yu!==void 0},Yu??"static"):rN()}),k&&f.jsx(Ft,{"data-tip":sN(),"aria-label":sN(),onClick:k,children:f.jsx(x3n,{size:15})})]})]}),Cl?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Cl.message}),f.jsx(Oe,{onClick:()=>void mt.refetch(),children:Ys()})]}):on?f.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:[f.jsx(jt,{}),f.jsx("span",{children:L4e()})]}):Sl?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:Hn,tabIndex:0,role:"region","aria-label":(($r=Zn==null?void 0:Zn.title)==null?void 0:$r.trim())||xd(),onScroll:te=>{Zh(te.currentTarget),wn.dismiss()},children:f.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:zr,children:[f.jsx(uH,{projectId:e,sessionId:Y,children:f.jsx(XIn,{scrollRef:Hn,scrollToEndRef:nr,stickToBottom:On,onPinToBottom:no,messages:pr,allMessages:Ki,canFork:Mf,onFork:t_,onSelectFork:If,busy:sr,onOpenFile:vc,onOpenRun:c,onOpenSpawnedSession:ro,runExperimentName:u,onOpenExperiment:h,experimentName:_,onRespond:ii,onOpenPlan:gc,onOpenSubagent:Xh,recoveringTurnId:_s,onRecover:Al,skills:Zu},Y)}),sr&&ti&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:LCe()}),sr&&!ti&&!mc&&!wl&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:uEe()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx(AS,{})}),f.jsx("h2",{children:qCe()}),f.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-medium",children:[f.jsx(Ou,{size:19}),f.jsx("span",{children:n})]}),Nl&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:TR,"aria-hidden":"true",children:jR.map((te,ge)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${y4[ge].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${y4[ge].icon}`,children:[f.jsx(te,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},ge))}),f.jsxs(Vr,{className:"mt-3",role:"status",children:[f.jsx(jt,{}),f.jsx("span",{children:L6e()})]})]}),Ea&&Ea.length>0&&f.jsx("div",{className:TR,role:"group","aria-label":q6e(),children:Ea.map((te,ge)=>{const Ee=jR[ge],Ie=y4[ge];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Ie.box}`,onClick:()=>{du({name:"project_starter_clicked",slot:ge+1}),du({name:"first_action",surface:bc,action:"starter_click"}),Yh(te.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ee,{size:17,className:Ie.icon}),te.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:te.prompt})]},ge)})})]}),wn.action&&f.jsxs(Oe,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:wn.action.x,top:wn.action.top,transform:"translateX(-50%)"},onMouseDown:te=>te.preventDefault(),onClick:wn.add,children:[f.jsx(WI,{size:14}),Ube()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_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:[Sl&&f.jsx(Ft,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${hr?"opacity-0":"opacity-100"}`,title:jN(),"aria-label":jN(),inert:hr,onClick:Jh,children:sr&&!ti?f.jsx(Ib,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(s3n,{size:16})}),Ss&&!(jo&&Ss.promptId===jo.promptId)&&f.jsx(SDn,{synthesized:Ss.synthesized,agentLabel:Zn?hu[Zn.harness]:rEe(),showResumeModes:(Zn==null?void 0:Zn.harness)==="claude-code",onView:te=>gc==null?void 0:gc(Ss.plan,Ss.promptId,te),onApprove:te=>ii({promptId:Ss.promptId,approve:!0,...te?{resumeMode:te}:{}}),onReject:()=>ii({promptId:Ss.promptId,approve:!1}),onRevise:te=>{Y&&Df({sessionId:Y,promptId:Ss.promptId}),ii({promptId:Ss.promptId,approve:!1,note:te})}}),Ci.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Ci.map((te,ge)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:te.error?`${te.text} -${te.error}`:te.text,children:[te.dispatchState==="blocked"?f.jsx(xS,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(m4n,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:te.text}),te.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:te.dispatchState==="retrying"?f8n(te.nextRetryAt,ha):S7e()}),te.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void Hu(te.id),"aria-label":oJ({text:te.text}),disabled:fn!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:fn===te.id?cL():Qs()}),f.jsx("button",{onClick:()=>mn(te.id),"aria-label":eJ({text:te.text}),disabled:fn!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:O5e()}),ve===Ps&&vemn(te.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:f.jsx(lr,{size:11})})]},te.id))}),kl&&f.jsxs("div",{id:Mf,role:"note",className:`composer-demo-hint ${jR}`,children:[f.jsx(mh,{size:16,className:"shrink-0 text-primary"}),f.jsx("span",{className:"flex-1",dir:"auto",children:g2e()}),f.jsx($t,{size:"small","aria-label":Xg(),title:Xg(),onClick:()=>{var te;G(!0),(te=Rn.current)==null||te.focus()},children:f.jsx(lr,{size:14})})]}),b&&!oe&&c&&f.jsxs("div",{role:"note",className:`composer-demo-run-hint ${jR}`,children:[f.jsx(mh,{size:16,className:"shrink-0 text-primary"}),f.jsxs("span",{className:"flex flex-1 flex-wrap items-center gap-x-1.5 gap-y-1",dir:"auto",children:[f.jsx("span",{children:_N()}),f.jsxs(De,{size:"small",onClick:()=>c(b,"keepOpen"),children:[f.jsx(lo,{size:14}),c3()]}),f.jsx("span",{children:uN()})]}),f.jsx($t,{size:"small","aria-label":Xg(),title:Xg(),onClick:()=>{var te;le(!0),(te=Rn.current)==null||te.focus()},children:f.jsx(lr,{size:14})})]}),f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:b?`${_N()} ${c3()} ${uN()}`:""}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${Fs?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[st&&!st.agentReady&&f.jsx("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:st.catalogPending?f.jsxs("span",{children:[st.name," — ",W_()]}):f.jsxs(f.Fragment,{children:[f.jsxs("strong",{children:[st.name," ",Gwe()]})," ",st.agentNote?gh(st.agentNote):I7e()]})}),gi&&f.jsx(kDn,{skills:Lr,activeIndex:gr,onPick:mo,onHover:rr}),Ge&&f.jsx(zDn,{activeSessionId:Z,onClose:()=>kt(!1),onResume:te=>{kt(!1),ne("all"),y(te.id,{projectId:te.projectId})},onImport:te=>{kt(!1),Ua(te)}}),pe.length>0&&f.jsx(XDn,{annotations:pe,onClear:()=>{be([]),window.requestAnimationFrame(()=>{var te;return(te=Rn.current)==null?void 0:te.focus()})},onRemove:te=>{const ve=pe.filter(ze=>ze.id!==te);be(ve),ve.length===0&&window.requestAnimationFrame(()=>{var ze;return(ze=Rn.current)==null?void 0:ze.focus()})}}),Ke.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:Ke.map((te,ve)=>{const ze=()=>je(X=>X.filter((ae,xe)=>xe!==ve));return te.mediaType==="application/pdf"?f.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:te.name,children:[f.jsx(Lb,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:te.name??"document.pdf"}),f.jsx("button",{title:yN(),"aria-label":yN(),onClick:ze,children:f.jsx(lr,{size:11})})]},ve):f.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:[f.jsx("img",{src:te.dataUrl,alt:zD()}),f.jsx("button",{title:xN(),"aria-label":xN(),onClick:ze,children:f.jsx(lr,{size:11})})]},ve)})}),we&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:we}),Ie&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${Fs?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:Rn,"aria-describedby":kl?Mf:void 0,className:"relative z-1 bg-transparent",value:ce,placeholder:vi?vEe():pc&&st?C9e({harness:Ne(su[st.id]),shortcut:Ne(vc)}):Bt?st!=null&&st.agentReady?Yge({harness:Ne(su[Bt.harness])}):Ige({harness:Ne(su[Bt.harness])}):Ope(),rows:2,onPaste:vo,onDragOver:te=>{te.dataTransfer.types.includes("Files")&&te.preventDefault()},onDrop:te=>{te.dataTransfer.files.length!==0&&(te.preventDefault(),Zs(Array.from(te.dataTransfer.files)))},onChange:te=>{const ve=te.target.value,ze=te.target.selectionStart;Vn(ze);const X=ze>0&&/\s/.test(ve[ze-1])&&!vi&&!Kr.current&&vR(ve)===null?l4(ve,ze-1):null,ae=X&&G5(X.query),xe=X?(ve.slice(0,X.start)+ve.slice(X.end)).trim():"";if(X&&ae&&(ae==="plan"||!u4(ae)&&!xe)&&Es.some(Re=>Re.name===ae)){Fu(ae,ve,X);return}_e(ve),Vr(!1)},onSelect:te=>Vn(te.currentTarget.selectionStart),onCompositionStart:()=>{Kr.current=!0},onCompositionEnd:()=>{Kr.current=!1},onKeyDown:te=>{if(gi){if(te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();const ve=te.key==="ArrowDown"?1:-1;rr((gr+ve+Lr.length)%Lr.length);return}if(te.key==="Tab"||te.key==="Enter"){te.preventDefault(),mo(Lr[gr]);return}if(te.key==="Escape"){te.preventDefault(),Vr(!0);return}}if(te.key==="Backspace"&&go(te.currentTarget)){te.preventDefault();return}if(te.key==="Enter"&&!te.shiftKey&&!te.nativeEvent.isComposing){if(te.preventDefault(),Fs){Sl();return}Co({queue:te.metaKey||te.ctrlKey})}}}),f.jsx(wDn,{text:ce,editingTokenEnd:Wn==null?void 0:Wn.end,isCommand:yl,skills:Es,projectId:e,textareaRef:Rn})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:pr.ref,children:[f.jsx($t,{type:"button",className:"composer-bare",title:Y2(),"aria-label":Y2(),"aria-haspopup":"dialog","aria-expanded":pr.open,onClick:()=>pr.setOpen(te=>!te),children:f.jsx(F3n,{size:16})}),pr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:Y2()}),f.jsx(T8n,{})]})]}),f.jsx("input",{ref:nn,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:te=>{Zs(Array.from(te.target.files??[])),te.target.value=""}}),f.jsx($t,{type:"button",className:"composer-attach",title:iN(),"aria-label":iN(),onClick:()=>{var te;return(te=nn.current)==null?void 0:te.click()},children:f.jsx(x3n,{size:16})}),Bu&&f.jsxs(De,{type:"button",variant:"ghost",active:!0,className:"group max-w-60",title:lN({goal:Wi(Bu)}),"aria-label":lN({goal:Wi(Bu)}),onClick:()=>void Ga("clear"),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(HI,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(lr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{className:"truncate",children:$we()})]}),bo&&f.jsxs(De,{type:"button",variant:"ghost",active:!0,className:"group",title:pN(),"aria-label":pN(),onClick:()=>void Pu(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(J4n,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(lr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:i3e()})]}),Fs&&f.jsxs(De,{type:"button",variant:"ghost",active:!0,className:"group",title:hN(),"aria-label":hN(),onClick:Zh,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(vf,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(lr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:SD()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx(mkn,{value:Bt,onSelect:Ha,onOpenSettings:()=>a("harnesses"),permissionChoices:st!=null&&st.agentReady?(Wt==null?void 0:Wt.permissionModes)??[]:[],defaultPermissionId:(Wt==null?void 0:Wt.defaultPermissionMode)??null,onSelectPermission:qa,reasoningChoices:st!=null&&st.agentReady?zs.choices:[],defaultReasoningId:zs.defaultId,onSelectReasoning:$u,lockHarness:!!Vt,openRequest:sr}),f.jsx(CDn,{usage:Vt==null?void 0:Vt.contextUsage})]}),ir&&!vi?f.jsx($t,{className:"send-btn",variant:"stop",title:EN(),"aria-label":EN(),onClick:Eo,children:f.jsx(lr,{size:16})}):f.jsx($t,{className:`send-btn ${kl&&(st!=null&&st.agentReady)?"ring-2 ring-primary ring-offset-2 ring-offset-background":""}`,variant:"primary",title:Fs?kN():o3(),"aria-label":Fs?kN():o3(),onClick:()=>void(Fs?Sl():Co()),disabled:Fs?!Js||!Z&&!(st!=null&&st.agentReady):!(st!=null&&st.agentReady)||!ce.trim()&&Ke.length===0&&pe.length===0,children:f.jsx(BI,{size:16})})]})]})]})]})]})}const jR="flex items-center gap-2.5 mb-2.5 py-2 ps-3.5 pe-2 rounded-lg border border-border bg-surface text-text text-sm leading-normal",WLn=[],QLn=[];function Aa({className:e,...n}){return f.jsx("div",{className:bs("relative flex min-h-0 flex-1 flex-col",e),...n})}function Hd({className:e,...n}){return f.jsx("div",{className:bs("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Vo({className:e,...n}){return f.jsx("div",{className:bs("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const TR=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function XLn({projectId:e,sessionId:n,spawnPartId:t,onOpenFile:r,onOpenRun:s,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:c}){var k;const u=ct(il(n)),h=((k=u.data)==null?void 0:k.messages)??(u.isError?[]:null),_=A.useRef(null),p=A.useRef(null),m=A.useRef(!0);if(A.useLayoutEffect(()=>{m.current=!0;const v=_.current;v&&(v.scrollTop=v.scrollHeight)},[n,t]),A.useLayoutEffect(()=>{const v=_.current;v&&m.current&&(v.scrollTop=v.scrollHeight)},[h]),A.useEffect(()=>{const v=_.current,b=p.current;if(!v||!b)return;const w=new ResizeObserver(()=>{m.current&&(v.scrollTop=v.scrollHeight)});return w.observe(b),w.observe(v),()=>w.disconnect()},[h===null]),h===null)return f.jsx(Aa,{children:f.jsx("div",{className:TR,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:Ifn()})})});let x=null;for(const v of h)if(x=cb(v.parts,t),x)break;return f.jsx(Aa,{children:f.jsx("div",{className:TR,ref:_,onScroll:v=>{const b=v.currentTarget;m.current=b.scrollHeight-b.scrollTop-b.clientHeight<60},children:f.jsx("div",{ref:p,children:x?f.jsx(oH,{projectId:e,sessionId:n,children:f.jsx(DLn,{spawn:x,onOpenFile:r,onOpenRun:s,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:c})}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:Ufn()})})})})}function YLn({experiment:e}){var s;const n=ct(V$(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(Hd,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Vo,{children:[Ohe()," ",Ne(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(RB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(OB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?Whe():Nhe()}):f.jsx(Vo,{children:Fhe()})})}function GH({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:c}){return f.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:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":ANe(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:$Ne()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:AD()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(Nm,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(Lh,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(qb,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx($t,{title:AN(),"aria-label":AN(),onClick:c,children:o?f.jsx(Nt,{}):f.jsx(z3n,{size:13})})]})}const ZLn=/\.(md|mdx|markdown)$/i,JLn=/\.tex$/i,eIn=/\.html?$/i,tIn=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,nIn=/\.(csv|tsv|xlsx?|ods)$/i,rIn=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,sIn=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,iIn=/\.pdf$/i,aIn=/\.(docx?|log|rtf|txt)$/i;function oIn(e){return tIn.test(e)}function hC(e){return ZLn.test(e)}function VH(e){return JLn.test(e)}function cIn(e){return eIn.test(e)}function Nh({name:e}){const n=hC(e)?"markdown":oIn(e)?"image":nIn.test(e)?"spreadsheet":rIn.test(e)?"code":sIn.test(e)?"archive":iIn.test(e)?"pdf":aIn.test(e)||VH(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.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"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.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"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.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 ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function KH(e,n){const t=navigator.clipboard;if(!t){bn(DD(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>bn(K_(),"success")).catch(r=>bn(r instanceof Error?r.message:String(r),"error"))}function WH({name:e,onCommit:n,onCancel:t}){const[r,s]=A.useState(e),i=A.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(qr,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":iBe({path:Ne(e)}),onFocus:o=>{const c=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,c>0?c:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function QH(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function XH({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=A.useRef(null),c=A.useRef(a);c.current=a;const[u,h]=A.useState({x:e.x,y:e.y});A.useLayoutEffect(()=>{var k;const m=o.current;if(!m)return;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;return h({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(k=m.querySelector("button"))==null||k.focus(),()=>{m.contains(document.activeElement)&&(x==null||x.focus())}},[e]),A.useEffect(()=>{const m=()=>c.current(),x=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||c.current()},k=v=>{if(v.key==="Tab"){v.preventDefault(),c.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),c.current())};return document.addEventListener("pointerdown",x),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",k,!0),()=>{document.removeEventListener("pointerdown",x),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",k,!0)}},[]);const _=m=>{c.current(),m()},p=(m,x,k=!1)=>f.jsx(Jn,{size:"compact",role:"menuitem",danger:k,onClick:()=>_(x),children:f.jsx("span",{children:m})});return Mi.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":G$e({path:Ne(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,w;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const x=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],k=x.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:x[0]),v=m.key==="ArrowDown"?1:-1;(w=x[(k+v+x.length)%x.length])==null||w.focus()},children:[p(Z$e(),n),t&&p(ED(),t),r&&p($$e(),r),p(Efe(),s),i&&p(CD(),i,!0)]}),document.body)}const Z5=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),AR=["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 RR(){return{dirs:new Map,files:[]}}function YH(e){const n=RR();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(rc,{size:13,className:AR}):f.jsx(Ba,{size:13,className:AR}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(pC,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:c,onRename:u,onCancelRename:h})]})}function pC({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:c,onCancelRename:u}){const h=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),_=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[h.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(lIn,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:c,onCancelRename:u},`d:${m}`)}),_.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&c&&u)return f.jsxs("div",{className:Z5,style:{paddingInlineStart:8+t*14},children:[f.jsx(Nh,{name:p}),f.jsx(WH,{name:p,onCommit:k=>c(m,k),onCancel:u})]},`f:${m}`);const x=Ur(k=>i(m,k));return f.jsxs("button",{type:"button",className:Z5,style:{paddingInlineStart:8+t*14},...x,onContextMenu:k=>{o&&(k.preventDefault(),o(k,m))},onKeyDown:k=>{if(o&&(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10")){k.preventDefault(),o(k,m);return}x.onKeyDown(k)},title:EY({name:Ne(m)}),children:[f.jsx(Nh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function uIn({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var N,z;const c=t.branchName,u=ct({...W$(e,{ref:c}),enabled:r==="files",subscribed:r==="files"}),h=ct({...qv(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),_=u.data,p=(N=u.error)==null?void 0:N.message,m=u.isFetching,x=V$(t.id),k=rK({queryKey:x.queryKey})>0,v=(z=h.data)!=null&&z.exists&&h.data.branch===c?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},w=A.useMemo(()=>_?YH(_.entries):null,[_]),y=r==="files"?m:k,C=A.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(GH,{view:r,onViewChange:i,branchLabel:c,branchTitle:`Committed branch ${c}`,githubHref:n.githubEnabled?Mb(n.githubOwner,n.githubRepo,c):void 0,githubTitle:vD({branch:Ne(c)}),refreshing:y,onRefresh:()=>r==="files"?b():void et.invalidateQueries(x)}),r==="changes"?f.jsx(YLn,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(_==null?void 0:_.truncated)&&f.jsx(Vo,{children:YNe()}),p&&w&&f.jsxs(Vo,{children:[_ze()," ",Ne(p)]}),f.jsx(Hd,{children:w?w.dirs.size===0&&w.files.length===0?f.jsx(Vo,{children:sze()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(pC,{node:w,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,c,j)})}):f.jsx(Vo,{children:p?Vk({error:Ne(p)}):Kk()})})]})]})}function mC({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function _In({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var B,L,F;const c=n.id,h=((B=ct(La(c)).data)==null?void 0:B.some(U=>U.id===e&&U.busy))??!1,_=ct({...qv(e??""),enabled:!!e,refetchInterval:h?5e3:!1}),p=_.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},x=ct({...W$(c,m),enabled:!e||_.isSuccess,refetchInterval:h?5e3:!1}),k=x.data,v=(L=_.error??x.error)==null?void 0:L.message,b=_.isFetching||x.isFetching,[w,y]=A.useState(null),[C,N]=A.useState(null),z=A.useCallback(()=>{e&&et.invalidateQueries(qv(e)),et.invalidateQueries({queryKey:zt("getCodeTree",c),predicate:U=>!uD(U)})},[e,c]),T=A.useRef(h);A.useEffect(()=>{T.current&&!h&&z(),T.current=h},[h,z]);const j=A.useMemo(()=>k?YH(k.entries):null,[k]),M=A.useCallback(U=>{const K=new Set(r);K.has(U)?K.delete(U):K.add(U),i(K)},[r,i]),D=e&&(p!=null&&p.exists)?p:null,I=(D==null?void 0:D.branch)??(D!=null&&D.baselineBranch?Q1n({branch:Ne(D.baselineBranch)}):Jk()),$=((F=D==null?void 0:D.files)==null?void 0:F.length)??0,q=D?D1n({branch:Ne(`${I}${$>0?"*":""}`)}):H1n({branch:Ne(n.baselineBranch)}),H=D?D.branch:n.baselineBranch,Q=(U,K)=>D?a(U,e,void 0,K):a(U,void 0,n.baselineBranch,K),V=(k==null?void 0:k.root)==="worktree",J=async(U,K)=>{try{await obn(c,U,K,{sessionId:e}),z()}catch(ne){bn(ne instanceof Error?ne.message:String(ne),"error")}},Z=U=>{const K=(k==null?void 0:k.path)??n.repoPath;KH(K,U)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(GH,{view:D?t:"files",onViewChange:s,showViewToggle:!!D,branchLabel:q,branchTitle:q,githubHref:n.githubEnabled&&H?Mb(n.githubOwner,n.githubRepo,H):void 0,githubTitle:H?vD({branch:Ne(H)}):void 0,refreshing:b,onRefresh:z}),v&&(p||k)&&f.jsxs(Vo,{children:[Tvn()," ",Ne(v)]}),!k||e&&!p?f.jsx(Hd,{children:f.jsx(Vo,{children:v?Vk({error:Ne(v)}):Kk()})}):D&&t==="changes"?f.jsx(Hd,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!D.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:mvn()}):f.jsxs(f.Fragment,{children:[D.diff.truncated&&f.jsx(RB,{bytesRead:D.diff.bytesRead,byteLimit:D.diff.byteLimit}),f.jsx(OB,{diff:D.diff.diff,partial:D.diff.truncated})]})}):f.jsxs(Hd,{children:[k.truncated&&f.jsx(Vo,{children:nvn()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(mC,{icon:Su,title:kvn(),description:jGe()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(pC,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Q,renamingPath:C,onContextMenu:(U,K)=>{y(QH(U,K))},onRename:(U,K)=>{N(null),J(U,{action:"rename",newName:K})},onCancelRename:()=>N(null)})}):f.jsx(Vo,{children:lvn()})]}),w&&f.jsx(XH,{target:w,onOpen:()=>Q(w.path,"keepOpen"),onRename:V&&o(w.path)?()=>N(w.path):void 0,onDuplicate:V?()=>void J(w.path,{action:"duplicate"}):void 0,onCopyPath:()=>Z(w.path),onDelete:V?()=>{window.confirm(A$e({path:Ne(w.path)}))&&J(w.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function ZH({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=A.useMemo(()=>{if(!e)return[];const h=e.replace(/\r\n?/g,` -`),_=$$(h,RS(n));return h.endsWith(` -`)?_.slice(0,-1):_},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=A.useRef(null);A.useEffect(()=>{var h;r!==void 0&&(a?((h=o.current)==null||h.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:c}=y$(i.length),u=A.useMemo(()=>i.map((h,_)=>f.jsxs("div",{ref:_+1===a?o:void 0,className:`file-view-line flex items-stretch ${_+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":_+1,className:`${b$} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${c}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${Fv} ${v$}`,children:B$(h)?f.jsx("br",{}):h})]},_)),[i,c,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${Fv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${c}ch`},"aria-hidden":"true"}),u]})}const fIn="modulepreload",dIn=function(e){return"/"+e},MR={},hIn=function(n,t,r){let s=Promise.resolve();if(t&&t.length>0){let a=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=a(t.map(u=>{if(u=dIn(u),u in MR)return;MR[u]=!0;const h=u.endsWith(".css"),_=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${_}`))return;const p=document.createElement("link");if(p.rel=h?"stylesheet":fIn,h||(p.as="script"),p.crossOrigin="",p.href=u,c&&p.setAttribute("nonce",c),document.head.appendChild(p),h)return new Promise((m,x)=>{p.addEventListener("load",m),p.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return n().catch(i)})},lb=A.createContext(null);function pIn({url:e,name:n}){return f.jsx(Lh,{size:"small",href:e,download:n,"aria-label":Sv({name:Ne(n)}),"data-tip":Sv({name:Ne(n)}),"data-tip-align":"end",children:f.jsx(Db,{size:13})})}const mIn=A.lazy(()=>hIn(()=>import("./PdfPreview-zPnQv7In.js"),__vite__mapDeps([0,1])).catch(e=>(console.error("PDF viewer failed to load",e),{default:eq})));function JH(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function eq({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[ftt()," ",f.jsxs("a",{href:e,download:n,children:[l3()," ",Ne(n)]})]})}function J5({kind:e,url:n,name:t,download:r=!0}){const[s,i]=A.useState(!1),a=A.useContext(lb);if(A.useEffect(()=>i(!1),[e,n]),s)return f.jsx(eq,{url:n,name:t});let o;return e==="image"?o=f.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:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?o=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?o=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):o=f.jsx(A.Suspense,{fallback:f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center",children:f.jsx(Nt,{})}),children:f.jsx(mIn,{url:n,name:t,download:r,onError:()=>i(!0)},n)}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[o,r&&e!=="pdf"&&a&&Mi.createPortal(f.jsx(pIn,{url:n,name:t}),a)]})}const gIn=e=>({queryKey:zt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function tq(e,n=!0){return ct({...gIn(e),enabled:n,subscribed:n}).data??null}function vIn(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function bIn(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),c=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const h=u.join("/");if(!h)return null;const _=new URLSearchParams(c);_.delete("path");const p=_.toString();return{path:h,url:`${X_(e,h)}${p?`&${p}`:""}${i}`}}function yIn(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` ----`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const nq="orx:files-tree-width",rq="orx:artifacts-collapsed:",sq=180,iq=320,xIn=8,wIn=280;function kIn(){try{const e=Number(localStorage.getItem(nq));if(Number.isFinite(e)&&e>=sq&&e<=iq)return e}catch{}return wIn}function SIn(e){try{const n=localStorage.getItem(`${rq}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function W0(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=W0(t.children??[],n);if(r)return r}}return null}function aq({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(vIn(i))return i;const a=bIn(e,n,i);if(!a)return null;const o=W0(r,a.path);if(!o)return a.url;const c=a.url.indexOf("#"),u=c===-1?a.url:a.url.slice(0,c),h=c===-1?"":a.url.slice(c);return`${u}&v=${o.modifiedAt}:${o.size}${h}`};return f.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-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_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-prose-emphasis [&_.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-sm [&_.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]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_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-start [&_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-start [&_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]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-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-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_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:f.jsx(rjn,{remarkPlugins:[nH,[rH,lH]],rehypePlugins:[AF],components:{a:({href:i,children:a,...o})=>{const c=!i||i.startsWith("#"),u=c?i:s(i);return u?f.jsx("a",{...o,href:u,...c?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...uH},children:iH(yIn(t))})})}function CIn(e){return e.presentation==="text"&&hC(e.name)?"markdown":JH(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function EIn(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=QL,i=f6(e,n.path),a=ct({...i,enabled:s,subscribed:s}),o=A.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});A.useEffect(()=>{const h=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&h.projectId===e&&h.path===n.path&&(h.modifiedAt!==n.modifiedAt||h.size!==n.size||h.version!==null&&h.version!==r)&&et.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const c=a.data;return{text:c&&!c.binary?c.content:null,binary:(c==null?void 0:c.binary)??!1,truncated:(c==null?void 0:c.truncated)??!1,error:c?null:((u=a.error)==null?void 0:u.message)??(c===null?Mfe():null),wantsText:s}}function NIn({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=CIn(n),i=tq(X_(e,n.path)),{text:a,binary:o,truncated:c,error:u,wantsText:h}=EIn(e,n,s,i),[_,p]=A.useState(!1),[m,x]=A.useState(null),k=s==="markdown",v=n.path.split("/").slice(0,-1).join("/"),b=`${X_(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let w;return s==="image"||s==="audio"||s==="video"||s==="pdf"?w=f.jsx(lb.Provider,{value:m,children:f.jsx(J5,{kind:s,url:b,name:n.name})}):s==="download"||!h||o?w=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?bfe():yhe()," ",f.jsx("a",{href:b,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?LD():Pfe()})]}):u?w=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[dde()," ",Ne(u)]}):a===null?w=f.jsxs(Gr,{children:[f.jsx(Nt,{})," ",wD()]}):k&&!_?w=f.jsx(aq,{projectId:e,folder:v,markdown:a,entries:r}):w=f.jsx(ZH,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head @container flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Nh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0 @max-xl:hidden",children:[Kde()," ",new Date(n.modifiedAt).toLocaleString(E(),{dateStyle:"medium",timeStyle:"short"})]}),f.jsx("div",{ref:x,className:"contents"}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:el(n.size)}),k&&f.jsx($t,{size:"small",active:_,"data-tip":_?Ev():Nd(),"data-tip-align":"end","aria-label":_?Ev():Nd(),onClick:()=>p(y=>!y),children:f.jsx($3,{size:13})}),f.jsx(Lh,{size:"small",href:b,target:"_blank",rel:"noopener noreferrer","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),children:f.jsx(Z_,{size:13})}),f.jsx($t,{size:"small","data-tip":XE(),"data-tip-align":"end","aria-label":XE(),onClick:()=>{window.confirm(qk({path:Ne(n.path)}))&&t(n.path)},children:f.jsx(bf,{size:13})})]}),f.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 ${k&&!_?"doc":""}`,children:[w,c&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:yde()})]})]})}function oq({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:h,onCancelRename:_}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var x;const m={paddingInlineStart:8+Math.min(n,xIn)*14};if(p.isDir){const k=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.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-start cursor-pointer font-[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:m,onClick:()=>s(p.path),children:[f.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":k?V_e({name:Ne(p.name)}):ffe({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ba,{size:13,className:k?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx($t,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":ade(),"data-tip-align":"end","aria-label":ife({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(qk({path:Ne(p.path)}))&&o(p.path)},children:f.jsx(bf,{size:12})})]}),k&&(((x=p.children)==null?void 0:x.length)??0)>0&&f.jsx(oq,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:h,onCancelRename:_})]},p.path)}return c===p.path?f.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-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Nh,{name:p.name}),f.jsx(WH,{name:p.name,onCommit:k=>h(p.path,k),onCancel:_})]},p.path):f.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-start cursor-pointer font-[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===p.path?"selected":""}`,style:m,title:BQ({path:Ne(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:k=>{k.preventDefault(),i(p.path),u(k,p.path)},onAuxClick:k=>{k.button===1&&(k.preventDefault(),i(p.path),a(p.path))},onKeyDown:k=>{if(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10"){k.preventDefault(),i(p.path),u(k,p.path);return}if(k.key===" "){k.preventDefault(),k.stopPropagation(),i(p.path);return}k.key==="Enter"&&(k.preventDefault(),k.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Nh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function zIn({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=A.useState(null),[a,o]=A.useState(()=>SIn(e.id)),[c,u]=A.useState(kIn),[h,_]=A.useState(null),[p,m]=A.useState(null),x=A.useRef(null);A.useEffect(()=>{try{localStorage.setItem(`${rq}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const k=z=>{var I;z.preventDefault(),z.currentTarget.setPointerCapture(z.pointerId);const T=(I=x.current)==null?void 0:I.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const q=Math.round($.clientX-((T==null?void 0:T.left)??0)),H=Math.min(Math.max(q,sq),iq);u(H);try{localStorage.setItem(nq,String(H))}catch{}},D=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",D),window.removeEventListener("pointercancel",D),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",D),window.addEventListener("pointercancel",D)};A.useEffect(()=>{if(!s||!n)return;const z=W0(n.entries,s);(!z||z.isDir)&&i(null)},[s,n]);const v=z=>o(T=>{const j=new Set(T);return j.has(z)?j.delete(z):j.add(z),j}),b=z=>{(s===z||s!=null&&s.startsWith(z+"/"))&&i(null),dyn(e.id,z).catch(()=>{})},w=async(z,T)=>{try{await hyn(e.id,z,T),T.action==="rename"&&s===z&&i(null)}catch(j){bn(j instanceof Error?j.message:String(j),"error")}},y=z=>{n&&KH(n.dir,z)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(Gr,{className:"p-5",children:[f.jsx(Nt,{})," ",Pde()]})});const C=z=>f.jsx(oq,{entries:z,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{_(QH(T,j))},onRename:(T,j)=>{m(null),w(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),N=s?W0(n.entries,s):null;return n.entries.length===0?f.jsx(mC,{icon:gS,title:ehe(),description:dhe()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:x,style:{width:c},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:k}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:Nde()})]})]}),N?f.jsx(NIn,{projectId:e.id,entry:N,onDelete:b,artifactEntries:n.entries},N.path):f.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-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(m3n,{size:22,strokeWidth:1.5}),f.jsx("span",{children:Kfe()})]}),h&&f.jsx(XH,{target:h,onOpen:()=>t(h.path),onRename:r(h.path)?()=>m(h.path):void 0,onDuplicate:()=>void w(h.path,{action:"duplicate"}),onCopyPath:()=>y(h.path),onDelete:()=>{window.confirm(qk({path:Ne(h.path)}))&&b(h.path)},onClose:()=>_(null)})]})}const cq=20*1024*1024,lq="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-base [&_h3]:font-semibold [&_h3]:text-text",uq="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",jIn="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",TIn="text-sm font-normal text-text",AIn="mt-1 mb-0 text-sm leading-relaxed text-text";function _q(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function RIn(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function fq({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=A.useState(!1),a=A.useRef(null);return f.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 text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const c=(u=o.dataTransfer.files)==null?void 0:u[0];c&&r(c)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var c;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(c=a.current)==null||c.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const c=(u=o.target.files)==null?void 0:u[0];c&&r(c),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(Nt,{}),f.jsx("span",{children:rcn()})]}):f.jsxs(f.Fragment,{children:[f.jsx(G3n,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function dq({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[el(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",co(n)]})]})}function MIn({skill:e,onError:n}){const t=an({mutationFn:Iyn}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:TIn,children:e.name}),e.origin&&f.jsx(Gt,{size:"small",children:e.origin})]}),f.jsx(dq,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx($t,{size:"small","data-tip":e.origin?aan():ton(),"data-tip-align":"end","aria-label":e.origin?yan({name:Ne(e.name)}):Zsn({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?dan({name:Ne(e.name)}):Gsn({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(bf,{size:13})})]})}function OIn({template:e,onError:n}){const t=an({mutationFn:Oyn}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:jIn,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:AIn,children:[e.entry,s>0&&(s===1?Vin():Nan({count:Xt(s)}))]})]}),f.jsx(dq,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx($t,{"data-tip":con(),"data-tip-align":"end","aria-label":fin({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(iin({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(bf,{size:13})})]})}function DIn(){var w;const e=an({mutationFn:Lyn}),n=ct(zxn()),t=n.data,r=A.useRef(null),[s,i]=A.useState(!1),[a,o]=A.useState(!1),c=A.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);A.useLayoutEffect(()=>{c();const y=r.current;if(!y)return;const C=new ResizeObserver(c);return C.observe(y),()=>C.disconnect()},[t,c]);const u=n.isFetching,h=(w=n.error)==null?void 0:w.message,[_,p]=A.useState(!1),[m,x]=A.useState(null),k=()=>{n.refetch()},v=A.useRef(!1),b=A.useCallback(async y=>{if(!v.current){if(x(null),!RIn(y.name)){x(gcn());return}if(y.size>cq){x(RL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await _q(y)})}catch(C){x(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:lq,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:Xon()}),f.jsxs(De,{className:"ms-auto",size:"small",onClick:k,disabled:u,children:[f.jsx(Pa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Sm()]})]}),f.jsx("p",{className:uq,children:bin()}),f.jsx(fq,{accept:".md,.markdown,.zip",busy:_,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Ein()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:$sn()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),h&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[Oan()," ",h]}),t===void 0?h?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(Nt,{})," ",won()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Lon()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:c,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(MIn,{skill:y,onError:x},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function LIn(){var h;const e=an({mutationFn:Myn}),n=ct(Nxn()),t=n.data,r=(h=n.error)==null?void 0:h.message,[s,i]=A.useState(!1),[a,o]=A.useState(null),c=A.useRef(!1),u=A.useCallback(async _=>{if(c.current)return;o(null);const p=_.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(Scn());return}if(_.size>cq){o(RL());return}c.current=!0,i(!0);try{await e.mutateAsync({filename:_.name,contentBase64:await _q(_)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{c.current=!1,i(!1)}},[]);return f.jsxs("section",{className:lq,children:[f.jsx("h3",{children:pon()}),f.jsx("p",{className:uq,children:ucn()}),f.jsx(fq,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Min()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:_dn()})]}),onFile:_=>void u(_)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[Fan()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(Nt,{})," ",jon()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:qon()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(_=>f.jsx(OIn,{template:_,onError:o},_.name))})]})}function IIn(){return f.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:[f.jsx("h1",{children:Wan()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:Jin()}),f.jsx(DIn,{}),f.jsx(LIn,{})]})}const $In="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Fc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-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-hover-strong [&_.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-0 [&: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]:-start-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]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?$In:""}`,onClick:i,onDoubleClick:a,title:s?sdn({label:n}):n,"aria-label":s?Yfn({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:vNe(),onPointerDown:c=>c.preventDefault(),onClick:c=>{c.stopPropagation(),o()},children:f.jsx(lr,{size:12})})]})}const OR=["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 BIn({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:OR,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:OR,href:Mb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:Cv({name:Ne(t)}),children:[f.jsx("code",{children:t}),f.jsx(qb,{size:12})]})}const b4=["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-sm","[&_h2]:font-semibold"].join(" "),DR=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function LR(e){return new Date(e).toLocaleString(E(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function IR(e,n){return A0((e.endedAt??n)-e.createdAt)}function PIn({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(h=>h.status==="running"||h.status==="starting"),[c,u]=A.useState(()=>Date.now());return A.useEffect(()=>{if(!o)return;u(Date.now());const h=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(h)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.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:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx(al,{status:a?Zi(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(De,{...Ur(h=>s(a.id,h)),children:[f.jsx(lo,{size:15}),tLe()]}),f.jsxs(De,{...Ur(i),children:[f.jsx(Ib,{size:15}),aDe()]})]}),e.description&&f.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-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:NDe()}),f.jsx(Jo,{text:e.description})]}),f.jsxs("section",{className:b4,children:[f.jsx("h2",{children:a?JOe():jLe()}),a&&f.jsxs(f.Fragment,{children:[f.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:[f.jsx(al,{status:Zi(a)}),f.jsx(AS,{backend:a.backend}),f.jsxs("span",{title:wLe(),children:[f.jsx(t4n,{size:13}),LR(a.createdAt)]}),f.jsxs("span",{title:ODe(),children:[f.jsx(h4n,{size:13}),IR(a,c)]}),a.commitSha&&f.jsxs("span",{title:dDe(),children:[f.jsx(U4n,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[FDe()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:DR,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(Jo,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:b4,children:[f.jsx("h2",{children:"Git"}),f.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:[f.jsx(BIn,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[WDe()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:LR(e.createdAt),children:[yDe()," ",co(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:DR,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:b4,children:[f.jsx("h2",{children:pLe()}),f.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-start [&_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((h,_)=>f.jsxs("button",{...Ur(p=>s(h.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[cLe()," ",r.length-_]}),f.jsx(al,{status:Zi(h)}),f.jsx("span",{children:co(h.createdAt)}),f.jsx("span",{children:IR(h,c)}),f.jsx(lo,{size:13})]},h.id))})]})]})})}function $R(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=Bb(t,!0);let i=!1,a=0,o=!1,c=!1;async function u(){if(o){c=!0;return}o=!0;try{for(;;){const _=await tbn(e,a);if(i)return;if(_.dataBase64&&r.write($R(_.dataBase64)),a=_.nextOffset,_.eof)break}}catch{}finally{o=!1,c&&!i&&(c=!1,u())}}const h=Lxn(e,_=>{if(i)return;const p=$R(_.dataBase64);!o&&_.offset===a?(r.write(p),a+=p.length):_.offset+p.length>a&&u()});return u(),()=>{i=!0,h(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function HIn({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:c}){const u=r.filter(h=>h.experimentId===e.id).sort((h,_)=>_.createdAt-h.createdAt);return t==="overview"?f.jsx(PIn,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(h,_)=>o("terminal",h,_),onOpenCode:h=>c("files",h)}):f.jsx(qIn,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function qIn({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=A.useState(null),[a,o]=A.useState(null),[c,u]=A.useState(!1),h=A.useRef(null),_=t?n.find(v=>v.id===t)??null:n[0]??null,p=(_==null?void 0:_.status)==="running"||(_==null?void 0:_.status)==="starting",m=!!(_&&p&&(_.cancelRequested||a===_.id)),x=v=>{const b=n.findIndex(w=>w.id===v);return b===-1?n.length:n.length-b};A.useEffect(()=>{if(!c)return;const v=b=>{var w;(w=h.current)!=null&&w.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c]);async function k(){if(_){i(null),o(_.id);try{await FL(_.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.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:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(De,{size:"small",variant:"ghost",disabled:m,onClick:()=>void k(),children:[f.jsx(II,{size:13}),m?vze():MD()]}),n.length>0&&_&&f.jsxs("div",{className:"run-history relative shrink-0",ref:h,children:[f.jsxs(De,{title:UMe(),"aria-expanded":c,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[RN()," ",x(_.id)]}),f.jsx(al,{status:m?"cancelling":Zi(_)}),f.jsx(rc,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),c&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(Jn,{className:"justify-start",active:v.id===(_==null?void 0:_.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[RN()," ",x(v.id)]}),f.jsx(al,{status:Zi(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:co(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:_?f.jsx(FIn,{runId:_.id},_.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?ro():AMe()})})]})}let ek=!1;function BR(e){ek=!0;try{return window.confirm(e)}finally{ek=!1}}const tk=e=>e.replace(/\r\n/g,` -`),PR=(e,n,t)=>{const r=tk(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r -`),conflict:null}},Gc=e=>e.draft!==e.baseline,UIn=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),GIn=e=>e.crlf?e.draft.replace(/\n/g,`\r -`):e.draft;function VIn(e,n,t){return!Gc(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class KIn{constructor(){Hs(this,"buffer",null);Hs(this,"listeners",new Set);Hs(this,"saving",!1);Hs(this,"saveError",null);Hs(this,"revision",0);Hs(this,"saveRevision",0);Hs(this,"getSnapshot",()=>this.buffer);Hs(this,"getRevision",()=>this.revision);Hs(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Hs(this,"set",n=>{this.buffer=n,this.notify()});Hs(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Hs(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Hs(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Gc(this.buffer)||this.buffer.conflict!==null)}}function WIn({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var J,Z,B;const c=ct({...hSn(),enabled:r,subscribed:r}),u=((J=c.data)==null?void 0:J.engine)??(c.isPending?void 0:null),h=((Z=c.data)==null?void 0:Z.hint)??null,_=((B=c.data)==null?void 0:B.installCommand)??null,[p,m]=A.useState(!1),[x,k]=A.useState(null),[v,b]=A.useState(null),[w,y]=A.useState(!1),[C,N]=A.useState(null),[z,T]=A.useState(null),[j,M]=A.useState(!1),[D,I]=A.useState(0),$=A.useCallback(L=>{M(L),L&&I(F=>F+1)},[]),q=A.useRef(o);q.current=o;const H=A.useRef(!1),Q=A.useRef(null),V=A.useCallback(()=>{if(H.current)return;Q.current=n,H.current=!0,m(!0);const L=q.current;T(null),b(null),N(null),_bn(e,n,{sessionId:t}).then(F=>{var K,ne;const U=F.pdfPath;if(F.ok&&U){k(ce=>({path:U,version:((ce==null?void 0:ce.version)??0)+1,source:L})),y(F.hadErrors),N(F.note),F.hadErrors&&b(((K=F.log)==null?void 0:K.trim())||null),$(!0);return}k(null),y(!1),N(F.note),M(!1),b(((ne=F.log)==null?void 0:ne.trim())||CZe())}).catch(F=>{k(null),y(!1),N(null),M(!1),T(F instanceof Error?F.message:String(F))}).finally(()=>{H.current=!1,m(!1)})},[e,n,t,$]);return A.useEffect(()=>{!r||!s||!a||!u||Q.current!==n&&V()},[r,s,a,u,n,V]),{engine:u,installHint:h,installCommand:_,compiling:p,compiled:x,stale:x!==null&&x.source!==o,log:v,builtWithErrors:w,note:C,error:z,showPdf:j,setShowPdf:$,viewNonce:D,compile:()=>{i==null||i(),V()},dismiss:()=>{T(null),b(null)}}}const QIn=3e4,XIn=3e4,YIn=5*6e4;function ZIn({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:c}){var _e,se,G,oe;const u=A.useMemo(()=>mSn(e,n,{sessionId:t}),[e,n,t]),h=ct({...u,enabled:r,subscribed:r}),_=((_e=h.data)==null?void 0:_e.hasToken)??!1,p=((se=h.data)==null?void 0:se.hasSession)??!1,m=((G=h.data)==null?void 0:G.link)??null,x=!h.isPending,[k,v]=A.useState(null),[b,w]=A.useState(0),[y,C]=A.useState(!1),[N,z]=A.useState(null),[T,j]=A.useState(null),[M,D]=A.useState(!1),I=A.useCallback(le=>{Dn(u.queryKey)&&et.setQueryData(u.queryKey,pe=>pe&&{...pe,hasSession:le})},[u]),$=A.useCallback(le=>{Dn(u.queryKey)&&et.setQueryData(u.queryKey,le)},[u]);A.useEffect(()=>{z(null),w(0),L.current=!1,j(null),D(!1),V.current=!1},[r,e,n,t]),A.useEffect(()=>{D(!1)},[a]);const q=A.useRef(!1),H=A.useRef(c);H.current=c;const Q=A.useRef(o);Q.current=o;const V=A.useRef(!1),J=A.useCallback(le=>!_||!m||q.current||Q.current?!1:(q.current=!0,C(!0),j(null),xbn(e,n,{sessionId:t,resolve:le}).then(pe=>{V.current=!1,z(pe),pe.pulled.includes(n)&&(Q.current?D(!0):H.current(pe.pulled))}).catch(pe=>{V.current=!0,z(null),j(pe instanceof Error?pe.message:String(pe))}).finally(()=>{q.current=!1,C(!1)}),!0),[e,n,t,_,m]),Z=A.useRef(null),B=(k==null?void 0:k.state)==="live";A.useEffect(()=>{if(!r||!s||!x||!_||!m||o||B)return;const le=`${n}:${m.projectId}:${a}`;Z.current!==le&&J()&&(Z.current=le)},[r,s,x,_,m,n,a,o,y,J,B]);const L=A.useRef(!1);!y&&N&&N.conflicts.length===0&&!T&&(L.current=!0);const F=r&&x&&!!m&&_&&p&&L.current,U=A.useRef(null),K=A.useRef(Promise.resolve()),ne=A.useRef(!1);ne.current=(k==null?void 0:k.state)==="stopped"&&k.error!=null;const ce=A.useRef(!1);return A.useEffect(()=>{if(!F)return;let le=!1;const pe=()=>{const Me=ce.current;ce.current=!1,!(!Me&&ne.current)&&(K.current=K.current.then(()=>{if(!le)return mbn(e,n,{sessionId:t,retry:Me}).then(Le=>{var Ke;le||((U.current===null||((Ke=Le.status)==null?void 0:Ke.state)==="stopped")&&v(Le.status),U.current=Le.key)}).catch(Le=>{le||v({state:"stopped",error:Le instanceof Error?Le.message:String(Le),needsSession:!1,note:null})})}))};pe();const be=setInterval(pe,XIn);return()=>{le=!0,clearInterval(be),U.current=null,v(null),K.current=K.current.then(()=>gbn(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),A.useEffect(()=>Hxn(le=>{if(le.key===U.current){if(le.type==="live"){v(le.status);return}le.paths.includes(n)&&(Q.current?D(!0):H.current(le.paths))}}),[n]),A.useEffect(()=>{if(!r||!s||!x||!_||!m||o||B)return;const le=setInterval(()=>{q.current||V.current||et.fetchQuery({...gSn(e,n,{sessionId:t}),staleTime:0}).then(pe=>{pe.remoteChanged&&J()}).catch(pe=>{V.current=!0,j(pe instanceof Error?pe.message:String(pe))})},QIn);return()=>clearInterval(le)},[r,s,x,_,m,o,e,n,t,J,B]),A.useEffect(()=>{if(!r||!s||!x||!_||!m||!B)return;const le=setInterval(J,YIn);return()=>clearInterval(le)},[r,s,x,_,m,B,J]),{hasToken:_,hasSession:p,live:k,retryLive:()=>{ce.current=!0,w(le=>le+1)},link:m,loaded:x,syncing:y,last:N,error:T??((oe=h.error)==null?void 0:oe.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>D(!1),uploadUrl:kbn(e,n,{sessionId:t}),saveToken:async le=>{const pe=await qL(le);Z.current=null,V.current=!1,j(null),Dn(u.queryKey)&&et.setQueryData(u.queryKey,be=>be&&{...be,hasToken:pe.hasToken})},saveSession:async le=>{const pe=await UL(le,{host:m==null?void 0:m.host});I(pe.hasSession),ce.current=!0,w(be=>be+1)},importSession:async()=>{const le=await pbn({host:m==null?void 0:m.host});return I(le.hasSession),ce.current=!0,w(pe=>pe+1),le.source},linkProject:async le=>{z(null),v(null),L.current=!1,Z.current=null,$(await bbn(e,n,{project:le,sessionId:t})),i==null||i()},unlink:async()=>{$(await ybn(e,n,{sessionId:t})),Z.current=null,V.current=!1,z(null),j(null)},sync:le=>{V.current=!1,J(le)&&(Z.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}const FR=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],JIn=4e6,e$n=200,HR=16e6,t$n=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),qR=e=>e.startsWith("//")?`https:${e}`:e;async function n$n(e,n){var s;let t=JIn;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:c}of e){if(r.has(o)){const x=r.get(o);x&&i.setAttribute(a,x);continue}if(n.aborted)return;if(r.size>=e$n)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const h=u.headers.get("content-type")??"",_=Number(u.headers.get("content-length"));if(!c.some(x=>h.startsWith(x))||!(Number.isFinite(_)&&_>0&&_<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await t$n(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function r$n(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll(FR.map(c=>c.selector).join(", ")))for(const{selector:c,attribute:u,typePrefixes:h}of FR){if(!o.matches(c))continue;const _=o.getAttribute(u);if(!_)continue;const p=n(_);p&&(p===_?o.setAttribute(u,qR(_)):s.push({element:o,attribute:u,url:p,typePrefixes:h}))}await n$n(s,t);for(const o of r.querySelectorAll("a[href]")){const c=o.getAttribute("href");!c||!S6(c)||(o.setAttribute("href",qR(c)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function s$n(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${HR-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>HR}}function i$n({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=A.useState(null);return A.useEffect(()=>{let o=!1;const c=new AbortController;return a(null),s$n(e,n,t,c.signal).then(async({text:u,partial:h})=>({source:await r$n(u,s,c.signal),partial:h})).then(u=>{o||a(u)}),()=>{o=!0,c.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(Nt,{})," ",ID()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:IFe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:UFe({name:Ne(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function a$n({overleaf:e}){var _;const n=A.useRef(null),{open:t,setOpen:r,ref:s}=_o(n),i=A.useId(),[a,o]=A.useState({top:0,left:0,maxHeight:0}),c=((_=e.last)==null?void 0:_.conflicts.length)??0,u=e.hasToken&&!!e.error,h=u?f3():c?Emt():!e.hasToken||!e.link?Fbt():e.syncing?rL():e.blocked?nL():JD();return A.useEffect(()=>{c&&r(!0)},[c,r]),A.useEffect(()=>{u&&bn(f3(),"error",{id:i,duration:5e3})},[u,e.error,i]),A.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),x=Math.min(p.bottom+6,window.innerHeight-80);o({top:x,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-x-8}),(s.current.querySelector("input")??s.current).focus();const k=()=>r(!1),v=b=>{var w;b.target instanceof Node&&!((w=s.current)!=null&&w.contains(b.target))&&k()};return window.addEventListener("resize",k),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx($t,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":h,"data-tip-align":"end","aria-label":EZ({status:h}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(Nt,{}):f.jsx(v4n,{size:13,className:u||c?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&Mi.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":wL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx($t,{size:"small","aria-label":sFe(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(lr,{size:13})})}),f.jsx(_$n,{overleaf:e})]}),document.body)]})}const j1=e=>Wi(new Intl.ListFormat(E()).format(e.map(Ne)));function o$n(e){if(e.error)return fgt();if(e.syncing)return rL();if(e.blocked)return nL();const n=e.last;return n?n.pulled.length&&n.pushed.length?ebt({pulled:j1(n.pulled),pushed:j1(n.pushed)}):n.pulled.length?Kvt({paths:j1(n.pulled)}):n.pushed.length?obt({paths:j1(n.pushed)}):n.conflicts.length?d1t():JD():Mvt()}function c$n({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:tL()})}function l$n(e){return e.state==="live"?Mgt():e.state==="connecting"?Egt():e.error??Kgt()}function UR({overleaf:e,replacing:n}){const[t,r]=A.useState(""),[s,i]=A.useState(!1),[a,o]=A.useState(!1),[c,u]=A.useState(null),h=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},_=a?eyt():n?hbt():Vmt();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:_}),a&&f.jsx(qr,{className:"basis-full min-w-0","aria-label":_3(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:_3(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(Nt,{}),a?f.jsx(De,{type:"button",disabled:s||!t.trim(),onClick:()=>h(()=>e.saveSession(t.trim())),children:s?oa():bmt()}):f.jsx(De,{type:"button",disabled:s,onClick:()=>h(e.importSession),children:Jmt()}),f.jsx(De,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?eL():Pvt()})]}),c&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:c})]})}function u$n({overleaf:e}){if(!e.hasSession)return f.jsx(UR,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:e1t()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:l$n(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(De,{onClick:e.retryLive,children:Pgt()})}),t&&f.jsx(UR,{overleaf:e,replacing:!0})]})}function _$n({overleaf:e}){var p,m,x;const[n,t]=A.useState(""),[r,s]=A.useState(!1),[i,a]=A.useState(null),[o,c]=A.useState(!1),u=()=>{t(""),a(null),c(!0)},h=!e.hasToken||o;async function _(k){k.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{h?(await e.saveToken(v),c(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!h){const k=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(Nt,{}),e.error?f3():o$n(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(u$n,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(De,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?xbt():((m=e.live)==null?void 0:m.state)==="live"?dyt():void 0,onClick:()=>e.sync(),children:e.error?Qs():avt()}),f.jsxs(ph,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[K1t()," ",f.jsx(Z_,{size:12})]})]}),k.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",M1t()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(De,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:P1t()}),f.jsx(De,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Evt()})]})]},v)),((x=e.last)==null?void 0:x.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:sS()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(De,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:pz()}),f.jsx(ph,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:tL()}),f.jsx(De,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:dvt()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:_,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:h?Eyt():Myt()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(qr,{className:"basis-full min-w-0","aria-label":h?dz():hz(),"aria-invalid":!!i,type:h?"password":"text",value:n,onChange:k=>t(k.target.value),placeholder:h?dz():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(De,{type:"submit",disabled:r||!n.trim(),children:r?h?oa():ra():h?Obt():bgt()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:h?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:h?Mmt():hz()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(c$n,{href:e.uploadUrl}),o?f.jsx(De,{variant:"ghost",type:"button",onClick:()=>c(!1),children:eL()}):e.hasToken&&f.jsx(De,{variant:"ghost",type:"button",onClick:u,children:pz()})]})]})}function f$n({command:e}){const[n,t]=A.useState("idle"),r=A.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx($t,{"data-tip":n==="copied"?K_():n==="select"?kUe():ZBe(),"aria-label":vPe(),onClick:()=>void s(),children:n==="copied"?f.jsx(Ri,{size:13}):f.jsx(gf,{size:13})})]})}function GR(e){const[n,t]=A.useState(!1),[r,s]=A.useState(null);return{busy:n,error:r,trigger:async()=>{t(!0),s(null);try{await e()}catch(a){s(a instanceof Error?a.message:String(a))}finally{t(!1)}}}}function d$n({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:c,onScrollPositionChange:u,lineScrollRequest:h,onLineScrollRequestHandled:_,onEdit:p,artifactVersion:m,artifactEntries:x=[],bufferSession:k,remote:v=!1,restored:b=!1,onRestoreActivated:w,showSource:y=!1,onShowSourceChange:C}){var Ar,Rn;const N=X$(e,n,t??"repo",r,s),z=ct({...N,enabled:!k.saving}),T=z.data??null,j=((Ar=z.error)==null?void 0:Ar.message)??null,M=Ge=>{Jr(N.queryKey,kt=>(typeof Ge=="function"?Ge(kt??null):Ge)??void 0)},[D,I]=A.useState(0),$=t==="artifacts",q=t==="abs",H=hC(n),Q=VH(n),V=cIn(n),J=H||V,[Z,B]=A.useState(!1),L=!b||Z,F=()=>{B(!0),w==null||w()};A.useSyncExternalStore(k.subscribe,k.getRevision);const U=k.getSnapshot(),K=k.set,ne=k.saving,ce=k.setSaving,_e=k.saveRevision,se=k.saveError,G=k.setSaveError,oe=A.useRef(null),le=A.useRef(null),[pe,be]=A.useState(!1),[Me,Le]=A.useState(null),Ke=A.useRef(c),je=(T==null?void 0:T.file)??null,we=U&&Gc(U)?U.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,rt=we.split("/").slice(0,-1).join("/"),Ze=(T==null?void 0:T.source)==="artifact",at=A.useCallback(Ge=>{var kt;return((kt=o5(rt,Ge,q))==null?void 0:kt.path)??null},[q,rt]),St=A.useCallback(Ge=>q?HL(Ge):Ze?X_(e,Ge):y3(e,Ge,{sessionId:r,ref:s}),[Ze,s,q,e,r]),Ft=A.useCallback(Ge=>{if(S6(Ge))return Ge;const kt=o5(rt,Ge,q);return kt?B7n(St(kt.path),kt):null},[q,rt,St]),ut=JH(je==null?void 0:je.presentation),dt=(T==null?void 0:T.source)==="artifact"&&!$,Ie=$&&(T==null?void 0:T.source)==="checkout",me=!s&&(T==null?void 0:T.source)==="checkout"&&je!=null&&!je.notFound,Ae=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",Pe=me&&je!=null&&!je.binary&&!je.truncated&&!ut&&!Ae,nt=Pe&&je.version===void 0,_t=U!==null&&Gc(U),pt=!nt&&(Pe&&typeof je.version=="string"||_t),yt=(U==null?void 0:U.draft)??tk((je==null?void 0:je.content)??""),Zt=(U==null?void 0:U.baseline)??tk((je==null?void 0:je.content)??""),nn=pt&&U!==null&&Gc(U),jt=async Ge=>{const kt=k.getSnapshot();if(!pt||!kt||!Gc(kt))return!0;if(k.saving)return!1;if(kt.conflict&&Ge===void 0)return G(kt.conflict.exists?MN():LN()),!1;const pr=kt.draft,Gn=GIn(kt);ce(!0),G(null);try{await et.cancelQueries(N);const pn=await abn(e,we,Gn,{sessionId:r,expectedVersion:Ge??kt.version});return k.getSnapshot()?(k.saved(pr,pn.version),M(rr=>rr&&rr.source==="checkout"?{source:"checkout",file:{...rr.file,content:Gn,version:pn.version}}:rr),!0):!1}catch(pn){if(pn instanceof b3){const ts=k.getSnapshot();return!ts||!Gc(ts)||K({...ts,conflict:{currentVersion:pn.currentVersion,exists:pn.exists}}),!1}return G(pn instanceof Error?pn.message:String(pn)),!1}finally{ce(!1)}},mt=Q&&me&&!Ae,ft=WIn({projectId:e,filePath:we,sessionId:r,enabled:mt,autoRun:L,onManualAction:F,ready:je!=null&&!je.notFound,source:pt?yt:(je==null?void 0:je.content)??""}),en=ZIn({projectId:e,filePath:we,sessionId:r,enabled:mt,autoRun:L,onManualAction:F,savedSource:Zt,dirty:nn,onPulled:A.useCallback(Ge=>{Ge.includes(we)&&I(kt=>kt+1)},[we])}),An=Q&&ft.showPdf&&ft.compiled!=null,xr=nt&&_t,kn=(pt||xr)&&!(J&&!y)&&!An,Ln=je!==null&&!je.notFound&&!je.binary&&!ut&&!An,Un=Ln&&!kn&&(!V||y),dr=async()=>{if(je)try{if(je.truncated&&!kn){const Ge=fetch(St(we)).then(async kt=>{if(!kt.ok)throw new Error;return new Blob([await kt.text()],{type:"text/plain"})});await navigator.clipboard.write([new ClipboardItem({"text/plain":Ge})])}else await navigator.clipboard.writeText(kn?yt:je.content);be(!0),window.setTimeout(()=>be(!1),1500)}catch{bn(_Pe(),"error")}},es=Ge=>{if(!Ge.metaKey&&!Ge.ctrlKey||Ge.altKey||Ge.shiftKey||Ge.key.toLowerCase()!=="a"||!(Ge.target instanceof Node)||!Ge.currentTarget.contains(Ge.target))return;const kt=le.current;if(!kt)return;Ge.preventDefault();const pr=document.createRange();pr.selectNodeContents(kt);const Gn=window.getSelection();Gn==null||Gn.removeAllRanges(),Gn==null||Gn.addRange(pr)},Ct=ft.compiled?`${y3(e,ft.compiled.path,{sessionId:r})}&v=${ft.compiled.version}`:null,on=Ct?`${Ct}&view=${ft.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,cn=ft.compiled?ft.compiled.path.split("/").pop()??ft.compiled.path:null,fn=async()=>{nn&&!await jt()||Q&&ft.engine&&ft.compile()},wr=async()=>{nn&&(L?await fn():await jt())},un=GR(()=>cbn(e,we,{sessionId:r})),dn=GR(()=>lbn(e,we,{sessionId:r})),Tn=v?rqe():je!=null&&je.notFound?BN():s?XHe({branch:Ne(s)}):me?null:uqe(),wt=A.useCallback(()=>{k.saving||I(Ge=>Ge+1)},[k]),Mt=()=>{K(null),G(null),wt()},zn=tq(St(we),!s&&!ne);A.useEffect(()=>{if(!j||s)return;const Ge=window.setInterval(()=>{document.visibilityState!=="hidden"&&wt()},2e3);return()=>window.clearInterval(Ge)},[j,s,wt]);const hr=`${St(we)}&v=${encodeURIComponent(zn??m??"")}&reload=${D}`;A.useEffect(()=>{var pr,Gn;if(!T||k.saving)return;const Ge=T,kt=k.getSnapshot();if(kt&&Gc(kt)){const pn=Ge.source==="checkout"?Ge.file:null,ts=pn!==null&&pn.path===kt.path&&(!r||pn.root==="worktree"),rr=VIn(kt,ts&&typeof pn.version=="string"?pn.version:null,ts&&!pn.notFound);rr&&(rr.currentVersion!==((pr=kt.conflict)==null?void 0:pr.currentVersion)||rr.exists!==((Gn=kt.conflict)==null?void 0:Gn.exists))?K({...kt,conflict:rr}):!rr&&kt.conflict&&K({...kt,conflict:null})}(!kt||!Gc(kt))&&Ge.source==="checkout"&&!Ge.file.notFound&&!Ge.file.binary&&!Ge.file.truncated&&typeof Ge.file.version=="string"&&(K(PR(Ge.file.path,Ge.file.content,Ge.file.version)),G(null))},[T,k,r,ne,_e]);const Hn=JSON.stringify(N.queryKey),hn=A.useRef({sourceKey:Hn,nonce:D,artifactVersion:m,diskVersion:zn});A.useEffect(()=>{const Ge=hn.current;hn.current={sourceKey:Hn,nonce:D,artifactVersion:m,diskVersion:zn},Ge.sourceKey===Hn&&(Ge.nonce!==D||Ge.diskVersion!==null&&Ge.diskVersion!==zn||Ge.artifactVersion!=null&&Ge.artifactVersion!==m)&&vSn(e,n,t??"repo",r,s)},[Hn,D,m,zn,e,n,t,r,s]),A.useLayoutEffect(()=>{const Ge=oe.current,kt=Ke.current;!Ge||!je||!kt||(Ge.scrollTop=kt.top,Ge.scrollLeft=kt.left)},[je]);const Tr=Ge=>{if(Ge.source==="absolute")return kHe();if($)return lHe({root:r?Jg():Zg()});if(s)return mHe({branch:Ne(s)});if(r&&Ge.source==="checkout"&&Ge.file.root==="clone")return wGe();const kt=Ge.source==="checkout"?Ge.file.root:Ge.checkoutRoot;return THe({root:kt==="worktree"?Jg():Zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",onKeyDown:es,children:[f.jsxs("div",{className:"file-view-header @container flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Nh,{name:we}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(we),children:we.split("/").pop()||we}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap [&_svg]:flex-none",title:VQ({branch:Ne(a)}),children:[f.jsx(Nm,{size:11}),a]}),kn&&(ne||nn||se)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${se?"text-accent-red":"text-muted"}`,title:se??(ne?oa():cGe()),children:ne?f.jsxs(f.Fragment,{children:[f.jsx(Nt,{})," ",mUe()]}):se?lUe():$D()}),f.jsx("div",{ref:Le,className:"contents"}),Q&&ft.compiled&&f.jsx($t,{size:"small",active:!ft.showPdf,"data-tip":ft.stale&&ft.showPdf?Aqe():ft.showPdf?Nd():qN(),"data-tip-align":"end","aria-label":ft.showPdf?Nd():qN(),onClick:()=>ft.setShowPdf(!ft.showPdf),children:ft.showPdf?f.jsx($3,{size:13}):f.jsx(Lb,{size:13,className:ft.stale?"text-accent-amber":void 0})}),Q&&Ct&&cn&&f.jsx(Lh,{size:"small","data-tip":ft.stale?gFe({name:Ne(cn)}):Sv({name:Ne(cn)}),"data-tip-align":"end","aria-label":Sv({name:Ne(cn)}),href:Ct,download:cn,children:f.jsx(Db,{size:13,className:ft.stale?"text-accent-amber":void 0})}),mt&&f.jsx(a$n,{overleaf:en}),Q&&me&&f.jsx($t,{size:"small","data-tip":ft.compiled?FN():ON(),"data-tip-align":"end","aria-label":ft.compiled?FN():ON(),disabled:ft.compiling||!ft.engine,onClick:()=>void fn(),children:ft.compiling?f.jsx(Nt,{}):f.jsx(z4n,{size:13})}),J&&f.jsx($t,{size:"small",active:y,"data-tip":y?Ev():Nd(),"data-tip-align":"end","aria-label":y?Ev():Nd(),onClick:()=>C==null?void 0:C(!y),children:f.jsx($3,{size:13})}),Ln&&f.jsx($t,{size:"small","data-tip":pe?K_():DN(),"data-tip-align":"end","aria-label":pe?K_():DN(),onClick:()=>void dr(),children:pe?f.jsx(Ri,{size:13}):f.jsx(gf,{size:13})}),je!=null&&f.jsxs(f.Fragment,{children:[f.jsx($t,{size:"small","data-tip":Tn??un.error??PN(),"data-tip-align":"end","aria-label":PN(),"aria-description":Tn??void 0,disabled:un.busy||Tn!=null,onClick:()=>void un.trigger(),children:un.busy?f.jsx(Nt,{}):f.jsx(Z_,{size:13})}),f.jsx($t,{size:"small","data-tip":Tn??dn.error??HN(),"data-tip-align":"end","aria-label":HN(),"aria-description":Tn??void 0,disabled:dn.busy||Tn!=null,onClick:()=>void dn.trigger(),children:dn.busy?f.jsx(Nt,{}):f.jsx(Su,{size:13})})]})]}),!j&&Ie&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:IHe({root:T.file.root==="worktree"?Jg():Zg()})}),nt&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:pGe()}),j&&je!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[$N()," ",Ne(j)]}),(U==null?void 0:U.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:U.conflict.exists?MN():LN()}),((Rn=U==null?void 0:U.conflict)==null?void 0:Rn.exists)&&U.conflict.currentVersion&&f.jsx(De,{disabled:ne,onPointerDown:Ge=>Ge.preventDefault(),onClick:()=>{var Ge;return void jt(((Ge=U.conflict)==null?void 0:Ge.currentVersion)??void 0)},children:Sqe()}),f.jsx(De,{disabled:ne,onPointerDown:Ge=>Ge.preventDefault(),onClick:Mt,children:Xqe()})]}),(ft.error||ft.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${ft.builtWithErrors?"text-subtext":"text-accent-red"}`,children:ft.error??(ft.builtWithErrors?GBe():RBe())}),f.jsx($t,{"data-tip":UPe(),"data-tip-align":"end","aria-label":YPe(),onClick:ft.dismiss,children:f.jsx(lr,{size:13})})]}),ft.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:ft.log})]}),mt&&en.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:gqe()}),f.jsx(De,{onClick:()=>{en.reloaded(),I(Ge=>Ge+1)},children:APe()})]}),Q&&me&&ft.engine===null&&ft.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[ft.installHint,ft.installCommand&&f.jsx(f$n,{command:ft.installCommand})]}),ft.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:ft.note}),An&&ft.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:HUe()}),f.jsxs("div",{ref:oe,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",tabIndex:Un?0:void 0,onScroll:Ge=>{const kt={top:Math.max(0,Ge.currentTarget.scrollTop),left:Math.max(0,Ge.currentTarget.scrollLeft)};Ke.current=kt,u==null||u(kt)},children:[!kn&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:QUe()}),!kn&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&dt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:fBe({root:T.checkoutRoot==="worktree"?Jg():Zg()})}),j&&je===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[$N()," ",Ne(j)]}):je===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:ID()}):kn?f.jsx(P$,{value:yt,onChange:Ge=>{const kt=k.getSnapshot()??(je&&typeof je.version=="string"?PR(je.path,je.content,je.version):null);kt&&K(UIn(kt,Ge)),p==null||p(),se&&G(null)},onSave:()=>void wr(),onBlur:()=>{ek||wr()},readOnly:xr,path:n,highlightLine:i,scrollRequest:h,onScrollRequestHandled:_,scrollPosition:Ke.current,onScrollPositionChange:Ge=>{Ke.current=Ge,u==null||u(Ge)}}):je.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?Tr(T):BN()}):ut?f.jsx(lb.Provider,{value:Me,children:f.jsx(J5,{kind:ut,url:hr,name:n.split("/").pop()??n})}):je.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[bBe()," ",f.jsx("a",{href:hr,download:n.split("/").pop()??n,children:LD()})]}):An&&on&&cn?f.jsx(lb.Provider,{value:Me,children:f.jsx(J5,{kind:"pdf",url:on,name:cn,download:!1},on)}):H&&!y?f.jsx("div",{ref:le,className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:Ze?f.jsx(aq,{projectId:e,folder:rt,markdown:je.content,entries:x}):f.jsx(Jo,{text:je.content,resolveFilePath:at,resolveImageSrc:Ft,onOpenFile:o&&((Ge,kt,pr,Gn,pn)=>o(Ge,r,s,pn))})}):V&&!y?f.jsx(i$n,{html:je.content,truncated:je.truncated,url:hr,name:we,resolveSrc:Ft}):f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:le,children:f.jsx(ZH,{text:je.content,path:n,highlightLine:i,scrollRequest:h,onScrollRequestHandled:_})}),je.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:TFe()})]})]})]})}const y4=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function h$n({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=_o(),c=A.useRef(null);return A.useEffect(()=>{if(!i)return;const u=h=>{var _;h.key==="Escape"&&((_=c.current)==null||_.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx($t,{size:"small",className:"project-back text-text","aria-label":GN(),onClick:n,children:f.jsx(R0,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:rXe()}),s&&f.jsx($t,{size:"small","data-tip":VN(),"data-tip-align":"end","aria-label":VN(),onClick:s,children:f.jsx(VI,{size:18})})]}),f.jsxs("button",{ref:c,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(rc,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(Jn,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:y4,children:[f.jsx(FI,{size:14}),IQe()]})}),f.jsx(Jn,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:y4,children:[f.jsx(qI,{size:14}),GN()]})}),f.jsx(Jn,{onClick:()=>{var u;(u=c.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:y4,children:[f.jsx(L4n,{size:14}),UQe()]})})]})]})})}function p$n({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:a}){const[o,c]=A.useState(new Set),[u,h]=A.useState(null),_=new Map;for(const x of e){const k=_.get(x.experimentId);k?k.push(x):_.set(x.experimentId,[x])}for(const x of _.values())x.sort((k,v)=>v.createdAt-k.createdAt);const p=[...n].sort((x,k)=>{var w,y,C,N;const v=((y=(w=_.get(x.id))==null?void 0:w[0])==null?void 0:y.createdAt)??x.createdAt;return(((N=(C=_.get(k.id))==null?void 0:C[0])==null?void 0:N.createdAt)??k.createdAt)-v});if(p.length===0)return f.jsx(mC,{icon:mh,title:t??XLe(),description:t?void 0:LLe()});async function m(x){h(null),c(k=>new Set(k).add(x));try{await a(x)}catch(k){c(v=>{const b=new Set(v);return b.delete(x),b}),h(k instanceof Error?k.message:String(k))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[u&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[_$e()," ",u]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":ZIe(),children:p.map(x=>{const k=_.get(x.id)??[],v=k[0]??null,b=k.find(N=>N.status==="running"||N.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||o.has(b.id))),C=b?y?"cancelling":Zi(b):v?Zi(v):"idle";return f.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-divider-subtle 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(x,"preview"),onDoubleClick:()=>r(x,"keepOpen"),onAuxClick:N=>{N.button===1&&(N.preventDefault(),r(x,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Ur(N=>r(x,N),{stopPropagation:!0}),children:x.title||x.slug}),f.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:x.branchName,children:[f.jsx(Nm,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:x.branchName})]})]}),f.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:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx(al,{status:C})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:k.length===1?uIe():SIe({count:Xt(k.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:v?co(v.createdAt):rIe()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":RQ({name:x.title||x.slug}),onClick:N=>N.stopPropagation(),onDoubleClick:N=>N.stopPropagation(),onAuxClick:N=>N.stopPropagation(),children:[f.jsxs(De,{size:"small",disabled:!w,title:w?gIe():qLe(),...Ur(N=>{w&&s(x.id,w.id,N)},{stopPropagation:!0}),children:[f.jsx(lo,{size:15}),c3()]}),f.jsxs(De,{size:"small",title:gD({branch:Ne(x.branchName)}),...Ur(N=>i(x.id,N),{stopPropagation:!0}),children:[f.jsx(Ib,{size:15}),GIe()]}),b&&f.jsxs(De,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:y,title:y?AIe():$Ie(),onClick:()=>void m(b.id),children:[f.jsx(II,{size:15}),y?Bje():MD()]})]})]},x.id)})})]})}function m$n({onClose:e,onCreateProject:n}){const[t,r]=A.useState(!1),[s,i]=A.useState(null),a=A.useRef(null),o=A.useCallback(c=>{t||(r(!0),i(null),c().catch(()=>i(fhn())).finally(()=>r(!1)))},[t]);return A.useEffect(()=>{const c=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e,o]),A.useEffect(()=>{const c=a.current;if(!c)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,h=()=>[...c.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(h()[0]??c).focus();const _=p=>{if(p.key!=="Tab")return;const m=h();if(m.length===0){p.preventDefault(),c.focus();return}const x=m[0],k=m[m.length-1];p.shiftKey&&document.activeElement===x?(p.preventDefault(),k.focus()):!p.shiftKey&&document.activeElement===k&&(p.preventDefault(),x.focus())};return document.addEventListener("keydown",_,!0),()=>{document.removeEventListener("keydown",_,!0),u==null||u.focus()}},[]),Mi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx($t,{className:"absolute end-3.5 top-3.5","aria-label":v3(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(lr,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx(TS,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:$dn()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:Ehn()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[bhn()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:Zdn()}),vdn()]}),f.jsx("p",{dir:"auto",children:Gdn()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(De,{onClick:()=>o(n),disabled:t,children:Adn()}),f.jsx(De,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?oa():ihn()})]})]})}),document.body)}function fs(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function Ly(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}av.prototype=Ly.prototype={constructor:av,on:function(e,n){var t=this._,r=v$n(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),KR.hasOwnProperty(n)?{space:KR[n],local:e}:e}function y$n(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===nk&&n.documentElement.namespaceURI===nk?n.createElement(e):n.createElementNS(t,e)}}function x$n(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function hq(e){var n=Iy(e);return(n.local?x$n:y$n)(n)}function w$n(){}function gC(e){return e==null?w$n:function(){return this.querySelector(e)}}function k$n(e){typeof e!="function"&&(e=gC(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(N=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function W$n(e){e||(e=Q$n);function n(_,p){return _&&p?e(_.__data__,p.__data__):!_-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function X$n(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Y$n(){return Array.from(this)}function Z$n(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?lBn:typeof n=="function"?_Bn:uBn)(e,n,t??"")):zh(this.node(),e)}function zh(e,n){return e.style.getPropertyValue(n)||bq(e).getComputedStyle(e,null).getPropertyValue(n)}function dBn(e){return function(){delete this[e]}}function hBn(e,n){return function(){this[e]=n}}function pBn(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function mBn(e,n){return arguments.length>1?this.each((n==null?dBn:typeof n=="function"?pBn:hBn)(e,n)):this.node()[e]}function yq(e){return e.trim().split(/^|\s+/)}function vC(e){return e.classList||new xq(e)}function xq(e){this._node=e,this._names=yq(e.getAttribute("class")||"")}xq.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function wq(e,n){for(var t=vC(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function UBn(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function rk(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:c,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:h}})}rk.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ePn(e){return!e.ctrlKey&&!e.button}function tPn(){return this.parentNode}function nPn(e,n){return n??{x:e.x,y:e.y}}function rPn(){return navigator.maxTouchPoints||"ontouchstart"in this}function zq(){var e=ePn,n=tPn,t=nPn,r=rPn,s={},i=Ly("start","drag","end"),a=0,o,c,u,h,_=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,JBn).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,N){if(!(h||!e.call(this,C,N))){var z=y(this,n.call(this,C,N),C,N,"mouse");z&&(Qi(C.view).on("mousemove.drag",x,Q0).on("mouseup.drag",k,Q0),Eq(C.view),x4(C),u=!1,o=C.clientX,c=C.clientY,z("start",C))}}function x(C){if(qd(C),!u){var N=C.clientX-o,z=C.clientY-c;u=N*N+z*z>_}s.mouse("drag",C)}function k(C){Qi(C.view).on("mousemove.drag mouseup.drag",null),Nq(C.view,u),qd(C),s.mouse("end",C)}function v(C,N){if(e.call(this,C,N)){var z=C.changedTouches,T=n.call(this,C,N),j=z.length,M,D;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?A1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?A1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=iPn.exec(e))?new Ai(n[1],n[2],n[3],1):(n=aPn.exec(e))?new Ai(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=oPn.exec(e))?A1(n[1],n[2],n[3],n[4]):(n=cPn.exec(e))?A1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=lPn.exec(e))?eM(n[1],n[2]/100,n[3]/100,1):(n=uPn.exec(e))?eM(n[1],n[2]/100,n[3]/100,n[4]):WR.hasOwnProperty(e)?YR(WR[e]):e==="transparent"?new Ai(NaN,NaN,NaN,0):null}function YR(e){return new Ai(e>>16&255,e>>8&255,e&255,1)}function A1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Ai(e,n,t,r)}function dPn(e){return e instanceof Bm||(e=sf(e)),e?(e=e.rgb(),new Ai(e.r,e.g,e.b,e.opacity)):new Ai}function sk(e,n,t,r){return arguments.length===1?dPn(e):new Ai(e,n,t,r??1)}function Ai(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}bC(Ai,sk,jq(Bm,{brighter(e){return e=e==null?_b:Math.pow(_b,e),new Ai(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?X0:Math.pow(X0,e),new Ai(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ai(U_(this.r),U_(this.g),U_(this.b),fb(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:ZR,formatHex:ZR,formatHex8:hPn,formatRgb:JR,toString:JR}));function ZR(){return`#${S_(this.r)}${S_(this.g)}${S_(this.b)}`}function hPn(){return`#${S_(this.r)}${S_(this.g)}${S_(this.b)}${S_((isNaN(this.opacity)?1:this.opacity)*255)}`}function JR(){const e=fb(this.opacity);return`${e===1?"rgb(":"rgba("}${U_(this.r)}, ${U_(this.g)}, ${U_(this.b)}${e===1?")":`, ${e})`}`}function fb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function U_(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function S_(e){return e=U_(e),(e<16?"0":"")+e.toString(16)}function eM(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new no(e,n,t,r)}function Tq(e){if(e instanceof no)return new no(e.h,e.s,e.l,e.opacity);if(e instanceof Bm||(e=sf(e)),!e)return new no;if(e instanceof no)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,c=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&c<1?0:a,new no(a,o,c,e.opacity)}function pPn(e,n,t,r){return arguments.length===1?Tq(e):new no(e,n,t,r??1)}function no(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}bC(no,pPn,jq(Bm,{brighter(e){return e=e==null?_b:Math.pow(_b,e),new no(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?X0:Math.pow(X0,e),new no(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Ai(w4(e>=240?e-240:e+120,s,r),w4(e,s,r),w4(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new no(tM(this.h),R1(this.s),R1(this.l),fb(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=fb(this.opacity);return`${e===1?"hsl(":"hsla("}${tM(this.h)}, ${R1(this.s)*100}%, ${R1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tM(e){return e=(e||0)%360,e<0?e+360:e}function R1(e){return Math.max(0,Math.min(1,e||0))}function w4(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const yC=e=>()=>e;function mPn(e,n){return function(t){return e+t*n}}function gPn(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function vPn(e){return(e=+e)==1?Aq:function(n,t){return t-n?gPn(n,t,e):yC(isNaN(n)?t:n)}}function Aq(e,n){var t=n-e;return t?mPn(e,t):yC(isNaN(e)?n:e)}const db=(function e(n){var t=vPn(n);function r(s,i){var a=t((s=sk(s)).r,(i=sk(i)).r),o=t(s.g,i.g),c=t(s.b,i.b),u=Aq(s.opacity,i.opacity);return function(h){return s.r=a(h),s.g=o(h),s.b=c(h),s.opacity=u(h),s+""}}return r.gamma=e,r})(1);function bPn(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,c.push({i:a,x:Uo(r,s)})),t=k4.lastIndex;return t180?h+=360:h-u>180&&(u+=360),p.push({i:_.push(s(_)+"rotate(",null,r)-2,x:Uo(u,h)})):h&&_.push(s(_)+"rotate("+h+r)}function o(u,h,_,p){u!==h?p.push({i:_.push(s(_)+"skewX(",null,r)-2,x:Uo(u,h)}):h&&_.push(s(_)+"skewX("+h+r)}function c(u,h,_,p,m,x){if(u!==_||h!==p){var k=m.push(s(m)+"scale(",null,",",null,")");x.push({i:k-4,x:Uo(u,_)},{i:k-2,x:Uo(h,p)})}else(_!==1||p!==1)&&m.push(s(m)+"scale("+_+","+p+")")}return function(u,h){var _=[],p=[];return u=e(u),h=e(h),i(u.translateX,u.translateY,h.translateX,h.translateY,_,p),a(u.rotate,h.rotate,_,p),o(u.skewX,h.skewX,_,p),c(u.scaleX,u.scaleY,h.scaleX,h.scaleY,_,p),u=h=null,function(m){for(var x=-1,k=p.length,v;++x=0&&e._call.call(void 0,n),e=e._next;--jh}function sM(){af=(pb=Z0.now())+$y,jh=a0=0;try{OPn()}finally{jh=0,LPn(),af=0}}function DPn(){var e=Z0.now(),n=e-pb;n>Dq&&($y-=n,pb=e)}function LPn(){for(var e,n=hb,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:hb=t);o0=e,ok(r)}function ok(e){if(!jh){a0&&(a0=clearTimeout(a0));var n=e-af;n>24?(e<1/0&&(a0=setTimeout(sM,e-Z0.now()-$y)),Zp&&(Zp=clearInterval(Zp))):(Zp||(pb=Z0.now(),Zp=setInterval(DPn,Dq)),jh=1,Lq(sM))}}function iM(e,n,t){var r=new mb;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var IPn=Ly("start","end","cancel","interrupt"),$Pn=[],$q=0,aM=1,ck=2,cv=3,oM=4,lk=5,lv=6;function By(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;BPn(e,t,{name:n,index:r,group:s,on:IPn,tween:$Pn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:$q})}function wC(e,n){var t=fo(e,n);if(t.state>$q)throw new Error("too late; already scheduled");return t}function lc(e,n){var t=fo(e,n);if(t.state>cv)throw new Error("too late; already running");return t}function fo(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function BPn(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=Iq(i,0,t.time);function i(u){t.state=aM,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var h,_,p,m;if(t.state!==aM)return c();for(h in r)if(m=r[h],m.name===t.name){if(m.state===cv)return iM(a);m.state===oM?(m.state=lv,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[h]):+hck&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function pFn(e,n,t){var r,s,i=hFn(n)?wC:lc;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function mFn(e,n){var t=this._id;return arguments.length<2?fo(this.node(),t).on.on(e):this.each(pFn(t,e,n))}function gFn(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function vFn(){return this.on("end.remove",gFn(this._id))}function bFn(e){var n=this._name,t=this._id;typeof e!="function"&&(e=gC(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function UFn(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function rl(e,n,t){this.k=e,this.x=n,this.y=t}rl.prototype={constructor:rl,scale:function(e){return e===1?this:new rl(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new rl(this.k,this.x+this.k*e,this.y+this.k*n)},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 Py=new rl(1,0,0);Hq.prototype=rl.prototype;function Hq(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Py;return e.__zoom}function S4(e){e.stopImmediatePropagation()}function Jp(e){e.preventDefault(),e.stopImmediatePropagation()}function GFn(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function VFn(){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 cM(){return this.__zoom||Py}function KFn(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function WFn(){return navigator.maxTouchPoints||"ontouchstart"in this}function QFn(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function qq(){var e=GFn,n=VFn,t=QFn,r=KFn,s=WFn,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,c=ov,u=Ly("start","zoom","end"),h,_,p,m=500,x=150,k=0,v=10;function b(H){H.property("__zoom",cM).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",D).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(H,Q,V,J){var Z=H.selection?H.selection():H;Z.property("__zoom",cM),H!==Z?N(H,Q,V,J):Z.interrupt().each(function(){z(this,arguments).event(J).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},b.scaleBy=function(H,Q,V,J){b.scaleTo(H,function(){var Z=this.__zoom.k,B=typeof Q=="function"?Q.apply(this,arguments):Q;return Z*B},V,J)},b.scaleTo=function(H,Q,V,J){b.transform(H,function(){var Z=n.apply(this,arguments),B=this.__zoom,L=V==null?C(Z):typeof V=="function"?V.apply(this,arguments):V,F=B.invert(L),U=typeof Q=="function"?Q.apply(this,arguments):Q;return t(y(w(B,U),L,F),Z,a)},V,J)},b.translateBy=function(H,Q,V,J){b.transform(H,function(){return t(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof V=="function"?V.apply(this,arguments):V),n.apply(this,arguments),a)},null,J)},b.translateTo=function(H,Q,V,J,Z){b.transform(H,function(){var B=n.apply(this,arguments),L=this.__zoom,F=J==null?C(B):typeof J=="function"?J.apply(this,arguments):J;return t(Py.translate(F[0],F[1]).scale(L.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof V=="function"?-V.apply(this,arguments):-V),B,a)},J,Z)};function w(H,Q){return Q=Math.max(i[0],Math.min(i[1],Q)),Q===H.k?H:new rl(Q,H.x,H.y)}function y(H,Q,V){var J=Q[0]-V[0]*H.k,Z=Q[1]-V[1]*H.k;return J===H.x&&Z===H.y?H:new rl(H.k,J,Z)}function C(H){return[(+H[0][0]+ +H[1][0])/2,(+H[0][1]+ +H[1][1])/2]}function N(H,Q,V,J){H.on("start.zoom",function(){z(this,arguments).event(J).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(J).end()}).tween("zoom",function(){var Z=this,B=arguments,L=z(Z,B).event(J),F=n.apply(Z,B),U=V==null?C(F):typeof V=="function"?V.apply(Z,B):V,K=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),ne=Z.__zoom,ce=typeof Q=="function"?Q.apply(Z,B):Q,_e=c(ne.invert(U).concat(K/ne.k),ce.invert(U).concat(K/ce.k));return function(se){if(se===1)se=ce;else{var G=_e(se),oe=K/G[2];se=new rl(oe,U[0]-G[0]*oe,U[1]-G[1]*oe)}L.zoom(null,se)}})}function z(H,Q,V){return!V&&H.__zooming||new T(H,Q)}function T(H,Q){this.that=H,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=n.apply(H,Q),this.taps=0}T.prototype={event:function(H){return H&&(this.sourceEvent=H),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(H,Q){return this.mouse&&H!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&H!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&H!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(H){var Q=Qi(this.that).datum();u.call(H,this.that,new UFn(H,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Q)}};function j(H,...Q){if(!e.apply(this,arguments))return;var V=z(this,Q).event(H),J=this.__zoom,Z=Math.max(i[0],Math.min(i[1],J.k*Math.pow(2,r.apply(this,arguments)))),B=Ya(H);if(V.wheel)(V.mouse[0][0]!==B[0]||V.mouse[0][1]!==B[1])&&(V.mouse[1]=J.invert(V.mouse[0]=B)),clearTimeout(V.wheel);else{if(J.k===Z)return;V.mouse=[B,J.invert(B)],uv(this),V.start()}Jp(H),V.wheel=setTimeout(L,x),V.zoom("mouse",t(y(w(J,Z),V.mouse[0],V.mouse[1]),V.extent,a));function L(){V.wheel=null,V.end()}}function M(H,...Q){if(p||!e.apply(this,arguments))return;var V=H.currentTarget,J=z(this,Q,!0).event(H),Z=Qi(H.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",K,!0),B=Ya(H,V),L=H.clientX,F=H.clientY;Eq(H.view),S4(H),J.mouse=[B,this.__zoom.invert(B)],uv(this),J.start();function U(ne){if(Jp(ne),!J.moved){var ce=ne.clientX-L,_e=ne.clientY-F;J.moved=ce*ce+_e*_e>k}J.event(ne).zoom("mouse",t(y(J.that.__zoom,J.mouse[0]=Ya(ne,V),J.mouse[1]),J.extent,a))}function K(ne){Z.on("mousemove.zoom mouseup.zoom",null),Nq(ne.view,J.moved),Jp(ne),J.event(ne).end()}}function D(H,...Q){if(e.apply(this,arguments)){var V=this.__zoom,J=Ya(H.changedTouches?H.changedTouches[0]:H,this),Z=V.invert(J),B=V.k*(H.shiftKey?.5:2),L=t(y(w(V,B),J,Z),n.apply(this,Q),a);Jp(H),o>0?Qi(this).transition().duration(o).call(N,L,J,H):Qi(this).call(b.transform,L,J,H)}}function I(H,...Q){if(e.apply(this,arguments)){var V=H.touches,J=V.length,Z=z(this,Q,H.changedTouches.length===J).event(H),B,L,F,U;for(S4(H),L=0;L`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:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,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.`},J0=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Uq=["Enter"," ","Escape"],Gq={"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:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"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 Th;(function(e){e.Strict="strict",e.Loose="loose"})(Th||(Th={}));var G_;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(G_||(G_={}));var em;(function(e){e.Partial="partial",e.Full="full"})(em||(em={}));const Vq={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var iu;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(iu||(iu={}));var gb;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(gb||(gb={}));var Rt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Rt||(Rt={}));const lM={[Rt.Left]:Rt.Right,[Rt.Right]:Rt.Left,[Rt.Top]:Rt.Bottom,[Rt.Bottom]:Rt.Top};function Kq(e){return e===null?null:e?"valid":"invalid"}const Wq=e=>"id"in e&&"source"in e&&"target"in e,XFn=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),SC=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Pm=(e,n=[0,0])=>{const{width:t,height:r}=vl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},YFn=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):SC(s)?s:n.nodeLookup.get(s.id));const o=a?vb(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Fy(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hy(t)},Fm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=Fy(t,vb(s)),r=!0)}),r?Hy(t):{x:0,y:0,width:0,height:0}},CC=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,c=(n.y-r)/s,u=n.width/s,h=n.height/s,_=[];for(const p of e.values()){const{measured:m,selectable:x=!0,hidden:k=!1}=p;if(a&&!x||k)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x:w,y}=p.internals.positionAbsolute,C=Zq(o,c,u,h,w,y,v,b),N=v*b,z=i&&C>0;(!p.internals.handleBounds||z||C>=N||p.dragging)&&_.push(p)}return _},ZFn=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function JFn(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function eHn({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=JFn(e,a),c=Fm(o),u=NC(c,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function Qq({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:c,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},h=a.origin??r;let _=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",uo.error005());else{const m=o.measured.width,x=o.measured.height;m&&x&&(_=[[c,u],[c+m,u+x]])}else o&&cf(a.extent)&&(_=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const p=cf(_)?of(n,_,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",uo.error015())),{position:{x:p.x-c+(a.measured.width??0)*h[0],y:p.y-u+(a.measured.height??0)*h[1]},positionAbsolute:p}}async function tHn({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),x=!m&&p.parentId&&a.find(k=>k.id===p.parentId);(m||x)&&a.push(p)}const o=new Set(n.map(p=>p.id)),c=r.filter(p=>p.deletable!==!1),h=ZFn(a,c);for(const p of c)o.has(p.id)&&!h.find(x=>x.id===p.id)&&h.push(p);if(!s)return{edges:h,nodes:a};const _=await s({nodes:a,edges:h});return typeof _=="boolean"?_?{edges:h,nodes:a}:{edges:[],nodes:[]}:_}const Ah=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),of=(e={x:0,y:0},n,t)=>({x:Ah(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:Ah(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function Xq(e,n,t){const{width:r,height:s}=vl(t),{x:i,y:a}=t.internals.positionAbsolute;return of(e,[[i,a],[i+r,a+s]],n)}const uM=(e,n,t)=>et?-Ah(Math.abs(e-t),1,n)/n:0,EC=(e,n,t=15,r=40)=>{const s=uM(e.x,r,n.width-r)*t,i=uM(e.y,r,n.height-r)*t;return[s,i]},Fy=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),uk=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),Hy=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),tm=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=SC(e)?e.internals.positionAbsolute:Pm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},vb=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=SC(e)?e.internals.positionAbsolute:Pm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Yq=(e,n)=>Hy(Fy(uk(e),uk(n))),Zq=(e,n,t,r,s,i,a,o)=>{const c=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(c*u)},bb=(e,n)=>Zq(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),_M=e=>so(e.width)&&so(e.height)&&so(e.x)&&so(e.y),so=e=>!isNaN(e)&&isFinite(e),Jq=(e,n)=>(t,r)=>{},Hm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),qm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?Hm(o,a):o},Rh=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function vd(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.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 nHn(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=vd(e,t),s=vd(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=vd(e.top??e.y??0,t),s=vd(e.bottom??e.y??0,t),i=vd(e.left??e.x??0,n),a=vd(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function rHn(e,n,t,r,s,i){const{x:a,y:o}=Rh(e,[n,t,r]),{x:c,y:u}=Rh({x:e.x+e.width,y:e.y+e.height},[n,t,r]),h=s-c,_=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(h),bottom:Math.floor(_)}}const NC=(e,n,t,r,s,i)=>{const a=nHn(i,n,t),o=(n-a.x)/e.width,c=(t-a.y)/e.height,u=Math.min(o,c),h=Ah(u,r,s),_=e.x+e.width/2,p=e.y+e.height/2,m=n/2-_*h,x=t/2-p*h,k=rHn(e,m,x,h,n,t),v={left:Math.min(k.left-a.left,0),top:Math.min(k.top-a.top,0),right:Math.min(k.right-a.right,0),bottom:Math.min(k.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:x-v.top+v.bottom,zoom:h}},nm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function cf(e){return e!=null&&e!=="parent"}function vl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function eU(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function tU(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function fM(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function sHn(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function iHn(e){return{...Gq,...e||{}}}function w0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=io(e),o=qm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=t?Hm(o,n):o;return{xSnapped:c,ySnapped:u,...o}}const zC=e=>({width:e.offsetWidth,height:e.offsetHeight}),nU=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},aHn=["INPUT","SELECT","TEXTAREA"];function rU(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:aHn.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const sU=e=>"clientX"in e,io=(e,n)=>{var i,a;const t=sU(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},dM=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...zC(a)}})};function iU({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const c=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,h=Math.abs(c-e),_=Math.abs(u-n);return[c,u,h,_]}function D1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function hM({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Rt.Left:return[n-D1(n-r,i),t];case Rt.Right:return[n+D1(r-n,i),t];case Rt.Top:return[n,t-D1(t-s,i)];case Rt.Bottom:return[n,t+D1(s-t,i)]}}function aU({sourceX:e,sourceY:n,sourcePosition:t=Rt.Bottom,targetX:r,targetY:s,targetPosition:i=Rt.Top,curvature:a=.25}){const[o,c]=hM({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,h]=hM({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[_,p,m,x]=iU({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:h});return[`M${e},${n} C${o},${c} ${u},${h} ${r},${s}`,_,p,m,x]}function oU({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const lHn=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,uHn=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),_Hn=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",uo.error006()),n;const r=t.getEdgeId||lHn;let s;return Wq(e)?s={...e}:s={...e,id:r(e)},uHn(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function cU({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=oU({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const pM={[Rt.Left]:{x:-1,y:0},[Rt.Right]:{x:1,y:0},[Rt.Top]:{x:0,y:-1},[Rt.Bottom]:{x:0,y:1}},fHn=({source:e,sourcePosition:n=Rt.Bottom,target:t})=>n===Rt.Left||n===Rt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function dHn({source:e,sourcePosition:n=Rt.Bottom,target:t,targetPosition:r=Rt.Top,center:s,offset:i,stepPosition:a}){const o=pM[n],c=pM[r],u={x:e.x+o.x*i,y:e.y+o.y*i},h={x:t.x+c.x*i,y:t.y+c.y*i},_=fHn({source:u,sourcePosition:n,target:h}),p=_.x!==0?"x":"y",m=_[p];let x=[],k,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=oU({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*c[p]===-1){p==="x"?(k=s.x??u.x+(h.x-u.x)*a,v=s.y??(u.y+h.y)/2):(k=s.x??(u.x+h.x)/2,v=s.y??u.y+(h.y-u.y)*a);const j=[{x:k,y:u.y},{x:k,y:h.y}],M=[{x:u.x,y:v},{x:h.x,y:v}];o[p]===m?x=p==="x"?j:M:x=p==="x"?M:j}else{const j=[{x:u.x,y:h.y}],M=[{x:h.x,y:u.y}];if(p==="x"?x=o.x===m?M:j:x=o.y===m?j:M,n===r){const H=Math.abs(e[p]-t[p]);if(H<=i){const Q=Math.min(i-1,i-H);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Q:w[p]=(h[p]>t[p]?-1:1)*Q}}if(n!==r){const H=p==="x"?"y":"x",Q=o[p]===c[H],V=u[H]>h[H],J=u[H]=q?(k=(D.x+I.x)/2,v=x[0].y):(k=x[0].x,v=(D.y+I.y)/2)}const N={x:u.x+b.x,y:u.y+b.y},z={x:h.x+w.x,y:h.y+w.y};return[[e,...N.x!==x[0].x||N.y!==x[0].y?[N]:[],...x,...z.x!==x[x.length-1].x||z.y!==x[x.length-1].y?[z]:[],t],k,v,y,C]}function hHn(e,n,t,r){const s=Math.min(mM(e,n)/2,mM(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function fk(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function mHn(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=fk(c,n);i.has(u)||(a.push({id:u,color:c.color||t,...c}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const lU=1e3,gHn=10,jC={nodeOrigin:[0,0],nodeExtent:J0,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},vHn={...jC,checkEquality:!0};function TC(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function bHn(e,n,t){const r=TC(jC,t);for(const s of e.values())if(s.parentId)RC(s,e,n,r);else{const i=Pm(s,r.nodeOrigin),a=cf(s.extent)?s.extent:r.nodeExtent,o=of(i,a,vl(s));s.internals.positionAbsolute=o}}function yHn(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function AC(e){return e==="manual"}function dk(e,n,t,r={}){var h,_;const s=TC(vHn,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!AC(s.zIndexMode)?lU:0;let c=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const x=Pm(p,s.nodeOrigin),k=cf(p.extent)?p.extent:s.nodeExtent,v=of(x,k,vl(p));m={...s.defaults,...p,measured:{width:(h=p.measured)==null?void 0:h.width,height:(_=p.measured)==null?void 0:_.height},internals:{positionAbsolute:v,handleBounds:yHn(p,m),z:uU(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),p.parentId&&RC(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function xHn(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function RC(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:c}=TC(jC,r),u=e.parentId,h=n.get(u);if(!h){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}xHn(e,t),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&c==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*gHn),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const _=i&&!AC(c)?lU:0,{x:p,y:m,z:x}=wHn(e,h,a,o,_,c),{positionAbsolute:k}=e.internals,v=p!==k.x||m!==k.y;(v||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:k,z:x}})}function uU(e,n,t){const r=so(e.zIndex)?e.zIndex:0;return AC(t)?r:r+(e.selected?n:0)}function wHn(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,c=vl(e),u=Pm(e,t),h=cf(e.extent)?of(u,e.extent,c):u;let _=of({x:a+h.x,y:o+h.y},r,c);e.extent==="parent"&&(_=Xq(_,c,n));const p=uU(e,s,i),m=n.internals.z??0;return{x:_.x,y:_.y,z:m>=p?m+1:p}}function MC(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const c=n.get(o.parentId);if(!c)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??tm(c),h=Yq(u,o.rect);i.set(o.parentId,{expandedRect:h,parent:c})}return i.size>0&&i.forEach(({expandedRect:o,parent:c},u)=>{var y;const h=c.internals.positionAbsolute,_=vl(c),p=c.origin??r,m=o.x0||x>0||b||w)&&(s.push({id:u,type:"position",position:{x:c.position.x-m+b,y:c.position.y-x+w}}),(y=t.get(u))==null||y.forEach(C=>{e.some(N=>N.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+x}})})),(_.width0){const m=MC(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:c}}async function SHn({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function yM(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const c=r.get(a)||new Map;if(r.set(a,c.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function _U(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,h=`${i}-${o}--${s}-${a}`;yM("source",c,h,e,s,a),yM("target",c,u,e,i,o),n.set(r.id,r)}}function fU(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:fU(t,n):!1}function xM(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function CHn(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!fU(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function C4({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,c;const s=[];for(const[u,h]of n){const _=(a=t.get(u))==null?void 0:a.internals.userNode;_&&s.push({..._,position:h.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((c=n.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function EHn({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=Hm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function NHn({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,c=!1,u={x:0,y:0},h=null,_=!1,p=null,m=!1,x=!1,k=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:N,nodeId:z,nodeClickDistance:T=0}){p=Qi(C);function j({x:$,y:q}){const{nodeLookup:H,nodeExtent:Q,snapGrid:V,snapToGrid:J,nodeOrigin:Z,onNodeDrag:B,onSelectionDrag:L,onError:F,updateNodePositions:U}=n();i={x:$,y:q};let K=!1;const ne=o.size>1,ce=ne&&Q?uk(Fm(o)):null,_e=ne&&J?EHn({dragItems:o,snapGrid:V,x:$,y:q}):null;for(const[se,G]of o){if(!H.has(se))continue;let oe={x:$-G.distance.x,y:q-G.distance.y};J&&(oe=_e?{x:Math.round(oe.x+_e.x),y:Math.round(oe.y+_e.y)}:Hm(oe,V));let le=null;if(ne&&Q&&!G.extent&&ce){const{positionAbsolute:Me}=G.internals,Le=Me.x-ce.x+Q[0][0],Ke=Me.x+G.measured.width-ce.x2+Q[1][0],je=Me.y-ce.y+Q[0][1],we=Me.y+G.measured.height-ce.y2+Q[1][1];le=[[Le,je],[Ke,we]]}const{position:pe,positionAbsolute:be}=Qq({nodeId:se,nextPosition:oe,nodeLookup:H,nodeExtent:le||Q,nodeOrigin:Z,onError:F});K=K||G.position.x!==pe.x||G.position.y!==pe.y,G.position=pe,G.internals.positionAbsolute=be}if(x=x||K,!!K&&(U(o,!0),k&&(r||B||!z&&L))){const[se,G]=C4({nodeId:z,dragItems:o,nodeLookup:H});r==null||r(k,o,se,G),B==null||B(k,se,G),z||L==null||L(k,G)}}async function M(){if(!h)return;const{transform:$,panBy:q,autoPanSpeed:H,autoPanOnNodeDrag:Q}=n();if(!Q){c=!1,cancelAnimationFrame(a);return}const[V,J]=EC(u,h,H);(V!==0||J!==0)&&(i.x=(i.x??0)-V/$[2],i.y=(i.y??0)-J/$[2],await q({x:V,y:J})&&j(i)),a=requestAnimationFrame(M)}function D($){var ne;const{nodeLookup:q,multiSelectionActive:H,nodesDraggable:Q,transform:V,snapGrid:J,snapToGrid:Z,selectNodesOnDrag:B,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:U}=n();_=!0,(!B||!N)&&!H&&z&&((ne=q.get(z))!=null&&ne.selected||U()),N&&B&&z&&(e==null||e(z));const K=w0($.sourceEvent,{transform:V,snapGrid:J,snapToGrid:Z,containerBounds:h});if(i=K,o=CHn(q,Q,K,z),o.size>0&&(t||L||!z&&F)){const[ce,_e]=C4({nodeId:z,dragItems:o,nodeLookup:q});t==null||t($.sourceEvent,o,ce,_e),L==null||L($.sourceEvent,ce,_e),z||F==null||F($.sourceEvent,_e)}}const I=zq().clickDistance(T).on("start",$=>{const{domNode:q,nodeDragThreshold:H,transform:Q,snapGrid:V,snapToGrid:J}=n();h=(q==null?void 0:q.getBoundingClientRect())||null,m=!1,x=!1,k=$.sourceEvent,H===0&&D($),i=w0($.sourceEvent,{transform:Q,snapGrid:V,snapToGrid:J,containerBounds:h}),u=io($.sourceEvent,h)}).on("drag",$=>{const{autoPanOnNodeDrag:q,transform:H,snapGrid:Q,snapToGrid:V,nodeDragThreshold:J,nodeLookup:Z}=n(),B=w0($.sourceEvent,{transform:H,snapGrid:Q,snapToGrid:V,containerBounds:h});if(k=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||z&&!Z.has(z))&&(m=!0),!m){if(!c&&q&&_&&(c=!0,M()),!_){const L=io($.sourceEvent,h),F=L.x-u.x,U=L.y-u.y;Math.sqrt(F*F+U*U)>J&&D($)}(i.x!==B.xSnapped||i.y!==B.ySnapped)&&o&&_&&(u=io($.sourceEvent,h),j(B))}}).on("end",$=>{if(!_||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(c=!1,_=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:q,updateNodePositions:H,onNodeDragStop:Q,onSelectionDragStop:V}=n();if(x&&(H(o,!1),x=!1),s||Q||!z&&V){const[J,Z]=C4({nodeId:z,dragItems:o,nodeLookup:q,dragging:!1});s==null||s($.sourceEvent,o,J,Z),Q==null||Q($.sourceEvent,J,Z),z||V==null||V($.sourceEvent,Z)}}}).filter($=>{const q=$.target;return!$.button&&(!w||!xM(q,`.${w}`,C))&&(!y||xM(q,y,C))});p.call(I)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function zHn(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())bb(s,tm(i))>0&&r.push(i);return r}const jHn=250;function THn(e,n,t,r){var o,c;let s=[],i=1/0;const a=zHn(e,t,n+jHn);for(const u of a){const h=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const _ of h){if(r.nodeId===_.nodeId&&r.type===_.type&&r.id===_.id)continue;const{x:p,y:m}=lf(u,_,_.position,!0),x=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));x>n||(x1){const u=r.type==="source"?"target":"source";return s.find(h=>h.type===u)??s[0]}return s[0]}function dU(e,n,t,r,s,i=!1){var u,h,_;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((h=a.internals.handleBounds)==null?void 0:h.source)??[],...((_=a.internals.handleBounds)==null?void 0:_.target)??[]],c=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return c&&i?{...c,...lf(a,c,c.position,!0)}:c}function hU(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function AHn(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const pU=()=>!0;function RHn(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:c,lib:u,autoPanOnConnect:h,flowId:_,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:k,onConnectEnd:v,isValidConnection:b=pU,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:N,autoPanSpeed:z,dragThreshold:T=1,handleDomNode:j}){const M=nU(e.target);let D=0,I;const{x:$,y:q}=io(e),H=hU(i,j),Q=o==null?void 0:o.getBoundingClientRect();let V=!1;if(!Q||!H)return;const J=dU(s,H,r,c,n);if(!J)return;let Z=io(e,Q),B=!1,L=null,F=!1,U=null;function K(){if(!h||!Q)return;const[pe,be]=EC(Z,Q,z);p({x:pe,y:be}),D=requestAnimationFrame(K)}const ne={...J,nodeId:s,type:H,position:J.position},ce=c.get(s);let se={inProgress:!0,isValid:null,from:lf(ce,ne,Rt.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:ce,to:Z,toHandle:null,toPosition:lM[ne.position],toNode:null,pointer:Z};function G(){V=!0,y(se),x==null||x(e,{nodeId:s,handleId:r,handleType:H})}T===0&&G();function oe(pe){if(!V){const{x:we,y:rt}=io(pe),Ze=we-$,at=rt-q;if(!(Ze*Ze+at*at>T*T))return;G()}if(!N()||!ne){le(pe);return}const be=C();Z=io(pe,Q),I=THn(qm(Z,be,!1,[1,1]),t,c,ne),B||(K(),B=!0);const Me=mU(pe,{handle:I,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:_,nodeLookup:c});U=Me.handleDomNode,L=Me.connection,F=AHn(!!I,Me.isValid);const Le=c.get(s),Ke=Le?lf(Le,ne,Rt.Left,!0):se.from,je={...se,from:Ke,isValid:F,to:Me.toHandle&&F?Rh({x:Me.toHandle.x,y:Me.toHandle.y},be):Z,toHandle:Me.toHandle,toPosition:F&&Me.toHandle?Me.toHandle.position:lM[ne.position],toNode:Me.toHandle?c.get(Me.toHandle.nodeId):null,pointer:Z};y(je),se=je}function le(pe){if(!("touches"in pe&&pe.touches.length>0)){if(V){(I||U)&&L&&F&&(k==null||k(L));const{inProgress:be,...Me}=se,Le={...Me,toPosition:se.toHandle?se.toPosition:null};v==null||v(pe,Le),i&&(w==null||w(pe,Le))}m(),cancelAnimationFrame(D),B=!1,F=!1,L=null,U=null,M.removeEventListener("mousemove",oe),M.removeEventListener("mouseup",le),M.removeEventListener("touchmove",oe),M.removeEventListener("touchend",le)}}M.addEventListener("mousemove",oe),M.addEventListener("mouseup",le),M.addEventListener("touchmove",oe),M.addEventListener("touchend",le)}function mU(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:c,isValidConnection:u=pU,nodeLookup:h}){const _=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${c}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:x}=io(e),k=a.elementFromPoint(m,x),v=k!=null&&k.classList.contains(`${o}-flow__handle`)?k:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=hU(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),N=v.classList.contains("connectable"),z=v.classList.contains("connectableend");if(!y||!w)return b;const T={source:_?y:r,sourceHandle:_?C:s,target:_?r:y,targetHandle:_?s:C};b.connection=T;const M=N&&z&&(t===Th.Strict?_&&w==="source"||!_&&w==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=dU(y,w,C,h,t,!0)}return b}const hk={onPointerDown:RHn,isValid:mU};function MHn({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Qi(e);function i({translateExtent:o,width:c,height:u,zoomStep:h=1,pannable:_=!0,zoomable:p=!0,inversePan:m=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),N=y.sourceEvent.ctrlKey&&nm()?10:1,z=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*h,T=C[2]*Math.pow(2,z*N);n.scaleTo(T)};let k=[0,0];const v=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])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const N=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],z=[N[0]-k[0],N[1]-k[1]];k=N;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-z[0]*T,y:C[1]-z[1]*T},M=[[0,0],[c,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},w=qq().on("start",v).on("zoom",_?b:null).on("zoom.wheel",p?x:null);s.call(w,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Ya}}const qy=e=>({x:e.x,y:e.y,zoom:e.k}),E4=({x:e,y:n,zoom:t})=>Py.translate(e,n).scale(t),Td=(e,n)=>e.target.closest(`.${n}`),gU=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),OHn=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,N4=(e,n=0,t=OHn,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},vU=e=>{const n=e.ctrlKey&&nm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function DHn({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:u}){return h=>{if(Td(h,n))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const _=t.property("__zoom").k||1;if(h.ctrlKey&&a){const v=Ya(h),b=vU(h),w=_*Math.pow(2,b);r.scaleTo(t,w,v,h);return}const p=h.deltaMode===1?20:1;let m=s===G_.Vertical?0:h.deltaX*p,x=s===G_.Horizontal?0:h.deltaY*p;!nm()&&h.shiftKey&&s!==G_.Vertical&&(m=h.deltaY*p,x=0),r.translateBy(t,-(m/_)*i,-(x/_)*i,{internal:!0});const k=qy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(h,k),e.panScrollTimeout=setTimeout(()=>{u==null||u(h,k),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(h,k))}}function LHn({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=Td(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function IHn({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=qy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function $Hn({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&gU(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,qy(i.transform)))}}function BHn({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&gU(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=qy(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},t?150:0)}}}function PHn({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:c,lib:u,connectionInProgress:h}){return _=>{var v;const p=e||n,m=t&&_.ctrlKey,x=_.type==="wheel";if(_.button===1&&_.type==="mousedown"&&(Td(_,`${u}-flow__node`)||Td(_,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||h&&!x||Td(_,o)&&x||Td(_,c)&&(!x||s&&x&&!e)||!t&&_.ctrlKey&&x)return!1;if(!t&&_.type==="touchstart"&&((v=_.touches)==null?void 0:v.length)>1)return _.preventDefault(),!1;if(!p&&!s&&!m&&x||!r&&(_.type==="mousedown"||_.type==="touchstart")||Array.isArray(r)&&!r.includes(_.button)&&_.type==="mousedown")return!1;const k=Array.isArray(r)&&r.includes(_.button)||!_.button||_.button<=1;return(!_.ctrlKey||x)&&k}}function FHn({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),_=qq().scaleExtent([n,t]).translateExtent(r),p=Qi(e).call(_);w({x:s.x,y:s.y,zoom:Ah(s.zoom,n,t)},[[0,0],[h.width,h.height]],r);const m=p.on("wheel.zoom"),x=p.on("dblclick.zoom");_.wheelDelta(vU);async function k(I,$){return p?new Promise(q=>{_==null||_.interpolate(($==null?void 0:$.interpolate)==="linear"?x0:ov).transform(N4(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),I)}):!1}function v({noWheelClassName:I,noPanClassName:$,onPaneContextMenu:q,userSelectionActive:H,panOnScroll:Q,panOnDrag:V,panOnScrollMode:J,panOnScrollSpeed:Z,preventScrolling:B,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:U,zoomActivationKeyPressed:K,lib:ne,onTransformChange:ce,connectionInProgress:_e,paneClickDistance:se,selectionOnDrag:G}){H&&!u.isZoomingOrPanning&&b();const oe=Q&&!K&&!H;_.clickDistance(G?1/0:!so(se)||se<0?0:se);const le=oe?DHn({zoomPanValues:u,noWheelClassName:I,d3Selection:p,d3Zoom:_,panOnScrollMode:J,panOnScrollSpeed:Z,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):LHn({noWheelClassName:I,preventScrolling:B,d3ZoomHandler:m});p.on("wheel.zoom",le,{passive:!1});const pe=IHn({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});_.on("start",pe);const be=$Hn({zoomPanValues:u,panOnDrag:V,onPaneContextMenu:!!q,onPanZoom:i,onTransformChange:ce});_.on("zoom",be);const Me=BHn({zoomPanValues:u,panOnDrag:V,panOnScroll:Q,onPaneContextMenu:q,onPanZoomEnd:o,onDraggingChange:c});_.on("end",Me);const Le=PHn({zoomActivationKeyPressed:K,panOnDrag:V,zoomOnScroll:F,panOnScroll:Q,zoomOnDoubleClick:U,zoomOnPinch:L,userSelectionActive:H,noPanClassName:$,noWheelClassName:I,lib:ne,connectionInProgress:_e});_.filter(Le),U?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function b(){_.on("zoom",null)}async function w(I,$,q){const H=E4(I),Q=_==null?void 0:_.constrain()(H,$,q);return Q&&await k(Q),Q}async function y(I,$){const q=E4(I);return await k(q,$),q}function C(I){if(p){const $=E4(I),q=p.property("__zoom");(q.k!==I.zoom||q.x!==I.x||q.y!==I.y)&&(_==null||_.transform(p,$,null,{sync:!0}))}}function N(){const I=p?Hq(p.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}async function z(I,$){return p?new Promise(q=>{_==null||_.interpolate(($==null?void 0:$.interpolate)==="linear"?x0:ov).scaleTo(N4(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),I)}):!1}async function T(I,$){return p?new Promise(q=>{_==null||_.interpolate(($==null?void 0:$.interpolate)==="linear"?x0:ov).scaleBy(N4(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),I)}):!1}function j(I){_==null||_.scaleExtent(I)}function M(I){_==null||_.translateExtent(I)}function D(I){const $=!so(I)||I<0?0:I;_==null||_.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:N,scaleTo:z,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:D}}var Mh;(function(e){e.Line="line",e.Handle="handle"})(Mh||(Mh={}));function HHn({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,c=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(c[0]=c[0]*-1),o&&i&&(c[1]=c[1]*-1),c}function wM(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function Jl(e,n){return Math.max(0,n-e)}function eu(e,n){return Math.max(0,e-n)}function L1(e,n,t){return Math.max(0,n-e,e-t)}function kM(e,n){return e?!n:n}function qHn(e,n,t,r,s,i,a,o){let{affectsX:c,affectsY:u}=n;const{isHorizontal:h,isVertical:_}=n,p=h&&_,{xSnapped:m,ySnapped:x}=t,{minWidth:k,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:N,height:z,aspectRatio:T}=e;let j=Math.floor(h?m-e.pointerX:0),M=Math.floor(_?x-e.pointerY:0);const D=N+(c?-j:j),I=z+(u?-M:M),$=-i[0]*N,q=-i[1]*z;let H=L1(D,k,v),Q=L1(I,b,w);if(a){let Z=0,B=0;c&&j<0?Z=Jl(y+j+$,a[0][0]):!c&&j>0&&(Z=eu(y+D+$,a[1][0])),u&&M<0?B=Jl(C+M+q,a[0][1]):!u&&M>0&&(B=eu(C+I+q,a[1][1])),H=Math.max(H,Z),Q=Math.max(Q,B)}if(o){let Z=0,B=0;c&&j>0?Z=eu(y+j,o[0][0]):!c&&j<0&&(Z=Jl(y+D,o[1][0])),u&&M>0?B=eu(C+M,o[0][1]):!u&&M<0&&(B=Jl(C+I,o[1][1])),H=Math.max(H,Z),Q=Math.max(Q,B)}if(s){if(h){const Z=L1(D/T,b,w)*T;if(H=Math.max(H,Z),a){let B=0;!c&&!u||c&&!u&&p?B=eu(C+q+D/T,a[1][1])*T:B=Jl(C+q+(c?j:-j)/T,a[0][1])*T,H=Math.max(H,B)}if(o){let B=0;!c&&!u||c&&!u&&p?B=Jl(C+D/T,o[1][1])*T:B=eu(C+(c?j:-j)/T,o[0][1])*T,H=Math.max(H,B)}}if(_){const Z=L1(I*T,k,v)/T;if(Q=Math.max(Q,Z),a){let B=0;!c&&!u||u&&!c&&p?B=eu(y+I*T+$,a[1][0])/T:B=Jl(y+(u?M:-M)*T+$,a[0][0])/T,Q=Math.max(Q,B)}if(o){let B=0;!c&&!u||u&&!c&&p?B=Jl(y+I*T,o[1][0])/T:B=eu(y+(u?M:-M)*T,o[0][0])/T,Q=Math.max(Q,B)}}}M=M+(M<0?Q:-Q),j=j+(j<0?H:-H),s&&(p?D>I*T?M=(kM(c,u)?-j:j)/T:j=(kM(c,u)?-M:M)*T:h?(M=j/T,u=c):(j=M*T,c=u));const V=c?y+j:y,J=u?C+M:C;return{width:N+(c?-j:j),height:z+(u?-M:M),x:i[0]*j*(c?-1:1)+V,y:i[1]*M*(u?-1:1)+J}}const bU={width:0,height:0,x:0,y:0},UHn={...bU,pointerX:0,pointerY:0,aspectRatio:1};function GHn(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,c=t[1]*a;return[[r-o,s-c],[r+i-o,s+a-c]]}function VHn({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=Qi(e);let a={controlDirection:wM("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:h,keepAspectRatio:_,resizeDirection:p,onResizeStart:m,onResize:x,onResizeEnd:k,shouldResize:v}){let b={...bU},w={...UHn};a={boundaries:h,resizeDirection:p,keepAspectRatio:_,controlDirection:wM(u)};let y,C=null,N=[],z,T,j,M=!1;const D=zq().on("start",I=>{const{nodeLookup:$,transform:q,snapGrid:H,snapToGrid:Q,nodeOrigin:V,paneDomNode:J}=t();if(y=$.get(n),!y)return;C=(J==null?void 0:J.getBoundingClientRect())??null;const{xSnapped:Z,ySnapped:B}=w0(I.sourceEvent,{transform:q,snapGrid:H,snapToGrid:Q,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...b,pointerX:Z,pointerY:B,aspectRatio:b.width/b.height},z=void 0,T=cf(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(z=$.get(y.parentId)),z&&y.extent==="parent"&&(T=[[0,0],[z.measured.width,z.measured.height]]),N=[],j=void 0;for(const[L,F]of $)if(F.parentId===n&&(N.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const U=GHn(F,y,F.origin??V);j?j=[[Math.min(U[0][0],j[0][0]),Math.min(U[0][1],j[0][1])],[Math.max(U[1][0],j[1][0]),Math.max(U[1][1],j[1][1])]]:j=U}m==null||m(I,{...b})}).on("drag",I=>{const{transform:$,snapGrid:q,snapToGrid:H,nodeOrigin:Q}=t(),V=w0(I.sourceEvent,{transform:$,snapGrid:q,snapToGrid:H,containerBounds:C}),J=[];if(!y)return;const{x:Z,y:B,width:L,height:F}=b,U={},K=y.origin??Q,{width:ne,height:ce,x:_e,y:se}=qHn(w,a.controlDirection,V,a.boundaries,a.keepAspectRatio,K,T,j),G=ne!==L,oe=ce!==F,le=_e!==Z&&G,pe=se!==B&&oe;if(!le&&!pe&&!G&&!oe)return;if((le||pe||K[0]===1||K[1]===1)&&(U.x=le?_e:b.x,U.y=pe?se:b.y,b.x=U.x,b.y=U.y,N.length>0)){const Ke=_e-Z,je=se-B;for(const we of N)we.position={x:we.position.x-Ke+K[0]*(ne-L),y:we.position.y-je+K[1]*(ce-F)},J.push(we)}if((G||oe)&&(U.width=G&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ne:b.width,U.height=oe&&(!a.resizeDirection||a.resizeDirection==="vertical")?ce:b.height,b.width=U.width,b.height=U.height),z&&y.expandParent){const Ke=K[0]*(U.width??0);U.x&&U.x{M&&(k==null||k(I,{...b}),s==null||s({...b}),M=!1)});i.call(D)}function c(){i.on(".drag",null)}return{update:o,destroy:c}}const KHn={},SM=e=>{let n;const t=new Set,r=(h,_)=>{const p=typeof h=="function"?h(n):h;if(!Object.is(p,n)){const m=n;n=_??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(x=>x(n,m))}},s=()=>n,c={setState:r,getState:s,getInitialState:()=>u,subscribe:h=>(t.add(h),()=>t.delete(h)),destroy:()=>{(KHn?"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."),t.clear()}},u=n=e(r,s,c);return c},WHn=e=>e?SM(e):SM,{useDebugValue:QHn}=Je,{useSyncExternalStoreWithSelector:XHn}=MW,YHn=e=>e;function yU(e,n=YHn,t){const r=XHn(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return QHn(r),r}const CM=(e,n)=>{const t=WHn(e),r=(s,i=n)=>yU(t,s,i);return Object.assign(r,t),r},ZHn=(e,n)=>e?CM(e,n):CM;function Nr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const Uy=A.createContext(null),JHn=Uy.Provider,xU=uo.error001("react");function jn(e,n){const t=A.useContext(Uy);if(t===null)throw new Error(xU);return yU(t,e,n)}function jr(){const e=A.useContext(Uy);if(e===null)throw new Error(xU);return A.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const EM={display:"none"},eqn={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},wU="react-flow__node-desc",kU="react-flow__edge-desc",tqn="react-flow__aria-live",nqn=e=>e.ariaLiveMessage,rqn=e=>e.ariaLabelConfig;function sqn({rfId:e}){const n=jn(nqn);return f.jsx("div",{id:`${tqn}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:eqn,children:n})}function iqn({rfId:e,disableKeyboardA11y:n}){const t=jn(rqn);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${wU}-${e}`,style:EM,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${kU}-${e}`,style:EM,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(sqn,{rfId:e})]})}const Gy=A.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:fs(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});Gy.displayName="Panel";const NM="https://reactflow.dev?utm_source=attribution";function aqn({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(Gy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${NM}`,children:f.jsx("a",{href:NM,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const oqn=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},I1=e=>e.id;function cqn(e,n){return Nr(e.selectedNodes.map(I1),n.selectedNodes.map(I1))&&Nr(e.selectedEdges.map(I1),n.selectedEdges.map(I1))}function lqn({onSelectionChange:e}){const n=jr(),{selectedNodes:t,selectedEdges:r}=jn(oqn,cqn);return A.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const uqn=e=>!!e.onSelectionChangeHandlers;function _qn({onSelectionChange:e}){const n=jn(uqn);return e||n?f.jsx(lqn,{onSelectionChange:e}):null}const SU=[0,0],fqn={x:0,y:0,zoom:1},dqn=["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"],zM=[...dqn,"rfId"],hqn=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}),jM={translateExtent:J0,nodeOrigin:SU,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function pqn(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:c}=jn(hqn,Nr),u=jr();A.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=jM,o()}),[]);const h=A.useRef(jM);return A.useEffect(()=>{for(const _ of zM){const p=e[_],m=h.current[_];p!==m&&(typeof e[_]>"u"||(_==="nodes"?n(p):_==="edges"?t(p):_==="minZoom"?r(p):_==="maxZoom"?s(p):_==="translateExtent"?i(p):_==="nodeExtent"?a(p):_==="ariaLabelConfig"?u.setState({ariaLabelConfig:iHn(p)}):_==="fitView"?u.setState({fitViewQueued:p}):_==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[_]:p})))}h.current=e},zM.map(_=>e[_])),null}function TM(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function mqn(e){var r;const[n,t]=A.useState(e==="system"?null:e);return A.useEffect(()=>{if(e!=="system"){t(e);return}const s=TM(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=TM())!=null&&r.matches?"dark":"light"}const AM=typeof document<"u"?document:null;function rm(e=null,n={target:AM,actInsideInputWithModifier:!0}){const[t,r]=A.useState(!1),s=A.useRef(!1),i=A.useRef(new Set([])),[a,o]=A.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(_=>typeof _=="string").map(_=>_.replace("+",` +${te.error}`:te.text,children:[te.dispatchState==="blocked"?f.jsx(wS,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(N3n,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:te.text}),te.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:te.dispatchState==="retrying"?k9n(te.nextRetryAt,to):D7e()}),te.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void Rl(te.id),"aria-label":_J({text:te.text}),disabled:xn!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:xn===te.id?uL():Ys()}),f.jsx("button",{onClick:()=>za(te.id),"aria-label":sJ({text:te.text}),disabled:xn!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:G5e()}),ge===eo&&geza(te.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:f.jsx(_r,{size:11})})]},te.id))}),si&&f.jsxs("div",{id:e_,role:"note",className:`composer-demo-hint ${AR}`,children:[f.jsx(gh,{size:16,className:"shrink-0 text-primary"}),f.jsx("span",{className:"flex-1",dir:"auto",children:z2e()}),f.jsx(Ft,{size:"small","aria-label":Xg(),title:Xg(),onClick:()=>{var te;G(!0),(te=In.current)==null||te.focus()},children:f.jsx(_r,{size:14})})]}),b&&!ae&&c&&f.jsxs("div",{role:"note",className:`composer-demo-run-hint ${AR}`,children:[f.jsx(gh,{size:16,className:"shrink-0 text-primary"}),f.jsxs("span",{className:"flex flex-1 flex-wrap items-center gap-x-1.5 gap-y-1",dir:"auto",children:[f.jsx("span",{children:fN()}),f.jsxs(Oe,{size:"small",onClick:()=>c(b,"keepOpen"),children:[f.jsx(ko,{size:14}),u3()]}),f.jsx("span",{children:_N()})]}),f.jsx(Ft,{size:"small","aria-label":Xg(),title:Xg(),onClick:()=>{var te;ce(!0),(te=In.current)==null||te.focus()},children:f.jsx(_r,{size:14})})]}),f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:b?`${fN()} ${u3()} ${_N()}`:""}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${Ei?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[st&&!st.agentReady&&f.jsx("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:st.catalogPending?f.jsxs("span",{children:[st.name," — ",nf()]}):f.jsxs(f.Fragment,{children:[f.jsxs("strong",{children:[st.name," ",n4e()]})," ",st.agentNote?vh(st.agentNote):W7e()]})}),Rr&&f.jsx(OLn,{skills:Fs,activeIndex:ei,onPick:Za,onHover:rr}),Ke&&f.jsx(BLn,{activeSessionId:Y,onClose:()=>gt(!1),onResume:te=>{gt(!1),ne("all"),y(te.id,{projectId:te.projectId})},onImport:te=>{gt(!1),No(te)}}),pe.length>0&&f.jsx(oIn,{annotations:pe,onClear:()=>{be([]),window.requestAnimationFrame(()=>{var te;return(te=In.current)==null?void 0:te.focus()})},onRemove:te=>{const ge=pe.filter(Ee=>Ee.id!==te);be(ge),ge.length===0&&window.requestAnimationFrame(()=>{var Ee;return(Ee=In.current)==null?void 0:Ee.focus()})}}),We.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:We.map((te,ge)=>{const Ee=()=>Ne(Ie=>Ie.filter((Pe,Yt)=>Yt!==ge));return te.mediaType==="application/pdf"?f.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:te.name,children:[f.jsx($b,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:te.name??"document.pdf"}),f.jsx("button",{title:xN(),"aria-label":xN(),onClick:Ee,children:f.jsx(_r,{size:11})})]},ge):f.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:[f.jsx("img",{src:te.dataUrl,alt:TD()}),f.jsx("button",{title:wN(),"aria-label":wN(),onClick:Ee,children:f.jsx(_r,{size:11})})]},ge)})}),xe&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:xe}),Le&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Le}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${Ei?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:In,"aria-describedby":si?e_:void 0,className:"relative z-1 bg-transparent",value:oe,placeholder:ni?jEe():ri&&st?L9e({harness:Ce(hu[st.id]),shortcut:Ce(hs)}):Vt?st!=null&&st.agentReady?c1e({harness:Ce(hu[Vt.harness])}):Wge({harness:Ce(hu[Vt.harness])}):Gpe(),rows:2,onPaste:Ps,onDragOver:te=>{te.dataTransfer.types.includes("Files")&&te.preventDefault()},onDrop:te=>{te.dataTransfer.files.length!==0&&(te.preventDefault(),wa(Array.from(te.dataTransfer.files)))},onChange:te=>{const ge=te.target.value,Ee=te.target.selectionStart;Jr(Ee);const Ie=Ee>0&&/\s/.test(ge[Ee-1])&&!ni&&!Rs.current&&yR(ge)===null?_4(ge,Ee-1):null,Pe=Ie&&K5(Ie.query),Yt=Ie?(ge.slice(0,Ie.start)+ge.slice(Ie.end)).trim():"";if(Ie&&Pe&&(Pe==="plan"||!f4(Pe)&&!Yt)&&vi.some(vn=>vn.name===Pe)){zo(Pe,ge,Ie);return}ue(ge),Tr(!1)},onSelect:te=>Jr(te.currentTarget.selectionStart),onCompositionStart:()=>{Rs.current=!0},onCompositionEnd:()=>{Rs.current=!1},onKeyDown:te=>{if(Rr){if(te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();const ge=te.key==="ArrowDown"?1:-1;rr((ei+ge+Fs.length)%Fs.length);return}if(te.key==="Tab"||te.key==="Enter"){te.preventDefault(),Za(Fs[ei]);return}if(te.key==="Escape"){te.preventDefault(),Tr(!0);return}}if(te.key==="Backspace"&&Eo(te.currentTarget)){te.preventDefault();return}if(te.key==="Enter"&&!te.shiftKey&&!te.nativeEvent.isComposing){if(te.preventDefault(),Ei){jl();return}zl({queue:te.metaKey||te.ctrlKey})}}}),f.jsx(MLn,{text:oe,editingTokenEnd:Kr==null?void 0:Kr.end,isCommand:kl,skills:vi,projectId:e,textareaRef:In})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:Zr.ref,children:[f.jsx(Ft,{type:"button",className:"composer-bare",title:J2(),"aria-label":J2(),"aria-haspopup":"dialog","aria-expanded":Zr.open,onClick:()=>Zr.setOpen(te=>!te),children:f.jsx(Z5n,{size:16})}),Zr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:J2()}),f.jsx(F9n,{})]})]}),f.jsx("input",{ref:un,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:te=>{wa(Array.from(te.target.files??[])),te.target.value=""}}),f.jsx(Ft,{type:"button",className:"composer-attach",title:aN(),"aria-label":aN(),onClick:()=>{var te;return(te=un.current)==null?void 0:te.click()},children:f.jsx(R5n,{size:16})}),ks&&f.jsxs(Oe,{type:"button",variant:"ghost",active:!0,className:"group max-w-60",title:uN({goal:ia(ks)}),"aria-label":uN({goal:ia(ks)}),onClick:()=>void Si("clear"),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(GI,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(_r,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{className:"truncate",children:Qwe()})]}),Vi&&f.jsxs(Oe,{type:"button",variant:"ghost",active:!0,className:"group",title:mN(),"aria-label":mN(),onClick:()=>void Qu(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(u5n,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(_r,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:m3e()})]}),Ei&&f.jsxs(Oe,{type:"button",variant:"ghost",active:!0,className:"group",title:pN(),"aria-label":pN(),onClick:ep,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(Cf,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(_r,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:ED()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx(NSn,{value:Vt,onSelect:dc,onOpenSettings:()=>a("harnesses"),permissionChoices:st!=null&&st.agentReady?(Jt==null?void 0:Jt.permissionModes)??[]:[],defaultPermissionId:(Jt==null?void 0:Jt.defaultPermissionMode)??null,onSelectPermission:es,reasoningChoices:st!=null&&st.agentReady?wi.choices:[],defaultReasoningId:wi.defaultId,onSelectReasoning:ki,lockHarness:!!$t,openRequest:cr}),f.jsx(LLn,{usage:$t==null?void 0:$t.contextUsage})]}),sr&&!ni?f.jsx(Ft,{className:"send-btn",variant:"stop",title:NN(),"aria-label":NN(),onClick:Tl,children:f.jsx(_r,{size:16})}):f.jsx(Ft,{className:`send-btn ${si&&(st!=null&&st.agentReady)?"ring-2 ring-primary ring-offset-2 ring-offset-background":""}`,variant:"primary",title:Ei?SN():l3(),"aria-label":Ei?SN():l3(),onClick:()=>void(Ei?jl():zl()),disabled:Ei?!bi||!Y&&!(st!=null&&st.agentReady):!(st!=null&&st.agentReady)||!oe.trim()&&We.length===0&&pe.length===0,children:f.jsx(HI,{size:16})})]})]})]})]})]})}const AR="flex items-center gap-2.5 mb-2.5 py-2 ps-3.5 pe-2 rounded-lg border border-border bg-surface text-text text-sm leading-normal",i$n=[],a$n=[];function Pa({className:e,...n}){return f.jsx("div",{className:ys("relative flex min-h-0 flex-1 flex-col",e),...n})}function qd({className:e,...n}){return f.jsx("div",{className:ys("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Qo({className:e,...n}){return f.jsx("div",{className:ys("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const RR=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function o$n({projectId:e,sessionId:n,spawnPartId:t,onOpenFile:r,onOpenRun:s,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:c}){var k;const u=ut(ol(n)),h=((k=u.data)==null?void 0:k.messages)??(u.isError?[]:null),_=A.useRef(null),p=A.useRef(null),m=A.useRef(!0);if(A.useLayoutEffect(()=>{m.current=!0;const v=_.current;v&&(v.scrollTop=v.scrollHeight)},[n,t]),A.useLayoutEffect(()=>{const v=_.current;v&&m.current&&(v.scrollTop=v.scrollHeight)},[h]),A.useEffect(()=>{const v=_.current,b=p.current;if(!v||!b)return;const x=new ResizeObserver(()=>{m.current&&(v.scrollTop=v.scrollHeight)});return x.observe(b),x.observe(v),()=>x.disconnect()},[h===null]),h===null)return f.jsx(Pa,{children:f.jsx("div",{className:RR,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:Wfn()})})});let w=null;for(const v of h)if(w=lb(v.parts,t),w)break;return f.jsx(Pa,{children:f.jsx("div",{className:RR,ref:_,onScroll:v=>{const b=v.currentTarget;m.current=b.scrollHeight-b.scrollTop-b.clientHeight<60},children:f.jsx("div",{ref:p,children:w?f.jsx(uH,{projectId:e,sessionId:n,children:f.jsx(VIn,{spawn:w,onOpenFile:r,onOpenRun:s,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:c})}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:tdn()})})})})}function c$n({experiment:e}){var s;const n=ut(Q$(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(qd,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Qo,{children:[Ghe()," ",Ce(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(DB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(IB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?ipe():$he()}):f.jsx(Qo,{children:Zhe()})})}function WH({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:c}){return f.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:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":HNe(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:QNe()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:MD()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(zm,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(Ih,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(Gb,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Ft,{title:RN(),"aria-label":RN(),onClick:c,children:o?f.jsx(jt,{}):f.jsx(B5n,{size:13})})]})}const l$n=/\.(md|mdx|markdown)$/i,u$n=/\.tex$/i,_$n=/\.html?$/i,f$n=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,d$n=/\.(csv|tsv|xlsx?|ods)$/i,h$n=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,p$n=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,m$n=/\.pdf$/i,g$n=/\.(docx?|log|rtf|txt)$/i;function v$n(e){return f$n.test(e)}function pC(e){return l$n.test(e)}function QH(e){return u$n.test(e)}function b$n(e){return _$n.test(e)}function zh({name:e}){const n=pC(e)?"markdown":v$n(e)?"image":d$n.test(e)?"spreadsheet":h$n.test(e)?"code":p$n.test(e)?"archive":m$n.test(e)?"pdf":g$n.test(e)||QH(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.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"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.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"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.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 ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function XH(e,n){const t=navigator.clipboard;if(!t){bn(ID(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>bn(tf(),"success")).catch(r=>bn(r instanceof Error?r.message:String(r),"error"))}function YH({name:e,onCommit:n,onCancel:t}){const[r,s]=A.useState(e),i=A.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Ur,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":mBe({path:Ce(e)}),onFocus:o=>{const c=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,c>0?c:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function ZH(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function JH({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=A.useRef(null),c=A.useRef(a);c.current=a;const[u,h]=A.useState({x:e.x,y:e.y});A.useLayoutEffect(()=>{var k;const m=o.current;if(!m)return;const w=document.activeElement instanceof HTMLElement?document.activeElement:null;return h({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(k=m.querySelector("button"))==null||k.focus(),()=>{m.contains(document.activeElement)&&(w==null||w.focus())}},[e]),A.useEffect(()=>{const m=()=>c.current(),w=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||c.current()},k=v=>{if(v.key==="Tab"){v.preventDefault(),c.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),c.current())};return document.addEventListener("pointerdown",w),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",k,!0),()=>{document.removeEventListener("pointerdown",w),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",k,!0)}},[]);const _=m=>{c.current(),m()},p=(m,w,k=!1)=>f.jsx(Dn,{size:"compact",role:"menuitem",danger:k,onClick:()=>_(w),children:f.jsx("span",{children:m})});return Fi.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":nBe({path:Ce(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,x;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const w=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],k=w.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:w[0]),v=m.key==="ArrowDown"?1:-1;(x=w[(k+v+w.length)%w.length])==null||x.focus()},children:[p(lBe(),n),t&&p(zD(),t),r&&p(Q$e(),r),p(Ife(),s),i&&p(ND(),i,!0)]}),document.body)}const ek=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),MR=["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 OR(){return{dirs:new Map,files:[]}}function eq(e){const n=OR();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(ac,{size:13,className:MR}):f.jsx(Wa,{size:13,className:MR}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(mC,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:c,onRename:u,onCancelRename:h})]})}function mC({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:c,onCancelRename:u}){const h=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),_=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[h.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(y$n,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:c,onCancelRename:u},`d:${m}`)}),_.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&c&&u)return f.jsxs("div",{className:ek,style:{paddingInlineStart:8+t*14},children:[f.jsx(zh,{name:p}),f.jsx(YH,{name:p,onCommit:k=>c(m,k),onCancel:u})]},`f:${m}`);const w=Gr(k=>i(m,k));return f.jsxs("button",{type:"button",className:ek,style:{paddingInlineStart:8+t*14},...w,onContextMenu:k=>{o&&(k.preventDefault(),o(k,m))},onKeyDown:k=>{if(o&&(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10")){k.preventDefault(),o(k,m);return}w.onKeyDown(k)},title:TY({name:Ce(m)}),children:[f.jsx(zh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function x$n({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var z,E;const c=t.branchName,u=ut({...Y$(e,{ref:c}),enabled:r==="files",subscribed:r==="files"}),h=ut({...Uv(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),_=u.data,p=(z=u.error)==null?void 0:z.message,m=u.isFetching,w=Q$(t.id),k=oK({queryKey:w.queryKey})>0,v=(E=h.data)!=null&&E.exists&&h.data.branch===c?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},x=A.useMemo(()=>_?eq(_.entries):null,[_]),y=r==="files"?m:k,C=A.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(WH,{view:r,onViewChange:i,branchLabel:c,branchTitle:`Committed branch ${c}`,githubHref:n.githubEnabled?Ob(n.githubOwner,n.githubRepo,c):void 0,githubTitle:yD({branch:Ce(c)}),refreshing:y,onRefresh:()=>r==="files"?b():void Je.invalidateQueries(w)}),r==="changes"?f.jsx(c$n,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(_==null?void 0:_.truncated)&&f.jsx(Qo,{children:cze()}),p&&x&&f.jsxs(Qo,{children:[wze()," ",Ce(p)]}),f.jsx(qd,{children:x?x.dirs.size===0&&x.files.length===0?f.jsx(Qo,{children:pze()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(mC,{node:x,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,c,j)})}):f.jsx(Qo,{children:p?Wk({error:Ce(p)}):Qk()})})]})]})}function gC({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function w$n({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var B,L,F;const c=n.id,h=((B=ut(Ga(c)).data)==null?void 0:B.some(U=>U.id===e&&U.busy))??!1,_=ut({...Uv(e??""),enabled:!!e,refetchInterval:h?5e3:!1}),p=_.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},w=ut({...Y$(c,m),enabled:!e||_.isSuccess,refetchInterval:h?5e3:!1}),k=w.data,v=(L=_.error??w.error)==null?void 0:L.message,b=_.isFetching||w.isFetching,[x,y]=A.useState(null),[C,z]=A.useState(null),E=A.useCallback(()=>{e&&Je.invalidateQueries(Uv(e)),Je.invalidateQueries({queryKey:Tt("getCodeTree",c),predicate:U=>!fD(U)})},[e,c]),T=A.useRef(h);A.useEffect(()=>{T.current&&!h&&E(),T.current=h},[h,E]);const j=A.useMemo(()=>k?eq(k.entries):null,[k]),M=A.useCallback(U=>{const K=new Set(r);K.has(U)?K.delete(U):K.add(U),i(K)},[r,i]),D=e&&(p!=null&&p.exists)?p:null,I=(D==null?void 0:D.branch)??(D!=null&&D.baselineBranch?ibn({branch:Ce(D.baselineBranch)}):tS()),$=((F=D==null?void 0:D.files)==null?void 0:F.length)??0,q=D?Gvn({branch:Ce(`${I}${$>0?"*":""}`)}):Zvn({branch:Ce(n.baselineBranch)}),H=D?D.branch:n.baselineBranch,Q=(U,K)=>D?a(U,e,void 0,K):a(U,void 0,n.baselineBranch,K),V=(k==null?void 0:k.root)==="worktree",Z=async(U,K)=>{try{await vyn(c,U,K,{sessionId:e}),E()}catch(ne){bn(ne instanceof Error?ne.message:String(ne),"error")}},Y=U=>{const K=(k==null?void 0:k.path)??n.repoPath;XH(K,U)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(WH,{view:D?t:"files",onViewChange:s,showViewToggle:!!D,branchLabel:q,branchTitle:q,githubHref:n.githubEnabled&&H?Ob(n.githubOwner,n.githubRepo,H):void 0,githubTitle:H?yD({branch:Ce(H)}):void 0,refreshing:b,onRefresh:E}),v&&(p||k)&&f.jsxs(Qo,{children:[Pbn()," ",Ce(v)]}),!k||e&&!p?f.jsx(qd,{children:f.jsx(Qo,{children:v?Wk({error:Ce(v)}):Qk()})}):D&&t==="changes"?f.jsx(qd,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!D.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:Ebn()}):f.jsxs(f.Fragment,{children:[D.diff.truncated&&f.jsx(DB,{bytesRead:D.diff.bytesRead,byteLimit:D.diff.byteLimit}),f.jsx(IB,{diff:D.diff.diff,partial:D.diff.truncated})]})}):f.jsxs(qd,{children:[k.truncated&&f.jsx(Qo,{children:fbn()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(gC,{icon:Ou,title:Mbn(),description:PGe()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(mC,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Q,renamingPath:C,onContextMenu:(U,K)=>{y(ZH(U,K))},onRename:(U,K)=>{z(null),Z(U,{action:"rename",newName:K})},onCancelRename:()=>z(null)})}):f.jsx(Qo,{children:bbn()})]}),x&&f.jsx(JH,{target:x,onOpen:()=>Q(x.path,"keepOpen"),onRename:V&&o(x.path)?()=>z(x.path):void 0,onDuplicate:V?()=>void Z(x.path,{action:"duplicate"}):void 0,onCopyPath:()=>Y(x.path),onDelete:V?()=>{window.confirm(H$e({path:Ce(x.path)}))&&Z(x.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function tq({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=A.useMemo(()=>{if(!e)return[];const h=e.replace(/\r\n?/g,` +`),_=F$(h,MS(n));return h.endsWith(` +`)?_.slice(0,-1):_},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=A.useRef(null);A.useEffect(()=>{var h;r!==void 0&&(a?((h=o.current)==null||h.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:c}=k$(i.length),u=A.useMemo(()=>i.map((h,_)=>f.jsxs("div",{ref:_+1===a?o:void 0,className:`file-view-line flex items-stretch ${_+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":_+1,className:`${w$} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${c}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${Hv} ${x$}`,children:H$(h)?f.jsx("br",{}):h})]},_)),[i,c,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${Hv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${c}ch`},"aria-hidden":"true"}),u]})}const k$n="modulepreload",S$n=function(e){return"/"+e},DR={},C$n=function(n,t,r){let s=Promise.resolve();if(t&&t.length>0){let a=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=a(t.map(u=>{if(u=S$n(u),u in DR)return;DR[u]=!0;const h=u.endsWith(".css"),_=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${_}`))return;const p=document.createElement("link");if(p.rel=h?"stylesheet":k$n,h||(p.as="script"),p.crossOrigin="",p.href=u,c&&p.setAttribute("nonce",c),document.head.appendChild(p),h)return new Promise((m,w)=>{p.addEventListener("load",m),p.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return n().catch(i)})},ub=A.createContext(null);function E$n({url:e,name:n}){return f.jsx(Ih,{size:"small",href:e,download:n,"aria-label":Sv({name:Ce(n)}),"data-tip":Sv({name:Ce(n)}),"data-tip-align":"end",children:f.jsx(Lb,{size:13})})}const N$n=A.lazy(()=>C$n(()=>import("./PdfPreview-1o-LUkLU.js"),__vite__mapDeps([0,1])).catch(e=>(console.error("PDF viewer failed to load",e),{default:rq})));function nq(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function rq({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[ktt()," ",f.jsxs("a",{href:e,download:n,children:[_3()," ",Ce(n)]})]})}function tk({kind:e,url:n,name:t,download:r=!0}){const[s,i]=A.useState(!1),a=A.useContext(ub);if(A.useEffect(()=>i(!1),[e,n]),s)return f.jsx(rq,{url:n,name:t});let o;return e==="image"?o=f.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:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?o=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?o=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):o=f.jsx(A.Suspense,{fallback:f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center",children:f.jsx(jt,{})}),children:f.jsx(N$n,{url:n,name:t,download:r,onError:()=>i(!0)},n)}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[o,r&&e!=="pdf"&&a&&Fi.createPortal(f.jsx(E$n,{url:n,name:t}),a)]})}const z$n=e=>({queryKey:Tt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function sq(e,n=!0){return ut({...z$n(e),enabled:n,subscribed:n}).data??null}function j$n(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function T$n(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),c=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const h=u.join("/");if(!h)return null;const _=new URLSearchParams(c);_.delete("path");const p=_.toString();return{path:h,url:`${sf(e,h)}${p?`&${p}`:""}${i}`}}function A$n(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` +---`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const iq="orx:files-tree-width",aq="orx:artifacts-collapsed:",oq=180,cq=320,R$n=8,M$n=280;function O$n(){try{const e=Number(localStorage.getItem(iq));if(Number.isFinite(e)&&e>=oq&&e<=cq)return e}catch{}return M$n}function D$n(e){try{const n=localStorage.getItem(`${aq}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function Q0(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=Q0(t.children??[],n);if(r)return r}}return null}function lq({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(j$n(i))return i;const a=T$n(e,n,i);if(!a)return null;const o=Q0(r,a.path);if(!o)return a.url;const c=a.url.indexOf("#"),u=c===-1?a.url:a.url.slice(0,c),h=c===-1?"":a.url.slice(c);return`${u}&v=${o.modifiedAt}:${o.size}${h}`};return f.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-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_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-prose-emphasis [&_.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-sm [&_.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]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_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-start [&_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-start [&_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]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-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-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_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:f.jsx(hTn,{remarkPlugins:[iH,[aH,fH]],rehypePlugins:[OF],components:{a:({href:i,children:a,...o})=>{const c=!i||i.startsWith("#"),u=c?i:s(i);return u?f.jsx("a",{...o,href:u,...c?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...dH},children:cH(A$n(t))})})}function L$n(e){return e.presentation==="text"&&pC(e.name)?"markdown":nq(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function I$n(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=ZL,i=d6(e,n.path),a=ut({...i,enabled:s,subscribed:s}),o=A.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});A.useEffect(()=>{const h=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&h.projectId===e&&h.path===n.path&&(h.modifiedAt!==n.modifiedAt||h.size!==n.size||h.version!==null&&h.version!==r)&&Je.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const c=a.data;return{text:c&&!c.binary?c.content:null,binary:(c==null?void 0:c.binary)??!1,truncated:(c==null?void 0:c.truncated)??!1,error:c?null:((u=a.error)==null?void 0:u.message)??(c===null?Ufe():null),wantsText:s}}function $$n({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=L$n(n),i=sq(sf(e,n.path)),{text:a,binary:o,truncated:c,error:u,wantsText:h}=I$n(e,n,s,i),[_,p]=A.useState(!1),[m,w]=A.useState(null),k=s==="markdown",v=n.path.split("/").slice(0,-1).join("/"),b=`${sf(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let x;return s==="image"||s==="audio"||s==="video"||s==="pdf"?x=f.jsx(ub.Provider,{value:m,children:f.jsx(tk,{kind:s,url:b,name:n.name})}):s==="download"||!h||o?x=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?Tfe():Ahe()," ",f.jsx("a",{href:b,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?$D():Yfe()})]}):u?x=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Sde()," ",Ce(u)]}):a===null?x=f.jsxs(Vr,{children:[f.jsx(jt,{})," ",SD()]}):k&&!_?x=f.jsx(lq,{projectId:e,folder:v,markdown:a,entries:r}):x=f.jsx(tq,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head @container flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(zh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ce(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0 @max-xl:hidden",children:[she()," ",new Date(n.modifiedAt).toLocaleString(N(),{dateStyle:"medium",timeStyle:"short"})]}),f.jsx("div",{ref:w,className:"contents"}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:nl(n.size)}),k&&f.jsx(Ft,{size:"small",active:_,"data-tip":_?Ev():zd(),"data-tip-align":"end","aria-label":_?Ev():zd(),onClick:()=>p(y=>!y),children:f.jsx(P3,{size:13})}),f.jsx(Ih,{size:"small",href:b,target:"_blank",rel:"noopener noreferrer","data-tip":ZE(),"data-tip-align":"end","aria-label":ZE(),children:f.jsx(of,{size:13})}),f.jsx(Ft,{size:"small","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),onClick:()=>{window.confirm(Gk({path:Ce(n.path)}))&&t(n.path)},children:f.jsx(Ef,{size:13})})]}),f.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 ${k&&!_?"doc":""}`,children:[x,c&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ade()})]})]})}function uq({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:h,onCancelRename:_}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var w;const m={paddingInlineStart:8+Math.min(n,R$n)*14};if(p.isDir){const k=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.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-start cursor-pointer font-[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:m,onClick:()=>s(p.path),children:[f.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":k?rfe({name:Ce(p.name)}):kfe({name:Ce(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Wa,{size:13,className:k?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Ft,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":gde(),"data-tip-align":"end","aria-label":mfe({name:Ce(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(Gk({path:Ce(p.path)}))&&o(p.path)},children:f.jsx(Ef,{size:12})})]}),k&&(((w=p.children)==null?void 0:w.length)??0)>0&&f.jsx(uq,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:h,onCancelRename:_})]},p.path)}return c===p.path?f.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-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(zh,{name:p.name}),f.jsx(YH,{name:p.name,onCommit:k=>h(p.path,k),onCancel:_})]},p.path):f.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-start cursor-pointer font-[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===p.path?"selected":""}`,style:m,title:qQ({path:Ce(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:k=>{k.preventDefault(),i(p.path),u(k,p.path)},onAuxClick:k=>{k.button===1&&(k.preventDefault(),i(p.path),a(p.path))},onKeyDown:k=>{if(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10"){k.preventDefault(),i(p.path),u(k,p.path);return}if(k.key===" "){k.preventDefault(),k.stopPropagation(),i(p.path);return}k.key==="Enter"&&(k.preventDefault(),k.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(zh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function B$n({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=A.useState(null),[a,o]=A.useState(()=>D$n(e.id)),[c,u]=A.useState(O$n),[h,_]=A.useState(null),[p,m]=A.useState(null),w=A.useRef(null);A.useEffect(()=>{try{localStorage.setItem(`${aq}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const k=E=>{var I;E.preventDefault(),E.currentTarget.setPointerCapture(E.pointerId);const T=(I=w.current)==null?void 0:I.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const q=Math.round($.clientX-((T==null?void 0:T.left)??0)),H=Math.min(Math.max(q,oq),cq);u(H);try{localStorage.setItem(iq,String(H))}catch{}},D=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",D),window.removeEventListener("pointercancel",D),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",D),window.addEventListener("pointercancel",D)};A.useEffect(()=>{if(!s||!n)return;const E=Q0(n.entries,s);(!E||E.isDir)&&i(null)},[s,n]);const v=E=>o(T=>{const j=new Set(T);return j.has(E)?j.delete(E):j.add(E),j}),b=E=>{(s===E||s!=null&&s.startsWith(E+"/"))&&i(null),Sxn(e.id,E).catch(()=>{})},x=async(E,T)=>{try{await Cxn(e.id,E,T),T.action==="rename"&&s===E&&i(null)}catch(j){bn(j instanceof Error?j.message:String(j),"error")}},y=E=>{n&&XH(n.dir,E)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(Vr,{className:"p-5",children:[f.jsx(jt,{})," ",Yde()]})});const C=E=>f.jsx(uq,{entries:E,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{_(ZH(T,j))},onRename:(T,j)=>{m(null),x(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),z=s?Q0(n.entries,s):null;return n.entries.length===0?f.jsx(gC,{icon:vS,title:_he(),description:She()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:w,style:{width:c},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:k}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:$de()})]})]}),z?f.jsx($$n,{projectId:e.id,entry:z,onDelete:b,artifactEntries:n.entries},z.path):f.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-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(N5n,{size:22,strokeWidth:1.5}),f.jsx("span",{children:sde()})]}),h&&f.jsx(JH,{target:h,onOpen:()=>t(h.path),onRename:r(h.path)?()=>m(h.path):void 0,onDuplicate:()=>void x(h.path,{action:"duplicate"}),onCopyPath:()=>y(h.path),onDelete:()=>{window.confirm(Gk({path:Ce(h.path)}))&&b(h.path)},onClose:()=>_(null)})]})}const _q=20*1024*1024,fq="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-base [&_h3]:font-semibold [&_h3]:text-text",dq="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",P$n="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",F$n="text-sm font-normal text-text",H$n="mt-1 mb-0 text-sm leading-relaxed text-text";function hq(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function q$n(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function pq({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=A.useState(!1),a=A.useRef(null);return f.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 text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const c=(u=o.dataTransfer.files)==null?void 0:u[0];c&&r(c)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var c;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(c=a.current)==null||c.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const c=(u=o.target.files)==null?void 0:u[0];c&&r(c),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(jt,{}),f.jsx("span",{children:hcn()})]}):f.jsxs(f.Fragment,{children:[f.jsx(nkn,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function mq({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[nl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",wo(n)]})]})}function U$n({skill:e,onError:n}){const t=dn({mutationFn:Wxn}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:F$n,children:e.name}),e.origin&&f.jsx(Wt,{size:"small",children:e.origin})]}),f.jsx(mq,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Ft,{size:"small","data-tip":e.origin?gan():fon(),"data-tip-align":"end","aria-label":e.origin?Aan({name:Ce(e.name)}):lin({name:Ce(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?San({name:Ce(e.name)}):nin({name:Ce(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Ef,{size:13})})]})}function G$n({template:e,onError:n}){const t=dn({mutationFn:Gxn}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:P$n,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:H$n,children:[e.entry,s>0&&(s===1?ran():$an({count:tn(s)}))]})]}),f.jsx(mq,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Ft,{"data-tip":bon(),"data-tip-align":"end","aria-label":kin({name:Ce(e.name)}),disabled:r,onClick:()=>{window.confirm(min({name:Ce(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Ef,{size:13})})]})}function V$n(){var x;const e=dn({mutationFn:Kxn}),n=ut(B2n()),t=n.data,r=A.useRef(null),[s,i]=A.useState(!1),[a,o]=A.useState(!1),c=A.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);A.useLayoutEffect(()=>{c();const y=r.current;if(!y)return;const C=new ResizeObserver(c);return C.observe(y),()=>C.disconnect()},[t,c]);const u=n.isFetching,h=(x=n.error)==null?void 0:x.message,[_,p]=A.useState(!1),[m,w]=A.useState(null),k=()=>{n.refetch()},v=A.useRef(!1),b=A.useCallback(async y=>{if(!v.current){if(w(null),!q$n(y.name)){w(zcn());return}if(y.size>_q){w(OL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await hq(y)})}catch(C){w(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:fq,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:ocn()}),f.jsxs(Oe,{className:"ms-auto",size:"small",onClick:k,disabled:u,children:[f.jsx(Qa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Cm()]})]}),f.jsx("p",{className:dq,children:Tin()}),f.jsx(pq,{accept:".md,.markdown,.zip",busy:_,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Iin()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Qsn()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),h&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[Gan()," ",h]}),t===void 0?h?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",Mon()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Kon()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:c,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(U$n,{skill:y,onError:w},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function K$n(){var h;const e=dn({mutationFn:Uxn}),n=ut($2n()),t=n.data,r=(h=n.error)==null?void 0:h.message,[s,i]=A.useState(!1),[a,o]=A.useState(null),c=A.useRef(!1),u=A.useCallback(async _=>{if(c.current)return;o(null);const p=_.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(Dcn());return}if(_.size>_q){o(OL());return}c.current=!0,i(!0);try{await e.mutateAsync({filename:_.name,contentBase64:await hq(_)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{c.current=!1,i(!1)}},[]);return f.jsxs("section",{className:fq,children:[f.jsx("h3",{children:Eon()}),f.jsx("p",{className:dq,children:xcn()}),f.jsx(pq,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Uin()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:wdn()})]}),onFile:_=>void u(_)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[Zan()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",Pon()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:ecn()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(_=>f.jsx(G$n,{template:_,onError:o},_.name))})]})}function W$n(){return f.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:[f.jsx("h1",{children:ion()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:uan()}),f.jsx(V$n,{}),f.jsx(K$n,{})]})}const Q$n="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function qc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-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-hover-strong [&_.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-0 [&: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]:-start-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]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?Q$n:""}`,onClick:i,onDoubleClick:a,title:s?pdn({label:n}):n,"aria-label":s?cdn({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:jNe(),onPointerDown:c=>c.preventDefault(),onClick:c=>{c.stopPropagation(),o()},children:f.jsx(_r,{size:12})})]})}const LR=["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 X$n({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:LR,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:LR,href:Ob(e,n,t),target:"_blank",rel:"noopener noreferrer",title:Cv({name:Ce(t)}),children:[f.jsx("code",{children:t}),f.jsx(Gb,{size:12})]})}const x4=["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-sm","[&_h2]:font-semibold"].join(" "),IR=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function $R(e){return new Date(e).toLocaleString(N(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function BR(e,n){return R0((e.endedAt??n)-e.createdAt)}function Y$n({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(h=>h.status==="running"||h.status==="starting"),[c,u]=A.useState(()=>Date.now());return A.useEffect(()=>{if(!o)return;u(Date.now());const h=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(h)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.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:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx(cl,{status:a?la(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Oe,{...Gr(h=>s(a.id,h)),children:[f.jsx(ko,{size:15}),fLe()]}),f.jsxs(Oe,{...Gr(i),children:[f.jsx(Bb,{size:15}),gDe()]})]}),e.description&&f.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-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:$De()}),f.jsx(nc,{text:e.description})]}),f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:a?uDe():PLe()}),a&&f.jsxs(f.Fragment,{children:[f.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:[f.jsx(cl,{status:la(a)}),f.jsx(RS,{backend:a.backend}),f.jsxs("span",{title:MLe(),children:[f.jsx(f3n,{size:13}),$R(a.createdAt)]}),f.jsxs("span",{title:GDe(),children:[f.jsx(C3n,{size:13}),BR(a,c)]}),a.commitSha&&f.jsxs("span",{title:SDe(),children:[f.jsx(t5n,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[ZDe()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:IR,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(nc,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:"Git"}),f.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:[f.jsx(X$n,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[iLe()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:$R(e.createdAt),children:[ADe()," ",wo(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:IR,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:ELe()}),f.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-start [&_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((h,_)=>f.jsxs("button",{...Gr(p=>s(h.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[bLe()," ",r.length-_]}),f.jsx(cl,{status:la(h)}),f.jsx("span",{children:wo(h.createdAt)}),f.jsx("span",{children:BR(h,c)}),f.jsx(ko,{size:13})]},h.id))})]})]})})}function PR(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=Fb(t,!0);let i=!1,a=0,o=!1,c=!1;async function u(){if(o){c=!0;return}o=!0;try{for(;;){const _=await fyn(e,a);if(i)return;if(_.dataBase64&&r.write(PR(_.dataBase64)),a=_.nextOffset,_.eof)break}}catch{}finally{o=!1,c&&!i&&(c=!1,u())}}const h=K2n(e,_=>{if(i)return;const p=PR(_.dataBase64);!o&&_.offset===a?(r.write(p),a+=p.length):_.offset+p.length>a&&u()});return u(),()=>{i=!0,h(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function J$n({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:c}){const u=r.filter(h=>h.experimentId===e.id).sort((h,_)=>_.createdAt-h.createdAt);return t==="overview"?f.jsx(Y$n,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(h,_)=>o("terminal",h,_),onOpenCode:h=>c("files",h)}):f.jsx(eBn,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function eBn({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=A.useState(null),[a,o]=A.useState(null),[c,u]=A.useState(!1),h=A.useRef(null),_=t?n.find(v=>v.id===t)??null:n[0]??null,p=(_==null?void 0:_.status)==="running"||(_==null?void 0:_.status)==="starting",m=!!(_&&p&&(_.cancelRequested||a===_.id)),w=v=>{const b=n.findIndex(x=>x.id===v);return b===-1?n.length:n.length-b};A.useEffect(()=>{if(!c)return;const v=b=>{var x;(x=h.current)!=null&&x.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c]);async function k(){if(_){i(null),o(_.id);try{await UL(_.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.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:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Oe,{size:"small",variant:"ghost",disabled:m,onClick:()=>void k(),children:[f.jsx(PI,{size:13}),m?jze():DD()]}),n.length>0&&_&&f.jsxs("div",{className:"run-history relative shrink-0",ref:h,children:[f.jsxs(Oe,{title:tOe(),"aria-expanded":c,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[MN()," ",w(_.id)]}),f.jsx(cl,{status:m?"cancelling":la(_)}),f.jsx(ac,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),c&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(Dn,{className:"justify-start",active:v.id===(_==null?void 0:_.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[MN()," ",w(v.id)]}),f.jsx(cl,{status:la(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:wo(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:_?f.jsx(Z$n,{runId:_.id},_.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?go():HMe()})})]})}let nk=!1;function FR(e){nk=!0;try{return window.confirm(e)}finally{nk=!1}}const rk=e=>e.replace(/\r\n/g,` +`),HR=(e,n,t)=>{const r=rk(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r +`),conflict:null}},Kc=e=>e.draft!==e.baseline,tBn=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),nBn=e=>e.crlf?e.draft.replace(/\n/g,`\r +`):e.draft;function rBn(e,n,t){return!Kc(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class sBn{constructor(){Us(this,"buffer",null);Us(this,"listeners",new Set);Us(this,"saving",!1);Us(this,"saveError",null);Us(this,"revision",0);Us(this,"saveRevision",0);Us(this,"getSnapshot",()=>this.buffer);Us(this,"getRevision",()=>this.revision);Us(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Us(this,"set",n=>{this.buffer=n,this.notify()});Us(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Us(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Us(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Kc(this.buffer)||this.buffer.conflict!==null)}}function iBn({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var Z,Y,B;const c=ut({...C6n(),enabled:r,subscribed:r}),u=((Z=c.data)==null?void 0:Z.engine)??(c.isPending?void 0:null),h=((Y=c.data)==null?void 0:Y.hint)??null,_=((B=c.data)==null?void 0:B.installCommand)??null,[p,m]=A.useState(!1),[w,k]=A.useState(null),[v,b]=A.useState(null),[x,y]=A.useState(!1),[C,z]=A.useState(null),[E,T]=A.useState(null),[j,M]=A.useState(!1),[D,I]=A.useState(0),$=A.useCallback(L=>{M(L),L&&I(F=>F+1)},[]),q=A.useRef(o);q.current=o;const H=A.useRef(!1),Q=A.useRef(null),V=A.useCallback(()=>{if(H.current)return;Q.current=n,H.current=!0,m(!0);const L=q.current;T(null),b(null),z(null),wyn(e,n,{sessionId:t}).then(F=>{var K,ne;const U=F.pdfPath;if(F.ok&&U){k(oe=>({path:U,version:((oe==null?void 0:oe.version)??0)+1,source:L})),y(F.hadErrors),z(F.note),F.hadErrors&&b(((K=F.log)==null?void 0:K.trim())||null),$(!0);return}k(null),y(!1),z(F.note),M(!1),b(((ne=F.log)==null?void 0:ne.trim())||LZe())}).catch(F=>{k(null),y(!1),z(null),M(!1),T(F instanceof Error?F.message:String(F))}).finally(()=>{H.current=!1,m(!1)})},[e,n,t,$]);return A.useEffect(()=>{!r||!s||!a||!u||Q.current!==n&&V()},[r,s,a,u,n,V]),{engine:u,installHint:h,installCommand:_,compiling:p,compiled:w,stale:w!==null&&w.source!==o,log:v,builtWithErrors:x,note:C,error:E,showPdf:j,setShowPdf:$,viewNonce:D,compile:()=>{i==null||i(),V()},dismiss:()=>{T(null),b(null)}}}const aBn=3e4,oBn=3e4,cBn=5*6e4;function lBn({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:c}){var ue,se,G,ae;const u=A.useMemo(()=>N6n(e,n,{sessionId:t}),[e,n,t]),h=ut({...u,enabled:r,subscribed:r}),_=((ue=h.data)==null?void 0:ue.hasToken)??!1,p=((se=h.data)==null?void 0:se.hasSession)??!1,m=((G=h.data)==null?void 0:G.link)??null,w=!h.isPending,[k,v]=A.useState(null),[b,x]=A.useState(0),[y,C]=A.useState(!1),[z,E]=A.useState(null),[T,j]=A.useState(null),[M,D]=A.useState(!1),I=A.useCallback(ce=>{Fn(u.queryKey)&&Je.setQueryData(u.queryKey,pe=>pe&&{...pe,hasSession:ce})},[u]),$=A.useCallback(ce=>{Fn(u.queryKey)&&Je.setQueryData(u.queryKey,ce)},[u]);A.useEffect(()=>{E(null),x(0),L.current=!1,j(null),D(!1),V.current=!1},[r,e,n,t]),A.useEffect(()=>{D(!1)},[a]);const q=A.useRef(!1),H=A.useRef(c);H.current=c;const Q=A.useRef(o);Q.current=o;const V=A.useRef(!1),Z=A.useCallback(ce=>!_||!m||q.current||Q.current?!1:(q.current=!0,C(!0),j(null),Ryn(e,n,{sessionId:t,resolve:ce}).then(pe=>{V.current=!1,E(pe),pe.pulled.includes(n)&&(Q.current?D(!0):H.current(pe.pulled))}).catch(pe=>{V.current=!0,E(null),j(pe instanceof Error?pe.message:String(pe))}).finally(()=>{q.current=!1,C(!1)}),!0),[e,n,t,_,m]),Y=A.useRef(null),B=(k==null?void 0:k.state)==="live";A.useEffect(()=>{if(!r||!s||!w||!_||!m||o||B)return;const ce=`${n}:${m.projectId}:${a}`;Y.current!==ce&&Z()&&(Y.current=ce)},[r,s,w,_,m,n,a,o,y,Z,B]);const L=A.useRef(!1);!y&&z&&z.conflicts.length===0&&!T&&(L.current=!0);const F=r&&w&&!!m&&_&&p&&L.current,U=A.useRef(null),K=A.useRef(Promise.resolve()),ne=A.useRef(!1);ne.current=(k==null?void 0:k.state)==="stopped"&&k.error!=null;const oe=A.useRef(!1);return A.useEffect(()=>{if(!F)return;let ce=!1;const pe=()=>{const Ae=oe.current;oe.current=!1,!(!Ae&&ne.current)&&(K.current=K.current.then(()=>{if(!ce)return Nyn(e,n,{sessionId:t,retry:Ae}).then(De=>{var We;ce||((U.current===null||((We=De.status)==null?void 0:We.state)==="stopped")&&v(De.status),U.current=De.key)}).catch(De=>{ce||v({state:"stopped",error:De instanceof Error?De.message:String(De),needsSession:!1,note:null})})}))};pe();const be=setInterval(pe,oBn);return()=>{ce=!0,clearInterval(be),U.current=null,v(null),K.current=K.current.then(()=>zyn(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),A.useEffect(()=>J2n(ce=>{if(ce.key===U.current){if(ce.type==="live"){v(ce.status);return}ce.paths.includes(n)&&(Q.current?D(!0):H.current(ce.paths))}}),[n]),A.useEffect(()=>{if(!r||!s||!w||!_||!m||o||B)return;const ce=setInterval(()=>{q.current||V.current||Je.fetchQuery({...z6n(e,n,{sessionId:t}),staleTime:0}).then(pe=>{pe.remoteChanged&&Z()}).catch(pe=>{V.current=!0,j(pe instanceof Error?pe.message:String(pe))})},aBn);return()=>clearInterval(ce)},[r,s,w,_,m,o,e,n,t,Z,B]),A.useEffect(()=>{if(!r||!s||!w||!_||!m||!B)return;const ce=setInterval(Z,cBn);return()=>clearInterval(ce)},[r,s,w,_,m,B,Z]),{hasToken:_,hasSession:p,live:k,retryLive:()=>{oe.current=!0,x(ce=>ce+1)},link:m,loaded:w,syncing:y,last:z,error:T??((ae=h.error)==null?void 0:ae.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>D(!1),uploadUrl:Oyn(e,n,{sessionId:t}),saveToken:async ce=>{const pe=await VL(ce);Y.current=null,V.current=!1,j(null),Fn(u.queryKey)&&Je.setQueryData(u.queryKey,be=>be&&{...be,hasToken:pe.hasToken})},saveSession:async ce=>{const pe=await KL(ce,{host:m==null?void 0:m.host});I(pe.hasSession),oe.current=!0,x(be=>be+1)},importSession:async()=>{const ce=await Eyn({host:m==null?void 0:m.host});return I(ce.hasSession),oe.current=!0,x(pe=>pe+1),ce.source},linkProject:async ce=>{E(null),v(null),L.current=!1,Y.current=null,$(await Tyn(e,n,{project:ce,sessionId:t})),i==null||i()},unlink:async()=>{$(await Ayn(e,n,{sessionId:t})),Y.current=null,V.current=!1,E(null),j(null)},sync:ce=>{V.current=!1,Z(ce)&&(Y.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}const qR=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],uBn=4e6,_Bn=200,UR=16e6,fBn=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),GR=e=>e.startsWith("//")?`https:${e}`:e;async function dBn(e,n){var s;let t=uBn;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:c}of e){if(r.has(o)){const w=r.get(o);w&&i.setAttribute(a,w);continue}if(n.aborted)return;if(r.size>=_Bn)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const h=u.headers.get("content-type")??"",_=Number(u.headers.get("content-length"));if(!c.some(w=>h.startsWith(w))||!(Number.isFinite(_)&&_>0&&_<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await fBn(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function hBn(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll(qR.map(c=>c.selector).join(", ")))for(const{selector:c,attribute:u,typePrefixes:h}of qR){if(!o.matches(c))continue;const _=o.getAttribute(u);if(!_)continue;const p=n(_);p&&(p===_?o.setAttribute(u,GR(_)):s.push({element:o,attribute:u,url:p,typePrefixes:h}))}await dBn(s,t);for(const o of r.querySelectorAll("a[href]")){const c=o.getAttribute("href");!c||!C6(c)||(o.setAttribute("href",GR(c)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function pBn(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${UR-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>UR}}function mBn({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=A.useState(null);return A.useEffect(()=>{let o=!1;const c=new AbortController;return a(null),pBn(e,n,t,c.signal).then(async({text:u,partial:h})=>({source:await hBn(u,s,c.signal),partial:h})).then(u=>{o||a(u)}),()=>{o=!0,c.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(jt,{})," ",BD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:WFe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:tHe({name:Ce(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function gBn({overleaf:e}){var _;const n=A.useRef(null),{open:t,setOpen:r,ref:s}=Xa(n),i=A.useId(),[a,o]=A.useState({top:0,left:0,maxHeight:0}),c=((_=e.last)==null?void 0:_.conflicts.length)??0,u=e.hasToken&&!!e.error,h=u?h3():c?Imt():!e.hasToken||!e.link?Zbt():e.syncing?iL():e.blocked?sL():tL();return A.useEffect(()=>{c&&r(!0)},[c,r]),A.useEffect(()=>{u&&bn(h3(),"error",{id:i,duration:5e3})},[u,e.error,i]),A.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),w=Math.min(p.bottom+6,window.innerHeight-80);o({top:w,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-w-8}),(s.current.querySelector("input")??s.current).focus();const k=()=>r(!1),v=b=>{var x;b.target instanceof Node&&!((x=s.current)!=null&&x.contains(b.target))&&k()};return window.addEventListener("resize",k),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Ft,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":h,"data-tip-align":"end","aria-label":TZ({status:h}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(jt,{}):f.jsx(j3n,{size:13,className:u||c?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&Fi.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":SL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Ft,{size:"small","aria-label":pFe(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(_r,{size:13})})}),f.jsx(wBn,{overleaf:e})]}),document.body)]})}const j1=e=>ia(new Intl.ListFormat(N()).format(e.map(Ce)));function vBn(e){if(e.error)return kgt();if(e.syncing)return iL();if(e.blocked)return sL();const n=e.last;return n?n.pulled.length&&n.pushed.length?_bt({pulled:j1(n.pulled),pushed:j1(n.pushed)}):n.pulled.length?sbt({paths:j1(n.pulled)}):n.pushed.length?vbt({paths:j1(n.pushed)}):n.conflicts.length?S1t():tL():Uvt()}function bBn({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:rL()})}function yBn(e){return e.state==="live"?Ugt():e.state==="connecting"?Igt():e.error??s1t()}function VR({overleaf:e,replacing:n}){const[t,r]=A.useState(""),[s,i]=A.useState(!1),[a,o]=A.useState(!1),[c,u]=A.useState(null),h=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},_=a?_yt():n?Cbt():rgt();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:_}),a&&f.jsx(Ur,{className:"basis-full min-w-0","aria-label":d3(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:d3(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(jt,{}),a?f.jsx(Oe,{type:"button",disabled:s||!t.trim(),onClick:()=>h(()=>e.saveSession(t.trim())),children:s?va():Tmt()}):f.jsx(Oe,{type:"button",disabled:s,onClick:()=>h(e.importSession),children:ugt()}),f.jsx(Oe,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?nL():Yvt()})]}),c&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:c})]})}function xBn({overleaf:e}){if(!e.hasSession)return f.jsx(VR,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:_1t()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:yBn(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Oe,{onClick:e.retryLive,children:Ygt()})}),t&&f.jsx(VR,{overleaf:e,replacing:!0})]})}function wBn({overleaf:e}){var p,m,w;const[n,t]=A.useState(""),[r,s]=A.useState(!1),[i,a]=A.useState(null),[o,c]=A.useState(!1),u=()=>{t(""),a(null),c(!0)},h=!e.hasToken||o;async function _(k){k.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{h?(await e.saveToken(v),c(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!h){const k=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(jt,{}),e.error?h3():vBn(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(xBn,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Oe,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?Rbt():((m=e.live)==null?void 0:m.state)==="live"?Syt():void 0,onClick:()=>e.sync(),children:e.error?Ys():gvt()}),f.jsxs(mh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[svt()," ",f.jsx(of,{size:12})]})]}),k.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",U1t()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Oe,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:Y1t()}),f.jsx(Oe,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Ivt()})]})]},v)),((w=e.last)==null?void 0:w.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:aS()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Oe,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:mz()}),f.jsx(mh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:rL()}),f.jsx(Oe,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Svt()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:_,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:h?Iyt():Uyt()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Ur,{className:"basis-full min-w-0","aria-label":h?hz():pz(),"aria-invalid":!!i,type:h?"password":"text",value:n,onChange:k=>t(k.target.value),placeholder:h?hz():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Oe,{type:"submit",disabled:r||!n.trim(),children:r?h?va():ha():h?Gbt():Tgt()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:h?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:h?Umt():pz()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(bBn,{href:e.uploadUrl}),o?f.jsx(Oe,{variant:"ghost",type:"button",onClick:()=>c(!1),children:nL()}):e.hasToken&&f.jsx(Oe,{variant:"ghost",type:"button",onClick:u,children:mz()})]})]})}function kBn({command:e}){const[n,t]=A.useState("idle"),r=A.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Ft,{"data-tip":n==="copied"?tf():n==="select"?OUe():lPe(),"aria-label":jPe(),onClick:()=>void s(),children:n==="copied"?f.jsx(Pi,{size:13}):f.jsx(Sf,{size:13})})]})}function KR(e){const[n,t]=A.useState(!1),[r,s]=A.useState(null);return{busy:n,error:r,trigger:async()=>{t(!0),s(null);try{await e()}catch(a){s(a instanceof Error?a.message:String(a))}finally{t(!1)}}}}function SBn({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:c,onScrollPositionChange:u,lineScrollRequest:h,onLineScrollRequestHandled:_,onEdit:p,artifactVersion:m,artifactEntries:w=[],bufferSession:k,remote:v=!1,restored:b=!1,onRestoreActivated:x,showSource:y=!1,onShowSourceChange:C}){var jr,In;const z=J$(e,n,t??"repo",r,s),E=ut({...z,enabled:!k.saving}),T=E.data??null,j=((jr=E.error)==null?void 0:jr.message)??null,M=Ke=>{Yr(z.queryKey,gt=>(typeof Ke=="function"?Ke(gt??null):Ke)??void 0)},[D,I]=A.useState(0),$=t==="artifacts",q=t==="abs",H=pC(n),Q=QH(n),V=b$n(n),Z=H||V,[Y,B]=A.useState(!1),L=!b||Y,F=()=>{B(!0),x==null||x()};A.useSyncExternalStore(k.subscribe,k.getRevision);const U=k.getSnapshot(),K=k.set,ne=k.saving,oe=k.setSaving,ue=k.saveRevision,se=k.saveError,G=k.setSaveError,ae=A.useRef(null),ce=A.useRef(null),[pe,be]=A.useState(!1),[Ae,De]=A.useState(null),We=A.useRef(c),Ne=(T==null?void 0:T.file)??null,xe=U&&Kc(U)?U.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,rt=xe.split("/").slice(0,-1).join("/"),Ze=(T==null?void 0:T.source)==="artifact",ct=A.useCallback(Ke=>{var gt;return((gt=l5(rt,Ke,q))==null?void 0:gt.path)??null},[q,rt]),Ct=A.useCallback(Ke=>q?GL(Ke):Ze?sf(e,Ke):k3(e,Ke,{sessionId:r,ref:s}),[Ze,s,q,e,r]),qt=A.useCallback(Ke=>{if(C6(Ke))return Ke;const gt=l5(rt,Ke,q);return gt?X8n(Ct(gt.path),gt):null},[q,rt,Ct]),dt=nq(Ne==null?void 0:Ne.presentation),ht=(T==null?void 0:T.source)==="artifact"&&!$,Le=$&&(T==null?void 0:T.source)==="checkout",me=!s&&(T==null?void 0:T.source)==="checkout"&&Ne!=null&&!Ne.notFound,Te=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",He=me&&Ne!=null&&!Ne.binary&&!Ne.truncated&&!dt&&!Te,nt=He&&Ne.version===void 0,_t=U!==null&&Kc(U),St=!nt&&(He&&typeof Ne.version=="string"||_t),yt=(U==null?void 0:U.draft)??rk((Ne==null?void 0:Ne.content)??""),Zt=(U==null?void 0:U.baseline)??rk((Ne==null?void 0:Ne.content)??""),un=St&&U!==null&&Kc(U),At=async Ke=>{const gt=k.getSnapshot();if(!St||!gt||!Kc(gt))return!0;if(k.saving)return!1;if(gt.conflict&&Ke===void 0)return G(gt.conflict.exists?ON():IN()),!1;const Zr=gt.draft,Wn=nBn(gt);oe(!0),G(null);try{await Je.cancelQueries(z);const wn=await gyn(e,xe,Wn,{sessionId:r,expectedVersion:Ke??gt.version});return k.getSnapshot()?(k.saved(Zr,wn.version),M(rr=>rr&&rr.source==="checkout"?{source:"checkout",file:{...rr.file,content:Wn,version:wn.version}}:rr),!0):!1}catch(wn){if(wn instanceof w3){const Qn=k.getSnapshot();return!Qn||!Kc(Qn)||K({...Qn,conflict:{currentVersion:wn.currentVersion,exists:wn.exists}}),!1}return G(wn instanceof Error?wn.message:String(wn)),!1}finally{oe(!1)}},pt=Q&&me&&!Te,mt=iBn({projectId:e,filePath:xe,sessionId:r,enabled:pt,autoRun:L,onManualAction:F,ready:Ne!=null&&!Ne.notFound,source:St?yt:(Ne==null?void 0:Ne.content)??""}),_n=lBn({projectId:e,filePath:xe,sessionId:r,enabled:pt,autoRun:L,onManualAction:F,savedSource:Zt,dirty:un,onPulled:A.useCallback(Ke=>{Ke.includes(xe)&&I(gt=>gt+1)},[xe])}),us=Q&&mt.showPdf&&mt.compiled!=null,xr=nt&&_t,Qt=(St||xr)&&!(Z&&!y)&&!us,Mn=Ne!==null&&!Ne.notFound&&!Ne.binary&&!dt&&!us,mr=Mn&&!Qt&&(!V||y),gr=async()=>{if(Ne)try{if(Ne.truncated&&!Qt){const Ke=fetch(Ct(xe)).then(async gt=>{if(!gt.ok)throw new Error;return new Blob([await gt.text()],{type:"text/plain"})});await navigator.clipboard.write([new ClipboardItem({"text/plain":Ke})])}else await navigator.clipboard.writeText(Qt?yt:Ne.content);be(!0),window.setTimeout(()=>be(!1),1500)}catch{bn(wPe(),"error")}},_s=Ke=>{if(!Ke.metaKey&&!Ke.ctrlKey||Ke.altKey||Ke.shiftKey||Ke.key.toLowerCase()!=="a"||!(Ke.target instanceof Node)||!Ke.currentTarget.contains(Ke.target))return;const gt=ce.current;if(!gt)return;Ke.preventDefault();const Zr=document.createRange();Zr.selectNodeContents(gt);const Wn=window.getSelection();Wn==null||Wn.removeAllRanges(),Wn==null||Wn.addRange(Zr)},Et=mt.compiled?`${k3(e,mt.compiled.path,{sessionId:r})}&v=${mt.compiled.version}`:null,fn=Et?`${Et}&view=${mt.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,an=mt.compiled?mt.compiled.path.split("/").pop()??mt.compiled.path:null,xn=async()=>{un&&!await At()||Q&&mt.engine&&mt.compile()},Ir=async()=>{un&&(L?await xn():await At())},mn=KR(()=>byn(e,xe,{sessionId:r})),gn=KR(()=>yyn(e,xe,{sessionId:r})),Ln=v?hqe():Ne!=null&&Ne.notFound?PN():s?oqe({branch:Ce(s)}):me?null:xqe(),Nt=A.useCallback(()=>{k.saving||I(Ke=>Ke+1)},[k]),Ot=()=>{K(null),G(null),Nt()},Hn=sq(Ct(xe),!s&&!ne);A.useEffect(()=>{if(!j||s)return;const Ke=window.setInterval(()=>{document.visibilityState!=="hidden"&&Nt()},2e3);return()=>window.clearInterval(Ke)},[j,s,Nt]);const zr=`${Ct(xe)}&v=${encodeURIComponent(Hn??m??"")}&reload=${D}`;A.useEffect(()=>{var Zr,Wn;if(!T||k.saving)return;const Ke=T,gt=k.getSnapshot();if(gt&&Kc(gt)){const wn=Ke.source==="checkout"?Ke.file:null,Qn=wn!==null&&wn.path===gt.path&&(!r||wn.root==="worktree"),rr=rBn(gt,Qn&&typeof wn.version=="string"?wn.version:null,Qn&&!wn.notFound);rr&&(rr.currentVersion!==((Zr=gt.conflict)==null?void 0:Zr.currentVersion)||rr.exists!==((Wn=gt.conflict)==null?void 0:Wn.exists))?K({...gt,conflict:rr}):!rr&>.conflict&&K({...gt,conflict:null})}(!gt||!Kc(gt))&&Ke.source==="checkout"&&!Ke.file.notFound&&!Ke.file.binary&&!Ke.file.truncated&&typeof Ke.file.version=="string"&&(K(HR(Ke.file.path,Ke.file.content,Ke.file.version)),G(null))},[T,k,r,ne,ue]);const nr=JSON.stringify(z.queryKey),On=A.useRef({sourceKey:nr,nonce:D,artifactVersion:m,diskVersion:Hn});A.useEffect(()=>{const Ke=On.current;On.current={sourceKey:nr,nonce:D,artifactVersion:m,diskVersion:Hn},Ke.sourceKey===nr&&(Ke.nonce!==D||Ke.diskVersion!==null&&Ke.diskVersion!==Hn||Ke.artifactVersion!=null&&Ke.artifactVersion!==m)&&j6n(e,n,t??"repo",r,s)},[nr,D,m,Hn,e,n,t,r,s]),A.useLayoutEffect(()=>{const Ke=ae.current,gt=We.current;!Ke||!Ne||!gt||(Ke.scrollTop=gt.top,Ke.scrollLeft=gt.left)},[Ne]);const hr=Ke=>{if(Ke.source==="absolute")return OHe();if($)return yHe({root:r?Jg():Zg()});if(s)return NHe({branch:Ce(s)});if(r&&Ke.source==="checkout"&&Ke.file.root==="clone")return MGe();const gt=Ke.source==="checkout"?Ke.file.root:Ke.checkoutRoot;return FHe({root:gt==="worktree"?Jg():Zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",onKeyDown:_s,children:[f.jsxs("div",{className:"file-view-header @container flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(zh,{name:xe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ce(xe),children:xe.split("/").pop()||xe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap [&_svg]:flex-none",title:XQ({branch:Ce(a)}),children:[f.jsx(zm,{size:11}),a]}),Qt&&(ne||un||se)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${se?"text-accent-red":"text-muted"}`,title:se??(ne?va():bGe()),children:ne?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",NUe()]}):se?yUe():PD()}),f.jsx("div",{ref:De,className:"contents"}),Q&&mt.compiled&&f.jsx(Ft,{size:"small",active:!mt.showPdf,"data-tip":mt.stale&&mt.showPdf?Hqe():mt.showPdf?zd():UN(),"data-tip-align":"end","aria-label":mt.showPdf?zd():UN(),onClick:()=>mt.setShowPdf(!mt.showPdf),children:mt.showPdf?f.jsx(P3,{size:13}):f.jsx($b,{size:13,className:mt.stale?"text-accent-amber":void 0})}),Q&&Et&&an&&f.jsx(Ih,{size:"small","data-tip":mt.stale?zFe({name:Ce(an)}):Sv({name:Ce(an)}),"data-tip-align":"end","aria-label":Sv({name:Ce(an)}),href:Et,download:an,children:f.jsx(Lb,{size:13,className:mt.stale?"text-accent-amber":void 0})}),pt&&f.jsx(gBn,{overleaf:_n}),Q&&me&&f.jsx(Ft,{size:"small","data-tip":mt.compiled?HN():DN(),"data-tip-align":"end","aria-label":mt.compiled?HN():DN(),disabled:mt.compiling||!mt.engine,onClick:()=>void xn(),children:mt.compiling?f.jsx(jt,{}):f.jsx(B3n,{size:13})}),Z&&f.jsx(Ft,{size:"small",active:y,"data-tip":y?Ev():zd(),"data-tip-align":"end","aria-label":y?Ev():zd(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(P3,{size:13})}),Mn&&f.jsx(Ft,{size:"small","data-tip":pe?tf():LN(),"data-tip-align":"end","aria-label":pe?tf():LN(),onClick:()=>void gr(),children:pe?f.jsx(Pi,{size:13}):f.jsx(Sf,{size:13})}),Ne!=null&&f.jsxs(f.Fragment,{children:[f.jsx(Ft,{size:"small","data-tip":Ln??mn.error??FN(),"data-tip-align":"end","aria-label":FN(),"aria-description":Ln??void 0,disabled:mn.busy||Ln!=null,onClick:()=>void mn.trigger(),children:mn.busy?f.jsx(jt,{}):f.jsx(of,{size:13})}),f.jsx(Ft,{size:"small","data-tip":Ln??gn.error??qN(),"data-tip-align":"end","aria-label":qN(),"aria-description":Ln??void 0,disabled:gn.busy||Ln!=null,onClick:()=>void gn.trigger(),children:gn.busy?f.jsx(jt,{}):f.jsx(Ou,{size:13})})]})]}),!j&&Le&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:WHe({root:T.file.root==="worktree"?Jg():Zg()})}),nt&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:EGe()}),j&&Ne!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[BN()," ",Ce(j)]}),(U==null?void 0:U.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:U.conflict.exists?ON():IN()}),((In=U==null?void 0:U.conflict)==null?void 0:In.exists)&&U.conflict.currentVersion&&f.jsx(Oe,{disabled:ne,onPointerDown:Ke=>Ke.preventDefault(),onClick:()=>{var Ke;return void At(((Ke=U.conflict)==null?void 0:Ke.currentVersion)??void 0)},children:Dqe()}),f.jsx(Oe,{disabled:ne,onPointerDown:Ke=>Ke.preventDefault(),onClick:Ot,children:oUe()})]}),(mt.error||mt.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${mt.builtWithErrors?"text-subtext":"text-accent-red"}`,children:mt.error??(mt.builtWithErrors?nPe():qBe())}),f.jsx(Ft,{"data-tip":tFe(),"data-tip-align":"end","aria-label":cFe(),onClick:mt.dismiss,children:f.jsx(_r,{size:13})})]}),mt.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:mt.log})]}),pt&&_n.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:zqe()}),f.jsx(Oe,{onClick:()=>{_n.reloaded(),I(Ke=>Ke+1)},children:HPe()})]}),Q&&me&&mt.engine===null&&mt.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[mt.installHint,mt.installCommand&&f.jsx(kBn,{command:mt.installCommand})]}),mt.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:mt.note}),us&&mt.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:JUe()}),f.jsxs("div",{ref:ae,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",tabIndex:mr?0:void 0,onScroll:Ke=>{const gt={top:Math.max(0,Ke.currentTarget.scrollTop),left:Math.max(0,Ke.currentTarget.scrollLeft)};We.current=gt,u==null||u(gt)},children:[!Qt&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:aGe()}),!Qt&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&ht&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:kBe({root:T.checkoutRoot==="worktree"?Jg():Zg()})}),j&&Ne===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[BN()," ",Ce(j)]}):Ne===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:BD()}):Qt?f.jsx(q$,{value:yt,onChange:Ke=>{const gt=k.getSnapshot()??(Ne&&typeof Ne.version=="string"?HR(Ne.path,Ne.content,Ne.version):null);gt&&K(tBn(gt,Ke)),p==null||p(),se&&G(null)},onSave:()=>void Ir(),onBlur:()=>{nk||Ir()},readOnly:xr,path:n,highlightLine:i,scrollRequest:h,onScrollRequestHandled:_,scrollPosition:We.current,onScrollPositionChange:Ke=>{We.current=Ke,u==null||u(Ke)}}):Ne.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?hr(T):PN()}):dt?f.jsx(ub.Provider,{value:Ae,children:f.jsx(tk,{kind:dt,url:zr,name:n.split("/").pop()??n})}):Ne.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[TBe()," ",f.jsx("a",{href:zr,download:n.split("/").pop()??n,children:$D()})]}):us&&fn&&an?f.jsx(ub.Provider,{value:Ae,children:f.jsx(tk,{kind:"pdf",url:fn,name:an,download:!1},fn)}):H&&!y?f.jsx("div",{ref:ce,className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:Ze?f.jsx(lq,{projectId:e,folder:rt,markdown:Ne.content,entries:w}):f.jsx(nc,{text:Ne.content,resolveFilePath:ct,resolveImageSrc:qt,onOpenFile:o&&((Ke,gt,Zr,Wn,wn)=>o(Ke,r,s,wn))})}):V&&!y?f.jsx(mBn,{html:Ne.content,truncated:Ne.truncated,url:zr,name:xe,resolveSrc:qt}):f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:ce,children:f.jsx(tq,{text:Ne.content,path:n,highlightLine:i,scrollRequest:h,onScrollRequestHandled:_})}),Ne.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:FFe()})]})]})]})}const w4=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function CBn({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=Xa(),c=A.useRef(null);return A.useEffect(()=>{if(!i)return;const u=h=>{var _;h.key==="Escape"&&((_=c.current)==null||_.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Ft,{size:"small",className:"project-back text-text","aria-label":VN(),onClick:n,children:f.jsx(M0,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:hXe()}),s&&f.jsx(Ft,{size:"small","data-tip":KN(),"data-tip-align":"end","aria-label":KN(),onClick:s,children:f.jsx(QI,{size:18})})]}),f.jsxs("button",{ref:c,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(ac,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(Dn,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:w4,children:[f.jsx(UI,{size:14}),WQe()]})}),f.jsx(Dn,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:w4,children:[f.jsx(VI,{size:14}),VN()]})}),f.jsx(Dn,{onClick:()=>{var u;(u=c.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:w4,children:[f.jsx(K3n,{size:14}),tXe()]})})]})]})})}function gq({id:e,name:n,hasParent:t,onArchive:r,compact:s=!1}){const i=A.useRef(null),a=Xa(i),o=(c,u)=>{a.setOpen(!1),r(e,c,u)};return f.jsxs("div",{className:"relative nodrag",ref:a.ref,children:[s?f.jsx("button",{type:"button",ref:i,className:"node-action","aria-label":Pz({name:n}),"aria-expanded":a.open,onClick:()=>a.setOpen(c=>!c),children:f.jsx(Ib,{size:15,"aria-hidden":"true"})}):f.jsx("button",{type:"button",className:"btn inline-flex h-7 items-center justify-center rounded-sm border border-border bg-background px-2.5 text-sm text-text hover:bg-surface",ref:i,"aria-label":Pz({name:n}),"aria-expanded":a.open,onClick:()=>a.setOpen(c=>!c),children:upn()}),a.open&&f.jsxs("div",{className:`option-menu absolute end-0 z-50 min-w-44 rounded-lg border border-border bg-background p-1.5 shadow-menu ${s?"bottom-[calc(100%_+_4px)]":"top-[calc(100%_+_4px)]"}`,children:[t&&f.jsx(Dn,{onClick:()=>o("up",!0),children:Xhn()}),f.jsx(Dn,{onClick:()=>o("down",!0),children:rpn()}),t&&f.jsx(Dn,{onClick:()=>o("up",!1),children:n0n()}),f.jsx(Dn,{onClick:()=>o("down",!1),children:l0n()})]})]})}function EBn({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onArchive:a,onCancel:o}){const[c,u]=A.useState(new Set),[h,_]=A.useState(null),p=new Map;for(const k of e){const v=p.get(k.experimentId);v?v.push(k):p.set(k.experimentId,[k])}for(const k of p.values())k.sort((v,b)=>b.createdAt-v.createdAt);const m=[...n].sort((k,v)=>{var y,C,z,E;const b=((C=(y=p.get(k.id))==null?void 0:y[0])==null?void 0:C.createdAt)??k.createdAt;return(((E=(z=p.get(v.id))==null?void 0:z[0])==null?void 0:E.createdAt)??v.createdAt)-b});if(m.length===0)return f.jsx(gC,{icon:gh,title:t??oIe(),description:t?void 0:KLe()});async function w(k){_(null),u(v=>new Set(v).add(k));try{await o(k)}catch(v){u(b=>{const x=new Set(b);return x.delete(k),x}),_(v instanceof Error?v.message:String(v))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[h&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[w$e()," ",h]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":l$e(),children:m.map(k=>{const v=p.get(k.id)??[],b=v[0]??null,x=v.find(E=>E.status==="running"||E.status==="starting"),y=x??b,C=!!(x&&(x.cancelRequested||c.has(x.id))),z=x?C?"cancelling":la(x):b?la(b):"idle";return f.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-divider-subtle 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,"preview"),onDoubleClick:()=>r(k,"keepOpen"),onAuxClick:E=>{E.button===1&&(E.preventDefault(),r(k,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Gr(E=>r(k,E),{stopPropagation:!0}),children:k.title||k.slug}),k.archived&&f.jsx("span",{className:"text-muted text-xs",children:IL()}),f.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:[f.jsx(zm,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:k.branchName})]})]}),f.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:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx(cl,{status:z})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:v.length===1?xIe():DIe({count:tn(v.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:b?wo(b.createdAt):hIe()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":LQ({name:k.title||k.slug}),onClick:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onAuxClick:E=>E.stopPropagation(),children:[f.jsxs(Oe,{size:"small",disabled:!y,title:y?zIe():eIe(),...Gr(E=>{y&&s(k.id,y.id,E)},{stopPropagation:!0}),children:[f.jsx(ko,{size:15}),u3()]}),f.jsxs(Oe,{size:"small",title:bD({branch:Ce(k.branchName)}),...Gr(E=>i(k.id,E),{stopPropagation:!0}),children:[f.jsx(Bb,{size:15}),n$e()]}),f.jsx(gq,{id:k.id,name:k.title||k.slug,hasParent:!!k.parentExperimentId,onArchive:a}),x&&f.jsxs(Oe,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:C,title:C?HIe():QIe(),onClick:()=>void w(x.id),children:[f.jsx(PI,{size:15}),C?Xje():DD()]})]})]},k.id)})})]})}function NBn({onClose:e,onCreateProject:n}){const[t,r]=A.useState(!1),[s,i]=A.useState(null),a=A.useRef(null),o=A.useCallback(c=>{t||(r(!0),i(null),c().catch(()=>i(khn())).finally(()=>r(!1)))},[t]);return A.useEffect(()=>{const c=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e,o]),A.useEffect(()=>{const c=a.current;if(!c)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,h=()=>[...c.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(h()[0]??c).focus();const _=p=>{if(p.key!=="Tab")return;const m=h();if(m.length===0){p.preventDefault(),c.focus();return}const w=m[0],k=m[m.length-1];p.shiftKey&&document.activeElement===w?(p.preventDefault(),k.focus()):!p.shiftKey&&document.activeElement===k&&(p.preventDefault(),w.focus())};return document.addEventListener("keydown",_,!0),()=>{document.removeEventListener("keydown",_,!0),u==null||u.focus()}},[]),Fi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Ft,{className:"absolute end-3.5 top-3.5","aria-label":y3(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(_r,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx(AS,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Qdn()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:Ihn()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[Thn()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:lhn()}),jdn()]}),f.jsx("p",{dir:"auto",children:nhn()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Oe,{onClick:()=>o(n),disabled:t,children:Hdn()}),f.jsx(Oe,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?va():mhn()})]})]})}),document.body)}function ls(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function $y(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}av.prototype=$y.prototype={constructor:av,on:function(e,n){var t=this._,r=jBn(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),QR.hasOwnProperty(n)?{space:QR[n],local:e}:e}function ABn(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===sk&&n.documentElement.namespaceURI===sk?n.createElement(e):n.createElementNS(t,e)}}function RBn(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vq(e){var n=By(e);return(n.local?RBn:ABn)(n)}function MBn(){}function vC(e){return e==null?MBn:function(){return this.querySelector(e)}}function OBn(e){typeof e!="function"&&(e=vC(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=x+1);!(z=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function iPn(e){e||(e=aPn);function n(_,p){return _&&p?e(_.__data__,p.__data__):!_-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function oPn(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cPn(){return Array.from(this)}function lPn(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?yPn:typeof n=="function"?wPn:xPn)(e,n,t??"")):jh(this.node(),e)}function jh(e,n){return e.style.getPropertyValue(n)||kq(e).getComputedStyle(e,null).getPropertyValue(n)}function SPn(e){return function(){delete this[e]}}function CPn(e,n){return function(){this[e]=n}}function EPn(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function NPn(e,n){return arguments.length>1?this.each((n==null?SPn:typeof n=="function"?EPn:CPn)(e,n)):this.node()[e]}function Sq(e){return e.trim().split(/^|\s+/)}function bC(e){return e.classList||new Cq(e)}function Cq(e){this._node=e,this._names=Sq(e.getAttribute("class")||"")}Cq.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Eq(e,n){for(var t=bC(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function tFn(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function ik(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:c,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:h}})}ik.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function _Fn(e){return!e.ctrlKey&&!e.button}function fFn(){return this.parentNode}function dFn(e,n){return n??{x:e.x,y:e.y}}function hFn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Rq(){var e=_Fn,n=fFn,t=dFn,r=hFn,s={},i=$y("start","drag","end"),a=0,o,c,u,h,_=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,uFn).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,z){if(!(h||!e.call(this,C,z))){var E=y(this,n.call(this,C,z),C,z,"mouse");E&&(aa(C.view).on("mousemove.drag",w,X0).on("mouseup.drag",k,X0),Tq(C.view),k4(C),u=!1,o=C.clientX,c=C.clientY,E("start",C))}}function w(C){if(Ud(C),!u){var z=C.clientX-o,E=C.clientY-c;u=z*z+E*E>_}s.mouse("drag",C)}function k(C){aa(C.view).on("mousemove.drag mouseup.drag",null),Aq(C.view,u),Ud(C),s.mouse("end",C)}function v(C,z){if(e.call(this,C,z)){var E=C.changedTouches,T=n.call(this,C,z),j=E.length,M,D;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?A1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?A1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=mFn.exec(e))?new Bi(n[1],n[2],n[3],1):(n=gFn.exec(e))?new Bi(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=vFn.exec(e))?A1(n[1],n[2],n[3],n[4]):(n=bFn.exec(e))?A1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=yFn.exec(e))?nM(n[1],n[2]/100,n[3]/100,1):(n=xFn.exec(e))?nM(n[1],n[2]/100,n[3]/100,n[4]):XR.hasOwnProperty(e)?JR(XR[e]):e==="transparent"?new Bi(NaN,NaN,NaN,0):null}function JR(e){return new Bi(e>>16&255,e>>8&255,e&255,1)}function A1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Bi(e,n,t,r)}function SFn(e){return e instanceof Pm||(e=df(e)),e?(e=e.rgb(),new Bi(e.r,e.g,e.b,e.opacity)):new Bi}function ak(e,n,t,r){return arguments.length===1?SFn(e):new Bi(e,n,t,r??1)}function Bi(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}yC(Bi,ak,Mq(Pm,{brighter(e){return e=e==null?fb:Math.pow(fb,e),new Bi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Y0:Math.pow(Y0,e),new Bi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Bi(Z_(this.r),Z_(this.g),Z_(this.b),db(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:eM,formatHex:eM,formatHex8:CFn,formatRgb:tM,toString:tM}));function eM(){return`#${R_(this.r)}${R_(this.g)}${R_(this.b)}`}function CFn(){return`#${R_(this.r)}${R_(this.g)}${R_(this.b)}${R_((isNaN(this.opacity)?1:this.opacity)*255)}`}function tM(){const e=db(this.opacity);return`${e===1?"rgb(":"rgba("}${Z_(this.r)}, ${Z_(this.g)}, ${Z_(this.b)}${e===1?")":`, ${e})`}`}function db(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Z_(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function R_(e){return e=Z_(e),(e<16?"0":"")+e.toString(16)}function nM(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new mo(e,n,t,r)}function Oq(e){if(e instanceof mo)return new mo(e.h,e.s,e.l,e.opacity);if(e instanceof Pm||(e=df(e)),!e)return new mo;if(e instanceof mo)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,c=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&c<1?0:a,new mo(a,o,c,e.opacity)}function EFn(e,n,t,r){return arguments.length===1?Oq(e):new mo(e,n,t,r??1)}function mo(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}yC(mo,EFn,Mq(Pm,{brighter(e){return e=e==null?fb:Math.pow(fb,e),new mo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Y0:Math.pow(Y0,e),new mo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Bi(S4(e>=240?e-240:e+120,s,r),S4(e,s,r),S4(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new mo(rM(this.h),R1(this.s),R1(this.l),db(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=db(this.opacity);return`${e===1?"hsl(":"hsla("}${rM(this.h)}, ${R1(this.s)*100}%, ${R1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rM(e){return e=(e||0)%360,e<0?e+360:e}function R1(e){return Math.max(0,Math.min(1,e||0))}function S4(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const xC=e=>()=>e;function NFn(e,n){return function(t){return e+t*n}}function zFn(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function jFn(e){return(e=+e)==1?Dq:function(n,t){return t-n?zFn(n,t,e):xC(isNaN(n)?t:n)}}function Dq(e,n){var t=n-e;return t?NFn(e,t):xC(isNaN(e)?n:e)}const hb=(function e(n){var t=jFn(n);function r(s,i){var a=t((s=ak(s)).r,(i=ak(i)).r),o=t(s.g,i.g),c=t(s.b,i.b),u=Dq(s.opacity,i.opacity);return function(h){return s.r=a(h),s.g=o(h),s.b=c(h),s.opacity=u(h),s+""}}return r.gamma=e,r})(1);function TFn(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,c.push({i:a,x:Ko(r,s)})),t=C4.lastIndex;return t180?h+=360:h-u>180&&(u+=360),p.push({i:_.push(s(_)+"rotate(",null,r)-2,x:Ko(u,h)})):h&&_.push(s(_)+"rotate("+h+r)}function o(u,h,_,p){u!==h?p.push({i:_.push(s(_)+"skewX(",null,r)-2,x:Ko(u,h)}):h&&_.push(s(_)+"skewX("+h+r)}function c(u,h,_,p,m,w){if(u!==_||h!==p){var k=m.push(s(m)+"scale(",null,",",null,")");w.push({i:k-4,x:Ko(u,_)},{i:k-2,x:Ko(h,p)})}else(_!==1||p!==1)&&m.push(s(m)+"scale("+_+","+p+")")}return function(u,h){var _=[],p=[];return u=e(u),h=e(h),i(u.translateX,u.translateY,h.translateX,h.translateY,_,p),a(u.rotate,h.rotate,_,p),o(u.skewX,h.skewX,_,p),c(u.scaleX,u.scaleY,h.scaleX,h.scaleY,_,p),u=h=null,function(m){for(var w=-1,k=p.length,v;++w=0&&e._call.call(void 0,n),e=e._next;--Th}function aM(){hf=(mb=J0.now())+Py,Th=o0=0;try{GFn()}finally{Th=0,KFn(),hf=0}}function VFn(){var e=J0.now(),n=e-mb;n>Bq&&(Py-=n,mb=e)}function KFn(){for(var e,n=pb,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:pb=t);c0=e,lk(r)}function lk(e){if(!Th){o0&&(o0=clearTimeout(o0));var n=e-hf;n>24?(e<1/0&&(o0=setTimeout(aM,e-J0.now()-Py)),Jp&&(Jp=clearInterval(Jp))):(Jp||(mb=J0.now(),Jp=setInterval(VFn,Bq)),Th=1,Pq(aM))}}function oM(e,n,t){var r=new gb;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var WFn=$y("start","end","cancel","interrupt"),QFn=[],Hq=0,cM=1,uk=2,cv=3,lM=4,_k=5,lv=6;function Fy(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;XFn(e,t,{name:n,index:r,group:s,on:WFn,tween:QFn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Hq})}function kC(e,n){var t=Co(e,n);if(t.state>Hq)throw new Error("too late; already scheduled");return t}function fc(e,n){var t=Co(e,n);if(t.state>cv)throw new Error("too late; already running");return t}function Co(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function XFn(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=Fq(i,0,t.time);function i(u){t.state=cM,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var h,_,p,m;if(t.state!==cM)return c();for(h in r)if(m=r[h],m.name===t.name){if(m.state===cv)return oM(a);m.state===lM?(m.state=lv,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[h]):+huk&&r.state<_k,r.state=lv,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete t[a]}i&&delete e.__transition}}function YFn(e){return this.each(function(){uv(this,e)})}function ZFn(e,n){var t,r;return function(){var s=fc(this,e),i=s.tween;if(i!==t){r=t=i;for(var a=0,o=r.length;a=0&&(n=n.slice(0,t)),!n||n==="start"})}function EHn(e,n,t){var r,s,i=CHn(n)?kC:fc;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function NHn(e,n){var t=this._id;return arguments.length<2?Co(this.node(),t).on.on(e):this.each(EHn(t,e,n))}function zHn(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function jHn(){return this.on("end.remove",zHn(this._id))}function THn(e){var n=this._name,t=this._id;typeof e!="function"&&(e=vC(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function tqn(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function il(e,n,t){this.k=e,this.x=n,this.y=t}il.prototype={constructor:il,scale:function(e){return e===1?this:new il(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new il(this.k,this.x+this.k*e,this.y+this.k*n)},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 Hy=new il(1,0,0);Vq.prototype=il.prototype;function Vq(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Hy;return e.__zoom}function E4(e){e.stopImmediatePropagation()}function e0(e){e.preventDefault(),e.stopImmediatePropagation()}function nqn(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function rqn(){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 uM(){return this.__zoom||Hy}function sqn(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function iqn(){return navigator.maxTouchPoints||"ontouchstart"in this}function aqn(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Kq(){var e=nqn,n=rqn,t=aqn,r=sqn,s=iqn,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,c=ov,u=$y("start","zoom","end"),h,_,p,m=500,w=150,k=0,v=10;function b(H){H.property("__zoom",uM).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",D).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(H,Q,V,Z){var Y=H.selection?H.selection():H;Y.property("__zoom",uM),H!==Y?z(H,Q,V,Z):Y.interrupt().each(function(){E(this,arguments).event(Z).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},b.scaleBy=function(H,Q,V,Z){b.scaleTo(H,function(){var Y=this.__zoom.k,B=typeof Q=="function"?Q.apply(this,arguments):Q;return Y*B},V,Z)},b.scaleTo=function(H,Q,V,Z){b.transform(H,function(){var Y=n.apply(this,arguments),B=this.__zoom,L=V==null?C(Y):typeof V=="function"?V.apply(this,arguments):V,F=B.invert(L),U=typeof Q=="function"?Q.apply(this,arguments):Q;return t(y(x(B,U),L,F),Y,a)},V,Z)},b.translateBy=function(H,Q,V,Z){b.transform(H,function(){return t(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof V=="function"?V.apply(this,arguments):V),n.apply(this,arguments),a)},null,Z)},b.translateTo=function(H,Q,V,Z,Y){b.transform(H,function(){var B=n.apply(this,arguments),L=this.__zoom,F=Z==null?C(B):typeof Z=="function"?Z.apply(this,arguments):Z;return t(Hy.translate(F[0],F[1]).scale(L.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof V=="function"?-V.apply(this,arguments):-V),B,a)},Z,Y)};function x(H,Q){return Q=Math.max(i[0],Math.min(i[1],Q)),Q===H.k?H:new il(Q,H.x,H.y)}function y(H,Q,V){var Z=Q[0]-V[0]*H.k,Y=Q[1]-V[1]*H.k;return Z===H.x&&Y===H.y?H:new il(H.k,Z,Y)}function C(H){return[(+H[0][0]+ +H[1][0])/2,(+H[0][1]+ +H[1][1])/2]}function z(H,Q,V,Z){H.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 Y=this,B=arguments,L=E(Y,B).event(Z),F=n.apply(Y,B),U=V==null?C(F):typeof V=="function"?V.apply(Y,B):V,K=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),ne=Y.__zoom,oe=typeof Q=="function"?Q.apply(Y,B):Q,ue=c(ne.invert(U).concat(K/ne.k),oe.invert(U).concat(K/oe.k));return function(se){if(se===1)se=oe;else{var G=ue(se),ae=K/G[2];se=new il(ae,U[0]-G[0]*ae,U[1]-G[1]*ae)}L.zoom(null,se)}})}function E(H,Q,V){return!V&&H.__zooming||new T(H,Q)}function T(H,Q){this.that=H,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=n.apply(H,Q),this.taps=0}T.prototype={event:function(H){return H&&(this.sourceEvent=H),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(H,Q){return this.mouse&&H!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&H!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&H!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(H){var Q=aa(this.that).datum();u.call(H,this.that,new tqn(H,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Q)}};function j(H,...Q){if(!e.apply(this,arguments))return;var V=E(this,Q).event(H),Z=this.__zoom,Y=Math.max(i[0],Math.min(i[1],Z.k*Math.pow(2,r.apply(this,arguments)))),B=uo(H);if(V.wheel)(V.mouse[0][0]!==B[0]||V.mouse[0][1]!==B[1])&&(V.mouse[1]=Z.invert(V.mouse[0]=B)),clearTimeout(V.wheel);else{if(Z.k===Y)return;V.mouse=[B,Z.invert(B)],uv(this),V.start()}e0(H),V.wheel=setTimeout(L,w),V.zoom("mouse",t(y(x(Z,Y),V.mouse[0],V.mouse[1]),V.extent,a));function L(){V.wheel=null,V.end()}}function M(H,...Q){if(p||!e.apply(this,arguments))return;var V=H.currentTarget,Z=E(this,Q,!0).event(H),Y=aa(H.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",K,!0),B=uo(H,V),L=H.clientX,F=H.clientY;Tq(H.view),E4(H),Z.mouse=[B,this.__zoom.invert(B)],uv(this),Z.start();function U(ne){if(e0(ne),!Z.moved){var oe=ne.clientX-L,ue=ne.clientY-F;Z.moved=oe*oe+ue*ue>k}Z.event(ne).zoom("mouse",t(y(Z.that.__zoom,Z.mouse[0]=uo(ne,V),Z.mouse[1]),Z.extent,a))}function K(ne){Y.on("mousemove.zoom mouseup.zoom",null),Aq(ne.view,Z.moved),e0(ne),Z.event(ne).end()}}function D(H,...Q){if(e.apply(this,arguments)){var V=this.__zoom,Z=uo(H.changedTouches?H.changedTouches[0]:H,this),Y=V.invert(Z),B=V.k*(H.shiftKey?.5:2),L=t(y(x(V,B),Z,Y),n.apply(this,Q),a);e0(H),o>0?aa(this).transition().duration(o).call(z,L,Z,H):aa(this).call(b.transform,L,Z,H)}}function I(H,...Q){if(e.apply(this,arguments)){var V=H.touches,Z=V.length,Y=E(this,Q,H.changedTouches.length===Z).event(H),B,L,F,U;for(E4(H),L=0;L`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:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,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.`},em=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Wq=["Enter"," ","Escape"],Qq={"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:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"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 Ah;(function(e){e.Strict="strict",e.Loose="loose"})(Ah||(Ah={}));var J_;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(J_||(J_={}));var tm;(function(e){e.Partial="partial",e.Full="full"})(tm||(tm={}));const Xq={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var pu;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(pu||(pu={}));var vb;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(vb||(vb={}));var Dt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Dt||(Dt={}));const _M={[Dt.Left]:Dt.Right,[Dt.Right]:Dt.Left,[Dt.Top]:Dt.Bottom,[Dt.Bottom]:Dt.Top};function Yq(e){return e===null?null:e?"valid":"invalid"}const Zq=e=>"id"in e&&"source"in e&&"target"in e,oqn=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),CC=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Fm=(e,n=[0,0])=>{const{width:t,height:r}=yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},cqn=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):CC(s)?s:n.nodeLookup.get(s.id));const o=a?bb(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return qy(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Uy(t)},Hm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=qy(t,bb(s)),r=!0)}),r?Uy(t):{x:0,y:0,width:0,height:0}},EC=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,c=(n.y-r)/s,u=n.width/s,h=n.height/s,_=[];for(const p of e.values()){const{measured:m,selectable:w=!0,hidden:k=!1}=p;if(a&&!w||k)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x,y}=p.internals.positionAbsolute,C=nU(o,c,u,h,x,y,v,b),z=v*b,E=i&&C>0;(!p.internals.handleBounds||E||C>=z||p.dragging)&&_.push(p)}return _},lqn=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function uqn(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function _qn({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=uqn(e,a),c=Hm(o),u=zC(c,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function Jq({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:c,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},h=a.origin??r;let _=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",So.error005());else{const m=o.measured.width,w=o.measured.height;m&&w&&(_=[[c,u],[c+m,u+w]])}else o&&mf(a.extent)&&(_=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const p=mf(_)?pf(n,_,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",So.error015())),{position:{x:p.x-c+(a.measured.width??0)*h[0],y:p.y-u+(a.measured.height??0)*h[1]},positionAbsolute:p}}async function fqn({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),w=!m&&p.parentId&&a.find(k=>k.id===p.parentId);(m||w)&&a.push(p)}const o=new Set(n.map(p=>p.id)),c=r.filter(p=>p.deletable!==!1),h=lqn(a,c);for(const p of c)o.has(p.id)&&!h.find(w=>w.id===p.id)&&h.push(p);if(!s)return{edges:h,nodes:a};const _=await s({nodes:a,edges:h});return typeof _=="boolean"?_?{edges:h,nodes:a}:{edges:[],nodes:[]}:_}const Rh=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),pf=(e={x:0,y:0},n,t)=>({x:Rh(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:Rh(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function eU(e,n,t){const{width:r,height:s}=yl(t),{x:i,y:a}=t.internals.positionAbsolute;return pf(e,[[i,a],[i+r,a+s]],n)}const fM=(e,n,t)=>et?-Rh(Math.abs(e-t),1,n)/n:0,NC=(e,n,t=15,r=40)=>{const s=fM(e.x,r,n.width-r)*t,i=fM(e.y,r,n.height-r)*t;return[s,i]},qy=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),fk=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),Uy=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),nm=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=CC(e)?e.internals.positionAbsolute:Fm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},bb=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=CC(e)?e.internals.positionAbsolute:Fm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},tU=(e,n)=>Uy(qy(fk(e),fk(n))),nU=(e,n,t,r,s,i,a,o)=>{const c=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(c*u)},yb=(e,n)=>nU(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),dM=e=>vo(e.width)&&vo(e.height)&&vo(e.x)&&vo(e.y),vo=e=>!isNaN(e)&&isFinite(e),rU=(e,n)=>(t,r)=>{},qm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),Um=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?qm(o,a):o},Mh=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function bd(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.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 dqn(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=bd(e,t),s=bd(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=bd(e.top??e.y??0,t),s=bd(e.bottom??e.y??0,t),i=bd(e.left??e.x??0,n),a=bd(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function hqn(e,n,t,r,s,i){const{x:a,y:o}=Mh(e,[n,t,r]),{x:c,y:u}=Mh({x:e.x+e.width,y:e.y+e.height},[n,t,r]),h=s-c,_=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(h),bottom:Math.floor(_)}}const zC=(e,n,t,r,s,i)=>{const a=dqn(i,n,t),o=(n-a.x)/e.width,c=(t-a.y)/e.height,u=Math.min(o,c),h=Rh(u,r,s),_=e.x+e.width/2,p=e.y+e.height/2,m=n/2-_*h,w=t/2-p*h,k=hqn(e,m,w,h,n,t),v={left:Math.min(k.left-a.left,0),top:Math.min(k.top-a.top,0),right:Math.min(k.right-a.right,0),bottom:Math.min(k.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:w-v.top+v.bottom,zoom:h}},rm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function mf(e){return e!=null&&e!=="parent"}function yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function sU(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function iU(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function hM(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function pqn(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function mqn(e){return{...Qq,...e||{}}}function k0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=bo(e),o=Um({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=t?qm(o,n):o;return{xSnapped:c,ySnapped:u,...o}}const jC=e=>({width:e.offsetWidth,height:e.offsetHeight}),aU=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},gqn=["INPUT","SELECT","TEXTAREA"];function oU(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:gqn.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const cU=e=>"clientX"in e,bo=(e,n)=>{var i,a;const t=cU(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},pM=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...jC(a)}})};function lU({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const c=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,h=Math.abs(c-e),_=Math.abs(u-n);return[c,u,h,_]}function D1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function mM({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Dt.Left:return[n-D1(n-r,i),t];case Dt.Right:return[n+D1(r-n,i),t];case Dt.Top:return[n,t-D1(t-s,i)];case Dt.Bottom:return[n,t+D1(s-t,i)]}}function uU({sourceX:e,sourceY:n,sourcePosition:t=Dt.Bottom,targetX:r,targetY:s,targetPosition:i=Dt.Top,curvature:a=.25}){const[o,c]=mM({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,h]=mM({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[_,p,m,w]=lU({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:h});return[`M${e},${n} C${o},${c} ${u},${h} ${r},${s}`,_,p,m,w]}function _U({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const yqn=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,xqn=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),wqn=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",So.error006()),n;const r=t.getEdgeId||yqn;let s;return Zq(e)?s={...e}:s={...e,id:r(e)},xqn(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function fU({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=_U({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const gM={[Dt.Left]:{x:-1,y:0},[Dt.Right]:{x:1,y:0},[Dt.Top]:{x:0,y:-1},[Dt.Bottom]:{x:0,y:1}},kqn=({source:e,sourcePosition:n=Dt.Bottom,target:t})=>n===Dt.Left||n===Dt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function Sqn({source:e,sourcePosition:n=Dt.Bottom,target:t,targetPosition:r=Dt.Top,center:s,offset:i,stepPosition:a}){const o=gM[n],c=gM[r],u={x:e.x+o.x*i,y:e.y+o.y*i},h={x:t.x+c.x*i,y:t.y+c.y*i},_=kqn({source:u,sourcePosition:n,target:h}),p=_.x!==0?"x":"y",m=_[p];let w=[],k,v;const b={x:0,y:0},x={x:0,y:0},[,,y,C]=_U({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*c[p]===-1){p==="x"?(k=s.x??u.x+(h.x-u.x)*a,v=s.y??(u.y+h.y)/2):(k=s.x??(u.x+h.x)/2,v=s.y??u.y+(h.y-u.y)*a);const j=[{x:k,y:u.y},{x:k,y:h.y}],M=[{x:u.x,y:v},{x:h.x,y:v}];o[p]===m?w=p==="x"?j:M:w=p==="x"?M:j}else{const j=[{x:u.x,y:h.y}],M=[{x:h.x,y:u.y}];if(p==="x"?w=o.x===m?M:j:w=o.y===m?j:M,n===r){const H=Math.abs(e[p]-t[p]);if(H<=i){const Q=Math.min(i-1,i-H);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Q:x[p]=(h[p]>t[p]?-1:1)*Q}}if(n!==r){const H=p==="x"?"y":"x",Q=o[p]===c[H],V=u[H]>h[H],Z=u[H]=q?(k=(D.x+I.x)/2,v=w[0].y):(k=w[0].x,v=(D.y+I.y)/2)}const z={x:u.x+b.x,y:u.y+b.y},E={x:h.x+x.x,y:h.y+x.y};return[[e,...z.x!==w[0].x||z.y!==w[0].y?[z]:[],...w,...E.x!==w[w.length-1].x||E.y!==w[w.length-1].y?[E]:[],t],k,v,y,C]}function Cqn(e,n,t,r){const s=Math.min(vM(e,n)/2,vM(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function hk(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Nqn(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=hk(c,n);i.has(u)||(a.push({id:u,color:c.color||t,...c}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const dU=1e3,zqn=10,TC={nodeOrigin:[0,0],nodeExtent:em,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},jqn={...TC,checkEquality:!0};function AC(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function Tqn(e,n,t){const r=AC(TC,t);for(const s of e.values())if(s.parentId)MC(s,e,n,r);else{const i=Fm(s,r.nodeOrigin),a=mf(s.extent)?s.extent:r.nodeExtent,o=pf(i,a,yl(s));s.internals.positionAbsolute=o}}function Aqn(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function RC(e){return e==="manual"}function pk(e,n,t,r={}){var h,_;const s=AC(jqn,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!RC(s.zIndexMode)?dU:0;let c=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const w=Fm(p,s.nodeOrigin),k=mf(p.extent)?p.extent:s.nodeExtent,v=pf(w,k,yl(p));m={...s.defaults,...p,measured:{width:(h=p.measured)==null?void 0:h.width,height:(_=p.measured)==null?void 0:_.height},internals:{positionAbsolute:v,handleBounds:Aqn(p,m),z:hU(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),p.parentId&&MC(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function Rqn(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function MC(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:c}=AC(TC,r),u=e.parentId,h=n.get(u);if(!h){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Rqn(e,t),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&c==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*zqn),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const _=i&&!RC(c)?dU:0,{x:p,y:m,z:w}=Mqn(e,h,a,o,_,c),{positionAbsolute:k}=e.internals,v=p!==k.x||m!==k.y;(v||w!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:k,z:w}})}function hU(e,n,t){const r=vo(e.zIndex)?e.zIndex:0;return RC(t)?r:r+(e.selected?n:0)}function Mqn(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,c=yl(e),u=Fm(e,t),h=mf(e.extent)?pf(u,e.extent,c):u;let _=pf({x:a+h.x,y:o+h.y},r,c);e.extent==="parent"&&(_=eU(_,c,n));const p=hU(e,s,i),m=n.internals.z??0;return{x:_.x,y:_.y,z:m>=p?m+1:p}}function OC(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const c=n.get(o.parentId);if(!c)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??nm(c),h=tU(u,o.rect);i.set(o.parentId,{expandedRect:h,parent:c})}return i.size>0&&i.forEach(({expandedRect:o,parent:c},u)=>{var y;const h=c.internals.positionAbsolute,_=yl(c),p=c.origin??r,m=o.x0||w>0||b||x)&&(s.push({id:u,type:"position",position:{x:c.position.x-m+b,y:c.position.y-w+x}}),(y=t.get(u))==null||y.forEach(C=>{e.some(z=>z.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+w}})})),(_.width0){const m=OC(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:c}}async function Dqn({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function wM(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const c=r.get(a)||new Map;if(r.set(a,c.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function pU(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,h=`${i}-${o}--${s}-${a}`;wM("source",c,h,e,s,a),wM("target",c,u,e,i,o),n.set(r.id,r)}}function mU(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:mU(t,n):!1}function kM(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Lqn(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!mU(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function N4({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,c;const s=[];for(const[u,h]of n){const _=(a=t.get(u))==null?void 0:a.internals.userNode;_&&s.push({..._,position:h.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((c=n.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function Iqn({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=qm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function $qn({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,c=!1,u={x:0,y:0},h=null,_=!1,p=null,m=!1,w=!1,k=null;function v({noDragClassName:x,handleSelector:y,domNode:C,isSelectable:z,nodeId:E,nodeClickDistance:T=0}){p=aa(C);function j({x:$,y:q}){const{nodeLookup:H,nodeExtent:Q,snapGrid:V,snapToGrid:Z,nodeOrigin:Y,onNodeDrag:B,onSelectionDrag:L,onError:F,updateNodePositions:U}=n();i={x:$,y:q};let K=!1;const ne=o.size>1,oe=ne&&Q?fk(Hm(o)):null,ue=ne&&Z?Iqn({dragItems:o,snapGrid:V,x:$,y:q}):null;for(const[se,G]of o){if(!H.has(se))continue;let ae={x:$-G.distance.x,y:q-G.distance.y};Z&&(ae=ue?{x:Math.round(ae.x+ue.x),y:Math.round(ae.y+ue.y)}:qm(ae,V));let ce=null;if(ne&&Q&&!G.extent&&oe){const{positionAbsolute:Ae}=G.internals,De=Ae.x-oe.x+Q[0][0],We=Ae.x+G.measured.width-oe.x2+Q[1][0],Ne=Ae.y-oe.y+Q[0][1],xe=Ae.y+G.measured.height-oe.y2+Q[1][1];ce=[[De,Ne],[We,xe]]}const{position:pe,positionAbsolute:be}=Jq({nodeId:se,nextPosition:ae,nodeLookup:H,nodeExtent:ce||Q,nodeOrigin:Y,onError:F});K=K||G.position.x!==pe.x||G.position.y!==pe.y,G.position=pe,G.internals.positionAbsolute=be}if(w=w||K,!!K&&(U(o,!0),k&&(r||B||!E&&L))){const[se,G]=N4({nodeId:E,dragItems:o,nodeLookup:H});r==null||r(k,o,se,G),B==null||B(k,se,G),E||L==null||L(k,G)}}async function M(){if(!h)return;const{transform:$,panBy:q,autoPanSpeed:H,autoPanOnNodeDrag:Q}=n();if(!Q){c=!1,cancelAnimationFrame(a);return}const[V,Z]=NC(u,h,H);(V!==0||Z!==0)&&(i.x=(i.x??0)-V/$[2],i.y=(i.y??0)-Z/$[2],await q({x:V,y:Z})&&j(i)),a=requestAnimationFrame(M)}function D($){var ne;const{nodeLookup:q,multiSelectionActive:H,nodesDraggable:Q,transform:V,snapGrid:Z,snapToGrid:Y,selectNodesOnDrag:B,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:U}=n();_=!0,(!B||!z)&&!H&&E&&((ne=q.get(E))!=null&&ne.selected||U()),z&&B&&E&&(e==null||e(E));const K=k0($.sourceEvent,{transform:V,snapGrid:Z,snapToGrid:Y,containerBounds:h});if(i=K,o=Lqn(q,Q,K,E),o.size>0&&(t||L||!E&&F)){const[oe,ue]=N4({nodeId:E,dragItems:o,nodeLookup:q});t==null||t($.sourceEvent,o,oe,ue),L==null||L($.sourceEvent,oe,ue),E||F==null||F($.sourceEvent,ue)}}const I=Rq().clickDistance(T).on("start",$=>{const{domNode:q,nodeDragThreshold:H,transform:Q,snapGrid:V,snapToGrid:Z}=n();h=(q==null?void 0:q.getBoundingClientRect())||null,m=!1,w=!1,k=$.sourceEvent,H===0&&D($),i=k0($.sourceEvent,{transform:Q,snapGrid:V,snapToGrid:Z,containerBounds:h}),u=bo($.sourceEvent,h)}).on("drag",$=>{const{autoPanOnNodeDrag:q,transform:H,snapGrid:Q,snapToGrid:V,nodeDragThreshold:Z,nodeLookup:Y}=n(),B=k0($.sourceEvent,{transform:H,snapGrid:Q,snapToGrid:V,containerBounds:h});if(k=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||E&&!Y.has(E))&&(m=!0),!m){if(!c&&q&&_&&(c=!0,M()),!_){const L=bo($.sourceEvent,h),F=L.x-u.x,U=L.y-u.y;Math.sqrt(F*F+U*U)>Z&&D($)}(i.x!==B.xSnapped||i.y!==B.ySnapped)&&o&&_&&(u=bo($.sourceEvent,h),j(B))}}).on("end",$=>{if(!_||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(c=!1,_=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:q,updateNodePositions:H,onNodeDragStop:Q,onSelectionDragStop:V}=n();if(w&&(H(o,!1),w=!1),s||Q||!E&&V){const[Z,Y]=N4({nodeId:E,dragItems:o,nodeLookup:q,dragging:!1});s==null||s($.sourceEvent,o,Z,Y),Q==null||Q($.sourceEvent,Z,Y),E||V==null||V($.sourceEvent,Y)}}}).filter($=>{const q=$.target;return!$.button&&(!x||!kM(q,`.${x}`,C))&&(!y||kM(q,y,C))});p.call(I)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function Bqn(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())yb(s,nm(i))>0&&r.push(i);return r}const Pqn=250;function Fqn(e,n,t,r){var o,c;let s=[],i=1/0;const a=Bqn(e,t,n+Pqn);for(const u of a){const h=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const _ of h){if(r.nodeId===_.nodeId&&r.type===_.type&&r.id===_.id)continue;const{x:p,y:m}=gf(u,_,_.position,!0),w=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));w>n||(w1){const u=r.type==="source"?"target":"source";return s.find(h=>h.type===u)??s[0]}return s[0]}function gU(e,n,t,r,s,i=!1){var u,h,_;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((h=a.internals.handleBounds)==null?void 0:h.source)??[],...((_=a.internals.handleBounds)==null?void 0:_.target)??[]],c=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return c&&i?{...c,...gf(a,c,c.position,!0)}:c}function vU(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function Hqn(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const bU=()=>!0;function qqn(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:c,lib:u,autoPanOnConnect:h,flowId:_,panBy:p,cancelConnection:m,onConnectStart:w,onConnect:k,onConnectEnd:v,isValidConnection:b=bU,onReconnectEnd:x,updateConnection:y,getTransform:C,getFromHandle:z,autoPanSpeed:E,dragThreshold:T=1,handleDomNode:j}){const M=aU(e.target);let D=0,I;const{x:$,y:q}=bo(e),H=vU(i,j),Q=o==null?void 0:o.getBoundingClientRect();let V=!1;if(!Q||!H)return;const Z=gU(s,H,r,c,n);if(!Z)return;let Y=bo(e,Q),B=!1,L=null,F=!1,U=null;function K(){if(!h||!Q)return;const[pe,be]=NC(Y,Q,E);p({x:pe,y:be}),D=requestAnimationFrame(K)}const ne={...Z,nodeId:s,type:H,position:Z.position},oe=c.get(s);let se={inProgress:!0,isValid:null,from:gf(oe,ne,Dt.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:oe,to:Y,toHandle:null,toPosition:_M[ne.position],toNode:null,pointer:Y};function G(){V=!0,y(se),w==null||w(e,{nodeId:s,handleId:r,handleType:H})}T===0&&G();function ae(pe){if(!V){const{x:xe,y:rt}=bo(pe),Ze=xe-$,ct=rt-q;if(!(Ze*Ze+ct*ct>T*T))return;G()}if(!z()||!ne){ce(pe);return}const be=C();Y=bo(pe,Q),I=Fqn(Um(Y,be,!1,[1,1]),t,c,ne),B||(K(),B=!0);const Ae=yU(pe,{handle:I,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:_,nodeLookup:c});U=Ae.handleDomNode,L=Ae.connection,F=Hqn(!!I,Ae.isValid);const De=c.get(s),We=De?gf(De,ne,Dt.Left,!0):se.from,Ne={...se,from:We,isValid:F,to:Ae.toHandle&&F?Mh({x:Ae.toHandle.x,y:Ae.toHandle.y},be):Y,toHandle:Ae.toHandle,toPosition:F&&Ae.toHandle?Ae.toHandle.position:_M[ne.position],toNode:Ae.toHandle?c.get(Ae.toHandle.nodeId):null,pointer:Y};y(Ne),se=Ne}function ce(pe){if(!("touches"in pe&&pe.touches.length>0)){if(V){(I||U)&&L&&F&&(k==null||k(L));const{inProgress:be,...Ae}=se,De={...Ae,toPosition:se.toHandle?se.toPosition:null};v==null||v(pe,De),i&&(x==null||x(pe,De))}m(),cancelAnimationFrame(D),B=!1,F=!1,L=null,U=null,M.removeEventListener("mousemove",ae),M.removeEventListener("mouseup",ce),M.removeEventListener("touchmove",ae),M.removeEventListener("touchend",ce)}}M.addEventListener("mousemove",ae),M.addEventListener("mouseup",ce),M.addEventListener("touchmove",ae),M.addEventListener("touchend",ce)}function yU(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:c,isValidConnection:u=bU,nodeLookup:h}){const _=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${c}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:w}=bo(e),k=a.elementFromPoint(m,w),v=k!=null&&k.classList.contains(`${o}-flow__handle`)?k:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const x=vU(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),z=v.classList.contains("connectable"),E=v.classList.contains("connectableend");if(!y||!x)return b;const T={source:_?y:r,sourceHandle:_?C:s,target:_?r:y,targetHandle:_?s:C};b.connection=T;const M=z&&E&&(t===Ah.Strict?_&&x==="source"||!_&&x==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=gU(y,x,C,h,t,!0)}return b}const mk={onPointerDown:qqn,isValid:yU};function Uqn({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=aa(e);function i({translateExtent:o,width:c,height:u,zoomStep:h=1,pannable:_=!0,zoomable:p=!0,inversePan:m=!1}){const w=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),z=y.sourceEvent.ctrlKey&&rm()?10:1,E=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*h,T=C[2]*Math.pow(2,E*z);n.scaleTo(T)};let k=[0,0];const v=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])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const z=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],E=[z[0]-k[0],z[1]-k[1]];k=z;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-E[0]*T,y:C[1]-E[1]*T},M=[[0,0],[c,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},x=Kq().on("start",v).on("zoom",_?b:null).on("zoom.wheel",p?w:null);s.call(x,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:uo}}const Gy=e=>({x:e.x,y:e.y,zoom:e.k}),z4=({x:e,y:n,zoom:t})=>Hy.translate(e,n).scale(t),Ad=(e,n)=>e.target.closest(`.${n}`),xU=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),Gqn=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,j4=(e,n=0,t=Gqn,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},wU=e=>{const n=e.ctrlKey&&rm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function Vqn({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:u}){return h=>{if(Ad(h,n))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const _=t.property("__zoom").k||1;if(h.ctrlKey&&a){const v=uo(h),b=wU(h),x=_*Math.pow(2,b);r.scaleTo(t,x,v,h);return}const p=h.deltaMode===1?20:1;let m=s===J_.Vertical?0:h.deltaX*p,w=s===J_.Horizontal?0:h.deltaY*p;!rm()&&h.shiftKey&&s!==J_.Vertical&&(m=h.deltaY*p,w=0),r.translateBy(t,-(m/_)*i,-(w/_)*i,{internal:!0});const k=Gy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(h,k),e.panScrollTimeout=setTimeout(()=>{u==null||u(h,k),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(h,k))}}function Kqn({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=Ad(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function Wqn({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=Gy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function Qqn({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&xU(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,Gy(i.transform)))}}function Xqn({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&xU(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=Gy(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},t?150:0)}}}function Yqn({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:c,lib:u,connectionInProgress:h}){return _=>{var v;const p=e||n,m=t&&_.ctrlKey,w=_.type==="wheel";if(_.button===1&&_.type==="mousedown"&&(Ad(_,`${u}-flow__node`)||Ad(_,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||h&&!w||Ad(_,o)&&w||Ad(_,c)&&(!w||s&&w&&!e)||!t&&_.ctrlKey&&w)return!1;if(!t&&_.type==="touchstart"&&((v=_.touches)==null?void 0:v.length)>1)return _.preventDefault(),!1;if(!p&&!s&&!m&&w||!r&&(_.type==="mousedown"||_.type==="touchstart")||Array.isArray(r)&&!r.includes(_.button)&&_.type==="mousedown")return!1;const k=Array.isArray(r)&&r.includes(_.button)||!_.button||_.button<=1;return(!_.ctrlKey||w)&&k}}function Zqn({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),_=Kq().scaleExtent([n,t]).translateExtent(r),p=aa(e).call(_);x({x:s.x,y:s.y,zoom:Rh(s.zoom,n,t)},[[0,0],[h.width,h.height]],r);const m=p.on("wheel.zoom"),w=p.on("dblclick.zoom");_.wheelDelta(wU);async function k(I,$){return p?new Promise(q=>{_==null||_.interpolate(($==null?void 0:$.interpolate)==="linear"?w0:ov).transform(j4(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),I)}):!1}function v({noWheelClassName:I,noPanClassName:$,onPaneContextMenu:q,userSelectionActive:H,panOnScroll:Q,panOnDrag:V,panOnScrollMode:Z,panOnScrollSpeed:Y,preventScrolling:B,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:U,zoomActivationKeyPressed:K,lib:ne,onTransformChange:oe,connectionInProgress:ue,paneClickDistance:se,selectionOnDrag:G}){H&&!u.isZoomingOrPanning&&b();const ae=Q&&!K&&!H;_.clickDistance(G?1/0:!vo(se)||se<0?0:se);const ce=ae?Vqn({zoomPanValues:u,noWheelClassName:I,d3Selection:p,d3Zoom:_,panOnScrollMode:Z,panOnScrollSpeed:Y,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):Kqn({noWheelClassName:I,preventScrolling:B,d3ZoomHandler:m});p.on("wheel.zoom",ce,{passive:!1});const pe=Wqn({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});_.on("start",pe);const be=Qqn({zoomPanValues:u,panOnDrag:V,onPaneContextMenu:!!q,onPanZoom:i,onTransformChange:oe});_.on("zoom",be);const Ae=Xqn({zoomPanValues:u,panOnDrag:V,panOnScroll:Q,onPaneContextMenu:q,onPanZoomEnd:o,onDraggingChange:c});_.on("end",Ae);const De=Yqn({zoomActivationKeyPressed:K,panOnDrag:V,zoomOnScroll:F,panOnScroll:Q,zoomOnDoubleClick:U,zoomOnPinch:L,userSelectionActive:H,noPanClassName:$,noWheelClassName:I,lib:ne,connectionInProgress:ue});_.filter(De),U?p.on("dblclick.zoom",w):p.on("dblclick.zoom",null)}function b(){_.on("zoom",null)}async function x(I,$,q){const H=z4(I),Q=_==null?void 0:_.constrain()(H,$,q);return Q&&await k(Q),Q}async function y(I,$){const q=z4(I);return await k(q,$),q}function C(I){if(p){const $=z4(I),q=p.property("__zoom");(q.k!==I.zoom||q.x!==I.x||q.y!==I.y)&&(_==null||_.transform(p,$,null,{sync:!0}))}}function z(){const I=p?Vq(p.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}async function E(I,$){return p?new Promise(q=>{_==null||_.interpolate(($==null?void 0:$.interpolate)==="linear"?w0:ov).scaleTo(j4(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),I)}):!1}async function T(I,$){return p?new Promise(q=>{_==null||_.interpolate(($==null?void 0:$.interpolate)==="linear"?w0:ov).scaleBy(j4(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),I)}):!1}function j(I){_==null||_.scaleExtent(I)}function M(I){_==null||_.translateExtent(I)}function D(I){const $=!vo(I)||I<0?0:I;_==null||_.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:x,getViewport:z,scaleTo:E,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:D}}var Oh;(function(e){e.Line="line",e.Handle="handle"})(Oh||(Oh={}));function Jqn({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,c=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(c[0]=c[0]*-1),o&&i&&(c[1]=c[1]*-1),c}function SM(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function lu(e,n){return Math.max(0,n-e)}function uu(e,n){return Math.max(0,e-n)}function L1(e,n,t){return Math.max(0,n-e,e-t)}function CM(e,n){return e?!n:n}function eUn(e,n,t,r,s,i,a,o){let{affectsX:c,affectsY:u}=n;const{isHorizontal:h,isVertical:_}=n,p=h&&_,{xSnapped:m,ySnapped:w}=t,{minWidth:k,maxWidth:v,minHeight:b,maxHeight:x}=r,{x:y,y:C,width:z,height:E,aspectRatio:T}=e;let j=Math.floor(h?m-e.pointerX:0),M=Math.floor(_?w-e.pointerY:0);const D=z+(c?-j:j),I=E+(u?-M:M),$=-i[0]*z,q=-i[1]*E;let H=L1(D,k,v),Q=L1(I,b,x);if(a){let Y=0,B=0;c&&j<0?Y=lu(y+j+$,a[0][0]):!c&&j>0&&(Y=uu(y+D+$,a[1][0])),u&&M<0?B=lu(C+M+q,a[0][1]):!u&&M>0&&(B=uu(C+I+q,a[1][1])),H=Math.max(H,Y),Q=Math.max(Q,B)}if(o){let Y=0,B=0;c&&j>0?Y=uu(y+j,o[0][0]):!c&&j<0&&(Y=lu(y+D,o[1][0])),u&&M>0?B=uu(C+M,o[0][1]):!u&&M<0&&(B=lu(C+I,o[1][1])),H=Math.max(H,Y),Q=Math.max(Q,B)}if(s){if(h){const Y=L1(D/T,b,x)*T;if(H=Math.max(H,Y),a){let B=0;!c&&!u||c&&!u&&p?B=uu(C+q+D/T,a[1][1])*T:B=lu(C+q+(c?j:-j)/T,a[0][1])*T,H=Math.max(H,B)}if(o){let B=0;!c&&!u||c&&!u&&p?B=lu(C+D/T,o[1][1])*T:B=uu(C+(c?j:-j)/T,o[0][1])*T,H=Math.max(H,B)}}if(_){const Y=L1(I*T,k,v)/T;if(Q=Math.max(Q,Y),a){let B=0;!c&&!u||u&&!c&&p?B=uu(y+I*T+$,a[1][0])/T:B=lu(y+(u?M:-M)*T+$,a[0][0])/T,Q=Math.max(Q,B)}if(o){let B=0;!c&&!u||u&&!c&&p?B=lu(y+I*T,o[1][0])/T:B=uu(y+(u?M:-M)*T,o[0][0])/T,Q=Math.max(Q,B)}}}M=M+(M<0?Q:-Q),j=j+(j<0?H:-H),s&&(p?D>I*T?M=(CM(c,u)?-j:j)/T:j=(CM(c,u)?-M:M)*T:h?(M=j/T,u=c):(j=M*T,c=u));const V=c?y+j:y,Z=u?C+M:C;return{width:z+(c?-j:j),height:E+(u?-M:M),x:i[0]*j*(c?-1:1)+V,y:i[1]*M*(u?-1:1)+Z}}const kU={width:0,height:0,x:0,y:0},tUn={...kU,pointerX:0,pointerY:0,aspectRatio:1};function nUn(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,c=t[1]*a;return[[r-o,s-c],[r+i-o,s+a-c]]}function rUn({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=aa(e);let a={controlDirection:SM("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:h,keepAspectRatio:_,resizeDirection:p,onResizeStart:m,onResize:w,onResizeEnd:k,shouldResize:v}){let b={...kU},x={...tUn};a={boundaries:h,resizeDirection:p,keepAspectRatio:_,controlDirection:SM(u)};let y,C=null,z=[],E,T,j,M=!1;const D=Rq().on("start",I=>{const{nodeLookup:$,transform:q,snapGrid:H,snapToGrid:Q,nodeOrigin:V,paneDomNode:Z}=t();if(y=$.get(n),!y)return;C=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:Y,ySnapped:B}=k0(I.sourceEvent,{transform:q,snapGrid:H,snapToGrid:Q,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},x={...b,pointerX:Y,pointerY:B,aspectRatio:b.width/b.height},E=void 0,T=mf(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(E=$.get(y.parentId)),E&&y.extent==="parent"&&(T=[[0,0],[E.measured.width,E.measured.height]]),z=[],j=void 0;for(const[L,F]of $)if(F.parentId===n&&(z.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const U=nUn(F,y,F.origin??V);j?j=[[Math.min(U[0][0],j[0][0]),Math.min(U[0][1],j[0][1])],[Math.max(U[1][0],j[1][0]),Math.max(U[1][1],j[1][1])]]:j=U}m==null||m(I,{...b})}).on("drag",I=>{const{transform:$,snapGrid:q,snapToGrid:H,nodeOrigin:Q}=t(),V=k0(I.sourceEvent,{transform:$,snapGrid:q,snapToGrid:H,containerBounds:C}),Z=[];if(!y)return;const{x:Y,y:B,width:L,height:F}=b,U={},K=y.origin??Q,{width:ne,height:oe,x:ue,y:se}=eUn(x,a.controlDirection,V,a.boundaries,a.keepAspectRatio,K,T,j),G=ne!==L,ae=oe!==F,ce=ue!==Y&&G,pe=se!==B&&ae;if(!ce&&!pe&&!G&&!ae)return;if((ce||pe||K[0]===1||K[1]===1)&&(U.x=ce?ue:b.x,U.y=pe?se:b.y,b.x=U.x,b.y=U.y,z.length>0)){const We=ue-Y,Ne=se-B;for(const xe of z)xe.position={x:xe.position.x-We+K[0]*(ne-L),y:xe.position.y-Ne+K[1]*(oe-F)},Z.push(xe)}if((G||ae)&&(U.width=G&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ne:b.width,U.height=ae&&(!a.resizeDirection||a.resizeDirection==="vertical")?oe:b.height,b.width=U.width,b.height=U.height),E&&y.expandParent){const We=K[0]*(U.width??0);U.x&&U.x{M&&(k==null||k(I,{...b}),s==null||s({...b}),M=!1)});i.call(D)}function c(){i.on(".drag",null)}return{update:o,destroy:c}}const sUn={},EM=e=>{let n;const t=new Set,r=(h,_)=>{const p=typeof h=="function"?h(n):h;if(!Object.is(p,n)){const m=n;n=_??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(w=>w(n,m))}},s=()=>n,c={setState:r,getState:s,getInitialState:()=>u,subscribe:h=>(t.add(h),()=>t.delete(h)),destroy:()=>{(sUn?"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."),t.clear()}},u=n=e(r,s,c);return c},iUn=e=>e?EM(e):EM,{useDebugValue:aUn}=et,{useSyncExternalStoreWithSelector:oUn}=IW,cUn=e=>e;function SU(e,n=cUn,t){const r=oUn(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return aUn(r),r}const NM=(e,n)=>{const t=iUn(e),r=(s,i=n)=>SU(t,s,i);return Object.assign(r,t),r},lUn=(e,n)=>e?NM(e,n):NM;function Cr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const Vy=A.createContext(null),uUn=Vy.Provider,CU=So.error001("react");function Rn(e,n){const t=A.useContext(Vy);if(t===null)throw new Error(CU);return SU(t,e,n)}function Nr(){const e=A.useContext(Vy);if(e===null)throw new Error(CU);return A.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const zM={display:"none"},_Un={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},EU="react-flow__node-desc",NU="react-flow__edge-desc",fUn="react-flow__aria-live",dUn=e=>e.ariaLiveMessage,hUn=e=>e.ariaLabelConfig;function pUn({rfId:e}){const n=Rn(dUn);return f.jsx("div",{id:`${fUn}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:_Un,children:n})}function mUn({rfId:e,disableKeyboardA11y:n}){const t=Rn(hUn);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${EU}-${e}`,style:zM,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${NU}-${e}`,style:zM,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(pUn,{rfId:e})]})}const Ky=A.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:ls(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});Ky.displayName="Panel";const jM="https://reactflow.dev?utm_source=attribution";function gUn({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(Ky,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${jM}`,children:f.jsx("a",{href:jM,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const vUn=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},I1=e=>e.id;function bUn(e,n){return Cr(e.selectedNodes.map(I1),n.selectedNodes.map(I1))&&Cr(e.selectedEdges.map(I1),n.selectedEdges.map(I1))}function yUn({onSelectionChange:e}){const n=Nr(),{selectedNodes:t,selectedEdges:r}=Rn(vUn,bUn);return A.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const xUn=e=>!!e.onSelectionChangeHandlers;function wUn({onSelectionChange:e}){const n=Rn(xUn);return e||n?f.jsx(yUn,{onSelectionChange:e}):null}const zU=[0,0],kUn={x:0,y:0,zoom:1},SUn=["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"],TM=[...SUn,"rfId"],CUn=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}),AM={translateExtent:em,nodeOrigin:zU,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function EUn(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:c}=Rn(CUn,Cr),u=Nr();A.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=AM,o()}),[]);const h=A.useRef(AM);return A.useEffect(()=>{for(const _ of TM){const p=e[_],m=h.current[_];p!==m&&(typeof e[_]>"u"||(_==="nodes"?n(p):_==="edges"?t(p):_==="minZoom"?r(p):_==="maxZoom"?s(p):_==="translateExtent"?i(p):_==="nodeExtent"?a(p):_==="ariaLabelConfig"?u.setState({ariaLabelConfig:mqn(p)}):_==="fitView"?u.setState({fitViewQueued:p}):_==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[_]:p})))}h.current=e},TM.map(_=>e[_])),null}function RM(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function NUn(e){var r;const[n,t]=A.useState(e==="system"?null:e);return A.useEffect(()=>{if(e!=="system"){t(e);return}const s=RM(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=RM())!=null&&r.matches?"dark":"light"}const MM=typeof document<"u"?document:null;function sm(e=null,n={target:MM,actInsideInputWithModifier:!0}){const[t,r]=A.useState(!1),s=A.useRef(!1),i=A.useRef(new Set([])),[a,o]=A.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(_=>typeof _=="string").map(_=>_.replace("+",` `).replace(` `,` +`).split(` -`)),h=u.reduce((_,p)=>_.concat(...p),[]);return[u,h]}return[[],[]]},[e]);return A.useEffect(()=>{const c=(n==null?void 0:n.target)??AM,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const h=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&rU(m))return!1;const k=MM(m.code,o);if(i.current.add(m[k]),RM(a,i.current,!1)){const w=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},_=m=>{const x=MM(m.code,o);RM(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[x]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",_),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",_),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function RM(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function MM(e,n){return n.includes(e)?"code":"key"}const gqn=()=>{const e=jr();return A.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),c=NC(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(c,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:c}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-c},h=t.snapGrid??s,_=t.snapToGrid??i;return qm(u,r,_,h)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=Rh(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function CU(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const c of a)vqn(c,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function vqn(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function bqn(e,n){return CU(e,n)}function yqn(e,n){return CU(e,n)}function b_(e,n){return{id:e,type:"select",selected:n}}function Ad(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(b_(i.id,a)))}return r}function OM({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),c=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;c!==void 0&&c!==a&&t.push({id:a.id,item:a,type:"replace"}),c===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function DM(e){return{id:e.id,type:"remove"}}const xqn=Jq();function wqn(e,n,t={}){return _Hn(e,n,{...t,onError:t.onError??xqn})}const LM=e=>XFn(e),kqn=e=>Wq(e);function EU(e){return A.forwardRef(e)}const Sqn=typeof window<"u"?A.useLayoutEffect:A.useEffect;function IM(e){const[n,t]=A.useState(BigInt(0)),[r]=A.useState(()=>Cqn(()=>t(s=>s+BigInt(1))));return Sqn(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function Cqn(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const NU=A.createContext(null);function Eqn({children:e}){const n=jr(),t=A.useCallback(o=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:h,onNodesChange:_,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:x}=n.getState();let k=c;for(const b of o)k=typeof b=="function"?b(k):b;let v=OM({items:k,lookup:p});for(const b of x.values())v=b(v);h&&u(k),v.length>0?_==null||_(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=IM(t),s=A.useCallback(o=>{const{edges:c=[],setEdges:u,hasDefaultEdges:h,onEdgesChange:_,edgeLookup:p}=n.getState();let m=c;for(const x of o)m=typeof x=="function"?x(m):x;h?u(m):_&&_(OM({items:m,lookup:p}))},[]),i=IM(s),a=A.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(NU.Provider,{value:a,children:e})}function Nqn(){const e=A.useContext(NU);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const zqn=e=>!!e.panZoom;function OC(){const e=gqn(),n=jr(),t=Nqn(),r=jn(zqn),s=A.useMemo(()=>{const i=_=>n.getState().nodeLookup.get(_),a=_=>{t.nodeQueue.push(_)},o=_=>{t.edgeQueue.push(_)},c=_=>{var b,w;const{nodeLookup:p,nodeOrigin:m}=n.getState(),x=LM(_)?_:p.get(_.id),k=x.parentId?tU(x.position,x.measured,x.parentId,p,m):x.position,v={...x,position:k,width:((b=x.measured)==null?void 0:b.width)??x.width,height:((w=x.measured)==null?void 0:w.height)??x.height};return tm(v)},u=(_,p,m={replace:!1})=>{a(x=>x.map(k=>{if(k.id===_){const v=typeof p=="function"?p(k):p;return m.replace&&LM(v)?v:{...k,...v}}return k}))},h=(_,p,m={replace:!1})=>{o(x=>x.map(k=>{if(k.id===_){const v=typeof p=="function"?p(k):p;return m.replace&&kqn(v)?v:{...k,...v}}return k}))};return{getNodes:()=>n.getState().nodes.map(_=>({..._})),getNode:_=>{var p;return(p=i(_))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:_=[]}=n.getState();return _.map(p=>({...p}))},getEdge:_=>n.getState().edgeLookup.get(_),setNodes:a,setEdges:o,addNodes:_=>{const p=Array.isArray(_)?_:[_];t.nodeQueue.push(m=>[...m,...p])},addEdges:_=>{const p=Array.isArray(_)?_:[_];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:_=[],edges:p=[],transform:m}=n.getState(),[x,k,v]=m;return{nodes:_.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x,y:k,zoom:v}}},deleteElements:async({nodes:_=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:k,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:N,edges:z}=await tHn({nodesToRemove:_,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:C}),T=z.length>0,j=N.length>0;if(T){const M=z.map(DM);v==null||v(z),w(M)}if(j){const M=N.map(DM);k==null||k(N),b(M)}return(j||T)&&(y==null||y({nodes:N,edges:z})),{deletedNodes:N,deletedEdges:z}},getIntersectingNodes:(_,p=!0,m)=>{const x=_M(_),k=x?_:c(_),v=m!==void 0;return k?(m||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!x&&(b.id===_.id||!w.internals.positionAbsolute))return!1;const y=tm(v?b:w),C=bb(y,k);return p&&C>0||C>=y.width*y.height||C>=k.width*k.height}):[]},isNodeIntersecting:(_,p,m=!0)=>{const k=_M(_)?_:c(_);if(!k)return!1;const v=bb(k,p);return m&&v>0||v>=p.width*p.height||v>=k.width*k.height},updateNode:u,updateNodeData:(_,p,m={replace:!1})=>{u(_,x=>{const k=typeof p=="function"?p(x):p;return m.replace?{...x,data:k}:{...x,data:{...x.data,...k}}},m)},updateEdge:h,updateEdgeData:(_,p,m={replace:!1})=>{h(_,x=>{const k=typeof p=="function"?p(x):p;return m.replace?{...x,data:k}:{...x,data:{...x.data,...k}}},m)},getNodesBounds:_=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return YFn(_,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:_,id:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}-${_}${p?`-${p}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:_,handleId:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}${_?p?`-${_}-${p}`:`-${_}`:""}`))==null?void 0:x.values())??[])},fitView:async _=>{const p=n.getState().fitViewResolver??sHn();return n.setState({fitViewQueued:!0,fitViewOptions:_,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return A.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const $M=e=>e.selected,jqn=typeof window<"u"?window:void 0;function Tqn({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=jr(),{deleteElements:r}=OC(),s=rm(e,{actInsideInputWithModifier:!1}),i=rm(n,{target:jqn});A.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter($M),edges:a.filter($M)}),t.setState({nodesSelectionActive:!1})}},[s]),A.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function Aqn(e){const n=jr();A.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=zC(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",uo.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const Vy={position:"absolute",width:"100%",height:"100%",top:0,left:0},Rqn=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Mqn({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=G_.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:u,minZoom:h,maxZoom:_,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:k,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const N=jr(),z=A.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=jn(Rqn,Nr),D=rm(p),I=A.useRef();Aqn(z);const $=A.useCallback(q=>{b==null||b({x:q[0],y:q[1],zoom:q[2]}),w||N.setState({transform:q})},[b,w]);return A.useEffect(()=>{if(z.current){I.current=FHn({domNode:z.current,minZoom:h,maxZoom:_,translateExtent:u,viewport:c,onDraggingChange:V=>N.setState(J=>J.paneDragging===V?J:{paneDragging:V}),onPanZoomStart:(V,J)=>{const{onViewportChangeStart:Z,onMoveStart:B}=N.getState();B==null||B(V,J),Z==null||Z(J)},onPanZoom:(V,J)=>{const{onViewportChange:Z,onMove:B}=N.getState();B==null||B(V,J),Z==null||Z(J)},onPanZoomEnd:(V,J)=>{const{onViewportChangeEnd:Z,onMoveEnd:B}=N.getState();B==null||B(V,J),Z==null||Z(J)}});const{x:q,y:H,zoom:Q}=I.current.getViewport();return N.setState({panZoom:I.current,transform:[q,H,Q],domNode:z.current.closest(".react-flow")}),()=>{var V;(V=I.current)==null||V.destroy()}}},[]),A.useEffect(()=>{var q;(q=I.current)==null||q.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:D,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:k,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,D,m,v,T,k,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:z,style:Vy,children:x})}const Oqn=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Dqn(){const{userSelectionActive:e,userSelectionRect:n}=jn(Oqn,Nr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const z4=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},Lqn=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Iqn({isSelecting:e,selectionKeyPressed:n,selectionMode:t=em.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:h,onPaneScroll:_,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:k}){const v=A.useRef(0),b=jr(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:N,autoPanSpeed:z}=jn(Lqn,Nr),T=y&&(e||w),j=A.useRef(null),M=A.useRef(),D=A.useRef(new Set),I=A.useRef(new Set),$=A.useRef(!1),q=A.useRef(!1),H=A.useRef({x:0,y:0}),Q=A.useRef(!1),V=G=>{if(q.current||$.current||b.getState().connection.inProgress){q.current=!1,$.current=!1;return}u==null||u(G),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},J=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}h==null||h(G)},Z=_?G=>_(G):void 0,B=G=>{q.current&&(G.stopPropagation(),q.current=!1)},L=G=>{var we,rt;const{domNode:oe,transform:le}=b.getState();if(M.current=oe==null?void 0:oe.getBoundingClientRect(),!M.current)return;const pe=G.target===j.current;if(!pe&&!!G.target.closest(".nokey")||!e||!(a&&pe||n)||G.button!==0||!G.isPrimary)return;(rt=(we=G.target)==null?void 0:we.setPointerCapture)==null||rt.call(we,G.pointerId),q.current=!1;const{x:Le,y:Ke}=io(G.nativeEvent,M.current),je=qm({x:Le,y:Ke},le);b.setState({userSelectionRect:{width:0,height:0,startX:je.x,startY:je.y,x:Le,y:Ke}}),pe||(G.stopPropagation(),G.preventDefault())};function F(G,oe){const{userSelectionRect:le}=b.getState();if(!le)return;const{transform:pe,nodeLookup:be,edgeLookup:Me,connectionLookup:Le,triggerNodeChanges:Ke,triggerEdgeChanges:je,defaultEdgeOptions:we}=b.getState(),rt={x:le.startX,y:le.startY},{x:Ze,y:at}=Rh(rt,pe),St={startX:rt.x,startY:rt.y,x:GIe.id)),I.current=new Set;const dt=(we==null?void 0:we.selectable)??!0;for(const Ie of D.current){const me=Le.get(Ie);if(me)for(const{edgeId:Ae}of me.values()){const Pe=Me.get(Ae);Pe&&(Pe.selectable??dt)&&I.current.add(Ae)}}if(!fM(Ft,D.current)){const Ie=Ad(be,D.current,!0);Ke(Ie)}if(!fM(ut,I.current)){const Ie=Ad(Me,I.current);je(Ie)}b.setState({userSelectionRect:St,userSelectionActive:!0,nodesSelectionActive:!1})}function U(){if(!s||!M.current)return;const[G,oe]=EC(H.current,M.current,z);N({x:G,y:oe}).then(le=>{if(!q.current||!le){v.current=requestAnimationFrame(U);return}const{x:pe,y:be}=H.current;F(pe,be),v.current=requestAnimationFrame(U)})}const K=()=>{cancelAnimationFrame(v.current),v.current=0,Q.current=!1};A.useEffect(()=>()=>K(),[]);const ne=G=>{const{userSelectionRect:oe,transform:le,resetSelectedElements:pe}=b.getState();if(!M.current||!oe)return;const{x:be,y:Me}=io(G.nativeEvent,M.current);H.current={x:be,y:Me};const Le=Rh({x:oe.startX,y:oe.startY},le);if(!q.current){const Ke=n?0:i;if(Math.hypot(be-Le.x,Me-Le.y)<=Ke)return;pe(),o==null||o(G)}q.current=!0,Q.current||(U(),Q.current=!0),F(be,Me)},ce=G=>{var oe,le;if(!T){G.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}G.button===0&&((le=(oe=G.target)==null?void 0:oe.releasePointerCapture)==null||le.call(oe,G.pointerId),!w&&G.target===j.current&&b.getState().userSelectionRect&&(V==null||V(G)),b.setState({userSelectionActive:!1,userSelectionRect:null}),q.current&&(c==null||c(G),b.setState({nodesSelectionActive:D.current.size>0})),K())},_e=G=>{var oe,le;(le=(oe=G.target)==null?void 0:oe.releasePointerCapture)==null||le.call(oe,G.pointerId),K()},se=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:fs(["react-flow__pane",{draggable:se,dragging:C,selection:e}]),onClick:T?void 0:z4(V,j),onContextMenu:z4(J,j),onWheel:z4(Z,j),onPointerEnter:T?void 0:p,onPointerMove:T?ne:m,onPointerUp:ce,onPointerCancel:T?_e:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?B:void 0,onPointerLeave:x,ref:j,style:Vy,children:[k,f.jsx(Dqn,{})]})}function pk({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:c}=n.getState(),u=o.get(e);if(!u){c==null||c("012",uo.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function zU({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=jr(),[c,u]=A.useState(!1),h=A.useRef();return A.useEffect(()=>{h.current=NHn({getStoreItems:()=>o.getState(),onNodeMouseDown:_=>{pk({id:_,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),A.useEffect(()=>{if(!(n||!e.current||!h.current))return h.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var _;(_=h.current)==null||_.destroy()}},[t,r,n,i,e,s,a]),c}const $qn=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function jU(){const e=jr();return A.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:c,nodeLookup:u,nodeOrigin:h}=e.getState(),_=new Map,p=$qn(a),m=s?i[0]:5,x=s?i[1]:5,k=t.direction.x*m*t.factor,v=t.direction.y*x*t.factor;for(const[,b]of u){if(!p(b))continue;let w={x:b.internals.positionAbsolute.x+k,y:b.internals.positionAbsolute.y+v};s&&(w=Hm(w,i));const{position:y,positionAbsolute:C}=Qq({nodeId:b.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:h,onError:o});b.position=y,b.internals.positionAbsolute=C,_.set(b.id,b)}c(_)},[])}const DC=A.createContext(null),Bqn=DC.Provider;DC.Consumer;const TU=()=>A.useContext(DC),Pqn=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),AU=A.createContext(null);function Fqn({children:e}){const n=jn(Pqn,Nr);return f.jsx(AU.Provider,{value:n,children:e})}function Hqn(){const e=A.useContext(AU);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const qqn={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Uqn=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:c,isValid:u}=a;if(!o&&!s)return qqn;const h=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===n&&(c==null?void 0:c.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:h,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===Th.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:h&&u}};function Gqn({type:e="source",position:n=Rt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:c,className:u,onMouseDown:h,onTouchStart:_,...p},m){var Q,V;const x=a||null,k=e==="target",v=jr(),b=TU(),{connectOnClick:w,noPanClassName:y,rfId:C}=Hqn(),{connectingFrom:N,connectingTo:z,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:D,valid:I}=jn(Uqn(b,x,e),Nr);b||(V=(Q=v.getState()).onError)==null||V.call(Q,"010",uo.error010());const $=J=>{const{defaultEdgeOptions:Z,onConnect:B,hasDefaultEdges:L}=v.getState(),F={...Z,...J};if(L){const{edges:U,setEdges:K,onError:ne}=v.getState();K(wqn(F,U,{onError:ne}))}B==null||B(F),o==null||o(F)},q=J=>{if(!b)return;const Z=sU(J.nativeEvent);if(s&&(Z&&J.button===0||!Z)){const B=v.getState();hk.onPointerDown(J.nativeEvent,{handleDomNode:J.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:k,handleId:x,nodeId:b,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...L)=>{var F,U;return(U=(F=v.getState()).onConnectEnd)==null?void 0:U.call(F,...L)},updateConnection:B.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var F,U;return((U=(F=v.getState()).isValidConnection)==null?void 0:U.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}Z?h==null||h(J):_==null||_(J)},H=J=>{const{onClickConnectStart:Z,onClickConnectEnd:B,connectionClickStartHandle:L,connectionMode:F,isValidConnection:U,lib:K,rfId:ne,nodeLookup:ce,connection:_e}=v.getState();if(!b||!L&&!s)return;if(!L){Z==null||Z(J.nativeEvent,{nodeId:b,handleId:x,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:x}});return}const se=nU(J.target),G=t||U,{connection:oe,isValid:le}=hk.isValid(J.nativeEvent,{handle:{nodeId:b,id:x,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:G,flowId:ne,doc:se,lib:K,nodeLookup:ce});le&&oe&&$(oe);const pe=structuredClone(_e);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,B==null||B(J,pe),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":x,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${x}-${e}`,className:fs(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!k,target:k,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:N,connectingto:z,valid:I,connectionindicator:r&&(!M||j)&&(M||D?i:s)}]),onMouseDown:q,onTouchStart:q,onClick:w?H:void 0,ref:m,...p,children:c})}const Au=A.memo(EU(Gqn));function Vqn({data:e,isConnectable:n,sourcePosition:t=Rt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(Au,{type:"source",position:t,isConnectable:n})]})}function Kqn({data:e,isConnectable:n,targetPosition:t=Rt.Top,sourcePosition:r=Rt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(Au,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(Au,{type:"source",position:r,isConnectable:n})]})}function Wqn(){return null}function Qqn({data:e,isConnectable:n,targetPosition:t=Rt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Au,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const yb={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},BM={input:Vqn,default:Kqn,output:Qqn,group:Wqn};function Xqn(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const Yqn=e=>{const{width:n,height:t,x:r,y:s}=Fm(e.nodeLookup,{filter:i=>!!i.selected});return{width:so(n)?n:null,height:so(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function Zqn({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=jr(),{width:s,height:i,transformString:a,userSelectionActive:o}=jn(Yqn,Nr),c=jU(),u=A.useRef(null);A.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const h=!o&&s!==null&&i!==null;if(zU({nodeRef:u,disabled:!h}),!h)return null;const _=e?m=>{const x=r.getState().nodes.filter(k=>k.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(yb,m.key)&&(m.preventDefault(),c({direction:yb[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:fs(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:_,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const PM=typeof window<"u"?window:void 0,Jqn=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function RU({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:h,selectionMode:_,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:k,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:N,panOnScrollMode:z,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:D,translateExtent:I,minZoom:$,maxZoom:q,preventScrolling:H,onSelectionContextMenu:Q,noWheelClassName:V,noPanClassName:J,disableKeyboardA11y:Z,onViewportChange:B,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:U}=jn(Jqn,Nr),K=rm(u,{target:PM}),ne=rm(k,{target:PM}),ce=ne||j,_e=ne||C,se=h&&ce!==!0,G=K||U||se;return Tqn({deleteKeyCode:c,multiSelectionKeyCode:x}),f.jsx(Mqn,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:_e,panOnScrollSpeed:N,panOnScrollMode:z,zoomOnDoubleClick:T,panOnDrag:!K&&ce,defaultViewport:D,translateExtent:I,minZoom:$,maxZoom:q,zoomActivationKeyCode:v,preventScrolling:H,noWheelClassName:V,noPanClassName:J,onViewportChange:B,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:se,children:f.jsxs(Iqn,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ce,autoPanOnSelection:M,isSelecting:!!G,selectionMode:_,selectionKeyPressed:K,paneClickDistance:o,selectionOnDrag:se,children:[e,F&&f.jsx(Zqn,{onSelectionContextMenu:Q,noPanClassName:J,disableKeyboardA11y:Z})]})})}RU.displayName="FlowRenderer";const eUn=A.memo(RU),tUn=e=>n=>e?CC(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function nUn(e){return jn(A.useCallback(tUn(e),[e]),Nr)}const rUn=e=>e.updateNodeInternals;function sUn(){const e=jn(rUn),[n]=A.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return A.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function iUn({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=jr(),i=A.useRef(null),a=A.useRef(null),o=A.useRef(e.sourcePosition),c=A.useRef(e.targetPosition),u=A.useRef(n),h=t&&!!e.internals.handleBounds;return A.useEffect(()=>{i.current&&!e.hidden&&(!h||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[h,e.hidden]),A.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),A.useEffect(()=>{if(i.current){const _=u.current!==n,p=o.current!==e.sourcePosition,m=c.current!==e.targetPosition;(_||p||m)&&(u.current=n,o.current=e.sourcePosition,c.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function aUn({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:c,nodesConnectable:u,nodesFocusable:h,resizeObserver:_,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:k,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:N}=jn(G=>{const oe=G.nodeLookup.get(e),le=G.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:le}},Nr);let z=y.type||"default",T=(v==null?void 0:v[z])||BM[z];T===void 0&&(w==null||w("003",uo.error003(z)),z="default",T=(v==null?void 0:v.default)||BM.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||c&&typeof y.selectable>"u"),D=!!(y.connectable||u&&typeof y.connectable>"u"),I=!!(y.focusable||h&&typeof y.focusable>"u"),$=jr(),q=eU(y),H=iUn({node:y,nodeType:z,hasDimensions:q,resizeObserver:_}),Q=zU({nodeRef:H,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),V=jU();if(y.hidden)return null;const J=vl(y),Z=Xqn(y),B=M||j||n||t||r||s,L=t?G=>t(G,{...C.userNode}):void 0,F=r?G=>r(G,{...C.userNode}):void 0,U=s?G=>s(G,{...C.userNode}):void 0,K=i?G=>i(G,{...C.userNode}):void 0,ne=a?G=>a(G,{...C.userNode}):void 0,ce=G=>{const{selectNodesOnDrag:oe,nodeDragThreshold:le}=$.getState();M&&(!oe||!j||le>0)&&pk({id:e,store:$,nodeRef:H}),n&&n(G,{...C.userNode})},_e=G=>{if(!(rU(G.nativeEvent)||x)){if(Uq.includes(G.key)&&M){const oe=G.key==="Escape";pk({id:e,store:$,unselect:oe,nodeRef:H})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(yb,G.key)){G.preventDefault();const{ariaLabelConfig:oe}=$.getState();$.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:yb[G.key],factor:G.shiftKey?4:1})}}},se=()=>{var Le;if(x||!((Le=H.current)!=null&&Le.matches(":focus-visible")))return;const{transform:G,width:oe,height:le,autoPanOnNodeFocus:pe,setCenter:be}=$.getState();if(!pe)return;CC(new Map([[e,y]]),{x:0,y:0,width:oe,height:le},G,!0).length>0||be(y.position.x+J.width/2,y.position.y+J.height/2,{zoom:G[2]})};return f.jsx("div",{className:fs(["react-flow__node",`react-flow__node-${z}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:N,draggable:j,dragging:Q}]),ref:H,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:B?"all":"none",visibility:q?"visible":"hidden",...y.style,...Z},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:U,onContextMenu:K,onClick:ce,onDoubleClick:ne,onKeyDown:I?_e:void 0,tabIndex:I?0:void 0,onFocus:I?se:void 0,role:y.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${wU}-${k}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(Bqn,{value:e,children:f.jsx(T,{id:e,data:y.data,type:z,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:D,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Q,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...J})})})}var oUn=A.memo(aUn);const cUn=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function MU(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=jn(cUn,Nr),a=nUn(e.onlyRenderVisibleElements),o=sUn();return f.jsx("div",{className:"react-flow__nodes",style:Vy,children:a.map(c=>f.jsx(oUn,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}MU.displayName="NodeRenderer";const lUn=A.memo(MU);function uUn(e){return jn(A.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&cHn({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),Nr)}const _Un=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},fUn=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},FM={[gb.Arrow]:_Un,[gb.ArrowClosed]:fUn};function dUn(e){const n=jr();return A.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(FM,e)?FM[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",uo.error009(e)),null)},[e])}const hUn=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const c=dUn(n);return c?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(c,{color:t,strokeWidth:a})}):null},OU=({defaultColor:e,rfId:n})=>{const t=jn(i=>i.edges),r=jn(i=>i.defaultEdgeOptions),s=A.useMemo(()=>mHn(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(hUn,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};OU.displayName="MarkerDefinitions";var pUn=A.memo(OU);function DU({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:c,className:u,...h}){const[_,p]=A.useState({x:1,y:0,width:0,height:0}),m=fs(["react-flow__edge-textwrapper",u]),x=A.useRef(null);return A.useEffect(()=>{if(x.current){const k=x.current.getBBox();p({x:k.x,y:k.y,width:k.width,height:k.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-_.width/2} ${n-_.height/2})`,className:m,visibility:_.width?"visible":"hidden",...h,children:[s&&f.jsx("rect",{width:_.width+2*a[0],x:-a[0],y:-a[1],height:_.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:_.height/2,dy:"0.3em",ref:x,style:r,children:t}),c]}):null}DU.displayName="EdgeText";const mUn=A.memo(DU);function Ky({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:u=20,...h}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...h,d:e,fill:"none",className:fs(["react-flow__edge-path",h.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&so(n)&&so(t)?f.jsx(mUn,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function HM({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Rt.Left||e===Rt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function LU({sourceX:e,sourceY:n,sourcePosition:t=Rt.Bottom,targetX:r,targetY:s,targetPosition:i=Rt.Top}){const[a,o]=HM({pos:t,x1:e,y1:n,x2:r,y2:s}),[c,u]=HM({pos:i,x1:r,y1:s,x2:e,y2:n}),[h,_,p,m]=iU({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:c,targetControlY:u});return[`M${e},${n} C${a},${o} ${c},${u} ${r},${s}`,h,_,p,m]}function IU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:k,markerStart:v,interactionWidth:b})=>{const[w,y,C]=LU({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),N=e.isInternal?void 0:n;return f.jsx(Ky,{id:N,path:w,labelX:y,labelY:C,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:k,markerStart:v,interactionWidth:b})})}const gUn=IU({isInternal:!1}),$U=IU({isInternal:!0});gUn.displayName="SimpleBezierEdge";$U.displayName="SimpleBezierEdgeInternal";function BU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,sourcePosition:m=Rt.Bottom,targetPosition:x=Rt.Top,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,N]=_k({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:x,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),z=e.isInternal?void 0:n;return f.jsx(Ky,{id:z,path:y,labelX:C,labelY:N,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:k,markerStart:v,interactionWidth:w})})}const PU=BU({isInternal:!1}),FU=BU({isInternal:!0});PU.displayName="SmoothStepEdge";FU.displayName="SmoothStepEdgeInternal";function HU(e){return A.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(PU,{...t,id:r,pathOptions:A.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const vUn=HU({isInternal:!1}),qU=HU({isInternal:!0});vUn.displayName="StepEdge";qU.displayName="StepEdgeInternal";function UU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:m,markerStart:x,interactionWidth:k})=>{const[v,b,w]=cU({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(Ky,{id:y,path:v,labelX:b,labelY:w,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:m,markerStart:x,interactionWidth:k})})}const bUn=UU({isInternal:!1}),GU=UU({isInternal:!0});bUn.displayName="StraightEdge";GU.displayName="StraightEdgeInternal";function VU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Rt.Bottom,targetPosition:o=Rt.Top,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,N]=aU({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),z=e.isInternal?void 0:n;return f.jsx(Ky,{id:z,path:y,labelX:C,labelY:N,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:k,markerStart:v,interactionWidth:w})})}const yUn=VU({isInternal:!1}),KU=VU({isInternal:!0});yUn.displayName="BezierEdge";KU.displayName="BezierEdgeInternal";const qM={default:KU,straight:GU,step:qU,smoothstep:FU,simplebezier:$U},UM={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},xUn=(e,n,t)=>t===Rt.Left?e-n:t===Rt.Right?e+n:e,wUn=(e,n,t)=>t===Rt.Top?e-n:t===Rt.Bottom?e+n:e,GM="react-flow__edgeupdater";function VM({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:fs([GM,`${GM}-${o}`]),cx:xUn(n,r,e),cy:wUn(t,r,e),r,stroke:"transparent",fill:"transparent"})}function kUn({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:c,onReconnect:u,onReconnectStart:h,onReconnectEnd:_,setReconnecting:p,setUpdateHover:m}){const x=jr(),k=(C,N)=>{if(C.button!==0)return;const{autoPanOnConnect:z,domNode:T,connectionMode:j,connectionRadius:M,lib:D,onConnectStart:I,cancelConnection:$,nodeLookup:q,rfId:H,panBy:Q,updateConnection:V}=x.getState(),J=N.type==="target",Z=(F,U)=>{p(!1),_==null||_(F,t,N.type,U)},B=F=>u==null?void 0:u(t,F),L=(F,U)=>{p(!0),h==null||h(C,t,N.type),I==null||I(F,U)};hk.onPointerDown(C.nativeEvent,{autoPanOnConnect:z,connectionMode:j,connectionRadius:M,domNode:T,handleId:N.id,nodeId:N.nodeId,nodeLookup:q,isTarget:J,edgeUpdaterType:N.type,lib:D,flowId:H,cancelConnection:$,panBy:Q,isValidConnection:(...F)=>{var U,K;return((K=(U=x.getState()).isValidConnection)==null?void 0:K.call(U,...F))??!0},onConnect:B,onConnectStart:L,onConnectEnd:(...F)=>{var U,K;return(K=(U=x.getState()).onConnectEnd)==null?void 0:K.call(U,...F)},onReconnectEnd:Z,updateConnection:V,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>k(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>k(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),w=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(VM,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(VM,{position:c,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function SUn({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,reconnectRadius:h,onReconnect:_,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:k,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=jn(be=>be.edgeLookup.get(e));const C=jn(be=>be.defaultEdgeOptions);y=C?{...C,...y}:y;let N=y.type||"default",z=(k==null?void 0:k[N])||qM[N];z===void 0&&(b==null||b("011",uo.error011(N)),N="default",z=(k==null?void 0:k.default)||qM.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof _<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),D=A.useRef(null),[I,$]=A.useState(!1),[q,H]=A.useState(!1),Q=jr(),{zIndex:V=y.zIndex,sourceX:J,sourceY:Z,targetX:B,targetY:L,sourcePosition:F,targetPosition:U}=jn(A.useCallback(be=>{const Me=be.nodeLookup.get(y.source),Le=be.nodeLookup.get(y.target);if(!Me||!Le)return UM;const Ke=pHn({id:e,sourceNode:Me,targetNode:Le,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:be.connectionMode,onError:b}),je=oHn({selected:y.selected,zIndex:y.zIndex,sourceNode:Me,targetNode:Le,elevateOnSelect:be.elevateEdgesOnSelect,zIndexMode:be.zIndexMode});return{...Ke||UM,zIndex:je}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),Nr),K=A.useMemo(()=>y.markerStart?`url('#${fk(y.markerStart,x)}')`:void 0,[y.markerStart,x]),ne=A.useMemo(()=>y.markerEnd?`url('#${fk(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||J===null||Z===null||B===null||L===null)return null;const ce=be=>{var je;const{addSelectedEdges:Me,unselectNodesAndEdges:Le,multiSelectionActive:Ke}=Q.getState();M&&(Q.setState({nodesSelectionActive:!1}),y.selected&&Ke?(Le({nodes:[],edges:[y]}),(je=D.current)==null||je.blur()):Me([e])),s&&s(be,y)},_e=i?be=>{i(be,{...y})}:void 0,se=a?be=>{a(be,{...y})}:void 0,G=o?be=>{o(be,{...y})}:void 0,oe=c?be=>{c(be,{...y})}:void 0,le=u?be=>{u(be,{...y})}:void 0,pe=be=>{var Me;if(!w&&Uq.includes(be.key)&&M){const{unselectNodesAndEdges:Le,addSelectedEdges:Ke}=Q.getState();be.key==="Escape"?((Me=D.current)==null||Me.blur(),Le({edges:[y]})):Ke([e])}};return f.jsx("svg",{style:{zIndex:V},children:f.jsxs("g",{className:fs(["react-flow__edge",`react-flow__edge-${N}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:I,selectable:M}]),onClick:ce,onDoubleClick:_e,onContextMenu:se,onMouseEnter:G,onMouseMove:oe,onMouseLeave:le,onKeyDown:T?pe:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"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":T?`${kU}-${x}`:void 0,ref:D,...y.domAttributes,children:[!q&&f.jsx(z,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:J,sourceY:Z,targetX:B,targetY:L,sourcePosition:F,targetPosition:U,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:K,markerEnd:ne,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(kUn,{edge:y,isReconnectable:j,reconnectRadius:h,onReconnect:_,onReconnectStart:p,onReconnectEnd:m,sourceX:J,sourceY:Z,targetX:B,targetY:L,sourcePosition:F,targetPosition:U,setUpdateHover:$,setReconnecting:H})]})})}var CUn=A.memo(SUn);const EUn=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function WU({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:h,reconnectRadius:_,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:k}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=jn(EUn,Nr),C=uUn(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(pUn,{defaultColor:e,rfId:t}),C.map(N=>f.jsx(CUn,{id:N,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,onClick:h,reconnectRadius:_,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:k},N))]})}WU.displayName="EdgeRenderer";const NUn=A.memo(WU),zUn=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function jUn({children:e}){const n=jn(zUn);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function TUn(e){const n=OC(),t=A.useRef(!1);A.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const AUn=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function RUn(e){const n=jn(AUn),t=jr();return A.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function MUn(e){return e.connection.inProgress?{...e.connection,to:qm(e.connection.to,e.transform)}:{...e.connection}}function OUn(e){return MUn}function DUn(e){const n=OUn();return jn(n,Nr)}const LUn=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function IUn({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:c}=jn(LUn,Nr);return!(i&&s&&c)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:fs(["react-flow__connection",Kq(o)]),children:f.jsx(QU,{style:n,type:t,CustomComponent:r,isValid:o})})})}const QU=({style:e,type:n=iu.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:c,to:u,toNode:h,toHandle:_,toPosition:p,pointer:m}=DUn();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:p,connectionStatus:Kq(r),toNode:h,toHandle:_,pointer:m});let x="";const k={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case iu.Bezier:[x]=aU(k);break;case iu.SimpleBezier:[x]=LU(k);break;case iu.Step:[x]=_k({...k,borderRadius:0});break;case iu.SmoothStep:[x]=_k(k);break;default:[x]=cU(k)}return f.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};QU.displayName="ConnectionLine";const $Un={};function KM(e=$Un){A.useRef(e),jr(),A.useEffect(()=>{},[e])}function BUn(){jr(),A.useRef(!1),A.useEffect(()=>{},[])}function XU({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,onSelectionContextMenu:_,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:k,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:N,panActivationKeyCode:z,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:D,defaultViewport:I,translateExtent:$,minZoom:q,maxZoom:H,preventScrolling:Q,defaultMarkerColor:V,zoomOnScroll:J,zoomOnPinch:Z,panOnScroll:B,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:U,panOnDrag:K,autoPanOnSelection:ne,onPaneClick:ce,onPaneMouseEnter:_e,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneScroll:oe,onPaneContextMenu:le,paneClickDistance:pe,nodeClickDistance:be,onEdgeContextMenu:Me,onEdgeMouseEnter:Le,onEdgeMouseMove:Ke,onEdgeMouseLeave:je,reconnectRadius:we,onReconnect:rt,onReconnectStart:Ze,onReconnectEnd:at,noDragClassName:St,noWheelClassName:Ft,noPanClassName:ut,disableKeyboardA11y:dt,nodeExtent:Ie,rfId:me,viewport:Ae,onViewportChange:Pe}){return KM(e),KM(n),BUn(),TUn(t),RUn(Ae),f.jsx(eUn,{onPaneClick:ce,onPaneMouseEnter:_e,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneContextMenu:le,onPaneScroll:oe,paneClickDistance:pe,deleteKeyCode:j,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:N,panActivationKeyCode:z,zoomActivationKeyCode:T,elementsSelectable:D,zoomOnScroll:J,zoomOnPinch:Z,zoomOnDoubleClick:U,panOnScroll:B,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:K,autoPanOnSelection:ne,defaultViewport:I,translateExtent:$,minZoom:q,maxZoom:H,onSelectionContextMenu:_,preventScrolling:Q,noDragClassName:St,noWheelClassName:Ft,noPanClassName:ut,disableKeyboardA11y:dt,onViewportChange:Pe,isControlledViewport:!!Ae,children:f.jsxs(jUn,{children:[f.jsx(NUn,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:rt,onReconnectStart:Ze,onReconnectEnd:at,onlyRenderVisibleElements:M,onEdgeContextMenu:Me,onEdgeMouseEnter:Le,onEdgeMouseMove:Ke,onEdgeMouseLeave:je,reconnectRadius:we,defaultMarkerColor:V,noPanClassName:ut,disableKeyboardA11y:dt,rfId:me}),f.jsx(IUn,{style:k,type:x,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(lUn,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,nodeClickDistance:be,onlyRenderVisibleElements:M,noPanClassName:ut,noDragClassName:St,disableKeyboardA11y:dt,nodeExtent:Ie,rfId:me}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}XU.displayName="GraphView";const PUn=A.memo(XU),FUn=Jq(),WM=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c=.5,maxZoom:u=2,nodeOrigin:h,nodeExtent:_,zIndexMode:p="basic"}={})=>{const m=new Map,x=new Map,k=new Map,v=new Map,b=r??n??[],w=t??e??[],y=h??[0,0],C=_??J0;_U(k,v,b);const{nodesInitialized:N}=dk(w,m,x,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let z=[0,0,1];if(a&&s&&i){const T=Fm(m,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:j,y:M,zoom:D}=NC(T,s,i,c,u,(o==null?void 0:o.padding)??.1);z=[j,M,D]}return{rfId:"1",width:s??0,height:i??0,transform:z,nodes:w,nodesInitialized:N,nodeLookup:m,parentLookup:x,edges:b,edgeLookup:v,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:J0,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Th.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:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...Vq},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:FUn,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Gq,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},HUn=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:_,zIndexMode:p})=>ZHn((m,x)=>{async function k(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:N,minZoom:z,maxZoom:T}=x();b&&(await eHn({nodes:v,width:C,height:N,panZoom:b,minZoom:z,maxZoom:T},w),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...WM({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:_,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:N,zIndexMode:z,nodesSelectionActive:T}=x(),{nodesInitialized:j,hasSelectedNodes:M}=dk(v,b,w,{nodeOrigin:y,nodeExtent:_,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:z}),D=T&&M;N&&j?(k(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:D})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=x();_U(b,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=x();w(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:w}=x();w(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:N,nodeExtent:z,debug:T,fitViewQueued:j,zIndexMode:M}=x(),{changes:D,updatedInternals:I}=kHn(v,w,y,C,N,z,M);I&&(bHn(w,y,{nodeOrigin:N,nodeExtent:z,zIndexMode:M}),j?(k(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(D==null?void 0:D.length)>0&&(T&&console.log("React Flow: trigger node changes",D),b==null||b(D)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:N,connection:z,updateConnection:T,onNodesChangeMiddlewareMap:j}=x();for(const[M,D]of v){const I=C.get(M),$=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(D!=null&&D.position)),q={id:M,type:"position",position:$?{x:Math.max(0,D.position.x),y:Math.max(0,D.position.y)}:D.position,dragging:b};if(I&&z.inProgress&&z.fromNode.id===I.id){const H=lf(I,z.fromHandle,Rt.Left,!0);T({...z,from:H})}$&&I.parentId&&w.push({id:M,parentId:I.parentId,rect:{...D.internals.positionAbsolute,width:D.measured.width??0,height:D.measured.height??0}}),y.push(q)}if(w.length>0){const{parentLookup:M,nodeOrigin:D}=x(),I=MC(w,C,M,D);y.push(...I)}for(const M of j.values())y=M(y);N(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:N}=x();if(v!=null&&v.length){if(C){const z=bqn(v,y);w(z)}N&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:N}=x();if(v!=null&&v.length){if(C){const z=yqn(v,y);w(z)}N&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=x();if(b){const z=v.map(T=>b_(T,!0));C(z);return}C(Ad(y,new Set([...v]),!0)),N(Ad(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=x();if(b){const z=v.map(T=>b_(T,!0));N(z);return}N(Ad(w,new Set([...v]))),C(Ad(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:N,triggerEdgeChanges:z}=x(),T=v||y,j=b||w,M=[];for(const I of T){if(!I.selected)continue;const $=C.get(I.id);$&&($.selected=!1),M.push(b_(I.id,!1))}const D=[];for(const I of j)I.selected&&D.push(b_(I.id,!1));N(M),z(D)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=x();b==null||b.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=x();b==null||b.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=x().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=x();if(!C)return;const N=b.reduce((T,j)=>j.selected?[...T,b_(j.id,!1)]:T,[]),z=v.reduce((T,j)=>j.selected?[...T,b_(j.id,!1)]:T,[]);w(N),y(z)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:N,nodeExtent:z,zIndexMode:T}=x();v[0][0]===z[0][0]&&v[0][1]===z[0][1]&&v[1][0]===z[1][0]&&v[1][1]===z[1][1]||(dk(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:N}=x();return SHn({delta:v,panZoom:C,transform:b,translateExtent:N,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:N,panZoom:z}=x();if(!z)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:N;return await z.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...Vq}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...WM()})}},Object.is);function qUn({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:c,fitView:u,nodeOrigin:h,nodeExtent:_,zIndexMode:p,children:m}){const[x]=A.useState(()=>HUn({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:c,nodeOrigin:h,nodeExtent:_,zIndexMode:p}));return f.jsx(JHn,{value:x,children:f.jsx(Eqn,{children:f.jsx(Fqn,{children:m})})})}function UUn({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:c,minZoom:u,maxZoom:h,nodeOrigin:_,nodeExtent:p,zIndexMode:m}){return A.useContext(Uy)?f.jsx(f.Fragment,{children:e}):f.jsx(qUn,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:h,nodeOrigin:_,nodeExtent:p,zIndexMode:m,children:e})}const GUn={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function VUn({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:c,onInit:u,onMove:h,onMoveStart:_,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:z,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:D,onEdgesDelete:I,onDelete:$,onSelectionChange:q,onSelectionDragStart:H,onSelectionDrag:Q,onSelectionDragStop:V,onSelectionContextMenu:J,onSelectionStart:Z,onSelectionEnd:B,onBeforeDelete:L,connectionMode:F,connectionLineType:U=iu.Bezier,connectionLineStyle:K,connectionLineComponent:ne,connectionLineContainerStyle:ce,deleteKeyCode:_e="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:G=!1,selectionMode:oe=em.Full,panActivationKeyCode:le="Space",multiSelectionKeyCode:pe=nm()?"Meta":"Control",zoomActivationKeyCode:be=nm()?"Meta":"Control",snapToGrid:Me,snapGrid:Le,onlyRenderVisibleElements:Ke=!1,selectNodesOnDrag:je,nodesDraggable:we,autoPanOnNodeFocus:rt,nodesConnectable:Ze,nodesFocusable:at,nodeOrigin:St=SU,edgesFocusable:Ft,edgesReconnectable:ut,elementsSelectable:dt=!0,defaultViewport:Ie=fqn,minZoom:me=.5,maxZoom:Ae=2,translateExtent:Pe=J0,preventScrolling:nt=!0,nodeExtent:_t,defaultMarkerColor:pt="#b1b1b7",zoomOnScroll:yt=!0,zoomOnPinch:Zt=!0,panOnScroll:nn=!1,panOnScrollSpeed:jt=.5,panOnScrollMode:mt=G_.Free,zoomOnDoubleClick:ft=!0,panOnDrag:en=!0,onPaneClick:An,onPaneMouseEnter:xr,onPaneMouseMove:kn,onPaneMouseLeave:Ln,onPaneScroll:Un,onPaneContextMenu:dr,paneClickDistance:es=1,nodeClickDistance:Ct=0,children:on,onReconnect:cn,onReconnectStart:fn,onReconnectEnd:wr,onEdgeContextMenu:un,onEdgeDoubleClick:dn,onEdgeMouseEnter:Tn,onEdgeMouseMove:wt,onEdgeMouseLeave:Mt,reconnectRadius:zn=10,onNodesChange:hr,onEdgesChange:Hn,noDragClassName:hn="nodrag",noWheelClassName:Tr="nowheel",noPanClassName:Ar="nopan",fitView:Rn,fitViewOptions:Ge,connectOnClick:kt,attributionPosition:pr,proOptions:Gn,defaultEdgeOptions:pn,elevateNodesOnSelect:ts=!0,elevateEdgesOnSelect:rr=!1,disableKeyboardA11y:_a=!1,autoPanOnConnect:Vr,autoPanOnNodeDrag:sr,autoPanOnSelection:ho=!0,autoPanSpeed:po,connectionRadius:Vn,isValidConnection:Kr,onError:mo,style:go,id:Zs,nodeDragThreshold:vo,connectionDragThreshold:Vt,viewport:Fa,onViewportChange:Kn,width:Wr,height:st,colorMode:Wt="light",debug:Es,onScroll:Js,ariaLabelConfig:mi,zIndexMode:Wn="basic",...mr},Is){const $s=Zs||"1",Lr=mqn(Wt),gi=A.useCallback(gr=>{gr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Js==null||Js(gr)},[Js]);return f.jsx("div",{"data-testid":"rf__wrapper",...mr,onScroll:gi,style:{...go,...GUn},ref:Is,className:fs(["react-flow",s,Lr]),id:Zs,role:"application",children:f.jsxs(UUn,{nodes:e,edges:n,width:Wr,height:st,fitView:Rn,fitViewOptions:Ge,minZoom:me,maxZoom:Ae,nodeOrigin:St,nodeExtent:_t,zIndexMode:Wn,children:[f.jsx(pqn,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:we,autoPanOnNodeFocus:rt,nodesConnectable:Ze,nodesFocusable:at,edgesFocusable:Ft,edgesReconnectable:ut,elementsSelectable:dt,elevateNodesOnSelect:ts,elevateEdgesOnSelect:rr,minZoom:me,maxZoom:Ae,nodeExtent:_t,onNodesChange:hr,onEdgesChange:Hn,snapToGrid:Me,snapGrid:Le,connectionMode:F,translateExtent:Pe,connectOnClick:kt,defaultEdgeOptions:pn,fitView:Rn,fitViewOptions:Ge,onNodesDelete:D,onEdgesDelete:I,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Q,onSelectionDragStart:H,onSelectionDragStop:V,onMove:h,onMoveStart:_,onMoveEnd:p,noPanClassName:Ar,nodeOrigin:St,rfId:$s,autoPanOnConnect:Vr,autoPanOnNodeDrag:sr,autoPanSpeed:po,onError:mo,connectionRadius:Vn,isValidConnection:Kr,selectNodesOnDrag:je,nodeDragThreshold:vo,connectionDragThreshold:Vt,onBeforeDelete:L,debug:Es,ariaLabelConfig:mi,zIndexMode:Wn}),f.jsx(PUn,{onInit:u,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:z,nodeTypes:i,edgeTypes:a,connectionLineType:U,connectionLineStyle:K,connectionLineComponent:ne,connectionLineContainerStyle:ce,selectionKeyCode:se,selectionOnDrag:G,selectionMode:oe,deleteKeyCode:_e,multiSelectionKeyCode:pe,panActivationKeyCode:le,zoomActivationKeyCode:be,onlyRenderVisibleElements:Ke,defaultViewport:Ie,translateExtent:Pe,minZoom:me,maxZoom:Ae,preventScrolling:nt,zoomOnScroll:yt,zoomOnPinch:Zt,zoomOnDoubleClick:ft,panOnScroll:nn,panOnScrollSpeed:jt,panOnScrollMode:mt,panOnDrag:en,autoPanOnSelection:ho,onPaneClick:An,onPaneMouseEnter:xr,onPaneMouseMove:kn,onPaneMouseLeave:Ln,onPaneScroll:Un,onPaneContextMenu:dr,paneClickDistance:es,nodeClickDistance:Ct,onSelectionContextMenu:J,onSelectionStart:Z,onSelectionEnd:B,onReconnect:cn,onReconnectStart:fn,onReconnectEnd:wr,onEdgeContextMenu:un,onEdgeDoubleClick:dn,onEdgeMouseEnter:Tn,onEdgeMouseMove:wt,onEdgeMouseLeave:Mt,reconnectRadius:zn,defaultMarkerColor:pt,noDragClassName:hn,noWheelClassName:Tr,noPanClassName:Ar,rfId:$s,disableKeyboardA11y:_a,nodeExtent:_t,viewport:Fa,onViewportChange:Kn}),f.jsx(_qn,{onSelectionChange:q}),on,f.jsx(aqn,{proOptions:Gn,position:pr}),f.jsx(iqn,{rfId:$s,disableKeyboardA11y:_a})]})})}var KUn=EU(VUn);function WUn({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:fs(["react-flow__background-pattern",t,r])})}function QUn({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:fs(["react-flow__background-pattern","dots",n])})}var cl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(cl||(cl={}));const XUn={[cl.Dots]:1,[cl.Lines]:1,[cl.Cross]:6},YUn=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function YU({id:e,variant:n=cl.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:c,className:u,patternClassName:h}){const _=A.useRef(null),{transform:p,patternId:m}=jn(YUn,Nr),x=r||XUn[n],k=n===cl.Dots,v=n===cl.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*p[2]||1,b[1]*p[2]||1],y=x*p[2],C=Array.isArray(i)?i:[i,i],N=v?[y,y]:w,z=[C[0]*p[2]||1+N[0]/2,C[1]*p[2]||1+N[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:fs(["react-flow__background",u]),style:{...c,...Vy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:_,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${z[0]},-${z[1]})`,children:k?f.jsx(QUn,{radius:y/2,className:h}):f.jsx(WUn,{dimensions:N,lineWidth:s,variant:n,className:h})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}YU.displayName="Background";const ZUn=A.memo(YU);function JUn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function eGn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function tGn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.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 nGn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 rGn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 $1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:fs(["react-flow__controls-button",n]),...t,children:e})}const sGn=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ZU({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:c,className:u,children:h,position:_="bottom-left",orientation:p="vertical","aria-label":m}){const x=jr(),{isInteractive:k,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=jn(sGn,Nr),{zoomIn:y,zoomOut:C,fitView:N}=OC(),z=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{N(s),o==null||o()},M=()=>{x.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),c==null||c(!k)},D=p==="horizontal"?"horizontal":"vertical";return f.jsxs(Gy,{className:fs(["react-flow__controls",D,u]),position:_,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx($1,{onClick:z,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(JUn,{})}),f.jsx($1,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(eGn,{})})]}),t&&f.jsx($1,{className:"react-flow__controls-fitview",onClick:j,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:f.jsx(tGn,{})}),r&&f.jsx($1,{className:"react-flow__controls-interactive",onClick:M,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:k?f.jsx(rGn,{}):f.jsx(nGn,{})}),h]})}ZU.displayName="Controls";A.memo(ZU);function iGn({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:c,className:u,borderRadius:h,shapeRendering:_,selected:p,onClick:m}){const{background:x,backgroundColor:k}=i||{},v=a||x||k;return f.jsx("rect",{className:fs(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:h,ry:h,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:c},shapeRendering:_,onClick:m?b=>m(b,e):void 0})}const aGn=A.memo(iGn),oGn=e=>e.nodes.map(n=>n.id),j4=e=>e instanceof Function?e:()=>e;function cGn({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=aGn,onClick:a}){const o=jn(oGn,Nr),c=j4(n),u=j4(e),h=j4(t),_=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(uGn,{id:p,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:_},p))})}function lGn({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:c}){const{node:u,x:h,y:_,width:p,height:m}=jn(x=>{const k=x.nodeLookup.get(e);if(!k)return{node:void 0,x:0,y:0,width:0,height:0};const v=k.internals.userNode,{x:b,y:w}=k.internals.positionAbsolute,{width:y,height:C}=vl(v);return{node:v,x:b,y:w,width:y,height:C}},Nr);return!u||u.hidden||!eU(u)?null:f.jsx(o,{x:h,y:_,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:c,id:u.id})}const uGn=A.memo(lGn);var _Gn=A.memo(cGn);const fGn=200,dGn=150,hGn=e=>!e.hidden,pGn=e=>{const n={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:n,boundingRect:e.nodeLookup.size>0?Yq(Fm(e.nodeLookup,{filter:hGn}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},mGn="react-flow__minimap-desc";function JU({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:c,maskColor:u,maskStrokeColor:h,maskStrokeWidth:_,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:k=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const N=jr(),z=A.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:D,translateExtent:I,flowWidth:$,flowHeight:q,ariaLabelConfig:H}=jn(pGn,Nr),Q=(e==null?void 0:e.width)??fGn,V=(e==null?void 0:e.height)??dGn,J=T.width/Q,Z=T.height/V,B=Math.max(J,Z),L=B*Q,F=B*V,U=C*B,K=T.x-(L-T.width)/2-U,ne=T.y-(F-T.height)/2-U,ce=L+U*2,_e=F+U*2,se=`${mGn}-${M}`,G=A.useRef(0),oe=A.useRef();G.current=B,A.useEffect(()=>{if(z.current&&D)return oe.current=MHn({domNode:z.current,panZoom:D,getTransform:()=>N.getState().transform,getViewScale:()=>G.current}),()=>{var Me;(Me=oe.current)==null||Me.destroy()}},[D]),A.useEffect(()=>{var Me;(Me=oe.current)==null||Me.update({translateExtent:I,width:$,height:q,inversePan:w,pannable:k,zoomStep:y,zoomable:v})},[k,v,w,y,I,$,q]);const le=m?Me=>{var je;const[Le,Ke]=((je=oe.current)==null?void 0:je.pointer(Me))||[0,0];m(Me,{x:Le,y:Ke})}:void 0,pe=x?A.useCallback((Me,Le)=>{const Ke=N.getState().nodeLookup.get(Le).internals.userNode;x(Me,Ke)},[]):void 0,be=b??H["minimap.ariaLabel"];return f.jsx(Gy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof _=="number"?_*B:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:fs(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Q,height:V,viewBox:`${K} ${ne} ${ce} ${_e}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:z,onClick:le,children:[be&&f.jsx("title",{id:se,children:be}),f.jsx(_Gn,{onClick:pe,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${K-U},${ne-U}h${ce+U*2}v${_e+U*2}h${-ce-U*2}z - M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}JU.displayName="MiniMap";A.memo(JU);const gGn=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,vGn={[Mh.Line]:"right",[Mh.Handle]:"bottom-right"};function bGn({nodeId:e,position:n,variant:t=Mh.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:_=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:k,onResize:v,onResizeEnd:b}){const w=TU(),y=typeof e=="string"?e:w,C=jr(),N=A.useRef(null),z=t===Mh.Handle,T=jn(A.useCallback(gGn(z&&m),[z,m]),Nr),j=A.useRef(null),M=n??vGn[t];A.useEffect(()=>{if(!(!N.current||!y))return j.current||(j.current=VHn({domNode:N.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:I,transform:$,snapGrid:q,snapToGrid:H,nodeOrigin:Q,domNode:V}=C.getState();return{nodeLookup:I,transform:$,snapGrid:q,snapToGrid:H,nodeOrigin:Q,paneDomNode:V}},onChange:(I,$)=>{const{triggerNodeChanges:q,nodeLookup:H,parentLookup:Q,nodeOrigin:V}=C.getState(),J=[],Z={x:I.x,y:I.y},B=H.get(y);if(B&&B.expandParent&&B.parentId){const L=B.origin??V,F=I.width??B.measured.width??0,U=I.height??B.measured.height??0,K={id:B.id,parentId:B.parentId,rect:{width:F,height:U,...tU({x:I.x??B.position.x,y:I.y??B.position.y},{width:F,height:U},B.parentId,H,L)}},ne=MC([K],H,Q,V);J.push(...ne),Z.x=I.x?Math.max(L[0]*F,I.x):void 0,Z.y=I.y?Math.max(L[1]*U,I.y):void 0}if(Z.x!==void 0&&Z.y!==void 0){const L={id:y,type:"position",position:{...Z}};J.push(L)}if(I.width!==void 0&&I.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};J.push(F)}for(const L of $){const F={...L,type:"position"};J.push(F)}q(J)},onEnd:({width:I,height:$})=>{const q={id:y,type:"dimensions",resizing:!1,dimensions:{width:I,height:$}};C.getState().triggerNodeChanges([q])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:c,maxWidth:u,maxHeight:h},keepAspectRatio:_,resizeDirection:p,onResizeStart:k,onResize:v,onResizeEnd:b,shouldResize:x}),()=>{var I;(I=j.current)==null||I.destroy()}},[M,o,c,u,h,_,k,v,b,x]);const D=M.split("-");return f.jsx("div",{className:fs(["react-flow__resize-control","nodrag",...D,t,r]),ref:N,style:{...s,scale:T,...a&&{[z?"backgroundColor":"borderColor"]:a}},children:i})}A.memo(bGn);function yGn(){const[e,n]=A.useState(0),[t,r]=A.useState(0);return{ref:A.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),c=new MutationObserver(a);return o.observe(i),c.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const B1=8;function xGn(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=A.useState({viewWidth:0,viewHeight:0});A.useEffect(()=>{function h(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",h),h(),()=>window.removeEventListener("resize",h)},[]);let o=0,c=0,u=0;if(e){const{distance:h}=e;switch(e.anchor){case"left":o=e.x-t-h,c=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+h,c=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,c=e.y+e.height+h;break;case"above":o=e.x+e.width/2-t/2,c=e.y-r-h;break}const _=o,p=c;o=Math.min(Math.max(o,B1),i-t-B1),c=Math.min(Math.max(c,B1),s-r-B1),u=e.anchor==="left"||e.anchor==="right"?p-c:_-o}return{x:o,y:c,arrowAdjustment:u}}const T4=380,A4=12,wGn=350,kGn=150,mk=new EventTarget;function SGn(){mk.dispatchEvent(new Event("move"))}function CGn(e,n){const[t,r]=A.useState(null),s=A.useRef(void 0),i=A.useRef(void 0);A.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return mk.addEventListener("move",u),()=>{mk.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),A.useEffect(()=>{r(u=>{var _;if(!u)return u;const h=((_=e.current)==null?void 0:_.getBoundingClientRect())??null;return h&&u.x===h.x&&u.y===h.y&&u.width===h.width&&u.height===h.height?u:h})},[e,n]);const a=A.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},wGn)},[e]),o=A.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),kGn)},[]),c=A.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:c}}function EGn(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(E(),t)}function NGn({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:c}){const u=yGn(),h=s.right+A4+T4<=window.innerWidth,_=s.x-A4-T4>=0,p=h?"right":_?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:x}=xGn({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:A4},u),k=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ct({...fSn(k??""),enabled:!!k,subscribed:!!k}),b=A.useMemo(()=>{if(!v)return null;const I=v;let $=I.diff;if(I.truncated){const V=$.lastIndexOf(` +`)),h=u.reduce((_,p)=>_.concat(...p),[]);return[u,h]}return[[],[]]},[e]);return A.useEffect(()=>{const c=(n==null?void 0:n.target)??MM,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const h=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&oU(m))return!1;const k=DM(m.code,o);if(i.current.add(m[k]),OM(a,i.current,!1)){const x=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},_=m=>{const w=DM(m.code,o);OM(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[w]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",_),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",_),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function OM(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function DM(e,n){return n.includes(e)?"code":"key"}const zUn=()=>{const e=Nr();return A.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),c=zC(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(c,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:c}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-c},h=t.snapGrid??s,_=t.snapToGrid??i;return Um(u,r,_,h)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=Mh(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function jU(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const c of a)jUn(c,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function jUn(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function TUn(e,n){return jU(e,n)}function AUn(e,n){return jU(e,n)}function N_(e,n){return{id:e,type:"select",selected:n}}function Rd(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(N_(i.id,a)))}return r}function LM({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),c=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;c!==void 0&&c!==a&&t.push({id:a.id,item:a,type:"replace"}),c===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function IM(e){return{id:e.id,type:"remove"}}const RUn=rU();function MUn(e,n,t={}){return wqn(e,n,{...t,onError:t.onError??RUn})}const $M=e=>oqn(e),OUn=e=>Zq(e);function TU(e){return A.forwardRef(e)}const DUn=typeof window<"u"?A.useLayoutEffect:A.useEffect;function BM(e){const[n,t]=A.useState(BigInt(0)),[r]=A.useState(()=>LUn(()=>t(s=>s+BigInt(1))));return DUn(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function LUn(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const AU=A.createContext(null);function IUn({children:e}){const n=Nr(),t=A.useCallback(o=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:h,onNodesChange:_,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:w}=n.getState();let k=c;for(const b of o)k=typeof b=="function"?b(k):b;let v=LM({items:k,lookup:p});for(const b of w.values())v=b(v);h&&u(k),v.length>0?_==null||_(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:x,setNodes:y}=n.getState();b&&y(x)})},[]),r=BM(t),s=A.useCallback(o=>{const{edges:c=[],setEdges:u,hasDefaultEdges:h,onEdgesChange:_,edgeLookup:p}=n.getState();let m=c;for(const w of o)m=typeof w=="function"?w(m):w;h?u(m):_&&_(LM({items:m,lookup:p}))},[]),i=BM(s),a=A.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(AU.Provider,{value:a,children:e})}function $Un(){const e=A.useContext(AU);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const BUn=e=>!!e.panZoom;function DC(){const e=zUn(),n=Nr(),t=$Un(),r=Rn(BUn),s=A.useMemo(()=>{const i=_=>n.getState().nodeLookup.get(_),a=_=>{t.nodeQueue.push(_)},o=_=>{t.edgeQueue.push(_)},c=_=>{var b,x;const{nodeLookup:p,nodeOrigin:m}=n.getState(),w=$M(_)?_:p.get(_.id),k=w.parentId?iU(w.position,w.measured,w.parentId,p,m):w.position,v={...w,position:k,width:((b=w.measured)==null?void 0:b.width)??w.width,height:((x=w.measured)==null?void 0:x.height)??w.height};return nm(v)},u=(_,p,m={replace:!1})=>{a(w=>w.map(k=>{if(k.id===_){const v=typeof p=="function"?p(k):p;return m.replace&&$M(v)?v:{...k,...v}}return k}))},h=(_,p,m={replace:!1})=>{o(w=>w.map(k=>{if(k.id===_){const v=typeof p=="function"?p(k):p;return m.replace&&OUn(v)?v:{...k,...v}}return k}))};return{getNodes:()=>n.getState().nodes.map(_=>({..._})),getNode:_=>{var p;return(p=i(_))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:_=[]}=n.getState();return _.map(p=>({...p}))},getEdge:_=>n.getState().edgeLookup.get(_),setNodes:a,setEdges:o,addNodes:_=>{const p=Array.isArray(_)?_:[_];t.nodeQueue.push(m=>[...m,...p])},addEdges:_=>{const p=Array.isArray(_)?_:[_];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:_=[],edges:p=[],transform:m}=n.getState(),[w,k,v]=m;return{nodes:_.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x:w,y:k,zoom:v}}},deleteElements:async({nodes:_=[],edges:p=[]})=>{const{nodes:m,edges:w,onNodesDelete:k,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:x,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:z,edges:E}=await fqn({nodesToRemove:_,edgesToRemove:p,nodes:m,edges:w,onBeforeDelete:C}),T=E.length>0,j=z.length>0;if(T){const M=E.map(IM);v==null||v(E),x(M)}if(j){const M=z.map(IM);k==null||k(z),b(M)}return(j||T)&&(y==null||y({nodes:z,edges:E})),{deletedNodes:z,deletedEdges:E}},getIntersectingNodes:(_,p=!0,m)=>{const w=dM(_),k=w?_:c(_),v=m!==void 0;return k?(m||n.getState().nodes).filter(b=>{const x=n.getState().nodeLookup.get(b.id);if(x&&!w&&(b.id===_.id||!x.internals.positionAbsolute))return!1;const y=nm(v?b:x),C=yb(y,k);return p&&C>0||C>=y.width*y.height||C>=k.width*k.height}):[]},isNodeIntersecting:(_,p,m=!0)=>{const k=dM(_)?_:c(_);if(!k)return!1;const v=yb(k,p);return m&&v>0||v>=p.width*p.height||v>=k.width*k.height},updateNode:u,updateNodeData:(_,p,m={replace:!1})=>{u(_,w=>{const k=typeof p=="function"?p(w):p;return m.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},m)},updateEdge:h,updateEdgeData:(_,p,m={replace:!1})=>{h(_,w=>{const k=typeof p=="function"?p(w):p;return m.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},m)},getNodesBounds:_=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return cqn(_,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:_,id:p,nodeId:m})=>{var w;return Array.from(((w=n.getState().connectionLookup.get(`${m}-${_}${p?`-${p}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:_,handleId:p,nodeId:m})=>{var w;return Array.from(((w=n.getState().connectionLookup.get(`${m}${_?p?`-${_}-${p}`:`-${_}`:""}`))==null?void 0:w.values())??[])},fitView:async _=>{const p=n.getState().fitViewResolver??pqn();return n.setState({fitViewQueued:!0,fitViewOptions:_,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return A.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const PM=e=>e.selected,PUn=typeof window<"u"?window:void 0;function FUn({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Nr(),{deleteElements:r}=DC(),s=sm(e,{actInsideInputWithModifier:!1}),i=sm(n,{target:PUn});A.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(PM),edges:a.filter(PM)}),t.setState({nodesSelectionActive:!1})}},[s]),A.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function HUn(e){const n=Nr();A.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=jC(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",So.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const Wy={position:"absolute",width:"100%",height:"100%",top:0,left:0},qUn=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function UUn({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=J_.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:u,minZoom:h,maxZoom:_,zoomActivationKeyCode:p,preventScrolling:m=!0,children:w,noWheelClassName:k,noPanClassName:v,onViewportChange:b,isControlledViewport:x,paneClickDistance:y,selectionOnDrag:C}){const z=Nr(),E=A.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=Rn(qUn,Cr),D=sm(p),I=A.useRef();HUn(E);const $=A.useCallback(q=>{b==null||b({x:q[0],y:q[1],zoom:q[2]}),x||z.setState({transform:q})},[b,x]);return A.useEffect(()=>{if(E.current){I.current=Zqn({domNode:E.current,minZoom:h,maxZoom:_,translateExtent:u,viewport:c,onDraggingChange:V=>z.setState(Z=>Z.paneDragging===V?Z:{paneDragging:V}),onPanZoomStart:(V,Z)=>{const{onViewportChangeStart:Y,onMoveStart:B}=z.getState();B==null||B(V,Z),Y==null||Y(Z)},onPanZoom:(V,Z)=>{const{onViewportChange:Y,onMove:B}=z.getState();B==null||B(V,Z),Y==null||Y(Z)},onPanZoomEnd:(V,Z)=>{const{onViewportChangeEnd:Y,onMoveEnd:B}=z.getState();B==null||B(V,Z),Y==null||Y(Z)}});const{x:q,y:H,zoom:Q}=I.current.getViewport();return z.setState({panZoom:I.current,transform:[q,H,Q],domNode:E.current.closest(".react-flow")}),()=>{var V;(V=I.current)==null||V.destroy()}}},[]),A.useEffect(()=>{var q;(q=I.current)==null||q.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:D,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:k,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,D,m,v,T,k,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:E,style:Wy,children:w})}const GUn=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function VUn(){const{userSelectionActive:e,userSelectionRect:n}=Rn(GUn,Cr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const T4=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},KUn=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function WUn({isSelecting:e,selectionKeyPressed:n,selectionMode:t=tm.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:h,onPaneScroll:_,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:w,children:k}){const v=A.useRef(0),b=Nr(),{userSelectionActive:x,elementsSelectable:y,dragging:C,panBy:z,autoPanSpeed:E}=Rn(KUn,Cr),T=y&&(e||x),j=A.useRef(null),M=A.useRef(),D=A.useRef(new Set),I=A.useRef(new Set),$=A.useRef(!1),q=A.useRef(!1),H=A.useRef({x:0,y:0}),Q=A.useRef(!1),V=G=>{if(q.current||$.current||b.getState().connection.inProgress){q.current=!1,$.current=!1;return}u==null||u(G),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},Z=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}h==null||h(G)},Y=_?G=>_(G):void 0,B=G=>{q.current&&(G.stopPropagation(),q.current=!1)},L=G=>{var xe,rt;const{domNode:ae,transform:ce}=b.getState();if(M.current=ae==null?void 0:ae.getBoundingClientRect(),!M.current)return;const pe=G.target===j.current;if(!pe&&!!G.target.closest(".nokey")||!e||!(a&&pe||n)||G.button!==0||!G.isPrimary)return;(rt=(xe=G.target)==null?void 0:xe.setPointerCapture)==null||rt.call(xe,G.pointerId),q.current=!1;const{x:De,y:We}=bo(G.nativeEvent,M.current),Ne=Um({x:De,y:We},ce);b.setState({userSelectionRect:{width:0,height:0,startX:Ne.x,startY:Ne.y,x:De,y:We}}),pe||(G.stopPropagation(),G.preventDefault())};function F(G,ae){const{userSelectionRect:ce}=b.getState();if(!ce)return;const{transform:pe,nodeLookup:be,edgeLookup:Ae,connectionLookup:De,triggerNodeChanges:We,triggerEdgeChanges:Ne,defaultEdgeOptions:xe}=b.getState(),rt={x:ce.startX,y:ce.startY},{x:Ze,y:ct}=Mh(rt,pe),Ct={startX:rt.x,startY:rt.y,x:GLe.id)),I.current=new Set;const ht=(xe==null?void 0:xe.selectable)??!0;for(const Le of D.current){const me=De.get(Le);if(me)for(const{edgeId:Te}of me.values()){const He=Ae.get(Te);He&&(He.selectable??ht)&&I.current.add(Te)}}if(!hM(qt,D.current)){const Le=Rd(be,D.current,!0);We(Le)}if(!hM(dt,I.current)){const Le=Rd(Ae,I.current);Ne(Le)}b.setState({userSelectionRect:Ct,userSelectionActive:!0,nodesSelectionActive:!1})}function U(){if(!s||!M.current)return;const[G,ae]=NC(H.current,M.current,E);z({x:G,y:ae}).then(ce=>{if(!q.current||!ce){v.current=requestAnimationFrame(U);return}const{x:pe,y:be}=H.current;F(pe,be),v.current=requestAnimationFrame(U)})}const K=()=>{cancelAnimationFrame(v.current),v.current=0,Q.current=!1};A.useEffect(()=>()=>K(),[]);const ne=G=>{const{userSelectionRect:ae,transform:ce,resetSelectedElements:pe}=b.getState();if(!M.current||!ae)return;const{x:be,y:Ae}=bo(G.nativeEvent,M.current);H.current={x:be,y:Ae};const De=Mh({x:ae.startX,y:ae.startY},ce);if(!q.current){const We=n?0:i;if(Math.hypot(be-De.x,Ae-De.y)<=We)return;pe(),o==null||o(G)}q.current=!0,Q.current||(U(),Q.current=!0),F(be,Ae)},oe=G=>{var ae,ce;if(!T){G.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}G.button===0&&((ce=(ae=G.target)==null?void 0:ae.releasePointerCapture)==null||ce.call(ae,G.pointerId),!x&&G.target===j.current&&b.getState().userSelectionRect&&(V==null||V(G)),b.setState({userSelectionActive:!1,userSelectionRect:null}),q.current&&(c==null||c(G),b.setState({nodesSelectionActive:D.current.size>0})),K())},ue=G=>{var ae,ce;(ce=(ae=G.target)==null?void 0:ae.releasePointerCapture)==null||ce.call(ae,G.pointerId),K()},se=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:ls(["react-flow__pane",{draggable:se,dragging:C,selection:e}]),onClick:T?void 0:T4(V,j),onContextMenu:T4(Z,j),onWheel:T4(Y,j),onPointerEnter:T?void 0:p,onPointerMove:T?ne:m,onPointerUp:oe,onPointerCancel:T?ue:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?B:void 0,onPointerLeave:w,ref:j,style:Wy,children:[k,f.jsx(VUn,{})]})}function gk({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:c}=n.getState(),u=o.get(e);if(!u){c==null||c("012",So.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function RU({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Nr(),[c,u]=A.useState(!1),h=A.useRef();return A.useEffect(()=>{h.current=$qn({getStoreItems:()=>o.getState(),onNodeMouseDown:_=>{gk({id:_,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),A.useEffect(()=>{if(!(n||!e.current||!h.current))return h.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var _;(_=h.current)==null||_.destroy()}},[t,r,n,i,e,s,a]),c}const QUn=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function MU(){const e=Nr();return A.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:c,nodeLookup:u,nodeOrigin:h}=e.getState(),_=new Map,p=QUn(a),m=s?i[0]:5,w=s?i[1]:5,k=t.direction.x*m*t.factor,v=t.direction.y*w*t.factor;for(const[,b]of u){if(!p(b))continue;let x={x:b.internals.positionAbsolute.x+k,y:b.internals.positionAbsolute.y+v};s&&(x=qm(x,i));const{position:y,positionAbsolute:C}=Jq({nodeId:b.id,nextPosition:x,nodeLookup:u,nodeExtent:r,nodeOrigin:h,onError:o});b.position=y,b.internals.positionAbsolute=C,_.set(b.id,b)}c(_)},[])}const LC=A.createContext(null),XUn=LC.Provider;LC.Consumer;const OU=()=>A.useContext(LC),YUn=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),DU=A.createContext(null);function ZUn({children:e}){const n=Rn(YUn,Cr);return f.jsx(DU.Provider,{value:n,children:e})}function JUn(){const e=A.useContext(DU);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const eGn={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},tGn=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:c,isValid:u}=a;if(!o&&!s)return eGn;const h=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===n&&(c==null?void 0:c.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:h,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===Ah.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:h&&u}};function nGn({type:e="source",position:n=Dt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:c,className:u,onMouseDown:h,onTouchStart:_,...p},m){var Q,V;const w=a||null,k=e==="target",v=Nr(),b=OU(),{connectOnClick:x,noPanClassName:y,rfId:C}=JUn(),{connectingFrom:z,connectingTo:E,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:D,valid:I}=Rn(tGn(b,w,e),Cr);b||(V=(Q=v.getState()).onError)==null||V.call(Q,"010",So.error010());const $=Z=>{const{defaultEdgeOptions:Y,onConnect:B,hasDefaultEdges:L}=v.getState(),F={...Y,...Z};if(L){const{edges:U,setEdges:K,onError:ne}=v.getState();K(MUn(F,U,{onError:ne}))}B==null||B(F),o==null||o(F)},q=Z=>{if(!b)return;const Y=cU(Z.nativeEvent);if(s&&(Y&&Z.button===0||!Y)){const B=v.getState();mk.onPointerDown(Z.nativeEvent,{handleDomNode:Z.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:k,handleId:w,nodeId:b,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...L)=>{var F,U;return(U=(F=v.getState()).onConnectEnd)==null?void 0:U.call(F,...L)},updateConnection:B.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var F,U;return((U=(F=v.getState()).isValidConnection)==null?void 0:U.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}Y?h==null||h(Z):_==null||_(Z)},H=Z=>{const{onClickConnectStart:Y,onClickConnectEnd:B,connectionClickStartHandle:L,connectionMode:F,isValidConnection:U,lib:K,rfId:ne,nodeLookup:oe,connection:ue}=v.getState();if(!b||!L&&!s)return;if(!L){Y==null||Y(Z.nativeEvent,{nodeId:b,handleId:w,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:w}});return}const se=aU(Z.target),G=t||U,{connection:ae,isValid:ce}=mk.isValid(Z.nativeEvent,{handle:{nodeId:b,id:w,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:G,flowId:ne,doc:se,lib:K,nodeLookup:oe});ce&&ae&&$(ae);const pe=structuredClone(ue);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,B==null||B(Z,pe),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":w,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${w}-${e}`,className:ls(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!k,target:k,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:z,connectingto:E,valid:I,connectionindicator:r&&(!M||j)&&(M||D?i:s)}]),onMouseDown:q,onTouchStart:q,onClick:x?H:void 0,ref:m,...p,children:c})}const Fu=A.memo(TU(nGn));function rGn({data:e,isConnectable:n,sourcePosition:t=Dt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(Fu,{type:"source",position:t,isConnectable:n})]})}function sGn({data:e,isConnectable:n,targetPosition:t=Dt.Top,sourcePosition:r=Dt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(Fu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(Fu,{type:"source",position:r,isConnectable:n})]})}function iGn(){return null}function aGn({data:e,isConnectable:n,targetPosition:t=Dt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Fu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const xb={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},FM={input:rGn,default:sGn,output:aGn,group:iGn};function oGn(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const cGn=e=>{const{width:n,height:t,x:r,y:s}=Hm(e.nodeLookup,{filter:i=>!!i.selected});return{width:vo(n)?n:null,height:vo(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function lGn({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Nr(),{width:s,height:i,transformString:a,userSelectionActive:o}=Rn(cGn,Cr),c=MU(),u=A.useRef(null);A.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const h=!o&&s!==null&&i!==null;if(RU({nodeRef:u,disabled:!h}),!h)return null;const _=e?m=>{const w=r.getState().nodes.filter(k=>k.selected);e(m,w)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(xb,m.key)&&(m.preventDefault(),c({direction:xb[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:ls(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:_,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const HM=typeof window<"u"?window:void 0,uGn=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function LU({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:h,selectionMode:_,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:w,panActivationKeyCode:k,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:z,panOnScrollMode:E,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:D,translateExtent:I,minZoom:$,maxZoom:q,preventScrolling:H,onSelectionContextMenu:Q,noWheelClassName:V,noPanClassName:Z,disableKeyboardA11y:Y,onViewportChange:B,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:U}=Rn(uGn,Cr),K=sm(u,{target:HM}),ne=sm(k,{target:HM}),oe=ne||j,ue=ne||C,se=h&&oe!==!0,G=K||U||se;return FUn({deleteKeyCode:c,multiSelectionKeyCode:w}),f.jsx(UUn,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:ue,panOnScrollSpeed:z,panOnScrollMode:E,zoomOnDoubleClick:T,panOnDrag:!K&&oe,defaultViewport:D,translateExtent:I,minZoom:$,maxZoom:q,zoomActivationKeyCode:v,preventScrolling:H,noWheelClassName:V,noPanClassName:Z,onViewportChange:B,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:se,children:f.jsxs(WUn,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:oe,autoPanOnSelection:M,isSelecting:!!G,selectionMode:_,selectionKeyPressed:K,paneClickDistance:o,selectionOnDrag:se,children:[e,F&&f.jsx(lGn,{onSelectionContextMenu:Q,noPanClassName:Z,disableKeyboardA11y:Y})]})})}LU.displayName="FlowRenderer";const _Gn=A.memo(LU),fGn=e=>n=>e?EC(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function dGn(e){return Rn(A.useCallback(fGn(e),[e]),Cr)}const hGn=e=>e.updateNodeInternals;function pGn(){const e=Rn(hGn),[n]=A.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return A.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function mGn({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Nr(),i=A.useRef(null),a=A.useRef(null),o=A.useRef(e.sourcePosition),c=A.useRef(e.targetPosition),u=A.useRef(n),h=t&&!!e.internals.handleBounds;return A.useEffect(()=>{i.current&&!e.hidden&&(!h||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[h,e.hidden]),A.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),A.useEffect(()=>{if(i.current){const _=u.current!==n,p=o.current!==e.sourcePosition,m=c.current!==e.targetPosition;(_||p||m)&&(u.current=n,o.current=e.sourcePosition,c.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function gGn({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:c,nodesConnectable:u,nodesFocusable:h,resizeObserver:_,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:w,rfId:k,nodeTypes:v,nodeClickDistance:b,onError:x}){const{node:y,internals:C,isParent:z}=Rn(G=>{const ae=G.nodeLookup.get(e),ce=G.parentLookup.has(e);return{node:ae,internals:ae.internals,isParent:ce}},Cr);let E=y.type||"default",T=(v==null?void 0:v[E])||FM[E];T===void 0&&(x==null||x("003",So.error003(E)),E="default",T=(v==null?void 0:v.default)||FM.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||c&&typeof y.selectable>"u"),D=!!(y.connectable||u&&typeof y.connectable>"u"),I=!!(y.focusable||h&&typeof y.focusable>"u"),$=Nr(),q=sU(y),H=mGn({node:y,nodeType:E,hasDimensions:q,resizeObserver:_}),Q=RU({nodeRef:H,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),V=MU();if(y.hidden)return null;const Z=yl(y),Y=oGn(y),B=M||j||n||t||r||s,L=t?G=>t(G,{...C.userNode}):void 0,F=r?G=>r(G,{...C.userNode}):void 0,U=s?G=>s(G,{...C.userNode}):void 0,K=i?G=>i(G,{...C.userNode}):void 0,ne=a?G=>a(G,{...C.userNode}):void 0,oe=G=>{const{selectNodesOnDrag:ae,nodeDragThreshold:ce}=$.getState();M&&(!ae||!j||ce>0)&&gk({id:e,store:$,nodeRef:H}),n&&n(G,{...C.userNode})},ue=G=>{if(!(oU(G.nativeEvent)||w)){if(Wq.includes(G.key)&&M){const ae=G.key==="Escape";gk({id:e,store:$,unselect:ae,nodeRef:H})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(xb,G.key)){G.preventDefault();const{ariaLabelConfig:ae}=$.getState();$.setState({ariaLiveMessage:ae["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:xb[G.key],factor:G.shiftKey?4:1})}}},se=()=>{var De;if(w||!((De=H.current)!=null&&De.matches(":focus-visible")))return;const{transform:G,width:ae,height:ce,autoPanOnNodeFocus:pe,setCenter:be}=$.getState();if(!pe)return;EC(new Map([[e,y]]),{x:0,y:0,width:ae,height:ce},G,!0).length>0||be(y.position.x+Z.width/2,y.position.y+Z.height/2,{zoom:G[2]})};return f.jsx("div",{className:ls(["react-flow__node",`react-flow__node-${E}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:z,draggable:j,dragging:Q}]),ref:H,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:B?"all":"none",visibility:q?"visible":"hidden",...y.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:U,onContextMenu:K,onClick:oe,onDoubleClick:ne,onKeyDown:I?ue:void 0,tabIndex:I?0:void 0,onFocus:I?se:void 0,role:y.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${EU}-${k}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(XUn,{value:e,children:f.jsx(T,{id:e,data:y.data,type:E,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:D,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Q,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...Z})})})}var vGn=A.memo(gGn);const bGn=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function IU(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=Rn(bGn,Cr),a=dGn(e.onlyRenderVisibleElements),o=pGn();return f.jsx("div",{className:"react-flow__nodes",style:Wy,children:a.map(c=>f.jsx(vGn,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}IU.displayName="NodeRenderer";const yGn=A.memo(IU);function xGn(e){return Rn(A.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&bqn({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),Cr)}const wGn=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},kGn=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},qM={[vb.Arrow]:wGn,[vb.ArrowClosed]:kGn};function SGn(e){const n=Nr();return A.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(qM,e)?qM[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",So.error009(e)),null)},[e])}const CGn=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const c=SGn(n);return c?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(c,{color:t,strokeWidth:a})}):null},$U=({defaultColor:e,rfId:n})=>{const t=Rn(i=>i.edges),r=Rn(i=>i.defaultEdgeOptions),s=A.useMemo(()=>Nqn(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(CGn,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};$U.displayName="MarkerDefinitions";var EGn=A.memo($U);function BU({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:c,className:u,...h}){const[_,p]=A.useState({x:1,y:0,width:0,height:0}),m=ls(["react-flow__edge-textwrapper",u]),w=A.useRef(null);return A.useEffect(()=>{if(w.current){const k=w.current.getBBox();p({x:k.x,y:k.y,width:k.width,height:k.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-_.width/2} ${n-_.height/2})`,className:m,visibility:_.width?"visible":"hidden",...h,children:[s&&f.jsx("rect",{width:_.width+2*a[0],x:-a[0],y:-a[1],height:_.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:_.height/2,dy:"0.3em",ref:w,style:r,children:t}),c]}):null}BU.displayName="EdgeText";const NGn=A.memo(BU);function Qy({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:u=20,...h}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...h,d:e,fill:"none",className:ls(["react-flow__edge-path",h.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&vo(n)&&vo(t)?f.jsx(NGn,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function UM({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Dt.Left||e===Dt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function PU({sourceX:e,sourceY:n,sourcePosition:t=Dt.Bottom,targetX:r,targetY:s,targetPosition:i=Dt.Top}){const[a,o]=UM({pos:t,x1:e,y1:n,x2:r,y2:s}),[c,u]=UM({pos:i,x1:r,y1:s,x2:e,y2:n}),[h,_,p,m]=lU({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:c,targetControlY:u});return[`M${e},${n} C${a},${o} ${c},${u} ${r},${s}`,h,_,p,m]}function FU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:b})=>{const[x,y,C]=PU({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),z=e.isInternal?void 0:n;return f.jsx(Qy,{id:z,path:x,labelX:y,labelY:C,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:b})})}const zGn=FU({isInternal:!1}),HU=FU({isInternal:!0});zGn.displayName="SimpleBezierEdge";HU.displayName="SimpleBezierEdgeInternal";function qU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,sourcePosition:m=Dt.Bottom,targetPosition:w=Dt.Top,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:x})=>{const[y,C,z]=dk({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:w,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),E=e.isInternal?void 0:n;return f.jsx(Qy,{id:E,path:y,labelX:C,labelY:z,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:k,markerStart:v,interactionWidth:x})})}const UU=qU({isInternal:!1}),GU=qU({isInternal:!0});UU.displayName="SmoothStepEdge";GU.displayName="SmoothStepEdgeInternal";function VU(e){return A.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(UU,{...t,id:r,pathOptions:A.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const jGn=VU({isInternal:!1}),KU=VU({isInternal:!0});jGn.displayName="StepEdge";KU.displayName="StepEdgeInternal";function WU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:m,markerStart:w,interactionWidth:k})=>{const[v,b,x]=fU({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(Qy,{id:y,path:v,labelX:b,labelY:x,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:m,markerStart:w,interactionWidth:k})})}const TGn=WU({isInternal:!1}),QU=WU({isInternal:!0});TGn.displayName="StraightEdge";QU.displayName="StraightEdgeInternal";function XU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Dt.Bottom,targetPosition:o=Dt.Top,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:x})=>{const[y,C,z]=uU({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),E=e.isInternal?void 0:n;return f.jsx(Qy,{id:E,path:y,labelX:C,labelY:z,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:x})})}const AGn=XU({isInternal:!1}),YU=XU({isInternal:!0});AGn.displayName="BezierEdge";YU.displayName="BezierEdgeInternal";const GM={default:YU,straight:QU,step:KU,smoothstep:GU,simplebezier:HU},VM={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},RGn=(e,n,t)=>t===Dt.Left?e-n:t===Dt.Right?e+n:e,MGn=(e,n,t)=>t===Dt.Top?e-n:t===Dt.Bottom?e+n:e,KM="react-flow__edgeupdater";function WM({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:ls([KM,`${KM}-${o}`]),cx:RGn(n,r,e),cy:MGn(t,r,e),r,stroke:"transparent",fill:"transparent"})}function OGn({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:c,onReconnect:u,onReconnectStart:h,onReconnectEnd:_,setReconnecting:p,setUpdateHover:m}){const w=Nr(),k=(C,z)=>{if(C.button!==0)return;const{autoPanOnConnect:E,domNode:T,connectionMode:j,connectionRadius:M,lib:D,onConnectStart:I,cancelConnection:$,nodeLookup:q,rfId:H,panBy:Q,updateConnection:V}=w.getState(),Z=z.type==="target",Y=(F,U)=>{p(!1),_==null||_(F,t,z.type,U)},B=F=>u==null?void 0:u(t,F),L=(F,U)=>{p(!0),h==null||h(C,t,z.type),I==null||I(F,U)};mk.onPointerDown(C.nativeEvent,{autoPanOnConnect:E,connectionMode:j,connectionRadius:M,domNode:T,handleId:z.id,nodeId:z.nodeId,nodeLookup:q,isTarget:Z,edgeUpdaterType:z.type,lib:D,flowId:H,cancelConnection:$,panBy:Q,isValidConnection:(...F)=>{var U,K;return((K=(U=w.getState()).isValidConnection)==null?void 0:K.call(U,...F))??!0},onConnect:B,onConnectStart:L,onConnectEnd:(...F)=>{var U,K;return(K=(U=w.getState()).onConnectEnd)==null?void 0:K.call(U,...F)},onReconnectEnd:Y,updateConnection:V,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>k(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>k(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),x=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(WM,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:x,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(WM,{position:c,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:x,onMouseOut:y,type:"target"})]})}function DGn({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,reconnectRadius:h,onReconnect:_,onReconnectStart:p,onReconnectEnd:m,rfId:w,edgeTypes:k,noPanClassName:v,onError:b,disableKeyboardA11y:x}){let y=Rn(be=>be.edgeLookup.get(e));const C=Rn(be=>be.defaultEdgeOptions);y=C?{...C,...y}:y;let z=y.type||"default",E=(k==null?void 0:k[z])||GM[z];E===void 0&&(b==null||b("011",So.error011(z)),z="default",E=(k==null?void 0:k.default)||GM.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof _<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),D=A.useRef(null),[I,$]=A.useState(!1),[q,H]=A.useState(!1),Q=Nr(),{zIndex:V=y.zIndex,sourceX:Z,sourceY:Y,targetX:B,targetY:L,sourcePosition:F,targetPosition:U}=Rn(A.useCallback(be=>{const Ae=be.nodeLookup.get(y.source),De=be.nodeLookup.get(y.target);if(!Ae||!De)return VM;const We=Eqn({id:e,sourceNode:Ae,targetNode:De,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:be.connectionMode,onError:b}),Ne=vqn({selected:y.selected,zIndex:y.zIndex,sourceNode:Ae,targetNode:De,elevateOnSelect:be.elevateEdgesOnSelect,zIndexMode:be.zIndexMode});return{...We||VM,zIndex:Ne}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),Cr),K=A.useMemo(()=>y.markerStart?`url('#${hk(y.markerStart,w)}')`:void 0,[y.markerStart,w]),ne=A.useMemo(()=>y.markerEnd?`url('#${hk(y.markerEnd,w)}')`:void 0,[y.markerEnd,w]);if(y.hidden||Z===null||Y===null||B===null||L===null)return null;const oe=be=>{var Ne;const{addSelectedEdges:Ae,unselectNodesAndEdges:De,multiSelectionActive:We}=Q.getState();M&&(Q.setState({nodesSelectionActive:!1}),y.selected&&We?(De({nodes:[],edges:[y]}),(Ne=D.current)==null||Ne.blur()):Ae([e])),s&&s(be,y)},ue=i?be=>{i(be,{...y})}:void 0,se=a?be=>{a(be,{...y})}:void 0,G=o?be=>{o(be,{...y})}:void 0,ae=c?be=>{c(be,{...y})}:void 0,ce=u?be=>{u(be,{...y})}:void 0,pe=be=>{var Ae;if(!x&&Wq.includes(be.key)&&M){const{unselectNodesAndEdges:De,addSelectedEdges:We}=Q.getState();be.key==="Escape"?((Ae=D.current)==null||Ae.blur(),De({edges:[y]})):We([e])}};return f.jsx("svg",{style:{zIndex:V},children:f.jsxs("g",{className:ls(["react-flow__edge",`react-flow__edge-${z}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:I,selectable:M}]),onClick:oe,onDoubleClick:ue,onContextMenu:se,onMouseEnter:G,onMouseMove:ae,onMouseLeave:ce,onKeyDown:T?pe:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"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":T?`${NU}-${w}`:void 0,ref:D,...y.domAttributes,children:[!q&&f.jsx(E,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,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:Y,targetX:B,targetY:L,sourcePosition:F,targetPosition:U,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:K,markerEnd:ne,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(OGn,{edge:y,isReconnectable:j,reconnectRadius:h,onReconnect:_,onReconnectStart:p,onReconnectEnd:m,sourceX:Z,sourceY:Y,targetX:B,targetY:L,sourcePosition:F,targetPosition:U,setUpdateHover:$,setReconnecting:H})]})})}var LGn=A.memo(DGn);const IGn=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ZU({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:h,reconnectRadius:_,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:w,disableKeyboardA11y:k}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,onError:y}=Rn(IGn,Cr),C=xGn(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(EGn,{defaultColor:e,rfId:t}),C.map(z=>f.jsx(LGn,{id:z,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,onClick:h,reconnectRadius:_,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:w,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:k},z))]})}ZU.displayName="EdgeRenderer";const $Gn=A.memo(ZU),BGn=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function PGn({children:e}){const n=Rn(BGn);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function FGn(e){const n=DC(),t=A.useRef(!1);A.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const HGn=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function qGn(e){const n=Rn(HGn),t=Nr();return A.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function UGn(e){return e.connection.inProgress?{...e.connection,to:Um(e.connection.to,e.transform)}:{...e.connection}}function GGn(e){return UGn}function VGn(e){const n=GGn();return Rn(n,Cr)}const KGn=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function WGn({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:c}=Rn(KGn,Cr);return!(i&&s&&c)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:ls(["react-flow__connection",Yq(o)]),children:f.jsx(JU,{style:n,type:t,CustomComponent:r,isValid:o})})})}const JU=({style:e,type:n=pu.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:c,to:u,toNode:h,toHandle:_,toPosition:p,pointer:m}=VGn();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:p,connectionStatus:Yq(r),toNode:h,toHandle:_,pointer:m});let w="";const k={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case pu.Bezier:[w]=uU(k);break;case pu.SimpleBezier:[w]=PU(k);break;case pu.Step:[w]=dk({...k,borderRadius:0});break;case pu.SmoothStep:[w]=dk(k);break;default:[w]=fU(k)}return f.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};JU.displayName="ConnectionLine";const QGn={};function QM(e=QGn){A.useRef(e),Nr(),A.useEffect(()=>{},[e])}function XGn(){Nr(),A.useRef(!1),A.useEffect(()=>{},[])}function eG({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,onSelectionContextMenu:_,onSelectionStart:p,onSelectionEnd:m,connectionLineType:w,connectionLineStyle:k,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:x,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:z,panActivationKeyCode:E,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:D,defaultViewport:I,translateExtent:$,minZoom:q,maxZoom:H,preventScrolling:Q,defaultMarkerColor:V,zoomOnScroll:Z,zoomOnPinch:Y,panOnScroll:B,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:U,panOnDrag:K,autoPanOnSelection:ne,onPaneClick:oe,onPaneMouseEnter:ue,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneScroll:ae,onPaneContextMenu:ce,paneClickDistance:pe,nodeClickDistance:be,onEdgeContextMenu:Ae,onEdgeMouseEnter:De,onEdgeMouseMove:We,onEdgeMouseLeave:Ne,reconnectRadius:xe,onReconnect:rt,onReconnectStart:Ze,onReconnectEnd:ct,noDragClassName:Ct,noWheelClassName:qt,noPanClassName:dt,disableKeyboardA11y:ht,nodeExtent:Le,rfId:me,viewport:Te,onViewportChange:He}){return QM(e),QM(n),XGn(),FGn(t),qGn(Te),f.jsx(_Gn,{onPaneClick:oe,onPaneMouseEnter:ue,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneContextMenu:ce,onPaneScroll:ae,paneClickDistance:pe,deleteKeyCode:j,selectionKeyCode:x,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:z,panActivationKeyCode:E,zoomActivationKeyCode:T,elementsSelectable:D,zoomOnScroll:Z,zoomOnPinch:Y,zoomOnDoubleClick:U,panOnScroll:B,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:K,autoPanOnSelection:ne,defaultViewport:I,translateExtent:$,minZoom:q,maxZoom:H,onSelectionContextMenu:_,preventScrolling:Q,noDragClassName:Ct,noWheelClassName:qt,noPanClassName:dt,disableKeyboardA11y:ht,onViewportChange:He,isControlledViewport:!!Te,children:f.jsxs(PGn,{children:[f.jsx($Gn,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:rt,onReconnectStart:Ze,onReconnectEnd:ct,onlyRenderVisibleElements:M,onEdgeContextMenu:Ae,onEdgeMouseEnter:De,onEdgeMouseMove:We,onEdgeMouseLeave:Ne,reconnectRadius:xe,defaultMarkerColor:V,noPanClassName:dt,disableKeyboardA11y:ht,rfId:me}),f.jsx(WGn,{style:k,type:w,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(yGn,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,nodeClickDistance:be,onlyRenderVisibleElements:M,noPanClassName:dt,noDragClassName:Ct,disableKeyboardA11y:ht,nodeExtent:Le,rfId:me}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}eG.displayName="GraphView";const YGn=A.memo(eG),ZGn=rU(),XM=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c=.5,maxZoom:u=2,nodeOrigin:h,nodeExtent:_,zIndexMode:p="basic"}={})=>{const m=new Map,w=new Map,k=new Map,v=new Map,b=r??n??[],x=t??e??[],y=h??[0,0],C=_??em;pU(k,v,b);const{nodesInitialized:z}=pk(x,m,w,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let E=[0,0,1];if(a&&s&&i){const T=Hm(m,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:j,y:M,zoom:D}=zC(T,s,i,c,u,(o==null?void 0:o.padding)??.1);E=[j,M,D]}return{rfId:"1",width:s??0,height:i??0,transform:E,nodes:x,nodesInitialized:z,nodeLookup:m,parentLookup:w,edges:b,edgeLookup:v,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:em,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ah.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:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...Xq},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ZGn,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Qq,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},JGn=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:_,zIndexMode:p})=>lUn((m,w)=>{async function k(){const{nodeLookup:v,panZoom:b,fitViewOptions:x,fitViewResolver:y,width:C,height:z,minZoom:E,maxZoom:T}=w();b&&(await _qn({nodes:v,width:C,height:z,panZoom:b,minZoom:E,maxZoom:T},x),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...XM({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:_,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:x,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:z,zIndexMode:E,nodesSelectionActive:T}=w(),{nodesInitialized:j,hasSelectedNodes:M}=pk(v,b,x,{nodeOrigin:y,nodeExtent:_,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:E}),D=T&&M;z&&j?(k(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:D})},setEdges:v=>{const{connectionLookup:b,edgeLookup:x}=w();pU(b,x,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:x}=w();x(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:x}=w();x(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:x,parentLookup:y,domNode:C,nodeOrigin:z,nodeExtent:E,debug:T,fitViewQueued:j,zIndexMode:M}=w(),{changes:D,updatedInternals:I}=Oqn(v,x,y,C,z,E,M);I&&(Tqn(x,y,{nodeOrigin:z,nodeExtent:E,zIndexMode:M}),j?(k(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(D==null?void 0:D.length)>0&&(T&&console.log("React Flow: trigger node changes",D),b==null||b(D)))},updateNodePositions:(v,b=!1)=>{const x=[];let y=[];const{nodeLookup:C,triggerNodeChanges:z,connection:E,updateConnection:T,onNodesChangeMiddlewareMap:j}=w();for(const[M,D]of v){const I=C.get(M),$=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(D!=null&&D.position)),q={id:M,type:"position",position:$?{x:Math.max(0,D.position.x),y:Math.max(0,D.position.y)}:D.position,dragging:b};if(I&&E.inProgress&&E.fromNode.id===I.id){const H=gf(I,E.fromHandle,Dt.Left,!0);T({...E,from:H})}$&&I.parentId&&x.push({id:M,parentId:I.parentId,rect:{...D.internals.positionAbsolute,width:D.measured.width??0,height:D.measured.height??0}}),y.push(q)}if(x.length>0){const{parentLookup:M,nodeOrigin:D}=w(),I=OC(x,C,M,D);y.push(...I)}for(const M of j.values())y=M(y);z(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:x,nodes:y,hasDefaultNodes:C,debug:z}=w();if(v!=null&&v.length){if(C){const E=TUn(v,y);x(E)}z&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:x,edges:y,hasDefaultEdges:C,debug:z}=w();if(v!=null&&v.length){if(C){const E=AUn(v,y);x(E)}z&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:z}=w();if(b){const E=v.map(T=>N_(T,!0));C(E);return}C(Rd(y,new Set([...v]),!0)),z(Rd(x))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:z}=w();if(b){const E=v.map(T=>N_(T,!0));z(E);return}z(Rd(x,new Set([...v]))),C(Rd(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:x,nodes:y,nodeLookup:C,triggerNodeChanges:z,triggerEdgeChanges:E}=w(),T=v||y,j=b||x,M=[];for(const I of T){if(!I.selected)continue;const $=C.get(I.id);$&&($.selected=!1),M.push(N_(I.id,!1))}const D=[];for(const I of j)I.selected&&D.push(N_(I.id,!1));z(M),E(D)},setMinZoom:v=>{const{panZoom:b,maxZoom:x}=w();b==null||b.setScaleExtent([v,x]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:x}=w();b==null||b.setScaleExtent([x,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=w().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:x,triggerEdgeChanges:y,elementsSelectable:C}=w();if(!C)return;const z=b.reduce((T,j)=>j.selected?[...T,N_(j.id,!1)]:T,[]),E=v.reduce((T,j)=>j.selected?[...T,N_(j.id,!1)]:T,[]);x(z),y(E)},setNodeExtent:v=>{const{nodes:b,nodeLookup:x,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:z,nodeExtent:E,zIndexMode:T}=w();v[0][0]===E[0][0]&&v[0][1]===E[0][1]&&v[1][0]===E[1][0]&&v[1][1]===E[1][1]||(pk(b,x,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:z,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:x,height:y,panZoom:C,translateExtent:z}=w();return Dqn({delta:v,panZoom:C,transform:b,translateExtent:z,width:x,height:y})},setCenter:async(v,b,x)=>{const{width:y,height:C,maxZoom:z,panZoom:E}=w();if(!E)return!1;const T=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:z;return await E.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{m({connection:{...Xq}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...XM()})}},Object.is);function eVn({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:c,fitView:u,nodeOrigin:h,nodeExtent:_,zIndexMode:p,children:m}){const[w]=A.useState(()=>JGn({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:c,nodeOrigin:h,nodeExtent:_,zIndexMode:p}));return f.jsx(uUn,{value:w,children:f.jsx(IUn,{children:f.jsx(ZUn,{children:m})})})}function tVn({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:c,minZoom:u,maxZoom:h,nodeOrigin:_,nodeExtent:p,zIndexMode:m}){return A.useContext(Vy)?f.jsx(f.Fragment,{children:e}):f.jsx(eVn,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:h,nodeOrigin:_,nodeExtent:p,zIndexMode:m,children:e})}const nVn={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function rVn({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:c,onInit:u,onMove:h,onMoveStart:_,onMoveEnd:p,onConnect:m,onConnectStart:w,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:z,onNodeDoubleClick:E,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:D,onEdgesDelete:I,onDelete:$,onSelectionChange:q,onSelectionDragStart:H,onSelectionDrag:Q,onSelectionDragStop:V,onSelectionContextMenu:Z,onSelectionStart:Y,onSelectionEnd:B,onBeforeDelete:L,connectionMode:F,connectionLineType:U=pu.Bezier,connectionLineStyle:K,connectionLineComponent:ne,connectionLineContainerStyle:oe,deleteKeyCode:ue="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:G=!1,selectionMode:ae=tm.Full,panActivationKeyCode:ce="Space",multiSelectionKeyCode:pe=rm()?"Meta":"Control",zoomActivationKeyCode:be=rm()?"Meta":"Control",snapToGrid:Ae,snapGrid:De,onlyRenderVisibleElements:We=!1,selectNodesOnDrag:Ne,nodesDraggable:xe,autoPanOnNodeFocus:rt,nodesConnectable:Ze,nodesFocusable:ct,nodeOrigin:Ct=zU,edgesFocusable:qt,edgesReconnectable:dt,elementsSelectable:ht=!0,defaultViewport:Le=kUn,minZoom:me=.5,maxZoom:Te=2,translateExtent:He=em,preventScrolling:nt=!0,nodeExtent:_t,defaultMarkerColor:St="#b1b1b7",zoomOnScroll:yt=!0,zoomOnPinch:Zt=!0,panOnScroll:un=!1,panOnScrollSpeed:At=.5,panOnScrollMode:pt=J_.Free,zoomOnDoubleClick:mt=!0,panOnDrag:_n=!0,onPaneClick:us,onPaneMouseEnter:xr,onPaneMouseMove:Qt,onPaneMouseLeave:Mn,onPaneScroll:mr,onPaneContextMenu:gr,paneClickDistance:_s=1,nodeClickDistance:Et=0,children:fn,onReconnect:an,onReconnectStart:xn,onReconnectEnd:Ir,onEdgeContextMenu:mn,onEdgeDoubleClick:gn,onEdgeMouseEnter:Ln,onEdgeMouseMove:Nt,onEdgeMouseLeave:Ot,reconnectRadius:Hn=10,onNodesChange:zr,onEdgesChange:nr,noDragClassName:On="nodrag",noWheelClassName:hr="nowheel",noPanClassName:jr="nopan",fitView:In,fitViewOptions:Ke,connectOnClick:gt,attributionPosition:Zr,proOptions:Wn,defaultEdgeOptions:wn,elevateNodesOnSelect:Qn=!0,elevateEdgesOnSelect:rr=!1,disableKeyboardA11y:As=!1,autoPanOnConnect:Tr,autoPanOnNodeDrag:cr,autoPanOnSelection:xl=!0,autoPanSpeed:Ya,connectionRadius:Jr,isValidConnection:Rs,onError:Za,style:Eo,id:wa,nodeDragThreshold:Ps,connectionDragThreshold:$t,viewport:qi,onViewportChange:Xn,width:Ar,height:st,colorMode:Jt="light",debug:vi,onScroll:bi,ariaLabelConfig:yi,zIndexMode:Kr="basic",...Wr},Ui){const Gi=wa||"1",Fs=NUn(Jt),Rr=A.useCallback(ei=>{ei.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),bi==null||bi(ei)},[bi]);return f.jsx("div",{"data-testid":"rf__wrapper",...Wr,onScroll:Rr,style:{...Eo,...nVn},ref:Ui,className:ls(["react-flow",s,Fs]),id:wa,role:"application",children:f.jsxs(tVn,{nodes:e,edges:n,width:Ar,height:st,fitView:In,fitViewOptions:Ke,minZoom:me,maxZoom:Te,nodeOrigin:Ct,nodeExtent:_t,zIndexMode:Kr,children:[f.jsx(EUn,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:w,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:xe,autoPanOnNodeFocus:rt,nodesConnectable:Ze,nodesFocusable:ct,edgesFocusable:qt,edgesReconnectable:dt,elementsSelectable:ht,elevateNodesOnSelect:Qn,elevateEdgesOnSelect:rr,minZoom:me,maxZoom:Te,nodeExtent:_t,onNodesChange:zr,onEdgesChange:nr,snapToGrid:Ae,snapGrid:De,connectionMode:F,translateExtent:He,connectOnClick:gt,defaultEdgeOptions:wn,fitView:In,fitViewOptions:Ke,onNodesDelete:D,onEdgesDelete:I,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Q,onSelectionDragStart:H,onSelectionDragStop:V,onMove:h,onMoveStart:_,onMoveEnd:p,noPanClassName:jr,nodeOrigin:Ct,rfId:Gi,autoPanOnConnect:Tr,autoPanOnNodeDrag:cr,autoPanSpeed:Ya,onError:Za,connectionRadius:Jr,isValidConnection:Rs,selectNodesOnDrag:Ne,nodeDragThreshold:Ps,connectionDragThreshold:$t,onBeforeDelete:L,debug:vi,ariaLabelConfig:yi,zIndexMode:Kr}),f.jsx(YGn,{onInit:u,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:z,onNodeDoubleClick:E,nodeTypes:i,edgeTypes:a,connectionLineType:U,connectionLineStyle:K,connectionLineComponent:ne,connectionLineContainerStyle:oe,selectionKeyCode:se,selectionOnDrag:G,selectionMode:ae,deleteKeyCode:ue,multiSelectionKeyCode:pe,panActivationKeyCode:ce,zoomActivationKeyCode:be,onlyRenderVisibleElements:We,defaultViewport:Le,translateExtent:He,minZoom:me,maxZoom:Te,preventScrolling:nt,zoomOnScroll:yt,zoomOnPinch:Zt,zoomOnDoubleClick:mt,panOnScroll:un,panOnScrollSpeed:At,panOnScrollMode:pt,panOnDrag:_n,autoPanOnSelection:xl,onPaneClick:us,onPaneMouseEnter:xr,onPaneMouseMove:Qt,onPaneMouseLeave:Mn,onPaneScroll:mr,onPaneContextMenu:gr,paneClickDistance:_s,nodeClickDistance:Et,onSelectionContextMenu:Z,onSelectionStart:Y,onSelectionEnd:B,onReconnect:an,onReconnectStart:xn,onReconnectEnd:Ir,onEdgeContextMenu:mn,onEdgeDoubleClick:gn,onEdgeMouseEnter:Ln,onEdgeMouseMove:Nt,onEdgeMouseLeave:Ot,reconnectRadius:Hn,defaultMarkerColor:St,noDragClassName:On,noWheelClassName:hr,noPanClassName:jr,rfId:Gi,disableKeyboardA11y:As,nodeExtent:_t,viewport:qi,onViewportChange:Xn}),f.jsx(wUn,{onSelectionChange:q}),fn,f.jsx(gUn,{proOptions:Wn,position:Zr}),f.jsx(mUn,{rfId:Gi,disableKeyboardA11y:As})]})})}var sVn=TU(rVn);function iVn({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ls(["react-flow__background-pattern",t,r])})}function aVn({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:ls(["react-flow__background-pattern","dots",n])})}var ul;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ul||(ul={}));const oVn={[ul.Dots]:1,[ul.Lines]:1,[ul.Cross]:6},cVn=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function tG({id:e,variant:n=ul.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:c,className:u,patternClassName:h}){const _=A.useRef(null),{transform:p,patternId:m}=Rn(cVn,Cr),w=r||oVn[n],k=n===ul.Dots,v=n===ul.Cross,b=Array.isArray(t)?t:[t,t],x=[b[0]*p[2]||1,b[1]*p[2]||1],y=w*p[2],C=Array.isArray(i)?i:[i,i],z=v?[y,y]:x,E=[C[0]*p[2]||1+z[0]/2,C[1]*p[2]||1+z[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:ls(["react-flow__background",u]),style:{...c,...Wy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:_,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%x[0],y:p[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:k?f.jsx(aVn,{radius:y/2,className:h}):f.jsx(iVn,{dimensions:z,lineWidth:s,variant:n,className:h})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}tG.displayName="Background";const lVn=A.memo(tG);function uVn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function _Vn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function fVn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.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 dVn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 hVn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 $1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:ls(["react-flow__controls-button",n]),...t,children:e})}const pVn=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function nG({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:c,className:u,children:h,position:_="bottom-left",orientation:p="vertical","aria-label":m}){const w=Nr(),{isInteractive:k,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:x}=Rn(pVn,Cr),{zoomIn:y,zoomOut:C,fitView:z}=DC(),E=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{z(s),o==null||o()},M=()=>{w.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),c==null||c(!k)},D=p==="horizontal"?"horizontal":"vertical";return f.jsxs(Ky,{className:ls(["react-flow__controls",D,u]),position:_,style:e,"data-testid":"rf__controls","aria-label":m??x["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx($1,{onClick:E,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(uVn,{})}),f.jsx($1,{onClick:T,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(_Vn,{})})]}),t&&f.jsx($1,{className:"react-flow__controls-fitview",onClick:j,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:f.jsx(fVn,{})}),r&&f.jsx($1,{className:"react-flow__controls-interactive",onClick:M,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:k?f.jsx(hVn,{}):f.jsx(dVn,{})}),h]})}nG.displayName="Controls";A.memo(nG);function mVn({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:c,className:u,borderRadius:h,shapeRendering:_,selected:p,onClick:m}){const{background:w,backgroundColor:k}=i||{},v=a||w||k;return f.jsx("rect",{className:ls(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:h,ry:h,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:c},shapeRendering:_,onClick:m?b=>m(b,e):void 0})}const gVn=A.memo(mVn),vVn=e=>e.nodes.map(n=>n.id),A4=e=>e instanceof Function?e:()=>e;function bVn({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=gVn,onClick:a}){const o=Rn(vVn,Cr),c=A4(n),u=A4(e),h=A4(t),_=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(xVn,{id:p,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:_},p))})}function yVn({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:c}){const{node:u,x:h,y:_,width:p,height:m}=Rn(w=>{const k=w.nodeLookup.get(e);if(!k)return{node:void 0,x:0,y:0,width:0,height:0};const v=k.internals.userNode,{x:b,y:x}=k.internals.positionAbsolute,{width:y,height:C}=yl(v);return{node:v,x:b,y:x,width:y,height:C}},Cr);return!u||u.hidden||!sU(u)?null:f.jsx(o,{x:h,y:_,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:c,id:u.id})}const xVn=A.memo(yVn);var wVn=A.memo(bVn);const kVn=200,SVn=150,CVn=e=>!e.hidden,EVn=e=>{const n={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:n,boundingRect:e.nodeLookup.size>0?tU(Hm(e.nodeLookup,{filter:CVn}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},NVn="react-flow__minimap-desc";function rG({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:c,maskColor:u,maskStrokeColor:h,maskStrokeWidth:_,position:p="bottom-right",onClick:m,onNodeClick:w,pannable:k=!1,zoomable:v=!1,ariaLabel:b,inversePan:x,zoomStep:y=1,offsetScale:C=5}){const z=Nr(),E=A.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:D,translateExtent:I,flowWidth:$,flowHeight:q,ariaLabelConfig:H}=Rn(EVn,Cr),Q=(e==null?void 0:e.width)??kVn,V=(e==null?void 0:e.height)??SVn,Z=T.width/Q,Y=T.height/V,B=Math.max(Z,Y),L=B*Q,F=B*V,U=C*B,K=T.x-(L-T.width)/2-U,ne=T.y-(F-T.height)/2-U,oe=L+U*2,ue=F+U*2,se=`${NVn}-${M}`,G=A.useRef(0),ae=A.useRef();G.current=B,A.useEffect(()=>{if(E.current&&D)return ae.current=Uqn({domNode:E.current,panZoom:D,getTransform:()=>z.getState().transform,getViewScale:()=>G.current}),()=>{var Ae;(Ae=ae.current)==null||Ae.destroy()}},[D]),A.useEffect(()=>{var Ae;(Ae=ae.current)==null||Ae.update({translateExtent:I,width:$,height:q,inversePan:x,pannable:k,zoomStep:y,zoomable:v})},[k,v,x,y,I,$,q]);const ce=m?Ae=>{var Ne;const[De,We]=((Ne=ae.current)==null?void 0:Ne.pointer(Ae))||[0,0];m(Ae,{x:De,y:We})}:void 0,pe=w?A.useCallback((Ae,De)=>{const We=z.getState().nodeLookup.get(De).internals.userNode;w(Ae,We)},[]):void 0,be=b??H["minimap.ariaLabel"];return f.jsx(Ky,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof _=="number"?_*B:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:ls(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Q,height:V,viewBox:`${K} ${ne} ${oe} ${ue}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:E,onClick:ce,children:[be&&f.jsx("title",{id:se,children:be}),f.jsx(wVn,{onClick:pe,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${K-U},${ne-U}h${oe+U*2}v${ue+U*2}h${-oe-U*2}z + M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}rG.displayName="MiniMap";A.memo(rG);const zVn=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,jVn={[Oh.Line]:"right",[Oh.Handle]:"bottom-right"};function TVn({nodeId:e,position:n,variant:t=Oh.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:_=!1,resizeDirection:p,autoScale:m=!0,shouldResize:w,onResizeStart:k,onResize:v,onResizeEnd:b}){const x=OU(),y=typeof e=="string"?e:x,C=Nr(),z=A.useRef(null),E=t===Oh.Handle,T=Rn(A.useCallback(zVn(E&&m),[E,m]),Cr),j=A.useRef(null),M=n??jVn[t];A.useEffect(()=>{if(!(!z.current||!y))return j.current||(j.current=rUn({domNode:z.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:I,transform:$,snapGrid:q,snapToGrid:H,nodeOrigin:Q,domNode:V}=C.getState();return{nodeLookup:I,transform:$,snapGrid:q,snapToGrid:H,nodeOrigin:Q,paneDomNode:V}},onChange:(I,$)=>{const{triggerNodeChanges:q,nodeLookup:H,parentLookup:Q,nodeOrigin:V}=C.getState(),Z=[],Y={x:I.x,y:I.y},B=H.get(y);if(B&&B.expandParent&&B.parentId){const L=B.origin??V,F=I.width??B.measured.width??0,U=I.height??B.measured.height??0,K={id:B.id,parentId:B.parentId,rect:{width:F,height:U,...iU({x:I.x??B.position.x,y:I.y??B.position.y},{width:F,height:U},B.parentId,H,L)}},ne=OC([K],H,Q,V);Z.push(...ne),Y.x=I.x?Math.max(L[0]*F,I.x):void 0,Y.y=I.y?Math.max(L[1]*U,I.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const L={id:y,type:"position",position:{...Y}};Z.push(L)}if(I.width!==void 0&&I.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};Z.push(F)}for(const L of $){const F={...L,type:"position"};Z.push(F)}q(Z)},onEnd:({width:I,height:$})=>{const q={id:y,type:"dimensions",resizing:!1,dimensions:{width:I,height:$}};C.getState().triggerNodeChanges([q])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:c,maxWidth:u,maxHeight:h},keepAspectRatio:_,resizeDirection:p,onResizeStart:k,onResize:v,onResizeEnd:b,shouldResize:w}),()=>{var I;(I=j.current)==null||I.destroy()}},[M,o,c,u,h,_,k,v,b,w]);const D=M.split("-");return f.jsx("div",{className:ls(["react-flow__resize-control","nodrag",...D,t,r]),ref:z,style:{...s,scale:T,...a&&{[E?"backgroundColor":"borderColor"]:a}},children:i})}A.memo(TVn);function AVn(){const[e,n]=A.useState(0),[t,r]=A.useState(0);return{ref:A.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),c=new MutationObserver(a);return o.observe(i),c.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const B1=8;function RVn(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=A.useState({viewWidth:0,viewHeight:0});A.useEffect(()=>{function h(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",h),h(),()=>window.removeEventListener("resize",h)},[]);let o=0,c=0,u=0;if(e){const{distance:h}=e;switch(e.anchor){case"left":o=e.x-t-h,c=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+h,c=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,c=e.y+e.height+h;break;case"above":o=e.x+e.width/2-t/2,c=e.y-r-h;break}const _=o,p=c;o=Math.min(Math.max(o,B1),i-t-B1),c=Math.min(Math.max(c,B1),s-r-B1),u=e.anchor==="left"||e.anchor==="right"?p-c:_-o}return{x:o,y:c,arrowAdjustment:u}}const R4=380,M4=12,MVn=350,OVn=150,vk=new EventTarget;function DVn(){vk.dispatchEvent(new Event("move"))}function LVn(e,n){const[t,r]=A.useState(null),s=A.useRef(void 0),i=A.useRef(void 0);A.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return vk.addEventListener("move",u),()=>{vk.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),A.useEffect(()=>{r(u=>{var _;if(!u)return u;const h=((_=e.current)==null?void 0:_.getBoundingClientRect())??null;return h&&u.x===h.x&&u.y===h.y&&u.width===h.width&&u.height===h.height?u:h})},[e,n]);const a=A.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},MVn)},[e]),o=A.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),OVn)},[]),c=A.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:c}}function IVn(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(N(),t)}function $Vn({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:c}){const u=AVn(),h=s.right+M4+R4<=window.innerWidth,_=s.x-M4-R4>=0,p=h?"right":_?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:w}=RVn({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:M4},u),k=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ut({...k6n(k??""),enabled:!!k,subscribed:!!k}),b=A.useMemo(()=>{if(!v)return null;const I=v;let $=I.diff;if(I.truncated){const V=$.lastIndexOf(` diff --git `);$=V!==-1?$.slice(0,V+1):$.slice(0,$.lastIndexOf(` -`)+1)}let q=[];try{q=$.trim()?Y3($):[]}catch{return null}if(I.truncated&&q.every(V=>V.hunks.length===0))return null;let H=0,Q=0;for(const V of q){const J=ly(V);H+=J.additions,Q+=J.deletions}return{fileCount:q.length,additions:H,deletions:Q,truncated:I.truncated}},[v]),w={done:0,failed:0,cancelled:0,live:0};for(const I of n)I.status==="done"?w.done+=1:I.status==="failed"?w.failed+=1:I.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?A0((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,N=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,z=A.useRef(null),[T,j]=A.useState(!1),[M,D]=A.useState(!1);return A.useEffect(()=>{j(!1)},[N]),A.useEffect(()=>{const I=z.current;I&&D(I.scrollHeight>I.clientHeight+1)},[N,T]),Mi.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.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-border-hover-strong [&_.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-sm [&_.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]: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-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:T4,left:m,top:x,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:c,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx(al,{status:t?Zi(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Ur(i),children:[f.jsx(lo,{size:13}),VOe()]}),f.jsxs("button",{type:"button",...Ur(a),children:[f.jsx(Ib,{size:13}),COe()]})]}),N&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:z,children:N}),N&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(I=>!I),children:T?RD():Eje()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(E(),{style:"short"}).format([n.length===1?iYe():fYe({count:Xt(n.length)}),...w.done>0?[gXe({count:Xt(w.done)})]:[],...w.failed>0?[SXe({count:Xt(w.failed)})]:[],...w.cancelled>0?[uXe({count:Xt(w.cancelled)})]:[],...w.live>0?[GXe({count:Xt(w.live)})]:[]])}),t&&iS(t.backend)&&f.jsx(AS,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:co(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(Nm,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[BOe()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?EX({parent:Ne(r??"parent")}):bX({parent:Ne(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?ZXe():b.truncated?$Xe({count:Xt(b.fileCount)}):AXe({count:Xt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[ROe()," ",EGn(e.createdAt)]})]})]}),document.body)}const QM=["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-sm [&_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(" "),zGn=264,XM=132,_v=44,jGn=72,TGn=148,AGn=44;function RGn(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function MGn(e,n){const t=new Map,r=o=>{const c=t.get(o)??1+o.children.reduce((u,h)=>u+r(h),0);return t.set(o,c),c},s=new Map,i=o=>{const c=s.get(o)??(n(o)||o.children.some(i));return s.set(o,c),c};function a(o){if(n(o)){const h=[];let _=0;for(const p of o.children)i(p)?h.push(...a(p)):_+=r(p);return _>0&&h.push({kind:"elided",id:`el-${o.exp.id}`,count:_,children:[]}),[{kind:"exp",exp:o.exp,children:h}]}if(!i(o))return[];let c=0;const u=[];return(function h(_){c+=1;for(const p of _.children)n(p)?u.push(...a(p)):i(p)?h(p):c+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:c,children:u}]}return e.flatMap(a)}function gk(e){return e.kind==="exp"?zGn:TGn}function P1(e){return e.kind==="exp"?e.exp.id:e.id}function fv(e){if(e.children.length===0)return gk(e);const n=e.children.reduce((t,r)=>t+fv(r),0)+_v*(e.children.length-1);return Math.max(gk(e),n)}function OGn(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const DGn=A.memo(function({data:n}){pf();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:c,onOpenView:u,onOpenCode:h}=n,_=r?Zi(r):void 0,p=_==="running"||_==="starting"||_==="cancelling",m=i?Mhn():p?apn():Vc(),x=s.slice(-8),k=A.useRef(null),v=CGn(k,n);return f.jsxs("div",{ref:k,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.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-start [&_.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-xs [&_.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]: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-xs [&_.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-sm [&_.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]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${p?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[f.jsx(Au,{type:"target",position:Rt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Ur(b=>u(t.id,"overview",b)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:m}),f.jsx(al,{status:_??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:x0n()}),x.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:x.map(b=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${OGn(Zi(b))}`,title:d6(Zi(b))},b.id))}):f.jsx("span",{children:e0n()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:co(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:o0n(),...Ur(b=>u(t.id,"terminal",b)),children:[f.jsx(lo,{size:13}),DL()]}),f.jsxs("button",{className:"node-action",title:gD({branch:Ne(t.branchName)}),...Ur(b=>h(t.id,t.branchName,"files",b)),children:[f.jsx(Ib,{size:13}),Npn()]}),o&&c&&f.jsx("a",{className:"node-action node-action-ext",title:Cv({name:Ne(t.branchName)}),"aria-label":Cv({name:Ne(t.branchName)}),href:Mb(o,c,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:f.jsx(qb,{size:13})})]}),f.jsx(Au,{type:"source",position:Rt.Bottom}),v.rect&&f.jsx(NGn,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:v.rect,onOpenLogs:s.length>0?b=>u(t.id,"terminal",b):void 0,onOpenCode:b=>h(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),LGn=A.memo(function({data:n}){pf();const{count:t,onShowProjectScope:r}=n;return f.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-hover-faint text-muted text-sm font-medium text-start 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:z0n(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(Au,{type:"target",position:Rt.Top}),f.jsx(pS,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?Jhn():Vhn({count:Xt(t)}),f.jsx("span",{className:"elided-node-sub",children:h0n()})]}),f.jsx(Au,{type:"source",position:Rt.Bottom})]})}),IGn={exp:DGn,elided:LGn},eG={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},$Gn={...eG.style,strokeDasharray:"4 4"};function BGn({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:a,viewport:o,onViewportChange:c}){const{nodes:u,edges:h}=A.useMemo(()=>{const _=new Map;for(const y of n){const C=_.get(y.experimentId);C?C.push(y):_.set(y.experimentId,[y])}for(const y of _.values())y.sort((C,N)=>C.createdAt-N.createdAt);const p=[],m=[],x=y=>!i||y.exp.chatSessionId===i,k=MGn(RGn(e),x),v=new Map(e.map(y=>[y.id,y.slug]));function b(y,C,N){const z=C-gk(y)/2;if(y.kind==="exp"){const M=_.get(y.exp.id)??[];p.push({id:y.exp.id,type:"exp",position:{x:z,y:N},data:{exp:y.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!y.exp.parentExperimentId,parentSlug:y.exp.parentExperimentId?v.get(y.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else p.push({id:y.id,type:"elided",position:{x:z,y:N+(XM-AGn)/2},data:{count:y.count,onShowProjectScope:a}});if(y.children.length===0)return;const T=y.children.reduce((M,D)=>M+fv(D),0)+_v*(y.children.length-1);let j=C-T/2;for(const M of y.children){const D=fv(M),I=y.kind==="elided"||M.kind==="elided";m.push({id:`e-${P1(y)}-${P1(M)}`,source:P1(y),target:P1(M),...I?{style:$Gn}:{}}),b(M,j+D/2,N+XM+jGn),j+=D+_v}}let w=0;for(const y of k){const C=fv(y);b(y,w+C/2,0),w+=C+_v}return{nodes:p,edges:m}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,a]);return e.length===0?f.jsxs("div",{className:QM,children:[f.jsx("p",{className:"empty-state-title",children:Kpn()}),f.jsx("p",{className:"empty-state-hint",children:ypn()})]}):u.length===0&&i?f.jsxs("div",{className:QM,children:[f.jsx("p",{className:"empty-state-title",children:Ppn()}),f.jsx("p",{className:"empty-state-hint",children:dpn()})]}):f.jsx(KUn,{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:u,edges:h,nodeTypes:IGn,defaultEdgeOptions:eG,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:SGn,onMoveEnd:(_,p)=>{_&&c(p)},minZoom:.15,defaultViewport:o??void 0,fitView:o===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(ZUn,{variant:cl.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const e0=["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-sm [&_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(" ");function PGn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function FGn(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),c=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/")||C6(i))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[x,k]=[m(i),m(p)];return x===k?"":x.startsWith(`${k}/`)?x.slice(k.length).replace(/^\/+/,""):null},h=i.startsWith("/")&&c?u(c):null,_=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(h!==null)return h?{path:h,source:"artifacts"}:null;if(_!==null)i=_;else{const p=s?PGn(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),x=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),k=m||x?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};x?(a=x[1],i=x[2]):k&&(i=k[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function HGn(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const qGn=10,YM=1448,UGn=80,GGn=48;function ZM(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function JM(e){const n=A.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function VGn({runtime:e,projectId:n,pane:t}){var te,ve,ze;const r=an({mutationFn:Bvn}),s=di(),i=lD({select:X=>X.location}),a=J_(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",c=A.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:c.current;(a==null?void 0:a.kind)==="task"&&(c.current=u);const h=t!==void 0,_=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=A.useState(null),[x,k]=A.useState(0),v=A.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==x)&&(v.current={href:i.href,jump:x,value:v.current.value+1});const b=A.useMemo(()=>{const X=t?Ja(t):"experiments";return typeof X=="object"&&"path"in X&&X.line&&p!==v.current.value?{...X,lineScrollRequest:v.current.value}:X},[t,p,i.href,x]),w=ct(La(n)),y=A.useMemo(()=>{var X;return((X=w.data)==null?void 0:X.map(ae=>ae.id))??null},[w.data]),C=A.useRef(new Set),N=A.useRef(new Set),z=A.useRef({}),[T,j]=A.useState(0),M=A.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const D=A.useCallback((X,ae=!1)=>{const xe=M.current;xe.projectId&&s.navigate({href:X1(xe.projectId,xe.activeSessionId,X),replace:ae})},[s]),I=A.useCallback(X=>{const ae=tl(X);D(ae.kind==="file"?{...ae,line:void 0}:ae)},[D]),$=A.useCallback(()=>D(void 0),[D]),q=A.useCallback(X=>{(t==null?void 0:t.kind)==="experiment"&&D({...t,runId:X??void 0})},[t,D]),H=A.useCallback(X=>{s.navigate({href:X?`/projects/${encodeURIComponent(X)}`:"/projects"})},[s]),Q=A.useCallback(X=>{var ae;if(n)if(X==="chat"){const xe=c.current;s.navigate({href:X1(n,xe,(ae=yu(Ga.current,xe??"new"))==null?void 0:ae.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${X==="skills"?"skills":`settings/${X}`}`})},[s,n]),V=pf(),{status:J}=l6(e.kind==="local"),Z=A.useMemo(()=>dh(),[n]),B=ct(Z),L=B.data??null,F=A.useCallback(X=>{Jr(Z.queryKey,ae=>(typeof X=="function"?X(ae??null):X)??void 0)},[Z]),U=A.useMemo(()=>Cm(),[n]),K=ct(U),ne=K.data??null,ce=A.useCallback(X=>{Jr(U.queryKey,ae=>(typeof X=="function"?X(ae??null):X)??void 0)},[U]),_e=A.useRef(void 0);_e.current=ne==null?void 0:ne.tourCompleted;const se=[!w.data&&w.error?kD():null,!B.data&&B.error?_0():null,!K.data&&K.error?__e():null].filter(X=>X!==null),G=se.length?v_e({items:new Intl.ListFormat(V).format(se)}):null,oe=A.useRef(null),le=ct(M3(n)),pe=le.data??[],be=!le.isPending,[Me,Le]=A.useState(!1),je=ct(mu(n)).data??[],we=A.useRef(je);we.current=je;const rt=A.useRef(new Map),Ze=A.useRef(new Set),at=A.useRef(null),St=A.useRef(!1),Ft=A.useRef(new Map),ut=A.useRef(new Map),dt=A.useRef(0),Ie=A.useRef(pe);Ie.current=pe;const Ae=ct(dSn(n)).data??null,[Pe,nt]=A.useState("table"),[_t,pt]=A.useState("project"),yt=A.useRef(null),{open:Zt,setOpen:nn,ref:jt}=_o(yt),[mt,ft]=A.useState(!1),en=pe.every(X=>X.chatSessionId),An=u&&en?_t:"project",xr=A.useMemo(()=>An!=="agent"?pe:pe.filter(X=>X.chatSessionId===u),[pe,An,u]),kn=A.useMemo(()=>{if(An!=="agent")return je;const X=new Set(xr.map(ae=>ae.id));return je.filter(ae=>X.has(ae.experimentId))},[je,xr,An]),[Ln,Un]=A.useState([]),[dr,es]=A.useState(!1),[Ct,on]=A.useState(!1),[cn,fn]=A.useState(!1),[wr,un]=A.useState(!1),[dn,Tn]=A.useState(null),[wt,Mt]=A.useState([]),[zn,hr]=A.useState([]),Hn=A.useRef(new Map),hn=A.useRef(new Map),Tr=X=>{let ae=hn.current.get(X);return ae||(ae=new KIn,hn.current.set(X,ae)),ae},[Ar,Rn]=A.useState([]),[Ge,kt]=A.useState([]),[pr,Gn]=A.useState([]),[pn,ts]=A.useState([]),[rr,_a]=A.useState(null),[Vr,sr]=A.useState("files"),[ho,po]=A.useState(new Set),[Vn,Kr]=A.useState(!1),[mo,go]=A.useState(null),[Zs,vo]=A.useState(u$),[Vt,Fa]=A.useState(()=>window.innerWidth>=YM),Kn=o==="chat"&&!h&&Vt,[Wr,st]=A.useState(!0),[Wt,Es]=A.useState(!1),Js=A.useRef(NS()),mi=A.useRef(u);mi.current=u;const Wn=A.useRef(Ln);Wn.current=Ln;const mr=A.useRef(pn);mr.current=pn;const Is=A.useRef(null),$s=A.useCallback(X=>{const ae=[...X];mr.current=ae,ts(ae)},[]),Lr=A.useCallback(X=>{Is.current=X,_a(X)},[]),gi=A.useCallback(X=>{const ae=Ot(X);Mt(Se=>Hp(Se,ae)),hr(Se=>Hp(Se,ae)),Rn(Se=>Hp(Se,ae)),kt(Se=>Hp(Se,ae)),Gn(Se=>Hp(Se,ae));const xe=Ps.current;if(xe&&"path"in X){const Se=Ls(xe,mi.current,X);Hn.current.delete(Se),hn.current.delete(Se),N.current.delete(Se),C.current.delete(Se)}const Re=Wn.current.filter(Se=>Ot(Se)!==ae);Wn.current=Re,Un(Re)},[]),gr=A.useCallback(X=>{const ae=Ot(X),xe=[...Wn.current.filter(Re=>Ot(Re)!==ae),c1(X)];Wn.current=xe,Un(xe),I(X)},[I]),Ns=A.useCallback((X,ae,xe)=>{const Re=Ot(X),Se=Is.current,He=JMn({order:mr.current,previewKey:Se?Ot(Se):null},Re,ae);He.replacedKey&&Se&&typeof Se!="string"&&Ot(Se)===He.replacedKey&&gi(Se),$s(He.order),He.previewKey===null?Lr(null):He.previewKey===Re&&Lr(c1(X));const We=[...Wn.current.filter(Lt=>Ot(Lt)!==Re),c1(X)];Wn.current=We,Un(We),D(tl(X,xe))},[gi,$s,Lr,D]),Bt=A.useCallback(X=>{const ae=Is.current;ae&&Ot(ae)===Ot(X)&&Lr(null)},[Lr]);A.useEffect(()=>{let X=!1;const ae=Re=>{const Se=Is.current,He=Re.target;if(He instanceof Element&&He.closest("input, textarea, [contenteditable='true']")!==null){X=!1;return}if(Se&&Ot(Se)===Ot(Js.current.rightTab)&&(Re.metaKey||Re.ctrlKey)&&!Re.altKey&&!Re.shiftKey&&Re.key.toLowerCase()==="k"){Re.preventDefault(),X=!0;return}if(X&&Re.key==="Enter"){Re.preventDefault(),X=!1;const Lt=Is.current;Lt&&Bt(Lt);return}X=!1},xe=()=>{X=!1};return window.addEventListener("keydown",ae),window.addEventListener("blur",xe),window.addEventListener("pointerdown",xe),()=>{window.removeEventListener("keydown",ae),window.removeEventListener("blur",xe),window.removeEventListener("pointerdown",xe)}},[Bt]);const zs=A.useCallback((X,ae)=>{const xe=Ot(X),Re=Is.current;Re&&Ot(Re)===xe&&Lr(null);const Se=eOn({order:mr.current,previewKey:Re?Ot(Re):null},xe,Wn.current.map(Ot));$s(Se.order);const He=Wn.current.filter(Lt=>Ot(Lt)!==xe);if(Wn.current=He,Un(He),!ae)return;const We=Se.fallbackKey?He.find(Lt=>Ot(Lt)===Se.fallbackKey):void 0;We?I(We):($(),Kr(!1))},[$s,Lr,I,$]),Ha=Q,js=A.useMemo(()=>({rightTab:c1(b),tabHistory:Ln,experimentsTabOpen:dr,filesTabOpen:Ct,artifactsTabOpen:cn,terminalTabOpen:wr,expTabs:wt,fileTabs:zn,planTabs:Ar,subagentTabs:Ge,codeTabs:pr,contentTabOrder:mr.current,previewTab:Is.current,filesView:Vr,filesToggled:ho,selectedRunId:_,scope:_t,panelOpen:h,panelMax:Vn,treeViewport:mo}),[b,Ln,dr,Ct,cn,wr,wt,zn,Ar,Ge,pr,pn,rr,Vr,ho,_,_t,h,Vn,mo]);Js.current=js;const qa=A.useCallback(()=>Object.fromEntries(Hn.current),[]),$u=A.useRef(void 0),Bu=A.useCallback(()=>{clearTimeout($u.current),$u.current=setTimeout(()=>j(X=>X+1),200)},[]);A.useEffect(()=>()=>clearTimeout($u.current),[]);const bo=A.useCallback((X,ae,xe)=>{if(Un(X.tabHistory),Wn.current=X.tabHistory,es(X.experimentsTabOpen),on(X.filesTabOpen),fn(X.artifactsTabOpen),un(X.terminalTabOpen),Mt(X.expTabs),hr(X.fileTabs),Rn(Se=>Se===X.planTabs?Se:X.planTabs.map(He=>{var We;return{...He,plan:((We=Se.find(Lt=>Lt.sessionId===He.sessionId&&Lt.promptId===He.promptId))==null?void 0:We.plan)??""}})),kt(X.subagentTabs),Gn(X.codeTabs),$s(X.contentTabOrder),Lr(X.previewTab),sr(X.filesView),po(X.filesToggled),pt(X.scope),Kr(X.panelMax),go(X.treeViewport),ft(M.current.activeSessionId===Ld&&X.fileTabs.some(Se=>__(Se,{path:rw,source:"artifacts"}))),xe){for(const[Se,He]of Object.entries((ae==null?void 0:ae.scroll)??{}))Hn.current.set(Se,He);Object.assign(z.current,ae==null?void 0:ae.sourceModes)}const Re=M.current;if(Re.projectId)for(const Se of X.fileTabs){const He=Ls(Re.projectId,Re.activeSessionId,Se);N.current.has(He)||C.current.add(He)}},[$s,Lr]),{ready:Ir,loaded:Pu,error:yo,retry:fa,capture:Ua,workspace:Ga}=y5n({projectId:ne&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",firstDemoOpen:(ne==null?void 0:ne.tourCompleted)===!1,state:js,apply:bo,getScroll:qa,sourceModes:z.current,revision:T}),bl=A.useRef(null);A.useLayoutEffect(()=>{if(!Ir||!be||(a==null?void 0:a.kind)!=="task")return;const X=bl.current;(X==null?void 0:X.projectId)===n&&X.taskId===u&&X.scope!==An&&go(null),bl.current={projectId:n,taskId:u,scope:An}},[Ir,be,a==null?void 0:a.kind,n,u,An]);const Fu=A.useCallback((X,ae)=>{var Lt;const xe=(ae==null?void 0:ae.projectId)??n;if(!xe)return;const Re=xe===n;X&&Re&&ae!=null&&ae.replace&&u===null&&(Ua(),v5n(xe,X));const Se=yu(a$(xe),X??"new"),He=Se?Se.active:Uc(xe)?(Lt=zS(X??void 0,_e.current===!1))==null?void 0:Lt.active:void 0,We=Re&&(ae!=null&&ae.replace)&&X&&u===null?M.current.pane:He;s.navigate({href:X1(xe,X,We),replace:Re&&(ae==null?void 0:ae.replace)})},[s,n,u,Ua]);A.useEffect(()=>{Ir&&(a==null?void 0:a.kind)!=="task"&&!c.current&&Ga.current.lastTaskId&&(y!=null&&y.includes(Ga.current.lastTaskId))&&(c.current=Ga.current.lastTaskId,j(X=>X+1))},[Ir,a==null?void 0:a.kind,Ga,y]),cQ({shouldBlockFn:({next:X})=>{var ae;return((ae=J_(X.pathname))==null?void 0:ae.projectId)!==n&&[...hn.current.values()].some(xe=>xe.needsProtection)&&!BR(IN())},enableBeforeUnload:()=>[...hn.current.values()].some(X=>X.needsProtection)});const Bs=A.useRef(null);A.useEffect(()=>{const X=$b(i.href);!ne||!Ir||!X||(Fb.queue({lastLocation:X,railOpen:Wr,panelWidth:Zs,experimentsView:Pe},Bs.current===X?250:0),Bs.current=X)},[i.href,ne,Ir,Wr,Zs,Pe]);const ds=(ne==null?void 0:ne.onboardingCompleted)??!1,[uc,da]=A.useState(!1),[fr,_c]=A.useState(null),[ir,Ef]=A.useState(0),xo=A.useCallback(()=>da(!0),[]),wo=A.useCallback(async X=>{const ae=_e.current===!1,xe=await r.mutateAsync({tourCompleted:!0});ae&&ru({name:"demo_welcome_choice",choice:X}),ce(Re=>Re&&{...Re,tourCompleted:xe.tourCompleted}),da(!1),X==="explore_demo"&&Ef(Re=>Re+1)},[]),Di=A.useCallback(async()=>{await wo("create_project"),Es(!0)},[wo]);A.useEffect(()=>{!n||!Uc(n)||!ds||ne!=null&&ne.tourCompleted||xo()},[n,ds,xo,ne==null?void 0:ne.tourCompleted]);const Ht=(L==null?void 0:L.find(X=>X.id===n))??null;A.useEffect(()=>{const X=G||ne===null?null:Ht==null?void 0:Ht.name;document.title=X?`${Wi(X)} — OpenResearch`:"OpenResearch"},[G,ne,Ht]);const Ps=A.useRef(n);Ps.current=n;const ei=A.useCallback(X=>{n&&ru({name:"first_action",surface:Uc(n)?"demo":"project",action:X})},[n]);A.useEffect(()=>{o!=="chat"&&o!=="skills"&&ei("open_settings")},[o,ei]);const ha=A.useCallback((X=!1)=>{X&&(!M.current.isTask||M.current.pane)||(ei("open_experiment"),es(!0),D({kind:"home",view:"experiments"},X))},[D,ei]),Nf=()=>{B.refetch(),K.refetch(),w.refetch()},fc=A.useRef(!1);A.useEffect(()=>{if(!ne||fc.current)return;fc.current=!0,oe.current=ne.preferredAgent;const X=CS()??ne.workspace;X&&(st(X.railOpen),vo(Math.min(X.panelWidth,s0())),nt(X.experimentsView))},[ne]),A.useEffect(()=>{y&&c.current&&!y.includes(c.current)&&(c.current=null)},[y]);const dc=A.useRef(Promise.resolve()),Li=A.useRef(0),ar=A.useCallback(X=>{const ae=++Li.current;ce(Re=>Re&&{...Re,preferredAgent:X});const xe=dc.current.then(()=>r.mutateAsync({preferredAgent:X})).then(Re=>{oe.current=Re.preferredAgent,ae===Li.current&&ce(Se=>Se&&{...Se,preferredAgent:Re.preferredAgent})}).catch(Re=>{throw ae===Li.current&&ce(Se=>Se&&{...Se,preferredAgent:oe.current}),Re});return dc.current=xe.catch(()=>{}),xe},[]);A.useEffect(()=>{const X=()=>{vo(ae=>Math.min(ae,s0())),Fa(window.innerWidth>=YM)};return window.addEventListener("resize",X),()=>window.removeEventListener("resize",X)},[]);const hc=A.useCallback(X=>{St.current=!1,Ft.current.clear(),ut.current.clear();const ae=++dt.current;et.fetchQuery(mu(X)).then(xe=>{if(Ps.current!==X||at.current!==X||dt.current!==ae)return;Ft.current=new Map(xe.map(Se=>[Se.id,Se]));const Re=[...ut.current.values()].some(Se=>{const He=Ft.current.get(Se.id);return!He||He.status!=="running"&&He.updatedAt<=Se.updatedAt});ut.current.clear();for(const Se of xe){const He=rt.current.get(Se.id);(!He||He.updatedAt{var He;return xe.some(We=>We.id===Se&&We.status==="running")?Se:((He=xe.find(We=>We.status==="running"))==null?void 0:He.id)??null}),Re&&ha(!0)}).catch(()=>{dt.current===ae&&(ut.current.clear(),Le(!0))})},[ha]);A.useEffect(()=>{if(n)return at.current=n,rt.current.clear(),Ze.current.clear(),Yvn(n).catch(()=>{}),hc(n),()=>{dt.current++}},[hc,n]);const Ts=A.useCallback(()=>{fn(!0),gr("artifacts")},[gr]),vi=A.useCallback(()=>{un(!0),gr("terminal")},[gr]),Fs=u??(n?`project:${n}`:null);A.useEffect(()=>{Tn(h?b==="terminal"?Fs:X=>X===Fs?X:null:null)},[h,b,Fs]),Qxn({onReconnect:()=>{const X=Ps.current;X&&(at.current=X,rt.current.clear(),Ze.current.clear(),hc(X))},onRun:X=>{if(X.projectId!==Ps.current||X.projectId!==at.current)return;const ae=rt.current.get(X.id),xe=Ze.current.has(X.id);if(ae&&ae.updatedAt>X.updatedAt||(rt.current.set(X.id,X),Ze.current.add(X.id),Uc(X.projectId)&&_c(He=>X.status==="running"?He??X.id:He===X.id?null:He),X.status!=="running"||(ae==null?void 0:ae.status)==="running"))return;const Re=Ft.current.get(X.id),Se=St.current&&(!Re||Re.status!=="running"&&Re.updatedAt<=X.updatedAt);xe&&ae||Se?ha(!0):St.current||ut.current.set(X.id,X)}});const yl=A.useCallback(()=>pt("project"),[]),Ii=A.useCallback((X,ae="overview",xe="preview",Re)=>{ei("open_experiment");const Se={id:X,view:ae};Mt(He=>He.some(We=>uw(We,Se))?He:[...He,Se]),Ns(Se,xe,Re)},[Ns]),$i=A.useCallback((X,ae="preview")=>{const xe=we.current.filter(Se=>Se.id===X||Se.id.startsWith(X)),Re=xe.length===1?xe[0]:null;Re&&Ii(Re.experimentId,"terminal",ae,Re.id)},[Ii]),zf=A.useMemo(()=>new Map(pe.map(X=>{var ae;return[X.id,((ae=X.title)==null?void 0:ae.trim())||X.slug||Vc()]})),[pe,V]),ko=JM(zf),Wh=A.useMemo(()=>{const X=new Map;for(const ae of je)X.set(ae.id,ko.get(ae.experimentId)??Vc());return X},[ko,je,V]),pc=JM(Wh),mc=A.useCallback(X=>{const ae=pc.get(X);if(ae)return ae;const xe=[...pc].filter(([Re])=>Re.startsWith(X));return xe.length===1?xe[0][1]:""},[pc]),jf=A.useCallback(X=>{const ae=ko.get(X);if(ae)return ae;const xe=[...ko].filter(([Re])=>Re.startsWith(X));return xe.length===1?xe[0][1]:""},[ko]),Tf=A.useCallback((X,ae="preview")=>{const xe=Ie.current.filter(Re=>Re.id===X||Re.id.startsWith(X));xe.length===1&&Ii(xe[0].id,"overview",ae)},[Ii]),xl=A.useCallback(X=>{const ae=wt.findIndex(xe=>uw(xe,X));ae!==-1&&(Mt(xe=>xe.filter((Re,Se)=>Se!==ae)),zs(X,Ot(b)===Ot(X)))},[wt,zs,b]),ti=A.useCallback((X,ae="preview")=>{X.line!=null&&k(Se=>Se+1);const xe=Ps.current;if(xe){const Se=Ls(xe,mi.current,X);Js.current.fileTabs.some(He=>__(He,X))||C.current.delete(Se),N.current.add(Se)}const Re=s$(X);hr(Se=>{const He=Se.findIndex(Lt=>__(Lt,X));if(He===-1)return[...Se,Re];const We=Se.slice();return We[He]=Re,We}),Ns(X,ae)},[Ns]),wl=A.useCallback((X,ae,xe,Re,Se,He)=>{const We=L==null?void 0:L.find(kr=>kr.id===n),Lt=FGn(X,We==null?void 0:We.repoPath,ae,(We==null?void 0:We.artifactsDir)??(We==null?void 0:We.filesDir),We==null?void 0:We.slug);if(!Lt)return null;const Qn=Se?Ie.current.find(kr=>kr.id===Se||Se.length>=6&&kr.id.startsWith(Se)):void 0,Qr=xe??(Qn==null?void 0:Qn.branchName),Xr=Lt.source==null||Lt.source==="repo";return Qr&&Xr&&(Lt.ref=Qr),He&&!Lt.ref&&Xr&&(Lt.branchLabel=He),Re!=null&&(Lt.line=Re),Lt},[L,n]),So=A.useCallback((X,ae,xe,Re,Se,He,We="preview")=>{const Lt=wl(X,ae,xe,Re,Se,He);Lt&&ti(Lt,We)},[ti,wl]),Af=A.useCallback(X=>ti({path:X,source:"artifacts"},"keepOpen"),[ti]),gc=A.useCallback((X,ae,xe,Re,Se,He="preview")=>{const We=wl(X,ae,Se,xe,Re);We&&ti(We,He)},[ti,wl]),ni=A.useCallback((X,ae)=>{Bt(X),ae()},[Bt]),Qh=A.useCallback(X=>{var Re;const ae=zn.findIndex(Se=>__(Se,X));if(ae===-1)return;const xe=n?Ls(n,u,X):null;xe&&((Re=hn.current.get(xe))!=null&&Re.needsProtection)&&!BR(IN())||(hr(Se=>Se.filter((He,We)=>We!==ae)),xe&&(Hn.current.delete(xe),hn.current.delete(xe),N.current.delete(xe),C.current.delete(xe),delete z.current[xe]),u===Ld&&__(X,{path:rw,source:"artifacts"})&&ft(!1),zs(X,Ot(b)===Ot(X)))},[u,zn,zs,n,b]),Rf=A.useCallback(X=>{X.lineScrollRequest!==void 0&&m(X.lineScrollRequest)},[]),Xh=A.useCallback((X,ae,xe,Re="preview")=>{const Se={kind:"plan",sessionId:ae,promptId:xe,plan:X};Rn(He=>{const We=He.findIndex(Qn=>Qn.promptId===xe);if(We===-1)return[...He,Se];const Lt=He.slice();return Lt[We]=Se,Lt}),Ns(Se,Re)},[Ns]),Mf=A.useCallback(X=>{const ae=Ar.findIndex(xe=>xe.promptId===X.promptId);ae!==-1&&(Rn(xe=>xe.filter((Re,Se)=>Se!==ae)),zs(X,Ot(b)===Ot(X)))},[zs,Ar,b]),kl=A.useCallback((X,ae,xe,Re="preview")=>{const Se={kind:"subagent",sessionId:X,spawnPartId:ae,label:xe};kt(He=>He.some(We=>We.spawnPartId===ae)?He:[...He,Se]),Ns(Se,Re)},[Ns]),Yh=A.useCallback(X=>{const ae=Ge.findIndex(xe=>xe.spawnPartId===X.spawnPartId);ae!==-1&&(kt(xe=>xe.filter((Re,Se)=>Se!==ae)),zs(X,Ot(b)===Ot(X)))},[zs,b,Ge]),[pa,Of]=A.useState({});A.useEffect(()=>{if(Of(We=>{const Lt=new Set(Ge.map(Qn=>Qn.spawnPartId));return Object.keys(We).every(Qn=>Lt.has(Qn))?We:Object.fromEntries(Object.entries(We).filter(([Qn])=>Lt.has(Qn)))}),Ge.length===0)return;let X=!0;const ae=new Set,xe=(We,Lt,Qn)=>{Of(Qr=>{var kr;let Xr=Qr;for(const ri of Lt)if(!(Qn&&ae.has(ri.spawnPartId)))for(const Xn of We){const va=cb(Xn.parts,ri.spawnPartId);if(!va)continue;Qn||ae.add(ri.spawnPartId);const xc={label:MLn(va),running:((kr=va.state)==null?void 0:kr.status)==="running"},ba=Xr[ri.spawnPartId];(!ba||ba.label!==xc.label||ba.running!==xc.running)&&(Xr===Qr&&(Xr={...Qr}),Xr[ri.spawnPartId]=xc);break}return Xr})};let Re=0;const Se=()=>{const We=++Re;for(const Lt of new Set(Ge.map(Qn=>Qn.sessionId)))et.fetchQuery({...il(Lt),staleTime:0}).then(({messages:Qn})=>{X&&We===Re&&xe(Qn,Ge.filter(Qr=>Qr.sessionId===Lt),!0)}).catch(()=>{})};Se();const He=Ov(We=>{if(We.type==="reconnected"){ae.clear(),Se();return}if(We.type!=="message")return;const Lt=Ge.filter(Qn=>Qn.sessionId===We.sessionId);Lt.length&&xe([We.message],Lt,!1)});return()=>{X=!1,He()}},[Ge]);const Co=A.useCallback((X,ae,xe="files",Re="preview")=>{const Se={code:!0,experimentId:X,branch:ae,view:xe,toggled:new Set};Gn(He=>He.some(We=>fd(We,Se))?He.map(We=>fd(We,Se)?{...We,experimentId:X,view:xe}:We):[...He,Se]),Ns(Se,Re)},[Ns]),ma=A.useCallback((X,ae)=>{Gn(xe=>xe.map(Re=>fd(Re,X)?{...Re,...ae}:Re)),ae.view&&D(tl({...X,...ae}))},[]),Zh=A.useCallback(X=>{const ae=pr.findIndex(xe=>fd(xe,X));ae!==-1&&(Gn(xe=>xe.filter((Re,Se)=>Se!==ae)),zs(X,Ot(b)===Ot(X)))},[pr,zs,b]),Sl=A.useCallback(()=>{on(!0),gr("files")},[gr]),Eo=A.useCallback(X=>{X==="experiments"?es(!1):X==="files"?on(!1):X==="terminal"?(un(!1),Tn(null)):fn(!1),zs(X,b===X)},[zs,b]),Df=X=>{X.preventDefault(),X.currentTarget.setPointerCapture(X.pointerId);const xe=document.body.style.userSelect;document.body.style.userSelect="none";const Re=Vn,Se=X.clientX,He=Zs;let We=!1;function Lt(){window.removeEventListener("pointermove",Qn),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),document.body.style.userSelect=xe}function Qn(Qr){if(Re){const Xn=Qr.clientX-Se;if(We||Xnkr+UGn){Kr(!0);return}Kr(!1);const ri=Math.min(Math.max(Xr,Bv),kr);vo(ri)}window.addEventListener("pointermove",Qn),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)},Lf=(X,ae)=>{F(xe=>xe?ZM(xe,X):[X]),s.navigate({href:`/projects/${encodeURIComponent(X.id)}${ae?"/settings/git":""}`}),ae&&bn(ae,"error")},As=typeof b=="object"&&"id"in b?b:null,mn=typeof b=="object"&&"path"in b?b:null,Hu=(mn==null?void 0:mn.source)==="artifacts"&&Ae?W0(Ae.entries,mn.path):null,qu=Hu?`${Hu.modifiedAt}:${Hu.size}`:null,Cl=u===Ld&&mt?zn.find(X=>__(X,{path:rw,source:"artifacts"})):void 0,If=Cl?[Cl]:[],hs=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,ws=hs==null?void 0:hs.sessionId,bi=hs==null?void 0:hs.promptId,Uu=!!(ws&&bi&&(y!=null&&y.includes(ws))),No=ct({...il(ws??""),enabled:Uu,subscribed:Uu}),vc=A.useMemo(()=>{var ae;if(!ws||!bi||!No.data)return null;const X=No.data.messages.flatMap(xe=>{const Re=cb(xe.parts,bi);return Re?[Re]:[]})[0];return{key:`${ws}:${bi}`,text:((ae=X==null?void 0:X.prompt)==null?void 0:ae.plan)??null}},[ws,bi,No.data]),ns=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,bc=typeof b=="object"&&"code"in b?b:null,rs=bc?pr.find(X=>fd(X,bc))??null:null,Gu=new Map;for(const X of[...wt,...zn,...Ar,...Ge,...pr])Gu.set(Ot(X),X);const Vu=Cl?Ot(Cl):null,Ku=pn.filter(X=>X!==Vu).map(X=>Gu.get(X)).filter(p5n),zo=X=>rr!==null&&Ot(rr)===Ot(X),Wu=X=>f.jsx(Fc,{active:mn!==null&&__(mn,X),label:X.path.split("/").pop()||X.path,icon:f.jsx(PI,{size:12,className:"shrink-0"}),preview:zo(X),onSelect:()=>gr(X),onPromote:()=>Bt(X),onClose:()=>Qh(X)},`file:${ES(X)}`),ga=As?pe.find(X=>X.id===As.id)??null:null,yc=rs?pe.find(X=>X.id===rs.experimentId&&X.branchName===rs.branch)??null:null,$f=X=>{var xe,Re;if("path"in X)return Wu(X);if("id"in X){const Se=pe.find(He=>He.id===X.id);return f.jsx(Fc,{active:As!==null&&uw(As,X),label:Se?Se.title||Se.slug:"…",icon:X.view==="overview"?f.jsx(r4n,{size:12,className:"shrink-0"}):f.jsx(lo,{size:12,className:"shrink-0"}),preview:zo(X),onSelect:()=>gr(X),onPromote:()=>Bt(X),onClose:()=>xl(X)},Ot(X))}if("kind"in X&&X.kind==="plan")return f.jsx(Fc,{active:hs!==null&&hs.promptId===X.promptId,label:jD(),icon:f.jsx(bS,{size:12,className:"shrink-0"}),preview:zo(X),onSelect:()=>gr(X),onPromote:()=>Bt(X),onClose:()=>Mf(X)},Ot(X));if("kind"in X)return f.jsx(Fc,{active:ns!==null&&ns.spawnPartId===X.spawnPartId,label:((xe=pa[X.spawnPartId])==null?void 0:xe.label)??X.label??C_e(),shimmer:((Re=pa[X.spawnPartId])==null?void 0:Re.running)??!1,icon:f.jsx(wS,{size:12,className:"shrink-0"}),preview:zo(X),onSelect:()=>gr(X),onPromote:()=>Bt(X),onClose:()=>Yh(X)},Ot(X));const ae=pe.find(Se=>Se.id===X.experimentId);return f.jsx(Fc,{active:rs!==null&&fd(rs,X),label:(ae==null?void 0:ae.slug)??X.branch,icon:f.jsx(Su,{size:12,className:"shrink-0"}),preview:zo(X),onSelect:()=>gr(X),onPromote:()=>Bt(X),onClose:()=>Zh(X)},Ot(X))};if(!a||a.kind==="resume")return null;if(G)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:e0,children:[f.jsx("p",{children:G}),f.jsx(De,{variant:"primary",onClick:Nf,children:Qs()})]}),e.kind==="ssh"&&f.jsx(q3,{runtime:e,corner:!0})]});if(L&&!Ht)return f.jsxs("div",{className:e0,children:[ro(),f.jsx(De,{onClick:()=>H(null),children:_0()})]});if(yo&&!Ir)return f.jsxs("div",{className:e0,children:[f.jsx("p",{role:"alert",children:yo}),f.jsx(De,{onClick:fa,children:Qs()})]});if(L===null||ne===null||!Pu||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:e0,children:f.jsx(Nt,{})}),e.kind==="ssh"&&f.jsx(q3,{runtime:e,corner:!0})]});if(!Ht||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:e0,children:[ro(),f.jsx(De,{onClick:()=>H(null),children:_0()})]});const ks=f.jsx(h$n,{projectName:((te=L.find(X=>X.id===n))==null?void 0:te.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Es(!0),onRepository:()=>Ha("git"),onCollapse:()=>st(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(h$,{}),e.kind==="local"&&f.jsx(U$,{status:J}),yo&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:yo}),f.jsx(De,{onClick:fa,children:Qs()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Kn?"workspace-card-visible":""}`,children:[n&&f.jsx(KLn,{projectId:n,projectName:(Ht==null?void 0:Ht.name)??"",railHeader:ks,railOpen:Wr,onShowRail:()=>st(!0),mainView:o,onSelectMainView:Ha,onOpenFile:gc,onOpenRun:$i,runExperimentName:mc,onOpenExperiment:Tf,experimentName:jf,onOpenPlan:Xh,onOpenSubagent:kl,composerFocusNonce:ir,demoRunningRunId:fr,runtime:e,onOpenDemoWelcome:Ht&&Uc(Ht.id)?xo:void 0,activeSessionId:u,onActiveSessionChange:Fu,preferredAgent:ne.preferredAgent,onPreferredAgentChange:ar,children:o==="skills"?f.jsx(IIn,{}):o!=="chat"?f.jsx(lDn,{remote:e.kind==="ssh",tab:o,project:Ht,onProjectUpdate:X=>{F(ae=>ae?ZM(ae,X):[X])},onSelectTab:Ha}):null}),o==="chat"&&f.jsx(L7n,{expanded:Kn,experiments:pe,runs:je,onOpenExperiment:(X,ae)=>Ii(X,"overview","preview",ae),rightOffset:h?Zs+28:void 0,activeView:h&&(b==="files"||b==="artifacts"||b==="experiments"||b==="terminal")?b:null,projectId:Ht.id,onCompute:()=>Ha("compute"),sessionId:u,busy:((ve=w.data)==null?void 0:ve.some(X=>X.id===u&&X.busy))??!1,onChanges:()=>{sr("changes"),Sl()},onFiles:()=>{sr("files"),Sl()},onTerminal:vi,onArtifacts:Ts,onExperiments:()=>ha()}),o==="chat"&&h&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Vn?"max":""}`,style:Vn?void 0:{width:Zs},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Vn?"cursor-e-resize":"cursor-col-resize"}`,title:Vn?xle():hle(),onPointerDown:Df}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.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:[If.map(Wu),Ct&&f.jsx(Fc,{active:b==="files",label:a3(),icon:f.jsx(Su,{size:12,className:"shrink-0"}),onSelect:()=>gr("files"),onClose:()=>Eo("files")}),wr&&f.jsx(Fc,{active:b==="terminal",label:Tv(),icon:f.jsx(lo,{size:12,className:"shrink-0"}),onSelect:()=>gr("terminal"),onClose:()=>Eo("terminal")}),cn&&f.jsx(Fc,{active:b==="artifacts",label:yD(),icon:f.jsx(gS,{size:12,className:"shrink-0"}),onSelect:()=>gr("artifacts"),onClose:()=>Eo("artifacts")}),dr&&f.jsx(Fc,{active:b==="experiments",label:xD(),icon:f.jsx(mh,{size:12,className:"shrink-0"}),onSelect:()=>gr("experiments"),onClose:()=>Eo("experiments")}),Ku.map($f)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx($t,{title:Vn?QE():WE(),"aria-label":Vn?QE():WE(),onClick:()=>Kr(X=>!X),children:Vn?f.jsx(c3n,{size:14}):f.jsx(i3n,{size:14})}),f.jsx($t,{title:T0(),"aria-label":T0(),onClick:()=>{$(),Kr(!1)},children:f.jsx(lr,{size:14})})]})]}),b==="terminal"&&wr?null:!Ir||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!be||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Me?f.jsx(Aa,{children:f.jsx(Nt,{})}):As&&(!ga||_&&!je.some(X=>X.id===_&&X.experimentId===As.id))||bc&&!yc||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Aa,{children:f.jsx("div",{className:"p-6 text-subtext",children:ro()})}):b==="artifacts"?f.jsx(Aa,{children:Ht&&f.jsx(zIn,{project:Ht,artifacts:Ae,onOpenFile:Af,canRenameFile:X=>{var ae;return!((ae=hn.current.get(Ls(Ht.id,u,{path:X,source:"artifacts"})))!=null&&ae.needsProtection)}},Ht.id)}):b==="experiments"?f.jsxs(Aa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:jt,children:[f.jsx($t,{size:"small",ref:yt,className:"experiment-scope-trigger",active:An==="agent",title:Ple({scope:An==="agent"?VE():KE()}),"aria-label":fue(),"aria-expanded":Zt,onClick:()=>nn(X=>!X),children:f.jsx(B4n,{size:16,strokeWidth:2.5})}),Zt&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-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:[f.jsxs(Jn,{"aria-pressed":An==="agent",disabled:!u||!en,title:u?en?void 0:bue():Mue(),onClick:()=>{pt("agent"),nn(!1)},children:[f.jsx("span",{children:VE()}),An==="agent"&&f.jsx(Ri,{size:13})]}),f.jsxs(Jn,{"aria-pressed":An==="project",onClick:()=>{pt("project"),nn(!1)},children:[f.jsx("span",{children:KE()}),An==="project"&&f.jsx(Ri,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_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":Kle(),children:[f.jsx("button",{className:Pe==="table"?"active":"","aria-pressed":Pe==="table",onClick:()=>nt("table"),children:R_e()}),f.jsx("button",{className:Pe==="tree"?"active":"","aria-pressed":Pe==="tree",onClick:()=>nt("tree"),children:B_e()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:Pe==="tree"?Ht&&f.jsx(BGn,{experiments:pe,runs:kn,project:Ht,onOpenView:Ii,onOpenCode:Co,agentSessionId:An==="agent"?u:null,onShowProjectScope:yl,viewport:mo,onViewportChange:go}):f.jsx(p$n,{runs:kn,emptyHint:An==="agent"&&pe.length>0?Eue():void 0,experiments:xr,onOpen:(X,ae)=>{Ii(X.id,"overview",ae)},onOpenLogs:(X,ae,xe)=>{Ii(X,"terminal",xe,ae)},onOpenCode:(X,ae)=>{const xe=pe.find(Re=>Re.id===X);xe&&Co(xe.id,xe.branchName,"files",ae)},onCancel:FL})})]}):b==="files"?f.jsx(Aa,{children:Ht?f.jsx(_In,{sessionId:u??void 0,project:Ht,view:Vr,toggled:ho,onViewChange:sr,onToggledChange:po,canRenameFile:X=>{var ae;return!((ae=hn.current.get(Ls(Ht.id,u,{path:X,source:"repo",sessionId:u??void 0})))!=null&&ae.needsProtection)},onOpenFile:(X,ae,xe,Re)=>So(X,ae,xe,void 0,void 0,void 0,Re)},`files:${u??`project:${Ht.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(Hd,{children:f.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:[f.jsx(FI,{size:22}),f.jsx("p",{children:s_e()})]})})})}):mn?f.jsx(Aa,{children:n&&f.jsx(d$n,{remote:e.kind==="ssh",restored:C.current.has(Ls(n,u,mn)),onRestoreActivated:()=>{const X=Ls(n,u,mn);C.current.delete(X),N.current.add(X)},showSource:z.current[Ls(n,u,mn)]??!1,onShowSourceChange:X=>{z.current[Ls(n,u,mn)]=X,j(ae=>ae+1)},projectId:n,path:mn.path,source:mn.source,sessionId:mn.source==="artifacts"?u??void 0:mn.sessionId,gitRef:mn.ref,line:mn.line,branchLabel:HGn(mn,Ht==null?void 0:Ht.baselineBranch),artifactVersion:qu,artifactEntries:mn.source==="artifacts"?Ae==null?void 0:Ae.entries:void 0,bufferSession:Tr(Ls(n,u,mn)),onOpenFile:(X,ae,xe,Re)=>ni(mn,()=>So(X,ae,xe,void 0,void 0,void 0,Re)),scrollPosition:Hn.current.get(Ls(n,u,mn)),onScrollPositionChange:X=>{Hn.current.set(Ls(n,u,mn),X),Bu()},lineScrollRequest:mn.lineScrollRequest,onLineScrollRequestHandled:()=>Rf(mn),onEdit:()=>Bt(mn)},Ls(n,u,mn))}):hs?f.jsx(Aa,{children:f.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:f.jsx(Jo,{text:(vc==null?void 0:vc.key)===`${hs.sessionId}:${hs.promptId}`?vc.text??ro():((ze=Ar.find(X=>X.promptId===hs.promptId))==null?void 0:ze.plan)||wD(),onOpenFile:(X,ae,xe,Re,Se)=>ni(hs,()=>So(X,hs.sessionId,Re,ae,xe,void 0,Se))})})}):ns?f.jsx(XLn,{projectId:n,sessionId:ns.sessionId,spawnPartId:ns.spawnPartId,onOpenFile:(X,ae,xe,Re,Se)=>ni(ns,()=>gc(X,ns.sessionId,ae,xe,Re,Se)),onOpenRun:(X,ae)=>ni(ns,()=>$i(X,ae)),runExperimentName:mc,onOpenExperiment:(X,ae)=>ni(ns,()=>Tf(X,ae)),experimentName:jf,onOpenSubagent:(X,ae,xe)=>ni(ns,()=>kl(ns.sessionId,X,ae,xe))},ns.spawnPartId):rs?f.jsx(Aa,{children:n&&Ht&&rs&&yc&&f.jsx(uIn,{projectId:n,project:Ht,experiment:yc,view:rs.view,toggled:rs.toggled,onViewChange:X=>ma(rs,{view:X}),onToggledChange:X=>ma(rs,{toggled:X}),onOpenFile:(X,ae,xe,Re)=>ni(rs,()=>So(X,ae,xe,void 0,void 0,yc.branchName,Re))},`code:${rs.branch}`)}):f.jsx(Aa,{children:As&&ga&&Ht&&f.jsx(HIn,{experiment:ga,project:Ht,view:As.view,runs:je,selectedRunId:_,onSelectRun:q,parentExperiment:pe.find(X=>X.id===ga.parentExperimentId)??null,onOpenView:(X,ae,xe)=>{ni(As,()=>Ii(ga.id,X,xe,ae))},onOpenCode:(X,ae)=>ni(As,()=>Co(ga.id,ga.branchName,X,ae))},`${As.id}:${As.view}`)}),wr&&dn!==null&&dn===Fs&&Ht&&f.jsx(Aa,{className:b==="terminal"?void 0:"hidden",children:f.jsx($7n,{projectId:Ht.id,sessionId:u,active:b==="terminal"},Fs)})]})]}),Wt&&f.jsx(d$,{remote:e.kind==="ssh",onClose:()=>Es(!1),onCreated:(X,ae)=>{Es(!1),Lf(X,ae)}}),uc&&Ht&&Uc(Ht.id)&&f.jsx(m$n,{onClose:wo,onCreateProject:Di})]})}const vk=tc()({validateSearch:e=>({pane:kS(e.pane)}),beforeLoad:({location:e})=>{if(!J_(e.pathname))throw DK()},component:KGn});function KGn(){const{projectId:e}=vk.useParams(),{pane:n}=vk.useSearch(),t=di(),r=lD({select:s=>s.location});return A.useEffect(()=>{const s=WGn(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(N0,{}),f.jsx(VGn,{projectId:e,pane:n,runtime:o$()},e)]})}function WGn(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&kS(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const tG=tc()({component:QGn});function QGn(){const{projectId:e}=tG.useParams();return f.jsx(aSn,{projectId:e})}const XGn=tc()({}),YGn=tc()({}),ZGn=tc()({}),JGn=tc()({}),eVn=cSn.update({id:"/",path:"/",getParentRoute:()=>Hb}),LC=lSn.update({id:"/projects",path:"/projects",getParentRoute:()=>Hb}),tVn=uSn.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>Hb}),nVn=_Sn.update({id:"/",path:"/",getParentRoute:()=>LC}),Kh=vk.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>LC}),rVn=tG.update({id:"/",path:"/",getParentRoute:()=>Kh}),sVn=XGn.update({id:"/skills",path:"/skills",getParentRoute:()=>Kh}),iVn=YGn.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>Kh}),aVn=ZGn.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>Kh}),oVn=JGn.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>Kh}),cVn={ProjectsProjectIdSkillsRoute:sVn,ProjectsProjectIdIndexRoute:rVn,ProjectsProjectIdSettingsTabRoute:iVn,ProjectsProjectIdTasksSessionIdRoute:aVn,ProjectsProjectIdTasksNewRoute:oVn},lVn=Kh._addFileChildren(cVn),uVn={ProjectsProjectIdRoute:lVn,ProjectsIndexRoute:nVn},_Vn=LC._addFileChildren(uVn),fVn={IndexRoute:eVn,ProjectsRoute:_Vn,RemoteLaunchRoute:tVn},dVn=Hb._addFileChildren(fVn)._addFileTypes(),hVn=rQ({routeTree:dVn,context:{queryClient:et},trailingSlash:"never",defaultPendingComponent:u6,defaultErrorComponent:_6,defaultNotFoundComponent:sSn}),nG=E();document.documentElement.lang=nG;document.documentElement.dir="ltr";YL(nG);_K.createRoot(document.getElementById("root")).render(f.jsxs(A.StrictMode,{children:[f.jsx(CV,{client:et,children:f.jsx(aQ,{router:hVn})}),f.jsx($wn,{})]}));export{rc as C,$t as I,lb as M,Ih as P,WI as S,u3n as a,KN as b,it as c,qr as d,pIn as e,Xt as f,E as g,Mi as h,WN as i,f as j,A as r}; +`)+1)}let q=[];try{q=$.trim()?J3($):[]}catch{return null}if(I.truncated&&q.every(V=>V.hunks.length===0))return null;let H=0,Q=0;for(const V of q){const Z=_y(V);H+=Z.additions,Q+=Z.deletions}return{fileCount:q.length,additions:H,deletions:Q,truncated:I.truncated}},[v]),x={done:0,failed:0,cancelled:0,live:0};for(const I of n)I.status==="done"?x.done+=1:I.status==="failed"?x.failed+=1:I.status==="cancelled"?x.cancelled+=1:x.live+=1;const y=t?R0((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,z=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,E=A.useRef(null),[T,j]=A.useState(!1),[M,D]=A.useState(!1);return A.useEffect(()=>{j(!1)},[z]),A.useEffect(()=>{const I=E.current;I&&D(I.scrollHeight>I.clientHeight+1)},[z,T]),Fi.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.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-border-hover-strong [&_.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-sm [&_.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]: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-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:R4,left:m,top:w,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:c,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx(cl,{status:t?la(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Gr(i),children:[f.jsx(ko,{size:13}),rDe()]}),f.jsxs("button",{type:"button",...Gr(a),children:[f.jsx(Bb,{size:13}),LOe()]})]}),z&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:E,children:z}),z&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(I=>!I),children:T?OD():Ije()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(N(),{style:"short"}).format([n.length===1?mYe():kYe({count:tn(n.length)}),...x.done>0?[zXe({count:tn(x.done)})]:[],...x.failed>0?[DXe({count:tn(x.failed)})]:[],...x.cancelled>0?[xXe({count:tn(x.cancelled)})]:[],...x.live>0?[nYe({count:tn(x.live)})]:[]])}),t&&oS(t.backend)&&f.jsx(RS,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:wo(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(zm,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[XOe()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?TX({parent:Ce(r??"parent")}):kX({parent:Ce(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?lYe():b.truncated?QXe({count:tn(b.fileCount)}):HXe({count:tn(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[qOe()," ",IVn(e.createdAt)]})]})]}),document.body)}const YM=["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-sm [&_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(" "),BVn=264,ZM=132,_v=44,PVn=72,FVn=148,HVn=44;function qVn(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function UVn(e,n){const t=new Map,r=o=>{const c=t.get(o)??1+o.children.reduce((u,h)=>u+r(h),0);return t.set(o,c),c},s=new Map,i=o=>{const c=s.get(o)??(n(o)||o.children.some(i));return s.set(o,c),c};function a(o){if(n(o)){const h=[];let _=0;for(const p of o.children)i(p)?h.push(...a(p)):_+=r(p);return _>0&&h.push({kind:"elided",id:`el-${o.exp.id}`,count:_,children:[]}),[{kind:"exp",exp:o.exp,children:h}]}if(!i(o))return[];let c=0;const u=[];return(function h(_){c+=1;for(const p of _.children)n(p)?u.push(...a(p)):i(p)?h(p):c+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:c,children:u}]}return e.flatMap(a)}function bk(e){return e.kind==="exp"?BVn:FVn}function P1(e){return e.kind==="exp"?e.exp.id:e.id}function fv(e){if(e.children.length===0)return bk(e);const n=e.children.reduce((t,r)=>t+fv(r),0)+_v*(e.children.length-1);return Math.max(bk(e),n)}function GVn(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const VVn=A.memo(function({data:n}){wf();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:c,onOpenView:u,onOpenCode:h,onArchive:_}=n,p=r?la(r):void 0,m=p==="running"||p==="starting"||p==="cancelling",w=i?jpn():m?m0n():Wc(),k=s.slice(-8),v=A.useRef(null),b=LVn(v,n);return f.jsxs("div",{ref:v,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.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-start [&_.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-xs [&_.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]: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-xs [&_.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-sm [&_.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]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${m?"live":""} ${t.archived?"opacity-80":""}`,onMouseEnter:b.onMouseEnter,onMouseLeave:b.onMouseLeave,children:[f.jsx(Fu,{type:"target",position:Dt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Gr(x=>u(t.id,"overview",x)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:t.archived?IL():w}),f.jsx(cl,{status:p??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:Amn()}),k.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:k.map(x=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${GVn(la(x))}`,title:h6(la(x))},x.id))}):f.jsx("span",{children:umn()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:wo(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:x=>x.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:gmn(),...Gr(x=>u(t.id,"terminal",x)),children:[f.jsx(ko,{size:13}),$L()]}),f.jsxs("button",{className:"node-action",title:bD({branch:Ce(t.branchName)}),...Gr(x=>h(t.id,t.branchName,"files",x)),children:[f.jsx(Bb,{size:13}),I0n()]}),f.jsx(gq,{id:t.id,name:t.slug,hasParent:!!t.parentExperimentId,onArchive:_,compact:!0}),o&&c&&f.jsx("a",{className:"node-action node-action-ext",title:Cv({name:Ce(t.branchName)}),"aria-label":Cv({name:Ce(t.branchName)}),href:Ob(o,c,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:x=>x.stopPropagation(),children:f.jsx(Gb,{size:13})})]}),f.jsx(Fu,{type:"source",position:Dt.Bottom}),b.rect&&f.jsx($Vn,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:b.rect,onOpenLogs:s.length>0?x=>u(t.id,"terminal",x):void 0,onOpenCode:x=>h(t.id,t.branchName,"files",x),onMouseEnter:b.keepOpen,onMouseLeave:b.onMouseLeave})]})}),KVn=A.memo(function({data:n}){wf();const{count:t,onShowProjectScope:r}=n;return f.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-hover-faint text-muted text-sm font-medium text-start 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:$mn(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(Fu,{type:"target",position:Dt.Top}),f.jsx(Ib,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?Qpn():Hpn({count:tn(t)}),f.jsx("span",{className:"elided-node-sub",children:Smn()})]}),f.jsx(Fu,{type:"source",position:Dt.Bottom})]})}),WVn={exp:VVn,elided:KVn},sG={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},QVn={...sG.style,strokeDasharray:"4 4"};function XVn({experiments:e,hasArchivedExperiments:n,allExperiments:t,runs:r,project:s,onOpenView:i,onOpenCode:a,onArchive:o,agentSessionId:c,onShowProjectScope:u,viewport:h,onViewportChange:_}){const{nodes:p,edges:m}=A.useMemo(()=>{const w=new Map;for(const E of r){const T=w.get(E.experimentId);T?T.push(E):w.set(E.experimentId,[E])}for(const E of w.values())E.sort((T,j)=>T.createdAt-j.createdAt);const k=[],v=[],b=E=>!c||E.exp.chatSessionId===c,x=UVn(qVn(e),b),y=new Map(t.map(E=>[E.id,E.slug]));function C(E,T,j){const M=T-bk(E)/2;if(E.kind==="exp"){const $=w.get(E.exp.id)??[];k.push({id:E.exp.id,type:"exp",position:{x:M,y:j},data:{exp:E.exp,latestRun:$[$.length-1]??null,runs:$,isBaseline:!E.exp.parentExperimentId,parentSlug:E.exp.parentExperimentId?y.get(E.exp.parentExperimentId)??null:null,githubOwner:s.githubEnabled?s.githubOwner:"",githubRepo:s.githubEnabled?s.githubRepo:"",onOpenView:i,onOpenCode:a,onArchive:o}})}else k.push({id:E.id,type:"elided",position:{x:M,y:j+(ZM-HVn)/2},data:{count:E.count,onShowProjectScope:u}});if(E.children.length===0)return;const D=E.children.reduce(($,q)=>$+fv(q),0)+_v*(E.children.length-1);let I=T-D/2;for(const $ of E.children){const q=fv($),H=E.kind==="elided"||$.kind==="elided";v.push({id:`e-${P1(E)}-${P1($)}`,source:P1(E),target:P1($),...H?{style:QVn}:{}}),C($,I+q/2,j+ZM+PVn),I+=q+_v}}let z=0;for(const E of x){const T=fv(E);C(E,z+T/2,0),z+=T+_v}return{nodes:k,edges:v}},[e,t,r,i,a,o,s.githubOwner,s.githubRepo,s.githubEnabled,c,u]);return e.length===0?f.jsxs("div",{className:YM,children:[f.jsx("p",{className:"empty-state-title",children:n?x3():rmn()}),!n&&f.jsx("p",{className:"empty-state-hint",children:T0n()})]}):p.length===0&&c?f.jsxs("div",{className:YM,children:[f.jsx("p",{className:"empty-state-title",children:n?x3():X0n()}),!n&&f.jsx("p",{className:"empty-state-hint",children:k0n()})]}):f.jsx(sVn,{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:p,edges:m,nodeTypes:WVn,defaultEdgeOptions:sG,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:DVn,onMoveEnd:(w,k)=>{w&&_(k)},minZoom:.15,defaultViewport:h??void 0,fitView:h===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(lVn,{variant:ul.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},c??"project")}const t0=["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-sm [&_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(" ");function YVn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ZVn(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),c=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/")||E6(i))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[w,k]=[m(i),m(p)];return w===k?"":w.startsWith(`${k}/`)?w.slice(k.length).replace(/^\/+/,""):null},h=i.startsWith("/")&&c?u(c):null,_=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(h!==null)return h?{path:h,source:"artifacts"}:null;if(_!==null)i=_;else{const p=s?YVn(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),w=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),k=m||w?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};w?(a=w[1],i=w[2]):k&&(i=k[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function JVn(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const eKn=10,JM=1448,tKn=80,nKn=48;function eO(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function tO(e){const n=A.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function rKn({runtime:e,projectId:n,pane:t}){var Yt,vn,hn;const r=dn({mutationFn:Qbn}),s=pi(),i=_D({select:J=>J.location}),a=cf(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",c=A.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:c.current;(a==null?void 0:a.kind)==="task"&&(c.current=u);const h=t!==void 0,_=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=A.useState(null),[w,k]=A.useState(0),v=A.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==w)&&(v.current={href:i.href,jump:w,value:v.current.value+1});const b=A.useMemo(()=>{const J=t?fo(t):"experiments";return typeof J=="object"&&"path"in J&&J.line&&p!==v.current.value?{...J,lineScrollRequest:v.current.value}:J},[t,p,i.href,w]),x=ut(Ga(n)),y=A.useMemo(()=>{var J;return((J=x.data)==null?void 0:J.map(he=>he.id))??null},[x.data]),C=A.useRef(new Set),z=A.useRef(new Set),E=A.useRef({}),[T,j]=A.useState(0),M=A.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const D=A.useCallback((J,he=!1)=>{const je=M.current;je.projectId&&s.navigate({href:X1(je.projectId,je.activeSessionId,J),replace:he})},[s]),I=A.useCallback(J=>{const he=rl(J);D(he.kind==="file"?{...he,line:void 0}:he)},[D]),$=A.useCallback(()=>D(void 0),[D]),q=A.useCallback(J=>{(t==null?void 0:t.kind)==="experiment"&&D({...t,runId:J??void 0})},[t,D]),H=A.useCallback(J=>{s.navigate({href:J?`/projects/${encodeURIComponent(J)}`:"/projects"})},[s]),Q=A.useCallback(J=>{var he;if(n)if(J==="chat"){const je=c.current;s.navigate({href:X1(n,je,(he=Tu(Ki.current,je??"new"))==null?void 0:he.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${J==="skills"?"skills":`settings/${J}`}`})},[s,n]),V=wf(),{status:Z}=u6(e.kind==="local"),Y=A.useMemo(()=>hh(),[n]),B=ut(Y),L=B.data??null,F=A.useCallback(J=>{Yr(Y.queryKey,he=>(typeof J=="function"?J(he??null):J)??void 0)},[Y]),U=A.useMemo(()=>Em(),[n]),K=ut(U),ne=K.data??null,oe=A.useCallback(J=>{Yr(U.queryKey,he=>(typeof J=="function"?J(he??null):J)??void 0)},[U]),ue=A.useRef(void 0);ue.current=ne==null?void 0:ne.tourCompleted;const se=[!x.data&&x.error?CD():null,!B.data&&B.error?f0():null,!K.data&&K.error?p_e():null].filter(J=>J!==null),G=se.length?j_e({items:new Intl.ListFormat(V).format(se)}):null,ae=A.useRef(null),ce=ut(Lv(n)),pe=ce.data??[],be=!ce.isPending,[Ae,De]=A.useState(!1),Ne=ut(Eu(n)).data??[],xe=A.useRef(Ne);xe.current=Ne;const rt=A.useRef(new Map),Ze=A.useRef(new Set),ct=A.useRef(null),Ct=A.useRef(!1),qt=A.useRef(new Map),dt=A.useRef(new Map),ht=A.useRef(0),Le=A.useRef(pe);Le.current=pe;const Te=ut(S6n(n)).data??null,[He,nt]=A.useState("table"),[_t,St]=A.useState(!1),[yt,Zt]=A.useState("project"),un=A.useRef(null),{open:At,setOpen:pt,ref:mt}=Xa(un),[_n,us]=A.useState(!1),xr=pe.every(J=>J.chatSessionId),Qt=u&&xr?yt:"project",Mn=A.useMemo(()=>Qt!=="agent"?pe:pe.filter(J=>J.chatSessionId===u),[pe,Qt,u]),mr=A.useMemo(()=>pe.filter(J=>_t||!J.archived),[pe,_t]),gr=A.useMemo(()=>Mn.filter(J=>_t||!J.archived),[Mn,_t]),_s=A.useCallback(async(J,he,je)=>{try{await uyn(J,he,je),await Je.invalidateQueries({queryKey:Lv(n).queryKey})}catch(Be){bn(Be instanceof Error?Be.message:String(Be),"error")}},[n]),Et=A.useMemo(()=>{if(Qt!=="agent")return Ne;const J=new Set(Mn.map(he=>he.id));return Ne.filter(he=>J.has(he.experimentId))},[Ne,Mn,Qt]),[fn,an]=A.useState([]),[xn,Ir]=A.useState(!1),[mn,gn]=A.useState(!1),[Ln,Nt]=A.useState(!1),[Ot,Hn]=A.useState(!1),[zr,nr]=A.useState(null),[On,hr]=A.useState([]),[jr,In]=A.useState([]),Ke=A.useRef(new Map),gt=A.useRef(new Map),Zr=J=>{let he=gt.current.get(J);return he||(he=new sBn,gt.current.set(J,he)),he},[Wn,wn]=A.useState([]),[Qn,rr]=A.useState([]),[As,Tr]=A.useState([]),[cr,xl]=A.useState([]),[Ya,Jr]=A.useState(null),[Rs,Za]=A.useState("files"),[Eo,wa]=A.useState(new Set),[Ps,$t]=A.useState(!1),[qi,Xn]=A.useState(null),[Ar,st]=A.useState(d$),[Jt,vi]=A.useState(()=>window.innerWidth>=JM),bi=o==="chat"&&!h&&Jt,[yi,Kr]=A.useState(!0),[Wr,Ui]=A.useState(!1),Gi=A.useRef(zS()),Fs=A.useRef(u);Fs.current=u;const Rr=A.useRef(fn);Rr.current=fn;const ei=A.useRef(cr);ei.current=cr;const xi=A.useRef(null),Vt=A.useCallback(J=>{const he=[...J];ei.current=he,xl(he)},[]),wi=A.useCallback(J=>{xi.current=J,Jr(J)},[]),dc=A.useCallback(J=>{const he=Lt(J);hr(Me=>qp(Me,he)),In(Me=>qp(Me,he)),wn(Me=>qp(Me,he)),rr(Me=>qp(Me,he)),Tr(Me=>qp(Me,he));const je=Qi.current;if(je&&"path"in J){const Me=Bs(je,Fs.current,J);Ke.current.delete(Me),gt.current.delete(Me),z.current.delete(Me),C.current.delete(Me)}const Be=Rr.current.filter(Me=>Lt(Me)!==he);Rr.current=Be,an(Be)},[]),Yn=A.useCallback(J=>{const he=Lt(J),je=[...Rr.current.filter(Be=>Lt(Be)!==he),c1(J)];Rr.current=je,an(je),I(J)},[I]),es=A.useCallback((J,he,je)=>{const Be=Lt(J),Me=xi.current,it=uDn({order:ei.current,previewKey:Me?Lt(Me):null},Be,he);it.replacedKey&&Me&&typeof Me!="string"&&Lt(Me)===it.replacedKey&&dc(Me),Vt(it.order),it.previewKey===null?wi(null):it.previewKey===Be&&wi(c1(J));const at=[...Rr.current.filter(Bt=>Lt(Bt)!==Be),c1(J)];Rr.current=at,an(at),D(rl(J,je))},[dc,Vt,wi,D]),ki=A.useCallback(J=>{const he=xi.current;he&&Lt(he)===Lt(J)&&wi(null)},[wi]);A.useEffect(()=>{let J=!1;const he=Be=>{const Me=xi.current,it=Be.target;if(it instanceof Element&&it.closest("input, textarea, [contenteditable='true']")!==null){J=!1;return}if(Me&&Lt(Me)===Lt(Gi.current.rightTab)&&(Be.metaKey||Be.ctrlKey)&&!Be.altKey&&!Be.shiftKey&&Be.key.toLowerCase()==="k"){Be.preventDefault(),J=!0;return}if(J&&Be.key==="Enter"){Be.preventDefault(),J=!1;const Bt=xi.current;Bt&&ki(Bt);return}J=!1},je=()=>{J=!1};return window.addEventListener("keydown",he),window.addEventListener("blur",je),window.addEventListener("pointerdown",je),()=>{window.removeEventListener("keydown",he),window.removeEventListener("blur",je),window.removeEventListener("pointerdown",je)}},[ki]);const ks=A.useCallback((J,he)=>{const je=Lt(J),Be=xi.current;Be&&Lt(Be)===je&&wi(null);const Me=_Dn({order:ei.current,previewKey:Be?Lt(Be):null},je,Rr.current.map(Lt));Vt(Me.order);const it=Rr.current.filter(Bt=>Lt(Bt)!==je);if(Rr.current=it,an(it),!he)return;const at=Me.fallbackKey?it.find(Bt=>Lt(Bt)===Me.fallbackKey):void 0;at?I(at):($(),$t(!1))},[Vt,wi,I,$]),Vi=Q,Hs=A.useMemo(()=>({rightTab:c1(b),tabHistory:fn,experimentsTabOpen:xn,filesTabOpen:mn,artifactsTabOpen:Ln,terminalTabOpen:Ot,expTabs:On,fileTabs:jr,planTabs:Wn,subagentTabs:Qn,codeTabs:As,contentTabOrder:ei.current,previewTab:xi.current,filesView:Rs,filesToggled:Eo,selectedRunId:_,scope:yt,panelOpen:h,panelMax:Ps,treeViewport:qi}),[b,fn,xn,mn,Ln,Ot,On,jr,Wn,Qn,As,cr,Ya,Rs,Eo,_,yt,h,Ps,qi]);Gi.current=Hs;const Qu=A.useCallback(()=>Object.fromEntries(Ke.current),[]),hc=A.useRef(void 0),Ja=A.useCallback(()=>{clearTimeout(hc.current),hc.current=setTimeout(()=>j(J=>J+1),200)},[]);A.useEffect(()=>()=>clearTimeout(hc.current),[]);const No=A.useCallback((J,he,je)=>{if(an(J.tabHistory),Rr.current=J.tabHistory,Ir(J.experimentsTabOpen),gn(J.filesTabOpen),Nt(J.artifactsTabOpen),Hn(J.terminalTabOpen),hr(J.expTabs),In(J.fileTabs),wn(Me=>Me===J.planTabs?Me:J.planTabs.map(it=>{var at;return{...it,plan:((at=Me.find(Bt=>Bt.sessionId===it.sessionId&&Bt.promptId===it.promptId))==null?void 0:at.plan)??""}})),rr(J.subagentTabs),Tr(J.codeTabs),Vt(J.contentTabOrder),wi(J.previewTab),Za(J.filesView),wa(J.filesToggled),Zt(J.scope),$t(J.panelMax),Xn(J.treeViewport),us(M.current.activeSessionId===Id&&J.fileTabs.some(Me=>b_(Me,{path:iw,source:"artifacts"}))),je){for(const[Me,it]of Object.entries((he==null?void 0:he.scroll)??{}))Ke.current.set(Me,it);Object.assign(E.current,he==null?void 0:he.sourceModes)}const Be=M.current;if(Be.projectId)for(const Me of J.fileTabs){const it=Bs(Be.projectId,Be.activeSessionId,Me);z.current.has(it)||C.current.add(it)}},[Vt,wi]),{ready:Si,loaded:Xu,error:zo,retry:qs,capture:fs,workspace:Ki}=Akn({projectId:ne&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",firstDemoOpen:(ne==null?void 0:ne.tourCompleted)===!1,state:Hs,apply:No,getScroll:Qu,sourceModes:E.current,revision:T}),ka=A.useRef(null);A.useLayoutEffect(()=>{if(!Si||!be||(a==null?void 0:a.kind)!=="task")return;const J=ka.current;(J==null?void 0:J.projectId)===n&&J.taskId===u&&J.scope!==Qt&&Xn(null),ka.current={projectId:n,taskId:u,scope:Qt}},[Si,be,a==null?void 0:a.kind,n,u,Qt]);const pr=A.useCallback((J,he)=>{var Bt;const je=(he==null?void 0:he.projectId)??n;if(!je)return;const Be=je===n;J&&Be&&he!=null&&he.replace&&u===null&&(fs(),jkn(je,J));const Me=Tu(l$(je),J??"new"),it=Me?Me.active:Vc(je)?(Bt=jS(J??void 0,ue.current===!1))==null?void 0:Bt.active:void 0,at=Be&&(he!=null&&he.replace)&&J&&u===null?M.current.pane:it;s.navigate({href:X1(je,J,at),replace:Be&&(he==null?void 0:he.replace)})},[s,n,u,fs]);A.useEffect(()=>{Si&&(a==null?void 0:a.kind)!=="task"&&!c.current&&Ki.current.lastTaskId&&(y!=null&&y.includes(Ki.current.lastTaskId))&&(c.current=Ki.current.lastTaskId,j(J=>J+1))},[Si,a==null?void 0:a.kind,Ki,y]),fQ({shouldBlockFn:({next:J})=>{var he;return((he=cf(J.pathname))==null?void 0:he.projectId)!==n&&[...gt.current.values()].some(je=>je.needsProtection)&&!FR($N())},enableBeforeUnload:()=>[...gt.current.values()].some(J=>J.needsProtection)});const pc=A.useRef(null);A.useEffect(()=>{const J=Pb(i.href);!ne||!Si||!J||(qb.queue({lastLocation:J,railOpen:yi,panelWidth:Ar,experimentsView:He},pc.current===J?250:0),pc.current=J)},[i.href,ne,Si,yi,Ar,He]);const sr=(ne==null?void 0:ne.onboardingCompleted)??!1,[Mf,mc]=A.useState(!1),[wl,Ci]=A.useState(null),[ds,eo]=A.useState(0),Wi=A.useCallback(()=>mc(!0),[]),to=A.useCallback(async J=>{const he=ue.current===!1,je=await r.mutateAsync({tourCompleted:!0});he&&du({name:"demo_welcome_choice",choice:J}),oe(Be=>Be&&{...Be,tourCompleted:je.tourCompleted}),mc(!1),J==="explore_demo"&&eo(Be=>Be+1)},[]),Of=A.useCallback(async()=>{await to("create_project"),Ui(!0)},[to]);A.useEffect(()=>{!n||!Vc(n)||!sr||ne!=null&&ne.tourCompleted||Wi()},[n,sr,Wi,ne==null?void 0:ne.tourCompleted]);const on=(L==null?void 0:L.find(J=>J.id===n))??null;A.useEffect(()=>{const J=G||ne===null?null:on==null?void 0:on.name;document.title=J?`${ia(J)} — OpenResearch`:"OpenResearch"},[G,ne,on]);const Qi=A.useRef(n);Qi.current=n;const ti=A.useCallback(J=>{n&&du({name:"first_action",surface:Vc(n)?"demo":"project",action:J})},[n]);A.useEffect(()=>{o!=="chat"&&o!=="skills"&&ti("open_settings")},[o,ti]);const Zn=A.useCallback((J=!1)=>{J&&(!M.current.isTask||M.current.pane)||(ti("open_experiment"),Ir(!0),D({kind:"home",view:"experiments"},J))},[D,ti]),Yu=()=>{B.refetch(),K.refetch(),x.refetch()},Ss=A.useRef(!1);A.useEffect(()=>{if(!ne||Ss.current)return;Ss.current=!0,ae.current=ne.preferredAgent;const J=ES()??ne.workspace;J&&(Kr(J.railOpen),st(Math.min(J.panelWidth,i0())),nt(J.experimentsView))},[ne]),A.useEffect(()=>{y&&c.current&&!y.includes(c.current)&&(c.current=null)},[y]);const ni=A.useRef(Promise.resolve()),Ei=A.useRef(0),kl=A.useCallback(J=>{const he=++Ei.current;oe(Be=>Be&&{...Be,preferredAgent:J});const je=ni.current.then(()=>r.mutateAsync({preferredAgent:J})).then(Be=>{ae.current=Be.preferredAgent,he===Ei.current&&oe(Me=>Me&&{...Me,preferredAgent:Be.preferredAgent})}).catch(Be=>{throw he===Ei.current&&oe(Me=>Me&&{...Me,preferredAgent:ae.current}),Be});return ni.current=je.catch(()=>{}),je},[]);A.useEffect(()=>{const J=()=>{st(he=>Math.min(he,i0())),vi(window.innerWidth>=JM)};return window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]);const Zu=A.useCallback(J=>{Ct.current=!1,qt.current.clear(),dt.current.clear();const he=++ht.current;Je.fetchQuery(Eu(J)).then(je=>{if(Qi.current!==J||ct.current!==J||ht.current!==he)return;qt.current=new Map(je.map(Me=>[Me.id,Me]));const Be=[...dt.current.values()].some(Me=>{const it=qt.current.get(Me.id);return!it||it.status!=="running"&&it.updatedAt<=Me.updatedAt});dt.current.clear();for(const Me of je){const it=rt.current.get(Me.id);(!it||it.updatedAt{var it;return je.some(at=>at.id===Me&&at.status==="running")?Me:((it=je.find(at=>at.status==="running"))==null?void 0:it.id)??null}),Be&&Zn(!0)}).catch(()=>{ht.current===he&&(dt.current.clear(),De(!0))})},[Zn]);A.useEffect(()=>{if(n)return ct.current=n,rt.current.clear(),Ze.current.clear(),oyn(n).catch(()=>{}),Zu(n),()=>{ht.current++}},[Zu,n]);const Sa=A.useCallback(()=>{Nt(!0),Yn("artifacts")},[Yn]),Df=A.useCallback(()=>{Hn(!0),Yn("terminal")},[Yn]),jo=u??(n?`project:${n}`:null);A.useEffect(()=>{nr(h?b==="terminal"?jo:J=>J===jo?J:null:null)},[h,b,jo]),awn({onReconnect:()=>{const J=Qi.current;J&&(ct.current=J,rt.current.clear(),Ze.current.clear(),Zu(J))},onRun:J=>{if(J.projectId!==Qi.current||J.projectId!==ct.current)return;const he=rt.current.get(J.id),je=Ze.current.has(J.id);if(he&&he.updatedAt>J.updatedAt||(rt.current.set(J.id,J),Ze.current.add(J.id),Vc(J.projectId)&&Ci(it=>J.status==="running"?it??J.id:it===J.id?null:it),J.status!=="running"||(he==null?void 0:he.status)==="running"))return;const Be=qt.current.get(J.id),Me=Ct.current&&(!Be||Be.status!=="running"&&Be.updatedAt<=J.updatedAt);je&&he||Me?Zn(!0):Ct.current||dt.current.set(J.id,J)}});const Qh=A.useCallback(()=>Zt("project"),[]),ri=A.useCallback((J,he="overview",je="preview",Be)=>{ti("open_experiment");const Me={id:J,view:he};hr(it=>it.some(at=>fw(at,Me))?it:[...it,Me]),es(Me,je,Be)},[es]),gc=A.useCallback((J,he="preview")=>{const je=xe.current.filter(Me=>Me.id===J||Me.id.startsWith(J)),Be=je.length===1?je[0]:null;Be&&ri(Be.experimentId,"terminal",he,Be.id)},[ri]),Xh=A.useMemo(()=>new Map(pe.map(J=>{var he;return[J.id,((he=J.title)==null?void 0:he.trim())||J.slug||Wc()]})),[pe,V]),vc=tO(Xh),Sl=A.useMemo(()=>{const J=new Map;for(const he of Ne)J.set(he.id,vc.get(he.experimentId)??Wc());return J},[vc,Ne,V]),Ca=tO(Sl),Lf=A.useCallback(J=>{const he=Ca.get(J);if(he)return he;const je=[...Ca].filter(([Be])=>Be.startsWith(J));return je.length===1?je[0][1]:""},[Ca]),Cl=A.useCallback(J=>{const he=vc.get(J);if(he)return he;const je=[...vc].filter(([Be])=>Be.startsWith(J));return je.length===1?je[0][1]:""},[vc]),Ju=A.useCallback((J,he="preview")=>{const je=Le.current.filter(Be=>Be.id===J||Be.id.startsWith(J));je.length===1&&ri(je[0].id,"overview",he)},[ri]),El=A.useCallback(J=>{const he=On.findIndex(je=>fw(je,J));he!==-1&&(hr(je=>je.filter((Be,Me)=>Me!==he)),ks(J,Lt(b)===Lt(J)))},[On,ks,b]),Ea=A.useCallback((J,he="preview")=>{J.line!=null&&k(Me=>Me+1);const je=Qi.current;if(je){const Me=Bs(je,Fs.current,J);Gi.current.fileTabs.some(it=>b_(it,J))||C.current.delete(Me),z.current.add(Me)}const Be=o$(J);In(Me=>{const it=Me.findIndex(Bt=>b_(Bt,J));if(it===-1)return[...Me,Be];const at=Me.slice();return at[it]=Be,at}),es(J,he)},[es]),Nl=A.useCallback((J,he,je,Be,Me,it)=>{const at=L==null?void 0:L.find(ps=>ps.id===n),Bt=ZVn(J,at==null?void 0:at.repoPath,he,(at==null?void 0:at.artifactsDir)??(at==null?void 0:at.filesDir),at==null?void 0:at.slug);if(!Bt)return null;const Kt=Me?Le.current.find(ps=>ps.id===Me||Me.length>=6&&ps.id.startsWith(Me)):void 0,Ns=je??(Kt==null?void 0:Kt.branchName),Os=Bt.source==null||Bt.source==="repo";return Ns&&Os&&(Bt.ref=Ns),it&&!Bt.ref&&Os&&(Bt.branchLabel=it),Be!=null&&(Bt.line=Be),Bt},[L,n]),bc=A.useCallback((J,he,je,Be,Me,it,at="preview")=>{const Bt=Nl(J,he,je,Be,Me,it);Bt&&Ea(Bt,at)},[Ea,Nl]),Yh=A.useCallback(J=>Ea({path:J,source:"artifacts"},"keepOpen"),[Ea]),e_=A.useCallback((J,he,je,Be,Me,it="preview")=>{const at=Nl(J,he,Me,je,Be);at&&Ea(at,it)},[Ea,Nl]),si=A.useCallback((J,he)=>{ki(J),he()},[ki]),Zh=A.useCallback(J=>{var Be;const he=jr.findIndex(Me=>b_(Me,J));if(he===-1)return;const je=n?Bs(n,u,J):null;je&&((Be=gt.current.get(je))!=null&&Be.needsProtection)&&!FR($N())||(In(Me=>Me.filter((it,at)=>at!==he)),je&&(Ke.current.delete(je),gt.current.delete(je),z.current.delete(je),C.current.delete(je),delete E.current[je]),u===Id&&b_(J,{path:iw,source:"artifacts"})&&us(!1),ks(J,Lt(b)===Lt(J)))},[u,jr,ks,n,b]),no=A.useCallback(J=>{J.lineScrollRequest!==void 0&&m(J.lineScrollRequest)},[]),Jh=A.useCallback((J,he,je,Be="preview")=>{const Me={kind:"plan",sessionId:he,promptId:je,plan:J};wn(it=>{const at=it.findIndex(Kt=>Kt.promptId===je);if(at===-1)return[...it,Me];const Bt=it.slice();return Bt[at]=Me,Bt}),es(Me,Be)},[es]),zl=A.useCallback(J=>{const he=Wn.findIndex(je=>je.promptId===J.promptId);he!==-1&&(wn(je=>je.filter((Be,Me)=>Me!==he)),ks(J,Lt(b)===Lt(J)))},[ks,Wn,b]),Na=A.useCallback((J,he,je,Be="preview")=>{const Me={kind:"subagent",sessionId:J,spawnPartId:he,label:je};rr(it=>it.some(at=>at.spawnPartId===he)?it:[...it,Me]),es(Me,Be)},[es]),ep=A.useCallback(J=>{const he=Qn.findIndex(je=>je.spawnPartId===J.spawnPartId);he!==-1&&(rr(je=>je.filter((Be,Me)=>Me!==he)),ks(J,Lt(b)===Lt(J)))},[ks,b,Qn]),[jl,Tl]=A.useState({});A.useEffect(()=>{if(Tl(at=>{const Bt=new Set(Qn.map(Kt=>Kt.spawnPartId));return Object.keys(at).every(Kt=>Bt.has(Kt))?at:Object.fromEntries(Object.entries(at).filter(([Kt])=>Bt.has(Kt)))}),Qn.length===0)return;let J=!0;const he=new Set,je=(at,Bt,Kt)=>{Tl(Ns=>{var ps;let Os=Ns;for(const ja of Bt)if(!(Kt&&he.has(ja.spawnPartId)))for(const so of at){const zs=lb(so.parts,ja.spawnPartId);if(!zs)continue;Kt||he.add(ja.spawnPartId);const wc={label:UIn(zs),running:((ps=zs.state)==null?void 0:ps.status)==="running"},kc=Os[ja.spawnPartId];(!kc||kc.label!==wc.label||kc.running!==wc.running)&&(Os===Ns&&(Os={...Ns}),Os[ja.spawnPartId]=wc);break}return Os})};let Be=0;const Me=()=>{const at=++Be;for(const Bt of new Set(Qn.map(Kt=>Kt.sessionId)))Je.fetchQuery({...ol(Bt),staleTime:0}).then(({messages:Kt})=>{J&&at===Be&&je(Kt,Qn.filter(Ns=>Ns.sessionId===Bt),!0)}).catch(()=>{})};Me();const it=Ov(at=>{if(at.type==="reconnected"){he.clear(),Me();return}if(at.type!=="message")return;const Bt=Qn.filter(Kt=>Kt.sessionId===at.sessionId);Bt.length&&je([at.message],Bt,!1)});return()=>{J=!1,it()}},[Qn]);const Al=A.useCallback((J,he,je="files",Be="preview")=>{const Me={code:!0,experimentId:J,branch:he,view:je,toggled:new Set};Tr(it=>it.some(at=>dd(at,Me))?it.map(at=>dd(at,Me)?{...at,experimentId:J,view:je}:at):[...it,Me]),es(Me,Be)},[es]),t_=A.useCallback((J,he)=>{Tr(je=>je.map(Be=>dd(Be,J)?{...Be,...he}:Be)),he.view&&D(rl({...J,...he}))},[]),If=A.useCallback(J=>{const he=As.findIndex(je=>dd(je,J));he!==-1&&(Tr(je=>je.filter((Be,Me)=>Me!==he)),ks(J,Lt(b)===Lt(J)))},[As,ks,b]),za=A.useCallback(()=>{gn(!0),Yn("files")},[Yn]),Rl=A.useCallback(J=>{J==="experiments"?Ir(!1):J==="files"?gn(!1):J==="terminal"?(Hn(!1),nr(null)):Nt(!1),ks(J,b===J)},[ks,b]),n_=J=>{J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId);const je=document.body.style.userSelect;document.body.style.userSelect="none";const Be=Ps,Me=J.clientX,it=Ar;let at=!1;function Bt(){window.removeEventListener("pointermove",Kt),window.removeEventListener("pointerup",Bt),window.removeEventListener("pointercancel",Bt),document.body.style.userSelect=je}function Kt(Ns){if(Be){const so=Ns.clientX-Me;if(at||sops+tKn){$t(!0);return}$t(!1);const ja=Math.min(Math.max(Os,Pv),ps);st(ja)}window.addEventListener("pointermove",Kt),window.addEventListener("pointerup",Bt),window.addEventListener("pointercancel",Bt)},tp=(J,he)=>{F(je=>je?eO(je,J):[J]),s.navigate({href:`/projects/${encodeURIComponent(J.id)}${he?"/settings/git":""}`}),he&&bn(he,"error")},Ms=typeof b=="object"&&"id"in b?b:null,$n=typeof b=="object"&&"path"in b?b:null,ii=($n==null?void 0:$n.source)==="artifacts"&&Te?Q0(Te.entries,$n.path):null,To=ii?`${ii.modifiedAt}:${ii.size}`:null,yc=u===Id&&_n?jr.find(J=>b_(J,{path:iw,source:"artifacts"})):void 0,Ml=yc?[yc]:[],hs=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,Ni=hs==null?void 0:hs.sessionId,ro=hs==null?void 0:hs.promptId,xc=!!(Ni&&ro&&(y!=null&&y.includes(Ni))),Ol=ut({...ol(Ni??""),enabled:xc,subscribed:xc}),Ao=A.useMemo(()=>{var he;if(!Ni||!ro||!Ol.data)return null;const J=Ol.data.messages.flatMap(je=>{const Be=lb(je.parts,ro);return Be?[Be]:[]})[0];return{key:`${Ni}:${ro}`,text:((he=J==null?void 0:J.prompt)==null?void 0:he.plan)??null}},[Ni,ro,Ol.data]),Cs=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Dl=typeof b=="object"&&"code"in b?b:null,Es=Dl?As.find(J=>dd(J,Dl))??null:null,r_=new Map;for(const J of[...On,...jr,...Wn,...Qn,...As])r_.set(Lt(J),J);const $f=yc?Lt(yc):null,Bf=cr.filter(J=>J!==$f).map(J=>r_.get(J)).filter(Ekn),$r=J=>Ya!==null&&Lt(Ya)===Lt(J),te=J=>f.jsx(qc,{active:$n!==null&&b_($n,J),label:J.path.split("/").pop()||J.path,icon:f.jsx(qI,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>ki(J),onClose:()=>Zh(J)},`file:${NS(J)}`),ge=Ms?pe.find(J=>J.id===Ms.id)??null:null,Ee=Es?pe.find(J=>J.id===Es.experimentId&&J.branchName===Es.branch)??null:null,Ie=J=>{var je,Be;if("path"in J)return te(J);if("id"in J){const Me=pe.find(it=>it.id===J.id);return f.jsx(qc,{active:Ms!==null&&fw(Ms,J),label:Me?Me.title||Me.slug:"…",icon:J.view==="overview"?f.jsx(h3n,{size:12,className:"shrink-0"}):f.jsx(ko,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>ki(J),onClose:()=>El(J)},Lt(J))}if("kind"in J&&J.kind==="plan")return f.jsx(qc,{active:hs!==null&&hs.promptId===J.promptId,label:AD(),icon:f.jsx(yS,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>ki(J),onClose:()=>zl(J)},Lt(J));if("kind"in J)return f.jsx(qc,{active:Cs!==null&&Cs.spawnPartId===J.spawnPartId,label:((je=jl[J.spawnPartId])==null?void 0:je.label)??J.label??L_e(),shimmer:((Be=jl[J.spawnPartId])==null?void 0:Be.running)??!1,icon:f.jsx(kS,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>ki(J),onClose:()=>ep(J)},Lt(J));const he=pe.find(Me=>Me.id===J.experimentId);return f.jsx(qc,{active:Es!==null&&dd(Es,J),label:(he==null?void 0:he.slug)??J.branch,icon:f.jsx(Ou,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>ki(J),onClose:()=>If(J)},Lt(J))};if(!a||a.kind==="resume")return null;if(G)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:t0,children:[f.jsx("p",{children:G}),f.jsx(Oe,{variant:"primary",onClick:Yu,children:Ys()})]}),e.kind==="ssh"&&f.jsx(G3,{runtime:e,corner:!0})]});if(L&&!on)return f.jsxs("div",{className:t0,children:[go(),f.jsx(Oe,{onClick:()=>H(null),children:f0()})]});if(zo&&!Si)return f.jsxs("div",{className:t0,children:[f.jsx("p",{role:"alert",children:zo}),f.jsx(Oe,{onClick:qs,children:Ys()})]});if(L===null||ne===null||!Xu||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:t0,children:f.jsx(jt,{})}),e.kind==="ssh"&&f.jsx(G3,{runtime:e,corner:!0})]});if(!on||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:t0,children:[go(),f.jsx(Oe,{onClick:()=>H(null),children:f0()})]});const Pe=f.jsx(CBn,{projectName:((Yt=L.find(J=>J.id===n))==null?void 0:Yt.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Ui(!0),onRepository:()=>Vi("git"),onCollapse:()=>Kr(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(g$,{}),e.kind==="local"&&f.jsx(K$,{status:Z}),zo&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:zo}),f.jsx(Oe,{onClick:qs,children:Ys()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${bi?"workspace-card-visible":""}`,children:[n&&f.jsx(s$n,{projectId:n,projectName:(on==null?void 0:on.name)??"",railHeader:Pe,railOpen:yi,onShowRail:()=>Kr(!0),mainView:o,onSelectMainView:Vi,onOpenFile:e_,onOpenRun:gc,runExperimentName:Lf,onOpenExperiment:Ju,experimentName:Cl,onOpenPlan:Jh,onOpenSubagent:Na,composerFocusNonce:ds,demoRunningRunId:wl,runtime:e,onOpenDemoWelcome:on&&Vc(on.id)?Wi:void 0,activeSessionId:u,onActiveSessionChange:pr,preferredAgent:ne.preferredAgent,onPreferredAgentChange:kl,children:o==="skills"?f.jsx(W$n,{}):o!=="chat"?f.jsx(yLn,{remote:e.kind==="ssh",tab:o,project:on,onProjectUpdate:J=>{F(he=>he?eO(he,J):[J])},onSelectTab:Vi}):null}),o==="chat"&&f.jsx(K8n,{expanded:bi,experiments:pe,runs:Ne,onOpenExperiment:(J,he)=>ri(J,"overview","preview",he),rightOffset:h?Ar+28:void 0,activeView:h&&(b==="files"||b==="artifacts"||b==="experiments"||b==="terminal")?b:null,projectId:on.id,onCompute:()=>Vi("compute"),sessionId:u,busy:((vn=x.data)==null?void 0:vn.some(J=>J.id===u&&J.busy))??!1,onChanges:()=>{Za("changes"),za()},onFiles:()=>{Za("files"),za()},onTerminal:Df,onArtifacts:Sa,onExperiments:()=>Zn()}),o==="chat"&&h&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Ps?"max":""}`,style:Ps?void 0:{width:Ar},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Ps?"cursor-e-resize":"cursor-col-resize"}`,title:Ps?Cle():vle(),onPointerDown:n_}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.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:[Ml.map(te),mn&&f.jsx(qc,{active:b==="files",label:c3(),icon:f.jsx(Ou,{size:12,className:"shrink-0"}),onSelect:()=>Yn("files"),onClose:()=>Rl("files")}),Ot&&f.jsx(qc,{active:b==="terminal",label:Tv(),icon:f.jsx(ko,{size:12,className:"shrink-0"}),onSelect:()=>Yn("terminal"),onClose:()=>Rl("terminal")}),Ln&&f.jsx(qc,{active:b==="artifacts",label:wD(),icon:f.jsx(vS,{size:12,className:"shrink-0"}),onSelect:()=>Yn("artifacts"),onClose:()=>Rl("artifacts")}),xn&&f.jsx(qc,{active:b==="experiments",label:kD(),icon:f.jsx(gh,{size:12,className:"shrink-0"}),onSelect:()=>Yn("experiments"),onClose:()=>Rl("experiments")}),Bf.map(Ie)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Ft,{title:Ps?XE():QE(),"aria-label":Ps?XE():QE(),onClick:()=>$t(J=>!J),children:Ps?f.jsx(b5n,{size:14}):f.jsx(m5n,{size:14})}),f.jsx(Ft,{title:A0(),"aria-label":A0(),onClick:()=>{$(),$t(!1)},children:f.jsx(_r,{size:14})})]})]}),b==="terminal"&&Ot?null:!Si||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!be||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Ae?f.jsx(Pa,{children:f.jsx(jt,{})}):Ms&&(!ge||_&&!Ne.some(J=>J.id===_&&J.experimentId===Ms.id))||Dl&&!Ee||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Pa,{children:f.jsx("div",{className:"p-6 text-subtext",children:go()})}):b==="artifacts"?f.jsx(Pa,{children:on&&f.jsx(B$n,{project:on,artifacts:Te,onOpenFile:Yh,canRenameFile:J=>{var he;return!((he=gt.current.get(Bs(on.id,u,{path:J,source:"artifacts"})))!=null&&he.needsProtection)}},on.id)}):b==="experiments"?f.jsxs(Pa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("label",{className:"inline-flex items-center gap-1 text-sm text-subtext",children:[f.jsx("input",{type:"checkbox",checked:_t,onChange:J=>St(J.target.checked)}),w_e()]}),f.jsxs("div",{className:"option-picker relative inline-flex",ref:mt,children:[f.jsx(Ft,{size:"small",ref:un,className:"experiment-scope-trigger",active:Qt==="agent",title:Ule({scope:Qt==="agent"?KE():WE()}),"aria-label":mue(),"aria-expanded":At,onClick:()=>pt(J=>!J),children:f.jsx(X3n,{size:16,strokeWidth:2.5})}),At&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-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:[f.jsxs(Dn,{"aria-pressed":Qt==="agent",disabled:!u||!xr,title:u?xr?void 0:kue():Iue(),onClick:()=>{Zt("agent"),pt(!1)},children:[f.jsx("span",{children:KE()}),Qt==="agent"&&f.jsx(Pi,{size:13})]}),f.jsxs(Dn,{"aria-pressed":Qt==="project",onClick:()=>{Zt("project"),pt(!1)},children:[f.jsx("span",{children:WE()}),Qt==="project"&&f.jsx(Pi,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_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":Yle(),children:[f.jsx("button",{className:He==="table"?"active":"","aria-pressed":He==="table",onClick:()=>nt("table"),children:q_e()}),f.jsx("button",{className:He==="tree"?"active":"","aria-pressed":He==="tree",onClick:()=>nt("tree"),children:X_e()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:He==="tree"?on&&f.jsx(XVn,{experiments:mr,allExperiments:pe,hasArchivedExperiments:Mn.length>0&&gr.length===0,runs:Et,project:on,onOpenView:ri,onOpenCode:Al,onArchive:_s,agentSessionId:Qt==="agent"?u:null,onShowProjectScope:Qh,viewport:qi,onViewportChange:Xn}):f.jsx(EBn,{runs:Et,emptyHint:!_t&&Mn.length>0&&gr.length===0?x3():Qt==="agent"&&pe.length>0?Tue():void 0,experiments:gr,onOpen:(J,he)=>{ri(J.id,"overview",he)},onOpenLogs:(J,he,je)=>{ri(J,"terminal",je,he)},onOpenCode:(J,he)=>{const je=pe.find(Be=>Be.id===J);je&&Al(je.id,je.branchName,"files",he)},onArchive:_s,onCancel:UL})})]}):b==="files"?f.jsx(Pa,{children:on?f.jsx(w$n,{sessionId:u??void 0,project:on,view:Rs,toggled:Eo,onViewChange:Za,onToggledChange:wa,canRenameFile:J=>{var he;return!((he=gt.current.get(Bs(on.id,u,{path:J,source:"repo",sessionId:u??void 0})))!=null&&he.needsProtection)},onOpenFile:(J,he,je,Be)=>bc(J,he,je,void 0,void 0,void 0,Be)},`files:${u??`project:${on.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(qd,{children:f.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:[f.jsx(UI,{size:22}),f.jsx("p",{children:c_e()})]})})})}):$n?f.jsx(Pa,{children:n&&f.jsx(SBn,{remote:e.kind==="ssh",restored:C.current.has(Bs(n,u,$n)),onRestoreActivated:()=>{const J=Bs(n,u,$n);C.current.delete(J),z.current.add(J)},showSource:E.current[Bs(n,u,$n)]??!1,onShowSourceChange:J=>{E.current[Bs(n,u,$n)]=J,j(he=>he+1)},projectId:n,path:$n.path,source:$n.source,sessionId:$n.source==="artifacts"?u??void 0:$n.sessionId,gitRef:$n.ref,line:$n.line,branchLabel:JVn($n,on==null?void 0:on.baselineBranch),artifactVersion:To,artifactEntries:$n.source==="artifacts"?Te==null?void 0:Te.entries:void 0,bufferSession:Zr(Bs(n,u,$n)),onOpenFile:(J,he,je,Be)=>si($n,()=>bc(J,he,je,void 0,void 0,void 0,Be)),scrollPosition:Ke.current.get(Bs(n,u,$n)),onScrollPositionChange:J=>{Ke.current.set(Bs(n,u,$n),J),Ja()},lineScrollRequest:$n.lineScrollRequest,onLineScrollRequestHandled:()=>no($n),onEdit:()=>ki($n)},Bs(n,u,$n))}):hs?f.jsx(Pa,{children:f.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:f.jsx(nc,{text:(Ao==null?void 0:Ao.key)===`${hs.sessionId}:${hs.promptId}`?Ao.text??go():((hn=Wn.find(J=>J.promptId===hs.promptId))==null?void 0:hn.plan)||SD(),onOpenFile:(J,he,je,Be,Me)=>si(hs,()=>bc(J,hs.sessionId,Be,he,je,void 0,Me))})})}):Cs?f.jsx(o$n,{projectId:n,sessionId:Cs.sessionId,spawnPartId:Cs.spawnPartId,onOpenFile:(J,he,je,Be,Me)=>si(Cs,()=>e_(J,Cs.sessionId,he,je,Be,Me)),onOpenRun:(J,he)=>si(Cs,()=>gc(J,he)),runExperimentName:Lf,onOpenExperiment:(J,he)=>si(Cs,()=>Ju(J,he)),experimentName:Cl,onOpenSubagent:(J,he,je)=>si(Cs,()=>Na(Cs.sessionId,J,he,je))},Cs.spawnPartId):Es?f.jsx(Pa,{children:n&&on&&Es&&Ee&&f.jsx(x$n,{projectId:n,project:on,experiment:Ee,view:Es.view,toggled:Es.toggled,onViewChange:J=>t_(Es,{view:J}),onToggledChange:J=>t_(Es,{toggled:J}),onOpenFile:(J,he,je,Be)=>si(Es,()=>bc(J,he,je,void 0,void 0,Ee.branchName,Be))},`code:${Es.branch}`)}):f.jsx(Pa,{children:Ms&&ge&&on&&f.jsx(J$n,{experiment:ge,project:on,view:Ms.view,runs:Ne,selectedRunId:_,onSelectRun:q,parentExperiment:pe.find(J=>J.id===ge.parentExperimentId)??null,onOpenView:(J,he,je)=>{si(Ms,()=>ri(ge.id,J,je,he))},onOpenCode:(J,he)=>si(Ms,()=>Al(ge.id,ge.branchName,J,he))},`${Ms.id}:${Ms.view}`)}),Ot&&zr!==null&&zr===jo&&on&&f.jsx(Pa,{className:b==="terminal"?void 0:"hidden",children:f.jsx(Q8n,{projectId:on.id,sessionId:u,active:b==="terminal"},jo)})]})]}),Wr&&f.jsx(m$,{remote:e.kind==="ssh",onClose:()=>Ui(!1),onCreated:(J,he)=>{Ui(!1),tp(J,he)}}),Mf&&on&&Vc(on.id)&&f.jsx(NBn,{onClose:to,onCreateProject:Of})]})}const yk=sc()({validateSearch:e=>({pane:SS(e.pane)}),beforeLoad:({location:e})=>{if(!cf(e.pathname))throw BK()},component:sKn});function sKn(){const{projectId:e}=yk.useParams(),{pane:n}=yk.useSearch(),t=pi(),r=_D({select:s=>s.location});return A.useEffect(()=>{const s=iKn(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(z0,{}),f.jsx(rKn,{projectId:e,pane:n,runtime:u$()},e)]})}function iKn(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&SS(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const iG=sc()({component:aKn});function aKn(){const{projectId:e}=iG.useParams();return f.jsx(g6n,{projectId:e})}const oKn=sc()({}),cKn=sc()({}),lKn=sc()({}),uKn=sc()({}),_Kn=b6n.update({id:"/",path:"/",getParentRoute:()=>Ub}),IC=y6n.update({id:"/projects",path:"/projects",getParentRoute:()=>Ub}),fKn=x6n.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>Ub}),dKn=w6n.update({id:"/",path:"/",getParentRoute:()=>IC}),Wh=yk.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>IC}),hKn=iG.update({id:"/",path:"/",getParentRoute:()=>Wh}),pKn=oKn.update({id:"/skills",path:"/skills",getParentRoute:()=>Wh}),mKn=cKn.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>Wh}),gKn=lKn.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>Wh}),vKn=uKn.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>Wh}),bKn={ProjectsProjectIdSkillsRoute:pKn,ProjectsProjectIdIndexRoute:hKn,ProjectsProjectIdSettingsTabRoute:mKn,ProjectsProjectIdTasksSessionIdRoute:gKn,ProjectsProjectIdTasksNewRoute:vKn},yKn=Wh._addFileChildren(bKn),xKn={ProjectsProjectIdRoute:yKn,ProjectsIndexRoute:dKn},wKn=IC._addFileChildren(xKn),kKn={IndexRoute:_Kn,ProjectsRoute:wKn,RemoteLaunchRoute:fKn},SKn=Ub._addFileChildren(kKn)._addFileTypes(),CKn=oQ({routeTree:SKn,context:{queryClient:Je},trailingSlash:"never",defaultPendingComponent:_6,defaultErrorComponent:f6,defaultNotFoundComponent:p6n}),aG=N();document.documentElement.lang=aG;document.documentElement.dir="ltr";eI(aG);pK.createRoot(document.getElementById("root")).render(f.jsxs(A.StrictMode,{children:[f.jsx(jV,{client:Je,children:f.jsx(uQ,{router:CKn})}),f.jsx(Q4n,{})]}));export{ac as C,Ft as I,ub as M,$h as P,YI as S,x5n as a,WN as b,ot as c,Ur as d,E$n as e,tn as f,N as g,Fi as h,QN as i,f as j,A as r}; diff --git a/ui/dist/index.html b/ui/dist/index.html index f9cb3d5a..a1788e3d 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -49,8 +49,8 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - - + +
("table"); + const [showArchivedExperiments, setShowArchivedExperiments] = useState(false); // Experiments pane scope: "agent" narrows to the open chat session's work. // Falls back to "project" whenever there is no usable experiment attribution. const [scope, setScope] = useState<"agent" | "project">("project"); @@ -368,6 +370,22 @@ export default function App({ runtime, projectId, pane }: { runtime: RuntimeInfo if (effectiveScope !== "agent") return experiments; return experiments.filter((experiment) => experiment.chatSessionId === activeSessionId); }, [experiments, effectiveScope, activeSessionId]); + const visibleExperiments = useMemo( + () => experiments.filter((experiment) => showArchivedExperiments || !experiment.archived), + [experiments, showArchivedExperiments], + ); + const visibleScopedExperiments = useMemo( + () => scopedExperiments.filter((experiment) => showArchivedExperiments || !experiment.archived), + [scopedExperiments, showArchivedExperiments], + ); + const archiveExperiment = useCallback(async (id: string, direction: "up" | "down", archived: boolean) => { + try { + await setExperimentArchived(id, direction, archived); + await queryClient.invalidateQueries({ queryKey: listExperimentsQuery(projectId).queryKey }); + } catch (error) { + showAlert(error instanceof Error ? error.message : String(error), "error"); + } + }, [projectId]); // Runs are scoped by their experiment's owner, not by which session launched them. const scopedRuns = useMemo(() => { if (effectiveScope !== "agent") return runs; @@ -1752,6 +1770,10 @@ export default function App({ runtime, projectId, pane }: { runtime: RuntimeInfo
+
0 && visibleScopedExperiments.length === 0} runs={scopedRuns} project={activeProject} onOpenView={openExperimentTab} onOpenCode={openCodeTabForExperiment} + onArchive={archiveExperiment} agentSessionId={effectiveScope === "agent" ? activeSessionId : null} onShowProjectScope={showProjectScope} viewport={treeViewport} @@ -1838,11 +1863,13 @@ export default function App({ runtime, projectId, pane }: { runtime: RuntimeInfo 0 + !showArchivedExperiments && scopedExperiments.length > 0 && visibleScopedExperiments.length === 0 + ? m.tree_all_experiments_archived() + : effectiveScope === "agent" && experiments.length > 0 ? m.app_no_task_experiments() : undefined } - experiments={scopedExperiments} + experiments={visibleScopedExperiments} onOpen={(experiment, intent) => { openExperimentTab(experiment.id, "overview", intent); }} @@ -1859,6 +1886,7 @@ export default function App({ runtime, projectId, pane }: { runtime: RuntimeInfo intent, ); }} + onArchive={archiveExperiment} onCancel={cancelRun} /> )} diff --git a/ui/src/api.ts b/ui/src/api.ts index 6f605711..d406f2ec 100644 --- a/ui/src/api.ts +++ b/ui/src/api.ts @@ -86,6 +86,7 @@ export interface Experiment { updatedAt: number; /** Chat session that created this experiment; null for dashboard/legacy rows. */ chatSessionId?: string | null; + archived: boolean; } export type RunStatus = "starting" | "running" | "done" | "failed" | "cancelled"; @@ -373,6 +374,9 @@ export const listExperiments = (projectId: string, signal?: AbortSignal) => (r) => r.experiments, ); +export const setExperimentArchived = (id: string, direction: "up" | "down", archived: boolean) => + patch<{ ids: string[] }>(`/api/experiments/${id}/archive`, { direction, archived }); + export const listRuns = (projectId: string, signal?: AbortSignal) => get<{ runs: Run[] }>(`/api/projects/${projectId}/runs`, signal).then((r) => r.runs); diff --git a/ui/src/components/ArchiveMenu.tsx b/ui/src/components/ArchiveMenu.tsx new file mode 100644 index 00000000..8b32c791 --- /dev/null +++ b/ui/src/components/ArchiveMenu.tsx @@ -0,0 +1,56 @@ +import { useRef } from "react"; +import { Ellipsis } from "lucide-react"; +import { m } from "../paraglide/messages.js"; +import { usePopover } from "./ModelPicker"; +import { MenuItem } from "./ui"; + +export function ArchiveMenu({ id, name, hasParent, onArchive, compact = false }: { + id: string; + name: string; + hasParent: boolean; + onArchive: (id: string, direction: "up" | "down", archived: boolean) => void; + compact?: boolean; +}) { + const triggerRef = useRef(null); + const menu = usePopover(triggerRef); + const choose = (direction: "up" | "down", archived: boolean) => { + menu.setOpen(false); + onArchive(id, direction, archived); + }; + + return ( +
+ {compact ? ( + + ) : ( + + )} + {menu.open && ( +
+ {hasParent && choose("up", true)}>{m.tree_archive_above()}} + choose("down", true)}>{m.tree_archive_down()} + {hasParent && choose("up", false)}>{m.tree_restore_above()}} + choose("down", false)}>{m.tree_restore_down()} +
+ )} +
+ ); +} diff --git a/ui/src/components/ExperimentsTable.tsx b/ui/src/components/ExperimentsTable.tsx index 0c37a07d..2e50dab9 100644 --- a/ui/src/components/ExperimentsTable.tsx +++ b/ui/src/components/ExperimentsTable.tsx @@ -7,6 +7,7 @@ import { fmtNumber, runDisplayStatus, timeAgo, type Experiment, type Run } from import { StatusBadge } from "./StatusBadge"; import { tabOpenGestureHandlers, type TabOpenIntent } from "../tabPreview"; import { Button } from "./ui"; +import { ArchiveMenu } from "./ArchiveMenu"; export function ExperimentsTable({ runs, @@ -15,6 +16,7 @@ export function ExperimentsTable({ onOpen, onOpenLogs, onOpenCode, + onArchive, onCancel, }: { runs: Run[]; @@ -23,6 +25,7 @@ export function ExperimentsTable({ onOpen: (experiment: Experiment, intent: TabOpenIntent) => void; onOpenLogs: (experimentId: string, runId: string, intent: TabOpenIntent) => void; onOpenCode: (experimentId: string, intent: TabOpenIntent) => void; + onArchive: (id: string, direction: "up" | "down", archived: boolean) => void; onCancel: (runId: string) => Promise; }) { const [pendingCancellation, setPendingCancellation] = useState>(new Set()); @@ -117,6 +120,7 @@ export function ExperimentsTable({ > {experiment.title || experiment.slug} + {experiment.archived && {m.tree_archived()}} ",t):s}}class dl{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class S5{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var vAn=e=>e instanceof Gh||e instanceof vy||e instanceof Uh,Wo={"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]}},b1={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]},mA={Å:"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 bAn(e,n){Wo[e]=n}function V6(e,n,t){if(!Wo[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Wo[n][r];if(!s&&e[0]in mA&&(r=mA[e[0]].charCodeAt(0),s=Wo[n][r]),!s&&t==="text"&&$P(r)&&(s=Wo[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var Bw={};function yAn(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!Bw[n]){var t=Bw[n]={cssEmPerMu:b1.quad[n]/18};for(var r in b1)b1.hasOwnProperty(r)&&(t[r]=b1[r][n])}return Bw[n]}var Sr={math:{},text:{}};function P(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var W="math",Ge="text",ee="main",_e="ams",Er="accent-token",vt="bin",gi="close",Vh="inner",Ut="mathord",cs="op-token",ya="open",Im="punct",fe="rel",gl="spacing",ye="textord";P(W,ee,fe,"≡","\\equiv",!0);P(W,ee,fe,"≺","\\prec",!0);P(W,ee,fe,"≻","\\succ",!0);P(W,ee,fe,"∼","\\sim",!0);P(W,ee,fe,"⊥","\\perp");P(W,ee,fe,"⪯","\\preceq",!0);P(W,ee,fe,"⪰","\\succeq",!0);P(W,ee,fe,"≃","\\simeq",!0);P(W,ee,fe,"∣","\\mid",!0);P(W,ee,fe,"≪","\\ll",!0);P(W,ee,fe,"≫","\\gg",!0);P(W,ee,fe,"≍","\\asymp",!0);P(W,ee,fe,"∥","\\parallel");P(W,ee,fe,"⋈","\\bowtie",!0);P(W,ee,fe,"⌣","\\smile",!0);P(W,ee,fe,"⊑","\\sqsubseteq",!0);P(W,ee,fe,"⊒","\\sqsupseteq",!0);P(W,ee,fe,"≐","\\doteq",!0);P(W,ee,fe,"⌢","\\frown",!0);P(W,ee,fe,"∋","\\ni",!0);P(W,ee,fe,"∝","\\propto",!0);P(W,ee,fe,"⊢","\\vdash",!0);P(W,ee,fe,"⊣","\\dashv",!0);P(W,ee,fe,"∋","\\owns");P(W,ee,Im,".","\\ldotp");P(W,ee,Im,"⋅","\\cdotp");P(W,ee,Im,"⋅","·");P(Ge,ee,ye,"⋅","·");P(W,ee,ye,"#","\\#");P(Ge,ee,ye,"#","\\#");P(W,ee,ye,"&","\\&");P(Ge,ee,ye,"&","\\&");P(W,ee,ye,"ℵ","\\aleph",!0);P(W,ee,ye,"∀","\\forall",!0);P(W,ee,ye,"ℏ","\\hbar",!0);P(W,ee,ye,"∃","\\exists",!0);P(W,ee,ye,"∇","\\nabla",!0);P(W,ee,ye,"♭","\\flat",!0);P(W,ee,ye,"ℓ","\\ell",!0);P(W,ee,ye,"♮","\\natural",!0);P(W,ee,ye,"♣","\\clubsuit",!0);P(W,ee,ye,"℘","\\wp",!0);P(W,ee,ye,"♯","\\sharp",!0);P(W,ee,ye,"♢","\\diamondsuit",!0);P(W,ee,ye,"ℜ","\\Re",!0);P(W,ee,ye,"♡","\\heartsuit",!0);P(W,ee,ye,"ℑ","\\Im",!0);P(W,ee,ye,"♠","\\spadesuit",!0);P(W,ee,ye,"§","\\S",!0);P(Ge,ee,ye,"§","\\S");P(W,ee,ye,"¶","\\P",!0);P(Ge,ee,ye,"¶","\\P");P(W,ee,ye,"†","\\dag");P(Ge,ee,ye,"†","\\dag");P(Ge,ee,ye,"†","\\textdagger");P(W,ee,ye,"‡","\\ddag");P(Ge,ee,ye,"‡","\\ddag");P(Ge,ee,ye,"‡","\\textdaggerdbl");P(W,ee,gi,"⎱","\\rmoustache",!0);P(W,ee,ya,"⎰","\\lmoustache",!0);P(W,ee,gi,"⟯","\\rgroup",!0);P(W,ee,ya,"⟮","\\lgroup",!0);P(W,ee,vt,"∓","\\mp",!0);P(W,ee,vt,"⊖","\\ominus",!0);P(W,ee,vt,"⊎","\\uplus",!0);P(W,ee,vt,"⊓","\\sqcap",!0);P(W,ee,vt,"∗","\\ast");P(W,ee,vt,"⊔","\\sqcup",!0);P(W,ee,vt,"◯","\\bigcirc",!0);P(W,ee,vt,"∙","\\bullet",!0);P(W,ee,vt,"‡","\\ddagger");P(W,ee,vt,"≀","\\wr",!0);P(W,ee,vt,"⨿","\\amalg");P(W,ee,vt,"&","\\And");P(W,ee,fe,"⟵","\\longleftarrow",!0);P(W,ee,fe,"⇐","\\Leftarrow",!0);P(W,ee,fe,"⟸","\\Longleftarrow",!0);P(W,ee,fe,"⟶","\\longrightarrow",!0);P(W,ee,fe,"⇒","\\Rightarrow",!0);P(W,ee,fe,"⟹","\\Longrightarrow",!0);P(W,ee,fe,"↔","\\leftrightarrow",!0);P(W,ee,fe,"⟷","\\longleftrightarrow",!0);P(W,ee,fe,"⇔","\\Leftrightarrow",!0);P(W,ee,fe,"⟺","\\Longleftrightarrow",!0);P(W,ee,fe,"↦","\\mapsto",!0);P(W,ee,fe,"⟼","\\longmapsto",!0);P(W,ee,fe,"↗","\\nearrow",!0);P(W,ee,fe,"↩","\\hookleftarrow",!0);P(W,ee,fe,"↪","\\hookrightarrow",!0);P(W,ee,fe,"↘","\\searrow",!0);P(W,ee,fe,"↼","\\leftharpoonup",!0);P(W,ee,fe,"⇀","\\rightharpoonup",!0);P(W,ee,fe,"↙","\\swarrow",!0);P(W,ee,fe,"↽","\\leftharpoondown",!0);P(W,ee,fe,"⇁","\\rightharpoondown",!0);P(W,ee,fe,"↖","\\nwarrow",!0);P(W,ee,fe,"⇌","\\rightleftharpoons",!0);P(W,_e,fe,"≮","\\nless",!0);P(W,_e,fe,"","\\@nleqslant");P(W,_e,fe,"","\\@nleqq");P(W,_e,fe,"⪇","\\lneq",!0);P(W,_e,fe,"≨","\\lneqq",!0);P(W,_e,fe,"","\\@lvertneqq");P(W,_e,fe,"⋦","\\lnsim",!0);P(W,_e,fe,"⪉","\\lnapprox",!0);P(W,_e,fe,"⊀","\\nprec",!0);P(W,_e,fe,"⋠","\\npreceq",!0);P(W,_e,fe,"⋨","\\precnsim",!0);P(W,_e,fe,"⪹","\\precnapprox",!0);P(W,_e,fe,"≁","\\nsim",!0);P(W,_e,fe,"","\\@nshortmid");P(W,_e,fe,"∤","\\nmid",!0);P(W,_e,fe,"⊬","\\nvdash",!0);P(W,_e,fe,"⊭","\\nvDash",!0);P(W,_e,fe,"⋪","\\ntriangleleft");P(W,_e,fe,"⋬","\\ntrianglelefteq",!0);P(W,_e,fe,"⊊","\\subsetneq",!0);P(W,_e,fe,"","\\@varsubsetneq");P(W,_e,fe,"⫋","\\subsetneqq",!0);P(W,_e,fe,"","\\@varsubsetneqq");P(W,_e,fe,"≯","\\ngtr",!0);P(W,_e,fe,"","\\@ngeqslant");P(W,_e,fe,"","\\@ngeqq");P(W,_e,fe,"⪈","\\gneq",!0);P(W,_e,fe,"≩","\\gneqq",!0);P(W,_e,fe,"","\\@gvertneqq");P(W,_e,fe,"⋧","\\gnsim",!0);P(W,_e,fe,"⪊","\\gnapprox",!0);P(W,_e,fe,"⊁","\\nsucc",!0);P(W,_e,fe,"⋡","\\nsucceq",!0);P(W,_e,fe,"⋩","\\succnsim",!0);P(W,_e,fe,"⪺","\\succnapprox",!0);P(W,_e,fe,"≆","\\ncong",!0);P(W,_e,fe,"","\\@nshortparallel");P(W,_e,fe,"∦","\\nparallel",!0);P(W,_e,fe,"⊯","\\nVDash",!0);P(W,_e,fe,"⋫","\\ntriangleright");P(W,_e,fe,"⋭","\\ntrianglerighteq",!0);P(W,_e,fe,"","\\@nsupseteqq");P(W,_e,fe,"⊋","\\supsetneq",!0);P(W,_e,fe,"","\\@varsupsetneq");P(W,_e,fe,"⫌","\\supsetneqq",!0);P(W,_e,fe,"","\\@varsupsetneqq");P(W,_e,fe,"⊮","\\nVdash",!0);P(W,_e,fe,"⪵","\\precneqq",!0);P(W,_e,fe,"⪶","\\succneqq",!0);P(W,_e,fe,"","\\@nsubseteqq");P(W,_e,vt,"⊴","\\unlhd");P(W,_e,vt,"⊵","\\unrhd");P(W,_e,fe,"↚","\\nleftarrow",!0);P(W,_e,fe,"↛","\\nrightarrow",!0);P(W,_e,fe,"⇍","\\nLeftarrow",!0);P(W,_e,fe,"⇏","\\nRightarrow",!0);P(W,_e,fe,"↮","\\nleftrightarrow",!0);P(W,_e,fe,"⇎","\\nLeftrightarrow",!0);P(W,_e,fe,"△","\\vartriangle");P(W,_e,ye,"ℏ","\\hslash");P(W,_e,ye,"▽","\\triangledown");P(W,_e,ye,"◊","\\lozenge");P(W,_e,ye,"Ⓢ","\\circledS");P(W,_e,ye,"®","\\circledR");P(Ge,_e,ye,"®","\\circledR");P(W,_e,ye,"∡","\\measuredangle",!0);P(W,_e,ye,"∄","\\nexists");P(W,_e,ye,"℧","\\mho");P(W,_e,ye,"Ⅎ","\\Finv",!0);P(W,_e,ye,"⅁","\\Game",!0);P(W,_e,ye,"‵","\\backprime");P(W,_e,ye,"▲","\\blacktriangle");P(W,_e,ye,"▼","\\blacktriangledown");P(W,_e,ye,"■","\\blacksquare");P(W,_e,ye,"⧫","\\blacklozenge");P(W,_e,ye,"★","\\bigstar");P(W,_e,ye,"∢","\\sphericalangle",!0);P(W,_e,ye,"∁","\\complement",!0);P(W,_e,ye,"ð","\\eth",!0);P(Ge,ee,ye,"ð","ð");P(W,_e,ye,"╱","\\diagup");P(W,_e,ye,"╲","\\diagdown");P(W,_e,ye,"□","\\square");P(W,_e,ye,"□","\\Box");P(W,_e,ye,"◊","\\Diamond");P(W,_e,ye,"¥","\\yen",!0);P(Ge,_e,ye,"¥","\\yen",!0);P(W,_e,ye,"✓","\\checkmark",!0);P(Ge,_e,ye,"✓","\\checkmark");P(W,_e,ye,"ℶ","\\beth",!0);P(W,_e,ye,"ℸ","\\daleth",!0);P(W,_e,ye,"ℷ","\\gimel",!0);P(W,_e,ye,"ϝ","\\digamma",!0);P(W,_e,ye,"ϰ","\\varkappa");P(W,_e,ya,"┌","\\@ulcorner",!0);P(W,_e,gi,"┐","\\@urcorner",!0);P(W,_e,ya,"└","\\@llcorner",!0);P(W,_e,gi,"┘","\\@lrcorner",!0);P(W,_e,fe,"≦","\\leqq",!0);P(W,_e,fe,"⩽","\\leqslant",!0);P(W,_e,fe,"⪕","\\eqslantless",!0);P(W,_e,fe,"≲","\\lesssim",!0);P(W,_e,fe,"⪅","\\lessapprox",!0);P(W,_e,fe,"≊","\\approxeq",!0);P(W,_e,vt,"⋖","\\lessdot");P(W,_e,fe,"⋘","\\lll",!0);P(W,_e,fe,"≶","\\lessgtr",!0);P(W,_e,fe,"⋚","\\lesseqgtr",!0);P(W,_e,fe,"⪋","\\lesseqqgtr",!0);P(W,_e,fe,"≑","\\doteqdot");P(W,_e,fe,"≓","\\risingdotseq",!0);P(W,_e,fe,"≒","\\fallingdotseq",!0);P(W,_e,fe,"∽","\\backsim",!0);P(W,_e,fe,"⋍","\\backsimeq",!0);P(W,_e,fe,"⫅","\\subseteqq",!0);P(W,_e,fe,"⋐","\\Subset",!0);P(W,_e,fe,"⊏","\\sqsubset",!0);P(W,_e,fe,"≼","\\preccurlyeq",!0);P(W,_e,fe,"⋞","\\curlyeqprec",!0);P(W,_e,fe,"≾","\\precsim",!0);P(W,_e,fe,"⪷","\\precapprox",!0);P(W,_e,fe,"⊲","\\vartriangleleft");P(W,_e,fe,"⊴","\\trianglelefteq");P(W,_e,fe,"⊨","\\vDash",!0);P(W,_e,fe,"⊪","\\Vvdash",!0);P(W,_e,fe,"⌣","\\smallsmile");P(W,_e,fe,"⌢","\\smallfrown");P(W,_e,fe,"≏","\\bumpeq",!0);P(W,_e,fe,"≎","\\Bumpeq",!0);P(W,_e,fe,"≧","\\geqq",!0);P(W,_e,fe,"⩾","\\geqslant",!0);P(W,_e,fe,"⪖","\\eqslantgtr",!0);P(W,_e,fe,"≳","\\gtrsim",!0);P(W,_e,fe,"⪆","\\gtrapprox",!0);P(W,_e,vt,"⋗","\\gtrdot");P(W,_e,fe,"⋙","\\ggg",!0);P(W,_e,fe,"≷","\\gtrless",!0);P(W,_e,fe,"⋛","\\gtreqless",!0);P(W,_e,fe,"⪌","\\gtreqqless",!0);P(W,_e,fe,"≖","\\eqcirc",!0);P(W,_e,fe,"≗","\\circeq",!0);P(W,_e,fe,"≜","\\triangleq",!0);P(W,_e,fe,"∼","\\thicksim");P(W,_e,fe,"≈","\\thickapprox");P(W,_e,fe,"⫆","\\supseteqq",!0);P(W,_e,fe,"⋑","\\Supset",!0);P(W,_e,fe,"⊐","\\sqsupset",!0);P(W,_e,fe,"≽","\\succcurlyeq",!0);P(W,_e,fe,"⋟","\\curlyeqsucc",!0);P(W,_e,fe,"≿","\\succsim",!0);P(W,_e,fe,"⪸","\\succapprox",!0);P(W,_e,fe,"⊳","\\vartriangleright");P(W,_e,fe,"⊵","\\trianglerighteq");P(W,_e,fe,"⊩","\\Vdash",!0);P(W,_e,fe,"∣","\\shortmid");P(W,_e,fe,"∥","\\shortparallel");P(W,_e,fe,"≬","\\between",!0);P(W,_e,fe,"⋔","\\pitchfork",!0);P(W,_e,fe,"∝","\\varpropto");P(W,_e,fe,"◀","\\blacktriangleleft");P(W,_e,fe,"∴","\\therefore",!0);P(W,_e,fe,"∍","\\backepsilon");P(W,_e,fe,"▶","\\blacktriangleright");P(W,_e,fe,"∵","\\because",!0);P(W,_e,fe,"⋘","\\llless");P(W,_e,fe,"⋙","\\gggtr");P(W,_e,vt,"⊲","\\lhd");P(W,_e,vt,"⊳","\\rhd");P(W,_e,fe,"≂","\\eqsim",!0);P(W,ee,fe,"⋈","\\Join");P(W,_e,fe,"≑","\\Doteq",!0);P(W,_e,vt,"∔","\\dotplus",!0);P(W,_e,vt,"∖","\\smallsetminus");P(W,_e,vt,"⋒","\\Cap",!0);P(W,_e,vt,"⋓","\\Cup",!0);P(W,_e,vt,"⩞","\\doublebarwedge",!0);P(W,_e,vt,"⊟","\\boxminus",!0);P(W,_e,vt,"⊞","\\boxplus",!0);P(W,_e,vt,"⋇","\\divideontimes",!0);P(W,_e,vt,"⋉","\\ltimes",!0);P(W,_e,vt,"⋊","\\rtimes",!0);P(W,_e,vt,"⋋","\\leftthreetimes",!0);P(W,_e,vt,"⋌","\\rightthreetimes",!0);P(W,_e,vt,"⋏","\\curlywedge",!0);P(W,_e,vt,"⋎","\\curlyvee",!0);P(W,_e,vt,"⊝","\\circleddash",!0);P(W,_e,vt,"⊛","\\circledast",!0);P(W,_e,vt,"⋅","\\centerdot");P(W,_e,vt,"⊺","\\intercal",!0);P(W,_e,vt,"⋒","\\doublecap");P(W,_e,vt,"⋓","\\doublecup");P(W,_e,vt,"⊠","\\boxtimes",!0);P(W,_e,fe,"⇢","\\dashrightarrow",!0);P(W,_e,fe,"⇠","\\dashleftarrow",!0);P(W,_e,fe,"⇇","\\leftleftarrows",!0);P(W,_e,fe,"⇆","\\leftrightarrows",!0);P(W,_e,fe,"⇚","\\Lleftarrow",!0);P(W,_e,fe,"↞","\\twoheadleftarrow",!0);P(W,_e,fe,"↢","\\leftarrowtail",!0);P(W,_e,fe,"↫","\\looparrowleft",!0);P(W,_e,fe,"⇋","\\leftrightharpoons",!0);P(W,_e,fe,"↶","\\curvearrowleft",!0);P(W,_e,fe,"↺","\\circlearrowleft",!0);P(W,_e,fe,"↰","\\Lsh",!0);P(W,_e,fe,"⇈","\\upuparrows",!0);P(W,_e,fe,"↿","\\upharpoonleft",!0);P(W,_e,fe,"⇃","\\downharpoonleft",!0);P(W,ee,fe,"⊶","\\origof",!0);P(W,ee,fe,"⊷","\\imageof",!0);P(W,_e,fe,"⊸","\\multimap",!0);P(W,_e,fe,"↭","\\leftrightsquigarrow",!0);P(W,_e,fe,"⇉","\\rightrightarrows",!0);P(W,_e,fe,"⇄","\\rightleftarrows",!0);P(W,_e,fe,"↠","\\twoheadrightarrow",!0);P(W,_e,fe,"↣","\\rightarrowtail",!0);P(W,_e,fe,"↬","\\looparrowright",!0);P(W,_e,fe,"↷","\\curvearrowright",!0);P(W,_e,fe,"↻","\\circlearrowright",!0);P(W,_e,fe,"↱","\\Rsh",!0);P(W,_e,fe,"⇊","\\downdownarrows",!0);P(W,_e,fe,"↾","\\upharpoonright",!0);P(W,_e,fe,"⇂","\\downharpoonright",!0);P(W,_e,fe,"⇝","\\rightsquigarrow",!0);P(W,_e,fe,"⇝","\\leadsto");P(W,_e,fe,"⇛","\\Rrightarrow",!0);P(W,_e,fe,"↾","\\restriction");P(W,ee,ye,"‘","`");P(W,ee,ye,"$","\\$");P(Ge,ee,ye,"$","\\$");P(Ge,ee,ye,"$","\\textdollar");P(W,ee,ye,"%","\\%");P(Ge,ee,ye,"%","\\%");P(W,ee,ye,"_","\\_");P(Ge,ee,ye,"_","\\_");P(Ge,ee,ye,"_","\\textunderscore");P(W,ee,ye,"∠","\\angle",!0);P(W,ee,ye,"∞","\\infty",!0);P(W,ee,ye,"′","\\prime");P(W,ee,ye,"△","\\triangle");P(W,ee,ye,"Γ","\\Gamma",!0);P(W,ee,ye,"Δ","\\Delta",!0);P(W,ee,ye,"Θ","\\Theta",!0);P(W,ee,ye,"Λ","\\Lambda",!0);P(W,ee,ye,"Ξ","\\Xi",!0);P(W,ee,ye,"Π","\\Pi",!0);P(W,ee,ye,"Σ","\\Sigma",!0);P(W,ee,ye,"Υ","\\Upsilon",!0);P(W,ee,ye,"Φ","\\Phi",!0);P(W,ee,ye,"Ψ","\\Psi",!0);P(W,ee,ye,"Ω","\\Omega",!0);P(W,ee,ye,"A","Α");P(W,ee,ye,"B","Β");P(W,ee,ye,"E","Ε");P(W,ee,ye,"Z","Ζ");P(W,ee,ye,"H","Η");P(W,ee,ye,"I","Ι");P(W,ee,ye,"K","Κ");P(W,ee,ye,"M","Μ");P(W,ee,ye,"N","Ν");P(W,ee,ye,"O","Ο");P(W,ee,ye,"P","Ρ");P(W,ee,ye,"T","Τ");P(W,ee,ye,"X","Χ");P(W,ee,ye,"¬","\\neg",!0);P(W,ee,ye,"¬","\\lnot");P(W,ee,ye,"⊤","\\top");P(W,ee,ye,"⊥","\\bot");P(W,ee,ye,"∅","\\emptyset");P(W,_e,ye,"∅","\\varnothing");P(W,ee,Ut,"α","\\alpha",!0);P(W,ee,Ut,"β","\\beta",!0);P(W,ee,Ut,"γ","\\gamma",!0);P(W,ee,Ut,"δ","\\delta",!0);P(W,ee,Ut,"ϵ","\\epsilon",!0);P(W,ee,Ut,"ζ","\\zeta",!0);P(W,ee,Ut,"η","\\eta",!0);P(W,ee,Ut,"θ","\\theta",!0);P(W,ee,Ut,"ι","\\iota",!0);P(W,ee,Ut,"κ","\\kappa",!0);P(W,ee,Ut,"λ","\\lambda",!0);P(W,ee,Ut,"μ","\\mu",!0);P(W,ee,Ut,"ν","\\nu",!0);P(W,ee,Ut,"ξ","\\xi",!0);P(W,ee,Ut,"ο","\\omicron",!0);P(W,ee,Ut,"π","\\pi",!0);P(W,ee,Ut,"ρ","\\rho",!0);P(W,ee,Ut,"σ","\\sigma",!0);P(W,ee,Ut,"τ","\\tau",!0);P(W,ee,Ut,"υ","\\upsilon",!0);P(W,ee,Ut,"ϕ","\\phi",!0);P(W,ee,Ut,"χ","\\chi",!0);P(W,ee,Ut,"ψ","\\psi",!0);P(W,ee,Ut,"ω","\\omega",!0);P(W,ee,Ut,"ε","\\varepsilon",!0);P(W,ee,Ut,"ϑ","\\vartheta",!0);P(W,ee,Ut,"ϖ","\\varpi",!0);P(W,ee,Ut,"ϱ","\\varrho",!0);P(W,ee,Ut,"ς","\\varsigma",!0);P(W,ee,Ut,"φ","\\varphi",!0);P(W,ee,vt,"∗","*",!0);P(W,ee,vt,"+","+");P(W,ee,vt,"−","-",!0);P(W,ee,vt,"⋅","\\cdot",!0);P(W,ee,vt,"∘","\\circ",!0);P(W,ee,vt,"÷","\\div",!0);P(W,ee,vt,"±","\\pm",!0);P(W,ee,vt,"×","\\times",!0);P(W,ee,vt,"∩","\\cap",!0);P(W,ee,vt,"∪","\\cup",!0);P(W,ee,vt,"∖","\\setminus",!0);P(W,ee,vt,"∧","\\land");P(W,ee,vt,"∨","\\lor");P(W,ee,vt,"∧","\\wedge",!0);P(W,ee,vt,"∨","\\vee",!0);P(W,ee,ye,"√","\\surd");P(W,ee,ya,"⟨","\\langle",!0);P(W,ee,ya,"∣","\\lvert");P(W,ee,ya,"∥","\\lVert");P(W,ee,gi,"?","?");P(W,ee,gi,"!","!");P(W,ee,gi,"⟩","\\rangle",!0);P(W,ee,gi,"∣","\\rvert");P(W,ee,gi,"∥","\\rVert");P(W,ee,fe,"=","=");P(W,ee,fe,":",":");P(W,ee,fe,"≈","\\approx",!0);P(W,ee,fe,"≅","\\cong",!0);P(W,ee,fe,"≥","\\ge");P(W,ee,fe,"≥","\\geq",!0);P(W,ee,fe,"←","\\gets");P(W,ee,fe,">","\\gt",!0);P(W,ee,fe,"∈","\\in",!0);P(W,ee,fe,"","\\@not");P(W,ee,fe,"⊂","\\subset",!0);P(W,ee,fe,"⊃","\\supset",!0);P(W,ee,fe,"⊆","\\subseteq",!0);P(W,ee,fe,"⊇","\\supseteq",!0);P(W,_e,fe,"⊈","\\nsubseteq",!0);P(W,_e,fe,"⊉","\\nsupseteq",!0);P(W,ee,fe,"⊨","\\models");P(W,ee,fe,"←","\\leftarrow",!0);P(W,ee,fe,"≤","\\le");P(W,ee,fe,"≤","\\leq",!0);P(W,ee,fe,"<","\\lt",!0);P(W,ee,fe,"→","\\rightarrow",!0);P(W,ee,fe,"→","\\to");P(W,_e,fe,"≱","\\ngeq",!0);P(W,_e,fe,"≰","\\nleq",!0);P(W,ee,gl," ","\\ ");P(W,ee,gl," ","\\space");P(W,ee,gl," ","\\nobreakspace");P(Ge,ee,gl," ","\\ ");P(Ge,ee,gl," "," ");P(Ge,ee,gl," ","\\space");P(Ge,ee,gl," ","\\nobreakspace");P(W,ee,gl,"","\\nobreak");P(W,ee,gl,"","\\allowbreak");P(W,ee,Im,",",",");P(W,ee,Im,";",";");P(W,_e,vt,"⊼","\\barwedge",!0);P(W,_e,vt,"⊻","\\veebar",!0);P(W,ee,vt,"⊙","\\odot",!0);P(W,ee,vt,"⊕","\\oplus",!0);P(W,ee,vt,"⊗","\\otimes",!0);P(W,ee,ye,"∂","\\partial",!0);P(W,ee,vt,"⊘","\\oslash",!0);P(W,_e,vt,"⊚","\\circledcirc",!0);P(W,_e,vt,"⊡","\\boxdot",!0);P(W,ee,vt,"△","\\bigtriangleup");P(W,ee,vt,"▽","\\bigtriangledown");P(W,ee,vt,"†","\\dagger");P(W,ee,vt,"⋄","\\diamond");P(W,ee,vt,"⋆","\\star");P(W,ee,vt,"◃","\\triangleleft");P(W,ee,vt,"▹","\\triangleright");P(W,ee,ya,"{","\\{");P(Ge,ee,ye,"{","\\{");P(Ge,ee,ye,"{","\\textbraceleft");P(W,ee,gi,"}","\\}");P(Ge,ee,ye,"}","\\}");P(Ge,ee,ye,"}","\\textbraceright");P(W,ee,ya,"{","\\lbrace");P(W,ee,gi,"}","\\rbrace");P(W,ee,ya,"[","\\lbrack",!0);P(Ge,ee,ye,"[","\\lbrack",!0);P(W,ee,gi,"]","\\rbrack",!0);P(Ge,ee,ye,"]","\\rbrack",!0);P(W,ee,ya,"(","\\lparen",!0);P(W,ee,gi,")","\\rparen",!0);P(Ge,ee,ye,"<","\\textless",!0);P(Ge,ee,ye,">","\\textgreater",!0);P(W,ee,ya,"⌊","\\lfloor",!0);P(W,ee,gi,"⌋","\\rfloor",!0);P(W,ee,ya,"⌈","\\lceil",!0);P(W,ee,gi,"⌉","\\rceil",!0);P(W,ee,ye,"\\","\\backslash");P(W,ee,ye,"∣","|");P(W,ee,ye,"∣","\\vert");P(Ge,ee,ye,"|","\\textbar",!0);P(W,ee,ye,"∥","\\|");P(W,ee,ye,"∥","\\Vert");P(Ge,ee,ye,"∥","\\textbardbl");P(Ge,ee,ye,"~","\\textasciitilde");P(Ge,ee,ye,"\\","\\textbackslash");P(Ge,ee,ye,"^","\\textasciicircum");P(W,ee,fe,"↑","\\uparrow",!0);P(W,ee,fe,"⇑","\\Uparrow",!0);P(W,ee,fe,"↓","\\downarrow",!0);P(W,ee,fe,"⇓","\\Downarrow",!0);P(W,ee,fe,"↕","\\updownarrow",!0);P(W,ee,fe,"⇕","\\Updownarrow",!0);P(W,ee,cs,"∐","\\coprod");P(W,ee,cs,"⋁","\\bigvee");P(W,ee,cs,"⋀","\\bigwedge");P(W,ee,cs,"⨄","\\biguplus");P(W,ee,cs,"⋂","\\bigcap");P(W,ee,cs,"⋃","\\bigcup");P(W,ee,cs,"∫","\\int");P(W,ee,cs,"∫","\\intop");P(W,ee,cs,"∬","\\iint");P(W,ee,cs,"∭","\\iiint");P(W,ee,cs,"∏","\\prod");P(W,ee,cs,"∑","\\sum");P(W,ee,cs,"⨂","\\bigotimes");P(W,ee,cs,"⨁","\\bigoplus");P(W,ee,cs,"⨀","\\bigodot");P(W,ee,cs,"∮","\\oint");P(W,ee,cs,"∯","\\oiint");P(W,ee,cs,"∰","\\oiiint");P(W,ee,cs,"⨆","\\bigsqcup");P(W,ee,cs,"∫","\\smallint");P(Ge,ee,Vh,"…","\\textellipsis");P(W,ee,Vh,"…","\\mathellipsis");P(Ge,ee,Vh,"…","\\ldots",!0);P(W,ee,Vh,"…","\\ldots",!0);P(W,ee,Vh,"⋯","\\@cdots",!0);P(W,ee,Vh,"⋱","\\ddots",!0);P(W,ee,ye,"⋮","\\varvdots");P(Ge,ee,ye,"⋮","\\varvdots");P(W,ee,Er,"ˊ","\\acute");P(W,ee,Er,"ˋ","\\grave");P(W,ee,Er,"¨","\\ddot");P(W,ee,Er,"~","\\tilde");P(W,ee,Er,"ˉ","\\bar");P(W,ee,Er,"˘","\\breve");P(W,ee,Er,"ˇ","\\check");P(W,ee,Er,"^","\\hat");P(W,ee,Er,"⃗","\\vec");P(W,ee,Er,"˙","\\dot");P(W,ee,Er,"˚","\\mathring");P(W,ee,Ut,"","\\@imath");P(W,ee,Ut,"","\\@jmath");P(W,ee,ye,"ı","ı");P(W,ee,ye,"ȷ","ȷ");P(Ge,ee,ye,"ı","\\i",!0);P(Ge,ee,ye,"ȷ","\\j",!0);P(Ge,ee,ye,"ß","\\ss",!0);P(Ge,ee,ye,"æ","\\ae",!0);P(Ge,ee,ye,"œ","\\oe",!0);P(Ge,ee,ye,"ø","\\o",!0);P(Ge,ee,ye,"Æ","\\AE",!0);P(Ge,ee,ye,"Œ","\\OE",!0);P(Ge,ee,ye,"Ø","\\O",!0);P(Ge,ee,Er,"ˊ","\\'");P(Ge,ee,Er,"ˋ","\\`");P(Ge,ee,Er,"ˆ","\\^");P(Ge,ee,Er,"˜","\\~");P(Ge,ee,Er,"ˉ","\\=");P(Ge,ee,Er,"˘","\\u");P(Ge,ee,Er,"˙","\\.");P(Ge,ee,Er,"¸","\\c");P(Ge,ee,Er,"˚","\\r");P(Ge,ee,Er,"ˇ","\\v");P(Ge,ee,Er,"¨",'\\"');P(Ge,ee,Er,"˝","\\H");P(Ge,ee,Er,"◯","\\textcircled");var qP={"--":!0,"---":!0,"``":!0,"''":!0};P(Ge,ee,ye,"–","--",!0);P(Ge,ee,ye,"–","\\textendash");P(Ge,ee,ye,"—","---",!0);P(Ge,ee,ye,"—","\\textemdash");P(Ge,ee,ye,"‘","`",!0);P(Ge,ee,ye,"‘","\\textquoteleft");P(Ge,ee,ye,"’","'",!0);P(Ge,ee,ye,"’","\\textquoteright");P(Ge,ee,ye,"“","``",!0);P(Ge,ee,ye,"“","\\textquotedblleft");P(Ge,ee,ye,"”","''",!0);P(Ge,ee,ye,"”","\\textquotedblright");P(W,ee,ye,"°","\\degree",!0);P(Ge,ee,ye,"°","\\degree");P(Ge,ee,ye,"°","\\textdegree",!0);P(W,ee,ye,"£","\\pounds");P(W,ee,ye,"£","\\mathsterling",!0);P(Ge,ee,ye,"£","\\pounds");P(Ge,ee,ye,"£","\\textsterling",!0);P(W,_e,ye,"✠","\\maltese");P(Ge,_e,ye,"✠","\\maltese");var gA='0123456789/@."';for(var Pw=0;Pw{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return NA[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return wAn[i]}else{if(r===120485||r===120486)return NA[0];if(120486{if(Lu(e.classes)!==Lu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},UP=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ve=function(n,t,r,s){var i=new Gh(n,t,r,s);return W6(i),i},$u=(e,n,t,r)=>new Gh(e,n,t,r),Ch=function(n,t,r){var s=Ve([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=tt(s.height),s.maxFontSize=1,s},EAn=function(n,t,r,s){var i=new vy(n,t,r,s);return W6(i),i},vl=function(n){var t=new Uh(n);return W6(t),t},Eh=function(n,t){return n instanceof Uh?Ve([],[n],t):n},NAn=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ve(["mspace"],[],n),r=Lr(e,n);return t.style.marginRight=tt(r),t},w1=(e,n,t)=>{var r,s;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 n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},T5={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"}},VP={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},KP=function(n,t){var[r,s,i]=VP[n],a=new Iu(r),o=new dl([a],{width:tt(s),height:tt(i),style:"width:"+tt(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),c=$u(["overlay"],[o],t);return c.height=i,c.style.height=tt(i),c.style.width=tt(s),c},Or={number:3,unit:"mu"},w_={number:4,unit:"mu"},Hc={number:5,unit:"mu"},zAn={mord:{mop:Or,mbin:w_,mrel:Hc,minner:Or},mop:{mord:Or,mop:Or,mrel:Hc,minner:Or},mbin:{mord:w_,mop:w_,mopen:w_,minner:w_},mrel:{mord:Hc,mop:Hc,mopen:Hc,minner:Hc},mopen:{},mclose:{mop:Or,mbin:w_,mrel:Hc,minner:Or},mpunct:{mord:Or,mop:Or,mrel:Hc,mopen:Or,mclose:Or,mpunct:Or,minner:Or},minner:{mord:Or,mop:Or,mbin:w_,mrel:Hc,mopen:Or,mpunct:Or,minner:Or}},jAn={mord:{mop:Or},mop:{mord:Or,mop:Or},mbin:{},mrel:{},mopen:{},mclose:{mop:Or},mpunct:{},minner:{mop:Or}},WP={},tb={},nb={};function ft(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,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:s},c=0;c{var v=k.classes[0],b=w.classes[0];v==="mbin"&&AAn.has(b)?k.classes[0]="mord":b==="mbin"&&TAn.has(v)&&(w.classes[0]="mord")},{node:_},p,m),A5(i,(w,k)=>{var v,b,x=M5(k),y=M5(w),C=x&&y?w.hasClass("mtight")?(v=jAn[x])==null?void 0:v[y]:(b=zAn[x])==null?void 0:b[y]:null;if(C)return GP(C,u)},{node:_},p,m),i},A5=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(_+1,0,p),a++})(a)}s&&n.pop()},QP=function(n){return n instanceof Uh||n instanceof vy||n instanceof Gh&&n.hasClass("enclosing")?n:null},R5=function(n,t){var r=QP(n);if(r){var s=r.children;if(s.length){if(t==="right")return R5(s[s.length-1],"right");if(t==="left")return R5(s[0],"left")}}return n},M5=function(n,t){if(!n)return null;t&&(n=R5(n,t));var r=n.classes[0];return MAn[r]||null},G0=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ve(t.concat(r))},Kn=function(n,t,r){if(!n)return Ve();if(tb[n.type]){var s=tb[n.type](n,t);if(r&&t.size!==r.size){s=Ve(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Xe("Got group of unknown type: '"+n.type+"'")};function k1(e,n){var t=Ve(["base"],e,n),r=Ve(["strut"]);return r.style.height=tt(t.height+t.depth),t.depth&&(r.style.verticalAlign=tt(-t.depth)),t.children.unshift(r),t}function O5(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=xs(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(k1(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(k1(a,n));var u;t?(u=k1(xs(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var h=Ve(["katex-html"],i);if(h.setAttribute("aria-hidden","true"),u){var _=u.children[0];_.style.height=tt(h.height+h.depth),h.depth&&(_.style.verticalAlign=tt(-h.depth))}return h}function XP(e){return new Uh(e)}class Ye{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=Lu(this.classes));for(var r=0;r0&&(n+=' class ="'+Zs(Lu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class os{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Zs(this.toText())}toText(){return this.text}}class YP{constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",tt(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var OAn=new Set(["\\imath","\\jmath"]),DAn=new Set(["mrow","mtable"]),Ka=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(qP.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new os(n)},Q6=function(n){return n.length===1?n[0]:new Ye("mrow",n)},LAn={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"},X6=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=LAn[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(OAn.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=T5[t].fontName;return V6(i,o,r)?T5[t].variant:null};function Uw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof os&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof os&&t.text===","}else return!1}var xa=function(n,t,r){if(n.length===1){var s=dr(n[0],t);return r&&s instanceof Ye&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||Uw(a))){var u=c.children[0];u instanceof Ye&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof os&&h.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var _=c.children[0];_ instanceof os&&_.text.length>0&&(_.text=_.text.slice(0,1)+"̸"+_.text.slice(1),i.pop())}}}i.push(c),a=c}return i},Bu=function(n,t,r){return Q6(xa(n,t,r))},dr=function(n,t){if(!n)return new Ye("mrow");if(nb[n.type])return nb[n.type](n,t);throw new Xe("Got group of unknown type: '"+n.type+"'")};function zA(e,n,t,r,s){var i=xa(e,t),a;i.length===1&&i[0]instanceof Ye&&DAn.has(i[0].type)?a=i[0]:a=new Ye("mrow",i);var o=new Ye("annotation",[new os(n)]);o.setAttribute("encoding","application/x-tex");var c=new Ye("semantics",[a,o]),u=new Ye("math",[c]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var h=s?"katex":"katex-mathml";return Ve([h],[u])}var IAn=[[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]],jA=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],TA=function(n,t){return t.size<2?n:IAn[n-1][t.size-1]};class Qc{constructor(n){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=n.style,this.color=n.color,this.size=n.size||Qc.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=jA[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={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(t,n),new Qc(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:TA(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:jA[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=TA(Qc.BASESIZE,n);return this.size===t&&this.textSize===Qc.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Qc.BASESIZE?["sizing","reset-size"+this.size,"size"+Qc.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=yAn(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Qc.BASESIZE=6;var ZP=function(n){return new Qc({style:n.displayMode?nn.DISPLAY:nn.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},JP=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ve(r,[n])}return n},$An=function(n,t,r){var s=ZP(r),i;if(r.output==="mathml")return zA(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=O5(n,s);i=Ve(["katex"],[a])}else{var o=zA(n,t,s,r.displayMode,!1),c=O5(n,s);i=Ve(["katex"],[o,c])}return JP(i,r)},BAn=function(n,t,r){var s=ZP(r),i=O5(n,s),a=Ve(["katex"],[i]);return JP(a,r)},PAn={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":"="},xy=function(n){var t=new Ye("mo",[new os(PAn[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},FAn={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]},HAn=new Set(["widehat","widecheck","widetilde","utilde"]),wy=function(n,t){function r(){var o=4e5,c=n.label.slice(1);if(HAn.has(c)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,h,_,p;if(u>5)c==="widehat"||c==="widecheck"?(h=420,o=2364,p=.42,_=c+"4"):(h=312,o=2340,p=.34,_="tilde4");else{var m=[1,1,2,2,3,3][u];c==="widehat"||c==="widecheck"?(o=[0,1062,2364,2364,2364][m],h=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],_=c+m):(o=[0,600,1033,2339,2340][m],h=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],_="tilde"+m)}var w=new Iu(_),k=new dl([w],{width:"100%",height:tt(p),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:$u([],[k],t),minWidth:0,height:p}}else{var v=[],b=FAn[c];if(!b)throw new Error('No SVG data for "'+c+'".');var[x,y,C]=b,z=C/1e3,E=x.length,T,j;if(E===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+c+'".');T=["hide-tail"],j=[b[3]]}else if(E===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(E===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+E+" children.");for(var M=0;M0&&(s.style.minWidth=tt(i)),s},qAn=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ve(["stretchy",t],[],i),t==="fbox"){var c=i.color&&i.getColor();c&&(a.style.borderColor=c)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new S5({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new S5({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new dl(u,{width:"100%",height:tt(o)});a=$u([],[h],i)}return a.height=o,a.style.height=tt(o),a},UAn={bin:1,close:1,inner:1,open:1,punct:1,rel:1},GAn={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function VAn(e){return e in UAn}function ln(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function ky(e){var n=Sy(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Sy(e){return e&&(e.type==="atom"||GAn.hasOwnProperty(e.type))?e:null}var eF=e=>{if(e instanceof ma)return e;if(vAn(e)&&e.children.length===1)return eF(e.children[0])},Y6=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=ln(e.base,"accent"),t=r.base,e.base=t,s=gAn(Kn(e,n)),e.base=r):(r=ln(e,"accent"),t=r.base);var i=Kn(t,n.havingCrampedStyle()),a=r.isShifty&&ml(t),o=0;if(a){var c,u;o=(c=(u=eF(i))==null?void 0:u.skew)!=null?c:0}var h=r.label==="\\c",_=h?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=wy(r,n),p=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+tt(2*o)+")",marginLeft:tt(2*o)}:void 0}]});else{var m,w;r.label==="\\vec"?(m=KP("vec",n),w=VP.vec[1]):(m=yy({mode:r.mode,text:r.label},n,"textord"),m=mAn(m),m.italic=0,w=m.width,h&&(_+=m.depth)),p=Ve(["accent-body"],[m]);var k=r.label==="\\textcircled";k&&(p.classes.push("accent-full"),_=i.height);var v=o;k||(v-=w/2),p.style.left=tt(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-_},{type:"elem",elem:p}]})}var b=Ve(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},tF=(e,n)=>{var t=e.isStretchy?xy(e.label):new Ye("mo",[Ka(e.label,e.mode)]),r=new Ye("mover",[dr(e.base,n),t]);return r.setAttribute("accent","true"),r},KAn=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ft({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,n)=>{var t=rb(n[0]),r=!KAn.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:Y6,mathmlBuilder:tF});ft({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[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:t}},htmlBuilder:Y6,mathmlBuilder:tF});ft({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Kn(e.base,n),r=wy(e,n),s=e.label==="\\utilde"?.12:0,i=Gn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ve(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=xy(e.label),r=new Ye("munder",[dr(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var S1=e=>{var n=new Ye("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ft({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,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Eh(Kn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Eh(Kn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=wy(e,n),c=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var h;if(a){var _=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;h=Gn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:_}]})}else h=Gn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:c,wrapperClasses:["svg-align"]}]});return Ve(["mrel","x-arrow"],[h],n)},mathmlBuilder(e,n){var t=xy(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=S1(dr(e.body,n));if(e.below){var i=S1(dr(e.below,n));r=new Ye("munderover",[t,i,s])}else r=new Ye("mover",[t,s])}else if(e.below){var a=S1(dr(e.below,n));r=new Ye("munder",[t,a])}else r=S1(),r=new Ye("mover",[t,r]);return r}});function nF(e,n){var t=xs(e.body,n,!0);return Ve([e.mclass],t,n)}function rF(e,n){var t,r=xa(e.body,n);return e.mclass==="minner"?t=new Ye("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Ye("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Ye("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ft({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:as(s),isCharacterBox:ml(s)}},htmlBuilder:nF,mathmlBuilder:rF});var Cy=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};ft({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Cy(n[0]),body:as(n[1]),isCharacterBox:ml(n[1])}}});ft({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Cy(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:as(s)},c={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[c],isCharacterBox:ml(c)}},htmlBuilder:nF,mathmlBuilder:rF});ft({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Cy(n[0]),body:as(n[0])}},htmlBuilder(e,n){var t=xs(e.body,n,!0),r=Ve([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=xa(e.body,n),r=new Ye("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var WAn={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},AA=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),RA=e=>e.type==="textord"&&e.text==="@",QAn=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function XAn(e,n,t){var r=WAn[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),c={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function YAn(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Xe("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var _=0;_<2;_++){for(var p=!0,m=c+1;mAV=|." after @',a[c]);var w=XAn(u,h,e),k={type:"styling",body:[w],mode:"math",style:"display",resetFont:!0};r.push(k),o=AA()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ft({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Eh(Kn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=tt(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Ye("mrow",[dr(e.label,n)]);return t=new Ye("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Ye("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ft({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Eh(Kn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Ye("mrow",[dr(e.fragment,n)])}});ft({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=ln(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Xe("\\@char with invalid code point "+i);return c<=65535?u=String.fromCharCode(c):(c-=65536,u=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var sF=(e,n)=>{var t=xs(e.body,n.withColor(e.color),!1);return vl(t)},iF=(e,n)=>{var t=xa(e.body,n.withColor(e.color)),r=new Ye("mstyle",t);return r.setAttribute("mathcolor",e.color),r};ft({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=ln(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:as(s)}},htmlBuilder:sF,mathmlBuilder:iF});ft({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=ln(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:sF,mathmlBuilder:iF});ft({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&ln(s,"size").value}},htmlBuilder(e,n){var t=Ve(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=tt(Lr(e.size,n)))),t},mathmlBuilder(e,n){var t=new Ye("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",tt(Lr(e.size,n)))),t}});var D5={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},aF=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Xe("Expected a control sequence",e);return n},ZAn=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},oF=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};ft({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(D5[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=D5[r.text]),ln(n.parseFunction(),"internal");throw new Xe("Invalid token after macro prefix",r)}});ft({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Xe("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Xe('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Xe('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Xe("Expected a macro definition");o[i].push(r.text)}var{tokens:c}=n.gullet.consumeArg();return a&&c.unshift(a),(t==="\\edef"||t==="\\xdef")&&(c=n.gullet.expandTokens(c),c.reverse()),n.gullet.macros.set(s,{tokens:c,numArgs:i,delimiters:o},t===D5[t]),{type:"internal",mode:n.mode}}});ft({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=aF(n.gullet.popToken());n.gullet.consumeSpaces();var s=ZAn(n);return oF(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});ft({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=aF(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return oF(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var a0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=V6(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},Z6=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ve(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},cF=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=tt(i),n.height-=i,n.depth+=i},JAn=function(n,t,r,s,i,a){var o=fi(n,"Main-Regular",i,s),c=Z6(o,t,s,a);return cF(c,s,t),c},eRn=function(n,t,r,s){return fi(n,"Size"+t+"-Regular",r,s)},lF=function(n,t,r,s,i,a){var o=eRn(n,t,i,s),c=Z6(Ve(["delimsizing","size"+t],[o],s),nn.TEXT,s,a);return r&&cF(c,s,nn.TEXT),c},Gw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ve(["delimsizinginner",s],[Ve([],[fi(n,t,r)])]);return{type:"elem",elem:i}},Vw=function(n,t,r){var s=Wo["Size4-Regular"][n.charCodeAt(0)]?Wo["Size4-Regular"][n.charCodeAt(0)][4]:Wo["Size1-Regular"][n.charCodeAt(0)][4],i=new Iu("inner",lAn(n,Math.round(1e3*t))),a=new dl([i],{width:tt(s),height:tt(t),style:"width:"+tt(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=$u([],[a],r);return o.height=t,o.style.height=tt(t),o.style.width=tt(s),{type:"elem",elem:o}},L5=.008,C1={type:"kern",size:-1*L5},tRn=new Set(["|","\\lvert","\\rvert","\\vert"]),nRn=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),uF=function(n,t,r,s,i,a){var o,c,u,h,_="",p=0;o=u=h=n,c=null;var m="Size1-Regular";n==="\\uparrow"?u=h="⏐":n==="\\Uparrow"?u=h="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):tRn.has(n)?(u="∣",_="vert",p=333):nRn.has(n)?(u="∥",_="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",h="⎣",m="Size4-Regular",_="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",h="⎦",m="Size4-Regular",_="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",h="⎣",m="Size4-Regular",_="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=h="⎢",m="Size4-Regular",_="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",h="⎦",m="Size4-Regular",_="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=h="⎥",m="Size4-Regular",_="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",h="⎝",m="Size4-Regular",_="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",h="⎠",m="Size4-Regular",_="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",c="⎨",h="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",c="⎬",h="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",h="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",h="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",h="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",h="⎩",u="⎪",m="Size4-Regular");var w=a0(o,m,i),k=w.height+w.depth,v=a0(u,m,i),b=v.height+v.depth,x=a0(h,m,i),y=x.height+x.depth,C=0,z=1;if(c!==null){var E=a0(c,m,i);C=E.height+E.depth,z=2}var T=k+y+C,j=Math.max(0,Math.ceil((t-T)/(z*b))),M=T+j*z*b,D=s.fontMetrics().axisHeight;r&&(D*=s.sizeMultiplier);var I=M/2-D,$=[];if(_.length>0){var q=M-k-y,H=Math.round(M*1e3),Q=uAn(_,Math.round(q*1e3)),V=new Iu(_,Q),Z=tt(p/1e3),Y=tt(H/1e3),B=new dl([V],{width:Z,height:Y,viewBox:"0 0 "+p+" "+H}),L=$u([],[B],s);L.height=H/1e3,L.style.width=Z,L.style.height=Y,$.push({type:"elem",elem:L})}else{if($.push(Gw(h,m,i)),$.push(C1),c===null){var F=M-k-y+2*L5;$.push(Vw(u,F,s))}else{var U=(M-k-y-C)/2+2*L5;$.push(Vw(u,U,s)),$.push(C1),$.push(Gw(c,m,i)),$.push(C1),$.push(Vw(u,U,s))}$.push(C1),$.push(Gw(o,m,i))}var K=s.havingBaseStyle(nn.TEXT),ne=Gn({positionType:"bottom",positionData:I,children:$});return Z6(Ve(["delimsizing","mult"],[ne],K),nn.TEXT,s,a)},Kw=80,Ww=.08,Qw=function(n,t,r,s,i){var a=cAn(n,s,r),o=new Iu(n,a),c=new dl([o],{width:"400em",height:tt(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return $u(["hide-tail"],[c],i)},rRn=function(n,t){var r=t.havingBaseSizing(),s=pF("\\surd",n*r.sizeMultiplier,hF,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,c,u,h,_;return s.type==="small"?(h=1e3+1e3*a+Kw,n<1?i=1:n<1.4&&(i=.7),c=(1+a+Ww)/i,u=(1+a)/i,o=Qw("sqrtMain",c,h,a,t),o.style.minWidth="0.853em",_=.833/i):s.type==="large"?(h=(1e3+Kw)*y0[s.size],u=(y0[s.size]+a)/i,c=(y0[s.size]+a+Ww)/i,o=Qw("sqrtSize"+s.size,c,h,a,t),o.style.minWidth="1.02em",_=1/i):(c=n+a+Ww,u=n+a,h=Math.floor(1e3*n+a)+Kw,o=Qw("sqrtTall",c,h,a,t),o.style.minWidth="0.742em",_=1.056),o.height=u,o.style.height=tt(c),{span:o,advanceWidth:_,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},_F=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),sRn=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),fF=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),y0=[0,1.2,1.8,2.4,3],dF=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),_F.has(n)||fF.has(n))return lF(n,t,!1,r,s,i);if(sRn.has(n))return uF(n,y0[t],!1,r,s,i);throw new Xe("Illegal delimiter: '"+n+"'")},iRn=[{type:"small",style:nn.SCRIPTSCRIPT},{type:"small",style:nn.SCRIPT},{type:"small",style:nn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],aRn=[{type:"small",style:nn.SCRIPTSCRIPT},{type:"small",style:nn.SCRIPT},{type:"small",style:nn.TEXT},{type:"stack"}],hF=[{type:"small",style:nn.SCRIPTSCRIPT},{type:"small",style:nn.SCRIPT},{type:"small",style:nn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],oRn=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},pF=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},I5=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;fF.has(n)?o=iRn:_F.has(n)?o=hF:o=aRn;var c=pF(n,t,o,s);return c.type==="small"?JAn(n,c.style,r,s,i,a):c.type==="large"?lF(n,c.size,r,s,i,a):uF(n,t,r,s,i,a)},Xw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,u=5/s.fontMetrics().ptPerEm,h=Math.max(t-o,r+o),_=Math.max(h/500*c,2*h-u);return I5(n,_,!0,s,i,a)},MA={"\\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}},cRn=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 OA(e){return"isMiddle"in e}function Ey(e,n){var t=Sy(e);if(t&&cRn.has(t.text))return t;throw t?new Xe("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Xe("Invalid delimiter type '"+e.type+"'",e)}ft({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,n)=>{var t=Ey(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:MA[e.funcName].size,mclass:MA[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ve([e.mclass]):dF(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(Ka(e.delim,e.mode));var t=new Ye("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=tt(y0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function DA(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ft({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Xe("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Ey(n[0],e).text,color:t}}});ft({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Ey(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=ln(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{DA(e);for(var t=xs(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{DA(e);var t=xa(e.body,n);if(e.left!=="."){var r=new Ye("mo",[Ka(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Ye("mo",[Ka(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return Q6(t)}});ft({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Ey(n[0],e);if(!e.parser.leftrightDepth)throw new Xe("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=G0(n,[]):(t=dF(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?Ka("|","text"):Ka(e.delim,e.mode),r=new Ye("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Ny=(e,n)=>{var t=Eh(Kn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=ml(e.body);if(r==="sout")i=Ve(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var c=Lr({number:.6,unit:"pt"},n),u=Lr({number:.35,unit:"ex"},n),h=n.havingBaseSizing();s=s/h.sizeMultiplier;var _=t.height+t.depth+c+u;t.style.paddingLeft=tt(_/2+c);var p=Math.floor(1e3*_*s),m=aAn(p),w=new dl([new Iu("phase",m)],{width:"400em",height:tt(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=$u(["hide-tail"],[w],n),i.style.height=tt(_),a=t.depth+c+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var k,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),k=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=k):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),k=4*b,v=Math.max(0,.25-t.depth)):(k=o?.2:0,v=k),i=qAn(t,r,k,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=tt(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=tt(b),i.style.borderRightWidth=tt(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var x;if(e.backgroundColor)x=Gn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];x=Gn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(x.height=t.height,x.depth=t.depth),/cancel/.test(r)&&!o?Ve(["mord","cancel-lap"],[x],n):Ve(["mord"],[x],n)},zy=(e,n)=>{var t,r=new Ye(e.label.includes("colorbox")?"mpadded":"menclose",[dr(e.body,n)]);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(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+tt(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ft({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=ln(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Ny,mathmlBuilder:zy});ft({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=ln(n[0],"color-token").color,a=ln(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Ny,mathmlBuilder:zy});ft({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});ft({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Ny,mathmlBuilder:zy});ft({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Ny,mathmlBuilder:zy});ft({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var mF={};function cc(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},c=0;c{var n=e.parser.settings;if(!n.displayMode)throw new Xe("{"+e.envName+"} can be used only in display mode.")},lRn=new Set(["gather","gather*"]);function J6(e){if(!e.includes("ed"))return!e.includes("*")}function Wu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:c,singleRow:u,emptySingleRow:h,maxNumCols:_,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Xe("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var w=[],k=[w],v=[],b=[],x=c!=null?[]:void 0;function y(){c&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){x&&(e.gullet.macros.get("\\df@tag")?(x.push(e.subparse([new da("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!c&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(LA(e));;){var z=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var E={type:"ordgroup",mode:e.mode,body:z};t&&(E={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[E]}),w.push(E);var T=e.fetch().text;if(T==="&"){if(_&&w.length===_){if(u||o)throw new Xe("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),w.length===1&&E.type==="styling"&&E.body.length===1&&E.body[0].type==="ordgroup"&&E.body[0].body.length===0&&(k.length>1||!h)&&k.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:He[nt]})}for(C(a[0]),r=0;r0&&(I+=x,THe))for(r=0;r=o)){var ae=void 0;if(s>0||n.hskipBeforeAndAfter){var ce,pe;ae=(ce=(pe=K)==null?void 0:pe.pregap)!=null?ce:p,ae!==0&&(Q=Ve(["arraycolsep"],[]),Q.style.width=tt(ae),H.push(Q))}var be=[];for(r=0;r0){for(var Ct=Ch("hline",t,h),qt=Ch("hdashline",t,h),dt=[{type:"elem",elem:ct,shift:0}];u.length>0;){var ht=u.pop(),Le=ht.pos-$;ht.isDashed?dt.push({type:"elem",elem:qt,shift:Le}):dt.push({type:"elem",elem:Ct,shift:Le})}ct=Gn({positionType:"individualShift",children:dt})}if(Z.length===0)return Ve(["mord"],[ct],t);var me=Gn({positionType:"individualShift",children:Z}),Te=Ve(["tag"],[me],t);return vl([ct,Te])},uRn={c:"center ",l:"left ",r:"right "},uc=function(n,t){for(var r=[],s=new Ye("mtd",[],["mtr-glue"]),i=new Ye("mtd",[],["mml-eqn-num"]),a=0;a0){var w=n.cols,k="",v=!1,b=0,x=w.length;w[0].type==="separator"&&(p+="top ",b=1),w[w.length-1].type==="separator"&&(p+="bottom ",x-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var D=1;D0&&m&&(v=1),r[w]={type:"align",align:k,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};cc({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Sy(n[0]),r=t?[n[0]]:ln(n[0],"ordgroup").body,s=r.map(function(a){var o=ky(a),c=o.text;if("lcr".includes(c))return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new Xe("Unknown column alignment: "+c,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Wu(e.parser,i,eC(e.envName))},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Xe("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Wu(e.parser,r,eC(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Wu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Sy(n[0]),r=t?[n[0]]:ln(n[0],"ordgroup").body,s=r.map(function(o){var c=ky(o),u=c.text;if("lc".includes(u))return{type:"align",align:u};throw new Xe("Unknown column alignment: "+u,o)});if(s.length>1)throw new Xe("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Wu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Xe("{subarray} can contain only one column");return a},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Wu(e.parser,n,eC(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:vF,htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){lRn.has(e.envName)&&jy(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:J6(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Wu(e.parser,n,"display")},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:vF,htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){jy(e);var n={autoTag:J6(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Wu(e.parser,n,"display")},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["CD"],props:{numArgs:0},handler(e){return jy(e),YAn(e.parser)},htmlBuilder:lc,mathmlBuilder:uc});ie("\\nonumber","\\gdef\\@eqnsw{0}");ie("\\notag","\\nonumber");ft({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Xe(e.funcName+" valid only within array environment")}});var IA=mF;ft({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Xe("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Kn(e.body,r)},yF=(e,n)=>{var t=e.font,r=n.withFont(t);return dr(e.body,r)},$A={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ft({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=rb(n[0]),i=r;return i in $A&&(i=$A[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:bF,mathmlBuilder:yF});ft({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Cy(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:ml(r)}}});ft({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:bF,mathmlBuilder:yF});var _Rn=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Kn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,c=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?w=3*p:w=7*p,k=n.fontMetrics().denom1):(_>0?(m=n.fontMetrics().num2,w=p):(m=n.fontMetrics().num3,w=3*p),k=n.fontMetrics().denom2);var v;if(h){var x=n.fontMetrics().axisHeight;m-a.depth-(x+.5*_){var t=new Ye("mfrac",[dr(e.numer,n),dr(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Lr(e.barSize,n);t.setAttribute("linethickness",tt(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Ye("mo",[new os(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Ye("mo",[new os(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return Q6(s)}return t},xF=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};ft({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,c=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",c=")";break;case"\\\\bracefrac":a=!1,o="\\{",c="\\}";break;case"\\\\brackfrac":a=!1,o="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",h=null;return u||r.startsWith("\\d")?h="display":r.startsWith("\\t")&&(h="text"),xF({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:c,barSize:null},h)},htmlBuilder:_Rn,mathmlBuilder:fRn});ft({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var BA=["display","text","script","scriptscript"],PA=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};ft({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=rb(n[0]),a=i.type==="atom"&&i.family==="open"?PA(i.text):null,o=rb(n[1]),c=o.type==="atom"&&o.family==="close"?PA(o.text):null,u=ln(n[2],"size"),h,_=null;u.isBlank?h=!0:(_=u.value,h=_.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var w=ln(m.body[0],"textord");p=BA[Number(w.text)]}}else m=ln(m,"textord"),p=BA[Number(m.text)];return xF({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:h,barSize:_,leftDelim:a,rightDelim:c},p)}});ft({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:ln(n[0],"size").value,token:s}}});ft({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=ln(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var wF=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Kn(e.sup,n.havingStyle(t.sup()),n):Kn(e.sub,n.havingStyle(t.sub()),n),s=ln(e.base,"horizBrace")):s=ln(e,"horizBrace");var i=Kn(s.base,n.havingBaseStyle(nn.DISPLAY)),a=wy(s,n),o;if(s.isOver?o=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=Gn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var c=Ve(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=Gn({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]})}return Ve(["minner",s.isOver?"mover":"munder"],[o],n)},dRn=(e,n)=>{var t=xy(e.label);return new Ye(e.isOver?"mover":"munder",[dr(e.base,n),t])};ft({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:wF,mathmlBuilder:dRn});ft({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=ln(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:as(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=xs(e.body,n,!1);return EAn(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=Bu(e.body,n);return t instanceof Ye||(t=new Ye("mrow",[t])),t.setAttribute("href",e.href),t}});ft({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=ln(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=ln(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,c={};switch(r){case"\\htmlClass":c.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),h=0;h{var t=xs(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ve(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>Bu(e.body,n)});ft({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:as(n[0]),mathml:as(n[1])}},htmlBuilder:(e,n)=>{var t=xs(e.html,n,!1);return vl(t)},mathmlBuilder:(e,n)=>Bu(e.mathml,n)});var Yw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Xe("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!BP(r))throw new Xe("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ft({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var c=ln(t[0],"raw").string,u=c.split(","),h=0;h{var t=Lr(e.height,n),r=0;e.totalheight.number>0&&(r=Lr(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Lr(e.width,n));var i={height:tt(t+r)};s>0&&(i.width=tt(s)),r>0&&(i.verticalAlign=tt(-r));var a=new hAn(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Ye("mglyph",[]);t.setAttribute("alt",e.alt);var r=Lr(e.height,n),s=0;if(e.totalheight.number>0&&(s=Lr(e.totalheight,n)-r,t.setAttribute("valign",tt(-s))),t.setAttribute("height",tt(r+s)),e.width.number>0){var i=Lr(e.width,n);t.setAttribute("width",tt(i))}return t.setAttribute("src",e.src),t}});ft({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=ln(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return GP(e.dimension,n)},mathmlBuilder(e,n){var t=Lr(e.dimension,n);return new YP(t)}});ft({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ve([],[Kn(e.body,n)]),t=Ve(["inner"],[t],n)):t=Ve(["inner"],[Kn(e.body,n)]);var r=Ve(["fix"],[]),s=Ve([e.alignment],[t,r],n),i=Ve(["strut"]);return i.style.height=tt(s.height+s.depth),s.depth&&(i.style.verticalAlign=tt(-s.depth)),s.children.unshift(i),s=Ve(["thinbox"],[s],n),Ve(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Ye("mpadded",[dr(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});ft({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ft({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Xe("Mismatched "+e.funcName)}});var FA=(e,n)=>{switch(n.style.size){case nn.DISPLAY.size:return e.display;case nn.TEXT.size:return e.text;case nn.SCRIPT.size:return e.script;case nn.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ft({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:as(n[0]),text:as(n[1]),script:as(n[2]),scriptscript:as(n[3])}},htmlBuilder:(e,n)=>{var t=FA(e,n),r=xs(t,n,!1);return vl(r)},mathmlBuilder:(e,n)=>{var t=FA(e,n);return Bu(t,n)}});var kF=(e,n,t,r,s,i,a)=>{e=Ve([],[e]);var o=t&&ml(t),c,u;if(n){var h=Kn(n,r.havingStyle(s.sup()),r);u={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(t){var _=Kn(t,r.havingStyle(s.sub()),r);c={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-_.height)}}var p;if(u&&c){var m=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+a;p=Gn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:tt(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:tt(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(c){var w=e.height-a;p=Gn({positionType:"top",positionData:w,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:tt(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e}]})}else if(u){var k=e.depth+a;p=Gn({positionType:"bottom",positionData:k,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:tt(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(c&&i!==0&&!o){var b=Ve(["mspace"],[],r);b.style.marginRight=tt(i),v.unshift(b)}return Ve(["mop","op-limits"],v,r)},SF=new Set(["\\smallint"]),Kh=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=ln(e.base,"op"),s=!0):i=ln(e,"op");var a=n.style,o=!1;a.size===nn.DISPLAY.size&&i.symbol&&!SF.has(i.name)&&(o=!0);var c,u;if(i.symbol){var h=o?"Size2-Regular":"Size1-Regular",_="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(_=i.name.slice(1),i.name=_==="oiint"?"\\iint":"\\iiint"),c=fi(i.name,h,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=c.italic,_.length>0){var p=KP(_+"Size"+(o?"2":"1"),n);c=Gn({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+_,c.classes.unshift("mop"),c.italic=u}}else if(i.body){var m=xs(i.body,n,!0);m.length===1&&m[0]instanceof ma?(c=m[0],c.classes[0]="mop"):c=Ve(["mop"],m,n)}else{for(var w=[],k=1;k{var t;if(e.symbol)t=new Ye("mo",[Ka(e.name,e.mode)]),SF.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Ye("mo",xa(e.body,n));else{t=new Ye("mi",[new os(e.name.slice(1))]);var r=new Ye("mo",[Ka("⁡","text")]);e.parentIsSupSub?t=new Ye("mrow",[t,r]):t=XP([t,r])}return t},hRn={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ft({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=hRn[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Kh,mathmlBuilder:$m});ft({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:as(r)}},htmlBuilder:Kh,mathmlBuilder:$m});var pRn={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ft({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:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Kh,mathmlBuilder:$m});ft({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Kh,mathmlBuilder:$m});ft({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=pRn[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Kh,mathmlBuilder:$m});var CF=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=ln(e.base,"operatorname"),s=!0):i=ln(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(_=>{var p="text"in _?_.text:void 0;return typeof p=="string"?{type:"textord",mode:_.mode,text:p}:_}),c=xs(o,n.withFont("mathrm"),!0),u=0;u{for(var t=xa(e.body,n.withFont("mathrm")),r=!0,s=0;sh.toText()).join("");t=[new os(o)]}var c=new Ye("mi",t);c.setAttribute("mathvariant","normal");var u=new Ye("mo",[Ka("⁡","text")]);return e.parentIsSupSub?new Ye("mrow",[c,u]):XP([c,u])};ft({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:as(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:CF,mathmlBuilder:mRn});ie("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Rf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?vl(xs(e.body,n,!1)):Ve(["mord"],xs(e.body,n,!0),n)},mathmlBuilder(e,n){return Bu(e.body,n,!0)}});ft({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Kn(e.body,n.havingCrampedStyle()),r=Ch("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ve(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Ye("mo",[new os("‾")]);t.setAttribute("stretchy","true");var r=new Ye("mover",[dr(e.body,n),t]);return r.setAttribute("accent","true"),r}});ft({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:as(r)}},htmlBuilder:(e,n)=>{var t=xs(e.body,n.withPhantom(),!1);return vl(t)},mathmlBuilder:(e,n)=>{var t=xa(e.body,n);return new Ye("mphantom",t)}});ie("\\hphantom","\\smash{\\phantom{#1}}");ft({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ve(["inner"],[Kn(e.body,n.withPhantom())]),r=Ve(["fix"],[]);return Ve(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=xa(as(e.body),n),r=new Ye("mphantom",t),s=new Ye("mpadded",[r]);return s.setAttribute("width","0px"),s}});ft({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=ln(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Kn(e.body,n),r=Lr(e.dy,n);return Gn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ye("mpadded",[dr(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});ft({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});ft({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=ln(n[0],"size"),a=ln(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&ln(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ve(["mord","rule"],[],n),r=Lr(e.width,n),s=Lr(e.height,n),i=e.shift?Lr(e.shift,n):0;return t.style.borderRightWidth=tt(r),t.style.borderTopWidth=tt(s),t.style.bottom=tt(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Lr(e.width,n),r=Lr(e.height,n),s=e.shift?Lr(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Ye("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",tt(t)),a.setAttribute("height",tt(r));var o=new Ye("mpadded",[a]);return s>=0?o.setAttribute("height",tt(s)):(o.setAttribute("height",tt(s)),o.setAttribute("depth",tt(-s))),o.setAttribute("voffset",tt(s)),o}});function EF(e,n,t){for(var r=xs(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return EF(e.body,t,n)};ft({type:"sizing",names:HA,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:HA.indexOf(r)+1,body:i}},htmlBuilder:gRn,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=xa(e.body,t),s=new Ye("mstyle",r);return s.setAttribute("mathsize",tt(t.sizeMultiplier)),s}});ft({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&ln(t[0],"ordgroup");if(a)for(var o,c=0;c{var t=Ve([],[Kn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ve(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Ye("mpadded",[dr(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});ft({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Kn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Eh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+_-t.height-t.depth)/2);var p=c.height-t.height-a-u;t.style.paddingLeft=tt(h);var m=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:c},{type:"kern",size:u}]});if(e.index){var w=n.havingStyle(nn.SCRIPTSCRIPT),k=Kn(e.index,w,n),v=.6*(m.height-m.depth),b=Gn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:k}]}),x=Ve(["root"],[b]);return Ve(["mord","sqrt"],[x,m],n)}else return Ve(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Ye("mroot",[dr(t,n),dr(r,n)]):new Ye("msqrt",[dr(t,n)])}});var $5={display:nn.DISPLAY,text:nn.TEXT,script:nn.SCRIPT,scriptscript:nn.SCRIPTSCRIPT};function vRn(e){return e in $5}ft({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!vRn(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=$5[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),EF(e.body,r,n)},mathmlBuilder(e,n){var t=$5[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=xa(e.body,r),i=new Ye("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var bRn=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===nn.DISPLAY.size||r.alwaysHandleSupSub);return s?Kh:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===nn.DISPLAY.size||r.limits);return i?CF:null}else{if(r.type==="accent")return ml(r.base)?Y6:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?wF:null}else return null}else return null};Rf({type:"supsub",htmlBuilder(e,n){var t=bRn(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Kn(r,n),o,c,u=n.fontMetrics(),h=0,_=0,p=r&&ml(r);if(s){var m=n.havingStyle(n.style.sup());o=Kn(s,m,n),p||(h=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var w=n.havingStyle(n.style.sub());c=Kn(i,w,n),p||(_=a.depth+w.fontMetrics().subDrop*w.sizeMultiplier/n.sizeMultiplier)}var k;n.style===nn.DISPLAY?k=u.sup1:n.style.cramped?k=u.sup3:k=u.sup2;var v=n.sizeMultiplier,b=tt(.5/u.ptPerEm/v),x=null;if(c){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof ma||y){var C;x=tt(-((C=a.italic)!=null?C:0))}}var z;if(o&&c){h=Math.max(h,k,o.depth+.25*u.xHeight),_=Math.max(_,u.sub2);var E=u.defaultRuleThickness,T=4*E;if(h-o.depth-(c.height-_)0&&(h+=j,_-=j)}var M=[{type:"elem",elem:c,shift:_,marginRight:b,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:b}];z=Gn({positionType:"individualShift",children:M})}else if(c){_=Math.max(_,u.sub1,c.height-.8*u.xHeight);var D=[{type:"elem",elem:c,marginLeft:x,marginRight:b}];z=Gn({positionType:"shift",positionData:_,children:D})}else if(o)h=Math.max(h,k,o.depth+.25*u.xHeight),z=Gn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var I=M5(a,"right")||"mord";return Ve([I],[a,Ve(["msupsub"],[z])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[dr(e.base,n)];e.sub&&i.push(dr(e.sub,n)),e.sup&&i.push(dr(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===nn.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===nn.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var c=e.base;c&&c.type==="op"&&c.limits&&(n.style===nn.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||n.style===nn.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===nn.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===nn.DISPLAY)?a="mover":a="msup"}return new Ye(a,i)}});Rf({type:"atom",htmlBuilder(e,n){return K6(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Ye("mo",[Ka(e.text,e.mode)]);if(e.family==="bin"){var r=X6(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var NF={mi:"italic",mn:"normal",mtext:"normal"};Rf({type:"mathord",htmlBuilder(e,n){return yy(e,n,"mathord")},mathmlBuilder(e,n){var t=new Ye("mi",[Ka(e.text,e.mode,n)]),r=X6(e,n)||"italic";return r!==NF[t.type]&&t.setAttribute("mathvariant",r),t}});Rf({type:"textord",htmlBuilder(e,n){return yy(e,n,"textord")},mathmlBuilder(e,n){var t=Ka(e.text,e.mode,n),r=X6(e,n)||"normal",s;return e.mode==="text"?s=new Ye("mtext",[t]):/[0-9]/.test(e.text)?s=new Ye("mn",[t]):e.text==="\\prime"?s=new Ye("mo",[t]):s=new Ye("mi",[t]),r!==NF[s.type]&&s.setAttribute("mathvariant",r),s}});var Zw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Jw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Rf({type:"spacing",htmlBuilder(e,n){if(Jw.hasOwnProperty(e.text)){var t=Jw[e.text].className||"";if(e.mode==="text"){var r=yy(e,n,"textord");return r.classes.push(t),r}else return Ve(["mspace",t],[K6(e.text,e.mode,n)],n)}else{if(Zw.hasOwnProperty(e.text))return Ve(["mspace",Zw[e.text]],[],n);throw new Xe('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(Jw.hasOwnProperty(e.text))t=new Ye("mtext",[new os(" ")]);else{if(Zw.hasOwnProperty(e.text))return new Ye("mspace");throw new Xe('Unknown type of space "'+e.text+'"')}return t}});var qA=()=>{var e=new Ye("mtd",[]);return e.setAttribute("width","50%"),e};Rf({type:"tag",mathmlBuilder(e,n){var t=new Ye("mtable",[new Ye("mtr",[qA(),new Ye("mtd",[Bu(e.body,n)]),qA(),new Ye("mtd",[Bu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var UA={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},GA={"\\textbf":"textbf","\\textmd":"textmd"},yRn={"\\textit":"textit","\\textup":"textup"},VA=(e,n)=>{var t=e.font;if(t){if(UA[t])return n.withTextFontFamily(UA[t]);if(GA[t])return n.withTextFontWeight(GA[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(yRn[t])};ft({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:as(s),font:r}},htmlBuilder(e,n){var t=VA(e,n),r=xs(e.body,t,!0);return Ve(["mord","text"],r,t)},mathmlBuilder(e,n){var t=VA(e,n);return Bu(e.body,t)}});ft({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Kn(e.body,n),r=Ch("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=Gn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ve(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Ye("mo",[new os("‾")]);t.setAttribute("stretchy","true");var r=new Ye("munder",[dr(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});ft({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Kn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return Gn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ye("mpadded",[dr(e.body,n)],["vcenter"]);return new Ye("mrow",[t])}});ft({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Xe("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=KA(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),Nu=WP,zF=`[ \r +-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 _An(e){return"toText"in e}class Uh{constructor(n){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=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(_An(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var k5={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},fAn={ex:!0,em:!0,mu:!0},BP=function(n){return typeof n!="string"&&(n=n.unit),n in k5||n in fAn||n==="ex"},Lr=function(n,t){var r;if(n.unit in k5)r=k5[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Xe("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},tt=function(n){return+n.toFixed(4)+"em"},Lu=function(n){return n.filter(t=>t).join(" ")},G6=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=PTn(r)+":"+s+";")}return t},PP=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},FP=function(n){var t=document.createElement(n);t.className=Lu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,HP=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Zs(Lu(this.classes))+'"');var r=G6(this.style);r&&(t+=' style="'+Zs(r)+'"');for(var s of Object.keys(this.attributes)){if(dAn.test(s))throw new Xe("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Zs(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class Gh{constructor(n,t,r,s){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,PP.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return FP.call(this,"span")}toMarkup(){return HP.call(this,"span")}}class vy{constructor(n,t,r,s){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,PP.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return FP.call(this,"a")}toMarkup(){return HP.call(this,"a")}}class hAn{constructor(n,t,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=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Zs(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=tt(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=Lu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+tt(this.italic)+";"),r+=G6(this.style),r&&(n=!0,t+=' style="'+Zs(r)+'"');var s=Zs(this.text);return n?(t+=">",t+=s,t+="",t):s}}class dl{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class S5{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var vAn=e=>e instanceof Gh||e instanceof vy||e instanceof Uh,Wo={"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]}},b1={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]},mA={Å:"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 bAn(e,n){Wo[e]=n}function V6(e,n,t){if(!Wo[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Wo[n][r];if(!s&&e[0]in mA&&(r=mA[e[0]].charCodeAt(0),s=Wo[n][r]),!s&&t==="text"&&$P(r)&&(s=Wo[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var Bw={};function yAn(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!Bw[n]){var t=Bw[n]={cssEmPerMu:b1.quad[n]/18};for(var r in b1)b1.hasOwnProperty(r)&&(t[r]=b1[r][n])}return Bw[n]}var Sr={math:{},text:{}};function P(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var W="math",Ge="text",ee="main",_e="ams",Er="accent-token",vt="bin",vi="close",Vh="inner",Ut="mathord",cs="op-token",ya="open",Im="punct",fe="rel",gl="spacing",ye="textord";P(W,ee,fe,"≡","\\equiv",!0);P(W,ee,fe,"≺","\\prec",!0);P(W,ee,fe,"≻","\\succ",!0);P(W,ee,fe,"∼","\\sim",!0);P(W,ee,fe,"⊥","\\perp");P(W,ee,fe,"⪯","\\preceq",!0);P(W,ee,fe,"⪰","\\succeq",!0);P(W,ee,fe,"≃","\\simeq",!0);P(W,ee,fe,"∣","\\mid",!0);P(W,ee,fe,"≪","\\ll",!0);P(W,ee,fe,"≫","\\gg",!0);P(W,ee,fe,"≍","\\asymp",!0);P(W,ee,fe,"∥","\\parallel");P(W,ee,fe,"⋈","\\bowtie",!0);P(W,ee,fe,"⌣","\\smile",!0);P(W,ee,fe,"⊑","\\sqsubseteq",!0);P(W,ee,fe,"⊒","\\sqsupseteq",!0);P(W,ee,fe,"≐","\\doteq",!0);P(W,ee,fe,"⌢","\\frown",!0);P(W,ee,fe,"∋","\\ni",!0);P(W,ee,fe,"∝","\\propto",!0);P(W,ee,fe,"⊢","\\vdash",!0);P(W,ee,fe,"⊣","\\dashv",!0);P(W,ee,fe,"∋","\\owns");P(W,ee,Im,".","\\ldotp");P(W,ee,Im,"⋅","\\cdotp");P(W,ee,Im,"⋅","·");P(Ge,ee,ye,"⋅","·");P(W,ee,ye,"#","\\#");P(Ge,ee,ye,"#","\\#");P(W,ee,ye,"&","\\&");P(Ge,ee,ye,"&","\\&");P(W,ee,ye,"ℵ","\\aleph",!0);P(W,ee,ye,"∀","\\forall",!0);P(W,ee,ye,"ℏ","\\hbar",!0);P(W,ee,ye,"∃","\\exists",!0);P(W,ee,ye,"∇","\\nabla",!0);P(W,ee,ye,"♭","\\flat",!0);P(W,ee,ye,"ℓ","\\ell",!0);P(W,ee,ye,"♮","\\natural",!0);P(W,ee,ye,"♣","\\clubsuit",!0);P(W,ee,ye,"℘","\\wp",!0);P(W,ee,ye,"♯","\\sharp",!0);P(W,ee,ye,"♢","\\diamondsuit",!0);P(W,ee,ye,"ℜ","\\Re",!0);P(W,ee,ye,"♡","\\heartsuit",!0);P(W,ee,ye,"ℑ","\\Im",!0);P(W,ee,ye,"♠","\\spadesuit",!0);P(W,ee,ye,"§","\\S",!0);P(Ge,ee,ye,"§","\\S");P(W,ee,ye,"¶","\\P",!0);P(Ge,ee,ye,"¶","\\P");P(W,ee,ye,"†","\\dag");P(Ge,ee,ye,"†","\\dag");P(Ge,ee,ye,"†","\\textdagger");P(W,ee,ye,"‡","\\ddag");P(Ge,ee,ye,"‡","\\ddag");P(Ge,ee,ye,"‡","\\textdaggerdbl");P(W,ee,vi,"⎱","\\rmoustache",!0);P(W,ee,ya,"⎰","\\lmoustache",!0);P(W,ee,vi,"⟯","\\rgroup",!0);P(W,ee,ya,"⟮","\\lgroup",!0);P(W,ee,vt,"∓","\\mp",!0);P(W,ee,vt,"⊖","\\ominus",!0);P(W,ee,vt,"⊎","\\uplus",!0);P(W,ee,vt,"⊓","\\sqcap",!0);P(W,ee,vt,"∗","\\ast");P(W,ee,vt,"⊔","\\sqcup",!0);P(W,ee,vt,"◯","\\bigcirc",!0);P(W,ee,vt,"∙","\\bullet",!0);P(W,ee,vt,"‡","\\ddagger");P(W,ee,vt,"≀","\\wr",!0);P(W,ee,vt,"⨿","\\amalg");P(W,ee,vt,"&","\\And");P(W,ee,fe,"⟵","\\longleftarrow",!0);P(W,ee,fe,"⇐","\\Leftarrow",!0);P(W,ee,fe,"⟸","\\Longleftarrow",!0);P(W,ee,fe,"⟶","\\longrightarrow",!0);P(W,ee,fe,"⇒","\\Rightarrow",!0);P(W,ee,fe,"⟹","\\Longrightarrow",!0);P(W,ee,fe,"↔","\\leftrightarrow",!0);P(W,ee,fe,"⟷","\\longleftrightarrow",!0);P(W,ee,fe,"⇔","\\Leftrightarrow",!0);P(W,ee,fe,"⟺","\\Longleftrightarrow",!0);P(W,ee,fe,"↦","\\mapsto",!0);P(W,ee,fe,"⟼","\\longmapsto",!0);P(W,ee,fe,"↗","\\nearrow",!0);P(W,ee,fe,"↩","\\hookleftarrow",!0);P(W,ee,fe,"↪","\\hookrightarrow",!0);P(W,ee,fe,"↘","\\searrow",!0);P(W,ee,fe,"↼","\\leftharpoonup",!0);P(W,ee,fe,"⇀","\\rightharpoonup",!0);P(W,ee,fe,"↙","\\swarrow",!0);P(W,ee,fe,"↽","\\leftharpoondown",!0);P(W,ee,fe,"⇁","\\rightharpoondown",!0);P(W,ee,fe,"↖","\\nwarrow",!0);P(W,ee,fe,"⇌","\\rightleftharpoons",!0);P(W,_e,fe,"≮","\\nless",!0);P(W,_e,fe,"","\\@nleqslant");P(W,_e,fe,"","\\@nleqq");P(W,_e,fe,"⪇","\\lneq",!0);P(W,_e,fe,"≨","\\lneqq",!0);P(W,_e,fe,"","\\@lvertneqq");P(W,_e,fe,"⋦","\\lnsim",!0);P(W,_e,fe,"⪉","\\lnapprox",!0);P(W,_e,fe,"⊀","\\nprec",!0);P(W,_e,fe,"⋠","\\npreceq",!0);P(W,_e,fe,"⋨","\\precnsim",!0);P(W,_e,fe,"⪹","\\precnapprox",!0);P(W,_e,fe,"≁","\\nsim",!0);P(W,_e,fe,"","\\@nshortmid");P(W,_e,fe,"∤","\\nmid",!0);P(W,_e,fe,"⊬","\\nvdash",!0);P(W,_e,fe,"⊭","\\nvDash",!0);P(W,_e,fe,"⋪","\\ntriangleleft");P(W,_e,fe,"⋬","\\ntrianglelefteq",!0);P(W,_e,fe,"⊊","\\subsetneq",!0);P(W,_e,fe,"","\\@varsubsetneq");P(W,_e,fe,"⫋","\\subsetneqq",!0);P(W,_e,fe,"","\\@varsubsetneqq");P(W,_e,fe,"≯","\\ngtr",!0);P(W,_e,fe,"","\\@ngeqslant");P(W,_e,fe,"","\\@ngeqq");P(W,_e,fe,"⪈","\\gneq",!0);P(W,_e,fe,"≩","\\gneqq",!0);P(W,_e,fe,"","\\@gvertneqq");P(W,_e,fe,"⋧","\\gnsim",!0);P(W,_e,fe,"⪊","\\gnapprox",!0);P(W,_e,fe,"⊁","\\nsucc",!0);P(W,_e,fe,"⋡","\\nsucceq",!0);P(W,_e,fe,"⋩","\\succnsim",!0);P(W,_e,fe,"⪺","\\succnapprox",!0);P(W,_e,fe,"≆","\\ncong",!0);P(W,_e,fe,"","\\@nshortparallel");P(W,_e,fe,"∦","\\nparallel",!0);P(W,_e,fe,"⊯","\\nVDash",!0);P(W,_e,fe,"⋫","\\ntriangleright");P(W,_e,fe,"⋭","\\ntrianglerighteq",!0);P(W,_e,fe,"","\\@nsupseteqq");P(W,_e,fe,"⊋","\\supsetneq",!0);P(W,_e,fe,"","\\@varsupsetneq");P(W,_e,fe,"⫌","\\supsetneqq",!0);P(W,_e,fe,"","\\@varsupsetneqq");P(W,_e,fe,"⊮","\\nVdash",!0);P(W,_e,fe,"⪵","\\precneqq",!0);P(W,_e,fe,"⪶","\\succneqq",!0);P(W,_e,fe,"","\\@nsubseteqq");P(W,_e,vt,"⊴","\\unlhd");P(W,_e,vt,"⊵","\\unrhd");P(W,_e,fe,"↚","\\nleftarrow",!0);P(W,_e,fe,"↛","\\nrightarrow",!0);P(W,_e,fe,"⇍","\\nLeftarrow",!0);P(W,_e,fe,"⇏","\\nRightarrow",!0);P(W,_e,fe,"↮","\\nleftrightarrow",!0);P(W,_e,fe,"⇎","\\nLeftrightarrow",!0);P(W,_e,fe,"△","\\vartriangle");P(W,_e,ye,"ℏ","\\hslash");P(W,_e,ye,"▽","\\triangledown");P(W,_e,ye,"◊","\\lozenge");P(W,_e,ye,"Ⓢ","\\circledS");P(W,_e,ye,"®","\\circledR");P(Ge,_e,ye,"®","\\circledR");P(W,_e,ye,"∡","\\measuredangle",!0);P(W,_e,ye,"∄","\\nexists");P(W,_e,ye,"℧","\\mho");P(W,_e,ye,"Ⅎ","\\Finv",!0);P(W,_e,ye,"⅁","\\Game",!0);P(W,_e,ye,"‵","\\backprime");P(W,_e,ye,"▲","\\blacktriangle");P(W,_e,ye,"▼","\\blacktriangledown");P(W,_e,ye,"■","\\blacksquare");P(W,_e,ye,"⧫","\\blacklozenge");P(W,_e,ye,"★","\\bigstar");P(W,_e,ye,"∢","\\sphericalangle",!0);P(W,_e,ye,"∁","\\complement",!0);P(W,_e,ye,"ð","\\eth",!0);P(Ge,ee,ye,"ð","ð");P(W,_e,ye,"╱","\\diagup");P(W,_e,ye,"╲","\\diagdown");P(W,_e,ye,"□","\\square");P(W,_e,ye,"□","\\Box");P(W,_e,ye,"◊","\\Diamond");P(W,_e,ye,"¥","\\yen",!0);P(Ge,_e,ye,"¥","\\yen",!0);P(W,_e,ye,"✓","\\checkmark",!0);P(Ge,_e,ye,"✓","\\checkmark");P(W,_e,ye,"ℶ","\\beth",!0);P(W,_e,ye,"ℸ","\\daleth",!0);P(W,_e,ye,"ℷ","\\gimel",!0);P(W,_e,ye,"ϝ","\\digamma",!0);P(W,_e,ye,"ϰ","\\varkappa");P(W,_e,ya,"┌","\\@ulcorner",!0);P(W,_e,vi,"┐","\\@urcorner",!0);P(W,_e,ya,"└","\\@llcorner",!0);P(W,_e,vi,"┘","\\@lrcorner",!0);P(W,_e,fe,"≦","\\leqq",!0);P(W,_e,fe,"⩽","\\leqslant",!0);P(W,_e,fe,"⪕","\\eqslantless",!0);P(W,_e,fe,"≲","\\lesssim",!0);P(W,_e,fe,"⪅","\\lessapprox",!0);P(W,_e,fe,"≊","\\approxeq",!0);P(W,_e,vt,"⋖","\\lessdot");P(W,_e,fe,"⋘","\\lll",!0);P(W,_e,fe,"≶","\\lessgtr",!0);P(W,_e,fe,"⋚","\\lesseqgtr",!0);P(W,_e,fe,"⪋","\\lesseqqgtr",!0);P(W,_e,fe,"≑","\\doteqdot");P(W,_e,fe,"≓","\\risingdotseq",!0);P(W,_e,fe,"≒","\\fallingdotseq",!0);P(W,_e,fe,"∽","\\backsim",!0);P(W,_e,fe,"⋍","\\backsimeq",!0);P(W,_e,fe,"⫅","\\subseteqq",!0);P(W,_e,fe,"⋐","\\Subset",!0);P(W,_e,fe,"⊏","\\sqsubset",!0);P(W,_e,fe,"≼","\\preccurlyeq",!0);P(W,_e,fe,"⋞","\\curlyeqprec",!0);P(W,_e,fe,"≾","\\precsim",!0);P(W,_e,fe,"⪷","\\precapprox",!0);P(W,_e,fe,"⊲","\\vartriangleleft");P(W,_e,fe,"⊴","\\trianglelefteq");P(W,_e,fe,"⊨","\\vDash",!0);P(W,_e,fe,"⊪","\\Vvdash",!0);P(W,_e,fe,"⌣","\\smallsmile");P(W,_e,fe,"⌢","\\smallfrown");P(W,_e,fe,"≏","\\bumpeq",!0);P(W,_e,fe,"≎","\\Bumpeq",!0);P(W,_e,fe,"≧","\\geqq",!0);P(W,_e,fe,"⩾","\\geqslant",!0);P(W,_e,fe,"⪖","\\eqslantgtr",!0);P(W,_e,fe,"≳","\\gtrsim",!0);P(W,_e,fe,"⪆","\\gtrapprox",!0);P(W,_e,vt,"⋗","\\gtrdot");P(W,_e,fe,"⋙","\\ggg",!0);P(W,_e,fe,"≷","\\gtrless",!0);P(W,_e,fe,"⋛","\\gtreqless",!0);P(W,_e,fe,"⪌","\\gtreqqless",!0);P(W,_e,fe,"≖","\\eqcirc",!0);P(W,_e,fe,"≗","\\circeq",!0);P(W,_e,fe,"≜","\\triangleq",!0);P(W,_e,fe,"∼","\\thicksim");P(W,_e,fe,"≈","\\thickapprox");P(W,_e,fe,"⫆","\\supseteqq",!0);P(W,_e,fe,"⋑","\\Supset",!0);P(W,_e,fe,"⊐","\\sqsupset",!0);P(W,_e,fe,"≽","\\succcurlyeq",!0);P(W,_e,fe,"⋟","\\curlyeqsucc",!0);P(W,_e,fe,"≿","\\succsim",!0);P(W,_e,fe,"⪸","\\succapprox",!0);P(W,_e,fe,"⊳","\\vartriangleright");P(W,_e,fe,"⊵","\\trianglerighteq");P(W,_e,fe,"⊩","\\Vdash",!0);P(W,_e,fe,"∣","\\shortmid");P(W,_e,fe,"∥","\\shortparallel");P(W,_e,fe,"≬","\\between",!0);P(W,_e,fe,"⋔","\\pitchfork",!0);P(W,_e,fe,"∝","\\varpropto");P(W,_e,fe,"◀","\\blacktriangleleft");P(W,_e,fe,"∴","\\therefore",!0);P(W,_e,fe,"∍","\\backepsilon");P(W,_e,fe,"▶","\\blacktriangleright");P(W,_e,fe,"∵","\\because",!0);P(W,_e,fe,"⋘","\\llless");P(W,_e,fe,"⋙","\\gggtr");P(W,_e,vt,"⊲","\\lhd");P(W,_e,vt,"⊳","\\rhd");P(W,_e,fe,"≂","\\eqsim",!0);P(W,ee,fe,"⋈","\\Join");P(W,_e,fe,"≑","\\Doteq",!0);P(W,_e,vt,"∔","\\dotplus",!0);P(W,_e,vt,"∖","\\smallsetminus");P(W,_e,vt,"⋒","\\Cap",!0);P(W,_e,vt,"⋓","\\Cup",!0);P(W,_e,vt,"⩞","\\doublebarwedge",!0);P(W,_e,vt,"⊟","\\boxminus",!0);P(W,_e,vt,"⊞","\\boxplus",!0);P(W,_e,vt,"⋇","\\divideontimes",!0);P(W,_e,vt,"⋉","\\ltimes",!0);P(W,_e,vt,"⋊","\\rtimes",!0);P(W,_e,vt,"⋋","\\leftthreetimes",!0);P(W,_e,vt,"⋌","\\rightthreetimes",!0);P(W,_e,vt,"⋏","\\curlywedge",!0);P(W,_e,vt,"⋎","\\curlyvee",!0);P(W,_e,vt,"⊝","\\circleddash",!0);P(W,_e,vt,"⊛","\\circledast",!0);P(W,_e,vt,"⋅","\\centerdot");P(W,_e,vt,"⊺","\\intercal",!0);P(W,_e,vt,"⋒","\\doublecap");P(W,_e,vt,"⋓","\\doublecup");P(W,_e,vt,"⊠","\\boxtimes",!0);P(W,_e,fe,"⇢","\\dashrightarrow",!0);P(W,_e,fe,"⇠","\\dashleftarrow",!0);P(W,_e,fe,"⇇","\\leftleftarrows",!0);P(W,_e,fe,"⇆","\\leftrightarrows",!0);P(W,_e,fe,"⇚","\\Lleftarrow",!0);P(W,_e,fe,"↞","\\twoheadleftarrow",!0);P(W,_e,fe,"↢","\\leftarrowtail",!0);P(W,_e,fe,"↫","\\looparrowleft",!0);P(W,_e,fe,"⇋","\\leftrightharpoons",!0);P(W,_e,fe,"↶","\\curvearrowleft",!0);P(W,_e,fe,"↺","\\circlearrowleft",!0);P(W,_e,fe,"↰","\\Lsh",!0);P(W,_e,fe,"⇈","\\upuparrows",!0);P(W,_e,fe,"↿","\\upharpoonleft",!0);P(W,_e,fe,"⇃","\\downharpoonleft",!0);P(W,ee,fe,"⊶","\\origof",!0);P(W,ee,fe,"⊷","\\imageof",!0);P(W,_e,fe,"⊸","\\multimap",!0);P(W,_e,fe,"↭","\\leftrightsquigarrow",!0);P(W,_e,fe,"⇉","\\rightrightarrows",!0);P(W,_e,fe,"⇄","\\rightleftarrows",!0);P(W,_e,fe,"↠","\\twoheadrightarrow",!0);P(W,_e,fe,"↣","\\rightarrowtail",!0);P(W,_e,fe,"↬","\\looparrowright",!0);P(W,_e,fe,"↷","\\curvearrowright",!0);P(W,_e,fe,"↻","\\circlearrowright",!0);P(W,_e,fe,"↱","\\Rsh",!0);P(W,_e,fe,"⇊","\\downdownarrows",!0);P(W,_e,fe,"↾","\\upharpoonright",!0);P(W,_e,fe,"⇂","\\downharpoonright",!0);P(W,_e,fe,"⇝","\\rightsquigarrow",!0);P(W,_e,fe,"⇝","\\leadsto");P(W,_e,fe,"⇛","\\Rrightarrow",!0);P(W,_e,fe,"↾","\\restriction");P(W,ee,ye,"‘","`");P(W,ee,ye,"$","\\$");P(Ge,ee,ye,"$","\\$");P(Ge,ee,ye,"$","\\textdollar");P(W,ee,ye,"%","\\%");P(Ge,ee,ye,"%","\\%");P(W,ee,ye,"_","\\_");P(Ge,ee,ye,"_","\\_");P(Ge,ee,ye,"_","\\textunderscore");P(W,ee,ye,"∠","\\angle",!0);P(W,ee,ye,"∞","\\infty",!0);P(W,ee,ye,"′","\\prime");P(W,ee,ye,"△","\\triangle");P(W,ee,ye,"Γ","\\Gamma",!0);P(W,ee,ye,"Δ","\\Delta",!0);P(W,ee,ye,"Θ","\\Theta",!0);P(W,ee,ye,"Λ","\\Lambda",!0);P(W,ee,ye,"Ξ","\\Xi",!0);P(W,ee,ye,"Π","\\Pi",!0);P(W,ee,ye,"Σ","\\Sigma",!0);P(W,ee,ye,"Υ","\\Upsilon",!0);P(W,ee,ye,"Φ","\\Phi",!0);P(W,ee,ye,"Ψ","\\Psi",!0);P(W,ee,ye,"Ω","\\Omega",!0);P(W,ee,ye,"A","Α");P(W,ee,ye,"B","Β");P(W,ee,ye,"E","Ε");P(W,ee,ye,"Z","Ζ");P(W,ee,ye,"H","Η");P(W,ee,ye,"I","Ι");P(W,ee,ye,"K","Κ");P(W,ee,ye,"M","Μ");P(W,ee,ye,"N","Ν");P(W,ee,ye,"O","Ο");P(W,ee,ye,"P","Ρ");P(W,ee,ye,"T","Τ");P(W,ee,ye,"X","Χ");P(W,ee,ye,"¬","\\neg",!0);P(W,ee,ye,"¬","\\lnot");P(W,ee,ye,"⊤","\\top");P(W,ee,ye,"⊥","\\bot");P(W,ee,ye,"∅","\\emptyset");P(W,_e,ye,"∅","\\varnothing");P(W,ee,Ut,"α","\\alpha",!0);P(W,ee,Ut,"β","\\beta",!0);P(W,ee,Ut,"γ","\\gamma",!0);P(W,ee,Ut,"δ","\\delta",!0);P(W,ee,Ut,"ϵ","\\epsilon",!0);P(W,ee,Ut,"ζ","\\zeta",!0);P(W,ee,Ut,"η","\\eta",!0);P(W,ee,Ut,"θ","\\theta",!0);P(W,ee,Ut,"ι","\\iota",!0);P(W,ee,Ut,"κ","\\kappa",!0);P(W,ee,Ut,"λ","\\lambda",!0);P(W,ee,Ut,"μ","\\mu",!0);P(W,ee,Ut,"ν","\\nu",!0);P(W,ee,Ut,"ξ","\\xi",!0);P(W,ee,Ut,"ο","\\omicron",!0);P(W,ee,Ut,"π","\\pi",!0);P(W,ee,Ut,"ρ","\\rho",!0);P(W,ee,Ut,"σ","\\sigma",!0);P(W,ee,Ut,"τ","\\tau",!0);P(W,ee,Ut,"υ","\\upsilon",!0);P(W,ee,Ut,"ϕ","\\phi",!0);P(W,ee,Ut,"χ","\\chi",!0);P(W,ee,Ut,"ψ","\\psi",!0);P(W,ee,Ut,"ω","\\omega",!0);P(W,ee,Ut,"ε","\\varepsilon",!0);P(W,ee,Ut,"ϑ","\\vartheta",!0);P(W,ee,Ut,"ϖ","\\varpi",!0);P(W,ee,Ut,"ϱ","\\varrho",!0);P(W,ee,Ut,"ς","\\varsigma",!0);P(W,ee,Ut,"φ","\\varphi",!0);P(W,ee,vt,"∗","*",!0);P(W,ee,vt,"+","+");P(W,ee,vt,"−","-",!0);P(W,ee,vt,"⋅","\\cdot",!0);P(W,ee,vt,"∘","\\circ",!0);P(W,ee,vt,"÷","\\div",!0);P(W,ee,vt,"±","\\pm",!0);P(W,ee,vt,"×","\\times",!0);P(W,ee,vt,"∩","\\cap",!0);P(W,ee,vt,"∪","\\cup",!0);P(W,ee,vt,"∖","\\setminus",!0);P(W,ee,vt,"∧","\\land");P(W,ee,vt,"∨","\\lor");P(W,ee,vt,"∧","\\wedge",!0);P(W,ee,vt,"∨","\\vee",!0);P(W,ee,ye,"√","\\surd");P(W,ee,ya,"⟨","\\langle",!0);P(W,ee,ya,"∣","\\lvert");P(W,ee,ya,"∥","\\lVert");P(W,ee,vi,"?","?");P(W,ee,vi,"!","!");P(W,ee,vi,"⟩","\\rangle",!0);P(W,ee,vi,"∣","\\rvert");P(W,ee,vi,"∥","\\rVert");P(W,ee,fe,"=","=");P(W,ee,fe,":",":");P(W,ee,fe,"≈","\\approx",!0);P(W,ee,fe,"≅","\\cong",!0);P(W,ee,fe,"≥","\\ge");P(W,ee,fe,"≥","\\geq",!0);P(W,ee,fe,"←","\\gets");P(W,ee,fe,">","\\gt",!0);P(W,ee,fe,"∈","\\in",!0);P(W,ee,fe,"","\\@not");P(W,ee,fe,"⊂","\\subset",!0);P(W,ee,fe,"⊃","\\supset",!0);P(W,ee,fe,"⊆","\\subseteq",!0);P(W,ee,fe,"⊇","\\supseteq",!0);P(W,_e,fe,"⊈","\\nsubseteq",!0);P(W,_e,fe,"⊉","\\nsupseteq",!0);P(W,ee,fe,"⊨","\\models");P(W,ee,fe,"←","\\leftarrow",!0);P(W,ee,fe,"≤","\\le");P(W,ee,fe,"≤","\\leq",!0);P(W,ee,fe,"<","\\lt",!0);P(W,ee,fe,"→","\\rightarrow",!0);P(W,ee,fe,"→","\\to");P(W,_e,fe,"≱","\\ngeq",!0);P(W,_e,fe,"≰","\\nleq",!0);P(W,ee,gl," ","\\ ");P(W,ee,gl," ","\\space");P(W,ee,gl," ","\\nobreakspace");P(Ge,ee,gl," ","\\ ");P(Ge,ee,gl," "," ");P(Ge,ee,gl," ","\\space");P(Ge,ee,gl," ","\\nobreakspace");P(W,ee,gl,"","\\nobreak");P(W,ee,gl,"","\\allowbreak");P(W,ee,Im,",",",");P(W,ee,Im,";",";");P(W,_e,vt,"⊼","\\barwedge",!0);P(W,_e,vt,"⊻","\\veebar",!0);P(W,ee,vt,"⊙","\\odot",!0);P(W,ee,vt,"⊕","\\oplus",!0);P(W,ee,vt,"⊗","\\otimes",!0);P(W,ee,ye,"∂","\\partial",!0);P(W,ee,vt,"⊘","\\oslash",!0);P(W,_e,vt,"⊚","\\circledcirc",!0);P(W,_e,vt,"⊡","\\boxdot",!0);P(W,ee,vt,"△","\\bigtriangleup");P(W,ee,vt,"▽","\\bigtriangledown");P(W,ee,vt,"†","\\dagger");P(W,ee,vt,"⋄","\\diamond");P(W,ee,vt,"⋆","\\star");P(W,ee,vt,"◃","\\triangleleft");P(W,ee,vt,"▹","\\triangleright");P(W,ee,ya,"{","\\{");P(Ge,ee,ye,"{","\\{");P(Ge,ee,ye,"{","\\textbraceleft");P(W,ee,vi,"}","\\}");P(Ge,ee,ye,"}","\\}");P(Ge,ee,ye,"}","\\textbraceright");P(W,ee,ya,"{","\\lbrace");P(W,ee,vi,"}","\\rbrace");P(W,ee,ya,"[","\\lbrack",!0);P(Ge,ee,ye,"[","\\lbrack",!0);P(W,ee,vi,"]","\\rbrack",!0);P(Ge,ee,ye,"]","\\rbrack",!0);P(W,ee,ya,"(","\\lparen",!0);P(W,ee,vi,")","\\rparen",!0);P(Ge,ee,ye,"<","\\textless",!0);P(Ge,ee,ye,">","\\textgreater",!0);P(W,ee,ya,"⌊","\\lfloor",!0);P(W,ee,vi,"⌋","\\rfloor",!0);P(W,ee,ya,"⌈","\\lceil",!0);P(W,ee,vi,"⌉","\\rceil",!0);P(W,ee,ye,"\\","\\backslash");P(W,ee,ye,"∣","|");P(W,ee,ye,"∣","\\vert");P(Ge,ee,ye,"|","\\textbar",!0);P(W,ee,ye,"∥","\\|");P(W,ee,ye,"∥","\\Vert");P(Ge,ee,ye,"∥","\\textbardbl");P(Ge,ee,ye,"~","\\textasciitilde");P(Ge,ee,ye,"\\","\\textbackslash");P(Ge,ee,ye,"^","\\textasciicircum");P(W,ee,fe,"↑","\\uparrow",!0);P(W,ee,fe,"⇑","\\Uparrow",!0);P(W,ee,fe,"↓","\\downarrow",!0);P(W,ee,fe,"⇓","\\Downarrow",!0);P(W,ee,fe,"↕","\\updownarrow",!0);P(W,ee,fe,"⇕","\\Updownarrow",!0);P(W,ee,cs,"∐","\\coprod");P(W,ee,cs,"⋁","\\bigvee");P(W,ee,cs,"⋀","\\bigwedge");P(W,ee,cs,"⨄","\\biguplus");P(W,ee,cs,"⋂","\\bigcap");P(W,ee,cs,"⋃","\\bigcup");P(W,ee,cs,"∫","\\int");P(W,ee,cs,"∫","\\intop");P(W,ee,cs,"∬","\\iint");P(W,ee,cs,"∭","\\iiint");P(W,ee,cs,"∏","\\prod");P(W,ee,cs,"∑","\\sum");P(W,ee,cs,"⨂","\\bigotimes");P(W,ee,cs,"⨁","\\bigoplus");P(W,ee,cs,"⨀","\\bigodot");P(W,ee,cs,"∮","\\oint");P(W,ee,cs,"∯","\\oiint");P(W,ee,cs,"∰","\\oiiint");P(W,ee,cs,"⨆","\\bigsqcup");P(W,ee,cs,"∫","\\smallint");P(Ge,ee,Vh,"…","\\textellipsis");P(W,ee,Vh,"…","\\mathellipsis");P(Ge,ee,Vh,"…","\\ldots",!0);P(W,ee,Vh,"…","\\ldots",!0);P(W,ee,Vh,"⋯","\\@cdots",!0);P(W,ee,Vh,"⋱","\\ddots",!0);P(W,ee,ye,"⋮","\\varvdots");P(Ge,ee,ye,"⋮","\\varvdots");P(W,ee,Er,"ˊ","\\acute");P(W,ee,Er,"ˋ","\\grave");P(W,ee,Er,"¨","\\ddot");P(W,ee,Er,"~","\\tilde");P(W,ee,Er,"ˉ","\\bar");P(W,ee,Er,"˘","\\breve");P(W,ee,Er,"ˇ","\\check");P(W,ee,Er,"^","\\hat");P(W,ee,Er,"⃗","\\vec");P(W,ee,Er,"˙","\\dot");P(W,ee,Er,"˚","\\mathring");P(W,ee,Ut,"","\\@imath");P(W,ee,Ut,"","\\@jmath");P(W,ee,ye,"ı","ı");P(W,ee,ye,"ȷ","ȷ");P(Ge,ee,ye,"ı","\\i",!0);P(Ge,ee,ye,"ȷ","\\j",!0);P(Ge,ee,ye,"ß","\\ss",!0);P(Ge,ee,ye,"æ","\\ae",!0);P(Ge,ee,ye,"œ","\\oe",!0);P(Ge,ee,ye,"ø","\\o",!0);P(Ge,ee,ye,"Æ","\\AE",!0);P(Ge,ee,ye,"Œ","\\OE",!0);P(Ge,ee,ye,"Ø","\\O",!0);P(Ge,ee,Er,"ˊ","\\'");P(Ge,ee,Er,"ˋ","\\`");P(Ge,ee,Er,"ˆ","\\^");P(Ge,ee,Er,"˜","\\~");P(Ge,ee,Er,"ˉ","\\=");P(Ge,ee,Er,"˘","\\u");P(Ge,ee,Er,"˙","\\.");P(Ge,ee,Er,"¸","\\c");P(Ge,ee,Er,"˚","\\r");P(Ge,ee,Er,"ˇ","\\v");P(Ge,ee,Er,"¨",'\\"');P(Ge,ee,Er,"˝","\\H");P(Ge,ee,Er,"◯","\\textcircled");var qP={"--":!0,"---":!0,"``":!0,"''":!0};P(Ge,ee,ye,"–","--",!0);P(Ge,ee,ye,"–","\\textendash");P(Ge,ee,ye,"—","---",!0);P(Ge,ee,ye,"—","\\textemdash");P(Ge,ee,ye,"‘","`",!0);P(Ge,ee,ye,"‘","\\textquoteleft");P(Ge,ee,ye,"’","'",!0);P(Ge,ee,ye,"’","\\textquoteright");P(Ge,ee,ye,"“","``",!0);P(Ge,ee,ye,"“","\\textquotedblleft");P(Ge,ee,ye,"”","''",!0);P(Ge,ee,ye,"”","\\textquotedblright");P(W,ee,ye,"°","\\degree",!0);P(Ge,ee,ye,"°","\\degree");P(Ge,ee,ye,"°","\\textdegree",!0);P(W,ee,ye,"£","\\pounds");P(W,ee,ye,"£","\\mathsterling",!0);P(Ge,ee,ye,"£","\\pounds");P(Ge,ee,ye,"£","\\textsterling",!0);P(W,_e,ye,"✠","\\maltese");P(Ge,_e,ye,"✠","\\maltese");var gA='0123456789/@."';for(var Pw=0;Pw{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return NA[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return wAn[i]}else{if(r===120485||r===120486)return NA[0];if(120486{if(Lu(e.classes)!==Lu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},UP=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ve=function(n,t,r,s){var i=new Gh(n,t,r,s);return W6(i),i},$u=(e,n,t,r)=>new Gh(e,n,t,r),Ch=function(n,t,r){var s=Ve([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=tt(s.height),s.maxFontSize=1,s},EAn=function(n,t,r,s){var i=new vy(n,t,r,s);return W6(i),i},vl=function(n){var t=new Uh(n);return W6(t),t},Eh=function(n,t){return n instanceof Uh?Ve([],[n],t):n},NAn=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ve(["mspace"],[],n),r=Lr(e,n);return t.style.marginRight=tt(r),t},w1=(e,n,t)=>{var r,s;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 n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},T5={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"}},VP={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},KP=function(n,t){var[r,s,i]=VP[n],a=new Iu(r),o=new dl([a],{width:tt(s),height:tt(i),style:"width:"+tt(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),c=$u(["overlay"],[o],t);return c.height=i,c.style.height=tt(i),c.style.width=tt(s),c},Or={number:3,unit:"mu"},w_={number:4,unit:"mu"},Hc={number:5,unit:"mu"},zAn={mord:{mop:Or,mbin:w_,mrel:Hc,minner:Or},mop:{mord:Or,mop:Or,mrel:Hc,minner:Or},mbin:{mord:w_,mop:w_,mopen:w_,minner:w_},mrel:{mord:Hc,mop:Hc,mopen:Hc,minner:Hc},mopen:{},mclose:{mop:Or,mbin:w_,mrel:Hc,minner:Or},mpunct:{mord:Or,mop:Or,mrel:Hc,mopen:Or,mclose:Or,mpunct:Or,minner:Or},minner:{mord:Or,mop:Or,mbin:w_,mrel:Hc,mopen:Or,mpunct:Or,minner:Or}},jAn={mord:{mop:Or},mop:{mord:Or,mop:Or},mbin:{},mrel:{},mopen:{},mclose:{mop:Or},mpunct:{},minner:{mop:Or}},WP={},tb={},nb={};function ft(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,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:s},c=0;c{var v=k.classes[0],b=w.classes[0];v==="mbin"&&AAn.has(b)?k.classes[0]="mord":b==="mbin"&&TAn.has(v)&&(w.classes[0]="mord")},{node:_},p,m),A5(i,(w,k)=>{var v,b,x=M5(k),y=M5(w),C=x&&y?w.hasClass("mtight")?(v=jAn[x])==null?void 0:v[y]:(b=zAn[x])==null?void 0:b[y]:null;if(C)return GP(C,u)},{node:_},p,m),i},A5=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(_+1,0,p),a++})(a)}s&&n.pop()},QP=function(n){return n instanceof Uh||n instanceof vy||n instanceof Gh&&n.hasClass("enclosing")?n:null},R5=function(n,t){var r=QP(n);if(r){var s=r.children;if(s.length){if(t==="right")return R5(s[s.length-1],"right");if(t==="left")return R5(s[0],"left")}}return n},M5=function(n,t){if(!n)return null;t&&(n=R5(n,t));var r=n.classes[0];return MAn[r]||null},G0=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ve(t.concat(r))},Kn=function(n,t,r){if(!n)return Ve();if(tb[n.type]){var s=tb[n.type](n,t);if(r&&t.size!==r.size){s=Ve(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Xe("Got group of unknown type: '"+n.type+"'")};function k1(e,n){var t=Ve(["base"],e,n),r=Ve(["strut"]);return r.style.height=tt(t.height+t.depth),t.depth&&(r.style.verticalAlign=tt(-t.depth)),t.children.unshift(r),t}function O5(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=xs(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(k1(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(k1(a,n));var u;t?(u=k1(xs(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var h=Ve(["katex-html"],i);if(h.setAttribute("aria-hidden","true"),u){var _=u.children[0];_.style.height=tt(h.height+h.depth),h.depth&&(_.style.verticalAlign=tt(-h.depth))}return h}function XP(e){return new Uh(e)}class Ye{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=Lu(this.classes));for(var r=0;r0&&(n+=' class ="'+Zs(Lu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class os{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Zs(this.toText())}toText(){return this.text}}class YP{constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",tt(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var OAn=new Set(["\\imath","\\jmath"]),DAn=new Set(["mrow","mtable"]),Ka=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(qP.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new os(n)},Q6=function(n){return n.length===1?n[0]:new Ye("mrow",n)},LAn={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"},X6=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=LAn[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(OAn.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=T5[t].fontName;return V6(i,o,r)?T5[t].variant:null};function Uw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof os&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof os&&t.text===","}else return!1}var xa=function(n,t,r){if(n.length===1){var s=dr(n[0],t);return r&&s instanceof Ye&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||Uw(a))){var u=c.children[0];u instanceof Ye&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof os&&h.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var _=c.children[0];_ instanceof os&&_.text.length>0&&(_.text=_.text.slice(0,1)+"̸"+_.text.slice(1),i.pop())}}}i.push(c),a=c}return i},Bu=function(n,t,r){return Q6(xa(n,t,r))},dr=function(n,t){if(!n)return new Ye("mrow");if(nb[n.type])return nb[n.type](n,t);throw new Xe("Got group of unknown type: '"+n.type+"'")};function zA(e,n,t,r,s){var i=xa(e,t),a;i.length===1&&i[0]instanceof Ye&&DAn.has(i[0].type)?a=i[0]:a=new Ye("mrow",i);var o=new Ye("annotation",[new os(n)]);o.setAttribute("encoding","application/x-tex");var c=new Ye("semantics",[a,o]),u=new Ye("math",[c]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var h=s?"katex":"katex-mathml";return Ve([h],[u])}var IAn=[[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]],jA=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],TA=function(n,t){return t.size<2?n:IAn[n-1][t.size-1]};class Qc{constructor(n){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=n.style,this.color=n.color,this.size=n.size||Qc.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=jA[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={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(t,n),new Qc(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:TA(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:jA[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=TA(Qc.BASESIZE,n);return this.size===t&&this.textSize===Qc.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Qc.BASESIZE?["sizing","reset-size"+this.size,"size"+Qc.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=yAn(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Qc.BASESIZE=6;var ZP=function(n){return new Qc({style:n.displayMode?nn.DISPLAY:nn.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},JP=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ve(r,[n])}return n},$An=function(n,t,r){var s=ZP(r),i;if(r.output==="mathml")return zA(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=O5(n,s);i=Ve(["katex"],[a])}else{var o=zA(n,t,s,r.displayMode,!1),c=O5(n,s);i=Ve(["katex"],[o,c])}return JP(i,r)},BAn=function(n,t,r){var s=ZP(r),i=O5(n,s),a=Ve(["katex"],[i]);return JP(a,r)},PAn={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":"="},xy=function(n){var t=new Ye("mo",[new os(PAn[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},FAn={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]},HAn=new Set(["widehat","widecheck","widetilde","utilde"]),wy=function(n,t){function r(){var o=4e5,c=n.label.slice(1);if(HAn.has(c)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,h,_,p;if(u>5)c==="widehat"||c==="widecheck"?(h=420,o=2364,p=.42,_=c+"4"):(h=312,o=2340,p=.34,_="tilde4");else{var m=[1,1,2,2,3,3][u];c==="widehat"||c==="widecheck"?(o=[0,1062,2364,2364,2364][m],h=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],_=c+m):(o=[0,600,1033,2339,2340][m],h=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],_="tilde"+m)}var w=new Iu(_),k=new dl([w],{width:"100%",height:tt(p),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:$u([],[k],t),minWidth:0,height:p}}else{var v=[],b=FAn[c];if(!b)throw new Error('No SVG data for "'+c+'".');var[x,y,C]=b,z=C/1e3,N=x.length,T,j;if(N===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+c+'".');T=["hide-tail"],j=[b[3]]}else if(N===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(N===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+N+" children.");for(var M=0;M0&&(s.style.minWidth=tt(i)),s},qAn=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ve(["stretchy",t],[],i),t==="fbox"){var c=i.color&&i.getColor();c&&(a.style.borderColor=c)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new S5({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new S5({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new dl(u,{width:"100%",height:tt(o)});a=$u([],[h],i)}return a.height=o,a.style.height=tt(o),a},UAn={bin:1,close:1,inner:1,open:1,punct:1,rel:1},GAn={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function VAn(e){return e in UAn}function ln(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function ky(e){var n=Sy(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Sy(e){return e&&(e.type==="atom"||GAn.hasOwnProperty(e.type))?e:null}var eF=e=>{if(e instanceof ma)return e;if(vAn(e)&&e.children.length===1)return eF(e.children[0])},Y6=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=ln(e.base,"accent"),t=r.base,e.base=t,s=gAn(Kn(e,n)),e.base=r):(r=ln(e,"accent"),t=r.base);var i=Kn(t,n.havingCrampedStyle()),a=r.isShifty&&ml(t),o=0;if(a){var c,u;o=(c=(u=eF(i))==null?void 0:u.skew)!=null?c:0}var h=r.label==="\\c",_=h?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=wy(r,n),p=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+tt(2*o)+")",marginLeft:tt(2*o)}:void 0}]});else{var m,w;r.label==="\\vec"?(m=KP("vec",n),w=VP.vec[1]):(m=yy({mode:r.mode,text:r.label},n,"textord"),m=mAn(m),m.italic=0,w=m.width,h&&(_+=m.depth)),p=Ve(["accent-body"],[m]);var k=r.label==="\\textcircled";k&&(p.classes.push("accent-full"),_=i.height);var v=o;k||(v-=w/2),p.style.left=tt(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-_},{type:"elem",elem:p}]})}var b=Ve(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},tF=(e,n)=>{var t=e.isStretchy?xy(e.label):new Ye("mo",[Ka(e.label,e.mode)]),r=new Ye("mover",[dr(e.base,n),t]);return r.setAttribute("accent","true"),r},KAn=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ft({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,n)=>{var t=rb(n[0]),r=!KAn.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:Y6,mathmlBuilder:tF});ft({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[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:t}},htmlBuilder:Y6,mathmlBuilder:tF});ft({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Kn(e.base,n),r=wy(e,n),s=e.label==="\\utilde"?.12:0,i=Gn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ve(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=xy(e.label),r=new Ye("munder",[dr(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var S1=e=>{var n=new Ye("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ft({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,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Eh(Kn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Eh(Kn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=wy(e,n),c=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var h;if(a){var _=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;h=Gn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:_}]})}else h=Gn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:c,wrapperClasses:["svg-align"]}]});return Ve(["mrel","x-arrow"],[h],n)},mathmlBuilder(e,n){var t=xy(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=S1(dr(e.body,n));if(e.below){var i=S1(dr(e.below,n));r=new Ye("munderover",[t,i,s])}else r=new Ye("mover",[t,s])}else if(e.below){var a=S1(dr(e.below,n));r=new Ye("munder",[t,a])}else r=S1(),r=new Ye("mover",[t,r]);return r}});function nF(e,n){var t=xs(e.body,n,!0);return Ve([e.mclass],t,n)}function rF(e,n){var t,r=xa(e.body,n);return e.mclass==="minner"?t=new Ye("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Ye("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Ye("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ft({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:as(s),isCharacterBox:ml(s)}},htmlBuilder:nF,mathmlBuilder:rF});var Cy=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};ft({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Cy(n[0]),body:as(n[1]),isCharacterBox:ml(n[1])}}});ft({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Cy(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:as(s)},c={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[c],isCharacterBox:ml(c)}},htmlBuilder:nF,mathmlBuilder:rF});ft({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Cy(n[0]),body:as(n[0])}},htmlBuilder(e,n){var t=xs(e.body,n,!0),r=Ve([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=xa(e.body,n),r=new Ye("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var WAn={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},AA=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),RA=e=>e.type==="textord"&&e.text==="@",QAn=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function XAn(e,n,t){var r=WAn[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),c={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function YAn(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Xe("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var _=0;_<2;_++){for(var p=!0,m=c+1;mAV=|." after @',a[c]);var w=XAn(u,h,e),k={type:"styling",body:[w],mode:"math",style:"display",resetFont:!0};r.push(k),o=AA()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ft({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Eh(Kn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=tt(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Ye("mrow",[dr(e.label,n)]);return t=new Ye("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Ye("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ft({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Eh(Kn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Ye("mrow",[dr(e.fragment,n)])}});ft({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=ln(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Xe("\\@char with invalid code point "+i);return c<=65535?u=String.fromCharCode(c):(c-=65536,u=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var sF=(e,n)=>{var t=xs(e.body,n.withColor(e.color),!1);return vl(t)},iF=(e,n)=>{var t=xa(e.body,n.withColor(e.color)),r=new Ye("mstyle",t);return r.setAttribute("mathcolor",e.color),r};ft({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=ln(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:as(s)}},htmlBuilder:sF,mathmlBuilder:iF});ft({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=ln(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:sF,mathmlBuilder:iF});ft({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&ln(s,"size").value}},htmlBuilder(e,n){var t=Ve(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=tt(Lr(e.size,n)))),t},mathmlBuilder(e,n){var t=new Ye("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",tt(Lr(e.size,n)))),t}});var D5={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},aF=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Xe("Expected a control sequence",e);return n},ZAn=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},oF=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};ft({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(D5[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=D5[r.text]),ln(n.parseFunction(),"internal");throw new Xe("Invalid token after macro prefix",r)}});ft({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Xe("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Xe('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Xe('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Xe("Expected a macro definition");o[i].push(r.text)}var{tokens:c}=n.gullet.consumeArg();return a&&c.unshift(a),(t==="\\edef"||t==="\\xdef")&&(c=n.gullet.expandTokens(c),c.reverse()),n.gullet.macros.set(s,{tokens:c,numArgs:i,delimiters:o},t===D5[t]),{type:"internal",mode:n.mode}}});ft({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=aF(n.gullet.popToken());n.gullet.consumeSpaces();var s=ZAn(n);return oF(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});ft({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=aF(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return oF(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var a0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=V6(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},Z6=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ve(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},cF=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=tt(i),n.height-=i,n.depth+=i},JAn=function(n,t,r,s,i,a){var o=fi(n,"Main-Regular",i,s),c=Z6(o,t,s,a);return cF(c,s,t),c},eRn=function(n,t,r,s){return fi(n,"Size"+t+"-Regular",r,s)},lF=function(n,t,r,s,i,a){var o=eRn(n,t,i,s),c=Z6(Ve(["delimsizing","size"+t],[o],s),nn.TEXT,s,a);return r&&cF(c,s,nn.TEXT),c},Gw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ve(["delimsizinginner",s],[Ve([],[fi(n,t,r)])]);return{type:"elem",elem:i}},Vw=function(n,t,r){var s=Wo["Size4-Regular"][n.charCodeAt(0)]?Wo["Size4-Regular"][n.charCodeAt(0)][4]:Wo["Size1-Regular"][n.charCodeAt(0)][4],i=new Iu("inner",lAn(n,Math.round(1e3*t))),a=new dl([i],{width:tt(s),height:tt(t),style:"width:"+tt(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=$u([],[a],r);return o.height=t,o.style.height=tt(t),o.style.width=tt(s),{type:"elem",elem:o}},L5=.008,C1={type:"kern",size:-1*L5},tRn=new Set(["|","\\lvert","\\rvert","\\vert"]),nRn=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),uF=function(n,t,r,s,i,a){var o,c,u,h,_="",p=0;o=u=h=n,c=null;var m="Size1-Regular";n==="\\uparrow"?u=h="⏐":n==="\\Uparrow"?u=h="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):tRn.has(n)?(u="∣",_="vert",p=333):nRn.has(n)?(u="∥",_="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",h="⎣",m="Size4-Regular",_="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",h="⎦",m="Size4-Regular",_="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",h="⎣",m="Size4-Regular",_="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=h="⎢",m="Size4-Regular",_="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",h="⎦",m="Size4-Regular",_="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=h="⎥",m="Size4-Regular",_="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",h="⎝",m="Size4-Regular",_="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",h="⎠",m="Size4-Regular",_="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",c="⎨",h="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",c="⎬",h="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",h="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",h="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",h="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",h="⎩",u="⎪",m="Size4-Regular");var w=a0(o,m,i),k=w.height+w.depth,v=a0(u,m,i),b=v.height+v.depth,x=a0(h,m,i),y=x.height+x.depth,C=0,z=1;if(c!==null){var N=a0(c,m,i);C=N.height+N.depth,z=2}var T=k+y+C,j=Math.max(0,Math.ceil((t-T)/(z*b))),M=T+j*z*b,D=s.fontMetrics().axisHeight;r&&(D*=s.sizeMultiplier);var I=M/2-D,$=[];if(_.length>0){var q=M-k-y,H=Math.round(M*1e3),Q=uAn(_,Math.round(q*1e3)),V=new Iu(_,Q),Z=tt(p/1e3),Y=tt(H/1e3),B=new dl([V],{width:Z,height:Y,viewBox:"0 0 "+p+" "+H}),L=$u([],[B],s);L.height=H/1e3,L.style.width=Z,L.style.height=Y,$.push({type:"elem",elem:L})}else{if($.push(Gw(h,m,i)),$.push(C1),c===null){var F=M-k-y+2*L5;$.push(Vw(u,F,s))}else{var U=(M-k-y-C)/2+2*L5;$.push(Vw(u,U,s)),$.push(C1),$.push(Gw(c,m,i)),$.push(C1),$.push(Vw(u,U,s))}$.push(C1),$.push(Gw(o,m,i))}var K=s.havingBaseStyle(nn.TEXT),ne=Gn({positionType:"bottom",positionData:I,children:$});return Z6(Ve(["delimsizing","mult"],[ne],K),nn.TEXT,s,a)},Kw=80,Ww=.08,Qw=function(n,t,r,s,i){var a=cAn(n,s,r),o=new Iu(n,a),c=new dl([o],{width:"400em",height:tt(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return $u(["hide-tail"],[c],i)},rRn=function(n,t){var r=t.havingBaseSizing(),s=pF("\\surd",n*r.sizeMultiplier,hF,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,c,u,h,_;return s.type==="small"?(h=1e3+1e3*a+Kw,n<1?i=1:n<1.4&&(i=.7),c=(1+a+Ww)/i,u=(1+a)/i,o=Qw("sqrtMain",c,h,a,t),o.style.minWidth="0.853em",_=.833/i):s.type==="large"?(h=(1e3+Kw)*y0[s.size],u=(y0[s.size]+a)/i,c=(y0[s.size]+a+Ww)/i,o=Qw("sqrtSize"+s.size,c,h,a,t),o.style.minWidth="1.02em",_=1/i):(c=n+a+Ww,u=n+a,h=Math.floor(1e3*n+a)+Kw,o=Qw("sqrtTall",c,h,a,t),o.style.minWidth="0.742em",_=1.056),o.height=u,o.style.height=tt(c),{span:o,advanceWidth:_,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},_F=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),sRn=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),fF=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),y0=[0,1.2,1.8,2.4,3],dF=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),_F.has(n)||fF.has(n))return lF(n,t,!1,r,s,i);if(sRn.has(n))return uF(n,y0[t],!1,r,s,i);throw new Xe("Illegal delimiter: '"+n+"'")},iRn=[{type:"small",style:nn.SCRIPTSCRIPT},{type:"small",style:nn.SCRIPT},{type:"small",style:nn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],aRn=[{type:"small",style:nn.SCRIPTSCRIPT},{type:"small",style:nn.SCRIPT},{type:"small",style:nn.TEXT},{type:"stack"}],hF=[{type:"small",style:nn.SCRIPTSCRIPT},{type:"small",style:nn.SCRIPT},{type:"small",style:nn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],oRn=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},pF=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},I5=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;fF.has(n)?o=iRn:_F.has(n)?o=hF:o=aRn;var c=pF(n,t,o,s);return c.type==="small"?JAn(n,c.style,r,s,i,a):c.type==="large"?lF(n,c.size,r,s,i,a):uF(n,t,r,s,i,a)},Xw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,u=5/s.fontMetrics().ptPerEm,h=Math.max(t-o,r+o),_=Math.max(h/500*c,2*h-u);return I5(n,_,!0,s,i,a)},MA={"\\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}},cRn=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 OA(e){return"isMiddle"in e}function Ey(e,n){var t=Sy(e);if(t&&cRn.has(t.text))return t;throw t?new Xe("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Xe("Invalid delimiter type '"+e.type+"'",e)}ft({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,n)=>{var t=Ey(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:MA[e.funcName].size,mclass:MA[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ve([e.mclass]):dF(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(Ka(e.delim,e.mode));var t=new Ye("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=tt(y0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function DA(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ft({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Xe("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Ey(n[0],e).text,color:t}}});ft({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Ey(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=ln(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{DA(e);for(var t=xs(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{DA(e);var t=xa(e.body,n);if(e.left!=="."){var r=new Ye("mo",[Ka(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Ye("mo",[Ka(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return Q6(t)}});ft({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Ey(n[0],e);if(!e.parser.leftrightDepth)throw new Xe("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=G0(n,[]):(t=dF(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?Ka("|","text"):Ka(e.delim,e.mode),r=new Ye("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Ny=(e,n)=>{var t=Eh(Kn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=ml(e.body);if(r==="sout")i=Ve(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var c=Lr({number:.6,unit:"pt"},n),u=Lr({number:.35,unit:"ex"},n),h=n.havingBaseSizing();s=s/h.sizeMultiplier;var _=t.height+t.depth+c+u;t.style.paddingLeft=tt(_/2+c);var p=Math.floor(1e3*_*s),m=aAn(p),w=new dl([new Iu("phase",m)],{width:"400em",height:tt(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=$u(["hide-tail"],[w],n),i.style.height=tt(_),a=t.depth+c+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var k,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),k=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=k):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),k=4*b,v=Math.max(0,.25-t.depth)):(k=o?.2:0,v=k),i=qAn(t,r,k,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=tt(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=tt(b),i.style.borderRightWidth=tt(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var x;if(e.backgroundColor)x=Gn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];x=Gn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(x.height=t.height,x.depth=t.depth),/cancel/.test(r)&&!o?Ve(["mord","cancel-lap"],[x],n):Ve(["mord"],[x],n)},zy=(e,n)=>{var t,r=new Ye(e.label.includes("colorbox")?"mpadded":"menclose",[dr(e.body,n)]);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(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+tt(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ft({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=ln(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Ny,mathmlBuilder:zy});ft({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=ln(n[0],"color-token").color,a=ln(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Ny,mathmlBuilder:zy});ft({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});ft({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Ny,mathmlBuilder:zy});ft({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Ny,mathmlBuilder:zy});ft({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var mF={};function cc(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},c=0;c{var n=e.parser.settings;if(!n.displayMode)throw new Xe("{"+e.envName+"} can be used only in display mode.")},lRn=new Set(["gather","gather*"]);function J6(e){if(!e.includes("ed"))return!e.includes("*")}function Wu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:c,singleRow:u,emptySingleRow:h,maxNumCols:_,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Xe("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var w=[],k=[w],v=[],b=[],x=c!=null?[]:void 0;function y(){c&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){x&&(e.gullet.macros.get("\\df@tag")?(x.push(e.subparse([new da("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!c&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(LA(e));;){var z=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:z};t&&(N={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[N]}),w.push(N);var T=e.fetch().text;if(T==="&"){if(_&&w.length===_){if(u||o)throw new Xe("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),w.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(k.length>1||!h)&&k.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:He[nt]})}for(C(a[0]),r=0;r0&&(I+=x,THe))for(r=0;r=o)){var ae=void 0;if(s>0||n.hskipBeforeAndAfter){var ce,pe;ae=(ce=(pe=K)==null?void 0:pe.pregap)!=null?ce:p,ae!==0&&(Q=Ve(["arraycolsep"],[]),Q.style.width=tt(ae),H.push(Q))}var be=[];for(r=0;r0){for(var Ct=Ch("hline",t,h),qt=Ch("hdashline",t,h),dt=[{type:"elem",elem:ct,shift:0}];u.length>0;){var ht=u.pop(),Le=ht.pos-$;ht.isDashed?dt.push({type:"elem",elem:qt,shift:Le}):dt.push({type:"elem",elem:Ct,shift:Le})}ct=Gn({positionType:"individualShift",children:dt})}if(Z.length===0)return Ve(["mord"],[ct],t);var me=Gn({positionType:"individualShift",children:Z}),Te=Ve(["tag"],[me],t);return vl([ct,Te])},uRn={c:"center ",l:"left ",r:"right "},uc=function(n,t){for(var r=[],s=new Ye("mtd",[],["mtr-glue"]),i=new Ye("mtd",[],["mml-eqn-num"]),a=0;a0){var w=n.cols,k="",v=!1,b=0,x=w.length;w[0].type==="separator"&&(p+="top ",b=1),w[w.length-1].type==="separator"&&(p+="bottom ",x-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var D=1;D0&&m&&(v=1),r[w]={type:"align",align:k,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};cc({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Sy(n[0]),r=t?[n[0]]:ln(n[0],"ordgroup").body,s=r.map(function(a){var o=ky(a),c=o.text;if("lcr".includes(c))return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new Xe("Unknown column alignment: "+c,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Wu(e.parser,i,eC(e.envName))},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Xe("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Wu(e.parser,r,eC(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Wu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Sy(n[0]),r=t?[n[0]]:ln(n[0],"ordgroup").body,s=r.map(function(o){var c=ky(o),u=c.text;if("lc".includes(u))return{type:"align",align:u};throw new Xe("Unknown column alignment: "+u,o)});if(s.length>1)throw new Xe("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Wu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Xe("{subarray} can contain only one column");return a},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Wu(e.parser,n,eC(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:vF,htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){lRn.has(e.envName)&&jy(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:J6(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Wu(e.parser,n,"display")},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:vF,htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){jy(e);var n={autoTag:J6(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Wu(e.parser,n,"display")},htmlBuilder:lc,mathmlBuilder:uc});cc({type:"array",names:["CD"],props:{numArgs:0},handler(e){return jy(e),YAn(e.parser)},htmlBuilder:lc,mathmlBuilder:uc});ie("\\nonumber","\\gdef\\@eqnsw{0}");ie("\\notag","\\nonumber");ft({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Xe(e.funcName+" valid only within array environment")}});var IA=mF;ft({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Xe("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Kn(e.body,r)},yF=(e,n)=>{var t=e.font,r=n.withFont(t);return dr(e.body,r)},$A={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ft({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=rb(n[0]),i=r;return i in $A&&(i=$A[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:bF,mathmlBuilder:yF});ft({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Cy(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:ml(r)}}});ft({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:bF,mathmlBuilder:yF});var _Rn=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Kn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,c=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?w=3*p:w=7*p,k=n.fontMetrics().denom1):(_>0?(m=n.fontMetrics().num2,w=p):(m=n.fontMetrics().num3,w=3*p),k=n.fontMetrics().denom2);var v;if(h){var x=n.fontMetrics().axisHeight;m-a.depth-(x+.5*_){var t=new Ye("mfrac",[dr(e.numer,n),dr(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Lr(e.barSize,n);t.setAttribute("linethickness",tt(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Ye("mo",[new os(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Ye("mo",[new os(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return Q6(s)}return t},xF=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};ft({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,c=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",c=")";break;case"\\\\bracefrac":a=!1,o="\\{",c="\\}";break;case"\\\\brackfrac":a=!1,o="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",h=null;return u||r.startsWith("\\d")?h="display":r.startsWith("\\t")&&(h="text"),xF({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:c,barSize:null},h)},htmlBuilder:_Rn,mathmlBuilder:fRn});ft({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var BA=["display","text","script","scriptscript"],PA=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};ft({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=rb(n[0]),a=i.type==="atom"&&i.family==="open"?PA(i.text):null,o=rb(n[1]),c=o.type==="atom"&&o.family==="close"?PA(o.text):null,u=ln(n[2],"size"),h,_=null;u.isBlank?h=!0:(_=u.value,h=_.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var w=ln(m.body[0],"textord");p=BA[Number(w.text)]}}else m=ln(m,"textord"),p=BA[Number(m.text)];return xF({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:h,barSize:_,leftDelim:a,rightDelim:c},p)}});ft({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:ln(n[0],"size").value,token:s}}});ft({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=ln(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var wF=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Kn(e.sup,n.havingStyle(t.sup()),n):Kn(e.sub,n.havingStyle(t.sub()),n),s=ln(e.base,"horizBrace")):s=ln(e,"horizBrace");var i=Kn(s.base,n.havingBaseStyle(nn.DISPLAY)),a=wy(s,n),o;if(s.isOver?o=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=Gn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var c=Ve(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=Gn({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]})}return Ve(["minner",s.isOver?"mover":"munder"],[o],n)},dRn=(e,n)=>{var t=xy(e.label);return new Ye(e.isOver?"mover":"munder",[dr(e.base,n),t])};ft({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:wF,mathmlBuilder:dRn});ft({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=ln(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:as(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=xs(e.body,n,!1);return EAn(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=Bu(e.body,n);return t instanceof Ye||(t=new Ye("mrow",[t])),t.setAttribute("href",e.href),t}});ft({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=ln(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=ln(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,c={};switch(r){case"\\htmlClass":c.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),h=0;h{var t=xs(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ve(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>Bu(e.body,n)});ft({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:as(n[0]),mathml:as(n[1])}},htmlBuilder:(e,n)=>{var t=xs(e.html,n,!1);return vl(t)},mathmlBuilder:(e,n)=>Bu(e.mathml,n)});var Yw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Xe("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!BP(r))throw new Xe("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ft({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var c=ln(t[0],"raw").string,u=c.split(","),h=0;h{var t=Lr(e.height,n),r=0;e.totalheight.number>0&&(r=Lr(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Lr(e.width,n));var i={height:tt(t+r)};s>0&&(i.width=tt(s)),r>0&&(i.verticalAlign=tt(-r));var a=new hAn(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Ye("mglyph",[]);t.setAttribute("alt",e.alt);var r=Lr(e.height,n),s=0;if(e.totalheight.number>0&&(s=Lr(e.totalheight,n)-r,t.setAttribute("valign",tt(-s))),t.setAttribute("height",tt(r+s)),e.width.number>0){var i=Lr(e.width,n);t.setAttribute("width",tt(i))}return t.setAttribute("src",e.src),t}});ft({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=ln(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return GP(e.dimension,n)},mathmlBuilder(e,n){var t=Lr(e.dimension,n);return new YP(t)}});ft({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ve([],[Kn(e.body,n)]),t=Ve(["inner"],[t],n)):t=Ve(["inner"],[Kn(e.body,n)]);var r=Ve(["fix"],[]),s=Ve([e.alignment],[t,r],n),i=Ve(["strut"]);return i.style.height=tt(s.height+s.depth),s.depth&&(i.style.verticalAlign=tt(-s.depth)),s.children.unshift(i),s=Ve(["thinbox"],[s],n),Ve(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Ye("mpadded",[dr(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});ft({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ft({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Xe("Mismatched "+e.funcName)}});var FA=(e,n)=>{switch(n.style.size){case nn.DISPLAY.size:return e.display;case nn.TEXT.size:return e.text;case nn.SCRIPT.size:return e.script;case nn.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ft({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:as(n[0]),text:as(n[1]),script:as(n[2]),scriptscript:as(n[3])}},htmlBuilder:(e,n)=>{var t=FA(e,n),r=xs(t,n,!1);return vl(r)},mathmlBuilder:(e,n)=>{var t=FA(e,n);return Bu(t,n)}});var kF=(e,n,t,r,s,i,a)=>{e=Ve([],[e]);var o=t&&ml(t),c,u;if(n){var h=Kn(n,r.havingStyle(s.sup()),r);u={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(t){var _=Kn(t,r.havingStyle(s.sub()),r);c={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-_.height)}}var p;if(u&&c){var m=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+a;p=Gn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:tt(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:tt(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(c){var w=e.height-a;p=Gn({positionType:"top",positionData:w,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:tt(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e}]})}else if(u){var k=e.depth+a;p=Gn({positionType:"bottom",positionData:k,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:tt(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(c&&i!==0&&!o){var b=Ve(["mspace"],[],r);b.style.marginRight=tt(i),v.unshift(b)}return Ve(["mop","op-limits"],v,r)},SF=new Set(["\\smallint"]),Kh=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=ln(e.base,"op"),s=!0):i=ln(e,"op");var a=n.style,o=!1;a.size===nn.DISPLAY.size&&i.symbol&&!SF.has(i.name)&&(o=!0);var c,u;if(i.symbol){var h=o?"Size2-Regular":"Size1-Regular",_="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(_=i.name.slice(1),i.name=_==="oiint"?"\\iint":"\\iiint"),c=fi(i.name,h,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=c.italic,_.length>0){var p=KP(_+"Size"+(o?"2":"1"),n);c=Gn({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+_,c.classes.unshift("mop"),c.italic=u}}else if(i.body){var m=xs(i.body,n,!0);m.length===1&&m[0]instanceof ma?(c=m[0],c.classes[0]="mop"):c=Ve(["mop"],m,n)}else{for(var w=[],k=1;k{var t;if(e.symbol)t=new Ye("mo",[Ka(e.name,e.mode)]),SF.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Ye("mo",xa(e.body,n));else{t=new Ye("mi",[new os(e.name.slice(1))]);var r=new Ye("mo",[Ka("⁡","text")]);e.parentIsSupSub?t=new Ye("mrow",[t,r]):t=XP([t,r])}return t},hRn={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ft({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=hRn[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Kh,mathmlBuilder:$m});ft({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:as(r)}},htmlBuilder:Kh,mathmlBuilder:$m});var pRn={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ft({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:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Kh,mathmlBuilder:$m});ft({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Kh,mathmlBuilder:$m});ft({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=pRn[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Kh,mathmlBuilder:$m});var CF=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=ln(e.base,"operatorname"),s=!0):i=ln(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(_=>{var p="text"in _?_.text:void 0;return typeof p=="string"?{type:"textord",mode:_.mode,text:p}:_}),c=xs(o,n.withFont("mathrm"),!0),u=0;u{for(var t=xa(e.body,n.withFont("mathrm")),r=!0,s=0;sh.toText()).join("");t=[new os(o)]}var c=new Ye("mi",t);c.setAttribute("mathvariant","normal");var u=new Ye("mo",[Ka("⁡","text")]);return e.parentIsSupSub?new Ye("mrow",[c,u]):XP([c,u])};ft({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:as(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:CF,mathmlBuilder:mRn});ie("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Rf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?vl(xs(e.body,n,!1)):Ve(["mord"],xs(e.body,n,!0),n)},mathmlBuilder(e,n){return Bu(e.body,n,!0)}});ft({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Kn(e.body,n.havingCrampedStyle()),r=Ch("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ve(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Ye("mo",[new os("‾")]);t.setAttribute("stretchy","true");var r=new Ye("mover",[dr(e.body,n),t]);return r.setAttribute("accent","true"),r}});ft({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:as(r)}},htmlBuilder:(e,n)=>{var t=xs(e.body,n.withPhantom(),!1);return vl(t)},mathmlBuilder:(e,n)=>{var t=xa(e.body,n);return new Ye("mphantom",t)}});ie("\\hphantom","\\smash{\\phantom{#1}}");ft({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ve(["inner"],[Kn(e.body,n.withPhantom())]),r=Ve(["fix"],[]);return Ve(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=xa(as(e.body),n),r=new Ye("mphantom",t),s=new Ye("mpadded",[r]);return s.setAttribute("width","0px"),s}});ft({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=ln(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Kn(e.body,n),r=Lr(e.dy,n);return Gn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ye("mpadded",[dr(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});ft({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});ft({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=ln(n[0],"size"),a=ln(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&ln(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ve(["mord","rule"],[],n),r=Lr(e.width,n),s=Lr(e.height,n),i=e.shift?Lr(e.shift,n):0;return t.style.borderRightWidth=tt(r),t.style.borderTopWidth=tt(s),t.style.bottom=tt(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Lr(e.width,n),r=Lr(e.height,n),s=e.shift?Lr(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Ye("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",tt(t)),a.setAttribute("height",tt(r));var o=new Ye("mpadded",[a]);return s>=0?o.setAttribute("height",tt(s)):(o.setAttribute("height",tt(s)),o.setAttribute("depth",tt(-s))),o.setAttribute("voffset",tt(s)),o}});function EF(e,n,t){for(var r=xs(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return EF(e.body,t,n)};ft({type:"sizing",names:HA,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:HA.indexOf(r)+1,body:i}},htmlBuilder:gRn,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=xa(e.body,t),s=new Ye("mstyle",r);return s.setAttribute("mathsize",tt(t.sizeMultiplier)),s}});ft({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&ln(t[0],"ordgroup");if(a)for(var o,c=0;c{var t=Ve([],[Kn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ve(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Ye("mpadded",[dr(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});ft({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Kn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Eh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+_-t.height-t.depth)/2);var p=c.height-t.height-a-u;t.style.paddingLeft=tt(h);var m=Gn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:c},{type:"kern",size:u}]});if(e.index){var w=n.havingStyle(nn.SCRIPTSCRIPT),k=Kn(e.index,w,n),v=.6*(m.height-m.depth),b=Gn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:k}]}),x=Ve(["root"],[b]);return Ve(["mord","sqrt"],[x,m],n)}else return Ve(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Ye("mroot",[dr(t,n),dr(r,n)]):new Ye("msqrt",[dr(t,n)])}});var $5={display:nn.DISPLAY,text:nn.TEXT,script:nn.SCRIPT,scriptscript:nn.SCRIPTSCRIPT};function vRn(e){return e in $5}ft({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!vRn(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=$5[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),EF(e.body,r,n)},mathmlBuilder(e,n){var t=$5[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=xa(e.body,r),i=new Ye("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var bRn=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===nn.DISPLAY.size||r.alwaysHandleSupSub);return s?Kh:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===nn.DISPLAY.size||r.limits);return i?CF:null}else{if(r.type==="accent")return ml(r.base)?Y6:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?wF:null}else return null}else return null};Rf({type:"supsub",htmlBuilder(e,n){var t=bRn(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Kn(r,n),o,c,u=n.fontMetrics(),h=0,_=0,p=r&&ml(r);if(s){var m=n.havingStyle(n.style.sup());o=Kn(s,m,n),p||(h=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var w=n.havingStyle(n.style.sub());c=Kn(i,w,n),p||(_=a.depth+w.fontMetrics().subDrop*w.sizeMultiplier/n.sizeMultiplier)}var k;n.style===nn.DISPLAY?k=u.sup1:n.style.cramped?k=u.sup3:k=u.sup2;var v=n.sizeMultiplier,b=tt(.5/u.ptPerEm/v),x=null;if(c){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof ma||y){var C;x=tt(-((C=a.italic)!=null?C:0))}}var z;if(o&&c){h=Math.max(h,k,o.depth+.25*u.xHeight),_=Math.max(_,u.sub2);var N=u.defaultRuleThickness,T=4*N;if(h-o.depth-(c.height-_)0&&(h+=j,_-=j)}var M=[{type:"elem",elem:c,shift:_,marginRight:b,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:b}];z=Gn({positionType:"individualShift",children:M})}else if(c){_=Math.max(_,u.sub1,c.height-.8*u.xHeight);var D=[{type:"elem",elem:c,marginLeft:x,marginRight:b}];z=Gn({positionType:"shift",positionData:_,children:D})}else if(o)h=Math.max(h,k,o.depth+.25*u.xHeight),z=Gn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var I=M5(a,"right")||"mord";return Ve([I],[a,Ve(["msupsub"],[z])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[dr(e.base,n)];e.sub&&i.push(dr(e.sub,n)),e.sup&&i.push(dr(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===nn.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===nn.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var c=e.base;c&&c.type==="op"&&c.limits&&(n.style===nn.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||n.style===nn.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===nn.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===nn.DISPLAY)?a="mover":a="msup"}return new Ye(a,i)}});Rf({type:"atom",htmlBuilder(e,n){return K6(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Ye("mo",[Ka(e.text,e.mode)]);if(e.family==="bin"){var r=X6(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var NF={mi:"italic",mn:"normal",mtext:"normal"};Rf({type:"mathord",htmlBuilder(e,n){return yy(e,n,"mathord")},mathmlBuilder(e,n){var t=new Ye("mi",[Ka(e.text,e.mode,n)]),r=X6(e,n)||"italic";return r!==NF[t.type]&&t.setAttribute("mathvariant",r),t}});Rf({type:"textord",htmlBuilder(e,n){return yy(e,n,"textord")},mathmlBuilder(e,n){var t=Ka(e.text,e.mode,n),r=X6(e,n)||"normal",s;return e.mode==="text"?s=new Ye("mtext",[t]):/[0-9]/.test(e.text)?s=new Ye("mn",[t]):e.text==="\\prime"?s=new Ye("mo",[t]):s=new Ye("mi",[t]),r!==NF[s.type]&&s.setAttribute("mathvariant",r),s}});var Zw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Jw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Rf({type:"spacing",htmlBuilder(e,n){if(Jw.hasOwnProperty(e.text)){var t=Jw[e.text].className||"";if(e.mode==="text"){var r=yy(e,n,"textord");return r.classes.push(t),r}else return Ve(["mspace",t],[K6(e.text,e.mode,n)],n)}else{if(Zw.hasOwnProperty(e.text))return Ve(["mspace",Zw[e.text]],[],n);throw new Xe('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(Jw.hasOwnProperty(e.text))t=new Ye("mtext",[new os(" ")]);else{if(Zw.hasOwnProperty(e.text))return new Ye("mspace");throw new Xe('Unknown type of space "'+e.text+'"')}return t}});var qA=()=>{var e=new Ye("mtd",[]);return e.setAttribute("width","50%"),e};Rf({type:"tag",mathmlBuilder(e,n){var t=new Ye("mtable",[new Ye("mtr",[qA(),new Ye("mtd",[Bu(e.body,n)]),qA(),new Ye("mtd",[Bu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var UA={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},GA={"\\textbf":"textbf","\\textmd":"textmd"},yRn={"\\textit":"textit","\\textup":"textup"},VA=(e,n)=>{var t=e.font;if(t){if(UA[t])return n.withTextFontFamily(UA[t]);if(GA[t])return n.withTextFontWeight(GA[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(yRn[t])};ft({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:as(s),font:r}},htmlBuilder(e,n){var t=VA(e,n),r=xs(e.body,t,!0);return Ve(["mord","text"],r,t)},mathmlBuilder(e,n){var t=VA(e,n);return Bu(e.body,t)}});ft({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Kn(e.body,n),r=Ch("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=Gn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ve(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Ye("mo",[new os("‾")]);t.setAttribute("stretchy","true");var r=new Ye("munder",[dr(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});ft({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Kn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return Gn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ye("mpadded",[dr(e.body,n)],["vcenter"]);return new Ye("mrow",[t])}});ft({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Xe("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=KA(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),Nu=WP,zF=`[ \r ]`,xRn="\\\\[a-zA-Z@]+",wRn="\\\\[^\uD800-\uDFFF]",kRn="("+xRn+")"+zF+"*",SRn=`\\\\( |[ \r ]+ -?)[ \r ]*`,B5="[̀-ͯ]",CRn=new RegExp(B5+"+$"),ERn="("+zF+"+)|"+(SRn+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(B5+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(B5+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+kRn)+("|"+wRn+")");class WA{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(ERn,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new da("EOF",new Ii(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Xe("Unexpected character: '"+n[t]+"'",new da(n[t],new Ii(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` -`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.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=i+1,this.lex()}return new da(s,new Ii(this,t,this.tokenRegex.lastIndex))}}class NRn{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Xe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var zRn=gF;ie("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ie("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ie("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ie("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ie("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ie("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ie("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var QA={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};ie("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Xe("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=QA[n.text],r==null||r>=t)throw new Xe("Invalid base-"+t+" digit "+n.text);for(var s;(s=QA[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Xe("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Xe("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Xe("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)c+=u.text,u=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new Xe("Invalid number of arguments: "+c);o=parseInt(c),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ie("\\newcommand",e=>tC(e,!1,!0,!1));ie("\\renewcommand",e=>tC(e,!0,!1,!1));ie("\\providecommand",e=>tC(e,!0,!0,!0));ie("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ie("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ie("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),Nu[t],Sr.math[t],Sr.text[t]),""});ie("\\bgroup","{");ie("\\egroup","}");ie("~","\\nobreakspace");ie("\\lq","`");ie("\\rq","'");ie("\\aa","\\r a");ie("\\AA","\\r A");ie("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ie("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ie("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ie("ℬ","\\mathscr{B}");ie("ℰ","\\mathscr{E}");ie("ℱ","\\mathscr{F}");ie("ℋ","\\mathscr{H}");ie("ℐ","\\mathscr{I}");ie("ℒ","\\mathscr{L}");ie("ℳ","\\mathscr{M}");ie("ℛ","\\mathscr{R}");ie("ℭ","\\mathfrak{C}");ie("ℌ","\\mathfrak{H}");ie("ℨ","\\mathfrak{Z}");ie("\\Bbbk","\\Bbb{k}");ie("\\llap","\\mathllap{\\textrm{#1}}");ie("\\rlap","\\mathrlap{\\textrm{#1}}");ie("\\clap","\\mathclap{\\textrm{#1}}");ie("\\mathstrut","\\vphantom{(}");ie("\\underbar","\\underline{\\text{#1}}");ie("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ie("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ie("\\ne","\\neq");ie("≠","\\neq");ie("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ie("∉","\\notin");ie("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ie("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ie("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ie("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ie("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ie("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ie("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ie("⟂","\\perp");ie("‼","\\mathclose{!\\mkern-0.8mu!}");ie("∌","\\notni");ie("⌜","\\ulcorner");ie("⌝","\\urcorner");ie("⌞","\\llcorner");ie("⌟","\\lrcorner");ie("©","\\copyright");ie("®","\\textregistered");ie("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ie("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ie("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ie("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ie("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ie("⋮","\\vdots");ie("\\varGamma","\\mathit{\\Gamma}");ie("\\varDelta","\\mathit{\\Delta}");ie("\\varTheta","\\mathit{\\Theta}");ie("\\varLambda","\\mathit{\\Lambda}");ie("\\varXi","\\mathit{\\Xi}");ie("\\varPi","\\mathit{\\Pi}");ie("\\varSigma","\\mathit{\\Sigma}");ie("\\varUpsilon","\\mathit{\\Upsilon}");ie("\\varPhi","\\mathit{\\Phi}");ie("\\varPsi","\\mathit{\\Psi}");ie("\\varOmega","\\mathit{\\Omega}");ie("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ie("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ie("\\boxed","\\fbox{$\\displaystyle{#1}$}");ie("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ie("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ie("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ie("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ie("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var XA={",":"\\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"},jRn=new Set(["bin","rel"]);ie("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in XA?n=XA[t]:(t.slice(0,4)==="\\not"||t in Sr.math&&jRn.has(Sr.math[t].group))&&(n="\\dotsb"),n});var nC={")":!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};ie("\\dotso",function(e){var n=e.future().text;return n in nC?"\\ldots\\,":"\\ldots"});ie("\\dotsc",function(e){var n=e.future().text;return n in nC&&n!==","?"\\ldots\\,":"\\ldots"});ie("\\cdots",function(e){var n=e.future().text;return n in nC?"\\@cdots\\,":"\\@cdots"});ie("\\dotsb","\\cdots");ie("\\dotsm","\\cdots");ie("\\dotsi","\\!\\cdots");ie("\\dotsx","\\ldots\\,");ie("\\DOTSI","\\relax");ie("\\DOTSB","\\relax");ie("\\DOTSX","\\relax");ie("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ie("\\,","\\tmspace+{3mu}{.1667em}");ie("\\thinspace","\\,");ie("\\>","\\mskip{4mu}");ie("\\:","\\tmspace+{4mu}{.2222em}");ie("\\medspace","\\:");ie("\\;","\\tmspace+{5mu}{.2777em}");ie("\\thickspace","\\;");ie("\\!","\\tmspace-{3mu}{.1667em}");ie("\\negthinspace","\\!");ie("\\negmedspace","\\tmspace-{4mu}{.2222em}");ie("\\negthickspace","\\tmspace-{5mu}{.277em}");ie("\\enspace","\\kern.5em ");ie("\\enskip","\\hskip.5em\\relax");ie("\\quad","\\hskip1em\\relax");ie("\\qquad","\\hskip2em\\relax");ie("\\tag","\\@ifstar\\tag@literal\\tag@paren");ie("\\tag@paren","\\tag@literal{({#1})}");ie("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Xe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ie("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ie("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ie("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ie("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ie("\\newline","\\\\\\relax");ie("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var jF=tt(Wo["Main-Regular"][84][1]-.7*Wo["Main-Regular"][65][1]);ie("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+jF+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ie("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+jF+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ie("\\hspace","\\@ifstar\\@hspacer\\@hspace");ie("\\@hspace","\\hskip #1\\relax");ie("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ie("\\ordinarycolon",":");ie("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ie("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ie("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ie("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ie("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ie("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ie("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ie("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ie("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ie("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ie("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ie("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ie("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ie("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ie("∷","\\dblcolon");ie("∹","\\eqcolon");ie("≔","\\coloneqq");ie("≕","\\eqqcolon");ie("⩴","\\Coloneqq");ie("\\ratio","\\vcentcolon");ie("\\coloncolon","\\dblcolon");ie("\\colonequals","\\coloneqq");ie("\\coloncolonequals","\\Coloneqq");ie("\\equalscolon","\\eqqcolon");ie("\\equalscoloncolon","\\Eqqcolon");ie("\\colonminus","\\coloneq");ie("\\coloncolonminus","\\Coloneq");ie("\\minuscolon","\\eqcolon");ie("\\minuscoloncolon","\\Eqcolon");ie("\\coloncolonapprox","\\Colonapprox");ie("\\coloncolonsim","\\Colonsim");ie("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ie("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ie("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ie("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ie("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ie("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ie("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ie("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ie("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ie("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ie("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ie("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ie("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ie("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ie("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ie("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ie("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ie("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ie("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ie("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ie("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ie("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ie("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ie("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ie("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ie("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ie("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ie("\\imath","\\html@mathml{\\@imath}{ı}");ie("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ie("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ie("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ie("⟦","\\llbracket");ie("⟧","\\rrbracket");ie("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ie("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ie("⦃","\\lBrace");ie("⦄","\\rBrace");ie("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ie("⦵","\\minuso");ie("\\darr","\\downarrow");ie("\\dArr","\\Downarrow");ie("\\Darr","\\Downarrow");ie("\\lang","\\langle");ie("\\rang","\\rangle");ie("\\uarr","\\uparrow");ie("\\uArr","\\Uparrow");ie("\\Uarr","\\Uparrow");ie("\\N","\\mathbb{N}");ie("\\R","\\mathbb{R}");ie("\\Z","\\mathbb{Z}");ie("\\alef","\\aleph");ie("\\alefsym","\\aleph");ie("\\Alpha","\\mathrm{A}");ie("\\Beta","\\mathrm{B}");ie("\\bull","\\bullet");ie("\\Chi","\\mathrm{X}");ie("\\clubs","\\clubsuit");ie("\\cnums","\\mathbb{C}");ie("\\Complex","\\mathbb{C}");ie("\\Dagger","\\ddagger");ie("\\diamonds","\\diamondsuit");ie("\\empty","\\emptyset");ie("\\Epsilon","\\mathrm{E}");ie("\\Eta","\\mathrm{H}");ie("\\exist","\\exists");ie("\\harr","\\leftrightarrow");ie("\\hArr","\\Leftrightarrow");ie("\\Harr","\\Leftrightarrow");ie("\\hearts","\\heartsuit");ie("\\image","\\Im");ie("\\infin","\\infty");ie("\\Iota","\\mathrm{I}");ie("\\isin","\\in");ie("\\Kappa","\\mathrm{K}");ie("\\larr","\\leftarrow");ie("\\lArr","\\Leftarrow");ie("\\Larr","\\Leftarrow");ie("\\lrarr","\\leftrightarrow");ie("\\lrArr","\\Leftrightarrow");ie("\\Lrarr","\\Leftrightarrow");ie("\\Mu","\\mathrm{M}");ie("\\natnums","\\mathbb{N}");ie("\\Nu","\\mathrm{N}");ie("\\Omicron","\\mathrm{O}");ie("\\plusmn","\\pm");ie("\\rarr","\\rightarrow");ie("\\rArr","\\Rightarrow");ie("\\Rarr","\\Rightarrow");ie("\\real","\\Re");ie("\\reals","\\mathbb{R}");ie("\\Reals","\\mathbb{R}");ie("\\Rho","\\mathrm{P}");ie("\\sdot","\\cdot");ie("\\sect","\\S");ie("\\spades","\\spadesuit");ie("\\sub","\\subset");ie("\\sube","\\subseteq");ie("\\supe","\\supseteq");ie("\\Tau","\\mathrm{T}");ie("\\thetasym","\\vartheta");ie("\\weierp","\\wp");ie("\\Zeta","\\mathrm{Z}");ie("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ie("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ie("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ie("\\bra","\\mathinner{\\langle{#1}|}");ie("\\ket","\\mathinner{|{#1}\\rangle}");ie("\\braket","\\mathinner{\\langle{#1}\\rangle}");ie("\\Bra","\\left\\langle#1\\right|");ie("\\Ket","\\left|#1\\right\\rangle");var TF=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var c=_=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=_;if(!_&&s.length){var w=p.future();w.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",c(!1)),s.length&&n.macros.set("\\|",c(!0));var u=n.consumeArg().tokens,h=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ie("\\bra@ket",TF(!1));ie("\\bra@set",TF(!0));ie("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ie("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ie("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ie("\\angln","{\\angl n}");ie("\\blue","\\textcolor{##6495ed}{#1}");ie("\\orange","\\textcolor{##ffa500}{#1}");ie("\\pink","\\textcolor{##ff00af}{#1}");ie("\\red","\\textcolor{##df0030}{#1}");ie("\\green","\\textcolor{##28ae7b}{#1}");ie("\\gray","\\textcolor{gray}{#1}");ie("\\purple","\\textcolor{##9d38bd}{#1}");ie("\\blueA","\\textcolor{##ccfaff}{#1}");ie("\\blueB","\\textcolor{##80f6ff}{#1}");ie("\\blueC","\\textcolor{##63d9ea}{#1}");ie("\\blueD","\\textcolor{##11accd}{#1}");ie("\\blueE","\\textcolor{##0c7f99}{#1}");ie("\\tealA","\\textcolor{##94fff5}{#1}");ie("\\tealB","\\textcolor{##26edd5}{#1}");ie("\\tealC","\\textcolor{##01d1c1}{#1}");ie("\\tealD","\\textcolor{##01a995}{#1}");ie("\\tealE","\\textcolor{##208170}{#1}");ie("\\greenA","\\textcolor{##b6ffb0}{#1}");ie("\\greenB","\\textcolor{##8af281}{#1}");ie("\\greenC","\\textcolor{##74cf70}{#1}");ie("\\greenD","\\textcolor{##1fab54}{#1}");ie("\\greenE","\\textcolor{##0d923f}{#1}");ie("\\goldA","\\textcolor{##ffd0a9}{#1}");ie("\\goldB","\\textcolor{##ffbb71}{#1}");ie("\\goldC","\\textcolor{##ff9c39}{#1}");ie("\\goldD","\\textcolor{##e07d10}{#1}");ie("\\goldE","\\textcolor{##a75a05}{#1}");ie("\\redA","\\textcolor{##fca9a9}{#1}");ie("\\redB","\\textcolor{##ff8482}{#1}");ie("\\redC","\\textcolor{##f9685d}{#1}");ie("\\redD","\\textcolor{##e84d39}{#1}");ie("\\redE","\\textcolor{##bc2612}{#1}");ie("\\maroonA","\\textcolor{##ffbde0}{#1}");ie("\\maroonB","\\textcolor{##ff92c6}{#1}");ie("\\maroonC","\\textcolor{##ed5fa6}{#1}");ie("\\maroonD","\\textcolor{##ca337c}{#1}");ie("\\maroonE","\\textcolor{##9e034e}{#1}");ie("\\purpleA","\\textcolor{##ddd7ff}{#1}");ie("\\purpleB","\\textcolor{##c6b9fc}{#1}");ie("\\purpleC","\\textcolor{##aa87ff}{#1}");ie("\\purpleD","\\textcolor{##7854ab}{#1}");ie("\\purpleE","\\textcolor{##543b78}{#1}");ie("\\mintA","\\textcolor{##f5f9e8}{#1}");ie("\\mintB","\\textcolor{##edf2df}{#1}");ie("\\mintC","\\textcolor{##e0e5cc}{#1}");ie("\\grayA","\\textcolor{##f6f7f7}{#1}");ie("\\grayB","\\textcolor{##f0f1f2}{#1}");ie("\\grayC","\\textcolor{##e3e5e6}{#1}");ie("\\grayD","\\textcolor{##d6d8da}{#1}");ie("\\grayE","\\textcolor{##babec2}{#1}");ie("\\grayF","\\textcolor{##888d93}{#1}");ie("\\grayG","\\textcolor{##626569}{#1}");ie("\\grayH","\\textcolor{##3b3e40}{#1}");ie("\\grayI","\\textcolor{##21242c}{#1}");ie("\\kaBlue","\\textcolor{##314453}{#1}");ie("\\kaGreen","\\textcolor{##71B307}{#1}");var AF={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class TRn{constructor(n,t,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=t,this.expansionCount=0,this.feed(n),this.macros=new NRn(zRn,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new WA(n,this.settings)}switchMode(n){this.mode=n}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(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new da("EOF",r.loc)),this.pushTokens(s),new da("",Ii.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Xe("Extra }",i)}else if(i.text==="EOF")throw new Xe("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Xe("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Xe("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Xe("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var c=i[o];if(c.text==="#"){if(o===0)throw new Xe("Incomplete placeholder at end of macro body",c);if(c=i[--o],c.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(c.text))i.splice(o,2,...a[+c.text-1]);else throw new Xe("Not a valid argument number",c)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new da(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new WA(s,this.settings),c=[],u=o.lex();u.text!=="EOF";)c.push(u),u=o.lex();c.reverse();var h={tokens:c,numArgs:i};return h}return s}isDefined(n){return this.macros.has(n)||Nu.hasOwnProperty(n)||Sr.math.hasOwnProperty(n)||Sr.text.hasOwnProperty(n)||AF.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:Nu.hasOwnProperty(n)&&!Nu[n].primitive}}var YA=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,E1=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),e4={"́":{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"}},ZA={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Ty{constructor(n,t){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 TRn(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Xe("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new da("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Ty.endOfExpression.has(s.text)||t&&s.text===t||n&&Nu[s.text]&&Nu[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&($P(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:Ii.range(n),text:t};else return null;if(this.consume(),i)for(var h=0;h0?{type:"text",value:E}:void 0),E===!1?p.lastIndex=C+1:(w!==C&&x.push({type:"text",value:u.value.slice(w,C)}),Array.isArray(E)?x.push(...E):E&&x.push(E),w=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(w?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=eR(e,"(");let i=eR(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function DF(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||uf(t)||fy(t))&&(!n||t!==47)}LF.peek=lMn;function tMn(){this.buffer()}function nMn(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function rMn(){this.buffer()}function sMn(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function iMn(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=yo(this.sliceSerialize(e)).toLowerCase(),t.label=n}function aMn(e){this.exit(e)}function oMn(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=yo(this.sliceSerialize(e)).toLowerCase(),t.label=n}function cMn(e){this.exit(e)}function lMn(){return"["}function LF(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function uMn(){return{enter:{gfmFootnoteCallString:tMn,gfmFootnoteCall:nMn,gfmFootnoteDefinitionLabelString:rMn,gfmFootnoteDefinition:sMn},exit:{gfmFootnoteCallString:iMn,gfmFootnoteCall:aMn,gfmFootnoteDefinitionLabelString:oMn,gfmFootnoteDefinition:cMn}}}function _Mn(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:LF},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let c=o.move("[^");const u=i.enter("footnoteDefinition"),h=i.enter("label");return c+=o.move(i.safe(i.associationId(r),{before:c,after:"]"})),h(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((n?` -`:" ")+i.indentLines(i.containerFlow(r,o.current()),n?IF:fMn))),u(),c}}function fMn(e,n,t){return n===0?e:IF(e,n,t)}function IF(e,n,t){return(t?"":" ")+e}const dMn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$F.peek=vMn;function hMn(){return{canContainEols:["delete"],enter:{strikethrough:mMn},exit:{strikethrough:gMn}}}function pMn(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:dMn}],handlers:{delete:$F}}}function mMn(e){this.enter({type:"delete",children:[]},e)}function gMn(e){this.exit(e)}function $F(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let a=s.move("~~");return a+=t.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function vMn(){return"~"}function bMn(e){return e.length}function yMn(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||bMn,i=[],a=[],o=[],c=[];let u=0,h=-1;for(;++hu&&(u=e[h].length);++bc[b])&&(c[b]=y)}k.push(x)}a[h]=k,o[h]=v}let _=-1;if(typeof r=="object"&&"length"in r)for(;++_c[_]&&(c[_]=x),m[_]=x),p[_]=y}a.splice(1,0,p),o.splice(1,0,m),h=-1;const w=[];for(;++h0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var zRn=gF;ie("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ie("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ie("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ie("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ie("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ie("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ie("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var QA={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};ie("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Xe("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=QA[n.text],r==null||r>=t)throw new Xe("Invalid base-"+t+" digit "+n.text);for(var s;(s=QA[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Xe("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Xe("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Xe("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)c+=u.text,u=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new Xe("Invalid number of arguments: "+c);o=parseInt(c),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ie("\\newcommand",e=>tC(e,!1,!0,!1));ie("\\renewcommand",e=>tC(e,!0,!1,!1));ie("\\providecommand",e=>tC(e,!0,!0,!0));ie("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ie("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ie("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),Nu[t],Sr.math[t],Sr.text[t]),""});ie("\\bgroup","{");ie("\\egroup","}");ie("~","\\nobreakspace");ie("\\lq","`");ie("\\rq","'");ie("\\aa","\\r a");ie("\\AA","\\r A");ie("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ie("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ie("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ie("ℬ","\\mathscr{B}");ie("ℰ","\\mathscr{E}");ie("ℱ","\\mathscr{F}");ie("ℋ","\\mathscr{H}");ie("ℐ","\\mathscr{I}");ie("ℒ","\\mathscr{L}");ie("ℳ","\\mathscr{M}");ie("ℛ","\\mathscr{R}");ie("ℭ","\\mathfrak{C}");ie("ℌ","\\mathfrak{H}");ie("ℨ","\\mathfrak{Z}");ie("\\Bbbk","\\Bbb{k}");ie("\\llap","\\mathllap{\\textrm{#1}}");ie("\\rlap","\\mathrlap{\\textrm{#1}}");ie("\\clap","\\mathclap{\\textrm{#1}}");ie("\\mathstrut","\\vphantom{(}");ie("\\underbar","\\underline{\\text{#1}}");ie("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ie("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ie("\\ne","\\neq");ie("≠","\\neq");ie("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ie("∉","\\notin");ie("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ie("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ie("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ie("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ie("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ie("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ie("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ie("⟂","\\perp");ie("‼","\\mathclose{!\\mkern-0.8mu!}");ie("∌","\\notni");ie("⌜","\\ulcorner");ie("⌝","\\urcorner");ie("⌞","\\llcorner");ie("⌟","\\lrcorner");ie("©","\\copyright");ie("®","\\textregistered");ie("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ie("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ie("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ie("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ie("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ie("⋮","\\vdots");ie("\\varGamma","\\mathit{\\Gamma}");ie("\\varDelta","\\mathit{\\Delta}");ie("\\varTheta","\\mathit{\\Theta}");ie("\\varLambda","\\mathit{\\Lambda}");ie("\\varXi","\\mathit{\\Xi}");ie("\\varPi","\\mathit{\\Pi}");ie("\\varSigma","\\mathit{\\Sigma}");ie("\\varUpsilon","\\mathit{\\Upsilon}");ie("\\varPhi","\\mathit{\\Phi}");ie("\\varPsi","\\mathit{\\Psi}");ie("\\varOmega","\\mathit{\\Omega}");ie("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ie("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ie("\\boxed","\\fbox{$\\displaystyle{#1}$}");ie("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ie("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ie("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ie("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ie("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var XA={",":"\\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"},jRn=new Set(["bin","rel"]);ie("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in XA?n=XA[t]:(t.slice(0,4)==="\\not"||t in Sr.math&&jRn.has(Sr.math[t].group))&&(n="\\dotsb"),n});var nC={")":!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};ie("\\dotso",function(e){var n=e.future().text;return n in nC?"\\ldots\\,":"\\ldots"});ie("\\dotsc",function(e){var n=e.future().text;return n in nC&&n!==","?"\\ldots\\,":"\\ldots"});ie("\\cdots",function(e){var n=e.future().text;return n in nC?"\\@cdots\\,":"\\@cdots"});ie("\\dotsb","\\cdots");ie("\\dotsm","\\cdots");ie("\\dotsi","\\!\\cdots");ie("\\dotsx","\\ldots\\,");ie("\\DOTSI","\\relax");ie("\\DOTSB","\\relax");ie("\\DOTSX","\\relax");ie("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ie("\\,","\\tmspace+{3mu}{.1667em}");ie("\\thinspace","\\,");ie("\\>","\\mskip{4mu}");ie("\\:","\\tmspace+{4mu}{.2222em}");ie("\\medspace","\\:");ie("\\;","\\tmspace+{5mu}{.2777em}");ie("\\thickspace","\\;");ie("\\!","\\tmspace-{3mu}{.1667em}");ie("\\negthinspace","\\!");ie("\\negmedspace","\\tmspace-{4mu}{.2222em}");ie("\\negthickspace","\\tmspace-{5mu}{.277em}");ie("\\enspace","\\kern.5em ");ie("\\enskip","\\hskip.5em\\relax");ie("\\quad","\\hskip1em\\relax");ie("\\qquad","\\hskip2em\\relax");ie("\\tag","\\@ifstar\\tag@literal\\tag@paren");ie("\\tag@paren","\\tag@literal{({#1})}");ie("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Xe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ie("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ie("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ie("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ie("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ie("\\newline","\\\\\\relax");ie("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var jF=tt(Wo["Main-Regular"][84][1]-.7*Wo["Main-Regular"][65][1]);ie("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+jF+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ie("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+jF+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ie("\\hspace","\\@ifstar\\@hspacer\\@hspace");ie("\\@hspace","\\hskip #1\\relax");ie("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ie("\\ordinarycolon",":");ie("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ie("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ie("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ie("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ie("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ie("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ie("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ie("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ie("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ie("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ie("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ie("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ie("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ie("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ie("∷","\\dblcolon");ie("∹","\\eqcolon");ie("≔","\\coloneqq");ie("≕","\\eqqcolon");ie("⩴","\\Coloneqq");ie("\\ratio","\\vcentcolon");ie("\\coloncolon","\\dblcolon");ie("\\colonequals","\\coloneqq");ie("\\coloncolonequals","\\Coloneqq");ie("\\equalscolon","\\eqqcolon");ie("\\equalscoloncolon","\\Eqqcolon");ie("\\colonminus","\\coloneq");ie("\\coloncolonminus","\\Coloneq");ie("\\minuscolon","\\eqcolon");ie("\\minuscoloncolon","\\Eqcolon");ie("\\coloncolonapprox","\\Colonapprox");ie("\\coloncolonsim","\\Colonsim");ie("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ie("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ie("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ie("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ie("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ie("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ie("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ie("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ie("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ie("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ie("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ie("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ie("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ie("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ie("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ie("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ie("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ie("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ie("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ie("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ie("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ie("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ie("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ie("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ie("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ie("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ie("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ie("\\imath","\\html@mathml{\\@imath}{ı}");ie("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ie("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ie("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ie("⟦","\\llbracket");ie("⟧","\\rrbracket");ie("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ie("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ie("⦃","\\lBrace");ie("⦄","\\rBrace");ie("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ie("⦵","\\minuso");ie("\\darr","\\downarrow");ie("\\dArr","\\Downarrow");ie("\\Darr","\\Downarrow");ie("\\lang","\\langle");ie("\\rang","\\rangle");ie("\\uarr","\\uparrow");ie("\\uArr","\\Uparrow");ie("\\Uarr","\\Uparrow");ie("\\N","\\mathbb{N}");ie("\\R","\\mathbb{R}");ie("\\Z","\\mathbb{Z}");ie("\\alef","\\aleph");ie("\\alefsym","\\aleph");ie("\\Alpha","\\mathrm{A}");ie("\\Beta","\\mathrm{B}");ie("\\bull","\\bullet");ie("\\Chi","\\mathrm{X}");ie("\\clubs","\\clubsuit");ie("\\cnums","\\mathbb{C}");ie("\\Complex","\\mathbb{C}");ie("\\Dagger","\\ddagger");ie("\\diamonds","\\diamondsuit");ie("\\empty","\\emptyset");ie("\\Epsilon","\\mathrm{E}");ie("\\Eta","\\mathrm{H}");ie("\\exist","\\exists");ie("\\harr","\\leftrightarrow");ie("\\hArr","\\Leftrightarrow");ie("\\Harr","\\Leftrightarrow");ie("\\hearts","\\heartsuit");ie("\\image","\\Im");ie("\\infin","\\infty");ie("\\Iota","\\mathrm{I}");ie("\\isin","\\in");ie("\\Kappa","\\mathrm{K}");ie("\\larr","\\leftarrow");ie("\\lArr","\\Leftarrow");ie("\\Larr","\\Leftarrow");ie("\\lrarr","\\leftrightarrow");ie("\\lrArr","\\Leftrightarrow");ie("\\Lrarr","\\Leftrightarrow");ie("\\Mu","\\mathrm{M}");ie("\\natnums","\\mathbb{N}");ie("\\Nu","\\mathrm{N}");ie("\\Omicron","\\mathrm{O}");ie("\\plusmn","\\pm");ie("\\rarr","\\rightarrow");ie("\\rArr","\\Rightarrow");ie("\\Rarr","\\Rightarrow");ie("\\real","\\Re");ie("\\reals","\\mathbb{R}");ie("\\Reals","\\mathbb{R}");ie("\\Rho","\\mathrm{P}");ie("\\sdot","\\cdot");ie("\\sect","\\S");ie("\\spades","\\spadesuit");ie("\\sub","\\subset");ie("\\sube","\\subseteq");ie("\\supe","\\supseteq");ie("\\Tau","\\mathrm{T}");ie("\\thetasym","\\vartheta");ie("\\weierp","\\wp");ie("\\Zeta","\\mathrm{Z}");ie("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ie("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ie("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ie("\\bra","\\mathinner{\\langle{#1}|}");ie("\\ket","\\mathinner{|{#1}\\rangle}");ie("\\braket","\\mathinner{\\langle{#1}\\rangle}");ie("\\Bra","\\left\\langle#1\\right|");ie("\\Ket","\\left|#1\\right\\rangle");var TF=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var c=_=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=_;if(!_&&s.length){var w=p.future();w.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",c(!1)),s.length&&n.macros.set("\\|",c(!0));var u=n.consumeArg().tokens,h=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ie("\\bra@ket",TF(!1));ie("\\bra@set",TF(!0));ie("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ie("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ie("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ie("\\angln","{\\angl n}");ie("\\blue","\\textcolor{##6495ed}{#1}");ie("\\orange","\\textcolor{##ffa500}{#1}");ie("\\pink","\\textcolor{##ff00af}{#1}");ie("\\red","\\textcolor{##df0030}{#1}");ie("\\green","\\textcolor{##28ae7b}{#1}");ie("\\gray","\\textcolor{gray}{#1}");ie("\\purple","\\textcolor{##9d38bd}{#1}");ie("\\blueA","\\textcolor{##ccfaff}{#1}");ie("\\blueB","\\textcolor{##80f6ff}{#1}");ie("\\blueC","\\textcolor{##63d9ea}{#1}");ie("\\blueD","\\textcolor{##11accd}{#1}");ie("\\blueE","\\textcolor{##0c7f99}{#1}");ie("\\tealA","\\textcolor{##94fff5}{#1}");ie("\\tealB","\\textcolor{##26edd5}{#1}");ie("\\tealC","\\textcolor{##01d1c1}{#1}");ie("\\tealD","\\textcolor{##01a995}{#1}");ie("\\tealE","\\textcolor{##208170}{#1}");ie("\\greenA","\\textcolor{##b6ffb0}{#1}");ie("\\greenB","\\textcolor{##8af281}{#1}");ie("\\greenC","\\textcolor{##74cf70}{#1}");ie("\\greenD","\\textcolor{##1fab54}{#1}");ie("\\greenE","\\textcolor{##0d923f}{#1}");ie("\\goldA","\\textcolor{##ffd0a9}{#1}");ie("\\goldB","\\textcolor{##ffbb71}{#1}");ie("\\goldC","\\textcolor{##ff9c39}{#1}");ie("\\goldD","\\textcolor{##e07d10}{#1}");ie("\\goldE","\\textcolor{##a75a05}{#1}");ie("\\redA","\\textcolor{##fca9a9}{#1}");ie("\\redB","\\textcolor{##ff8482}{#1}");ie("\\redC","\\textcolor{##f9685d}{#1}");ie("\\redD","\\textcolor{##e84d39}{#1}");ie("\\redE","\\textcolor{##bc2612}{#1}");ie("\\maroonA","\\textcolor{##ffbde0}{#1}");ie("\\maroonB","\\textcolor{##ff92c6}{#1}");ie("\\maroonC","\\textcolor{##ed5fa6}{#1}");ie("\\maroonD","\\textcolor{##ca337c}{#1}");ie("\\maroonE","\\textcolor{##9e034e}{#1}");ie("\\purpleA","\\textcolor{##ddd7ff}{#1}");ie("\\purpleB","\\textcolor{##c6b9fc}{#1}");ie("\\purpleC","\\textcolor{##aa87ff}{#1}");ie("\\purpleD","\\textcolor{##7854ab}{#1}");ie("\\purpleE","\\textcolor{##543b78}{#1}");ie("\\mintA","\\textcolor{##f5f9e8}{#1}");ie("\\mintB","\\textcolor{##edf2df}{#1}");ie("\\mintC","\\textcolor{##e0e5cc}{#1}");ie("\\grayA","\\textcolor{##f6f7f7}{#1}");ie("\\grayB","\\textcolor{##f0f1f2}{#1}");ie("\\grayC","\\textcolor{##e3e5e6}{#1}");ie("\\grayD","\\textcolor{##d6d8da}{#1}");ie("\\grayE","\\textcolor{##babec2}{#1}");ie("\\grayF","\\textcolor{##888d93}{#1}");ie("\\grayG","\\textcolor{##626569}{#1}");ie("\\grayH","\\textcolor{##3b3e40}{#1}");ie("\\grayI","\\textcolor{##21242c}{#1}");ie("\\kaBlue","\\textcolor{##314453}{#1}");ie("\\kaGreen","\\textcolor{##71B307}{#1}");var AF={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class TRn{constructor(n,t,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=t,this.expansionCount=0,this.feed(n),this.macros=new NRn(zRn,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new WA(n,this.settings)}switchMode(n){this.mode=n}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(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new da("EOF",r.loc)),this.pushTokens(s),new da("",$i.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Xe("Extra }",i)}else if(i.text==="EOF")throw new Xe("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Xe("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Xe("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Xe("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var c=i[o];if(c.text==="#"){if(o===0)throw new Xe("Incomplete placeholder at end of macro body",c);if(c=i[--o],c.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(c.text))i.splice(o,2,...a[+c.text-1]);else throw new Xe("Not a valid argument number",c)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new da(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new WA(s,this.settings),c=[],u=o.lex();u.text!=="EOF";)c.push(u),u=o.lex();c.reverse();var h={tokens:c,numArgs:i};return h}return s}isDefined(n){return this.macros.has(n)||Nu.hasOwnProperty(n)||Sr.math.hasOwnProperty(n)||Sr.text.hasOwnProperty(n)||AF.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:Nu.hasOwnProperty(n)&&!Nu[n].primitive}}var YA=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,E1=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),e4={"́":{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"}},ZA={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Ty{constructor(n,t){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 TRn(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Xe("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new da("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Ty.endOfExpression.has(s.text)||t&&s.text===t||n&&Nu[s.text]&&Nu[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&($P(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:$i.range(n),text:t};else return null;if(this.consume(),i)for(var h=0;h0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=C+1:(w!==C&&x.push({type:"text",value:u.value.slice(w,C)}),Array.isArray(N)?x.push(...N):N&&x.push(N),w=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(w?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=eR(e,"(");let i=eR(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function DF(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||uf(t)||fy(t))&&(!n||t!==47)}LF.peek=lMn;function tMn(){this.buffer()}function nMn(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function rMn(){this.buffer()}function sMn(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function iMn(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=yo(this.sliceSerialize(e)).toLowerCase(),t.label=n}function aMn(e){this.exit(e)}function oMn(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=yo(this.sliceSerialize(e)).toLowerCase(),t.label=n}function cMn(e){this.exit(e)}function lMn(){return"["}function LF(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function uMn(){return{enter:{gfmFootnoteCallString:tMn,gfmFootnoteCall:nMn,gfmFootnoteDefinitionLabelString:rMn,gfmFootnoteDefinition:sMn},exit:{gfmFootnoteCallString:iMn,gfmFootnoteCall:aMn,gfmFootnoteDefinitionLabelString:oMn,gfmFootnoteDefinition:cMn}}}function _Mn(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:LF},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let c=o.move("[^");const u=i.enter("footnoteDefinition"),h=i.enter("label");return c+=o.move(i.safe(i.associationId(r),{before:c,after:"]"})),h(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((n?` +`:" ")+i.indentLines(i.containerFlow(r,o.current()),n?IF:fMn))),u(),c}}function fMn(e,n,t){return n===0?e:IF(e,n,t)}function IF(e,n,t){return(t?"":" ")+e}const dMn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$F.peek=vMn;function hMn(){return{canContainEols:["delete"],enter:{strikethrough:mMn},exit:{strikethrough:gMn}}}function pMn(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:dMn}],handlers:{delete:$F}}}function mMn(e){this.enter({type:"delete",children:[]},e)}function gMn(e){this.exit(e)}function $F(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let a=s.move("~~");return a+=t.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function vMn(){return"~"}function bMn(e){return e.length}function yMn(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||bMn,i=[],a=[],o=[],c=[];let u=0,h=-1;for(;++hu&&(u=e[h].length);++bc[b])&&(c[b]=y)}k.push(x)}a[h]=k,o[h]=v}let _=-1;if(typeof r=="object"&&"length"in r)for(;++_c[_]&&(c[_]=x),m[_]=x),p[_]=y}a.splice(1,0,p),o.splice(1,0,m),h=-1;const w=[];for(;++h "),i.shift(2);const a=t.indentLines(t.containerFlow(e,i.current()),kMn);return s(),a}function kMn(e,n,t){return">"+(t?"":" ")+e}function SMn(e,n){return nR(e,n.inConstruct,!0)&&!nR(e,n.notInConstruct,!1)}function nR(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++ra&&(a=i):i=1,s=r+n.length,r=t.indexOf(n,s);return a}function CMn(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function EMn(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function NMn(e,n,t,r){const s=EMn(t),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(CMn(e,t)){const _=t.enter("codeIndented"),p=t.indentLines(i,zMn);return _(),p}const o=t.createTracker(r),c=s.repeat(Math.max(BF(i,s)+1,3)),u=t.enter("codeFenced");let h=o.move(c);if(e.lang){const _=t.enter(`codeFencedLang${a}`);h+=o.move(t.safe(e.lang,{before:h,after:" ",encode:["`"],...o.current()})),_()}if(e.lang&&e.meta){const _=t.enter(`codeFencedMeta${a}`);h+=o.move(" "),h+=o.move(t.safe(e.meta,{before:h,after:` @@ -1032,11 +1032,11 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, `))+1))}const a="#".repeat(s),o=t.enter("headingAtx"),c=t.enter("phrasing");i.move(a+" ");let u=t.containerPhrasing(e,{before:"# ",after:` `,...i.current()});return/^[\t ]/.test(u)&&(u=V0(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,t.options.closeAtx&&(u+=" "+a),c(),o(),u}FF.peek=OMn;function FF(e){return e.value||""}function OMn(){return"<"}HF.peek=DMn;function HF(e,n,t,r){const s=iC(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("image");let o=t.enter("label");const c=t.createTracker(r);let u=c.move("![");return u+=c.move(t.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(t.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=t.enter("destinationRaw"),u+=c.move(t.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=c.move(" "+s),u+=c.move(t.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),o()),u+=c.move(")"),a(),u}function DMn(){return"!"}qF.peek=LMn;function qF(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let c=o.move("![");const u=t.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const h=t.stack;t.stack=[],a=t.enter("reference");const _=t.safe(t.associationId(e),{before:c,after:"]",...o.current()});return a(),t.stack=h,i(),s==="full"||!u||u!==_?c+=o.move(_+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function LMn(){return"!"}UF.peek=IMn;function UF(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}VF.peek=$Mn;function VF(e,n,t,r){const s=iC(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,c;if(GF(e,t)){const h=t.stack;t.stack=[],o=t.enter("autolink");let _=a.move("<");return _+=a.move(t.containerPhrasing(e,{before:_,after:">",...a.current()})),_+=a.move(">"),o(),t.stack=h,_}o=t.enter("link"),c=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),c()),u+=a.move(")"),o(),u}function $Mn(e,n,t){return GF(e,t)?"<":"["}KF.peek=BMn;function KF(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let c=o.move("[");const u=t.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const h=t.stack;t.stack=[],a=t.enter("reference");const _=t.safe(t.associationId(e),{before:c,after:"]",...o.current()});return a(),t.stack=h,i(),s==="full"||!u||u!==_?c+=o.move(_+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function BMn(){return"["}function aC(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function PMn(e){const n=aC(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function FMn(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function WF(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function HMn(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?FMn(t):aC(t);const o=e.ordered?a==="."?")":".":PMn(t);let c=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(c=!0),WF(t)===a&&h){let _=-1;for(;++_-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const c=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),h);return c(),u;function h(_,p,m){return p?(m?"":" ".repeat(a))+_:(m?i:i+" ".repeat(a-i.length))+_}}function GMn(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const VMn=Om(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function KMn(e,n,t,r){return(e.children.some(function(a){return VMn(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function WMn(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}QF.peek=QMn;function QF(e,n,t,r){const s=WMn(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let c=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=c.charCodeAt(0),h=sb(r.before.charCodeAt(r.before.length-1),u,s);h.inside&&(c=V0(u)+c.slice(1));const _=c.charCodeAt(c.length-1),p=sb(r.after.charCodeAt(0),_,s);p.inside&&(c=c.slice(0,-1)+V0(_));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},o+c+m}function QMn(e,n,t){return t.options.strong||"*"}function XMn(e,n,t,r){return t.safe(e.value,r)}function YMn(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function ZMn(e,n,t){const r=(WF(t)+(t.options.ruleSpaces?" ":"")).repeat(YMn(t));return t.options.ruleSpaces?r.slice(0,-1):r}const XF={blockquote:wMn,break:rR,code:NMn,definition:jMn,emphasis:PF,hardBreak:rR,heading:MMn,html:FF,image:HF,imageReference:qF,inlineCode:UF,link:VF,linkReference:KF,list:HMn,listItem:UMn,paragraph:GMn,root:KMn,strong:QF,text:XMn,thematicBreak:ZMn};function JMn(){return{enter:{table:eOn,tableData:sR,tableHeader:sR,tableRow:nOn},exit:{codeText:rOn,table:tOn,tableData:s4,tableHeader:s4,tableRow:s4}}}function eOn(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function tOn(e){this.exit(e),this.data.inTable=void 0}function nOn(e){this.enter({type:"tableRow",children:[]},e)}function s4(e){this.exit(e)}function sR(e){this.enter({type:"tableCell",children:[]},e)}function rOn(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,sOn));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function sOn(e,n){return n==="|"?n:e}function iOn(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";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:p,table:a,tableCell:c,tableRow:o}};function a(m,w,k,v){return u(h(m,k,v),m.align)}function o(m,w,k,v){const b=_(m,k,v),x=u([b]);return x.slice(0,x.indexOf(` -`))}function c(m,w,k,v){const b=k.enter("tableCell"),x=k.enter("phrasing"),y=k.containerPhrasing(m,{...v,before:i,after:i});return x(),b(),y}function u(m,w){return yMn(m,{align:w,alignDelimiters:r,padding:t,stringLength:s})}function h(m,w,k){const v=m.children;let b=-1;const x=[],y=w.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const kOn={tokenize:AOn,partial:!0};function SOn(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:zOn,continuation:{tokenize:jOn},exit:TOn}},text:{91:{name:"gfmFootnoteCall",tokenize:NOn},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:COn,resolveTo:EOn}}}}function COn(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!a||!a._balanced)return t(c);const u=yo(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function EOn(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function NOn(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(_){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(_),e.exit("gfmFootnoteCallLabelMarker"),c}function c(_){return _!==94?t(_):(e.enter("gfmFootnoteCallMarker"),e.consume(_),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(_){if(i>999||_===93&&!a||_===null||_===91||fr(_))return t(_);if(_===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(yo(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(_),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(_)}return fr(_)||(a=!0),i++,e.consume(_),_===92?h:u}function h(_){return _===91||_===92||_===93?(e.consume(_),i++,u):u(_)}}function zOn(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return c;function c(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):t(w)}function h(w){if(a>999||w===93&&!o||w===null||w===91||fr(w))return t(w);if(w===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return i=yo(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return fr(w)||(o=!0),a++,e.consume(w),w===92?_:h}function _(w){return w===91||w===92||w===93?(e.consume(w),a++,h):h(w)}function p(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(i)||s.push(i),yn(e,m,"gfmFootnoteDefinitionWhitespace")):t(w)}function m(w){return n(w)}}function jOn(e,n,t){return e.check(Lm,n,e.attempt(kOn,n,t))}function TOn(e){e.exit("gfmFootnoteDefinition")}function AOn(e,n,t){const r=this;return yn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function ROn(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let c=-1;for(;++c1?c(w):(a.consume(w),_++,m);if(_<2&&!t)return c(w);const v=a.exit("strikethroughSequenceTemporary"),b=kh(w);return v._open=!b||b===2&&!!k,v._close=!k||k===2&&!!b,o(w)}}}class MOn{constructor(){this.map=[]}add(n,t,r){OOn(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function OOn(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const H=r.events[I][1].type;if(H==="lineEnding"||H==="linePrefix")I--;else break}const $=I>-1?r.events[I][1].type:null,q=$==="tableHead"||$==="tableRow"?E:c;return q===E&&r.parser.lazy[r.now().line]?t(D):q(D)}function c(D){return e.enter("tableHead"),e.enter("tableRow"),u(D)}function u(D){return D===124||(a=!0,i+=1),h(D)}function h(D){return D===null?t(D):Rt(D)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),m):t(D):Cn(D)?yn(e,h,"whitespace")(D):(i+=1,a&&(a=!1,s+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),a=!0,h):(e.enter("data"),_(D)))}function _(D){return D===null||D===124||fr(D)?(e.exit("data"),h(D)):(e.consume(D),D===92?p:_)}function p(D){return D===92||D===124?(e.consume(D),_):_(D)}function m(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(D):(e.enter("tableDelimiterRow"),a=!1,Cn(D)?yn(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):w(D))}function w(D){return D===45||D===58?v(D):D===124?(a=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),k):z(D)}function k(D){return Cn(D)?yn(e,v,"whitespace")(D):v(D)}function v(D){return D===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),b):D===45?(i+=1,b(D)):D===null||Rt(D)?C(D):z(D)}function b(D){return D===45?(e.enter("tableDelimiterFiller"),x(D)):z(D)}function x(D){return D===45?(e.consume(D),x):D===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(D))}function y(D){return Cn(D)?yn(e,C,"whitespace")(D):C(D)}function C(D){return D===124?w(D):D===null||Rt(D)?!a||s!==i?z(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(D)):z(D)}function z(D){return t(D)}function E(D){return e.enter("tableRow"),T(D)}function T(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),T):D===null||Rt(D)?(e.exit("tableRow"),n(D)):Cn(D)?yn(e,T,"whitespace")(D):(e.enter("data"),j(D))}function j(D){return D===null||D===124||fr(D)?(e.exit("data"),T(D)):(e.consume(D),D===92?M:j)}function M(D){return D===92||D===124?(e.consume(D),j):j(D)}}function $On(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,u,h,_;const p=new MOn;for(;++tt[2]+1){const w=t[2]+1,k=t[3]-t[2]-1;e.add(w,k,[])}}e.add(t[3]+1,0,[["exit",_,n]])}return s!==void 0&&(i.end=Object.assign({},Nd(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function aR(e,n,t,r,s){const i=[],a=Nd(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function Nd(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const BOn={name:"tasklistCheck",tokenize:FOn};function POn(){return{text:{91:BOn}}}function FOn(e,n,t){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return fr(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):t(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(c)}function o(c){return Rt(c)?n(c):Cn(c)?e.check({tokenize:HOn},n,t)(c):t(c)}}function HOn(e,n,t){return yn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function qOn(e){return dP([hOn(),SOn(),ROn(e),LOn(),POn()])}const UOn={};function iH(e){const n=this,t=e||UOn,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(qOn(t)),i.push(uOn()),a.push(_On(t))}function GOn(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(c){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},c)}function n(){this.buffer()}function t(){const c=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=u;const _=h.data.hChildren[0];_.type,_.tagName,_.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function a(c){const u=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=u,h.data.hChildren.push({type:"text",value:u})}function o(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function VOn(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`))}function c(m,w,k,v){const b=k.enter("tableCell"),x=k.enter("phrasing"),y=k.containerPhrasing(m,{...v,before:i,after:i});return x(),b(),y}function u(m,w){return yMn(m,{align:w,alignDelimiters:r,padding:t,stringLength:s})}function h(m,w,k){const v=m.children;let b=-1;const x=[],y=w.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const kOn={tokenize:AOn,partial:!0};function SOn(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:zOn,continuation:{tokenize:jOn},exit:TOn}},text:{91:{name:"gfmFootnoteCall",tokenize:NOn},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:COn,resolveTo:EOn}}}}function COn(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!a||!a._balanced)return t(c);const u=yo(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function EOn(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function NOn(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(_){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(_),e.exit("gfmFootnoteCallLabelMarker"),c}function c(_){return _!==94?t(_):(e.enter("gfmFootnoteCallMarker"),e.consume(_),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(_){if(i>999||_===93&&!a||_===null||_===91||fr(_))return t(_);if(_===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(yo(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(_),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(_)}return fr(_)||(a=!0),i++,e.consume(_),_===92?h:u}function h(_){return _===91||_===92||_===93?(e.consume(_),i++,u):u(_)}}function zOn(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return c;function c(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):t(w)}function h(w){if(a>999||w===93&&!o||w===null||w===91||fr(w))return t(w);if(w===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return i=yo(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return fr(w)||(o=!0),a++,e.consume(w),w===92?_:h}function _(w){return w===91||w===92||w===93?(e.consume(w),a++,h):h(w)}function p(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(i)||s.push(i),yn(e,m,"gfmFootnoteDefinitionWhitespace")):t(w)}function m(w){return n(w)}}function jOn(e,n,t){return e.check(Lm,n,e.attempt(kOn,n,t))}function TOn(e){e.exit("gfmFootnoteDefinition")}function AOn(e,n,t){const r=this;return yn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function ROn(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let c=-1;for(;++c1?c(w):(a.consume(w),_++,m);if(_<2&&!t)return c(w);const v=a.exit("strikethroughSequenceTemporary"),b=kh(w);return v._open=!b||b===2&&!!k,v._close=!k||k===2&&!!b,o(w)}}}class MOn{constructor(){this.map=[]}add(n,t,r){OOn(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function OOn(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const H=r.events[I][1].type;if(H==="lineEnding"||H==="linePrefix")I--;else break}const $=I>-1?r.events[I][1].type:null,q=$==="tableHead"||$==="tableRow"?N:c;return q===N&&r.parser.lazy[r.now().line]?t(D):q(D)}function c(D){return e.enter("tableHead"),e.enter("tableRow"),u(D)}function u(D){return D===124||(a=!0,i+=1),h(D)}function h(D){return D===null?t(D):Rt(D)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),m):t(D):Cn(D)?yn(e,h,"whitespace")(D):(i+=1,a&&(a=!1,s+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),a=!0,h):(e.enter("data"),_(D)))}function _(D){return D===null||D===124||fr(D)?(e.exit("data"),h(D)):(e.consume(D),D===92?p:_)}function p(D){return D===92||D===124?(e.consume(D),_):_(D)}function m(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(D):(e.enter("tableDelimiterRow"),a=!1,Cn(D)?yn(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):w(D))}function w(D){return D===45||D===58?v(D):D===124?(a=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),k):z(D)}function k(D){return Cn(D)?yn(e,v,"whitespace")(D):v(D)}function v(D){return D===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),b):D===45?(i+=1,b(D)):D===null||Rt(D)?C(D):z(D)}function b(D){return D===45?(e.enter("tableDelimiterFiller"),x(D)):z(D)}function x(D){return D===45?(e.consume(D),x):D===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(D))}function y(D){return Cn(D)?yn(e,C,"whitespace")(D):C(D)}function C(D){return D===124?w(D):D===null||Rt(D)?!a||s!==i?z(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(D)):z(D)}function z(D){return t(D)}function N(D){return e.enter("tableRow"),T(D)}function T(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),T):D===null||Rt(D)?(e.exit("tableRow"),n(D)):Cn(D)?yn(e,T,"whitespace")(D):(e.enter("data"),j(D))}function j(D){return D===null||D===124||fr(D)?(e.exit("data"),T(D)):(e.consume(D),D===92?M:j)}function M(D){return D===92||D===124?(e.consume(D),j):j(D)}}function $On(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,u,h,_;const p=new MOn;for(;++tt[2]+1){const w=t[2]+1,k=t[3]-t[2]-1;e.add(w,k,[])}}e.add(t[3]+1,0,[["exit",_,n]])}return s!==void 0&&(i.end=Object.assign({},Nd(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function aR(e,n,t,r,s){const i=[],a=Nd(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function Nd(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const BOn={name:"tasklistCheck",tokenize:FOn};function POn(){return{text:{91:BOn}}}function FOn(e,n,t){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return fr(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):t(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(c)}function o(c){return Rt(c)?n(c):Cn(c)?e.check({tokenize:HOn},n,t)(c):t(c)}}function HOn(e,n,t){return yn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function qOn(e){return dP([hOn(),SOn(),ROn(e),LOn(),POn()])}const UOn={};function iH(e){const n=this,t=e||UOn,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(qOn(t)),i.push(uOn()),a.push(_On(t))}function GOn(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(c){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},c)}function n(){this.buffer()}function t(){const c=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=u;const _=h.data.hChildren[0];_.type,_.tagName,_.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function a(c){const u=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=u,h.data.hChildren.push({type:"text",value:u})}function o(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function VOn(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,inConstruct:"mathFlowMeta"},{character:"$",after:n?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:r}};function t(i,a,o,c){const u=i.value||"",h=o.createTracker(c),_="$".repeat(Math.max(BF(u,"$")+1,2)),p=o.enter("mathFlow");let m=h.move(_);if(i.meta){const w=o.enter("mathFlowMeta");m+=h.move(o.safe(i.meta,{after:` `,before:m,encode:["$"],...h.current()})),w()}return m+=h.move(` `),u&&(m+=h.move(u+` -`)),m+=h.move(_),p(),m}function r(i,a,o){let c=i.value||"",u=1;for(n||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(c);)u++;const h="$".repeat(u);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let _=-1;for(;++_=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function F5(e){var a;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(o){r+=o[0].length,s+=1;continue}const c=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!c)break;r+=c[0].length,t+=c[0].length,n=!0}const i=((a=/^[ \t]*/.exec(e.slice(r)))==null?void 0:a[0].length)??0;return{hasListMarker:n,indentation:i,listIndent:t,offset:r+i,quoteDepth:s}}function rDn(e,n){const t=e[n];if(t!=="`"&&t!=="~"||K0(e,n)||Nh(e,n,t)<3)return!1;const r=e.lastIndexOf(` +`)),m+=h.move(_),p(),m}function r(i,a,o){let c=i.value||"",u=1;for(n||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(c);)u++;const h="$".repeat(u);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let _=-1;for(;++_=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function F5(e){var a;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(o){r+=o[0].length,s+=1;continue}const c=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!c)break;r+=c[0].length,t+=c[0].length,n=!0}const i=((a=/^[ \t]*/.exec(e.slice(r)))==null?void 0:a[0].length)??0;return{hasListMarker:n,indentation:i,listIndent:t,offset:r+i,quoteDepth:s}}function rDn(e,n){const t=e[n];if(t!=="`"&&t!=="~"||K0(e,n)||Nh(e,n,t)<3)return!1;const r=e.lastIndexOf(` `,n-1)+1,s=e.indexOf(` `,n),i=e.slice(r,s===-1?e.length:s),a=F5(i);return a.indentation<=3&&r+a.offset===n}function sDn(e,n){const t=e[n],r=Nh(e,n,t),s=e.lastIndexOf(` `,n-1)+1,i=e.indexOf(` @@ -1044,11 +1044,11 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, `,n+r);if(o===-1)return e.length;for(o+=1;o=a.listIndent&&_.indentation<=a.listIndent+3&&m>=r&&/^[ \t\r]*$/.test(e.slice(p+m,u)))return c===-1?e.length:c+1;if(c===-1)return e.length;o=c+1}return e.length}function iDn(e,n,t){const r=Nh(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function oDn(e){const n=[];for(let t=0;t|()[\]-]+$/.test(t)?/^[eE][+-]?\d+$/.test(t)||/[+*/=^_{}\\<>|()]/.test(t)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(t):!1:!0}function lDn(e,{predictMath:n=!1}={}){const t=oDn(e),r=new Set,s=new Set;for(let u=0;u`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),lDn(t,n)}function cH(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function fDn(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Gr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=fDn(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const lH=A.createContext(void 0);function uH({projectId:e,sessionId:n,children:t}){const r=A.useMemo(()=>(s,i=!1)=>{if(/^(https?:)?\/\//i.test(s))return s;const a=$B(s);return a?(a.source==="absolute"?GL(a.path):a.source==="artifact"&&!i?sf(e,a.path):k3(e,a.source==="artifact"?`artifacts/${a.path}`:a.path,{sessionId:n??void 0}))+a.hash:null},[e,n]);return f.jsx(lH,{value:r,children:t})}function dDn({src:e,alt:n,name:t,onClose:r}){const s=A.useRef(null),i=A.useRef(null),[a,o]=A.useState(1),[c,u]=A.useState({width:0,height:0}),[h,_]=A.useState({width:0,height:0});A.useEffect(()=>{const m=s.current;m==null||m.showModal(),m==null||m.focus();const w=i.current,k=new ResizeObserver(([v])=>{u({width:v.contentRect.width,height:v.contentRect.height})});return w&&k.observe(w),()=>{k.disconnect(),m==null||m.close()}},[]);const p=h.width&&c.width?Math.min(1,c.width*.9/h.width,c.height*.9/h.height):1;return Fi.createPortal(f.jsxs("dialog",{ref:s,tabIndex:-1,"aria-label":n||TD(),onCancel:m=>{m.preventDefault(),r()},className:"fixed inset-0 m-0 max-w-none max-h-none w-full h-dvh border-0 outline-none bg-transparent p-0 text-text backdrop:bg-image-backdrop",onClick:m=>{m.stopPropagation(),m.target===m.currentTarget&&r()},children:[f.jsx("div",{ref:i,className:"absolute inset-x-4 sm:inset-x-12 top-16 bottom-32 overflow-auto overscroll-contain",onClick:m=>{m.target===m.currentTarget&&r()},children:f.jsx("div",{className:"flex min-h-full min-w-full w-max pointer-events-none",children:f.jsx("img",{src:e,alt:n,onLoad:m=>_({width:m.currentTarget.naturalWidth,height:m.currentTarget.naturalHeight}),style:h.width?{width:h.width*p*a,height:h.height*p*a}:void 0,className:`pointer-events-auto block m-auto shrink-0 max-w-none rounded-lg shadow-modal ${h.width&&c.width?"visible":"invisible"}`})})}),f.jsxs("div",{className:"absolute top-5 right-5 flex gap-2",children:[f.jsx(Ih,{shape:"circle",href:e,download:t||!0,"aria-label":_3(),title:_3(),className:"bg-background shadow-popover",children:f.jsx(Lb,{size:16})}),f.jsx(Ft,{shape:"circle",onClick:r,"aria-label":y3(),title:y3(),className:"bg-background shadow-popover",children:f.jsx(_r,{size:16})})]}),f.jsxs("div",{className:"absolute bottom-6 inset-x-6 flex flex-col items-center gap-3 pointer-events-none",children:[n&&f.jsx("div",{className:"max-w-xl line-clamp-2 rounded-xl bg-background px-4 py-2 text-center text-sm leading-snug shadow-popover",children:n}),f.jsxs("div",{className:"pointer-events-auto flex items-center gap-1 rounded-full bg-background p-1.5 shadow-popover",children:[f.jsx(Ft,{shape:"circle",disabled:a<=.25,onClick:()=>o(m=>Math.max(.25,m-.25)),"aria-label":QN(),title:QN(),children:f.jsx(x5n,{size:16})}),f.jsxs(Oe,{variant:"ghost",className:"min-w-16 tabular-nums",onClick:()=>o(1),title:XN(),"aria-label":XN(),children:[Math.round(a*100),"%"]}),f.jsx(Ft,{shape:"circle",disabled:a>=4,onClick:()=>o(m=>Math.min(4,m+.25)),"aria-label":WN(),title:WN(),children:f.jsx($h,{size:16})})]})]})]}),document.body)}function hDn({src:e,fallbackSrc:n,downloadName:t,alt:r="",...s}){const[i,a]=A.useState(!1),[o,c]=A.useState(!1),u=i&&n?n:e;return f.jsxs(f.Fragment,{children:[f.jsx("img",{...s,src:u,alt:r,role:"button",tabIndex:0,"aria-haspopup":"dialog",onClick:h=>{h.preventDefault(),h.stopPropagation(),c(!0)},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),h.stopPropagation(),c(!0))},onError:!i&&n&&n!==e?()=>a(!0):void 0}),o&&u&&f.jsx(dDn,{src:u,alt:r,name:t,onClose:()=>c(!1)})]})}const pDn=1e5;function mDn({code:e,lang:n}){const[t,r]=A.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Ft,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:Yk(),"aria-label":utt(),onClick:s,children:t?f.jsx(Pi,{size:13}):f.jsx(Sf,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:f6n(e,n,pDn)})})]})}function gDn(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function uR(e,n,t){let r=n.line,s=n.column;for(let i=0;i`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),lDn(t,n)}function cH(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function fDn(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Gr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=fDn(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const lH=A.createContext(void 0);function uH({projectId:e,sessionId:n,children:t}){const r=A.useMemo(()=>(s,i=!1)=>{if(/^(https?:)?\/\//i.test(s))return s;const a=$B(s);return a?(a.source==="absolute"?GL(a.path):a.source==="artifact"&&!i?sf(e,a.path):k3(e,a.source==="artifact"?`artifacts/${a.path}`:a.path,{sessionId:n??void 0}))+a.hash:null},[e,n]);return f.jsx(lH,{value:r,children:t})}function dDn({src:e,alt:n,name:t,onClose:r}){const s=A.useRef(null),i=A.useRef(null),[a,o]=A.useState(1),[c,u]=A.useState({width:0,height:0}),[h,_]=A.useState({width:0,height:0});A.useEffect(()=>{const m=s.current;m==null||m.showModal(),m==null||m.focus();const w=i.current,k=new ResizeObserver(([v])=>{u({width:v.contentRect.width,height:v.contentRect.height})});return w&&k.observe(w),()=>{k.disconnect(),m==null||m.close()}},[]);const p=h.width&&c.width?Math.min(1,c.width*.9/h.width,c.height*.9/h.height):1;return gi.createPortal(f.jsxs("dialog",{ref:s,tabIndex:-1,"aria-label":n||TD(),onCancel:m=>{m.preventDefault(),r()},className:"fixed inset-0 m-0 max-w-none max-h-none w-full h-dvh border-0 outline-none bg-transparent p-0 text-text backdrop:bg-image-backdrop",onClick:m=>{m.stopPropagation(),m.target===m.currentTarget&&r()},children:[f.jsx("div",{ref:i,className:"absolute inset-x-4 sm:inset-x-12 top-16 bottom-32 overflow-auto overscroll-contain",onClick:m=>{m.target===m.currentTarget&&r()},children:f.jsx("div",{className:"flex min-h-full min-w-full w-max pointer-events-none",children:f.jsx("img",{src:e,alt:n,onLoad:m=>_({width:m.currentTarget.naturalWidth,height:m.currentTarget.naturalHeight}),style:h.width?{width:h.width*p*a,height:h.height*p*a}:void 0,className:`pointer-events-auto block m-auto shrink-0 max-w-none rounded-lg shadow-modal ${h.width&&c.width?"visible":"invisible"}`})})}),f.jsxs("div",{className:"absolute top-5 right-5 flex gap-2",children:[f.jsx(Ih,{shape:"circle",href:e,download:t||!0,"aria-label":_3(),title:_3(),className:"bg-background shadow-popover",children:f.jsx(Lb,{size:16})}),f.jsx(Ft,{shape:"circle",onClick:r,"aria-label":y3(),title:y3(),className:"bg-background shadow-popover",children:f.jsx(_r,{size:16})})]}),f.jsxs("div",{className:"absolute bottom-6 inset-x-6 flex flex-col items-center gap-3 pointer-events-none",children:[n&&f.jsx("div",{className:"max-w-xl line-clamp-2 rounded-xl bg-background px-4 py-2 text-center text-sm leading-snug shadow-popover",children:n}),f.jsxs("div",{className:"pointer-events-auto flex items-center gap-1 rounded-full bg-background p-1.5 shadow-popover",children:[f.jsx(Ft,{shape:"circle",disabled:a<=.25,onClick:()=>o(m=>Math.max(.25,m-.25)),"aria-label":QN(),title:QN(),children:f.jsx(x5n,{size:16})}),f.jsxs(Oe,{variant:"ghost",className:"min-w-16 tabular-nums",onClick:()=>o(1),title:XN(),"aria-label":XN(),children:[Math.round(a*100),"%"]}),f.jsx(Ft,{shape:"circle",disabled:a>=4,onClick:()=>o(m=>Math.min(4,m+.25)),"aria-label":WN(),title:WN(),children:f.jsx($h,{size:16})})]})]})]}),document.body)}function hDn({src:e,fallbackSrc:n,downloadName:t,alt:r="",...s}){const[i,a]=A.useState(!1),[o,c]=A.useState(!1),u=i&&n?n:e;return f.jsxs(f.Fragment,{children:[f.jsx("img",{...s,src:u,alt:r,role:"button",tabIndex:0,"aria-haspopup":"dialog",onClick:h=>{h.preventDefault(),h.stopPropagation(),c(!0)},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),h.stopPropagation(),c(!0))},onError:!i&&n&&n!==e?()=>a(!0):void 0}),o&&u&&f.jsx(dDn,{src:u,alt:r,name:t,onClose:()=>c(!1)})]})}const pDn=1e5;function mDn({code:e,lang:n}){const[t,r]=A.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Ft,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:Yk(),"aria-label":utt(),onClick:s,children:t?f.jsx(Fi,{size:13}):f.jsx(Sf,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:f6n(e,n,pDn)})})]})}function gDn(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function uR(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),c=gDn(a[2]??"");if(!c[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:a4(e,s,a.index)});const h=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:c},position:a4(e,a.index,h),type:o==="run"?"runMention":"fileMention"}),s=h}return i?(s_H(e)}function bDn(){return e=>{const n=t=>{var r;for(const s of["href","src"])if(t.properties&&Object.hasOwn(t.properties,s)){const i=String(t.properties[s]||"");t.properties[s]=s==="src"&&t.tagName==="img"&&E6(i)?i:AP(i)}(r=t.children)==null||r.forEach(n)};n(e)}}function fR({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?XY({path:Ce(e)}):e,...Gr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(qI,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(XI,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function yDn({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?kZ({id:Ce(e)}):SJ({id:Ce(e)}),...Gr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(yS,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||$L()}),f.jsx(XI,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const fH={singleDollarTextMath:!0},xDn=py().use(gy).use(iH).use(aH,fH).use(nDn).use(vDn).use(Yv).use(bDn).use(OF);function wDn(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const dH={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` -`)))return f.jsx("code",{className:s,...r,children:t});const c=i?V3(i[1]):null;return f.jsx(mDn,{code:a,lang:c})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})};function kDn({children:e}){return f.jsx("figure",{className:"my-6 mx-auto max-w-full text-left [&_img]:mx-auto [&_img]:my-0 [&_img]:w-auto [&_img]:h-auto [&_img]:max-h-[min(480px,60vh)] [&_img]:object-contain [&_img]:border-0 [&_img]:rounded-none",children:e})}const nc=A.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){wf();const o=A.useContext(lH),c=i??o,u=A.useMemo(()=>({"file-mention":h=>f.jsx(fR,{path:h.path,lines:h.lines,exp:h.exp,onOpenFile:t}),"run-mention":h=>f.jsx(yDn,{id:h.id,label:h.label,onOpenRun:r}),a:({node:h,href:_,children:p,"data-figure-src":m,...w})=>{const k=typeof m=="string"?$B(m):null;if(k&&t){const v=k.source==="artifact"?`artifacts/${k.path}`:k.path,b=s?s(v):v;if(b)return f.jsx("button",{type:"button",className:"text-primary underline cursor-pointer text-start",...Gr(x=>t(b,void 0,void 0,void 0,x)),children:p})}if(_&&wDn(_)&&t){let v;try{v=decodeURI(_)}catch{return f.jsx("span",{children:p})}const b=s?s(v):v;return b?f.jsx(fR,{path:b,onOpenFile:t}):f.jsx("span",{children:p})}return f.jsx("a",{href:_,target:"_blank",rel:"noopener noreferrer",...w,children:p})},figure:({children:h})=>f.jsx(kDn,{children:h}),figcaption:({children:h})=>f.jsx("figcaption",{className:"mt-3 text-sm italic leading-relaxed text-text",children:h}),th:({node:h,..._})=>f.jsx("th",{dir:"auto",..._}),td:({node:h,..._})=>f.jsx("td",{dir:"auto",..._}),img:({node:h,src:_,alt:p,className:m,...w})=>{var v;if(!_||typeof _!="string")return null;const k=c?c(_):_;return k?A.createElement(hDn,{...w,key:k,downloadName:(v=_.split(/[\\/]/).pop())==null?void 0:v.split(/[?#]/)[0],src:k,fallbackSrc:i?null:o==null?void 0:o(_,!0),alt:p??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border cursor-zoom-in focus-visible:outline-2 focus-visible:outline-primary ${m??""}`}):null},...dH}),[t,r,s,i,o,c]);return f.jsx("div",{dir:"auto","data-streaming":a||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-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_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-prose-emphasis [&_.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-sm [&_.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-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_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-start [&_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-start [&_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]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-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:f.jsx(oTn,{content:cH(n,{predictMath:a}),processor:xDn,components:u,predict:a})})}),dR="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function SDn({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,c]=A.useState(!1),u=A.useRef(null),[h,_]=A.useState(!1),[p,m]=A.useState(""),w=A.useRef(null);A.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&c(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),A.useEffect(()=>{var v;h&&((v=w.current)==null||v.focus())},[h]);const k=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),_(!1)};return f.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-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(yS,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?Rxt({agent:Ce(n)}):Cxt({agent:Ce(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Gr(t),children:Zxt()})]}),h?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:w,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:E2t(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),_(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),k())}}),f.jsxs("div",{className:dR,children:[f.jsx(Oe,{size:"small",onClick:()=>{m(""),_(!1)},children:aL()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Oe,{size:"small",variant:"primary",onClick:k,children:[f2t(),f.jsx(HI,{size:13})]})]})]}):f.jsxs("div",{className:dR,children:[f.jsx(Oe,{size:"small",onClick:i,children:i2t()}),f.jsx(Oe,{size:"small",onClick:()=>_(!0),children:b2t()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Oe,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:sxt()}),f.jsx(Oe,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":Gxt(),onClick:()=>c(v=>!v),children:f.jsx(ac,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(Dn,{onClick:()=>{c(!1),r("bypassPermissions")},children:_xt()})})]}):f.jsx(Oe,{size:"small",variant:"primary",onClick:()=>r(),children:vxt()})]})]})}function hR({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=A.useState(""),[o,c]=A.useState(!1),[u,h]=A.useState(null);async function _(p){if(p.preventDefault(),!(o||!i.trim())){c(!0),h(null);try{n(await e(i.trim())),a("")}catch(m){h(m instanceof Error?m.message:String(m))}finally{c(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:_,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Oe,{type:"submit",disabled:o||!i.trim(),children:o?va():ic()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??zKe()}),u&&f.jsx("div",{className:"error",children:u})]})}function hH({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}function CDn({settings:e}){const[n,t]=A.useState(!1);return f.jsxs("label",{className:"inline-flex max-w-full flex-wrap items-center gap-2 text-sm text-subtext",children:[Lln(),f.jsx("span",{className:"inline-block w-max max-w-full",children:f.jsx(ec,{variant:"field",dropDown:!0,value:e.defaultHost??"",disabled:n,choices:[{id:"",label:wL()},...e.defaultHost&&!e.hosts.some(r=>r.host===e.defaultHost)?[{id:e.defaultHost,label:e.defaultHost}]:[],...e.hosts.map(r=>({id:r.host,label:r.host}))],onSelect:r=>{t(!0),rxn(r||null).catch(s=>{bn(s instanceof Error?s.message:String(s),"error")}).finally(()=>t(!1))}})})]})}function EDn({host:e,connecting:n,reference:t,onChange:r}){const s=A.useId(),i=dn({mutationFn:nxn,scope:{id:`ssh-settings-${e.host}`}});function a(o){r(o),i.reset(),!(o!==null&&!o.trim())&&i.mutate({host:e.host,container:(o==null?void 0:o.trim())??null})}return f.jsxs("details",{className:"pb-3",children:[f.jsx("summary",{className:"w-fit cursor-pointer rounded-sm text-sm text-subtext focus-visible:outline-2 focus-visible:outline-text",children:YD()}),f.jsxs("div",{className:"mt-3 grid max-w-xl gap-3",children:[f.jsxs("label",{className:"text-sm text-subtext",children:[run(),f.jsx(ec,{variant:"field",dropDown:!0,value:t!==null?"container":"host",disabled:n,choices:[{id:"host",label:qln()},{id:"container",label:Xln()}],onSelect:o=>a(o==="container"?"":null)})]}),t!==null&&f.jsxs("label",{className:"text-sm text-subtext",htmlFor:`${s}-container`,children:[jln(),f.jsx(Ur,{id:`${s}-container`,value:t,disabled:n,required:!0,onChange:o=>a(o.target.value)})]}),i.error&&f.jsx("p",{className:"m-0 text-sm text-accent-red",role:"status",children:i.error.message})]})]})}const rc=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.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-base [&_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(" "),_f=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),NDn=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Ay="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ua=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),cC=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.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-start","[&_.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-control-subtle","[&_.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-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.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]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-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-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.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-start [&_.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-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.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-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.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","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),sl=["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","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),H5=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.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-base","[&_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-base [&_.kv_.v]:break-normal","[@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(" "),x0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),gd=["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(" "),zDn=new Set(["gh auth login","hf auth login","claude auth status"]);function pH(e){return zDn.has(e)?`/api/settings/commands/run?command=${encodeURIComponent(e)}`:void 0}function Ry(){const[e,n]=A.useState(null);return{run:e,start:(r,s,i)=>n(a=>({command:r,path:s,owner:i,attempt:((a==null?void 0:a.attempt)??0)+1})),clear:()=>n(null)}}function lC({note:e,className:n,disabled:t,resolve:r=pH,onRun:s}){return e?f.jsx("p",{className:n,children:vh(e,{canRun:i=>!t&&r(i)!==void 0,onRun:i=>{const a=r(i);a&&s(i,a)}})}):null}function My({run:e,onComplete:n,onClose:t}){return e?f.jsx(wkn,{path:e.path,label:e.command,onComplete:n,onError:r=>bn(r,"error"),onClose:t},`${e.command}-${e.attempt}`):null}function o4(e){return e.catalogPending?{cls:"warn",variant:"warning",label:nf()}:e.agentReady&&!e.authenticated&&e.authMethod!=="local"?{cls:"warn",variant:"warning",label:JD()}:e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?Jk():NXt()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:TFt()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:eL()}:e.needsConfigRepair||e.authState==="unknown"?{cls:"warn",variant:"warning",label:b3()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:FZt()}:{cls:"warn",variant:"warning",label:kL()}:{cls:"warn",variant:"warning",label:tVt()}}function jDn({h:e}){return e.id==="opencode"&&e.agentReady&&!e.authenticated&&!e.authMethod?f.jsx(f.Fragment,{children:_Tt()}):e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:zv()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?vDt():Zk()}):f.jsx(f.Fragment,{children:"—"})}function TDn(e,n,t){if(!n)return;const r=n.installUrl!==void 0&&t.includes(n.installUrl),s=t===n.login?"login":t===n.install?"install":t===n.update?"update":r?"install":null;if(s&&!(s!=="install"&&(!e.installed||e.installBroken)))return`/api/harnesses/setup?${new URLSearchParams({harness:e.id,action:s,shell:"true"})}`}function ADn({remote:e}){const n=Mu(),{data:t=null}=ut(n),[r,s]=A.useState(null),[i,a]=A.useState(!1),o=Ry(),[c,u]=A.useState(null),h=ut(aI()),_=(w,k=!1)=>{a(!0),af(w,k).catch(()=>{}).finally(()=>a(!1))},p=[...t??[]].sort((w,k)=>Number(k.agentReady)-Number(w.agentReady)),m=p.find(w=>w.id===r)??p[0];return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:v3()}),!e&&c&&h.data&&f.jsx(h$,{harness:c,commands:h.data[c.id],onClose:()=>u(null)}),f.jsx("div",{className:"mt-3 mb-3.5 w-fit max-w-full [&_.option-menu]:w-max",children:f.jsx(ec,{variant:"field",dropDown:!0,title:v3(),choices:p.map(w=>({id:w.id,label:w.name})),value:(m==null?void 0:m.id)??null,onSelect:w=>{const k=p.find(v=>v.id===w);k&&s(k.id)},renderIcon:w=>{const k=p.find(v=>v.id===w.id);return k&&f.jsx(bh,{harness:k.id})},renderLabel:w=>{const k=p.find(b=>b.id===w.id),v=k&&o4(k);return f.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[w.label,v&&f.jsxs(f.Fragment,{children:[f.jsx("span",{"aria-hidden":"true",className:`size-1.5 shrink-0 rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${v.cls}`}),f.jsx("span",{className:"sr-only",children:v.label})]})]})}})}),t?m?f.jsxs("div",{className:rc,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Wt,{variant:o4(m).variant,children:o4(m).label}),f.jsx("div",{className:"spacer flex-1"}),!e&&!m.catalogPending&&m.installed&&!m.installBroken&&!m.authenticated&&!m.needsConfigRepair&&m.authMethod!=="local"&&m.authMethod!=="apiKey"&&m.authState!=="unsupported"&&f.jsxs(Oe,{size:"small",onClick:()=>u(m),disabled:!h.data,"aria-haspopup":"dialog",children:[f.jsx(Cf,{size:14})," ",UD()]}),f.jsxs(Oe,{size:"small",onClick:()=>_(!0,!0),disabled:i,children:[f.jsx(Qa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Cm()]})]}),f.jsxs("div",{className:ys(_f,"[&_.v]:text-sm"),children:[f.jsx("span",{className:"k",children:YLt()}),f.jsx("span",{className:"v",children:m.binPath??GOt()}),f.jsx("span",{className:"k",children:jL()}),f.jsx("span",{className:"v",children:m.version??"—"}),f.jsx("span",{className:"k",children:vLt()}),f.jsx("span",{className:"v",children:f.jsx(jDn,{h:m})}),m.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:m.id==="opencode"?KJt():rS()}),f.jsx("span",{className:"v",children:m.account})]}),m.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:dKt()}),f.jsx("span",{className:"v",children:m.org})]}),m.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:hWt()}),f.jsx("span",{className:"v",children:m.plan})]}),f.jsx("span",{className:"k",children:iLt()}),f.jsx("span",{className:"v",children:m.catalogPending?nf():m.models.length>0?$Mt({count:tn(m.models.length),models:new Intl.ListFormat(N()).format(m.models.slice(0,4).map(w=>Ce(K1(w))))}):nS()})]}),f.jsx(lC,{note:m.agentNote,className:ys(Ua,"text-sm"),disabled:e,resolve:w=>{var k;return TDn(m,(k=h.data)==null?void 0:k[m.id],w)??pH(w)},onRun:(w,k)=>o.start(w,k,m.id)}),o.run&&f.jsx("div",{hidden:o.run.owner!==m.id,children:f.jsx(My,{run:o.run,onComplete:()=>_(!0,!0),onClose:o.clear})}),m.id==="opencode"&&f.jsx(b$,{installed:m.installed})]}):null:f.jsxs(Vr,{children:[f.jsx(jt,{})," ",GBt()]})]})}function RDn({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Wt,{variant:"success",children:k$t()}):f.jsx(Wt,{variant:"error",children:tGt()}):f.jsx(Wt,{variant:"error",children:r$t()}):f.jsx(Wt,{variant:"error",children:gHt()})}function MDn({onEditState:e}){var T;const n=dn({mutationFn:Kyn}),t=Vz(),r=ut(t),s=r.data??null,i=j=>{Yr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,c]=A.useState(""),[u,h]=A.useState(""),[_,p]=A.useState(!1),[m,w]=A.useState(!1),[k,v]=A.useState(null),b=j=>{i(j),c(j.context??""),h(j.namespace)},x=A.useRef(null);A.useEffect(()=>{const j=x.current;x.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(c(s.context??""),h(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;A.useEffect(()=>{e==null||e({dirty:C,saving:_})},[C,_,e]);async function z(){if(!(m||_||!y)){w(!0);try{await Je.fetchQuery({...Vz(),staleTime:0})}catch(j){bn(j instanceof Error?j.message:String(j),"error")}finally{w(!1)}}}async function E(j){if(j.preventDefault(),!(_||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:Lh()}),f.jsx("dd",{className:"m-0",children:m||_?f.jsx(Wt,{children:ha()}):C?f.jsx(Wt,{children:PD()}):f.jsx(RDn,{s})})]}),y&&!m&&!_&&s.preflight.error&&f.jsx("p",{className:`${Ay} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:E,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[T$t(),f.jsx(ec,{choices:[{id:"",label:s.currentContext?wRt({context:Ce(s.currentContext)}):pRt()},...o&&!s.contexts.includes(o)?[{id:o,label:ZOt({context:Ce(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:_||m,onSelect:c})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[aUt(),f.jsx(Ur,{type:"text",value:u,disabled:_||m,onChange:j=>h(j.target.value),placeholder:vBt(),autoComplete:"off",spellCheck:!1})]}),k&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:k}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",onClick:()=>void z(),disabled:_||m||!y,children:[f.jsx(Qa,{size:13})," ",m?ha():km()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:_||m||y,children:_?va():ic()})]})]})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",SIt()]})})}function ODn(){var y;const e=dn({mutationFn:C=>Qyn(...C)}),n=Kz(),t=ut(n),r=t.data??null,s=C=>{Yr(n.queryKey,z=>(typeof C=="function"?C(z??null):C)??void 0)},[i,a]=A.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[c,u]=A.useState(""),[h,_]=A.useState(""),[p,m]=A.useState(!1),w=t.isPending||p,[k,v]=A.useState(!1);async function b(){if(!(w||k)){m(!0),a(null);try{await Je.fetchQuery({...Kz(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function x(C){if(C.preventDefault(),!(!c.trim()||!h.trim()||w||k||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([c.trim(),h.trim()])),u(""),_("")}catch(z){a(z instanceof Error?z.message:String(z))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&w?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",AIt()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Lh()}),f.jsx("dd",{className:"m-0",children:f.jsx(Wt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?iS():Ab()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:XRt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:x,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?rMt():SMt(),f.jsx(Ur,{type:"password",value:c,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?uMt():AMt(),f.jsx(Ur,{type:"password",value:h,onChange:C=>_(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:gMt()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",disabled:w||k,onClick:()=>void b(),children:[f.jsx(Qa,{size:13})," ",Cm()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!c.trim()||!h.trim()||w||k||(r==null?void 0:r.processEnv),children:k?va():ic()})]})]})]})}const mH="rounded-sm border-border-strong bg-surface text-subtext",gH="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",DDn=5e3;function vH(e){const n=Va(),t=e.map(a=>Wz(a)),r=iK({queries:t.map(a=>({...a,refetchInterval:DDn}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Yr(Wz(a).queryKey,{running:!0})}]}function LDn({test:e,connecting:n,masterRunning:t,containerFailed:r=!1}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Wt,{className:gH,children:fL()})});if(e===void 0)return f.jsx(Wt,{className:mH,children:xL()});const s=e.missingTools??[],i=e.reachable&&e.toolsFound&&t===!1,a=!e.reachable||r?f.jsx(Wt,{className:"rounded-sm",variant:"error",children:sS()}):e.toolsFound?i?f.jsx(Wt,{className:"rounded-sm",variant:"warning",children:dL()}):f.jsx(Wt,{className:"rounded-sm",variant:"success",children:Sm()}):f.jsx(Wt,{className:"rounded-sm",variant:"error",children:s.length===1?GMt({tool:Ce(s[0])}):ZMt()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[a,!i&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:wo(e.testedAt)})]})}function IDn({remote:e=!1}){var I;const n=iI(),t=ut(n),r=((I=t.data)==null?void 0:I.hosts)??(t.isError?[]:null),[s,i]=A.useState(!1),[a,o]=A.useState({}),[c,u]=A.useState({}),h=A.useRef(0),[_,p]=A.useState(!1),[m,w]=A.useState({}),[k,v]=A.useState(null),[b,x]=A.useState(!1),[y,C]=A.useState(0),z=e?[]:(r==null?void 0:r.filter($=>{const q=a[$.host]??$.lastTest;return(q==null?void 0:q.reachable)&&q.toolsFound}).map($=>$.host))??[],[E,T]=vH(z);function j($){h.current+=1,p(!1),x(!1),C(q=>q+1),v($),w(q=>({...q,[$]:!0}))}function M(){h.current+=1,p(!1),x(!1),v(null)}function D($,q){w(H=>({...H,[$]:!q}))}return f.jsxs(f.Fragment,{children:[t.error&&f.jsx("p",{className:"text-sm text-accent-red",children:t.error.message}),f.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3",children:[!e&&t.data&&f.jsx(CDn,{settings:t.data}),f.jsxs(Oe,{variant:"ghost",className:"ms-auto",onClick:()=>i(!0),children:[f.jsx(xS,{size:14})," ",DL()]})]}),r===null?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",CL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:WUt()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map($=>{var ne,oe,ue;const q=c[$.host]===void 0?$.container??null:c[$.host],H=a[$.host],Q=q!==null&&((ne=H==null?void 0:H.container)==null?void 0:ne.reference)===q.trim()?H:void 0,V=q!==null?Q:H!=null&&H.container?$.lastTest:H??$.lastTest,Z=(oe=Q==null?void 0:Q.container)==null?void 0:oe.error,Y=((ue=Q==null?void 0:Q.container)==null?void 0:ue.ready)===!1,B=(V==null?void 0:V.error)||Z,L=k===$.host,F=m[$.host]??!1,U=!e&&(L||!!B),K=`${$.user?`${$.user}@`:""}${$.hostname??$.host}${$.port?`:${$.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3",children:[f.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:$.host,children:$.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:K,children:K})]})}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsxs("div",{className:"flex items-center gap-2 text-start",children:[f.jsx(LDn,{test:V,connecting:L&&!b,masterRunning:E[$.host],containerFailed:Y}),U&&f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":F,"aria-label":F?mX({name:Ce($.host)}):nY({name:Ce($.host)}),onClick:se=>{se.stopPropagation(),D($.host,F)},children:f.jsx(ac,{size:18,className:`text-muted transition-transform duration-120 ease-standard${F?" rotate-180":""}`})})]}),f.jsx(Oe,{size:"small",type:"button",className:"justify-self-end",onClick:se=>{se.stopPropagation(),L&&!b?M():j($.host)},disabled:!L&&(k!==null&&!b||q!==null&&!q.trim()),children:L?b?Ys():rf():(V==null?void 0:V.reachable)===!1||Y?Ys():V?TL():eS()})]})]}),!e&&f.jsx(EDn,{host:$,connecting:L&&!b,reference:q,onChange:se=>{L&&M(),u(G=>({...G,[$.host]:se})),o(G=>{const ae={...G};return delete ae[$.host],ae})}}),U&&(F||L)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3${F?"":" hidden"}`,children:[!L&&B&&f.jsx(kkn,{host:$.host,transcript:B}),L&&!_&&f.jsx(CS,{host:$.host,backend:"ssh",active:F,onComplete:se=>{if(se.backend!=="ssh")return;T($.host);const G=h.current;if(q===null){o(ae=>({...ae,[$.host]:{...se.result,container:null}})),x(!1),v(null);return}p(!0),sxn($.host,q.trim()).then(ae=>{h.current===G&&o(ce=>({...ce,[$.host]:{...ae,container:ae.container??{reference:q.trim(),ready:!1,error:ae.error??null}}}))}).catch(ae=>{h.current===G&&o(ce=>({...ce,[$.host]:{...se.result,container:{reference:q.trim(),ready:!1,error:ae instanceof Error?ae.message:String(ae)}}}))}).finally(()=>{h.current===G&&(p(!1),x(!1),v(null))})},onError:se=>{x(!0),o(G=>({...G,[$.host]:{container:q===null?null:{reference:q.trim(),ready:!1,error:se},reachable:!1,toolsFound:!1,missingTools:[],error:se,testedAt:Date.now()}}))}},y)]})]},$.host)})}),s&&f.jsx(U$,{onClose:()=>i(!1)})]})}function $Dn({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Wt,{className:gH,children:fL()}):e===null?f.jsx(Wt,{className:mH,children:xL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Wt,{className:"rounded-sm",variant:"warning",children:dL()}):f.jsx(Wt,{className:"rounded-sm",variant:"success",children:Sm()}):f.jsx(Wt,{className:"rounded-sm",variant:"error",children:Rqt()}):f.jsx(Wt,{className:"rounded-sm",variant:"error",children:jGt()}):f.jsx(Wt,{className:"rounded-sm",variant:"error",children:sS()})}function BDn({remote:e=!1}){var B;const n=dn({mutationFn:pxn}),t=k2n(),r=ut(t),s=r.data??null,i=L=>{Yr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((B=r.error)==null?void 0:B.message)??null,[o,c]=A.useState(""),[u,h]=A.useState(""),[_,p]=A.useState(""),[m,w]=A.useState(""),[k,v]=A.useState(!1),[b,x]=A.useState(null),[y,C]=A.useState(null),[z,E]=A.useState(!1),[T,j]=A.useState(!1),[M,D]=A.useState(0),I=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,q]=vH(I);function H(){j(!1),D(L=>L+1),E(!0)}const Q=L=>{i(L),c(L.host??""),h(L.partition??""),p(L.account??""),w(L.timeLimit??"")},V=A.useRef(null);A.useEffect(()=>{const L=V.current;V.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&_.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(c(s.host??""),h(s.partition??""),p(s.account??""),w(s.timeLimit??""))},[s,o,u,_,m]);const Z=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&_.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function Y(L){if(L.preventDefault(),!k){v(!0),x(null);try{Q(await n.mutateAsync({host:o,partition:u.trim(),account:_.trim(),timeLimit:m.trim()}))}catch(F){x(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!z&&(y==null?void 0:y.error)&&f.jsx("p",{className:Ay,children:y.error}),f.jsxs("form",{className:cC,onSubmit:Y,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vqt(),f.jsx(ec,{choices:[{id:"",label:wL()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:k||z,onSelect:L=>{c(L),C(null),E(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Oe,{type:"button",onClick:()=>{z&&!T?(j(!1),E(!1)):H()},disabled:!o,title:o?void 0:PJt(),children:z?T?Ys():rf():y?TL():eS()}),f.jsx("span",{role:"status",children:f.jsx($Dn,{test:y,connecting:z&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[eWt(),f.jsx(Ur,{type:"text",list:"slurm-partitions",value:u,onChange:L=>h(L.target.value),placeholder:Az(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[rS(),f.jsx(Ur,{type:"text",value:_,onChange:L=>p(L.target.value),placeholder:Az(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[wZt(),f.jsx(Ur,{type:"text",value:m,onChange:L=>w(L.target.value),placeholder:XIt(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Oe,{variant:"primary",type:"submit",disabled:k||Z||z,children:k?va():ic()})})]}),!e&&z&&f.jsx(CS,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),q(o),j(!1),E(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",UHt()]})})}function PDn(){var C;const e=dn({mutationFn:gxn}),n=S2n(),t=ut(n),r=t.data??null,s=z=>{Yr(n.queryKey,E=>(typeof z=="function"?z(E??null):z)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=A.useState(""),[c,u]=A.useState(!1),[h,_]=A.useState(null),[p,m]=A.useState(null),w=p!==null&&p!=="testing"?p:null,k=z=>{s(z),o(z.address??"")},v=A.useRef(null);A.useEffect(()=>{const z=v.current;v.current=r,r&&(!z||a===(z.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function x(z){if(z.preventDefault(),!c){u(!0),_(null);try{k(await e.mutateAsync({address:a}))}catch(E){_(E instanceof Error?E.message:String(E))}finally{u(!1)}}}async function y(){m("testing");try{m(await vxn(a.trim()||void 0))}catch(z){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:z instanceof Error?z.message:String(z)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(w==null?void 0:w.error)&&f.jsx("p",{className:Ay,children:w.error}),f.jsxs("form",{className:cC,onSubmit:x,children:[f.jsxs("label",{children:[uHt(),f.jsx(Ur,{type:"text",value:a,onChange:z=>{o(z.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[iPt(),": ",Ce(r.resolvedAddress)," · ",EL(),": ",r.source]}),h&&f.jsx("div",{className:"error",children:h}),f.jsxs("div",{className:"actions",children:[f.jsx(Oe,{variant:"primary",type:"submit",disabled:c||b,children:c?va():ic()}),f.jsx(Oe,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:OYt()}),f.jsx(FDn,{test:p})]}),(w==null?void 0:w.reachable)&&w.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zWt(),": ",w.rayVersion]})]})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",IHt()]})})}function FDn({test:e}){return e===null?null:e==="testing"?f.jsx(Wt,{children:FYt()}):e.reachable?f.jsx(Wt,{variant:"success",children:DWt()}):f.jsx(Wt,{variant:"error",children:sS()})}function HDn(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:nl(e.memBytes),r=e.gpus.length===0?null:VTt({count:e.gpus.length});return[n,e.cpuCount>0?vjt({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function qDn({remote:e}){var p;const n=ut(E2n()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=A.useState(0),[o,c]=A.useState(!0),[u,h]=A.useState(!1),_=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:NDn,children:[f.jsx("span",{className:"k",children:Lh()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Wt,{className:"gap-1.5",role:"status",children:[f.jsx(jt,{}),u?RDt():ha()]}):r?f.jsx(Wt,{variant:"warning",children:b3()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Wt,{variant:"success",children:Sm()}):t.sshKeyStatus==="unknown"?f.jsx(Wt,{variant:"warning",children:b3()}):f.jsx(Wt,{variant:"warning",children:Ab()}):f.jsx(Wt,{variant:"warning",children:kL()}):null}),f.jsx("span",{className:"k",children:yKt()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:PXt()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Wt,{variant:"success",children:OVt()}):t.sshKeyStatus==="no_local_match"?f.jsx(Wt,{variant:"warning",children:pVt()}):t.sshKeyStatus==="none_registered"?f.jsx(Wt,{variant:"error",children:LGt()}):f.jsx(Wt,{children:NL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:LRt({command:Ce("orx login")})}),!e&&i>0&&f.jsx(xkn,{login:o,onComplete:()=>{h(!1),a(0),_()},onError:m=>{h(!1),bn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ua,children:[GDt()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ua,children:[wGt()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),WYt()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ua,children:aen({register:Ce(`orx ssh-key add ${t.sshKeyPath}`),load:Ce("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ua,children:[pGt()," ",f.jsx("code",{children:"ssh-add"}),aKt()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Oe,{onClick:()=>void _(),disabled:s||u,children:[f.jsx(Qa,{size:13})," ",s?ha():km()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Oe,{variant:"primary",disabled:s||u,onClick:()=>{c(!t.loggedIn),h(!0),a(m=>m+1)},children:[u?f.jsx(jt,{}):f.jsx(Cf,{size:13})," ",t.loggedIn?Wtn():AL()]})]})]})}const UDn={local:TTe,ssh:_Ae,tinker:vAe,hf:mTe,modal:ITe,k8s:kTe,slurm:sAe,ray:YTe,openresearch:UTe},Oy={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},pR=["hf","modal","slurm","ray","openresearch"],c4=["hf","modal","openresearch"],bH={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"]},q5=["tinker","hf","modal","ray","k8s"],GDn={tinker:eMe,hf:MRe,modal:PRe,openresearch:KRe},mR="__custom__";function Xp(e,n){return!!(n&&!(bH[e]??[]).includes(n))}function VDn({settings:e,projectId:n,onSaved:t}){const r=dn({mutationFn:yxn}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=A.useState(s),[c,u]=A.useState(i),[h,_]=A.useState(Xp(s,i)),[p,m]=A.useState(!1),[w,k]=A.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),x=pR.includes(a),y=c4.includes(a),C=bH[a]??[],z=a===s&&(!x||c.trim()===i),E=lf[a](),T=GDn[a],j=p?tsn():y&&!c.trim()?VNt({destination:E}):a==="ssh"?fOt():iOt({destination:E});A.useEffect(()=>{o(s),u(i),_(Xp(s,i))},[s,i]);async function M($,q){const H=pR.includes($);if(!(p||c4.includes($)&&!q.trim())){m(!0),k(null);try{t(await r.mutateAsync({backend:$,flavor:H&&q.trim()||null,projectId:n}))}catch(Q){k(Q instanceof Error?Q.message:String(Q)),o(s),u(i),_(Xp(s,i))}finally{m(!1)}}}function D($){const q=e.targets.find(Q=>Q.id===$);if(!q)return;o(q.id);const H=q.id===s?i:"";u(H),_(Xp(q.id,H)),c4.includes(q.id)||M(q.id,H)}function I($){if($===mR){_(!0);return}_(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:ABt()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),z||M(a,c)},children:[f.jsx(ec,{choices:b.map($=>({id:$.id,label:lf[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const q=e.targets.find(H=>H.id===$.id);return q?f.jsx(Bh,{kind:Oy[q.id],size:16}):null},onSelect:D}),x&&f.jsx("div",{children:h?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:c,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!c.trim()){a===s&&(u(i),_(Xp(s,i)));return}z||M(a,c)},placeholder:Y$t(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":Tz(),title:Tz(),onMouseDown:$=>$.preventDefault(),onClick:()=>_(!1),children:f.jsx(ac,{size:12})})]}):f.jsx(ec,{choices:[{id:"",label:y?BNt():EOt()},...c&&!C.includes(c)?[{id:c,label:Bjt({value:Ce(c)})}]:[],...C.map($=>({id:$,label:$})),{id:mR,label:sBt()}],value:c,variant:"field",dropDown:!0,disabled:p,onSelect:I})})]}),w&&f.jsx("div",{className:"error mt-2.5",children:w}),v&&!v.configured&&f.jsx("p",{className:Ua,children:cZt()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function KDn({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?CNt():e.id==="openresearch"?AL():e.id==="ray"?eS():Ftn();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":lf[e.id](),"aria-describedby":i,"aria-haspopup":q5.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(Bh,{kind:Oy[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:lf[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:UDn[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?cRt():Nrn()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:sTt()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?vL():e.configured?!r||q5.includes(e.id)?iS():xsn():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(Q1,{size:16})})]})]})}function WDn({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(M0,{size:16})," ",mL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(Bh,{kind:Oy[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:lf[e.id]()})]}),n&&f.jsx(Wt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:vL()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(IDn,{remote:r}),e.id==="slurm"&&f.jsx(BDn,{remote:r}),e.id==="openresearch"&&f.jsx(qDn,{remote:r})]})]})}function QDn({target:e,remote:n,onClose:t}){const r=A.useRef(null),[s,i]=A.useState({dirty:!1,saving:!1});A.useEffect(()=>{const o=r.current;return o==null||o.showModal(),()=>o==null?void 0:o.close()},[]);const a=()=>{s.saving||s.dirty&&!window.confirm(tRt())||t()};return f.jsxs("dialog",{ref:r,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),a())},onCancel:o=>{o.preventDefault(),a()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(Bh,{kind:Oy[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:lf[e.id]()})]}),f.jsx(Ft,{title:A0(),"aria-label":A0(),onClick:a,disabled:s.saving,children:f.jsx(_r,{size:14})})]}),e.id==="tinker"&&f.jsx(YDn,{target:e}),e.id==="hf"&&f.jsx(JDn,{remote:n}),e.id==="modal"&&f.jsx(ODn,{}),e.id==="ray"&&f.jsx(PDn,{}),e.id==="k8s"&&f.jsx(MDn,{onEditState:i})]})}function XDn({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,D;const s=sI(e==null?void 0:e.id),i=ut(s),a=i.data??null,o=I=>{Yr(s.queryKey,$=>(typeof I=="function"?I($??null):I)??void 0)},c=a?null:((M=i.error)==null?void 0:M.message)??null,[u,h]=A.useState(null),[_,p]=A.useState(null),m=C2n(),w=ut(m),k=w.data??null,v=((D=w.error)==null?void 0:D.message)??null;A.useEffect(()=>{h(null),p(null)},[e==null?void 0:e.id]);const b=I=>{o(I),p(null)},x=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=x?[...x].sort((I,$)=>+($.id===y)-+(I.id===y)):null,z=(C==null?void 0:C.filter(I=>I.configured))??[],E=(C==null?void 0:C.filter(I=>!I.configured))??[],T=I=>f.jsx(KDn,{target:I,isDefault:y===I.id,summary:I.id==="local"?k?HDn(k):v??$Bt():void 0,onOpen:I.id==="local"?void 0:()=>h(I.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${I.id}`),j=u?a==null?void 0:a.targets.find(I=>I.id===u):null;return j&&!q5.includes(j.id)?f.jsx(WDn,{target:j,isDefault:y===j.id,onBack:()=>h(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:gL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:m$t()}),f.jsx(mLn,{projectId:e==null?void 0:e.id,onViewHistory:n}),c?f.jsx("div",{className:"error",children:c}):a?f.jsxs(f.Fragment,{children:[_&&f.jsx("div",{className:"error",children:_}),f.jsx(VDn,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:iS()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:z.map(T)})]}),E.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:Bqt()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),j&&f.jsx(QDn,{target:j,remote:r,onClose:()=>h(null)})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",gIt()]})]})}function YDn({target:e}){var x;const n=dn({mutationFn:Pyn}),[t,r]=A.useState(""),[s,i]=A.useState(!1),[a,o]=A.useState(null),c=Gz(),u=ut(c),h=u.data??null,_=a??((x=u.error)==null?void 0:x.message)??null,p=y=>{Yr(c.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,w]=A.useState(!1),k=u.isPending||m;async function v(){if(!(k||s)){w(!0),o(null);try{await Je.fetchQuery({...Gz(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{w(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||k)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!h&&k?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",ha()]}):h&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Lh()}),f.jsx("dd",{className:"m-0",children:f.jsx(Wt,{variant:h.validationStatus==="valid"?"success":h.validationStatus==="invalid"?"error":"warning",children:h.validationStatus==="valid"?Sm():h.validationStatus==="invalid"?yrn():h.validationStatus==="billingRequired"?arn():Ab()})})]}),(h==null?void 0:h.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:Jnn()})}),(h==null?void 0:h.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:drn()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||h!==null&&h.validationStatus!=="missing"?etn():Zk(),f.jsx(Ur,{type:"password",value:t,placeholder:(h==null?void 0:h.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),_&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:_}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",disabled:s||k,onClick:()=>void v(),children:[f.jsx(Qa,{size:13})," ",k?ha():km()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!t.trim()||s||k,children:s?ML():ic()})]})]})]})}function ZDn({settings:e}){return e.validationStatus==="missing"?f.jsx(Wt,{variant:"warning",children:Ab()}):e.validationStatus==="invalid"?f.jsx(Wt,{variant:"error",children:rHt()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Wt,{variant:"success",children:Sm()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Wt,{variant:"warning",children:cGt()}),f.jsx(hS,{content:dAt(),className:"text-subtext",children:f.jsx(gS,{size:15})})]}):null}function JDn({remote:e}){var x;const n=dn({mutationFn:$yn}),t=Uz(),r=ut(t),s=r.data??null,i=y=>{Yr(t.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},a=s?null:((x=r.error)==null?void 0:x.message)??null,[o,c]=A.useState(""),[u,h]=A.useState(!1),[_,p]=A.useState(!1),[m,w]=A.useState(null),k=Ry();async function v(){if(!(u||_||!s&&!a)){p(!0),w(null);try{await Je.fetchQuery({...Uz(),staleTime:0})}catch(y){w(y instanceof Error?y.message:String(y))}finally{p(!1)}}}async function b(y){if(y.preventDefault(),!(!o.trim()||u||_||!s&&!a)){h(!0),w(null);try{const C=await n.mutateAsync(o.trim());i(C),w(null),c("")}catch(C){w(C instanceof Error?C.message:String(C))}finally{h(!1)}}}return f.jsxs(f.Fragment,{children:[a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[s.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:rS()}),f.jsx("dd",{className:"m-0 text-text",children:s.username})]}),(s.validationStatus==="missing"||s.validationStatus==="invalid"||s.validationStatus==="valid"&&s.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Lh()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(ZDn,{settings:s})})]})]}),s.validationStatus==="unreachable"&&s.validationError&&f.jsx("p",{className:Ay,children:s.validationError}),s.source==="env"&&f.jsx("p",{className:Ua,children:uFt()}),s.validationStatus==="valid"&&s.jobsWrite===null&&f.jsx(lC,{note:aAt({login:"`hf auth login`",url:Ce("huggingface.co/settings/tokens")}),className:Ua,disabled:e,onRun:k.start}),f.jsx(My,{run:k.run,onComplete:()=>void r.refetch(),onClose:k.clear})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",YHt()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[s!=null&&s.configured?otn():bOt(),f.jsx(Ur,{type:"password",value:o,onChange:y=>c(y.target.value),placeholder:(s==null?void 0:s.maskedToken)??rFt(),autoComplete:"off"})]}),m&&f.jsx("div",{className:"error",children:m}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",disabled:u||_||!s&&!a,onClick:()=>void v(),children:[f.jsx(Qa,{size:13})," ",_?ha():km()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!o.trim()||u||_||!s&&!a,children:u?ML():ic()})]})]})]})}const yH=/^hf_[A-Za-z0-9]{10,}$/;function xH(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ua,children:[pZt()," ",f.jsx("code",{children:"HF_TOKEN"}),eXt()]})})})}const gR=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function U5(e,n){const t=n instanceof Error?n.message:String(n);bn(t.includes(e)?t:`${e}: ${t}`,"error")}function eLn({name:e,entry:n,onVars:t}){const r=dn({mutationFn:_=>WL(..._)}),s=dn({mutationFn:Yyn}),[i,a]=A.useState(""),[o,c]=A.useState(!1);async function u(){if(!(!i.trim()||o)){c(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(_){U5(e,_)}finally{c(!1)}}}async function h(){if(!o){c(!0);try{t(await s.mutateAsync(e))}catch(_){U5(e,_)}finally{c(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Wt,{children:KKt()})]}):f.jsx(Ur,{variant:"inline",className:"text-base",type:"password",value:i,onChange:_=>a(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),u()),_.key==="Escape"&&!o&&a("")},placeholder:zL(),"aria-label":ZJ({name:Ce(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Ft,{className:"[&:hover:not(:disabled)]:text-accent-red",title:o3({name:Ce(e)}),"aria-label":o3({name:Ce(e)}),onClick:()=>void h(),disabled:o,children:f.jsx(Ef,{size:13})}):i.trim()&&f.jsx(Oe,{size:"small",onClick:()=>void u(),disabled:o,children:o?va():ic()})})]}),!n&&e!=="HF_TOKEN"&&yH.test(i.trim())&&f.jsx(xH,{})]})}function tLn({onVars:e,onDone:n}){const t=dn({mutationFn:_=>WL(..._)}),[r,s]=A.useState(""),[i,a]=A.useState(""),[o,c]=A.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){c(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(_){U5(r.trim(),_)}finally{c(!1)}}}const h=_=>{_.key==="Enter"&&(_.preventDefault(),u()),_.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Ur,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:_=>s(_.target.value),onKeyDown:h,placeholder:"MY_API_KEY","aria-label":NUt(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Ur,{variant:"inline",className:"text-base",type:"password",value:i,onChange:_=>a(_.target.value),onKeyDown:h,placeholder:zL(),"aria-label":OUt(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Oe,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?va():ic()}),f.jsx(Ft,{title:rf(),"aria-label":uIt(),onClick:n,disabled:o,children:f.jsx(_r,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&yH.test(i.trim())&&f.jsx(xH,{})]})}function nLn(){var u;const e=N2n(),n=ut(e),t=n.data??null,r=h=>{Yr(e.queryKey,_=>(typeof h=="function"?h(_??null):h)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=A.useState(!1),o=t===null?[]:t.map(h=>h.key).filter(h=>!gR.includes(h)),c=[...gR,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:dJt()}),f.jsxs(Oe,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx($h,{size:12})," ",ZDt()]})]}),f.jsx("div",{className:rc,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-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-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[c.map(h=>f.jsx(eLn,{name:h,entry:t.find(_=>_.key===h),onVars:r},h)),i&&f.jsx(tLn,{onVars:r,onDone:()=>a(!1)})]})})})]})}const Yp=[{value:"system",label:Vnn,icon:k5n},{value:"light",label:Bnn,icon:Q5n},{value:"dark",label:Enn,icon:C5n}],rLn=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"},{id:"ar",label:"العربية"},{id:"es",label:"Español"},{id:"hi",label:"हिन्दी"}];function sLn(){const e=wf(),[n,t]=gI(),r=s=>{var h;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(_=>_===document.activeElement),u=((o===-1?Yp.findIndex(_=>_.value===n):o)+i+Yp.length)%Yp.length;t(Yp[u].value),(h=a[u])==null||h.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:GEt()}),f.jsxs("div",{className:`${rc} mt-3`,children:[f.jsxs("div",{className:`${sl} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Bz()}),f.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":Bz(),onKeyDown:r,children:Yp.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?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 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:sl,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jRt()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(ec,{choices:rLn,value:e,variant:"field",dropDown:!0,onSelect:s=>{mD(s)&&hI(s)}})})]})]})]})}const iLn={installer:Ygn,"app-bundle":Tgn,portable:_1n,cargo:Ign,homebrew:Ugn,nix:s1n,unknown:v1n},l4={cargo:C1n,homebrew:R1n,nix:B1n};function aLn(){var _;const e=dn({mutationFn:p=>Uyn(...p)}),{status:n,error:t,apply:r}=u6(),[s,i]=A.useState(null),[a,o]=A.useState(null),c=V$(n),u=s!==null||c.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:Lz()}),t?f.jsx("div",{className:rc,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]});const h=async(p,m)=>{i(p),o(null);try{await m()}catch(w){o(w instanceof Error?w.message:String(w))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:Lz()}),f.jsxs("div",{className:`${rc} mt-3`,children:[f.jsxs("div",{className:`${_f} pb-3.5`,children:[f.jsx("div",{className:"k",children:jL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:SHt()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:yL()}),f.jsx("div",{className:"v",children:iLn[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:MQt()}),f.jsx("p",{children:c.error?PL({error:c.error}):xtn({installed:Ce(n.installedVersion??"—"),current:Ce(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Oe,{size:"small",type:"button",disabled:u,onClick:c.restart,children:c.restarting?FL():BL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Mz()}),f.jsxs("p",{children:[yUt(),n.envDisabled&&Wrn()]})]}),f.jsx(dS,{type:"button",checked:n.autoUpdate,"aria-label":Mz(),disabled:u,onClick:()=>void h("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Frn({version:Ce(n.latest??"—")}):_Nt()}),f.jsx("p",{children:n.updateAvailable?WAt():RNt()})]}),f.jsx(Oe,{size:"small",type:"button",disabled:u,onClick:()=>void h("apply",()=>Hyn().then(r)),children:s==="apply"?Kk():n.updateAvailable?Orn():vNt()})]})]}):f.jsx("div",{className:sl,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:NKt()}),f.jsx("p",{children:((_=l4[n.channel])==null?void 0:_.call(l4))??den()})]})}),n.channel==="app-bundle"&&f.jsx(cLn,{busy:s,disabled:u,run:h}),a&&f.jsx("div",{className:"error",children:a})]})]})}function oLn(){var _;const e=dn({mutationFn:Bxn}),n=D2n(),t=ut(n),r=t.data??null,s=p=>{Yr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=A.useState(!1),[o,c]=A.useState(null),u=o??((_=t.error)==null?void 0:_.message)??null,h=()=>{!r||i||(a(!0),c(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>c(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:eJt()}),r?f.jsxs("div",{className:`${rc} mt-3`,children:[f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[jz(),r.locked&&r.reason&&f.jsx(hS,{content:`${U$t()} ${r.reason}.`,className:"text-subtext",children:f.jsx(gS,{size:15})})]}),f.jsx("p",{children:FUt()})]}),f.jsx(dS,{type:"button",checked:r.enabled,"aria-label":jz(),disabled:i||r.locked,onClick:h})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]})}function cLn({busy:e,disabled:n,run:t}){const r=dn({mutationFn:Gyn}),[s,i]=A.useState(null),[a,o]=A.useState(!1),c=u=>void t("cli",()=>r.mutateAsync(u).then(h=>{i(h),o(!1)}).catch(h=>{throw o(!u&&String((h==null?void 0:h.message)??h).includes("--force")),h}));return f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:OAt({command:Ce("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?azt({link:Ce(s.link)}):dzt({link:Ce(s.link)}),!s.onPath&&$Et({directory:Ce(s.dir)})]}):f.jsx("p",{children:NAt({command:Ce("orx")})})]}),f.jsx(Oe,{size:"small",type:"button",disabled:n,onClick:()=>c(a),children:e==="cli"?Kk():a?Ken():s?yen():yAt()})]})}function lLn({remote:e}){var w;const n=dn({mutationFn:k=>JL(...k)}),t=cS(),r=ut(t),s=r.data??null,i=k=>{Yr(t.queryKey,v=>(typeof k=="function"?k(v??null):k)??void 0)},[a,o]=A.useState(!1),[c,u]=A.useState(null),h=c??((w=r.error)==null?void 0:w.message)??null,_=async()=>{await r.refetch({cancelRefetch:!1})},p=Ry(),m=()=>{if(!s||a)return;const k=!s.githubForNewProjects;o(!0),u(null),n.mutateAsync([k,!0]).then(i).catch(v=>u(v instanceof Error?v.message:String(v))).finally(()=>o(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:TPt()}),s?f.jsxs("div",{className:`${rc} mt-3 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:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:IPt()}),f.jsx(Wt,{variant:s.githubAuthenticated?"success":s.ghInstalled?"warning":"error",children:s.githubAuthenticated?_L():hL()})]}),f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Rz()}),f.jsx("p",{children:EJt()})]}),f.jsx(dS,{type:"button",checked:s.githubForNewProjects,"aria-label":Rz(),disabled:a||!s.githubAuthenticated&&!s.githubForNewProjects,onClick:m})]}),!s.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(wH,{ghInstalled:s.ghInstalled,remote:e,onCheck:_,onRun:p.start})}),f.jsx(My,{run:p.run,onComplete:()=>void _(),onClose:p.clear}),h&&f.jsx("div",{className:"error",children:h})]}):h?f.jsx("div",{className:"error",children:h}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]})}function wH({ghInstalled:e,remote:n,onCheck:t,onRun:r}){const[s,i]=A.useState(!1),a=()=>{i(!0),t().finally(()=>i(!1))};return f.jsxs(f.Fragment,{children:[f.jsx(lC,{note:e?ztn():FAt(),className:"git-card-helper m-0 text-sm leading-relaxed text-text",disabled:n||!e,onRun:r}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(mh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[IFt()," ",f.jsx(of,{size:12})]}),f.jsx(Oe,{type:"button",variant:e?"warning":"default",disabled:s,onClick:a,children:s?ha():km()})]})]})}function uLn(){var m,w,k;const e=dn({mutationFn:Syn}),n=dn({mutationFn:Cyn}),t=E6n(),r=ut(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((w=r.data)==null?void 0:w.hasSession)??null,a=v=>Yr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[c,u]=A.useState(!1),[h,_]=A.useState(null),p=h??((k=r.error)==null?void 0:k.message);return f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:SL()}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:UPt()}),f.jsx("span",{className:"v",children:f.jsx(Wt,{variant:s?"success":"default",children:s===null?p?go():ha():s?$z():g3()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:MJt()}),s?f.jsx("div",{className:x0,children:f.jsx(Oe,{disabled:c,onClick:()=>{u(!0),_(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>_(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:c?Iz():Oen()})}):f.jsx(hR,{save:VL,onSaved:v=>o(v.hasToken),placeholder:PKt(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:oXt()}),f.jsx("span",{className:"v",children:f.jsx(Wt,{variant:i?"success":"default",children:i===null?p?go():ha():i?$z():g3()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:hXt()}),i?f.jsx("div",{className:x0,children:f.jsx(Oe,{disabled:c,onClick:()=>{u(!0),_(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>_(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:c?Iz():Nen()})}):f.jsx(hR,{save:v=>KL(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:d3(),createHref:"https://www.overleaf.com/project",createLabel:A1t()}),p&&f.jsx("div",{className:"error",children:p})]})}function _Ln({project:e,onProjectUpdate:n,remote:t}){var M;const r=dn({mutationFn:D=>JL(...D)}),s={...O2n((e==null?void 0:e.id)??""),enabled:!!e},i=ut(s),a=Ry(),o=i.data??null,c=D=>{Yr(s.queryKey,I=>(typeof D=="function"?D(I??null):D)??void 0)},[u,h]=A.useState(!1),[_,p]=A.useState(null),m=_??((M=i.error)==null?void 0:M.message)??null,[w,k]=A.useState(!1),[v,b]=A.useState(!1),[x,y]=A.useState(null),C=!!(o!=null&&o.github.owner&&o.github.repo),z=async()=>{await i.refetch({cancelRefetch:!1})},E=D=>{const I=D instanceof Error?D.message:String(D);return I.toLowerCase().includes("archived")?CTt():I.includes("(fetch first)")||I.includes("non-fast-forward")?RTt():I.includes("403")||I.toLowerCase().includes("permission denied")?BTt():I},T=()=>{e&&(h(!0),p(null),Lxn(e.id).then(D=>{c(D.git),n(D.project),Je.fetchQuery(cS()).then(I=>{!I.githubForNewProjects&&!I.githubDefaultPromptSeen&&k(!0)}).catch(()=>{})}).catch(D=>p(E(D))).finally(()=>h(!1)))},j=D=>{b(!0),y(null),r.mutateAsync([D,!0]).then(()=>k(!1)).catch(I=>y(I instanceof Error?I.message:String(I))).finally(()=>b(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:EQt()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:htn({project:(e==null?void 0:e.name)??Rjt()})}),e?m&&!o?f.jsx("div",{className:"error",children:m}):o?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:_qt()}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:oWt()}),f.jsx("span",{className:"v",children:o.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:o.gitVersion??ZD()}),f.jsx("span",{className:"k",children:eYt()}),f.jsx("span",{className:"v",children:o.initialized?vTt({branch:Ce(o.currentBranch??tS()),state:o.clean?JNt():JTt()}):iDt()}),f.jsx("span",{className:"k",children:ULt()}),f.jsx("span",{className:"v",children:o.baselineBranch}),f.jsx("span",{className:"k",children:bQt()}),f.jsx("span",{className:"v",children:o.remotes.length?o.remotes.map(D=>`${D.name}: ${D.url}`).join(" · "):nS()})]}),!o.initialized&&f.jsx("div",{className:x0,children:f.jsx(Oe,{variant:"primary",onClick:()=>void Dxn(e.id).then(c).catch(D=>p(String(D))),children:gFt()})})]}),f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:pL()}),f.jsx("span",{className:"v",children:f.jsx(Wt,{variant:o.github.authenticated?"success":o.github.ghInstalled?"warning":"error",children:o.github.authenticated?_L():hL()})}),f.jsx("span",{className:"k",children:xWt()}),f.jsx("span",{className:"v",children:C?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[o.github.owner,"/",o.github.repo]}),!o.github.enabled&&f.jsx(Wt,{children:NYt()})]}):f.jsx(Wt,{children:sqt()})}),o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:yYt()}),f.jsx("span",{className:"v",children:o.github.syncStatus})]})]}),!o.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(wH,{ghInstalled:o.github.ghInstalled,remote:t,onCheck:()=>z(),onRun:a.start})}),f.jsx(My,{run:a.run,onComplete:()=>void z(),onClose:a.clear}),o.github.authenticated&&!o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:C?csn():Cjt()}),f.jsxs("div",{className:x0,children:[C&&o.github.url&&f.jsxs(mh,{href:o.github.url,target:"_blank",rel:"noreferrer",children:[Dz()," ",f.jsx(of,{size:12})]}),f.jsx(Oe,{variant:"primary",disabled:u,onClick:T,children:u?S8t():g8t()})]})]}),o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:ZBt()}),f.jsxs("div",{className:x0,children:[o.github.url&&f.jsxs(mh,{href:o.github.url,target:"_blank",rel:"noreferrer",children:[Dz()," ",f.jsx(of,{size:12})]}),f.jsx(Oe,{disabled:u,onClick:()=>{h(!0),Ixn(e.id).then(D=>{c(D.git),n(D.project)}).catch(D=>p(D instanceof Error?D.message:String(D))).finally(()=>h(!1))},children:u?A8t():u8t()})]})]})]}),f.jsx(uLn,{}),m&&f.jsx("div",{className:"error",children:E(m)})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]}):f.jsx("div",{className:rc,children:f.jsx("p",{className:Ua,children:FVt()})}),w&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>j(!1),children:f.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-modal 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-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:D=>D.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:Cqt()}),f.jsx("p",{children:tZt()}),x&&f.jsx("div",{className:"error",children:x}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Oe,{disabled:v,onClick:()=>j(!1),children:cVt()}),f.jsx(Oe,{variant:"primary",disabled:v,onClick:()=>j(!0),children:v?va():qRt()})]})]})})]})}const fLn={env:yfn,config:Nfn,xdg:Ofn,default:dfn},u4={preparing:J_n,copying:__n,verifying:Ffn,finalizing:v_n},dLn=e=>{var n;return((n=u4[e])==null?void 0:n.call(u4))??e};function hLn(){var y;const e=z2n(),n=ut(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=A.useState(""),[a,o]=A.useState(!1),[c,u]=A.useState(null),[h,_]=A.useState({kind:"idle"}),[p,m]=A.useState(null);A.useEffect(()=>{t&&i(C=>C||t.current)},[t]),A.useEffect(()=>fI(C=>{C.type==="progress"?_(z=>{const E=z.kind==="moving"?z.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||E}}):C.type==="done"?(_({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&_({kind:"error",message:C.error})}),[]);const w=(t==null?void 0:t.source)==="env",k=s.trim(),v=t!==null&&k===t.current;async function b(){if(!(a||!k)){o(!0),m(null),u(null);try{u(await Jyn(k))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function x(C){if(C.preventDefault(),!(h.kind==="moving"||!k||v)&&(m(null),!!window.confirm(R_n({path:Ce(k)})))){_({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await exn(k)}catch(z){_({kind:"idle"}),m(z instanceof Error?z.message:String(z))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:dYt()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:dnn()}),r?f.jsx("div",{className:rc,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:rc,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:_Bt()})}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:I$t()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:EL()}),f.jsx("span",{className:"v",children:fLn[t.source]()})]}),!w&&f.jsxs("form",{className:cC,onSubmit:x,children:[f.jsxs("label",{children:[dUt(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:h.kind==="moving"})]}),c&&!c.error&&c.ok&&f.jsxs("p",{className:Ua,children:[eQt()," ",nl(c.treeBytes??0),c.freeBytes!=null&&` — ${C_n({size:Ce(nl(c.freeBytes))})}`,c.sameFilesystem?afn():"","."]}),c&&c.ok===!1&&c.error&&f.jsx("div",{className:"error",children:c.error}),p&&f.jsx("div",{className:"error",children:p}),h.kind==="moving"&&f.jsx(hH,{value:h.copied,max:h.total,label:dLn(h.phase),caption:h.total>0?f.jsxs("span",{className:"text-sm",children:[nl(h.copied)," / ",nl(h.total)]}):void 0}),h.kind==="done"&&f.jsxs("p",{className:Ua,children:[Jqt(),h.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",CDt({path:Ce(h.oldPathLeft)})]})]}),h.kind==="error"&&f.jsxs("div",{className:"error",children:[Vqt()," ",h.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Oe,{type:"button",onClick:b,disabled:a||!k||v||h.kind==="moving",children:a?ha():ZEt()}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!k||v||h.kind==="moving",children:h.kind==="moving"?V_n():B_n()})]})]})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]})}const G5=e=>e==="running"||e==="starting";function pLn(e){return G5(e.status)?R0(Date.now()-e.createdAt):e.endedAt?R0(e.endedAt-e.createdAt):"—"}function kH({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_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-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:ILt()}),f.jsx("th",{children:Lh()}),f.jsx("th",{children:KXt()}),f.jsx("th",{children:KQt()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(RS,{backend:t.backend}),r&&f.jsx(Ih,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:Oz(),"aria-label":Oz(),onClick:i=>i.stopPropagation(),children:f.jsx(of,{size:12})})]})}),f.jsx("td",{children:f.jsx(cl,{status:la(t)})}),f.jsx("td",{children:wo(t.createdAt)}),f.jsx("td",{children:pLn(t)})]},t.id)})})]})})}function mLn({projectId:e,onViewHistory:n}){var _;const t=ut({...Eu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(_=t.error)==null?void 0:_.message,i=t.isFetching,[,a]=A.useState(0);A.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},c=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>G5(p.status)).sort(c),h=r==null?void 0:r.filter(p=>!G5(p.status)).sort(c);return f.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-8",children:[f.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 [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[PQt(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Oe,{size:"small",onClick:o,disabled:i,children:[f.jsx(Qa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Cm()]}),f.jsx(Oe,{size:"small",onClick:n,children:h!=null&&h.length?jZe({count:tn(h.length)}):wZe()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!h?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]}):f.jsx(kH,{instances:u,emptyLabel:e?tZe():pZe()})]})}function gLn({projectId:e,onBack:n}){var c;const t=ut({...Eu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(c=t.error)==null?void 0:c.message,i=t.isFetching,[,a]=A.useState(0);A.useEffect(()=>{const u=setInterval(()=>a(h=>h+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.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:n,children:[f.jsx(M0,{size:14})," ",mL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:XFt()}),f.jsxs(Oe,{size:"small",onClick:o,disabled:i,children:[f.jsx(Qa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Cm()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(kH,{instances:[...r].sort((u,h)=>h.createdAt-u.createdAt),emptyLabel:e?WYe():cZe()}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]})}const SH=["projects","harnesses","storage"],vLn=[{id:"compute",label:gL,icon:f.jsx(mS,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:bL,icon:f.jsx(Cf,{size:15}),activeTabs:["environment"]},{id:"settings",label:aS,icon:f.jsx(xS,{size:15}),activeTabs:["settings",...SH]}];function bLn(e){return SH.includes(e)}function yLn({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||bLn(e),a=A.useRef(null);return A.useLayoutEffect(()=>{const o=a.current,c=o==null?void 0:o.parentElement;if(!o||!c)return;const u=()=>o.scrollIntoView({block:"start"}),h=new ResizeObserver(u);h.observe(c),u();const _=()=>h.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,_,{passive:!0});return()=>{_();for(const m of p)window.removeEventListener(m,_)}},[e,n==null?void 0:n.id]),f.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-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:aS()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:gd,children:f.jsx(sLn,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:gd,children:f.jsx(lLn,{remote:s})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:gd,children:f.jsx(ADn,{remote:s})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:gd,children:f.jsx(hLn,{})}),f.jsx("section",{className:gd,children:f.jsx(oLn,{})}),!s&&f.jsx("section",{className:gd,children:f.jsx(aLn,{})})]})]}),e==="compute"&&f.jsx(XDn,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(gLn,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:bL()}),f.jsx(nLn,{})]}),e==="git"&&f.jsx(_Ln,{project:n,onProjectUpdate:t,remote:s})]})}function ib(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function V5(e){return`${e.plugin?`${ib(e.plugin)}: `:""}${ib(e.name)}`}const CH=["plan","goal","new","resume","model","compact","copy","export"],xLn={plan:()=>Yyt(),goal:()=>DKe(),new:()=>Prt(),resume:()=>$8t(),model:()=>Ttt(),compact:()=>lTe(),copy:()=>DMe(),export:()=>j$e()};function wLn(e){return{name:e,get description(){return xLn[e]()},source:"command"}}function Dy(e){return CH.some(n=>n===e)}const ab={clear:"new",summarize:"compact"};function K5(e){const n=e.toLowerCase();return Dy(n)?n:Object.hasOwn(ab,n)?ab[n]:null}function EH(e){return Object.keys(ab).filter(n=>ab[n]===e)}function kLn(e,n){return e.name.toLowerCase().startsWith(n)||e.plugin&&`${e.plugin}:${e.name}`.toLowerCase().startsWith(n)?!0:e.source==="command"&&Dy(e.name)&&EH(e.name).some(t=>t.startsWith(n))}function _4(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?h:s}${a.slice(h.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function vR(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function NH(e){return CH.filter(n=>n!=="plan"||e)}function ELn(e,n){const t=e.filter(r=>!K5(r.name));for(const r of NH(n))t.push(wLn(r));return t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||V5(r).localeCompare(V5(s),void 0,{sensitivity:"base"}))}function f4(e){return e==="plan"||e==="goal"}function NLn(e,n){for(const t of NH(n).sort((r,s)=>+(r==="plan")-+(s==="plan"))){const r=[t,...EH(t)].join("|");if(t==="plan"){const s=new RegExp(`(^|\\s)\\/(?:${r})(?=\\s|$)`,"gi");if(s.test(e))return{name:t,prompt:e.replace(s,"").trim()}}else if(t==="goal"){const s=new RegExp(`^\\/(?:${r})(?=\\s|$)`,"i");if(s.test(e.trim()))return{name:t,prompt:e.trim().replace(s,"").trim()}}else if(new RegExp(`^\\/(?:${r})$`,"i").test(e.trim()))return{name:t,prompt:""}}return null}function d4(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}const zLn=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let jLn=null;function W5(e,n){const t=jLn??(jLn=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(ib(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}const TLn={plan:d5n,goal:GI,new:V5n,resume:VI,model:mS,compact:q3n,copy:Sf,export:Lb};function zH({name:e,className:n}){const t=Dy(e)?TLn[e]:ikn;return f.jsx(t,{size:16,strokeWidth:1.5,className:n,"aria-hidden":"true"})}function jH({name:e}){return f.jsxs(f.Fragment,{children:[f.jsx(zH,{name:e,className:"me-1 inline-block align-middle"}),ib(e)]})}function TH(e,n,t,r,s,i=!1){let a=0;return SLn(e,n).map((o,c,u)=>{var m,w;const h=a+o.text.length;a=h;const _=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,_,h,c);let p=o.text;return i||((m=u[c-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(w=u[c+1])!=null&&w.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(jH,{name:_})},c):i?f.jsx("span",{"aria-hidden":"true",children:o.text},c):f.jsx(A.Fragment,{children:p},c)})}function ALn({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=A.useRef(null),o=A.useRef(null),c=A.useRef(null),u=A.useId(),[h,_]=A.useState(!1),p=ut({...I2n(n,s,r.harness),enabled:h,subscribed:h}),m=p.data??null,w=p.isFetching,[k,v]=A.useState({}),b=()=>{c.current!==null&&window.clearTimeout(c.current),c.current=null},x=()=>{const z=a.current;if(!z)return;const E=z.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(E.left-4,window.innerWidth-T-16));v(E.top>300?{bottom:window.innerHeight-E.top+12,left:j,width:T}:{left:j,top:E.bottom+12,width:T})},y=()=>{b(),x(),_(!0)},C=()=>{b(),c.current=window.setTimeout(()=>_(!1),120)};return A.useEffect(()=>()=>b(),[]),A.useEffect(()=>{if(!h)return;const z=()=>x();return window.addEventListener("resize",z),window.addEventListener("scroll",z,!0),()=>{window.removeEventListener("resize",z),window.removeEventListener("scroll",z,!0)}},[h]),f.jsxs(A.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":h,"aria-label":IZ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:z=>{var E,T;if(z.key==="Escape"){_(!1);return}if(z.key==="Enter"||z.key===" "){z.preventDefault(),y();return}h&&(z.key==="ArrowDown"||z.key==="PageDown")&&(z.preventDefault(),(E=o.current)==null||E.scrollBy({top:z.key==="PageDown"?240:48,behavior:"smooth"})),h&&(z.key==="ArrowUp"||z.key==="PageUp")&&(z.preventDefault(),(T=o.current)==null||T.scrollBy({top:z.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:z=>{var E,T;z.preventDefault(),(E=i.current)==null||E.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(jH,{name:n})})})]}),h&&Fi.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":GJ({name:n}),style:{...k,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:z=>z.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Wt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:zsn()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:w&&m===null?f.jsx("span",{className:"text-muted",children:Dsn()}):f.jsx(nc,{text:m??r.description})})]}),document.body)]})}function RLn({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:TH(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function MLn({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=A.useRef(null);return A.useLayoutEffect(()=>{const o=i.current,c=a.current;if(!o||!c)return;const u=()=>{const _=getComputedStyle(o);for(const p of zLn)c.style.setProperty(p,_.getPropertyValue(p));c.style.width=`${o.clientWidth+parseFloat(_.borderLeftWidth)+parseFloat(_.borderRightWidth)}px`};u();const h=new ResizeObserver(u);return h.observe(o),()=>h.disconnect()},[e,i]),A.useLayoutEffect(()=>{const o=i.current;if(!o)return;const c=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return c(),o.addEventListener("scroll",c),()=>o.removeEventListener("scroll",c)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[TH(e,t,"",void 0,(o,c,u,h)=>{var w;const _=e.slice(u),p=((w=/^[ \t]+/.exec(_))==null?void 0:w[0].length)??0;if(u===n||_&&!_.startsWith(` -`)&&pk.name===c);return m&&m.source!=="command"?f.jsx(ALn,{label:o,name:c,end:u,skill:m,projectId:s,textareaRef:i},`${h}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${h}:${u}`)},!0),"​"]})}function OLn({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=A.useRef(null);return A.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[f.jsx(zH,{name:i.name,className:"shrink-0"}),f.jsx("span",{className:"skill-name shrink-0",children:V5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:Hsn()})]},i.name))})}function DLn(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const Q5=6.5,bR=2*Math.PI*Q5;function LLn({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(ILn,{usage:e})}function ILn({usage:e}){const{open:n,setOpen:t,ref:r}=Xa(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":DLn(a),c=a===null?"":new Intl.NumberFormat(N(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:hMe(),onClick:()=>t(u=>!u),children:a===null?e1(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:Q5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:Q5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${bR*Math.max(a,2)/100} ${bR}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-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:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:oMe()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?xMe({value:Ce(e1(s))}):zMe({used:Ce(e1(s)),total:Ce(e1(i)),percent:Ce(c)})})]}),a!==null&&f.jsx(hH,{value:s,max:i,fillColor:o})]})]})}function $Ln(e,n,t){const r=e.map(t);return n<0?r:[...r.slice(0,n),f.jsxs("div",{role:"group","aria-label":Cz(),children:[f.jsx("div",{className:"px-2.5 pb-1 pt-2.5 text-sm font-medium text-subtext",children:Cz()}),r.slice(n)]},"from-terminal")]}function BLn({activeSessionId:e,onClose:n,onResume:t,onImport:r}){const s=A.useRef(null),i=A.useRef(null),{data:a,isPending:o,error:c}=ut(F2n()),{data:u=[]}=ut(hh()),{data:h=[]}=ut(oI()),[_,p]=A.useState(""),[m,w]=A.useState(0);Nm(s,n);const k=A.useMemo(()=>new Map(u.map(z=>[z.id,z.name])),[u]),v=A.useMemo(()=>{const z=_.trim().toLowerCase(),E=M=>!z||M.toLowerCase().includes(z),T=(a??[]).filter(M=>M.id!==e).filter(M=>E(`${M.title??""} ${k.get(M.projectId)??""} ${hu[M.harness]}`)).map(M=>({kind:"session",key:M.id,session:M})),j=h.filter(M=>E(`${M.title??""} ${M.cwd??""} ${hu[M.harness]}`)).map(M=>({kind:"native",key:`${M.harness}:${M.nativeId}`,chat:M}));return[...T,...j]},[a,h,_,e,k]),b=A.useMemo(()=>v.findIndex(z=>z.kind==="native"),[v]),x=Math.min(m,Math.max(0,v.length-1));A.useLayoutEffect(()=>{var z;(z=i.current)==null||z.scrollIntoView({block:"nearest"})},[x,v]);const y=z=>(z==null?void 0:z.split("/").filter(Boolean).at(-1))??"",C=z=>z.kind==="native"?r(z.chat):t(z.session);return Fi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-start justify-center bg-modal-backdrop p-5 pt-[var(--modal-top)]",onClick:z=>{z.target===z.currentTarget&&n()},children:f.jsxs("div",{ref:s,className:"flex max-h-[calc(100vh_-_var(--modal-top)_-_1.25rem)] w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-label":Nz(),tabIndex:-1,children:[f.jsx("div",{className:"border-b border-border p-3",children:f.jsx(Ur,{"data-initial-focus":!0,value:_,placeholder:Ez(),"aria-label":Ez(),role:"combobox","aria-autocomplete":"list","aria-expanded":v.length>0,"aria-controls":"resume-options","aria-activedescendant":v[x]?`resume-option-${v[x].key}`:void 0,onChange:z=>{p(z.target.value),w(0)},onKeyDown:z=>{if(!z.nativeEvent.isComposing)if(z.key==="ArrowDown"||z.key==="ArrowUp"){if(z.preventDefault(),v.length===0)return;const E=z.key==="ArrowDown"?1:-1;w((x+E+v.length)%v.length)}else z.key==="Enter"&&v[x]&&(z.preventDefault(),C(v[x]))}})}),f.jsx("div",{id:"resume-options",className:"min-h-0 flex-1 overflow-y-auto p-1.5",role:v.length>0?"listbox":void 0,"aria-label":v.length>0?Nz():void 0,children:o?f.jsxs(Vr,{className:"px-2.5 py-2",role:"status",children:[f.jsx(jt,{})," ",Qk()]}):c&&!a?f.jsx("div",{className:"px-2.5 py-2 text-sm text-accent-red",role:"alert",children:Wk({error:Ce(c instanceof Error?c.message:String(c))})}):v.length===0?f.jsx("div",{className:"px-2.5 py-2 text-sm text-muted",role:"status",children:G8t()}):$Ln(v,b,(z,E)=>{var D;const T=z.kind==="native"?z.chat:null,j=z.kind==="session"?z.session:null;return f.jsxs(Dn,{id:`resume-option-${z.key}`,ref:E===x?i:void 0,type:"button",role:"option","aria-selected":E===x,active:E===x,tabIndex:-1,className:"gap-2.5 text-text",onMouseEnter:()=>w(E),onClick:()=>C(z),children:[f.jsx(bh,{harness:(T==null?void 0:T.harness)??(j==null?void 0:j.harness)??"claude-code"}),f.jsx("span",{dir:"auto",className:"min-w-0 flex-1 truncate",children:((D=(T==null?void 0:T.title)??(j==null?void 0:j.title))==null?void 0:D.trim())||xd()}),f.jsx("span",{dir:"auto",className:"max-w-40 shrink-0 truncate text-muted",title:(T==null?void 0:T.cwd)??void 0,children:T?y(T.cwd):k.get((j==null?void 0:j.projectId)??"")??""}),f.jsx("span",{className:"shrink-0 text-muted tabular-nums",children:wo((T==null?void 0:T.updatedAt)??(j==null?void 0:j.updatedAt)??0)})]},z.key)})})]})}),document.body)}const ob="!";function yR(e){return e.startsWith(ob)?e.slice(ob.length).trim():null}function PLn(e){return e.startsWith(ob)?e.slice(ob.length):e}function FLn(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 HLn(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function qLn(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` +`)))return f.jsx("code",{className:s,...r,children:t});const c=i?V3(i[1]):null;return f.jsx(mDn,{code:a,lang:c})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})};function kDn({children:e}){return f.jsx("figure",{className:"my-6 mx-auto max-w-full text-left [&_img]:mx-auto [&_img]:my-0 [&_img]:w-auto [&_img]:h-auto [&_img]:max-h-[min(480px,60vh)] [&_img]:object-contain [&_img]:border-0 [&_img]:rounded-none",children:e})}const nc=A.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){wf();const o=A.useContext(lH),c=i??o,u=A.useMemo(()=>({"file-mention":h=>f.jsx(fR,{path:h.path,lines:h.lines,exp:h.exp,onOpenFile:t}),"run-mention":h=>f.jsx(yDn,{id:h.id,label:h.label,onOpenRun:r}),a:({node:h,href:_,children:p,"data-figure-src":m,...w})=>{const k=typeof m=="string"?$B(m):null;if(k&&t){const v=k.source==="artifact"?`artifacts/${k.path}`:k.path,b=s?s(v):v;if(b)return f.jsx("button",{type:"button",className:"text-primary underline cursor-pointer text-start",...Gr(x=>t(b,void 0,void 0,void 0,x)),children:p})}if(_&&wDn(_)&&t){let v;try{v=decodeURI(_)}catch{return f.jsx("span",{children:p})}const b=s?s(v):v;return b?f.jsx(fR,{path:b,onOpenFile:t}):f.jsx("span",{children:p})}return f.jsx("a",{href:_,target:"_blank",rel:"noopener noreferrer",...w,children:p})},figure:({children:h})=>f.jsx(kDn,{children:h}),figcaption:({children:h})=>f.jsx("figcaption",{className:"mt-3 text-sm italic leading-relaxed text-text",children:h}),th:({node:h,..._})=>f.jsx("th",{dir:"auto",..._}),td:({node:h,..._})=>f.jsx("td",{dir:"auto",..._}),img:({node:h,src:_,alt:p,className:m,...w})=>{var v;if(!_||typeof _!="string")return null;const k=c?c(_):_;return k?A.createElement(hDn,{...w,key:k,downloadName:(v=_.split(/[\\/]/).pop())==null?void 0:v.split(/[?#]/)[0],src:k,fallbackSrc:i?null:o==null?void 0:o(_,!0),alt:p??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border cursor-zoom-in focus-visible:outline-2 focus-visible:outline-primary ${m??""}`}):null},...dH}),[t,r,s,i,o,c]);return f.jsx("div",{dir:"auto","data-streaming":a||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-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_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-prose-emphasis [&_.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-sm [&_.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-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_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-start [&_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-start [&_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]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-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:f.jsx(oTn,{content:cH(n,{predictMath:a}),processor:xDn,components:u,predict:a})})}),dR="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function SDn({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,c]=A.useState(!1),u=A.useRef(null),[h,_]=A.useState(!1),[p,m]=A.useState(""),w=A.useRef(null);A.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&c(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),A.useEffect(()=>{var v;h&&((v=w.current)==null||v.focus())},[h]);const k=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),_(!1)};return f.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-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(yS,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?Rxt({agent:Ce(n)}):Cxt({agent:Ce(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Gr(t),children:Zxt()})]}),h?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:w,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:E2t(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),_(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),k())}}),f.jsxs("div",{className:dR,children:[f.jsx(Oe,{size:"small",onClick:()=>{m(""),_(!1)},children:aL()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Oe,{size:"small",variant:"primary",onClick:k,children:[f2t(),f.jsx(HI,{size:13})]})]})]}):f.jsxs("div",{className:dR,children:[f.jsx(Oe,{size:"small",onClick:i,children:i2t()}),f.jsx(Oe,{size:"small",onClick:()=>_(!0),children:b2t()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Oe,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:sxt()}),f.jsx(Oe,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":Gxt(),onClick:()=>c(v=>!v),children:f.jsx(ac,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(Dn,{onClick:()=>{c(!1),r("bypassPermissions")},children:_xt()})})]}):f.jsx(Oe,{size:"small",variant:"primary",onClick:()=>r(),children:vxt()})]})]})}function hR({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=A.useState(""),[o,c]=A.useState(!1),[u,h]=A.useState(null);async function _(p){if(p.preventDefault(),!(o||!i.trim())){c(!0),h(null);try{n(await e(i.trim())),a("")}catch(m){h(m instanceof Error?m.message:String(m))}finally{c(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:_,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Oe,{type:"submit",disabled:o||!i.trim(),children:o?va():ic()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??zKe()}),u&&f.jsx("div",{className:"error",children:u})]})}function hH({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}function CDn({settings:e}){const[n,t]=A.useState(!1);return f.jsxs("label",{className:"inline-flex max-w-full flex-wrap items-center gap-2 text-sm text-subtext",children:[Lln(),f.jsx("span",{className:"inline-block w-max max-w-full",children:f.jsx(ec,{variant:"field",dropDown:!0,value:e.defaultHost??"",disabled:n,choices:[{id:"",label:wL()},...e.defaultHost&&!e.hosts.some(r=>r.host===e.defaultHost)?[{id:e.defaultHost,label:e.defaultHost}]:[],...e.hosts.map(r=>({id:r.host,label:r.host}))],onSelect:r=>{t(!0),rxn(r||null).catch(s=>{bn(s instanceof Error?s.message:String(s),"error")}).finally(()=>t(!1))}})})]})}function EDn({host:e,connecting:n,reference:t,onChange:r}){const s=A.useId(),i=dn({mutationFn:nxn,scope:{id:`ssh-settings-${e.host}`}});function a(o){r(o),i.reset(),!(o!==null&&!o.trim())&&i.mutate({host:e.host,container:(o==null?void 0:o.trim())??null})}return f.jsxs("details",{className:"pb-3",children:[f.jsx("summary",{className:"w-fit cursor-pointer rounded-sm text-sm text-subtext focus-visible:outline-2 focus-visible:outline-text",children:YD()}),f.jsxs("div",{className:"mt-3 grid max-w-xl gap-3",children:[f.jsxs("label",{className:"text-sm text-subtext",children:[run(),f.jsx(ec,{variant:"field",dropDown:!0,value:t!==null?"container":"host",disabled:n,choices:[{id:"host",label:qln()},{id:"container",label:Xln()}],onSelect:o=>a(o==="container"?"":null)})]}),t!==null&&f.jsxs("label",{className:"text-sm text-subtext",htmlFor:`${s}-container`,children:[jln(),f.jsx(Ur,{id:`${s}-container`,value:t,disabled:n,required:!0,onChange:o=>a(o.target.value)})]}),i.error&&f.jsx("p",{className:"m-0 text-sm text-accent-red",role:"status",children:i.error.message})]})]})}const rc=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.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-base [&_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(" "),_f=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),NDn=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Ay="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ua=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),cC=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.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-start","[&_.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-control-subtle","[&_.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-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.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]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-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-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.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-start [&_.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-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.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-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.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","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),sl=["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","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),H5=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.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-base","[&_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-base [&_.kv_.v]:break-normal","[@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(" "),x0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),gd=["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(" "),zDn=new Set(["gh auth login","hf auth login","claude auth status"]);function pH(e){return zDn.has(e)?`/api/settings/commands/run?command=${encodeURIComponent(e)}`:void 0}function Ry(){const[e,n]=A.useState(null);return{run:e,start:(r,s,i)=>n(a=>({command:r,path:s,owner:i,attempt:((a==null?void 0:a.attempt)??0)+1})),clear:()=>n(null)}}function lC({note:e,className:n,disabled:t,resolve:r=pH,onRun:s}){return e?f.jsx("p",{className:n,children:vh(e,{canRun:i=>!t&&r(i)!==void 0,onRun:i=>{const a=r(i);a&&s(i,a)}})}):null}function My({run:e,onComplete:n,onClose:t}){return e?f.jsx(wkn,{path:e.path,label:e.command,onComplete:n,onError:r=>bn(r,"error"),onClose:t},`${e.command}-${e.attempt}`):null}function o4(e){return e.catalogPending?{cls:"warn",variant:"warning",label:nf()}:e.agentReady&&!e.authenticated&&e.authMethod!=="local"?{cls:"warn",variant:"warning",label:JD()}:e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?Jk():NXt()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:TFt()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:eL()}:e.needsConfigRepair||e.authState==="unknown"?{cls:"warn",variant:"warning",label:b3()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:FZt()}:{cls:"warn",variant:"warning",label:kL()}:{cls:"warn",variant:"warning",label:tVt()}}function jDn({h:e}){return e.id==="opencode"&&e.agentReady&&!e.authenticated&&!e.authMethod?f.jsx(f.Fragment,{children:_Tt()}):e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:zv()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?vDt():Zk()}):f.jsx(f.Fragment,{children:"—"})}function TDn(e,n,t){if(!n)return;const r=n.installUrl!==void 0&&t.includes(n.installUrl),s=t===n.login?"login":t===n.install?"install":t===n.update?"update":r?"install":null;if(s&&!(s!=="install"&&(!e.installed||e.installBroken)))return`/api/harnesses/setup?${new URLSearchParams({harness:e.id,action:s,shell:"true"})}`}function ADn({remote:e}){const n=Mu(),{data:t=null}=ut(n),[r,s]=A.useState(null),[i,a]=A.useState(!1),o=Ry(),[c,u]=A.useState(null),h=ut(aI()),_=(w,k=!1)=>{a(!0),af(w,k).catch(()=>{}).finally(()=>a(!1))},p=[...t??[]].sort((w,k)=>Number(k.agentReady)-Number(w.agentReady)),m=p.find(w=>w.id===r)??p[0];return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:v3()}),!e&&c&&h.data&&f.jsx(h$,{harness:c,commands:h.data[c.id],onClose:()=>u(null)}),f.jsx("div",{className:"mt-3 mb-3.5 w-fit max-w-full [&_.option-menu]:w-max",children:f.jsx(ec,{variant:"field",dropDown:!0,title:v3(),choices:p.map(w=>({id:w.id,label:w.name})),value:(m==null?void 0:m.id)??null,onSelect:w=>{const k=p.find(v=>v.id===w);k&&s(k.id)},renderIcon:w=>{const k=p.find(v=>v.id===w.id);return k&&f.jsx(bh,{harness:k.id})},renderLabel:w=>{const k=p.find(b=>b.id===w.id),v=k&&o4(k);return f.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[w.label,v&&f.jsxs(f.Fragment,{children:[f.jsx("span",{"aria-hidden":"true",className:`size-1.5 shrink-0 rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${v.cls}`}),f.jsx("span",{className:"sr-only",children:v.label})]})]})}})}),t?m?f.jsxs("div",{className:rc,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Wt,{variant:o4(m).variant,children:o4(m).label}),f.jsx("div",{className:"spacer flex-1"}),!e&&!m.catalogPending&&m.installed&&!m.installBroken&&!m.authenticated&&!m.needsConfigRepair&&m.authMethod!=="local"&&m.authMethod!=="apiKey"&&m.authState!=="unsupported"&&f.jsxs(Oe,{size:"small",onClick:()=>u(m),disabled:!h.data,"aria-haspopup":"dialog",children:[f.jsx(Cf,{size:14})," ",UD()]}),f.jsxs(Oe,{size:"small",onClick:()=>_(!0,!0),disabled:i,children:[f.jsx(Qa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Cm()]})]}),f.jsxs("div",{className:ys(_f,"[&_.v]:text-sm"),children:[f.jsx("span",{className:"k",children:YLt()}),f.jsx("span",{className:"v",children:m.binPath??GOt()}),f.jsx("span",{className:"k",children:jL()}),f.jsx("span",{className:"v",children:m.version??"—"}),f.jsx("span",{className:"k",children:vLt()}),f.jsx("span",{className:"v",children:f.jsx(jDn,{h:m})}),m.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:m.id==="opencode"?KJt():rS()}),f.jsx("span",{className:"v",children:m.account})]}),m.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:dKt()}),f.jsx("span",{className:"v",children:m.org})]}),m.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:hWt()}),f.jsx("span",{className:"v",children:m.plan})]}),f.jsx("span",{className:"k",children:iLt()}),f.jsx("span",{className:"v",children:m.catalogPending?nf():m.models.length>0?$Mt({count:tn(m.models.length),models:new Intl.ListFormat(E()).format(m.models.slice(0,4).map(w=>Ce(K1(w))))}):nS()})]}),f.jsx(lC,{note:m.agentNote,className:ys(Ua,"text-sm"),disabled:e,resolve:w=>{var k;return TDn(m,(k=h.data)==null?void 0:k[m.id],w)??pH(w)},onRun:(w,k)=>o.start(w,k,m.id)}),o.run&&f.jsx("div",{hidden:o.run.owner!==m.id,children:f.jsx(My,{run:o.run,onComplete:()=>_(!0,!0),onClose:o.clear})}),m.id==="opencode"&&f.jsx(b$,{installed:m.installed})]}):null:f.jsxs(Vr,{children:[f.jsx(jt,{})," ",GBt()]})]})}function RDn({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Wt,{variant:"success",children:k$t()}):f.jsx(Wt,{variant:"error",children:tGt()}):f.jsx(Wt,{variant:"error",children:r$t()}):f.jsx(Wt,{variant:"error",children:gHt()})}function MDn({onEditState:e}){var T;const n=dn({mutationFn:Kyn}),t=Vz(),r=ut(t),s=r.data??null,i=j=>{Yr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,c]=A.useState(""),[u,h]=A.useState(""),[_,p]=A.useState(!1),[m,w]=A.useState(!1),[k,v]=A.useState(null),b=j=>{i(j),c(j.context??""),h(j.namespace)},x=A.useRef(null);A.useEffect(()=>{const j=x.current;x.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(c(s.context??""),h(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;A.useEffect(()=>{e==null||e({dirty:C,saving:_})},[C,_,e]);async function z(){if(!(m||_||!y)){w(!0);try{await Je.fetchQuery({...Vz(),staleTime:0})}catch(j){bn(j instanceof Error?j.message:String(j),"error")}finally{w(!1)}}}async function N(j){if(j.preventDefault(),!(_||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:Lh()}),f.jsx("dd",{className:"m-0",children:m||_?f.jsx(Wt,{children:ha()}):C?f.jsx(Wt,{children:PD()}):f.jsx(RDn,{s})})]}),y&&!m&&!_&&s.preflight.error&&f.jsx("p",{className:`${Ay} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[T$t(),f.jsx(ec,{choices:[{id:"",label:s.currentContext?wRt({context:Ce(s.currentContext)}):pRt()},...o&&!s.contexts.includes(o)?[{id:o,label:ZOt({context:Ce(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:_||m,onSelect:c})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[aUt(),f.jsx(Ur,{type:"text",value:u,disabled:_||m,onChange:j=>h(j.target.value),placeholder:vBt(),autoComplete:"off",spellCheck:!1})]}),k&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:k}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",onClick:()=>void z(),disabled:_||m||!y,children:[f.jsx(Qa,{size:13})," ",m?ha():km()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:_||m||y,children:_?va():ic()})]})]})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",SIt()]})})}function ODn(){var y;const e=dn({mutationFn:C=>Qyn(...C)}),n=Kz(),t=ut(n),r=t.data??null,s=C=>{Yr(n.queryKey,z=>(typeof C=="function"?C(z??null):C)??void 0)},[i,a]=A.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[c,u]=A.useState(""),[h,_]=A.useState(""),[p,m]=A.useState(!1),w=t.isPending||p,[k,v]=A.useState(!1);async function b(){if(!(w||k)){m(!0),a(null);try{await Je.fetchQuery({...Kz(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function x(C){if(C.preventDefault(),!(!c.trim()||!h.trim()||w||k||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([c.trim(),h.trim()])),u(""),_("")}catch(z){a(z instanceof Error?z.message:String(z))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&w?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",AIt()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Lh()}),f.jsx("dd",{className:"m-0",children:f.jsx(Wt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?iS():Ab()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:XRt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:x,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?rMt():SMt(),f.jsx(Ur,{type:"password",value:c,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?uMt():AMt(),f.jsx(Ur,{type:"password",value:h,onChange:C=>_(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:gMt()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",disabled:w||k,onClick:()=>void b(),children:[f.jsx(Qa,{size:13})," ",Cm()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!c.trim()||!h.trim()||w||k||(r==null?void 0:r.processEnv),children:k?va():ic()})]})]})]})}const mH="rounded-sm border-border-strong bg-surface text-subtext",gH="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",DDn=5e3;function vH(e){const n=Va(),t=e.map(a=>Wz(a)),r=iK({queries:t.map(a=>({...a,refetchInterval:DDn}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Yr(Wz(a).queryKey,{running:!0})}]}function LDn({test:e,connecting:n,masterRunning:t,containerFailed:r=!1}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Wt,{className:gH,children:fL()})});if(e===void 0)return f.jsx(Wt,{className:mH,children:xL()});const s=e.missingTools??[],i=e.reachable&&e.toolsFound&&t===!1,a=!e.reachable||r?f.jsx(Wt,{className:"rounded-sm",variant:"error",children:sS()}):e.toolsFound?i?f.jsx(Wt,{className:"rounded-sm",variant:"warning",children:dL()}):f.jsx(Wt,{className:"rounded-sm",variant:"success",children:Sm()}):f.jsx(Wt,{className:"rounded-sm",variant:"error",children:s.length===1?GMt({tool:Ce(s[0])}):ZMt()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[a,!i&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:wo(e.testedAt)})]})}function IDn({remote:e=!1}){var I;const n=iI(),t=ut(n),r=((I=t.data)==null?void 0:I.hosts)??(t.isError?[]:null),[s,i]=A.useState(!1),[a,o]=A.useState({}),[c,u]=A.useState({}),h=A.useRef(0),[_,p]=A.useState(!1),[m,w]=A.useState({}),[k,v]=A.useState(null),[b,x]=A.useState(!1),[y,C]=A.useState(0),z=e?[]:(r==null?void 0:r.filter($=>{const q=a[$.host]??$.lastTest;return(q==null?void 0:q.reachable)&&q.toolsFound}).map($=>$.host))??[],[N,T]=vH(z);function j($){h.current+=1,p(!1),x(!1),C(q=>q+1),v($),w(q=>({...q,[$]:!0}))}function M(){h.current+=1,p(!1),x(!1),v(null)}function D($,q){w(H=>({...H,[$]:!q}))}return f.jsxs(f.Fragment,{children:[t.error&&f.jsx("p",{className:"text-sm text-accent-red",children:t.error.message}),f.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3",children:[!e&&t.data&&f.jsx(CDn,{settings:t.data}),f.jsxs(Oe,{variant:"ghost",className:"ms-auto",onClick:()=>i(!0),children:[f.jsx(xS,{size:14})," ",DL()]})]}),r===null?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",CL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:WUt()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map($=>{var ne,oe,ue;const q=c[$.host]===void 0?$.container??null:c[$.host],H=a[$.host],Q=q!==null&&((ne=H==null?void 0:H.container)==null?void 0:ne.reference)===q.trim()?H:void 0,V=q!==null?Q:H!=null&&H.container?$.lastTest:H??$.lastTest,Z=(oe=Q==null?void 0:Q.container)==null?void 0:oe.error,Y=((ue=Q==null?void 0:Q.container)==null?void 0:ue.ready)===!1,B=(V==null?void 0:V.error)||Z,L=k===$.host,F=m[$.host]??!1,U=!e&&(L||!!B),K=`${$.user?`${$.user}@`:""}${$.hostname??$.host}${$.port?`:${$.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3",children:[f.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:$.host,children:$.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:K,children:K})]})}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsxs("div",{className:"flex items-center gap-2 text-start",children:[f.jsx(LDn,{test:V,connecting:L&&!b,masterRunning:N[$.host],containerFailed:Y}),U&&f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":F,"aria-label":F?mX({name:Ce($.host)}):nY({name:Ce($.host)}),onClick:se=>{se.stopPropagation(),D($.host,F)},children:f.jsx(ac,{size:18,className:`text-muted transition-transform duration-120 ease-standard${F?" rotate-180":""}`})})]}),f.jsx(Oe,{size:"small",type:"button",className:"justify-self-end",onClick:se=>{se.stopPropagation(),L&&!b?M():j($.host)},disabled:!L&&(k!==null&&!b||q!==null&&!q.trim()),children:L?b?Ys():rf():(V==null?void 0:V.reachable)===!1||Y?Ys():V?TL():eS()})]})]}),!e&&f.jsx(EDn,{host:$,connecting:L&&!b,reference:q,onChange:se=>{L&&M(),u(G=>({...G,[$.host]:se})),o(G=>{const ae={...G};return delete ae[$.host],ae})}}),U&&(F||L)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3${F?"":" hidden"}`,children:[!L&&B&&f.jsx(kkn,{host:$.host,transcript:B}),L&&!_&&f.jsx(CS,{host:$.host,backend:"ssh",active:F,onComplete:se=>{if(se.backend!=="ssh")return;T($.host);const G=h.current;if(q===null){o(ae=>({...ae,[$.host]:{...se.result,container:null}})),x(!1),v(null);return}p(!0),sxn($.host,q.trim()).then(ae=>{h.current===G&&o(ce=>({...ce,[$.host]:{...ae,container:ae.container??{reference:q.trim(),ready:!1,error:ae.error??null}}}))}).catch(ae=>{h.current===G&&o(ce=>({...ce,[$.host]:{...se.result,container:{reference:q.trim(),ready:!1,error:ae instanceof Error?ae.message:String(ae)}}}))}).finally(()=>{h.current===G&&(p(!1),x(!1),v(null))})},onError:se=>{x(!0),o(G=>({...G,[$.host]:{container:q===null?null:{reference:q.trim(),ready:!1,error:se},reachable:!1,toolsFound:!1,missingTools:[],error:se,testedAt:Date.now()}}))}},y)]})]},$.host)})}),s&&f.jsx(U$,{onClose:()=>i(!1)})]})}function $Dn({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Wt,{className:gH,children:fL()}):e===null?f.jsx(Wt,{className:mH,children:xL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Wt,{className:"rounded-sm",variant:"warning",children:dL()}):f.jsx(Wt,{className:"rounded-sm",variant:"success",children:Sm()}):f.jsx(Wt,{className:"rounded-sm",variant:"error",children:Rqt()}):f.jsx(Wt,{className:"rounded-sm",variant:"error",children:jGt()}):f.jsx(Wt,{className:"rounded-sm",variant:"error",children:sS()})}function BDn({remote:e=!1}){var B;const n=dn({mutationFn:pxn}),t=k2n(),r=ut(t),s=r.data??null,i=L=>{Yr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((B=r.error)==null?void 0:B.message)??null,[o,c]=A.useState(""),[u,h]=A.useState(""),[_,p]=A.useState(""),[m,w]=A.useState(""),[k,v]=A.useState(!1),[b,x]=A.useState(null),[y,C]=A.useState(null),[z,N]=A.useState(!1),[T,j]=A.useState(!1),[M,D]=A.useState(0),I=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,q]=vH(I);function H(){j(!1),D(L=>L+1),N(!0)}const Q=L=>{i(L),c(L.host??""),h(L.partition??""),p(L.account??""),w(L.timeLimit??"")},V=A.useRef(null);A.useEffect(()=>{const L=V.current;V.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&_.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(c(s.host??""),h(s.partition??""),p(s.account??""),w(s.timeLimit??""))},[s,o,u,_,m]);const Z=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&_.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function Y(L){if(L.preventDefault(),!k){v(!0),x(null);try{Q(await n.mutateAsync({host:o,partition:u.trim(),account:_.trim(),timeLimit:m.trim()}))}catch(F){x(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!z&&(y==null?void 0:y.error)&&f.jsx("p",{className:Ay,children:y.error}),f.jsxs("form",{className:cC,onSubmit:Y,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vqt(),f.jsx(ec,{choices:[{id:"",label:wL()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:k||z,onSelect:L=>{c(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Oe,{type:"button",onClick:()=>{z&&!T?(j(!1),N(!1)):H()},disabled:!o,title:o?void 0:PJt(),children:z?T?Ys():rf():y?TL():eS()}),f.jsx("span",{role:"status",children:f.jsx($Dn,{test:y,connecting:z&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[eWt(),f.jsx(Ur,{type:"text",list:"slurm-partitions",value:u,onChange:L=>h(L.target.value),placeholder:Az(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[rS(),f.jsx(Ur,{type:"text",value:_,onChange:L=>p(L.target.value),placeholder:Az(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[wZt(),f.jsx(Ur,{type:"text",value:m,onChange:L=>w(L.target.value),placeholder:XIt(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Oe,{variant:"primary",type:"submit",disabled:k||Z||z,children:k?va():ic()})})]}),!e&&z&&f.jsx(CS,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),q(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",UHt()]})})}function PDn(){var C;const e=dn({mutationFn:gxn}),n=S2n(),t=ut(n),r=t.data??null,s=z=>{Yr(n.queryKey,N=>(typeof z=="function"?z(N??null):z)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=A.useState(""),[c,u]=A.useState(!1),[h,_]=A.useState(null),[p,m]=A.useState(null),w=p!==null&&p!=="testing"?p:null,k=z=>{s(z),o(z.address??"")},v=A.useRef(null);A.useEffect(()=>{const z=v.current;v.current=r,r&&(!z||a===(z.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function x(z){if(z.preventDefault(),!c){u(!0),_(null);try{k(await e.mutateAsync({address:a}))}catch(N){_(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await vxn(a.trim()||void 0))}catch(z){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:z instanceof Error?z.message:String(z)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(w==null?void 0:w.error)&&f.jsx("p",{className:Ay,children:w.error}),f.jsxs("form",{className:cC,onSubmit:x,children:[f.jsxs("label",{children:[uHt(),f.jsx(Ur,{type:"text",value:a,onChange:z=>{o(z.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[iPt(),": ",Ce(r.resolvedAddress)," · ",EL(),": ",r.source]}),h&&f.jsx("div",{className:"error",children:h}),f.jsxs("div",{className:"actions",children:[f.jsx(Oe,{variant:"primary",type:"submit",disabled:c||b,children:c?va():ic()}),f.jsx(Oe,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:OYt()}),f.jsx(FDn,{test:p})]}),(w==null?void 0:w.reachable)&&w.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zWt(),": ",w.rayVersion]})]})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",IHt()]})})}function FDn({test:e}){return e===null?null:e==="testing"?f.jsx(Wt,{children:FYt()}):e.reachable?f.jsx(Wt,{variant:"success",children:DWt()}):f.jsx(Wt,{variant:"error",children:sS()})}function HDn(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:nl(e.memBytes),r=e.gpus.length===0?null:VTt({count:e.gpus.length});return[n,e.cpuCount>0?vjt({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function qDn({remote:e}){var p;const n=ut(E2n()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=A.useState(0),[o,c]=A.useState(!0),[u,h]=A.useState(!1),_=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:NDn,children:[f.jsx("span",{className:"k",children:Lh()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Wt,{className:"gap-1.5",role:"status",children:[f.jsx(jt,{}),u?RDt():ha()]}):r?f.jsx(Wt,{variant:"warning",children:b3()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Wt,{variant:"success",children:Sm()}):t.sshKeyStatus==="unknown"?f.jsx(Wt,{variant:"warning",children:b3()}):f.jsx(Wt,{variant:"warning",children:Ab()}):f.jsx(Wt,{variant:"warning",children:kL()}):null}),f.jsx("span",{className:"k",children:yKt()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:PXt()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Wt,{variant:"success",children:OVt()}):t.sshKeyStatus==="no_local_match"?f.jsx(Wt,{variant:"warning",children:pVt()}):t.sshKeyStatus==="none_registered"?f.jsx(Wt,{variant:"error",children:LGt()}):f.jsx(Wt,{children:NL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:LRt({command:Ce("orx login")})}),!e&&i>0&&f.jsx(xkn,{login:o,onComplete:()=>{h(!1),a(0),_()},onError:m=>{h(!1),bn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ua,children:[GDt()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ua,children:[wGt()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),WYt()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ua,children:aen({register:Ce(`orx ssh-key add ${t.sshKeyPath}`),load:Ce("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ua,children:[pGt()," ",f.jsx("code",{children:"ssh-add"}),aKt()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Oe,{onClick:()=>void _(),disabled:s||u,children:[f.jsx(Qa,{size:13})," ",s?ha():km()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Oe,{variant:"primary",disabled:s||u,onClick:()=>{c(!t.loggedIn),h(!0),a(m=>m+1)},children:[u?f.jsx(jt,{}):f.jsx(Cf,{size:13})," ",t.loggedIn?Wtn():AL()]})]})]})}const UDn={local:TTe,ssh:_Ae,tinker:vAe,hf:mTe,modal:ITe,k8s:kTe,slurm:sAe,ray:YTe,openresearch:UTe},Oy={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},pR=["hf","modal","slurm","ray","openresearch"],c4=["hf","modal","openresearch"],bH={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"]},q5=["tinker","hf","modal","ray","k8s"],GDn={tinker:eMe,hf:MRe,modal:PRe,openresearch:KRe},mR="__custom__";function Xp(e,n){return!!(n&&!(bH[e]??[]).includes(n))}function VDn({settings:e,projectId:n,onSaved:t}){const r=dn({mutationFn:yxn}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=A.useState(s),[c,u]=A.useState(i),[h,_]=A.useState(Xp(s,i)),[p,m]=A.useState(!1),[w,k]=A.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),x=pR.includes(a),y=c4.includes(a),C=bH[a]??[],z=a===s&&(!x||c.trim()===i),N=lf[a](),T=GDn[a],j=p?tsn():y&&!c.trim()?VNt({destination:N}):a==="ssh"?fOt():iOt({destination:N});A.useEffect(()=>{o(s),u(i),_(Xp(s,i))},[s,i]);async function M($,q){const H=pR.includes($);if(!(p||c4.includes($)&&!q.trim())){m(!0),k(null);try{t(await r.mutateAsync({backend:$,flavor:H&&q.trim()||null,projectId:n}))}catch(Q){k(Q instanceof Error?Q.message:String(Q)),o(s),u(i),_(Xp(s,i))}finally{m(!1)}}}function D($){const q=e.targets.find(Q=>Q.id===$);if(!q)return;o(q.id);const H=q.id===s?i:"";u(H),_(Xp(q.id,H)),c4.includes(q.id)||M(q.id,H)}function I($){if($===mR){_(!0);return}_(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:ABt()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),z||M(a,c)},children:[f.jsx(ec,{choices:b.map($=>({id:$.id,label:lf[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const q=e.targets.find(H=>H.id===$.id);return q?f.jsx(Bh,{kind:Oy[q.id],size:16}):null},onSelect:D}),x&&f.jsx("div",{children:h?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:c,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!c.trim()){a===s&&(u(i),_(Xp(s,i)));return}z||M(a,c)},placeholder:Y$t(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":Tz(),title:Tz(),onMouseDown:$=>$.preventDefault(),onClick:()=>_(!1),children:f.jsx(ac,{size:12})})]}):f.jsx(ec,{choices:[{id:"",label:y?BNt():EOt()},...c&&!C.includes(c)?[{id:c,label:Bjt({value:Ce(c)})}]:[],...C.map($=>({id:$,label:$})),{id:mR,label:sBt()}],value:c,variant:"field",dropDown:!0,disabled:p,onSelect:I})})]}),w&&f.jsx("div",{className:"error mt-2.5",children:w}),v&&!v.configured&&f.jsx("p",{className:Ua,children:cZt()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function KDn({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?CNt():e.id==="openresearch"?AL():e.id==="ray"?eS():Ftn();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":lf[e.id](),"aria-describedby":i,"aria-haspopup":q5.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(Bh,{kind:Oy[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:lf[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:UDn[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?cRt():Nrn()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:sTt()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?vL():e.configured?!r||q5.includes(e.id)?iS():xsn():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(Q1,{size:16})})]})]})}function WDn({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(M0,{size:16})," ",mL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(Bh,{kind:Oy[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:lf[e.id]()})]}),n&&f.jsx(Wt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:vL()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(IDn,{remote:r}),e.id==="slurm"&&f.jsx(BDn,{remote:r}),e.id==="openresearch"&&f.jsx(qDn,{remote:r})]})]})}function QDn({target:e,remote:n,onClose:t}){const r=A.useRef(null),[s,i]=A.useState({dirty:!1,saving:!1});A.useEffect(()=>{const o=r.current;return o==null||o.showModal(),()=>o==null?void 0:o.close()},[]);const a=()=>{s.saving||s.dirty&&!window.confirm(tRt())||t()};return f.jsxs("dialog",{ref:r,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),a())},onCancel:o=>{o.preventDefault(),a()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(Bh,{kind:Oy[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:lf[e.id]()})]}),f.jsx(Ft,{title:A0(),"aria-label":A0(),onClick:a,disabled:s.saving,children:f.jsx(_r,{size:14})})]}),e.id==="tinker"&&f.jsx(YDn,{target:e}),e.id==="hf"&&f.jsx(JDn,{remote:n}),e.id==="modal"&&f.jsx(ODn,{}),e.id==="ray"&&f.jsx(PDn,{}),e.id==="k8s"&&f.jsx(MDn,{onEditState:i})]})}function XDn({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,D;const s=sI(e==null?void 0:e.id),i=ut(s),a=i.data??null,o=I=>{Yr(s.queryKey,$=>(typeof I=="function"?I($??null):I)??void 0)},c=a?null:((M=i.error)==null?void 0:M.message)??null,[u,h]=A.useState(null),[_,p]=A.useState(null),m=C2n(),w=ut(m),k=w.data??null,v=((D=w.error)==null?void 0:D.message)??null;A.useEffect(()=>{h(null),p(null)},[e==null?void 0:e.id]);const b=I=>{o(I),p(null)},x=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=x?[...x].sort((I,$)=>+($.id===y)-+(I.id===y)):null,z=(C==null?void 0:C.filter(I=>I.configured))??[],N=(C==null?void 0:C.filter(I=>!I.configured))??[],T=I=>f.jsx(KDn,{target:I,isDefault:y===I.id,summary:I.id==="local"?k?HDn(k):v??$Bt():void 0,onOpen:I.id==="local"?void 0:()=>h(I.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${I.id}`),j=u?a==null?void 0:a.targets.find(I=>I.id===u):null;return j&&!q5.includes(j.id)?f.jsx(WDn,{target:j,isDefault:y===j.id,onBack:()=>h(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:gL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:m$t()}),f.jsx(mLn,{projectId:e==null?void 0:e.id,onViewHistory:n}),c?f.jsx("div",{className:"error",children:c}):a?f.jsxs(f.Fragment,{children:[_&&f.jsx("div",{className:"error",children:_}),f.jsx(VDn,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:iS()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:z.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:Bqt()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(QDn,{target:j,remote:r,onClose:()=>h(null)})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",gIt()]})]})}function YDn({target:e}){var x;const n=dn({mutationFn:Pyn}),[t,r]=A.useState(""),[s,i]=A.useState(!1),[a,o]=A.useState(null),c=Gz(),u=ut(c),h=u.data??null,_=a??((x=u.error)==null?void 0:x.message)??null,p=y=>{Yr(c.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,w]=A.useState(!1),k=u.isPending||m;async function v(){if(!(k||s)){w(!0),o(null);try{await Je.fetchQuery({...Gz(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{w(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||k)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!h&&k?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",ha()]}):h&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Lh()}),f.jsx("dd",{className:"m-0",children:f.jsx(Wt,{variant:h.validationStatus==="valid"?"success":h.validationStatus==="invalid"?"error":"warning",children:h.validationStatus==="valid"?Sm():h.validationStatus==="invalid"?yrn():h.validationStatus==="billingRequired"?arn():Ab()})})]}),(h==null?void 0:h.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:Jnn()})}),(h==null?void 0:h.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:drn()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||h!==null&&h.validationStatus!=="missing"?etn():Zk(),f.jsx(Ur,{type:"password",value:t,placeholder:(h==null?void 0:h.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),_&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:_}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",disabled:s||k,onClick:()=>void v(),children:[f.jsx(Qa,{size:13})," ",k?ha():km()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!t.trim()||s||k,children:s?ML():ic()})]})]})]})}function ZDn({settings:e}){return e.validationStatus==="missing"?f.jsx(Wt,{variant:"warning",children:Ab()}):e.validationStatus==="invalid"?f.jsx(Wt,{variant:"error",children:rHt()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Wt,{variant:"success",children:Sm()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Wt,{variant:"warning",children:cGt()}),f.jsx(hS,{content:dAt(),className:"text-subtext",children:f.jsx(gS,{size:15})})]}):null}function JDn({remote:e}){var x;const n=dn({mutationFn:$yn}),t=Uz(),r=ut(t),s=r.data??null,i=y=>{Yr(t.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},a=s?null:((x=r.error)==null?void 0:x.message)??null,[o,c]=A.useState(""),[u,h]=A.useState(!1),[_,p]=A.useState(!1),[m,w]=A.useState(null),k=Ry();async function v(){if(!(u||_||!s&&!a)){p(!0),w(null);try{await Je.fetchQuery({...Uz(),staleTime:0})}catch(y){w(y instanceof Error?y.message:String(y))}finally{p(!1)}}}async function b(y){if(y.preventDefault(),!(!o.trim()||u||_||!s&&!a)){h(!0),w(null);try{const C=await n.mutateAsync(o.trim());i(C),w(null),c("")}catch(C){w(C instanceof Error?C.message:String(C))}finally{h(!1)}}}return f.jsxs(f.Fragment,{children:[a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[s.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:rS()}),f.jsx("dd",{className:"m-0 text-text",children:s.username})]}),(s.validationStatus==="missing"||s.validationStatus==="invalid"||s.validationStatus==="valid"&&s.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Lh()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(ZDn,{settings:s})})]})]}),s.validationStatus==="unreachable"&&s.validationError&&f.jsx("p",{className:Ay,children:s.validationError}),s.source==="env"&&f.jsx("p",{className:Ua,children:uFt()}),s.validationStatus==="valid"&&s.jobsWrite===null&&f.jsx(lC,{note:aAt({login:"`hf auth login`",url:Ce("huggingface.co/settings/tokens")}),className:Ua,disabled:e,onRun:k.start}),f.jsx(My,{run:k.run,onComplete:()=>void r.refetch(),onClose:k.clear})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",YHt()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[s!=null&&s.configured?otn():bOt(),f.jsx(Ur,{type:"password",value:o,onChange:y=>c(y.target.value),placeholder:(s==null?void 0:s.maskedToken)??rFt(),autoComplete:"off"})]}),m&&f.jsx("div",{className:"error",children:m}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",disabled:u||_||!s&&!a,onClick:()=>void v(),children:[f.jsx(Qa,{size:13})," ",_?ha():km()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!o.trim()||u||_||!s&&!a,children:u?ML():ic()})]})]})]})}const yH=/^hf_[A-Za-z0-9]{10,}$/;function xH(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ua,children:[pZt()," ",f.jsx("code",{children:"HF_TOKEN"}),eXt()]})})})}const gR=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function U5(e,n){const t=n instanceof Error?n.message:String(n);bn(t.includes(e)?t:`${e}: ${t}`,"error")}function eLn({name:e,entry:n,onVars:t}){const r=dn({mutationFn:_=>WL(..._)}),s=dn({mutationFn:Yyn}),[i,a]=A.useState(""),[o,c]=A.useState(!1);async function u(){if(!(!i.trim()||o)){c(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(_){U5(e,_)}finally{c(!1)}}}async function h(){if(!o){c(!0);try{t(await s.mutateAsync(e))}catch(_){U5(e,_)}finally{c(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Wt,{children:KKt()})]}):f.jsx(Ur,{variant:"inline",className:"text-base",type:"password",value:i,onChange:_=>a(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),u()),_.key==="Escape"&&!o&&a("")},placeholder:zL(),"aria-label":ZJ({name:Ce(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Ft,{className:"[&:hover:not(:disabled)]:text-accent-red",title:o3({name:Ce(e)}),"aria-label":o3({name:Ce(e)}),onClick:()=>void h(),disabled:o,children:f.jsx(Ef,{size:13})}):i.trim()&&f.jsx(Oe,{size:"small",onClick:()=>void u(),disabled:o,children:o?va():ic()})})]}),!n&&e!=="HF_TOKEN"&&yH.test(i.trim())&&f.jsx(xH,{})]})}function tLn({onVars:e,onDone:n}){const t=dn({mutationFn:_=>WL(..._)}),[r,s]=A.useState(""),[i,a]=A.useState(""),[o,c]=A.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){c(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(_){U5(r.trim(),_)}finally{c(!1)}}}const h=_=>{_.key==="Enter"&&(_.preventDefault(),u()),_.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Ur,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:_=>s(_.target.value),onKeyDown:h,placeholder:"MY_API_KEY","aria-label":NUt(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Ur,{variant:"inline",className:"text-base",type:"password",value:i,onChange:_=>a(_.target.value),onKeyDown:h,placeholder:zL(),"aria-label":OUt(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Oe,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?va():ic()}),f.jsx(Ft,{title:rf(),"aria-label":uIt(),onClick:n,disabled:o,children:f.jsx(_r,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&yH.test(i.trim())&&f.jsx(xH,{})]})}function nLn(){var u;const e=N2n(),n=ut(e),t=n.data??null,r=h=>{Yr(e.queryKey,_=>(typeof h=="function"?h(_??null):h)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=A.useState(!1),o=t===null?[]:t.map(h=>h.key).filter(h=>!gR.includes(h)),c=[...gR,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:dJt()}),f.jsxs(Oe,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx($h,{size:12})," ",ZDt()]})]}),f.jsx("div",{className:rc,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-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-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[c.map(h=>f.jsx(eLn,{name:h,entry:t.find(_=>_.key===h),onVars:r},h)),i&&f.jsx(tLn,{onVars:r,onDone:()=>a(!1)})]})})})]})}const Yp=[{value:"system",label:Vnn,icon:k5n},{value:"light",label:Bnn,icon:Q5n},{value:"dark",label:Enn,icon:C5n}],rLn=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"},{id:"ar",label:"العربية"},{id:"es",label:"Español"},{id:"hi",label:"हिन्दी"}];function sLn(){const e=wf(),[n,t]=gI(),r=s=>{var h;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(_=>_===document.activeElement),u=((o===-1?Yp.findIndex(_=>_.value===n):o)+i+Yp.length)%Yp.length;t(Yp[u].value),(h=a[u])==null||h.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:GEt()}),f.jsxs("div",{className:`${rc} mt-3`,children:[f.jsxs("div",{className:`${sl} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Bz()}),f.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":Bz(),onKeyDown:r,children:Yp.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?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 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:sl,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jRt()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(ec,{choices:rLn,value:e,variant:"field",dropDown:!0,onSelect:s=>{mD(s)&&hI(s)}})})]})]})]})}const iLn={installer:Ygn,"app-bundle":Tgn,portable:_1n,cargo:Ign,homebrew:Ugn,nix:s1n,unknown:v1n},l4={cargo:C1n,homebrew:R1n,nix:B1n};function aLn(){var _;const e=dn({mutationFn:p=>Uyn(...p)}),{status:n,error:t,apply:r}=u6(),[s,i]=A.useState(null),[a,o]=A.useState(null),c=V$(n),u=s!==null||c.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:Lz()}),t?f.jsx("div",{className:rc,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]});const h=async(p,m)=>{i(p),o(null);try{await m()}catch(w){o(w instanceof Error?w.message:String(w))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:Lz()}),f.jsxs("div",{className:`${rc} mt-3`,children:[f.jsxs("div",{className:`${_f} pb-3.5`,children:[f.jsx("div",{className:"k",children:jL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:SHt()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:yL()}),f.jsx("div",{className:"v",children:iLn[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:MQt()}),f.jsx("p",{children:c.error?PL({error:c.error}):xtn({installed:Ce(n.installedVersion??"—"),current:Ce(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Oe,{size:"small",type:"button",disabled:u,onClick:c.restart,children:c.restarting?FL():BL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Mz()}),f.jsxs("p",{children:[yUt(),n.envDisabled&&Wrn()]})]}),f.jsx(dS,{type:"button",checked:n.autoUpdate,"aria-label":Mz(),disabled:u,onClick:()=>void h("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Frn({version:Ce(n.latest??"—")}):_Nt()}),f.jsx("p",{children:n.updateAvailable?WAt():RNt()})]}),f.jsx(Oe,{size:"small",type:"button",disabled:u,onClick:()=>void h("apply",()=>Hyn().then(r)),children:s==="apply"?Kk():n.updateAvailable?Orn():vNt()})]})]}):f.jsx("div",{className:sl,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:NKt()}),f.jsx("p",{children:((_=l4[n.channel])==null?void 0:_.call(l4))??den()})]})}),n.channel==="app-bundle"&&f.jsx(cLn,{busy:s,disabled:u,run:h}),a&&f.jsx("div",{className:"error",children:a})]})]})}function oLn(){var _;const e=dn({mutationFn:Bxn}),n=D2n(),t=ut(n),r=t.data??null,s=p=>{Yr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=A.useState(!1),[o,c]=A.useState(null),u=o??((_=t.error)==null?void 0:_.message)??null,h=()=>{!r||i||(a(!0),c(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>c(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:eJt()}),r?f.jsxs("div",{className:`${rc} mt-3`,children:[f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[jz(),r.locked&&r.reason&&f.jsx(hS,{content:`${U$t()} ${r.reason}.`,className:"text-subtext",children:f.jsx(gS,{size:15})})]}),f.jsx("p",{children:FUt()})]}),f.jsx(dS,{type:"button",checked:r.enabled,"aria-label":jz(),disabled:i||r.locked,onClick:h})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]})}function cLn({busy:e,disabled:n,run:t}){const r=dn({mutationFn:Gyn}),[s,i]=A.useState(null),[a,o]=A.useState(!1),c=u=>void t("cli",()=>r.mutateAsync(u).then(h=>{i(h),o(!1)}).catch(h=>{throw o(!u&&String((h==null?void 0:h.message)??h).includes("--force")),h}));return f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:OAt({command:Ce("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?azt({link:Ce(s.link)}):dzt({link:Ce(s.link)}),!s.onPath&&$Et({directory:Ce(s.dir)})]}):f.jsx("p",{children:NAt({command:Ce("orx")})})]}),f.jsx(Oe,{size:"small",type:"button",disabled:n,onClick:()=>c(a),children:e==="cli"?Kk():a?Ken():s?yen():yAt()})]})}function lLn({remote:e}){var w;const n=dn({mutationFn:k=>JL(...k)}),t=cS(),r=ut(t),s=r.data??null,i=k=>{Yr(t.queryKey,v=>(typeof k=="function"?k(v??null):k)??void 0)},[a,o]=A.useState(!1),[c,u]=A.useState(null),h=c??((w=r.error)==null?void 0:w.message)??null,_=async()=>{await r.refetch({cancelRefetch:!1})},p=Ry(),m=()=>{if(!s||a)return;const k=!s.githubForNewProjects;o(!0),u(null),n.mutateAsync([k,!0]).then(i).catch(v=>u(v instanceof Error?v.message:String(v))).finally(()=>o(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:TPt()}),s?f.jsxs("div",{className:`${rc} mt-3 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:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:IPt()}),f.jsx(Wt,{variant:s.githubAuthenticated?"success":s.ghInstalled?"warning":"error",children:s.githubAuthenticated?_L():hL()})]}),f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Rz()}),f.jsx("p",{children:EJt()})]}),f.jsx(dS,{type:"button",checked:s.githubForNewProjects,"aria-label":Rz(),disabled:a||!s.githubAuthenticated&&!s.githubForNewProjects,onClick:m})]}),!s.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(wH,{ghInstalled:s.ghInstalled,remote:e,onCheck:_,onRun:p.start})}),f.jsx(My,{run:p.run,onComplete:()=>void _(),onClose:p.clear}),h&&f.jsx("div",{className:"error",children:h})]}):h?f.jsx("div",{className:"error",children:h}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]})}function wH({ghInstalled:e,remote:n,onCheck:t,onRun:r}){const[s,i]=A.useState(!1),a=()=>{i(!0),t().finally(()=>i(!1))};return f.jsxs(f.Fragment,{children:[f.jsx(lC,{note:e?ztn():FAt(),className:"git-card-helper m-0 text-sm leading-relaxed text-text",disabled:n||!e,onRun:r}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(mh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[IFt()," ",f.jsx(of,{size:12})]}),f.jsx(Oe,{type:"button",variant:e?"warning":"default",disabled:s,onClick:a,children:s?ha():km()})]})]})}function uLn(){var m,w,k;const e=dn({mutationFn:Syn}),n=dn({mutationFn:Cyn}),t=E6n(),r=ut(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((w=r.data)==null?void 0:w.hasSession)??null,a=v=>Yr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[c,u]=A.useState(!1),[h,_]=A.useState(null),p=h??((k=r.error)==null?void 0:k.message);return f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:SL()}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:UPt()}),f.jsx("span",{className:"v",children:f.jsx(Wt,{variant:s?"success":"default",children:s===null?p?go():ha():s?$z():g3()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:MJt()}),s?f.jsx("div",{className:x0,children:f.jsx(Oe,{disabled:c,onClick:()=>{u(!0),_(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>_(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:c?Iz():Oen()})}):f.jsx(hR,{save:VL,onSaved:v=>o(v.hasToken),placeholder:PKt(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:oXt()}),f.jsx("span",{className:"v",children:f.jsx(Wt,{variant:i?"success":"default",children:i===null?p?go():ha():i?$z():g3()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:hXt()}),i?f.jsx("div",{className:x0,children:f.jsx(Oe,{disabled:c,onClick:()=>{u(!0),_(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>_(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:c?Iz():Nen()})}):f.jsx(hR,{save:v=>KL(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:d3(),createHref:"https://www.overleaf.com/project",createLabel:A1t()}),p&&f.jsx("div",{className:"error",children:p})]})}function _Ln({project:e,onProjectUpdate:n,remote:t}){var M;const r=dn({mutationFn:D=>JL(...D)}),s={...O2n((e==null?void 0:e.id)??""),enabled:!!e},i=ut(s),a=Ry(),o=i.data??null,c=D=>{Yr(s.queryKey,I=>(typeof D=="function"?D(I??null):D)??void 0)},[u,h]=A.useState(!1),[_,p]=A.useState(null),m=_??((M=i.error)==null?void 0:M.message)??null,[w,k]=A.useState(!1),[v,b]=A.useState(!1),[x,y]=A.useState(null),C=!!(o!=null&&o.github.owner&&o.github.repo),z=async()=>{await i.refetch({cancelRefetch:!1})},N=D=>{const I=D instanceof Error?D.message:String(D);return I.toLowerCase().includes("archived")?CTt():I.includes("(fetch first)")||I.includes("non-fast-forward")?RTt():I.includes("403")||I.toLowerCase().includes("permission denied")?BTt():I},T=()=>{e&&(h(!0),p(null),Lxn(e.id).then(D=>{c(D.git),n(D.project),Je.fetchQuery(cS()).then(I=>{!I.githubForNewProjects&&!I.githubDefaultPromptSeen&&k(!0)}).catch(()=>{})}).catch(D=>p(N(D))).finally(()=>h(!1)))},j=D=>{b(!0),y(null),r.mutateAsync([D,!0]).then(()=>k(!1)).catch(I=>y(I instanceof Error?I.message:String(I))).finally(()=>b(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:EQt()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:htn({project:(e==null?void 0:e.name)??Rjt()})}),e?m&&!o?f.jsx("div",{className:"error",children:m}):o?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:_qt()}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:oWt()}),f.jsx("span",{className:"v",children:o.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:o.gitVersion??ZD()}),f.jsx("span",{className:"k",children:eYt()}),f.jsx("span",{className:"v",children:o.initialized?vTt({branch:Ce(o.currentBranch??tS()),state:o.clean?JNt():JTt()}):iDt()}),f.jsx("span",{className:"k",children:ULt()}),f.jsx("span",{className:"v",children:o.baselineBranch}),f.jsx("span",{className:"k",children:bQt()}),f.jsx("span",{className:"v",children:o.remotes.length?o.remotes.map(D=>`${D.name}: ${D.url}`).join(" · "):nS()})]}),!o.initialized&&f.jsx("div",{className:x0,children:f.jsx(Oe,{variant:"primary",onClick:()=>void Dxn(e.id).then(c).catch(D=>p(String(D))),children:gFt()})})]}),f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:pL()}),f.jsx("span",{className:"v",children:f.jsx(Wt,{variant:o.github.authenticated?"success":o.github.ghInstalled?"warning":"error",children:o.github.authenticated?_L():hL()})}),f.jsx("span",{className:"k",children:xWt()}),f.jsx("span",{className:"v",children:C?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[o.github.owner,"/",o.github.repo]}),!o.github.enabled&&f.jsx(Wt,{children:NYt()})]}):f.jsx(Wt,{children:sqt()})}),o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:yYt()}),f.jsx("span",{className:"v",children:o.github.syncStatus})]})]}),!o.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(wH,{ghInstalled:o.github.ghInstalled,remote:t,onCheck:()=>z(),onRun:a.start})}),f.jsx(My,{run:a.run,onComplete:()=>void z(),onClose:a.clear}),o.github.authenticated&&!o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:C?csn():Cjt()}),f.jsxs("div",{className:x0,children:[C&&o.github.url&&f.jsxs(mh,{href:o.github.url,target:"_blank",rel:"noreferrer",children:[Dz()," ",f.jsx(of,{size:12})]}),f.jsx(Oe,{variant:"primary",disabled:u,onClick:T,children:u?S8t():g8t()})]})]}),o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:ZBt()}),f.jsxs("div",{className:x0,children:[o.github.url&&f.jsxs(mh,{href:o.github.url,target:"_blank",rel:"noreferrer",children:[Dz()," ",f.jsx(of,{size:12})]}),f.jsx(Oe,{disabled:u,onClick:()=>{h(!0),Ixn(e.id).then(D=>{c(D.git),n(D.project)}).catch(D=>p(D instanceof Error?D.message:String(D))).finally(()=>h(!1))},children:u?A8t():u8t()})]})]})]}),f.jsx(uLn,{}),m&&f.jsx("div",{className:"error",children:N(m)})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]}):f.jsx("div",{className:rc,children:f.jsx("p",{className:Ua,children:FVt()})}),w&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>j(!1),children:f.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-modal 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-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:D=>D.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:Cqt()}),f.jsx("p",{children:tZt()}),x&&f.jsx("div",{className:"error",children:x}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Oe,{disabled:v,onClick:()=>j(!1),children:cVt()}),f.jsx(Oe,{variant:"primary",disabled:v,onClick:()=>j(!0),children:v?va():qRt()})]})]})})]})}const fLn={env:yfn,config:Nfn,xdg:Ofn,default:dfn},u4={preparing:J_n,copying:__n,verifying:Ffn,finalizing:v_n},dLn=e=>{var n;return((n=u4[e])==null?void 0:n.call(u4))??e};function hLn(){var y;const e=z2n(),n=ut(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=A.useState(""),[a,o]=A.useState(!1),[c,u]=A.useState(null),[h,_]=A.useState({kind:"idle"}),[p,m]=A.useState(null);A.useEffect(()=>{t&&i(C=>C||t.current)},[t]),A.useEffect(()=>fI(C=>{C.type==="progress"?_(z=>{const N=z.kind==="moving"?z.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(_({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&_({kind:"error",message:C.error})}),[]);const w=(t==null?void 0:t.source)==="env",k=s.trim(),v=t!==null&&k===t.current;async function b(){if(!(a||!k)){o(!0),m(null),u(null);try{u(await Jyn(k))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function x(C){if(C.preventDefault(),!(h.kind==="moving"||!k||v)&&(m(null),!!window.confirm(R_n({path:Ce(k)})))){_({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await exn(k)}catch(z){_({kind:"idle"}),m(z instanceof Error?z.message:String(z))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:dYt()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:dnn()}),r?f.jsx("div",{className:rc,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:rc,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:_Bt()})}),f.jsxs("div",{className:_f,children:[f.jsx("span",{className:"k",children:I$t()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:EL()}),f.jsx("span",{className:"v",children:fLn[t.source]()})]}),!w&&f.jsxs("form",{className:cC,onSubmit:x,children:[f.jsxs("label",{children:[dUt(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:h.kind==="moving"})]}),c&&!c.error&&c.ok&&f.jsxs("p",{className:Ua,children:[eQt()," ",nl(c.treeBytes??0),c.freeBytes!=null&&` — ${C_n({size:Ce(nl(c.freeBytes))})}`,c.sameFilesystem?afn():"","."]}),c&&c.ok===!1&&c.error&&f.jsx("div",{className:"error",children:c.error}),p&&f.jsx("div",{className:"error",children:p}),h.kind==="moving"&&f.jsx(hH,{value:h.copied,max:h.total,label:dLn(h.phase),caption:h.total>0?f.jsxs("span",{className:"text-sm",children:[nl(h.copied)," / ",nl(h.total)]}):void 0}),h.kind==="done"&&f.jsxs("p",{className:Ua,children:[Jqt(),h.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",CDt({path:Ce(h.oldPathLeft)})]})]}),h.kind==="error"&&f.jsxs("div",{className:"error",children:[Vqt()," ",h.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Oe,{type:"button",onClick:b,disabled:a||!k||v||h.kind==="moving",children:a?ha():ZEt()}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!k||v||h.kind==="moving",children:h.kind==="moving"?V_n():B_n()})]})]})]}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]})}const G5=e=>e==="running"||e==="starting";function pLn(e){return G5(e.status)?R0(Date.now()-e.createdAt):e.endedAt?R0(e.endedAt-e.createdAt):"—"}function kH({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_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-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:ILt()}),f.jsx("th",{children:Lh()}),f.jsx("th",{children:KXt()}),f.jsx("th",{children:KQt()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(RS,{backend:t.backend}),r&&f.jsx(Ih,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:Oz(),"aria-label":Oz(),onClick:i=>i.stopPropagation(),children:f.jsx(of,{size:12})})]})}),f.jsx("td",{children:f.jsx(cl,{status:la(t)})}),f.jsx("td",{children:wo(t.createdAt)}),f.jsx("td",{children:pLn(t)})]},t.id)})})]})})}function mLn({projectId:e,onViewHistory:n}){var _;const t=ut({...Eu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(_=t.error)==null?void 0:_.message,i=t.isFetching,[,a]=A.useState(0);A.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},c=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>G5(p.status)).sort(c),h=r==null?void 0:r.filter(p=>!G5(p.status)).sort(c);return f.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-8",children:[f.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 [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[PQt(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Oe,{size:"small",onClick:o,disabled:i,children:[f.jsx(Qa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Cm()]}),f.jsx(Oe,{size:"small",onClick:n,children:h!=null&&h.length?jZe({count:tn(h.length)}):wZe()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!h?f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]}):f.jsx(kH,{instances:u,emptyLabel:e?tZe():pZe()})]})}function gLn({projectId:e,onBack:n}){var c;const t=ut({...Eu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(c=t.error)==null?void 0:c.message,i=t.isFetching,[,a]=A.useState(0);A.useEffect(()=>{const u=setInterval(()=>a(h=>h+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.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:n,children:[f.jsx(M0,{size:14})," ",mL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:XFt()}),f.jsxs(Oe,{size:"small",onClick:o,disabled:i,children:[f.jsx(Qa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Cm()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(kH,{instances:[...r].sort((u,h)=>h.createdAt-u.createdAt),emptyLabel:e?WYe():cZe()}):f.jsxs(Vr,{children:[f.jsx(jt,{})," ",Hu()]})]})}const SH=["projects","harnesses","storage"],vLn=[{id:"compute",label:gL,icon:f.jsx(mS,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:bL,icon:f.jsx(Cf,{size:15}),activeTabs:["environment"]},{id:"settings",label:aS,icon:f.jsx(xS,{size:15}),activeTabs:["settings",...SH]}];function bLn(e){return SH.includes(e)}function yLn({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||bLn(e),a=A.useRef(null);return A.useLayoutEffect(()=>{const o=a.current,c=o==null?void 0:o.parentElement;if(!o||!c)return;const u=()=>o.scrollIntoView({block:"start"}),h=new ResizeObserver(u);h.observe(c),u();const _=()=>h.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,_,{passive:!0});return()=>{_();for(const m of p)window.removeEventListener(m,_)}},[e,n==null?void 0:n.id]),f.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-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:aS()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:gd,children:f.jsx(sLn,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:gd,children:f.jsx(lLn,{remote:s})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:gd,children:f.jsx(ADn,{remote:s})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:gd,children:f.jsx(hLn,{})}),f.jsx("section",{className:gd,children:f.jsx(oLn,{})}),!s&&f.jsx("section",{className:gd,children:f.jsx(aLn,{})})]})]}),e==="compute"&&f.jsx(XDn,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(gLn,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:bL()}),f.jsx(nLn,{})]}),e==="git"&&f.jsx(_Ln,{project:n,onProjectUpdate:t,remote:s})]})}function ib(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function V5(e){return`${e.plugin?`${ib(e.plugin)}: `:""}${ib(e.name)}`}const CH=["plan","goal","new","resume","model","compact","copy","export"],xLn={plan:()=>Yyt(),goal:()=>DKe(),new:()=>Prt(),resume:()=>$8t(),model:()=>Ttt(),compact:()=>lTe(),copy:()=>DMe(),export:()=>j$e()};function wLn(e){return{name:e,get description(){return xLn[e]()},source:"command"}}function Dy(e){return CH.some(n=>n===e)}const ab={clear:"new",summarize:"compact"};function K5(e){const n=e.toLowerCase();return Dy(n)?n:Object.hasOwn(ab,n)?ab[n]:null}function EH(e){return Object.keys(ab).filter(n=>ab[n]===e)}function kLn(e,n){return e.name.toLowerCase().startsWith(n)||e.plugin&&`${e.plugin}:${e.name}`.toLowerCase().startsWith(n)?!0:e.source==="command"&&Dy(e.name)&&EH(e.name).some(t=>t.startsWith(n))}function _4(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?h:s}${a.slice(h.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function vR(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function NH(e){return CH.filter(n=>n!=="plan"||e)}function ELn(e,n){const t=e.filter(r=>!K5(r.name));for(const r of NH(n))t.push(wLn(r));return t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||V5(r).localeCompare(V5(s),void 0,{sensitivity:"base"}))}function f4(e){return e==="plan"||e==="goal"}function NLn(e,n){for(const t of NH(n).sort((r,s)=>+(r==="plan")-+(s==="plan"))){const r=[t,...EH(t)].join("|");if(t==="plan"){const s=new RegExp(`(^|\\s)\\/(?:${r})(?=\\s|$)`,"gi");if(s.test(e))return{name:t,prompt:e.replace(s,"").trim()}}else if(t==="goal"){const s=new RegExp(`^\\/(?:${r})(?=\\s|$)`,"i");if(s.test(e.trim()))return{name:t,prompt:e.trim().replace(s,"").trim()}}else if(new RegExp(`^\\/(?:${r})$`,"i").test(e.trim()))return{name:t,prompt:""}}return null}function d4(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}const zLn=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let jLn=null;function W5(e,n){const t=jLn??(jLn=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(ib(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}const TLn={plan:d5n,goal:GI,new:V5n,resume:VI,model:mS,compact:q3n,copy:Sf,export:Lb};function zH({name:e,className:n}){const t=Dy(e)?TLn[e]:ikn;return f.jsx(t,{size:16,strokeWidth:1.5,className:n,"aria-hidden":"true"})}function jH({name:e}){return f.jsxs(f.Fragment,{children:[f.jsx(zH,{name:e,className:"me-1 inline-block align-middle"}),ib(e)]})}function TH(e,n,t,r,s,i=!1){let a=0;return SLn(e,n).map((o,c,u)=>{var m,w;const h=a+o.text.length;a=h;const _=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,_,h,c);let p=o.text;return i||((m=u[c-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(w=u[c+1])!=null&&w.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(jH,{name:_})},c):i?f.jsx("span",{"aria-hidden":"true",children:o.text},c):f.jsx(A.Fragment,{children:p},c)})}function ALn({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=A.useRef(null),o=A.useRef(null),c=A.useRef(null),u=A.useId(),[h,_]=A.useState(!1),p=ut({...I2n(n,s,r.harness),enabled:h,subscribed:h}),m=p.data??null,w=p.isFetching,[k,v]=A.useState({}),b=()=>{c.current!==null&&window.clearTimeout(c.current),c.current=null},x=()=>{const z=a.current;if(!z)return;const N=z.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(N.left-4,window.innerWidth-T-16));v(N.top>300?{bottom:window.innerHeight-N.top+12,left:j,width:T}:{left:j,top:N.bottom+12,width:T})},y=()=>{b(),x(),_(!0)},C=()=>{b(),c.current=window.setTimeout(()=>_(!1),120)};return A.useEffect(()=>()=>b(),[]),A.useEffect(()=>{if(!h)return;const z=()=>x();return window.addEventListener("resize",z),window.addEventListener("scroll",z,!0),()=>{window.removeEventListener("resize",z),window.removeEventListener("scroll",z,!0)}},[h]),f.jsxs(A.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":h,"aria-label":IZ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:z=>{var N,T;if(z.key==="Escape"){_(!1);return}if(z.key==="Enter"||z.key===" "){z.preventDefault(),y();return}h&&(z.key==="ArrowDown"||z.key==="PageDown")&&(z.preventDefault(),(N=o.current)==null||N.scrollBy({top:z.key==="PageDown"?240:48,behavior:"smooth"})),h&&(z.key==="ArrowUp"||z.key==="PageUp")&&(z.preventDefault(),(T=o.current)==null||T.scrollBy({top:z.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:z=>{var N,T;z.preventDefault(),(N=i.current)==null||N.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(jH,{name:n})})})]}),h&&gi.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":GJ({name:n}),style:{...k,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:z=>z.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Wt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:zsn()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:w&&m===null?f.jsx("span",{className:"text-muted",children:Dsn()}):f.jsx(nc,{text:m??r.description})})]}),document.body)]})}function RLn({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:TH(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function MLn({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=A.useRef(null);return A.useLayoutEffect(()=>{const o=i.current,c=a.current;if(!o||!c)return;const u=()=>{const _=getComputedStyle(o);for(const p of zLn)c.style.setProperty(p,_.getPropertyValue(p));c.style.width=`${o.clientWidth+parseFloat(_.borderLeftWidth)+parseFloat(_.borderRightWidth)}px`};u();const h=new ResizeObserver(u);return h.observe(o),()=>h.disconnect()},[e,i]),A.useLayoutEffect(()=>{const o=i.current;if(!o)return;const c=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return c(),o.addEventListener("scroll",c),()=>o.removeEventListener("scroll",c)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[TH(e,t,"",void 0,(o,c,u,h)=>{var w;const _=e.slice(u),p=((w=/^[ \t]+/.exec(_))==null?void 0:w[0].length)??0;if(u===n||_&&!_.startsWith(` +`)&&pk.name===c);return m&&m.source!=="command"?f.jsx(ALn,{label:o,name:c,end:u,skill:m,projectId:s,textareaRef:i},`${h}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${h}:${u}`)},!0),"​"]})}function OLn({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=A.useRef(null);return A.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[f.jsx(zH,{name:i.name,className:"shrink-0"}),f.jsx("span",{className:"skill-name shrink-0",children:V5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:Hsn()})]},i.name))})}function DLn(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const Q5=6.5,bR=2*Math.PI*Q5;function LLn({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(ILn,{usage:e})}function ILn({usage:e}){const{open:n,setOpen:t,ref:r}=Xa(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":DLn(a),c=a===null?"":new Intl.NumberFormat(E(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:hMe(),onClick:()=>t(u=>!u),children:a===null?e1(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:Q5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:Q5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${bR*Math.max(a,2)/100} ${bR}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-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:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:oMe()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?xMe({value:Ce(e1(s))}):zMe({used:Ce(e1(s)),total:Ce(e1(i)),percent:Ce(c)})})]}),a!==null&&f.jsx(hH,{value:s,max:i,fillColor:o})]})]})}function $Ln(e,n,t){const r=e.map(t);return n<0?r:[...r.slice(0,n),f.jsxs("div",{role:"group","aria-label":Cz(),children:[f.jsx("div",{className:"px-2.5 pb-1 pt-2.5 text-sm font-medium text-subtext",children:Cz()}),r.slice(n)]},"from-terminal")]}function BLn({activeSessionId:e,onClose:n,onResume:t,onImport:r}){const s=A.useRef(null),i=A.useRef(null),{data:a,isPending:o,error:c}=ut(F2n()),{data:u=[]}=ut(hh()),{data:h=[]}=ut(oI()),[_,p]=A.useState(""),[m,w]=A.useState(0);Nm(s,n);const k=A.useMemo(()=>new Map(u.map(z=>[z.id,z.name])),[u]),v=A.useMemo(()=>{const z=_.trim().toLowerCase(),N=M=>!z||M.toLowerCase().includes(z),T=(a??[]).filter(M=>M.id!==e).filter(M=>N(`${M.title??""} ${k.get(M.projectId)??""} ${hu[M.harness]}`)).map(M=>({kind:"session",key:M.id,session:M})),j=h.filter(M=>N(`${M.title??""} ${M.cwd??""} ${hu[M.harness]}`)).map(M=>({kind:"native",key:`${M.harness}:${M.nativeId}`,chat:M}));return[...T,...j]},[a,h,_,e,k]),b=A.useMemo(()=>v.findIndex(z=>z.kind==="native"),[v]),x=Math.min(m,Math.max(0,v.length-1));A.useLayoutEffect(()=>{var z;(z=i.current)==null||z.scrollIntoView({block:"nearest"})},[x,v]);const y=z=>(z==null?void 0:z.split("/").filter(Boolean).at(-1))??"",C=z=>z.kind==="native"?r(z.chat):t(z.session);return gi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-start justify-center bg-modal-backdrop p-5 pt-[var(--modal-top)]",onClick:z=>{z.target===z.currentTarget&&n()},children:f.jsxs("div",{ref:s,className:"flex max-h-[calc(100vh_-_var(--modal-top)_-_1.25rem)] w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-label":Nz(),tabIndex:-1,children:[f.jsx("div",{className:"border-b border-border p-3",children:f.jsx(Ur,{"data-initial-focus":!0,value:_,placeholder:Ez(),"aria-label":Ez(),role:"combobox","aria-autocomplete":"list","aria-expanded":v.length>0,"aria-controls":"resume-options","aria-activedescendant":v[x]?`resume-option-${v[x].key}`:void 0,onChange:z=>{p(z.target.value),w(0)},onKeyDown:z=>{if(!z.nativeEvent.isComposing)if(z.key==="ArrowDown"||z.key==="ArrowUp"){if(z.preventDefault(),v.length===0)return;const N=z.key==="ArrowDown"?1:-1;w((x+N+v.length)%v.length)}else z.key==="Enter"&&v[x]&&(z.preventDefault(),C(v[x]))}})}),f.jsx("div",{id:"resume-options",className:"min-h-0 flex-1 overflow-y-auto p-1.5",role:v.length>0?"listbox":void 0,"aria-label":v.length>0?Nz():void 0,children:o?f.jsxs(Vr,{className:"px-2.5 py-2",role:"status",children:[f.jsx(jt,{})," ",Qk()]}):c&&!a?f.jsx("div",{className:"px-2.5 py-2 text-sm text-accent-red",role:"alert",children:Wk({error:Ce(c instanceof Error?c.message:String(c))})}):v.length===0?f.jsx("div",{className:"px-2.5 py-2 text-sm text-muted",role:"status",children:G8t()}):$Ln(v,b,(z,N)=>{var D;const T=z.kind==="native"?z.chat:null,j=z.kind==="session"?z.session:null;return f.jsxs(Dn,{id:`resume-option-${z.key}`,ref:N===x?i:void 0,type:"button",role:"option","aria-selected":N===x,active:N===x,tabIndex:-1,className:"gap-2.5 text-text",onMouseEnter:()=>w(N),onClick:()=>C(z),children:[f.jsx(bh,{harness:(T==null?void 0:T.harness)??(j==null?void 0:j.harness)??"claude-code"}),f.jsx("span",{dir:"auto",className:"min-w-0 flex-1 truncate",children:((D=(T==null?void 0:T.title)??(j==null?void 0:j.title))==null?void 0:D.trim())||xd()}),f.jsx("span",{dir:"auto",className:"max-w-40 shrink-0 truncate text-muted",title:(T==null?void 0:T.cwd)??void 0,children:T?y(T.cwd):k.get((j==null?void 0:j.projectId)??"")??""}),f.jsx("span",{className:"shrink-0 text-muted tabular-nums",children:wo((T==null?void 0:T.updatedAt)??(j==null?void 0:j.updatedAt)??0)})]},z.key)})})]})}),document.body)}const ob="!";function yR(e){return e.startsWith(ob)?e.slice(ob.length).trim():null}function PLn(e){return e.startsWith(ob)?e.slice(ob.length):e}function FLn(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 HLn(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function qLn(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` ${t} ${e.replace(/^\n|\n$/g,"")} @@ -1099,27 +1099,27 @@ ${n.trim()} `).replace(/[ \t]+\n/g,` `).replace(/\n{3,}/g,` -`).trim();if(!_)return null;const p=ZLn(t,e),m=Array.from(t.getClientRects()).filter(j=>j.width>0&&j.height>0),w=m[0]??t.getBoundingClientRect(),k=m.filter(j=>j.topw.top),v=k.length>0?k:[w],b=Math.min(...v.map(j=>j.left)),x=Math.max(...v.map(j=>j.right)),y=Math.min(...v.map(j=>j.top)),C=Math.max(...v.map(j=>j.bottom)),z=34,E=74,T=y>=z+h4?y-z-h4:C+h4;return{text:eIn(p,_),range:t.cloneRange(),x:Math.min(window.innerWidth-E,Math.max(E,b+(x-b)/2)),top:T}}function rIn(e,n){const[t,r]=A.useState(null),s=A.useRef(!1),i=A.useCallback(()=>{const c=e.current;r(c?nIn(c):null)},[e]);A.useEffect(()=>{let c=null;const u=()=>{s.current||i()},h=p=>{const m=e.current,w=p.target;!p.isPrimary||p.button!==0||!m||!(w instanceof Node)||!m.contains(w)||(s.current=!0,r(null))},_=p=>{!p.isPrimary||!s.current||(s.current=!1,c=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",h,!0),window.addEventListener("pointerup",_,!0),window.addEventListener("pointercancel",_,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",h,!0),window.removeEventListener("pointerup",_,!0),window.removeEventListener("pointercancel",_,!0),c!==null&&window.cancelAnimationFrame(c),s.current=!1}},[i]),A.useEffect(()=>{if(!t)return;const c=u=>{const h=u.target;h instanceof Element&&h.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",c,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",c,!0),window.removeEventListener("resize",i)}},[t,i]);const a=A.useCallback(()=>{var c;t&&(n({text:t.text,range:t.range}),r(null),(c=window.getSelection())==null||c.removeAllRanges())},[t,n]),o=A.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function sIn(e){A.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(z1);return}const t=new Highlight(...n);return CSS.highlights.set(z1,t),()=>{CSS.highlights.get(z1)===t&&CSS.highlights.delete(z1)}},[e])}function iIn({annotation:e}){const n=A.useRef(null),[t,r]=A.useState();return A.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?tIn(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx(nc,{text:t??e.text})})}function aIn({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:Qke()}),f.jsx(iIn,{annotation:t})]}),n&&f.jsx(Ft,{type:"button",size:"small","data-annotation-remove":!0,title:Z5e(),"aria-label":UZ({number:tn(r+1)}),onClick:()=>n(t.id),children:f.jsx(_r,{size:13})})]},t.id))}function _C({annotations:e,variant:n,onClear:t,onRemove:r}){const s=A.useRef(null),i=A.useRef(null),a=A.useId(),o=Xa(s),c=n==="sent",u=A.useRef(null),h=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},_=()=>{u.current=window.setTimeout(()=>{var w;(w=i.current)!=null&&w.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const w=c||!o.open;o.setOpen(w),w&&window.requestAnimationFrame(()=>{var k;return(k=i.current)==null?void 0:k.focus()})},m=w=>{r==null||r(w),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return A.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),f.jsxs("div",{className:c?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:c?h:void 0,onMouseLeave:c?_:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${c?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,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":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[f.jsx(WI,{size:c?13:14,className:"text-muted"}),e.length===1?Tve():Ape({count:tn(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:lN(),"aria-label":lN(),onClick:t,children:f.jsx(_r,{size:13})})]}),o.open&&f.jsx("div",{id:a,ref:i,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-popover p-2 text-start ${c?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":Hke(),children:f.jsx(aIn,{annotations:e,onRemove:r?m:void 0})})]})}function oIn(e){return f.jsx(_C,{...e,variant:"composer"})}const cIn=["prompt-collapsed text-muted text-base 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(" "),SR=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),lIn=["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(" "),uIn=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),Y5="prompt-actions flex flex-wrap gap-2",CR=[],_In=[],Zp={};function E_(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function m4(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function fIn(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function Ws(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function g4(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function v4(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=Pu));s++);return r}function dIn(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function Fd(...e){const n=new Set,t=new RegExp(`^${Y_}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=Pu||r++>=RH)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function Ly(e){return e.replace(/^Exit code \d+\s*/i,"").split(` +`).trim();if(!_)return null;const p=ZLn(t,e),m=Array.from(t.getClientRects()).filter(j=>j.width>0&&j.height>0),w=m[0]??t.getBoundingClientRect(),k=m.filter(j=>j.topw.top),v=k.length>0?k:[w],b=Math.min(...v.map(j=>j.left)),x=Math.max(...v.map(j=>j.right)),y=Math.min(...v.map(j=>j.top)),C=Math.max(...v.map(j=>j.bottom)),z=34,N=74,T=y>=z+h4?y-z-h4:C+h4;return{text:eIn(p,_),range:t.cloneRange(),x:Math.min(window.innerWidth-N,Math.max(N,b+(x-b)/2)),top:T}}function rIn(e,n){const[t,r]=A.useState(null),s=A.useRef(!1),i=A.useCallback(()=>{const c=e.current;r(c?nIn(c):null)},[e]);A.useEffect(()=>{let c=null;const u=()=>{s.current||i()},h=p=>{const m=e.current,w=p.target;!p.isPrimary||p.button!==0||!m||!(w instanceof Node)||!m.contains(w)||(s.current=!0,r(null))},_=p=>{!p.isPrimary||!s.current||(s.current=!1,c=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",h,!0),window.addEventListener("pointerup",_,!0),window.addEventListener("pointercancel",_,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",h,!0),window.removeEventListener("pointerup",_,!0),window.removeEventListener("pointercancel",_,!0),c!==null&&window.cancelAnimationFrame(c),s.current=!1}},[i]),A.useEffect(()=>{if(!t)return;const c=u=>{const h=u.target;h instanceof Element&&h.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",c,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",c,!0),window.removeEventListener("resize",i)}},[t,i]);const a=A.useCallback(()=>{var c;t&&(n({text:t.text,range:t.range}),r(null),(c=window.getSelection())==null||c.removeAllRanges())},[t,n]),o=A.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function sIn(e){A.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(z1);return}const t=new Highlight(...n);return CSS.highlights.set(z1,t),()=>{CSS.highlights.get(z1)===t&&CSS.highlights.delete(z1)}},[e])}function iIn({annotation:e}){const n=A.useRef(null),[t,r]=A.useState();return A.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?tIn(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx(nc,{text:t??e.text})})}function aIn({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:Qke()}),f.jsx(iIn,{annotation:t})]}),n&&f.jsx(Ft,{type:"button",size:"small","data-annotation-remove":!0,title:Z5e(),"aria-label":UZ({number:tn(r+1)}),onClick:()=>n(t.id),children:f.jsx(_r,{size:13})})]},t.id))}function _C({annotations:e,variant:n,onClear:t,onRemove:r}){const s=A.useRef(null),i=A.useRef(null),a=A.useId(),o=Xa(s),c=n==="sent",u=A.useRef(null),h=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},_=()=>{u.current=window.setTimeout(()=>{var w;(w=i.current)!=null&&w.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const w=c||!o.open;o.setOpen(w),w&&window.requestAnimationFrame(()=>{var k;return(k=i.current)==null?void 0:k.focus()})},m=w=>{r==null||r(w),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return A.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),f.jsxs("div",{className:c?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:c?h:void 0,onMouseLeave:c?_:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${c?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,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":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[f.jsx(WI,{size:c?13:14,className:"text-muted"}),e.length===1?Tve():Ape({count:tn(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:lN(),"aria-label":lN(),onClick:t,children:f.jsx(_r,{size:13})})]}),o.open&&f.jsx("div",{id:a,ref:i,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-popover p-2 text-start ${c?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":Hke(),children:f.jsx(aIn,{annotations:e,onRemove:r?m:void 0})})]})}function oIn(e){return f.jsx(_C,{...e,variant:"composer"})}const cIn=["prompt-collapsed text-muted text-base 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(" "),SR=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),lIn=["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(" "),uIn=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),Y5="prompt-actions flex flex-wrap gap-2",CR=[],_In=[],Zp={};function E_(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function m4(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function fIn(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function Ws(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function g4(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function v4(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=Pu));s++);return r}function dIn(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function Fd(...e){const n=new Set,t=new RegExp(`^${Y_}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=Pu||r++>=RH)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function Ly(e){return e.replace(/^Exit code \d+\s*/i,"").split(` `).filter(n=>!/^\s*\[orx-(?:run|experiment):[^\]]+\]\s*$/.test(n)).join(` `).trim()}function hIn(e){const n=e.changes;if(!Array.isArray(n))return null;for(const t of n){if(!t||typeof t!="object"||!("path"in t)||typeof t.path!="string")continue;const r="kind"in t?t.kind:null,s=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:t.path,type:s}}return null}function pIn(e){const n=e.trim(),t=n.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((t==null?void 0:t[1])??n).trim();return r=z9n(r),DH(r)}function DH(e){return gIn(e).replace(/[\t\r ]+/g," ").trim()}function mIn(e){let n=null,t=!1;for(let r=0;r!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&IH(s)?{ref:r,path:s}:null}function yIn(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function ER(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function xIn(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!u.startsWith("-"));if(!o)return null;const c=ER(s,o);if(!c)return null;s=c}return s?ER(s,e):e}const Fo="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",wIn=new RegExp(`\\bchat_(${Fo})\\b`,"gi"),Y_=`(?:${Fo}|[0-9a-f]{8})`;function Hd(e){const n=[];let t="",r="",s=null,i=!1;const a=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=u=>{let h=1,_=null,p=!1;for(let m=u;m{let h=!1;for(let _=u;_A9n(t.raw,n))}function $a(e,n){return Iy(e,n).length>0}function kIn(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,MH).matchAll(wIn))if(n.add(t[0].toLowerCase()),n.size>=Pu)break;return[...n]}function Z5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,MH),s=n==="runs"?[new RegExp(`/runs/(${Fo})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${Fo})`,"gi"),new RegExp(`^\\s*RUN\\s+(${Fo})\\b`,"gim"),new RegExp(`={3,}\\s*(${Fo})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${Fo})`,"gi"),new RegExp(`^\\s*id:\\s*(${Fo})`,"gim"),new RegExp(`={3,}\\s*(${Fo})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=Pu)return[...t];const i=new RegExp(`^\\s*(${Fo})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=Pu)break;return[...t]}function BH(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function PH(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function FH(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const c=o+a[0].length;c<=t&&/\bdone\b/.test(e.slice(c,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function SIn(e,n,t=[],r=[]){const s=Iy(e,"logs"),i=new Set;if(s.length===0){if(!$a(e,"logs"))return[];const o=t.length>0?[]:Z5(n,"runs");for(const c of t.length>0?t:o.length>0?o:r)if(i.add(c),i.size>=Pu)break;return Fd([...i])}let a=!1;for(const{invocation:o,offset:c}of BH(e,s)){const u=wh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const h=u.slice(1);let _=null;for(let v=0;v0?[]:Z5(n,"runs"),c=t.length>0?t:o.length>0?o:r;for(const u of c)if(i.add(u),i.size>=Pu)break}return Fd([...i])}function vd(e,n,t=[],r=[]){const s=Iy(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:c}of BH(e,s)){const u=wh(o.raw),h=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let _=!1;h&&new RegExp(`^${Y_}$`,"i").test(h)&&(i.add(h),_=!0);const p=h?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(h):null;if(p){const m=p[1],w=PH(e,m,c,Y_);if(w.length>0){for(const v of w)i.add(v);_=!0}const k=FH(e,m,c,Y_);for(const v of k)i.add(v);k.length>0&&(_=!0)}_||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:Z5(n,"experiments"),c=t.length>0?t:o.length>0?o:r;for(const u of c)if(i.add(u),i.size>=Pu)break}return Fd([...i])}const NR=new WeakMap;function ff(e){const n=N(),t=NR.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=CIn(e);return NR.set(e,{locale:n,activity:r}),r}function CIn(e){var b,x,y,C,z,E;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Ws(i,"command","cmd"),o=dIn(i,"commandArgv"),c=((x=e.state)==null?void 0:x.output)||((y=e.state)==null?void 0:y.error),u=Fd(v4(i,"targetIds")),h=Fd(v4(i,"runTargetIds")),_=Fd(v4(i,"experimentTargetIds")),p=Ws(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Ws(i,"description"),w=n.toLowerCase().split(/(?::|\.|__)+/),k=w.at(-1)??n.toLowerCase();if(k==="run"&&w.includes("web")){const T=g4(i,"search_query","q"),j=g4(i,"image_query","q"),M=g4(i,"find","pattern");return T?{kind:"web",label:GE({query:T})}:j?{kind:"web",label:Yie({query:j})}:M?{kind:"web",label:Iae({pattern:M})}:Array.isArray(i.open)?{kind:"web",label:l3e()}:Array.isArray(i.weather)?{kind:"web",label:Txe()}:Array.isArray(i.finance)?{kind:"web",label:mxe()}:Array.isArray(i.sports)?{kind:"web",label:kxe()}:Array.isArray(i.time)?{kind:"web",label:lxe()}:{kind:"web",label:oN()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["compacted","contextcompaction"],["imported","importedchat"],["subagentactivity","subagent"]]).get(k)??k){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:r5e()};const T=pIn(a??(o==null?void 0:o.join(" "))??""),j=Hd(T);let M=j.map(G=>G.raw);if(o!=null&&o.length){const G=T9n(o);M=G===null?[o]:Hd(DH(G)).map(ae=>ae.raw)}let D=null;for(const G of M)if(D=R9n(G),D)break;const I=M.some(G=>{const ae=wh(G);return ae!==null&&ae[0]!=="discover"&&ae[0]!=="paper"});if(D&&!I){const G=D.kind==="discover"?{keyword:vie(),embedding:Cie(),openalex:gae(),biorxiv:Rie(),pubmed:Sae()}[D.strategy]:null,ae=D.kind==="discover"?D.query?tne({activity:G??UE(),query:D.query}):G??UE():D.id?Pp({target:Ce(D.id)}):Are();return{kind:D.kind==="paper"?"read":"search",label:ae,litCall:D}}if($a(T,"agent\\s+spawn"))return{kind:"agent",label:p2e(),spawnedSessionIds:kIn(c),litCall:D??void 0};const $=j.map(G=>$H(G.raw)),q=$a(T,"exp\\s+status"),H=$a(T,"exp\\s+desc"),Q=Iy(T,"exp\\s+desc").some(G=>(wh(G.raw)??[]).some(ce=>ce==="--set"||ce.startsWith("--set=")||ce==="--stdin")),V=Q?Roe():Sre(),Z=Q?Eee():$se();if($a(T,"logs")){const G=SIn(T,c,h,u);return{kind:"project",label:G.length===1?Sse():Ase(),runIds:G,litCall:D??void 0}}if($a(T,"exp\\s+run"))return{kind:"project",label:NSe(),litCall:D??void 0};if($a(T,"exp\\s+wait"))return{kind:"project",label:jCe(),litCall:D??void 0};if($a(T,"exp\\s+cancel"))return{kind:"project",label:jye(),litCall:D??void 0};const Y=$a(T,"project\\s+view");if(Y&&q&&H)return{kind:"project",label:Z,experimentIds:vd(T,c,_,u),litCall:D??void 0};if(Y&&H)return{kind:"project",label:V,experimentIds:vd(T,c,_,u),litCall:D??void 0};if(Y&&q)return{kind:"project",label:cN(),experimentIds:vd(T,c,_,u),litCall:D??void 0};if(Y)return{kind:"project",label:A5e(),litCall:D??void 0};if(q&&H)return{kind:"project",label:Z,experimentIds:vd(T,c,_,u),litCall:D??void 0};if(q)return{kind:"project",label:cN(),experimentIds:vd(T,c,_,u),litCall:D??void 0};if(H)return{kind:"project",label:V,experimentIds:vd(T,c,_,u),litCall:D??void 0};if($a(T,"runs?"))return{kind:"project",label:w4e(),litCall:D??void 0};if($a(T,"projects"))return{kind:"project",label:j4e(),litCall:D??void 0};if($a(T,"compute"))return{kind:"project",label:qye(),litCall:D??void 0};const B=$.map(bIn).find(G=>G!=null);if(B){const G=m4(B.path);return{kind:G?"skill":"read",label:G?X2({name:Ce(G)}):Pp({target:Ce(E_(B.path))}),filePath:B.path,fileRef:B.ref,labelTarget:G?`${G} skill`:E_(B.path)}}const L=$.findIndex(G=>G!=null&&["sed","cat","head","tail"].includes(G.name)),F=L>=0?$[L]:null,U=F?vIn(F):null,K=U?xIn(U,j,L,Ws(i,"cwd","workdir")):null;if(U&&K){const G=m4(K);return{kind:G?"skill":"read",label:G?X2({name:Ce(G)}):Pp({target:Ce(E_(U))}),filePath:K,labelTarget:G?`${G} skill`:E_(U)}}if($.some(G=>(G==null?void 0:G.name)==="find"||(G==null?void 0:G.name)==="ls"||(G==null?void 0:G.name)==="rg"&&G.args.includes("--files")))return{kind:"search",label:vN()};const ne=$.findIndex(G=>(G==null?void 0:G.name)==="rg"||(G==null?void 0:G.name)==="grep");if(ne>=0){const G=yIn(j[ne].raw);return{kind:"search",label:G?Z2({pattern:Ce(G)}):Y2(),searchPattern:G??void 0}}const oe=$.find(G=>(G==null?void 0:G.name)==="git"),ue=oe==null?void 0:oe.args[0];if(ue==="grep"){const G=oe==null?void 0:oe.args.slice(1).find(ae=>!ae.startsWith("-"));return{kind:"search",label:G?Z2({pattern:Ce(G)}):Y2(),searchPattern:G}}if(ue==="status")return{kind:"command",label:nxe()};if(ue==="diff")return{kind:"command",label:jke()};if(ue==="log")return{kind:"command",label:S5e()};const se=G=>$.some(ae=>!ae||!["cargo","pnpm","npm","yarn"].includes(ae.name)?!1:ae.args[0]===G||ae.args[0]==="run"&&ae.args[1]===G);return se("test")?{kind:"command",label:u5e()}:$.some(G=>(G==null?void 0:G.name)==="tsc")||se("typecheck")?{kind:"command",label:Ixe()}:se("lint")?{kind:"command",label:Lye()}:se("build")?{kind:"command",label:pye()}:{kind:"command",label:rre({command:Ce(T)})}}case"skill":{const T=Ws(i,"skill","name"),j=T?fIn(n,T):null;return{kind:"skill",label:T?Lne({name:Ce(T)}):jne(),filePath:j??void 0,labelTarget:j&&T?`${T} skill`:void 0}}case"read":{const T=p?E_(p):null,j=p?m4(p):null;return j?{kind:"skill",label:X2({name:Ce(j)}),filePath:p??void 0,labelTarget:`${j} skill`}:T?{kind:"read",label:Pp({target:Ce(T)}),filePath:p??void 0,labelTarget:T}:{kind:"read",label:g5e()}}case"edit":case"write":case"notebookedit":{const T=hIn(i),j=p??(T==null?void 0:T.path)??null,M=j?E_(j):null,D=M?(T==null?void 0:T.type)==="add"?ate({target:Ce(M)}):(T==null?void 0:T.type)==="delete"?Nte({target:Ce(M)}):Fte({target:Ce(M)}):null;return M?{kind:"edit",label:D??hN(),filePath:j??void 0,labelTarget:M}:{kind:"edit",label:hN()}}case"grep":{const T=Ws(i,"pattern");return{kind:"search",label:T?Z2({pattern:Ce(T)}):Y2(),searchPattern:T??void 0}}case"glob":{const T=Ws(i,"pattern");return{kind:"search",label:T?pne({pattern:Ce(T)}):vN()}}case"websearch":{const T=Ws(i,"query"),j=Ws(i,"url"),M=Ws(i,"pattern");return T?{kind:"web",label:GE({query:T})}:M&&j?{kind:"web",label:uae({pattern:M})}:j?{kind:"web",label:Xne({target:Ce(j)})}:{kind:"web",label:m??oN()}}case"webfetch":{const T=Ws(i,"url");return{kind:"web",label:T?Pp({target:Ce(T)}):m??Xre()}}case"task":return{kind:"agent",label:m??ure()};case"subagent":return{kind:"agent",label:EIn(i)};case"error":return{kind:"command",label:lCe()};case"importedchat":return{kind:"project",label:cne()};case"contextcompaction":return{kind:"command",label:((C=e.state)==null?void 0:C.status)==="error"?Jee():((z=e.state)==null?void 0:z.status)==="running"?qE():Pee(),progressLabel:qE()};default:{const T=m??p??a??((E=e.state)==null?void 0:E.title)??"";return{kind:"command",label:T?`${n}: ${T}`:n}}}}function EIn(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return soe();case"sendInput":return Yae();case"resumeAgent":return use();case"wait":return Boe();case"closeAgent":return Mee()}switch(typeof e.kind=="string"?e.kind:""){case"started":return Coe();case"interacted":return iee();case"interrupted":return voe()}return _oe()}function cb({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(Cf,{...t});if(e.litCall)r=f.jsx(QB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx(II,{...t});break;case"read":case"project":r=f.jsx($I,{...t});break;case"search":r=f.jsx(YI,{...t});break;case"edit":r=f.jsx(bS,{...t});break;case"web":r=f.jsx(s5n,{...t});break;case"agent":r=f.jsx(kS,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function b4({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=A.useState(!1),a=A.useRef(null),o=A.useRef(!1);return A.useEffect(()=>{var c,u;!s||!o.current||(o.current=!1,(u=(c=a.current)==null?void 0:c.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((c,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Gr(h=>n(c.id,h),{stopPropagation:!0}):{onClick:h=>{h.stopPropagation(),t==null||t(c.id)}},children:c.label}):f.jsx("span",{children:c.label})]},c.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?lY({target:r}):$J({count:tn(e.length),target:r}),onClick:c=>{c.preventDefault(),c.stopPropagation(),o.current=!s&&c.detail===0,i(u=>!u)},children:s?OD():aje({count:tn(e.length)})})]})}function J5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,c,u,h;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:B9n(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(c3n,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const _=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Gr(p=>n(_,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((c=e.spawnedSessionIds)!=null&&c.length&&r){const _=e.spawnedSessionIds,p=_.slice(0,3),m=_.slice(p.length).map((w,k)=>({id:w,label:JE({number:tn(p.length+k+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((w,k)=>f.jsxs("span",{children:[k>0&&", ",f.jsx("button",{className:"tool-target",title:n3e(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(w)},children:JE({number:tn(k+1)})})]},w)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(b4,{items:m,onSelect:r,targetType:vpe()})]})]})}if((u=e.runIds)!=null&&u.length){const _=s?e.runIds.filter(w=>!!s(w)):e.runIds;if(_.length===0)return e.label;const p=_.slice(0,3),m=_.slice(p.length).map(w=>({id:w,label:(s==null?void 0:s(w))||Wc()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((w,k)=>f.jsxs("span",{children:[k>0&&", ",t?f.jsx("button",{className:"tool-target",title:uZ({run:Ce(w)}),...Gr(v=>t(w,v),{stopPropagation:!0}),children:(s==null?void 0:s(w))||Wc()}):f.jsx("span",{children:(s==null?void 0:s(w))||Wc()})]},w)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(b4,{items:m,onOpen:t,targetType:L8e()})]})]})}if((h=e.experimentIds)!=null&&h.length){const _=a?e.experimentIds.filter(w=>!!a(w)):e.experimentIds;if(_.length===0)return e.label;const p=_.slice(0,3),m=_.slice(p.length).map(w=>({id:w,label:(a==null?void 0:a(w))||Wc()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((w,k)=>f.jsxs("span",{children:[k>0&&", ",i?f.jsx("button",{className:"tool-target",title:qY({name:(a==null?void 0:a(w))||Ce(w)}),...Gr(v=>i(w,v),{stopPropagation:!0}),children:(a==null?void 0:a(w))||Wc()}):f.jsx("span",{children:(a==null?void 0:a(w))||Wc()})]},w)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(b4,{items:m,onOpen:i,targetType:ege()})]})]})}return e.label}function fC(e){const n=e.progressLabel??{skill:qne(),read:rse(),search:Uae(),edit:Wte(),project:Gse(),web:bee(),agent:yte(),command:xD()}[e.kind];return{...e,label:n}}function HH(e,n){const t=ff({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:wne(),read:gre(),search:_ie(),edit:Ote(),project:gse(),web:fee(),agent:dte(),command:Zse()}[t.kind]}function NIn(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const zIn=250;function jIn(e,n){const[t,r]=A.useState(e),s=A.useRef(Date.now()),i=A.useRef(e);return A.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=zIn-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const TIn=160;function qH(e){const[n,t]=A.useState(!1);return A.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),TIn);return()=>window.clearTimeout(r)},[e]),e&&n}function AIn(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:jD()}}function RIn(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function MIn(e){const n=[];let t=null;for(const r of e){const s=ff(r),i=RIn(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function UH({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var w,k;const i=(w=e.state)==null?void 0:w.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,c]=A.useState(Date.now());if(A.useEffect(()=>{if(typeof a!="number"||(c(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();c(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=w9n(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(jt,{}),f.jsx("span",{children:v})]})}const u=KB(i==null?void 0:i.recoveryAction),h=i==null?void 0:i.turnId,_=VB(e)?w1e():s?t9e():AN(),p=s?Z3n:wS,m=Ly(((k=e.state)==null?void 0:k.error)||AN());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:_}),f.jsx(Wa,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&h&&(u==="retry"||u==="continue")&&f.jsx(Oe,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(h,u),children:t?j9e():u==="retry"?Ys():dme()})]})}function zR({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:c}){const u=e.state,h=(u==null?void 0:u.status)==="error",_=Ly((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=h&&!!_,[m,w]=A.useState(!1),k=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(UH,{part:e,busy:!1,recovering:!1,usageLimited:u5(e)});const v=f.jsxs(f.Fragment,{children:[h&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),h?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(FI,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(cb,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${AH} ${h?"text-accent-red":"text-subtext"}`,children:[f.jsx(J5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:c}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:kY({count:tn(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":k,"aria-label":m?mY({activity:n.label}):AJ({activity:n.label}),onClick:()=>w(b=>!b),children:f.jsx(Wa,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:k,children:f.jsx("div",{className:uC,children:_.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function OIn({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,D,I;const[c,u]=A.useState(!1),[h,_]=A.useState(!1),p=()=>{_(!0),u($=>!$)},m=MIn(e),w=m.map(({activity:$})=>$),k=n?m.at(-1):void 0,v=k==null?void 0:k.part,b=k==null?void 0:k.activity,x=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&fC(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(x!=null&&x.progressLabel)&&(NIn((D=v.state)==null?void 0:D.input)||(x==null?void 0:x.kind)==="command"&&!Ws(((I=v.state)==null?void 0:I.input)??{},"command","cmd")),C=jIn(x,y),z=qH(C!=null),E=C??AIn(w),T=C?C.label:jD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(cb,{activity:C,className:z?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${z?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(J5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(zR,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(cb,{activity:E,className:z?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${z?"tool-running-shimmer":""}`,title:T,children:f.jsx(J5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":c,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":c,"aria-label":c?V0e():Kme(),children:f.jsx(Wa,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${c?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${c?"open":""}`,"aria-hidden":!c,inert:!c,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:h&&m.map(({part:$,count:q,activity:H})=>f.jsx(zR,{part:$,repeatCount:q,activity:H,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function DIn({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var h;const s=e.prompt,[i,a]=A.useState([]),o=!n,c=_=>n==null?void 0:n({promptId:e.id,..._});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:k3e(),icon:Pi,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:U3e(),icon:bS,iconClass:"text-accent-amber"}:s.approved===!1?{label:T3e(),icon:_r,iconClass:"text-accent-red"}:{label:I3e(),icon:$b,iconClass:"text-muted"},w=m.icon;return f.jsxs("details",{className:lIn,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?AD():zN()}),f.jsx(w,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Wa,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${SR} ms-6`,children:[f.jsx(nc,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const _=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,w)=>({id:`${e.id}-annotation-${w}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(_C,{annotations:p,variant:"sent"}),f.jsxs("details",{className:cIn,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||z7e()}),f.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 ${_?"chosen":""}`,children:_||w8e()})]}),f.jsxs("div",{className:SR,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var w;return f.jsx("li",{className:(w=s.answers)!=null&&w.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==_&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const _=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?p7e():zN()}),f.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 ${_?"clamped":""}`,children:f.jsx(nc,{text:s.plan??"",onOpenFile:t})}),_&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Gr(p=>r(s.plan??"",e.id,p)),children:wCe()}),!o&&!_&&f.jsxs("div",{className:Y5,children:[f.jsx(Oe,{size:"small",variant:"primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:Xve()}),f.jsx(Oe,{size:"small",onClick:()=>c({approve:!0,resumeMode:"bypassPermissions"}),children:rbe()}),f.jsx(Oe,{size:"small",onClick:()=>c({approve:!1}),children:$5e()})]})]})}if(s.kind==="permission"){const _=s.toolInput??{},p=Ws(_,"command","cmd","filePath","file_path","path")||"",m=typeof((h=s.toolInput)==null?void 0:h.reason)=="string"&&s.toolInput.reason||"",w=Ws(_,"description")||"",k=m||w||HH(s.tool,_),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(wS,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Abe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:k}),p&&f.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:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Oe,{size:"small",variant:"ghost",onClick:()=>c({approve:!1}),children:K2e()}),f.jsx(Oe,{size:"small",variant:"primary",onClick:()=>c({approve:!0}),children:Sbe()})]})]})]})}const u=_=>a(p=>s.multiSelect?p.includes(_)?p.filter(m=>m!==_):[...p,_]:[_]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:uIn,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(_=>{const p=i.includes(_.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start 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 ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(_.label):c({answers:[_.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:_.label}),_.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:_.description})]},_.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:Y5,children:f.jsx(Oe,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>c({answers:i}),children:nCe()})})]})}function LIn(e,n){return e.role==="user"?!0:e.parts.some(t=>xh(t,n))}function IIn(e){const n=e.text??"",t=n.startsWith("data:")?n:l2n(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}async function dC(e){try{if(!navigator.clipboard)throw new Error(ID());await navigator.clipboard.writeText(e),bn(tf(),"success")}catch(n){bn(n instanceof Error?n.message:String(n),"error")}}function $In(e,n){const t=URL.createObjectURL(new Blob([n],{type:"text/markdown;charset=utf-8"})),r=document.createElement("a");r.href=t,r.download=e,document.body.append(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(t),1e3)}function BIn({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:c,editDisabled:u}){const h=t>1,_=new Date(n),p=()=>dC(e);return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${h?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[h&&f.jsxs(f.Fragment,{children:[f.jsx(Ft,{size:"small",title:yN(),"aria-label":yN(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(BI,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Ft,{size:"small",title:bN(),"aria-label":bN(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Wa,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:_.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:_.toLocaleTimeString(N(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Ft,{size:"small","aria-label":Yk(),disabled:!e,onClick:p,children:f.jsx(Sf,{size:13})})]}),f.jsx(Ft,{size:"small",title:dN(),"aria-label":dN(),disabled:u,onClick:c,children:f.jsx(bS,{size:13})})]})}const PIn=A.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,busy:m=!1,recoveringTurnId:w,onRecover:k,skills:v,predictTextTail:b=!1,forkCount:x,forkIndex:y=0,forkPrevId:C,forkNextId:z,forkDisabled:E,branchDisabled:T,onFork:j,onSelectFork:M}){var Z,Y;wf();const[D,I]=A.useState(null),$=HIn(n);if($)return f.jsx(qIn,{part:$});if(n.role==="user"){const B=n.parts.filter(oe=>oe.type==="text").map(oe=>oe.text??"").join(` -`),L=oe=>!!(v!=null&&v.some(ue=>ue.name===oe)),F=n.parts.filter(oe=>oe.type==="image"&&oe.text).map(IIn),U=F.filter(oe=>!oe.isPdf),K=F.filter(oe=>oe.isPdf),ne=n.parts.filter(oe=>oe.type==="annotation"&&oe.text).map(oe=>({id:oe.id,text:oe.text??""}));if(D!==null){const oe=()=>{const ue=D.trim();!ue||E||(I(null),j(n.id,ue))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":fwe(),value:D,autoFocus:!0,onChange:ue=>I(ue.target.value),onKeyDown:ue=>{ue.key==="Escape"?(ue.preventDefault(),I(null)):ue.key==="Enter"&&!ue.shiftKey&&!ue.nativeEvent.isComposing&&(ue.preventDefault(),oe())}}),f.jsxs("div",{className:`${Y5} justify-end`,children:[f.jsx(Oe,{size:"small",onClick:()=>I(null),children:wye()}),f.jsx(Oe,{size:"small",variant:"primary",onClick:oe,disabled:E||!D.trim(),children:l3()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[ne.length>0&&f.jsx(_C,{annotations:ne,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(RLn,{text:B,isCommand:L}),U.length>0&&f.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((oe,ue)=>f.jsx("a",{href:oe.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:oe.src,alt:i0e()})},ue))}),K.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:K.map((oe,ue)=>f.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:oe.src,target:"_blank",rel:"noreferrer",children:[f.jsx($b,{size:15}),f.jsx("span",{children:oe.name})]},ue))})]}),x!==void 0&&f.jsx(BIn,{text:B,createdAt:n.createdAt,count:x,index:y,prevId:C,nextId:z,onSelect:M,pagerDisabled:T,onEdit:()=>I(B),editDisabled:E})]})}const q=n.parts.find(B=>B.type==="tool"&&u5(B)),H=n.parts.find(Mm)??q,Q=n.parts.filter(B=>B!==H&&!(q&&u5(B))),V=b&&!n.completedAt?"":GB(n);return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(FIn,{message:n,parts:Q,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,predictTextTail:b}}),H&&f.jsx(UH,{part:H,usageLimited:!!q,busy:m,recovering:w===((Y=(Z=H.state)==null?void 0:Z.input)==null?void 0:Y.turnId),onRecover:k}),V&&f.jsx("div",{className:"flex opacity-0 transition-opacity duration-80 ease-standard group-hover/turn:opacity-100 group-focus-within/turn:opacity-100",children:f.jsx(Ft,{size:"small",title:tN(),"aria-label":tN(),onClick:()=>void dC(V),children:f.jsx(Sf,{size:13})})})]})});function FIn({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=qB(n,r),[a,o]=A.useState(!1),[,c]=A.useState(0);if(A.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>c(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:iv(i,t)});const u=e.completedAt??(r?Date.now():null),h=u===null?null:u-e.createdAt,_=h===null?null:h<6e4||h>=36e5?R0(h):lNe({minutes:tn(Math.floor(h/6e4)),seconds:tn(Math.floor(h/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:_===null?nNe():mNe({duration:_})}),f.jsx(Wa,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:iv(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:iv(i,t)})]})}function HIn(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===cI?n:null}function qIn({part:e}){var c;const n=e.state,t=Ws((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((c=n==null?void 0:n.input)==null?void 0:c.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` -`),o=r?xD():s&&i!==null?M0e({code:tn(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[ED()," "]}),f.jsx(Cf,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${uC} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function iv(e,n){var x,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,predictTextTail:m=!1}=n,w=e.filter(C=>C.type!=="steer"&&xh(C,t)).at(-1),k=[];let v=[];const b=()=>{v.length!==0&&(k.push(f.jsx(OIn,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(xh(C,t)){if(C.type==="tool"&&(GIn(C.tool)||(((x=C.children)==null?void 0:x.length)??0)>0)){b(),k.push(f.jsx(KIn,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?k.push(f.jsx(nc,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(w==null?void 0:w.id)},C.id)):C.type==="steer"?k.push(f.jsx("div",{dir:"auto",role:"note","aria-label":XCe(),className:"msg-steer my-2 ms-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&&k.push(f.jsx(DIn,{part:C,onRespond:h,onOpenFile:s,onOpenPlan:_},C.id))}return b(),k}function UIn(e){return ff(e).label}function GIn(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function GH(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function lb(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&lb(t.children,n);if(r)return r}return null}function VIn({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var w,k,v,b;const o=e.children??[],c=((w=e.state)==null?void 0:w.status)==="running",u=((k=e.state)==null?void 0:k.status)==="error",h=u?Ly(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",_=iv(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:c,pendingTailToolId:c?FB(o):null}),m=o.some(x=>x.type==="text"&&!!x.text)?"":GH(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),h&&f.jsx("div",{className:uC,children:h.slice(0,2e4)}),_.length===0&&!m&&!h?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:c?Kk():H1e()}):f.jsxs(f.Fragment,{children:[_,m&&f.jsx(nc,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function KIn({part:e,pendingTail:n,onOpenSubagent:t}){var u,h,_,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=Ly(((h=e.state)==null?void 0:h.error)||((_=e.state)==null?void 0:_.output)||""),i=n&&!r?fC(ff(e)):ff(e),a=qH(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!GH(e),c=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(FI,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(cb,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${AH} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:c}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:Ive(),...Gr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[c,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Wa,{size:12})})]})}function WIn(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const c of s){const u=`${i}/${c.id}`;c.type==="tool"&&((a=c.state)!=null&&a.status)&&n.set(u,{status:c.state.status,part:c}),(o=c.children)!=null&&o.length&&r(c.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function hC(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Ws(o,"reason","description")||HH(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function QIn(e){const[n,t]=A.useState({text:"",sequence:0}),r=A.useRef(null);return A.useEffect(()=>{var w,k,v,b,x;const s=((w=e[0])==null?void 0:w.id)??"",{messageId:i,states:a}=WIn(e),o=hC(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?VE({label:ia(o.label)}):"",sequence:y.sequence+1}));return}const c=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,h=[...a].filter(([y,C])=>{var z;return((z=c.get(y))==null?void 0:z.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:VE({label:ia(o.label)}),sequence:y.sequence+1}));return}const _=(k=h.find(([,y])=>Mm(y.part)))==null?void 0:k[1].part;if((_==null?void 0:_.id)==="turn-recovery"){const y=KB((b=(v=_.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${Kce()}${y?` ${y==="retry"?fce():ice()}`:""}`,sequence:C.sequence+1}));return}if((_==null?void 0:_.id)==="turn-retry"){t(y=>({text:Zoe(),sequence:y.sequence+1}));return}const p=h.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>ff(C.part).label).join(", ");t(C=>({text:p.length===1?Mce({labels:y}):Pce({count:tn(p.length),labels:y}),sequence:C.sequence+1}));return}const m=h.filter(([,y])=>y.status==="running");if(m.length>0){const y=(x=m.at(-1))==null?void 0:x[1].part;t(C=>({text:y?fC(ff(y)).label:bce(),sequence:C.sequence+1}));return}h.some(([,y])=>y.status==="completed")&&t(y=>({text:Ece(),sequence:y.sequence+1}))},[e]),n}const XIn=A.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:c,onSelectFork:u,busy:h,onOpenFile:_,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:w,onOpenExperiment:k,experimentName:v,onRespond:b,onOpenPlan:x,onOpenSubagent:y,recoveringTurnId:C,onRecover:z,skills:E}){var B,L,F;wf();const T=((B=hC(n))==null?void 0:B.id)??null,j=A.useMemo(()=>n.filter(U=>LIn(U,T)),[n,T]),M=A.useMemo(()=>{const U=j.filter(K=>K.role==="user"&&!K.id.startsWith(W_));return p9n(a,n,U,K=>K.startsWith(W_))},[n,j,a]),D=A.useRef(new Set),[I,$]=A.useState(!1),q=A.useCallback(U=>j[U].id,[j]),H=A.useCallback(U=>{if(I)return j.map((ne,oe)=>oe);const K=new Set(BB(U));return j.forEach((ne,oe)=>{D.current.has(ne.id)&&K.add(oe)}),[...K].sort((ne,oe)=>ne-oe)},[j,I]),Q=f9n({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:q,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var U;return Math.max(0,j.length*400-(((U=t.current)==null?void 0:U.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:H});A.useLayoutEffect(()=>{const U=()=>Q.scrollToEnd();return r.current=U,i(),()=>{r.current=null}},[Q,r,i]),A.useEffect(()=>{const U=()=>{var oe;const K=window.getSelection();if(!K||K.isCollapsed||!K.rangeCount)return;const ne=K.getRangeAt(0);for(const ue of((oe=t.current)==null?void 0:oe.querySelectorAll("[data-message-id]"))??[])ne.intersectsNode(ue)&&ue.dataset.messageId&&D.current.add(ue.dataset.messageId)};return document.addEventListener("selectionchange",U),()=>document.removeEventListener("selectionchange",U)},[t]);const V=j.at(-1),Z=QIn(n),Y=h?HB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:Z.text},Z.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":I,onClick:()=>$(U=>!U),children:p9e()}),f.jsx("div",{className:"relative",style:{height:Q.getTotalSize()},children:Q.getVirtualItems().map(U=>{var se,G,ae,ce,pe,be;const K=j[U.index],ne=K.parts.find(Mm),oe=(G=(se=ne==null?void 0:ne.state)==null?void 0:se.input)==null?void 0:G.turnId,ue=ne?h||C!==null:!1;return f.jsx("div",{"data-index":U.index,"data-message-id":K.id,ref:Q.measureElement,className:"absolute left-0 w-full pb-4",style:{top:U.start},onClickCapture:Ae=>{!(Ae.target instanceof Element)||!Ae.target.closest("[data-work-toggle]")||(s.current=!1,Q.setOptions({...Q.options,anchorTo:"start"}))},onPointerDownCapture:()=>D.current.add(K.id),onFocusCapture:()=>D.current.add(K.id),children:f.jsx(PIn,{message:K,forkCount:(ae=M.get(K.id))==null?void 0:ae.count,forkIndex:(ce=M.get(K.id))==null?void 0:ce.index,forkPrevId:(pe=M.get(K.id))==null?void 0:pe.prevId,forkNextId:(be=M.get(K.id))==null?void 0:be.nextId,forkDisabled:!o,branchDisabled:h,onFork:c,onSelectFork:u,activePermissionId:T,pendingTailToolId:(Y==null?void 0:Y.messageId)===K.id?Y.toolId:null,onOpenFile:_,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:w,onOpenExperiment:k,experimentName:v,onRespond:b,onOpenPlan:x,onOpenSubagent:y,busy:ue,recoveringTurnId:oe===C?C:null,onRecover:z,skills:E,predictTextTail:h&&K===V&&K.role==="assistant"})},K.id)})})]})}),YIn=(e,n)=>e==="all"?!0:e==="archived"?n:!n,VH=[{id:"active",label:ube,railLabel:RD},{id:"archived",label:iN,railLabel:iN},{id:"all",label:gbe,railLabel:CD}];function ZIn({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=Xa();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Ft,{size:"small",className:"rail-filter-btn",active:e!=="active",title:gN(),"aria-label":gN(),onClick:()=>r(i=>!i),children:f.jsx(ZI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:VH.map(i=>f.jsxs(Dn,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Pi,{size:13})]},i.id))})]})}const JIn=14,e$n=500,t$n=1200;function KH({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.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*JIn,e$n)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function n$n({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:c,onDelete:u}){var z;const{open:h,setOpen:_,ref:p}=Xa(),m=((z=e.title)==null?void 0:z.trim())||"Untitled",[w,k]=A.useState(!1),[v,b]=A.useState(""),x=A.useRef(null);function y(){var E;b(((E=e.title)==null?void 0:E.trim())||""),k(!0)}function C(){var T;const E=v.trim();k(!1),E&&E!==(((T=e.title)==null?void 0:T.trim())||"")&&o(E)}return A.useEffect(()=>{var E,T;w&&((E=x.current)==null||E.focus(),(T=x.current)==null||T.select())},[w]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.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]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.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-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]: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-dot]:hidden ${n?"active":""} ${t?"unread":""} ${h?"menu-open":""} ${w?"editing":""}`,title:`${hu[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?w9e():""}`,onClick:()=>{w||(h?_(!1):a())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),h?_(!1):a())},children:[e.parentSessionId&&!w&&f.jsx(kS,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),w?f.jsx("input",{ref:x,className:"session-title-input","aria-label":hSe(),value:v,onChange:E=>b(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))}}):f.jsx("span",{className:"session-title",children:f.jsx(KH,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:CN(),"aria-label":CN(),onClick:E=>{E.stopPropagation(),_(T=>!T)},children:f.jsx(Ib,{size:14})}),h&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(Dn,{onClick:E=>{E.stopPropagation(),_(!1),y()},children:f.jsx("span",{children:zD()})}),f.jsx(Dn,{onClick:E=>{E.stopPropagation(),_(!1),c(!e.archived)},children:f.jsx("span",{children:e.archived?LEe():$pe()})}),f.jsx(Dn,{danger:!0,onClick:E=>{E.stopPropagation(),_(!1),u()},children:f.jsx("span",{children:ND()})})]})]})}const jR=[$I,YI,Cf,gh],r$n=()=>[{title:FSe(),prompt:OSe()},{title:t6e(),prompt:WSe()},{title:p6e(),prompt:c6e()},{title:j6e(),prompt:w6e()}],y4=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],TR="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function s$n({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:c,runExperimentName:u,onOpenExperiment:h,experimentName:_,onOpenPlan:p,onOpenSubagent:m,runtime:w,onOpenDemoWelcome:k,composerFocusNonce:v=0,demoRunningRunId:b=null,activeSessionId:x,onActiveSessionChange:y,preferredAgent:C,onPreferredAgentChange:z,children:E}){var Cs,Dl,Es,r_,$f,Bf,$r;const T=dn({mutationFn:te=>i2n(...te)}),j=dn({mutationFn:te=>r2n(...te)}),M=dn({mutationFn:te=>s2n(...te)}),D=dn({mutationFn:te=>Yxn(...te)}),I=dn({mutationFn:te=>Jxn(...te)}),$=dn({mutationFn:te=>t2n(...te)}),q=dn({mutationFn:te=>n2n(...te)}),H=dn({mutationFn:e2n}),Q=A.useMemo(()=>Ga(e),[e]),{data:V=_In}=ut(Q),Z=A.useCallback(te=>{Yr(Q.queryKey,ge=>{if(!ge)return;const Ee=typeof te=="function"?te(ge):te,Ie=new Map(ge.map(Pe=>[Pe.id,Pe]));for(const Pe of Ee)Ie.get(Pe.id)!==Pe&&_o(Je,Q.queryKey,Pe.id),Ie.delete(Pe.id);for(const Pe of Ie.keys())_o(Je,Q.queryKey,Pe);return Ee})},[Q]),Y=x,B=A.useRef(y);B.current=y;const L=A.useRef({projectId:e});L.current.projectId!==e&&(L.current={projectId:e});const[F,U]=A.useState(new Set),[K,ne]=A.useState("active"),[oe,ue]=A.useState(""),[se,G]=A.useState(!1),[ae,ce]=A.useState(!1),[pe,be]=A.useState([]),Ae=A.useRef(0),De=A.useRef({projectId:e,activeId:Y,mainView:i});(De.current.projectId!==e||De.current.activeId!==Y||De.current.mainView!==i)&&(De.current={projectId:e,activeId:Y,mainView:i});const[We,Ne]=A.useState([]),[xe,rt]=A.useState(null),Ze=Y??"new",ct=A.useRef(new Map),Ct=A.useRef(kw);Ct.current={draft:oe,attachments:We,annotations:pe};const qt=e===Fp&&V.length>0&&V.every(te=>Hbn[te.id]===te.activeLeafId)?Hz:null,dt=A.useRef(null);qt!==null&&dt.current===null&&Y!==null&&(dt.current=Ze);const ht=Ze===dt.current?qt:null;A.useLayoutEffect(()=>{const te=ct.current.get(Ze)??kw;return Ct.current=te,ue(te.draft),Ne(te.attachments),be(te.annotations),()=>{const ge=C9n(Ct.current,ht);ge?ct.current.set(Ze,ge):ct.current.delete(Ze)}},[Ze,ht]);const[Le,me]=A.useState(null),Te=A.useRef(Promise.resolve()),He=A.useRef(0),nt=A.useRef(0),[_t,St]=A.useState(null),yt=A.useRef(null),Zt=A.useRef(!1),un=A.useRef(null),[At,pt,mt]=V2n(e,i==="chat"?Y:null),{data:_n=a$n}=ut(Mu()),[us,xr]=A.useState(C);A.useEffect(()=>xr(C),[C]);const[Qt,Mn]=A.useState({}),[mr,gr]=A.useState(Zp),[_s,Et]=A.useState(null),fn=A.useRef(!1),an=A.useRef(null),[xn,Ir]=A.useState(null),mn=A.useRef(!1),gn=A.useRef(null),[Ln,Nt]=A.useState(new Map),Ot=A.useRef(new Map),Hn=A.useRef(null),zr=A.useRef(null),nr=A.useRef(null),On=A.useRef(!0),[hr,jr]=A.useState(!0),In=A.useRef(null),[Ke,gt]=A.useState(!1),Zr=Xa(),Wn=A.useCallback(te=>{var ge;Ae.current+=1,be(Ee=>[...Ee,{id:`annotation-${Ae.current}`,...te}]),(ge=In.current)==null||ge.focus()},[]),wn=rIn(zr,Wn);sIn(pe),A.useEffect(()=>{gt(!1),wn.dismiss()},[Y,e,wn.dismiss]);const[Qn,rr]=A.useState(0),[As,Tr]=A.useState(!1),[cr,xl]=A.useState(0),[Ya,Jr]=A.useState(0),Rs=A.useRef(!1);function Za(te){if(!Kr)return;if(!ni&&te.source==="command"&&Dy(te.name)&&te.name!=="goal"){zo(te.name,oe,Kr);return}const ge=te.source==="command"?1:W5(te.name,In.current),Ee=CLn(oe,Kr,te.name,ge);ue(Ee.text),window.requestAnimationFrame(()=>{var Ie,Pe;(Ie=In.current)==null||Ie.focus(),(Pe=In.current)==null||Pe.setSelectionRange(Ee.cursor,Ee.cursor),Jr(Ee.cursor)})}function Eo(te){if(Gi)return!1;const ge=te.selectionStart;if(Rs.current||ge!==te.selectionEnd)return!1;const Ee=oe.slice(0,ge).replace(/[ \t]+$/,"").length,Ie=_4(oe,Ee);if(!Ie||Ie.end!==Ee||!kl(Ie.query)||ge>Ee&&ge-Ee!==W5(Ie.query,te))return!1;const Pe=vR(oe,{...Ie,end:ge});return ue(Pe.text),Jr(Pe.cursor),window.requestAnimationFrame(()=>te.setSelectionRange(Pe.cursor,Pe.cursor)),!0}function wa(te){rt(null);let Ie=We.reduce((Pe,Yt)=>Pe+Yt.size,0);for(const Pe of te){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Pe.type))continue;if(Pe.size>31457280){rt(f0e({name:Ce(Pe.name)}));continue}if(Ie+Pe.size>41943040){rt(b0e());continue}Ie+=Pe.size;const Yt=Y,vn=new FileReader;vn.onload=()=>{const hn={dataUrl:vn.result,mediaType:Pe.type,name:Pe.name,size:Pe.size};if(De.current.activeId===Yt){Ne(he=>[...he,hn]);return}const J=ct.current.get(Yt??"new")??kw;ct.current.set(Yt??"new",{...J,attachments:[...J.attachments,hn]})},vn.readAsDataURL(Pe)}}function Ps(te){const ge=Array.from(te.clipboardData.items).filter(Ee=>Ee.kind==="file"&&(Ee.type.startsWith("image/")||Ee.type==="application/pdf")).map(Ee=>Ee.getAsFile()).filter(Ee=>Ee!==null);ge.length>0&&(te.preventDefault(),wa(ge))}const $t=V.find(te=>te.id===Y),qi=us??ESn(_n),Xn=$t?{harness:$t.harness,model:Qt.model??$t.model,serviceTier:Qt.serviceTier!==void 0?Qt.serviceTier:$t.serviceTier,permissionMode:Qt.permissionMode??$t.permissionMode,reasoningLevel:Qt.reasoningLevel??$t.reasoningLevel}:qi?{...qi,...Qt}:null,{data:Ar=i$n}=ut(L2n(Xn==null?void 0:Xn.harness)),st=Xn?_n.find(te=>te.id===Xn.harness):void 0,Jt=st==null?void 0:st.options,vi=A.useMemo(()=>ELn(Ar,Jt==null?void 0:Jt.planActivation),[Ar,Jt==null?void 0:Jt.planActivation]),bi=yR(oe),yi=bi!==null,Kr=_4(oe,Ya),Wr=(Kr==null?void 0:Kr.query)??null,Ui=Wr===null?[]:vi.filter(te=>kLn(te,Wr)),Gi=!yi&&Wr!==null&&(Kr==null?void 0:Kr.end)===Ya&&Ui.length>0,Fs=Gi&&!As?Ui:[],Rr=Fs.length>0,ei=Math.min(Qn,Math.max(0,Fs.length-1));A.useEffect(()=>rr(0),[Wr]);const xi=Xn&&st&&!st.catalogPending&&st.models.length>0&&!st.models.some(te=>te.id===Xn.model)?st.models[0].id:(Xn==null?void 0:Xn.model)??null,Vt=Xn&&{...Xn,model:xi,serviceTier:Rv(st,xi,Xn.serviceTier),reasoningLevel:nI(st,xi,Xn.reasoningLevel)},wi=Db(st,Vt==null?void 0:Vt.model),dc=te=>{if(!Vt)return;const ge={...Vt,...te},Ee={};te.model!==void 0&&te.model!==Vt.model&&(Ee.model=te.model),te.serviceTier!==void 0&&te.serviceTier!==Vt.serviceTier&&(Ee.serviceTier=te.serviceTier),te.permissionMode!==void 0&&te.permissionMode!==Vt.permissionMode&&(Ee.permissionMode=te.permissionMode),te.reasoningLevel!==void 0&&te.reasoningLevel!==Vt.reasoningLevel&&(Ee.reasoningLevel=te.reasoningLevel),gr(Ie=>({...Ie,...Ee})),xr(ge),z(ge).catch(()=>{}),$t?Mn(Ie=>({...Ie,...te})):te.harness&&te.harness!==Vt.harness&&Mn({})},Yn=A.useCallback(te=>{const ge=Te.current.catch(()=>{}).then(()=>{if(!Fn(Q.queryKey))throw new DOMException("Workspace changed","AbortError");return te()});return Te.current=ge.then(()=>{},()=>{}),ge},[Q]),es=te=>{if(te==="plan"&&(st==null?void 0:st.id)==="claude-code"?(gr(Ie=>({...Ie,permissionMode:te})),Mn(Ie=>({...Ie,permissionMode:te}))):(Mn(Ie=>{const Pe={...Ie};return delete Pe.permissionMode,Pe}),dc({permissionMode:te})),!$t)return;const ge=$t.id,Ee=++He.current;me(null),Yn(()=>T.mutateAsync([ge,te])).then(Ie=>{Z(Pe=>Pe.map(Yt=>Yt.id===Ie.id?Ie:Yt)),He.current===Ee&&Mn(Pe=>{const Yt={...Pe};return delete Yt.permissionMode,Yt})}).catch(()=>{He.current===Ee&&(Mn(Ie=>{const Pe={...Ie};return delete Pe.permissionMode,Pe}),me(QEe()))})},ki=te=>dc({reasoningLevel:te}),ks=((Cs=$t==null?void 0:$t.goal)==null?void 0:Cs.trim())||"",Vi=(Vt==null?void 0:Vt.harness)==="claude-code"?Vt.permissionMode==="plan":(Jt==null?void 0:Jt.planActivation)==="command"?_t??($t==null?void 0:$t.planMode)??!1:!1;A.useEffect(()=>{_t===null||($t==null?void 0:$t.planMode)!==_t||(yt.current=null,St(null))},[$t==null?void 0:$t.planMode,_t]);async function Hs(te){if(gr(Ie=>({...Ie,planMode:te})),yt.current=te,St(te),!$t)return;const ge=$t.id,Ee=++nt.current;me(null);try{const Ie=await Yn(()=>j.mutateAsync([ge,te]));Z(Pe=>Pe.map(Yt=>Yt.id===Ie.id?Ie:Yt)),nt.current===Ee&&(yt.current=null,St(null),me(null))}catch(Ie){throw nt.current===Ee&&(yt.current=null,St(null)),Ie}}async function Qu(){if((Vt==null?void 0:Vt.harness)==="claude-code"){es("auto");return}if($t)try{await Hs(!1)}catch{me(Pme())}}async function hc(){const te=!Vi;try{if((Vt==null?void 0:Vt.harness)==="claude-code")es(te?"plan":"auto");else if((Jt==null?void 0:Jt.planActivation)==="command")await Hs(te);else throw new Error(Yg())}catch{me(TN())}}function Ja(te,ge=""){var Ee;switch(te){case"plan":return hc(),!1;case"new":return Ni(),!1;case"resume":return gt(!0),!0;case"model":return xl(Ie=>Ie+1),!0;case"compact":return Xu(),!1;case"goal":return Si(ge),!1;case"copy":{const Ie=pr.at(-1),Pe=sr&&(Ie==null?void 0:Ie.role)==="assistant"&&!Ie.completedAt,Yt=b9n(Pe?pr.slice(0,-1):pr);return Yt?dC(Yt):bn(mve(),"info"),!1}case"export":{const Ie=((Ee=$t==null?void 0:$t.title)==null?void 0:Ee.trim())||xd(),Pe=$t?y9n(Ie,pr,{user:oge(),assistant:hu[$t.harness]}):null;return Pe?$In(x9n(Ie),Pe):bn(kve(),"info"),!1}}}async function No(te){me(null);const ge=L.current;try{const Ee=await D.mutateAsync([e,te]);if(Je.invalidateQueries({queryKey:oI().queryKey}),L.current!==ge)return;Z(Ie=>[Ee,...Ie.filter(Pe=>Pe.id!==Ee.id)]),ne("all"),y(Ee.id,{projectId:Ee.projectId})}catch(Ee){if(L.current!==ge)return;me(t1e({error:Ce(Ee instanceof Error?Ee.message:String(Ee))}))}}async function Si(te){var vn;const ge=te.trim();if(!ge){const hn=(vn=$t==null?void 0:$t.goal)==null?void 0:vn.trim();bn(hn?xge({goal:ia(hn)}):Oge(),"info");return}const Ee=De.current,Ie=()=>De.current.activeId===Ee.activeId;me(null);let Pe=Y;if(!Pe){if(!(st!=null&&st.agentReady)||!Vt){me(Yg());return}try{Pe=(await Na(Vt,d4(Jt==null?void 0:Jt.planActivation,void 0,yt.current))).id}catch(hn){me(nN({error:Ce(hn instanceof Error?hn.message:String(hn))}));return}}const Yt=/^(clear|none|off)$/i.test(ge);try{const hn=await Yn(()=>M.mutateAsync([Pe,Yt?null:ge]));Z(J=>J.map(he=>he.id===hn.id?hn:he)),bn(Yt?hge():Fge(),"success")}catch(hn){if(!Ie())return;me(nN({error:Ce(hn instanceof Error?hn.message:String(hn))}))}}async function Xu(){const te=Y;if(!te){bn(lve(),"info");return}if(sr){me(J0e());return}me(null),K==="archived"&&ne("active");const ge=De.current;try{const{message:Ee}=await u2n(te);pt({type:"upsertMessage",sessionId:te,message:Ee})}catch(Ee){if(De.current.activeId!==ge.activeId)return;me(ame({error:Ce(Ee instanceof Error?Ee.message:String(Ee))}))}}function zo(te,ge,Ee){const Ie=vR(ge,Ee);ue(Ie.text),Tr(!0),!Ja(te)&&window.requestAnimationFrame(()=>{var Pe,Yt;(Pe=In.current)==null||Pe.focus(),(Yt=In.current)==null||Yt.setSelectionRange(Ie.cursor,Ie.cursor),Jr(Ie.cursor)})}const qs=A.useCallback(async(te=!1)=>{const ge=L.current;if(ge.projectId!==e||!Fn(Q.queryKey))return null;const Ee=(Je.getQueryData(Q.queryKey)??[]).map(Ie=>Ie.id);try{const Ie=await Je.fetchQuery({...Q,...te?{staleTime:0}:{}});if(L.current!==ge||!Fn(Q.queryKey))return null;const Pe=Ie.filter(vn=>!_l.has(vn.id)),Yt=new Set(Pe.map(vn=>vn.id));for(const vn of Ee)Yt.has(vn)||n_(vn);return Ot.current=new Map(Pe.map(vn=>[vn.id,vn.title])),Pe}catch{return null}},[e]),fs=A.useCallback(async te=>{L.current.projectId!==e||!Fn(Q.queryKey)||await Promise.all([Je.fetchQuery({...ol(te),staleTime:0}),qs(!0)]).catch(()=>{})},[e,qs]);A.useEffect(()=>{const te=_$();U(e===Fp?new Set([Rb,Mb].filter(Ee=>!te.has(Ee))):new Set),G(!1),ce(!1),Nt(new Map),Ot.current=new Map,qs();const ge=L.current;return()=>{L.current===ge&&(L.current={projectId:e})}},[e,qs]),A.useEffect(()=>{gr(Zp),gn.current=null},[Y]),A.useEffect(()=>Ov(te=>{switch(te.type){case"session":{if(te.session.projectId!==e||_l.has(te.session.id))return;const ge=Ot.current.has(te.session.id),Ee=Ot.current.get(te.session.id)!==te.session.title;Ot.current.set(te.session.id,te.session.title),ge&&Ee&&te.session.titleSource==="generated"&&(Nt(Ie=>{const Pe=new Map(Ie);return Pe.set(te.session.id,(Ie.get(te.session.id)??0)+1),Pe}),window.setTimeout(()=>{Nt(Ie=>{if(!Ie.has(te.session.id))return Ie;const Pe=new Map(Ie);return Pe.delete(te.session.id),Pe})},t$n));break}case"sessionDeleted":n_(te.sessionId);break}}),[e]),A.useEffect(()=>Ov(te=>{te.type==="reconnected"&&qs(!0)}),[qs]);const Ki=Y?At.messagesBySession[Y]??CR:CR,ka=Y?At.activeLeafBySession[Y]??null:null;an.current=ka;const pr=A.useMemo(()=>d9n(Ki,ka),[Ki,ka]),pc=A.useRef({projectId:e,ids:At.busySessions});A.useEffect(()=>{const te=pc.current;pc.current={projectId:e,ids:At.busySessions},te.projectId===e&&U(ge=>v9n(ge,te.ids,At.busySessions,V,i==="chat"?Y:null))},[e,At.busySessions,V,Y,i]);const sr=Y?At.busySessions.has(Y):!1,Mf=!sr&&!!(st!=null&&st.agentReady),mc=sr&&HB(pr)!=null,wl=sr&&g9n(pr),Ci=Y?At.queuedBySession[Y]??[]:[],ds=Ci.some(te=>te.dispatchState==="retrying"),eo=Ci.findIndex(te=>te.dispatchState==="blocked"),Wi=Ci.reduce((te,ge)=>ge.dispatchState!=="retrying"||typeof ge.nextRetryAt!="number"?te:te===null?ge.nextRetryAt:Math.min(te,ge.nextRetryAt),null),[to,Of]=A.useState(()=>Date.now());A.useEffect(()=>{if(!ds||Wi===null||(Of(Date.now()),Wi<=Date.now()))return;const te=window.setInterval(()=>{const ge=Date.now();Of(ge),ge>=Wi&&window.clearInterval(te)},1e3);return()=>window.clearInterval(te)},[ds,Wi]),A.useEffect(()=>{const te=Ci.reduce((ge,Ee)=>Ee.planMode??ge,void 0);te!==void 0?(Zt.current=!0,yt.current=te,St(te)):Zt.current&&(Zt.current=!1,yt.current=null,St(null))},[Ci]);const on=!!Y&&!(Y in At.messagesBySession)&&mt.isPending,Qi=A.useMemo(()=>{const te=new Set;for(const ge of At.busySessions)(At.messagesBySession[ge]??[]).some(Ee=>Ee.parts.some(Ie=>Ie.type==="prompt"&&Ie.prompt&&!Ie.prompt.resolved&&Ie.prompt.nativeId))&&te.add(ge);return te},[At.busySessions,At.messagesBySession]),ti=Y?Qi.has(Y):!1,Zn=$t,Yu=Zn?Ln.get(Zn.id):void 0,Ss=A.useMemo(()=>{var te;for(let ge=pr.length-1;ge>=0;ge--)for(const Ee of pr[ge].parts)if(Ee.type==="prompt"&&((te=Ee.prompt)==null?void 0:te.kind)==="plan"&&!Ee.prompt.resolved)return{promptId:Ee.id,plan:Ee.prompt.plan??"",synthesized:!!Ee.prompt.synthesized};return null},[pr]),ni=A.useMemo(()=>Y?m9n(pr,Zn==null?void 0:Zn.harness,At.busySessions.has(Y)):null,[pr,Zn==null?void 0:Zn.harness,Y,At.busySessions]),Ei=yi&&!ni,kl=te=>{if(ni||yi)return!1;const ge=K5(te),Ee=vi.find(Ie=>Ie.name===(ge??te));return!Ee||Ee.source!=="command"?!!Ee:ge&&f4(ge)?ge==="plan"||oe.trim().toLowerCase().startsWith(`/${te}`):oe.trim().toLowerCase()===`/${te}`},Zu=A.useMemo(()=>vi.filter(te=>te.source!=="command"),[vi]),[Sa,Df]=A.useState(null),jo=Sa&&Sa.sessionId===Y?Sa:null;A.useEffect(()=>{if(!Sa)return;const te=At.busySessions.has(Sa.sessionId),ge=Sa.sessionId===Y&&Ss&&Ss.promptId!==Sa.promptId;(!te||ge)&&Df(null)},[Sa,Ss,At.busySessions,Y]);const Qh=A.useMemo(()=>hC(pr),[pr]),ri=sr&&!!(st!=null&&st.supportsSteering)&&!!(st!=null&&st.agentReady)&&!Ss&&!ni&&!Qh&&We.length===0&&pe.length===0,gc=A.useMemo(()=>p&&Y?(te,ge,Ee)=>p(te,Y,ge,Ee):void 0,[p,Y]),Xh=A.useMemo(()=>m&&Y?(te,ge,Ee)=>m(Y,te,ge,Ee):void 0,[m,Y]),vc=A.useMemo(()=>o&&((te,ge,Ee,Ie,Pe)=>o(te,Y??void 0,ge,Ee,Ie,Pe)),[o,Y]);A.useEffect(()=>{He.current+=1,nt.current+=1;const te=(Y?At.queuedBySession[Y]??[]:[]).reduce((ge,Ee)=>Ee.planMode??ge,void 0);Zt.current=te!==void 0,yt.current=te??null,St(te??null),Mn({}),me(null)},[Y]);const Sl=i==="chat"&&(pr.length>0||sr),Ca=(Vt==null?void 0:Vt.harness)??null,Lf=(Vt==null?void 0:Vt.model)??null,Cl=mt.data?null:mt.error,Ju=i==="chat"&&!Sl&&!on&&!Cl,El=ut({...uwn(e,Ca??"claude-code",Lf,N()),enabled:Ju&&Ca!==null,subscribed:Ju&&Ca!==null}),Ea=(Dl=El.data)!=null&&Dl.blank?r$n():((Es=El.data)==null?void 0:Es.prompts)??null,Nl=Ca!==null&&El.isPending,bc=e===Fp?"demo":"project",Yh=te=>{ue(te),Tr(!1),window.requestAnimationFrame(()=>{const ge=In.current;ge&&(ge.focus(),ge.setSelectionRange(te.length,te.length),Jr(te.length))})};A.useEffect(()=>{ht&&(ue(te=>te||ht),Tr(!1),Jr(ht.length))},[ht]),A.useEffect(()=>{if(v===0)return;const te=window.requestAnimationFrame(()=>{const ge=In.current;ge&&(ge.focus(),ge.setSelectionRange(ge.value.length,ge.value.length),ge.scrollIntoView({block:"nearest"}))});return()=>window.cancelAnimationFrame(te)},[v]);const e_=A.useId(),si=e===Fp&&oe===Hz&&!se,Zh=A.useCallback(te=>{const ge=te.scrollHeight-te.scrollTop-te.clientHeight<60;On.current=ge,jr(ge)},[]),no=A.useCallback(()=>{var te;On.current=!0,jr(!0),(te=nr.current)==null||te.call(nr)},[]);A.useEffect(()=>{const te=Hn.current,ge=zr.current;if(!te||!ge)return;const Ee=new ResizeObserver(()=>{var Ie;On.current?(Ie=nr.current)==null||Ie.call(nr):jr(te.scrollHeight-te.scrollTop-te.clientHeight<60)});return Ee.observe(te),Ee.observe(ge),()=>Ee.disconnect()},[Sl]);const Jh=A.useCallback(te=>{te.currentTarget.blur(),no()},[no]);async function zl({queue:te=!1}={}){var wc,kc,Pf,zi,s_,ai;const ge=oe.trim(),Ee=ni?null:NLn(ge,Jt==null?void 0:Jt.planActivation);if(Ee&&Ee.name!=="plan"){ue(f4(Ee.name)?"":Ee.prompt),Tr(!1),Ja(Ee.name,Ee.prompt);return}if(du({name:"first_action",surface:bc,action:"typed_prompt"}),mn.current)return;const Ie=!!Ee,Pe=!Vi,Yt=d4(Jt==null?void 0:Jt.planActivation,Ie?Pe:void 0,yt.current),vn=Ie&&(st==null?void 0:st.id)==="claude-code"?Pe?"plan":"auto":void 0,hn=Ee?Ee.prompt:ge,J=We,he=pe,je=he.map(zn=>({text:zn.text})),Be=e,Me=i;let it=Y;const at=()=>{const zn=De.current;return Fn(Q.queryKey)&&zn.projectId===Be&&zn.activeId===it&&zn.mainView===Me},Bt=()=>{at()&&(ue(zn=>zn||ge),Ne(zn=>zn.length?zn:J),be(zn=>zn.length?zn:he))};if(Ie&&!hn&&J.length===0&&he.length===0){ue(""),Tr(!1);try{if((st==null?void 0:st.id)==="claude-code")es(Pe?"plan":"auto");else if((Jt==null?void 0:Jt.planActivation)==="command")await Hs(Pe);else throw new Error(Yg())}catch{me(TN()),Bt()}return}const Kt=Vt?{...Vt,...vn?{permissionMode:vn}:{}}:null;vn&&es(vn);let Ns=null;const Os=yt.current;Ie&&(Jt==null?void 0:Jt.planActivation)==="command"&&(Ns=++nt.current,yt.current=Pe,St(Pe));const ps=()=>{!at()||Ns===null||nt.current!==Ns||(yt.current=Os,St(Os))};if(!hn&&J.length===0&&he.length===0)return;if((hn||he.length>0)&&ni&&J.length===0){ue(""),be([]),ii({promptId:ni,answers:[],note:hn||void 0,annotations:je}).then(zn=>{zn||Bt()});return}const ja=JSON.stringify({text:hn,images:J.map(zn=>({mediaType:zn.mediaType,name:zn.name,dataUrl:zn.dataUrl})),annotations:je,settings:Kt?{model:Kt.model,serviceTier:Kt.serviceTier,permissionMode:Kt.permissionMode,planMode:Yt,reasoningLevel:Kt.reasoningLevel}:null}),so=((wc=gn.current)==null?void 0:wc.signature)===ja?gn.current.id:`ct_${crypto.randomUUID()}`;if(gn.current={signature:ja,id:so},sr){if(!Y||!(st!=null&&st.agentReady)){ps();return}const zn=Y;ue(""),Ne([]),be([]),rt(null);const io=Kt?{model:Kt.model,serviceTier:Kt.serviceTier,permissionMode:Kt.permissionMode,planMode:(Jt==null?void 0:Jt.planActivation)==="command"?Yt??($t==null?void 0:$t.planMode):Yt,reasoningLevel:Kt.reasoningLevel}:{};at()&&Mn({});const Ta=J.map(Br=>({mediaType:Br.mediaType,dataBase64:Br.dataUrl.slice(Br.dataUrl.indexOf(",")+1),name:Br.name}));try{(kc=(await Yn(()=>qz(zn,hn,io,Ta.length?Ta:void 0,je,so,ri&&!te&&!Ie?"steer":void 0))).turn)!=null&&kc.existing&&await fs(zn),at()&&gr(Zp),((Pf=gn.current)==null?void 0:Pf.id)===so&&(gn.current=null)}catch{ps(),Bt()}return}if(!(st!=null&&st.agentReady)){ps();return}if(!Kt){ps();return}let zs=Y;try{ue(Jn=>Jn===oe?"":Jn),Ne(Jn=>Jn===J?[]:Jn),be(Jn=>Jn===he?[]:Jn),rt(null),mn.current=!0;try{if(!zs){const np=await Na(Kt,Yt);zs=np.id,it=np.id}if(!Fn(Q.queryKey))return;const Jn=ol(zs);await Je.fetchQuery({...Jn,...((zi=Je.getQueryState(Jn.queryKey))==null?void 0:zi.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{mn.current=!1}if(!Fn(Q.queryKey))return;pt({type:"optimisticUser",sessionId:zs,text:hn||Zpe(),attachments:J.map(Jn=>({url:Jn.dataUrl,mediaType:Jn.mediaType,name:Jn.name})),annotations:he}),pt({type:"busy",sessionId:zs,busy:!0}),at()&&no(),at()&&K==="archived"&&ne("active");const zn=Kt?{model:Kt.model,serviceTier:Kt.serviceTier,permissionMode:Kt.permissionMode,planMode:Yt,reasoningLevel:Kt.reasoningLevel}:{};at()&&Mn({});const io=J.map(Jn=>({mediaType:Jn.mediaType,dataBase64:Jn.dataUrl.slice(Jn.dataUrl.indexOf(",")+1),name:Jn.name})),Ta=zs;if(!Ta)throw new Error(c9e());(s_=(await Yn(()=>qz(Ta,hn,zn,io.length?io:void 0,je,so))).turn)!=null&&s_.existing&&await fs(Ta),at()&&gr(Zp),((ai=gn.current)==null?void 0:ai.id)===so&&(gn.current=null)}catch(zn){if(!Fn(Q.queryKey)||(Bt(),ps(),!zs))return;const io=zn instanceof Error?zn.message:String(zn);if(!/session is busy/i.test(io)&&await Je.fetchQuery({...Ga(e),staleTime:0}).then(Br=>{var Ll;return!!((Ll=Br.find(Jn=>Jn.id===zs))!=null&&Ll.busy)}).catch(()=>!1)){at()&&(ue(Br=>Br===hn?"":Br),Ne(Br=>Br===J?[]:Br),be(Br=>Br===he?[]:Br));return}pt({type:"busy",sessionId:zs,busy:!1}),pt({type:"localError",sessionId:zs,text:p1e({error:Ce(io)})})}}async function Na(te,ge){const Ee=De.current,Ie=L.current,Pe=await I.mutateAsync([e,te.harness,{model:te.model,serviceTier:te.serviceTier,permissionMode:te.permissionMode,planMode:ge,reasoningLevel:te.reasoningLevel}]);return L.current===Ie&&(Z(Yt=>[Pe,...Yt.filter(vn=>vn.id!==Pe.id)]),Je.getQueryData(Q.queryKey)||qs(!0)),L.current===Ie&&De.current===Ee&&(B.current(Pe.id,{replace:!0}),De.current={...Ee,activeId:Pe.id}),Pe}function ep(){const te=PLn(oe);ue(te),window.requestAnimationFrame(()=>{var ge,Ee;(ge=In.current)==null||ge.focus(),(Ee=In.current)==null||Ee.setSelectionRange(te.length,te.length),Jr(te.length)})}async function jl(){const te=bi;if(!te)return;if(me(null),sr){me(E0e());return}const ge=oe,Ee=De.current;let Ie=Y;const Pe=()=>{const J=De.current;return J.projectId===Ee.projectId&&J.activeId===Ie&&J.mainView===Ee.mainView},Yt=()=>{Pe()&&ue(J=>J||ge)};ue(""),Tr(!1);let vn=Y;if(!vn){if(!(st!=null&&st.agentReady)||!Vt){Yt(),me(Yg());return}try{const J=d4(Jt==null?void 0:Jt.planActivation,void 0,yt.current);vn=(await Na(Vt,J)).id,Ie=vn,Pe()&&Mn({})}catch(J){Yt();const he=J instanceof Error?J.message:String(J);Pe()&&me(eN({error:Ce(he)}));return}}Pe()&&K==="archived"&&ne("active");const hn=`${W_}shell-${Date.now()}`;pt({type:"localShell",sessionId:vn,id:hn,command:te}),Pe()&&no();try{const{message:J}=await _2n(vn,te);pt({type:"upsertMessage",sessionId:vn,message:J})}catch(J){const he=J instanceof Error?J.message:String(J);pt({type:"localShell",sessionId:vn,id:hn,command:te,error:eN({error:Ce(he)})})}}function Tl(){Y&&p2n(Y).catch(()=>{me(q9e())})}const Al=A.useCallback(async(te,ge)=>{if(!(!Y||fn.current)){fn.current=!0,me(null),Et(te);try{const Ee=S9n({model:mr.model,serviceTier:mr.serviceTier,permissionMode:mr.permissionMode,planMode:mr.planMode,reasoningLevel:mr.reasoningLevel}),Ie=Y;(await f2n(Ie,te,ge,Ee)).turn.existing&&await fs(Ie),gr(Zp)}catch{me(t8e())}finally{fn.current=!1,Et(null)}}},[Y,mr,fs]),t_=A.useCallback((te,ge)=>{if(!Y||sr||!(st!=null&&st.agentReady))return;const Ee=Y;pt({type:"busy",sessionId:Ee,busy:!0}),no(),Yn(()=>d2n(Ee,te,ge)).catch(Ie=>{pt({type:"busy",sessionId:Ee,busy:!1});const Pe=Ie instanceof Error?Ie.message:String(Ie);pt({type:"localError",sessionId:Ee,text:p8e({error:Ce(Pe)})})})},[Y,sr,st==null?void 0:st.agentReady,no,Yn]),If=A.useCallback(te=>{if(!Y||sr)return;const ge=Y,Ee=an.current;pt({type:"activeLeaf",sessionId:ge,leafId:te}),Yn(()=>h2n(ge,te)).catch(Ie=>{pt({type:"activeLeaf",sessionId:ge,leafId:Ee});const Pe=Ie instanceof Error?Ie.message:String(Ie);pt({type:"localError",sessionId:ge,text:X9e({error:Ce(Pe)})})})},[Y,sr,Yn]);function za(te){if(!Y)return;const ge=Y;o2n(ge,te).then(({removed:Ee})=>{if(Ee)return fs(ge)}).catch(()=>me(c8e()))}async function Rl(te){if(!Y||xn)return;const ge=Y;me(null),Ir(te);try{await c2n(ge,te),await fs(ge)}catch{me(j8e())}finally{Ir(null)}}A.useEffect(()=>{if(!sr||i!=="chat")return;function te(ge){var Ee;ge.key!=="Escape"||ge.defaultPrevented||(ge.preventDefault(),Tl(),(Ee=In.current)==null||Ee.focus())}return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[sr,Y,i]);function n_(te){Tb(te),ct.current.delete(te),dt.current===te&&(dt.current=null),De.current.projectId===e&&De.current.activeId===te&&De.current.mainView==="chat"&&(ue(""),Ne([]),be([]),B.current(null,{replace:!0})),U(ge=>{if(!ge.has(te))return ge;const Ee=new Set(ge);return Ee.delete(te),Ee}),Ot.current.delete(te)}function tp(te,ge){const Ee=te.archived;Z(Ie=>Ie.map(Pe=>Pe.id===te.id?{...Pe,archived:ge}:Pe)),$.mutateAsync([te.id,ge]).catch(()=>{Z(Ie=>Ie.map(Pe=>Pe.id===te.id?{...Pe,archived:Ee}:Pe))})}function Ms(te,ge){const Ee=te.title;Z(Ie=>Ie.map(Pe=>Pe.id===te.id?{...Pe,title:ge}:Pe)),q.mutateAsync([te.id,ge]).catch(()=>{Z(Ie=>Ie.map(Pe=>Pe.id===te.id?{...Pe,title:Ee}:Pe))})}async function $n(te){var Ee;const ge=((Ee=te.title)==null?void 0:Ee.trim())||xd();if(window.confirm(Eme({title:ia(ge)}))){try{await H.mutateAsync(te.id)}catch(Ie){bn(Mme({title:ia(ge),error:Ce(Ie instanceof Error?Ie.message:String(Ie))}),"error");return}n_(te.id)}}const ii=A.useCallback(te=>{if(!Y)return Promise.resolve(!1);const ge=Y;return pt({type:"busy",sessionId:ge,busy:!0}),Yn(()=>m2n(ge,te)).then(()=>!0).catch(()=>!1).finally(()=>{Fn(Q.queryKey)&&(Je.fetchQuery({...ol(ge),staleTime:0}).catch(()=>{}),Je.fetchQuery({...Ga(e),staleTime:0}).catch(()=>{}))})},[Y,e,Yn,Q]),To=V.filter(te=>YIn(K,te.archived)),yc=/Mac|iPhone|iPad/.test(navigator.platform),Ml=yc?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",hs=yc?"⌘ Enter":"Ctrl + Enter",Ni=A.useCallback(()=>{ne("active"),y(null)},[y]),ro=A.useCallback(te=>{ne("all"),y(te)},[y]);A.useEffect(()=>{const te=ge=>{ge.repeat||ge.key!=="Enter"||!ge.metaKey&&!ge.ctrlKey||ge.altKey||!ge.shiftKey||(ge.preventDefault(),Ni())};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[Ni]);const xc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":Ml,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Ni,children:[f.jsx($h,{size:15}),q4e()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx(II,{size:15}),n2e()]}),vLn.map(te=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&te.activeTabs.includes(i)?"active":""}`,"data-onboarding":te.id==="compute"?"nav-compute":void 0,onClick:()=>a(te.id),children:[te.icon,te.label()]},te.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((r_=VH.find(te=>te.id===K))==null?void 0:r_.railLabel())??RD()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(ZIn,{value:K,onChange:ne})})]}),f.jsxs("div",{className:"rail-body",children:[To.map(te=>f.jsx(n$n,{session:te,active:te.id===Y&&i==="chat",unread:F.has(te.id),busy:At.busySessions.has(te.id),waiting:Qi.has(te.id),revealTitle:Ln.get(te.id),onOpen:()=>{if(y(te.id),e===Fp){Bkn(te.id);const ge=Fbn[te.id];ge&&(du({name:"demo_experiment_started",kind:"curated",experiment:ge}),du({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:ge=>Ms(te,ge),onSetArchived:ge=>tp(te,ge),onDelete:()=>void $n(te)},te.id)),To.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:K==="archived"?Q1e():V.length>0?D1e():nve()})]}),f.jsx(G$,{runtime:w})]}),Ol="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 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",Ao=!r&&f.jsx(Ft,{title:EN(),"aria-label":EN(),onClick:s,children:f.jsx(QI,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&xc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:Ao}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:E})]})]}):f.jsxs(f.Fragment,{children:[r&&xc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[Ao,f.jsxs("div",{className:Ol,children:[f.jsx(L0,{variant:"header",title:Zn?(($f=Zn.title)==null?void 0:$f.trim())||xd():rN(),children:Zn?f.jsx(KH,{title:((Bf=Zn.title)==null?void 0:Bf.trim())||xd(),animate:Yu!==void 0},Yu??"static"):rN()}),k&&f.jsx(Ft,{"data-tip":sN(),"aria-label":sN(),onClick:k,children:f.jsx(x3n,{size:15})})]})]}),Cl?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Cl.message}),f.jsx(Oe,{onClick:()=>void mt.refetch(),children:Ys()})]}):on?f.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:[f.jsx(jt,{}),f.jsx("span",{children:L4e()})]}):Sl?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:Hn,tabIndex:0,role:"region","aria-label":(($r=Zn==null?void 0:Zn.title)==null?void 0:$r.trim())||xd(),onScroll:te=>{Zh(te.currentTarget),wn.dismiss()},children:f.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:zr,children:[f.jsx(uH,{projectId:e,sessionId:Y,children:f.jsx(XIn,{scrollRef:Hn,scrollToEndRef:nr,stickToBottom:On,onPinToBottom:no,messages:pr,allMessages:Ki,canFork:Mf,onFork:t_,onSelectFork:If,busy:sr,onOpenFile:vc,onOpenRun:c,onOpenSpawnedSession:ro,runExperimentName:u,onOpenExperiment:h,experimentName:_,onRespond:ii,onOpenPlan:gc,onOpenSubagent:Xh,recoveringTurnId:_s,onRecover:Al,skills:Zu},Y)}),sr&&ti&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:LCe()}),sr&&!ti&&!mc&&!wl&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:uEe()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx(AS,{})}),f.jsx("h2",{children:qCe()}),f.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-medium",children:[f.jsx(Ou,{size:19}),f.jsx("span",{children:n})]}),Nl&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:TR,"aria-hidden":"true",children:jR.map((te,ge)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${y4[ge].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${y4[ge].icon}`,children:[f.jsx(te,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},ge))}),f.jsxs(Vr,{className:"mt-3",role:"status",children:[f.jsx(jt,{}),f.jsx("span",{children:L6e()})]})]}),Ea&&Ea.length>0&&f.jsx("div",{className:TR,role:"group","aria-label":q6e(),children:Ea.map((te,ge)=>{const Ee=jR[ge],Ie=y4[ge];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Ie.box}`,onClick:()=>{du({name:"project_starter_clicked",slot:ge+1}),du({name:"first_action",surface:bc,action:"starter_click"}),Yh(te.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ee,{size:17,className:Ie.icon}),te.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:te.prompt})]},ge)})})]}),wn.action&&f.jsxs(Oe,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:wn.action.x,top:wn.action.top,transform:"translateX(-50%)"},onMouseDown:te=>te.preventDefault(),onClick:wn.add,children:[f.jsx(WI,{size:14}),Ube()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_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:[Sl&&f.jsx(Ft,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${hr?"opacity-0":"opacity-100"}`,title:jN(),"aria-label":jN(),inert:hr,onClick:Jh,children:sr&&!ti?f.jsx(Ib,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(s3n,{size:16})}),Ss&&!(jo&&Ss.promptId===jo.promptId)&&f.jsx(SDn,{synthesized:Ss.synthesized,agentLabel:Zn?hu[Zn.harness]:rEe(),showResumeModes:(Zn==null?void 0:Zn.harness)==="claude-code",onView:te=>gc==null?void 0:gc(Ss.plan,Ss.promptId,te),onApprove:te=>ii({promptId:Ss.promptId,approve:!0,...te?{resumeMode:te}:{}}),onReject:()=>ii({promptId:Ss.promptId,approve:!1}),onRevise:te=>{Y&&Df({sessionId:Y,promptId:Ss.promptId}),ii({promptId:Ss.promptId,approve:!1,note:te})}}),Ci.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Ci.map((te,ge)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:te.error?`${te.text} +`){a();continue}t+=h,r+=h}return a(),n}function Iy(e,n){return Hd(e).filter(t=>A9n(t.raw,n))}function $a(e,n){return Iy(e,n).length>0}function kIn(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,MH).matchAll(wIn))if(n.add(t[0].toLowerCase()),n.size>=Pu)break;return[...n]}function Z5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,MH),s=n==="runs"?[new RegExp(`/runs/(${Fo})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${Fo})`,"gi"),new RegExp(`^\\s*RUN\\s+(${Fo})\\b`,"gim"),new RegExp(`={3,}\\s*(${Fo})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${Fo})`,"gi"),new RegExp(`^\\s*id:\\s*(${Fo})`,"gim"),new RegExp(`={3,}\\s*(${Fo})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=Pu)return[...t];const i=new RegExp(`^\\s*(${Fo})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=Pu)break;return[...t]}function BH(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function PH(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function FH(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const c=o+a[0].length;c<=t&&/\bdone\b/.test(e.slice(c,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function SIn(e,n,t=[],r=[]){const s=Iy(e,"logs"),i=new Set;if(s.length===0){if(!$a(e,"logs"))return[];const o=t.length>0?[]:Z5(n,"runs");for(const c of t.length>0?t:o.length>0?o:r)if(i.add(c),i.size>=Pu)break;return Fd([...i])}let a=!1;for(const{invocation:o,offset:c}of BH(e,s)){const u=wh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const h=u.slice(1);let _=null;for(let v=0;v0?[]:Z5(n,"runs"),c=t.length>0?t:o.length>0?o:r;for(const u of c)if(i.add(u),i.size>=Pu)break}return Fd([...i])}function vd(e,n,t=[],r=[]){const s=Iy(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:c}of BH(e,s)){const u=wh(o.raw),h=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let _=!1;h&&new RegExp(`^${Y_}$`,"i").test(h)&&(i.add(h),_=!0);const p=h?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(h):null;if(p){const m=p[1],w=PH(e,m,c,Y_);if(w.length>0){for(const v of w)i.add(v);_=!0}const k=FH(e,m,c,Y_);for(const v of k)i.add(v);k.length>0&&(_=!0)}_||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:Z5(n,"experiments"),c=t.length>0?t:o.length>0?o:r;for(const u of c)if(i.add(u),i.size>=Pu)break}return Fd([...i])}const NR=new WeakMap;function ff(e){const n=E(),t=NR.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=CIn(e);return NR.set(e,{locale:n,activity:r}),r}function CIn(e){var b,x,y,C,z,N;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Ws(i,"command","cmd"),o=dIn(i,"commandArgv"),c=((x=e.state)==null?void 0:x.output)||((y=e.state)==null?void 0:y.error),u=Fd(v4(i,"targetIds")),h=Fd(v4(i,"runTargetIds")),_=Fd(v4(i,"experimentTargetIds")),p=Ws(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Ws(i,"description"),w=n.toLowerCase().split(/(?::|\.|__)+/),k=w.at(-1)??n.toLowerCase();if(k==="run"&&w.includes("web")){const T=g4(i,"search_query","q"),j=g4(i,"image_query","q"),M=g4(i,"find","pattern");return T?{kind:"web",label:GE({query:T})}:j?{kind:"web",label:Yie({query:j})}:M?{kind:"web",label:Iae({pattern:M})}:Array.isArray(i.open)?{kind:"web",label:l3e()}:Array.isArray(i.weather)?{kind:"web",label:Txe()}:Array.isArray(i.finance)?{kind:"web",label:mxe()}:Array.isArray(i.sports)?{kind:"web",label:kxe()}:Array.isArray(i.time)?{kind:"web",label:lxe()}:{kind:"web",label:oN()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["compacted","contextcompaction"],["imported","importedchat"],["subagentactivity","subagent"]]).get(k)??k){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:r5e()};const T=pIn(a??(o==null?void 0:o.join(" "))??""),j=Hd(T);let M=j.map(G=>G.raw);if(o!=null&&o.length){const G=T9n(o);M=G===null?[o]:Hd(DH(G)).map(ae=>ae.raw)}let D=null;for(const G of M)if(D=R9n(G),D)break;const I=M.some(G=>{const ae=wh(G);return ae!==null&&ae[0]!=="discover"&&ae[0]!=="paper"});if(D&&!I){const G=D.kind==="discover"?{keyword:vie(),embedding:Cie(),openalex:gae(),biorxiv:Rie(),pubmed:Sae()}[D.strategy]:null,ae=D.kind==="discover"?D.query?tne({activity:G??UE(),query:D.query}):G??UE():D.id?Pp({target:Ce(D.id)}):Are();return{kind:D.kind==="paper"?"read":"search",label:ae,litCall:D}}if($a(T,"agent\\s+spawn"))return{kind:"agent",label:p2e(),spawnedSessionIds:kIn(c),litCall:D??void 0};const $=j.map(G=>$H(G.raw)),q=$a(T,"exp\\s+status"),H=$a(T,"exp\\s+desc"),Q=Iy(T,"exp\\s+desc").some(G=>(wh(G.raw)??[]).some(ce=>ce==="--set"||ce.startsWith("--set=")||ce==="--stdin")),V=Q?Roe():Sre(),Z=Q?Eee():$se();if($a(T,"logs")){const G=SIn(T,c,h,u);return{kind:"project",label:G.length===1?Sse():Ase(),runIds:G,litCall:D??void 0}}if($a(T,"exp\\s+run"))return{kind:"project",label:NSe(),litCall:D??void 0};if($a(T,"exp\\s+wait"))return{kind:"project",label:jCe(),litCall:D??void 0};if($a(T,"exp\\s+cancel"))return{kind:"project",label:jye(),litCall:D??void 0};const Y=$a(T,"project\\s+view");if(Y&&q&&H)return{kind:"project",label:Z,experimentIds:vd(T,c,_,u),litCall:D??void 0};if(Y&&H)return{kind:"project",label:V,experimentIds:vd(T,c,_,u),litCall:D??void 0};if(Y&&q)return{kind:"project",label:cN(),experimentIds:vd(T,c,_,u),litCall:D??void 0};if(Y)return{kind:"project",label:A5e(),litCall:D??void 0};if(q&&H)return{kind:"project",label:Z,experimentIds:vd(T,c,_,u),litCall:D??void 0};if(q)return{kind:"project",label:cN(),experimentIds:vd(T,c,_,u),litCall:D??void 0};if(H)return{kind:"project",label:V,experimentIds:vd(T,c,_,u),litCall:D??void 0};if($a(T,"runs?"))return{kind:"project",label:w4e(),litCall:D??void 0};if($a(T,"projects"))return{kind:"project",label:j4e(),litCall:D??void 0};if($a(T,"compute"))return{kind:"project",label:qye(),litCall:D??void 0};const B=$.map(bIn).find(G=>G!=null);if(B){const G=m4(B.path);return{kind:G?"skill":"read",label:G?X2({name:Ce(G)}):Pp({target:Ce(E_(B.path))}),filePath:B.path,fileRef:B.ref,labelTarget:G?`${G} skill`:E_(B.path)}}const L=$.findIndex(G=>G!=null&&["sed","cat","head","tail"].includes(G.name)),F=L>=0?$[L]:null,U=F?vIn(F):null,K=U?xIn(U,j,L,Ws(i,"cwd","workdir")):null;if(U&&K){const G=m4(K);return{kind:G?"skill":"read",label:G?X2({name:Ce(G)}):Pp({target:Ce(E_(U))}),filePath:K,labelTarget:G?`${G} skill`:E_(U)}}if($.some(G=>(G==null?void 0:G.name)==="find"||(G==null?void 0:G.name)==="ls"||(G==null?void 0:G.name)==="rg"&&G.args.includes("--files")))return{kind:"search",label:vN()};const ne=$.findIndex(G=>(G==null?void 0:G.name)==="rg"||(G==null?void 0:G.name)==="grep");if(ne>=0){const G=yIn(j[ne].raw);return{kind:"search",label:G?Z2({pattern:Ce(G)}):Y2(),searchPattern:G??void 0}}const oe=$.find(G=>(G==null?void 0:G.name)==="git"),ue=oe==null?void 0:oe.args[0];if(ue==="grep"){const G=oe==null?void 0:oe.args.slice(1).find(ae=>!ae.startsWith("-"));return{kind:"search",label:G?Z2({pattern:Ce(G)}):Y2(),searchPattern:G}}if(ue==="status")return{kind:"command",label:nxe()};if(ue==="diff")return{kind:"command",label:jke()};if(ue==="log")return{kind:"command",label:S5e()};const se=G=>$.some(ae=>!ae||!["cargo","pnpm","npm","yarn"].includes(ae.name)?!1:ae.args[0]===G||ae.args[0]==="run"&&ae.args[1]===G);return se("test")?{kind:"command",label:u5e()}:$.some(G=>(G==null?void 0:G.name)==="tsc")||se("typecheck")?{kind:"command",label:Ixe()}:se("lint")?{kind:"command",label:Lye()}:se("build")?{kind:"command",label:pye()}:{kind:"command",label:rre({command:Ce(T)})}}case"skill":{const T=Ws(i,"skill","name"),j=T?fIn(n,T):null;return{kind:"skill",label:T?Lne({name:Ce(T)}):jne(),filePath:j??void 0,labelTarget:j&&T?`${T} skill`:void 0}}case"read":{const T=p?E_(p):null,j=p?m4(p):null;return j?{kind:"skill",label:X2({name:Ce(j)}),filePath:p??void 0,labelTarget:`${j} skill`}:T?{kind:"read",label:Pp({target:Ce(T)}),filePath:p??void 0,labelTarget:T}:{kind:"read",label:g5e()}}case"edit":case"write":case"notebookedit":{const T=hIn(i),j=p??(T==null?void 0:T.path)??null,M=j?E_(j):null,D=M?(T==null?void 0:T.type)==="add"?ate({target:Ce(M)}):(T==null?void 0:T.type)==="delete"?Nte({target:Ce(M)}):Fte({target:Ce(M)}):null;return M?{kind:"edit",label:D??hN(),filePath:j??void 0,labelTarget:M}:{kind:"edit",label:hN()}}case"grep":{const T=Ws(i,"pattern");return{kind:"search",label:T?Z2({pattern:Ce(T)}):Y2(),searchPattern:T??void 0}}case"glob":{const T=Ws(i,"pattern");return{kind:"search",label:T?pne({pattern:Ce(T)}):vN()}}case"websearch":{const T=Ws(i,"query"),j=Ws(i,"url"),M=Ws(i,"pattern");return T?{kind:"web",label:GE({query:T})}:M&&j?{kind:"web",label:uae({pattern:M})}:j?{kind:"web",label:Xne({target:Ce(j)})}:{kind:"web",label:m??oN()}}case"webfetch":{const T=Ws(i,"url");return{kind:"web",label:T?Pp({target:Ce(T)}):m??Xre()}}case"task":return{kind:"agent",label:m??ure()};case"subagent":return{kind:"agent",label:EIn(i)};case"error":return{kind:"command",label:lCe()};case"importedchat":return{kind:"project",label:cne()};case"contextcompaction":return{kind:"command",label:((C=e.state)==null?void 0:C.status)==="error"?Jee():((z=e.state)==null?void 0:z.status)==="running"?qE():Pee(),progressLabel:qE()};default:{const T=m??p??a??((N=e.state)==null?void 0:N.title)??"";return{kind:"command",label:T?`${n}: ${T}`:n}}}}function EIn(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return soe();case"sendInput":return Yae();case"resumeAgent":return use();case"wait":return Boe();case"closeAgent":return Mee()}switch(typeof e.kind=="string"?e.kind:""){case"started":return Coe();case"interacted":return iee();case"interrupted":return voe()}return _oe()}function cb({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(Cf,{...t});if(e.litCall)r=f.jsx(QB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx(II,{...t});break;case"read":case"project":r=f.jsx($I,{...t});break;case"search":r=f.jsx(YI,{...t});break;case"edit":r=f.jsx(bS,{...t});break;case"web":r=f.jsx(s5n,{...t});break;case"agent":r=f.jsx(kS,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function b4({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=A.useState(!1),a=A.useRef(null),o=A.useRef(!1);return A.useEffect(()=>{var c,u;!s||!o.current||(o.current=!1,(u=(c=a.current)==null?void 0:c.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((c,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Gr(h=>n(c.id,h),{stopPropagation:!0}):{onClick:h=>{h.stopPropagation(),t==null||t(c.id)}},children:c.label}):f.jsx("span",{children:c.label})]},c.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?lY({target:r}):$J({count:tn(e.length),target:r}),onClick:c=>{c.preventDefault(),c.stopPropagation(),o.current=!s&&c.detail===0,i(u=>!u)},children:s?OD():aje({count:tn(e.length)})})]})}function J5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,c,u,h;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:B9n(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(c3n,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const _=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Gr(p=>n(_,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((c=e.spawnedSessionIds)!=null&&c.length&&r){const _=e.spawnedSessionIds,p=_.slice(0,3),m=_.slice(p.length).map((w,k)=>({id:w,label:JE({number:tn(p.length+k+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((w,k)=>f.jsxs("span",{children:[k>0&&", ",f.jsx("button",{className:"tool-target",title:n3e(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(w)},children:JE({number:tn(k+1)})})]},w)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(b4,{items:m,onSelect:r,targetType:vpe()})]})]})}if((u=e.runIds)!=null&&u.length){const _=s?e.runIds.filter(w=>!!s(w)):e.runIds;if(_.length===0)return e.label;const p=_.slice(0,3),m=_.slice(p.length).map(w=>({id:w,label:(s==null?void 0:s(w))||Wc()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((w,k)=>f.jsxs("span",{children:[k>0&&", ",t?f.jsx("button",{className:"tool-target",title:uZ({run:Ce(w)}),...Gr(v=>t(w,v),{stopPropagation:!0}),children:(s==null?void 0:s(w))||Wc()}):f.jsx("span",{children:(s==null?void 0:s(w))||Wc()})]},w)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(b4,{items:m,onOpen:t,targetType:L8e()})]})]})}if((h=e.experimentIds)!=null&&h.length){const _=a?e.experimentIds.filter(w=>!!a(w)):e.experimentIds;if(_.length===0)return e.label;const p=_.slice(0,3),m=_.slice(p.length).map(w=>({id:w,label:(a==null?void 0:a(w))||Wc()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((w,k)=>f.jsxs("span",{children:[k>0&&", ",i?f.jsx("button",{className:"tool-target",title:qY({name:(a==null?void 0:a(w))||Ce(w)}),...Gr(v=>i(w,v),{stopPropagation:!0}),children:(a==null?void 0:a(w))||Wc()}):f.jsx("span",{children:(a==null?void 0:a(w))||Wc()})]},w)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(b4,{items:m,onOpen:i,targetType:ege()})]})]})}return e.label}function fC(e){const n=e.progressLabel??{skill:qne(),read:rse(),search:Uae(),edit:Wte(),project:Gse(),web:bee(),agent:yte(),command:xD()}[e.kind];return{...e,label:n}}function HH(e,n){const t=ff({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:wne(),read:gre(),search:_ie(),edit:Ote(),project:gse(),web:fee(),agent:dte(),command:Zse()}[t.kind]}function NIn(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const zIn=250;function jIn(e,n){const[t,r]=A.useState(e),s=A.useRef(Date.now()),i=A.useRef(e);return A.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=zIn-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const TIn=160;function qH(e){const[n,t]=A.useState(!1);return A.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),TIn);return()=>window.clearTimeout(r)},[e]),e&&n}function AIn(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:jD()}}function RIn(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function MIn(e){const n=[];let t=null;for(const r of e){const s=ff(r),i=RIn(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function UH({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var w,k;const i=(w=e.state)==null?void 0:w.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,c]=A.useState(Date.now());if(A.useEffect(()=>{if(typeof a!="number"||(c(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();c(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=w9n(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(jt,{}),f.jsx("span",{children:v})]})}const u=KB(i==null?void 0:i.recoveryAction),h=i==null?void 0:i.turnId,_=VB(e)?w1e():s?t9e():AN(),p=s?Z3n:wS,m=Ly(((k=e.state)==null?void 0:k.error)||AN());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:_}),f.jsx(Wa,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&h&&(u==="retry"||u==="continue")&&f.jsx(Oe,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(h,u),children:t?j9e():u==="retry"?Ys():dme()})]})}function zR({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:c}){const u=e.state,h=(u==null?void 0:u.status)==="error",_=Ly((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=h&&!!_,[m,w]=A.useState(!1),k=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(UH,{part:e,busy:!1,recovering:!1,usageLimited:u5(e)});const v=f.jsxs(f.Fragment,{children:[h&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),h?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(FI,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(cb,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${AH} ${h?"text-accent-red":"text-subtext"}`,children:[f.jsx(J5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:c}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:kY({count:tn(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":k,"aria-label":m?mY({activity:n.label}):AJ({activity:n.label}),onClick:()=>w(b=>!b),children:f.jsx(Wa,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:k,children:f.jsx("div",{className:uC,children:_.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function OIn({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,D,I;const[c,u]=A.useState(!1),[h,_]=A.useState(!1),p=()=>{_(!0),u($=>!$)},m=MIn(e),w=m.map(({activity:$})=>$),k=n?m.at(-1):void 0,v=k==null?void 0:k.part,b=k==null?void 0:k.activity,x=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&fC(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(x!=null&&x.progressLabel)&&(NIn((D=v.state)==null?void 0:D.input)||(x==null?void 0:x.kind)==="command"&&!Ws(((I=v.state)==null?void 0:I.input)??{},"command","cmd")),C=jIn(x,y),z=qH(C!=null),N=C??AIn(w),T=C?C.label:jD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(cb,{activity:C,className:z?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${z?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(J5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(zR,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(cb,{activity:N,className:z?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${z?"tool-running-shimmer":""}`,title:T,children:f.jsx(J5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":c,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":c,"aria-label":c?V0e():Kme(),children:f.jsx(Wa,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${c?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${c?"open":""}`,"aria-hidden":!c,inert:!c,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:h&&m.map(({part:$,count:q,activity:H})=>f.jsx(zR,{part:$,repeatCount:q,activity:H,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function DIn({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var h;const s=e.prompt,[i,a]=A.useState([]),o=!n,c=_=>n==null?void 0:n({promptId:e.id,..._});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:k3e(),icon:Fi,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:U3e(),icon:bS,iconClass:"text-accent-amber"}:s.approved===!1?{label:T3e(),icon:_r,iconClass:"text-accent-red"}:{label:I3e(),icon:$b,iconClass:"text-muted"},w=m.icon;return f.jsxs("details",{className:lIn,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?AD():zN()}),f.jsx(w,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Wa,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${SR} ms-6`,children:[f.jsx(nc,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const _=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,w)=>({id:`${e.id}-annotation-${w}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(_C,{annotations:p,variant:"sent"}),f.jsxs("details",{className:cIn,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||z7e()}),f.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 ${_?"chosen":""}`,children:_||w8e()})]}),f.jsxs("div",{className:SR,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var w;return f.jsx("li",{className:(w=s.answers)!=null&&w.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==_&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const _=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?p7e():zN()}),f.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 ${_?"clamped":""}`,children:f.jsx(nc,{text:s.plan??"",onOpenFile:t})}),_&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Gr(p=>r(s.plan??"",e.id,p)),children:wCe()}),!o&&!_&&f.jsxs("div",{className:Y5,children:[f.jsx(Oe,{size:"small",variant:"primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:Xve()}),f.jsx(Oe,{size:"small",onClick:()=>c({approve:!0,resumeMode:"bypassPermissions"}),children:rbe()}),f.jsx(Oe,{size:"small",onClick:()=>c({approve:!1}),children:$5e()})]})]})}if(s.kind==="permission"){const _=s.toolInput??{},p=Ws(_,"command","cmd","filePath","file_path","path")||"",m=typeof((h=s.toolInput)==null?void 0:h.reason)=="string"&&s.toolInput.reason||"",w=Ws(_,"description")||"",k=m||w||HH(s.tool,_),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(wS,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Abe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:k}),p&&f.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:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Oe,{size:"small",variant:"ghost",onClick:()=>c({approve:!1}),children:K2e()}),f.jsx(Oe,{size:"small",variant:"primary",onClick:()=>c({approve:!0}),children:Sbe()})]})]})]})}const u=_=>a(p=>s.multiSelect?p.includes(_)?p.filter(m=>m!==_):[...p,_]:[_]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:uIn,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(_=>{const p=i.includes(_.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start 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 ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(_.label):c({answers:[_.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:_.label}),_.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:_.description})]},_.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:Y5,children:f.jsx(Oe,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>c({answers:i}),children:nCe()})})]})}function LIn(e,n){return e.role==="user"?!0:e.parts.some(t=>xh(t,n))}function IIn(e){const n=e.text??"",t=n.startsWith("data:")?n:l2n(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}async function dC(e){try{if(!navigator.clipboard)throw new Error(ID());await navigator.clipboard.writeText(e),bn(tf(),"success")}catch(n){bn(n instanceof Error?n.message:String(n),"error")}}function $In(e,n){const t=URL.createObjectURL(new Blob([n],{type:"text/markdown;charset=utf-8"})),r=document.createElement("a");r.href=t,r.download=e,document.body.append(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(t),1e3)}function BIn({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:c,editDisabled:u}){const h=t>1,_=new Date(n),p=()=>dC(e);return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${h?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[h&&f.jsxs(f.Fragment,{children:[f.jsx(Ft,{size:"small",title:yN(),"aria-label":yN(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(BI,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Ft,{size:"small",title:bN(),"aria-label":bN(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Wa,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:_.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:_.toLocaleTimeString(E(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Ft,{size:"small","aria-label":Yk(),disabled:!e,onClick:p,children:f.jsx(Sf,{size:13})})]}),f.jsx(Ft,{size:"small",title:dN(),"aria-label":dN(),disabled:u,onClick:c,children:f.jsx(bS,{size:13})})]})}const PIn=A.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,busy:m=!1,recoveringTurnId:w,onRecover:k,skills:v,predictTextTail:b=!1,forkCount:x,forkIndex:y=0,forkPrevId:C,forkNextId:z,forkDisabled:N,branchDisabled:T,onFork:j,onSelectFork:M}){var Z,Y;wf();const[D,I]=A.useState(null),$=HIn(n);if($)return f.jsx(qIn,{part:$});if(n.role==="user"){const B=n.parts.filter(oe=>oe.type==="text").map(oe=>oe.text??"").join(` +`),L=oe=>!!(v!=null&&v.some(ue=>ue.name===oe)),F=n.parts.filter(oe=>oe.type==="image"&&oe.text).map(IIn),U=F.filter(oe=>!oe.isPdf),K=F.filter(oe=>oe.isPdf),ne=n.parts.filter(oe=>oe.type==="annotation"&&oe.text).map(oe=>({id:oe.id,text:oe.text??""}));if(D!==null){const oe=()=>{const ue=D.trim();!ue||N||(I(null),j(n.id,ue))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":fwe(),value:D,autoFocus:!0,onChange:ue=>I(ue.target.value),onKeyDown:ue=>{ue.key==="Escape"?(ue.preventDefault(),I(null)):ue.key==="Enter"&&!ue.shiftKey&&!ue.nativeEvent.isComposing&&(ue.preventDefault(),oe())}}),f.jsxs("div",{className:`${Y5} justify-end`,children:[f.jsx(Oe,{size:"small",onClick:()=>I(null),children:wye()}),f.jsx(Oe,{size:"small",variant:"primary",onClick:oe,disabled:N||!D.trim(),children:l3()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[ne.length>0&&f.jsx(_C,{annotations:ne,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(RLn,{text:B,isCommand:L}),U.length>0&&f.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((oe,ue)=>f.jsx("a",{href:oe.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:oe.src,alt:i0e()})},ue))}),K.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:K.map((oe,ue)=>f.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:oe.src,target:"_blank",rel:"noreferrer",children:[f.jsx($b,{size:15}),f.jsx("span",{children:oe.name})]},ue))})]}),x!==void 0&&f.jsx(BIn,{text:B,createdAt:n.createdAt,count:x,index:y,prevId:C,nextId:z,onSelect:M,pagerDisabled:T,onEdit:()=>I(B),editDisabled:N})]})}const q=n.parts.find(B=>B.type==="tool"&&u5(B)),H=n.parts.find(Mm)??q,Q=n.parts.filter(B=>B!==H&&!(q&&u5(B))),V=b&&!n.completedAt?"":GB(n);return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(FIn,{message:n,parts:Q,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,predictTextTail:b}}),H&&f.jsx(UH,{part:H,usageLimited:!!q,busy:m,recovering:w===((Y=(Z=H.state)==null?void 0:Z.input)==null?void 0:Y.turnId),onRecover:k}),V&&f.jsx("div",{className:"flex opacity-0 transition-opacity duration-80 ease-standard group-hover/turn:opacity-100 group-focus-within/turn:opacity-100",children:f.jsx(Ft,{size:"small",title:tN(),"aria-label":tN(),onClick:()=>void dC(V),children:f.jsx(Sf,{size:13})})})]})});function FIn({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=qB(n,r),[a,o]=A.useState(!1),[,c]=A.useState(0);if(A.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>c(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:iv(i,t)});const u=e.completedAt??(r?Date.now():null),h=u===null?null:u-e.createdAt,_=h===null?null:h<6e4||h>=36e5?R0(h):lNe({minutes:tn(Math.floor(h/6e4)),seconds:tn(Math.floor(h/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:_===null?nNe():mNe({duration:_})}),f.jsx(Wa,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:iv(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:iv(i,t)})]})}function HIn(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===cI?n:null}function qIn({part:e}){var c;const n=e.state,t=Ws((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((c=n==null?void 0:n.input)==null?void 0:c.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` +`),o=r?xD():s&&i!==null?M0e({code:tn(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[ED()," "]}),f.jsx(Cf,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${uC} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function iv(e,n){var x,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,predictTextTail:m=!1}=n,w=e.filter(C=>C.type!=="steer"&&xh(C,t)).at(-1),k=[];let v=[];const b=()=>{v.length!==0&&(k.push(f.jsx(OIn,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(xh(C,t)){if(C.type==="tool"&&(GIn(C.tool)||(((x=C.children)==null?void 0:x.length)??0)>0)){b(),k.push(f.jsx(KIn,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?k.push(f.jsx(nc,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(w==null?void 0:w.id)},C.id)):C.type==="steer"?k.push(f.jsx("div",{dir:"auto",role:"note","aria-label":XCe(),className:"msg-steer my-2 ms-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&&k.push(f.jsx(DIn,{part:C,onRespond:h,onOpenFile:s,onOpenPlan:_},C.id))}return b(),k}function UIn(e){return ff(e).label}function GIn(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function GH(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function lb(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&lb(t.children,n);if(r)return r}return null}function VIn({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var w,k,v,b;const o=e.children??[],c=((w=e.state)==null?void 0:w.status)==="running",u=((k=e.state)==null?void 0:k.status)==="error",h=u?Ly(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",_=iv(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:c,pendingTailToolId:c?FB(o):null}),m=o.some(x=>x.type==="text"&&!!x.text)?"":GH(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),h&&f.jsx("div",{className:uC,children:h.slice(0,2e4)}),_.length===0&&!m&&!h?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:c?Kk():H1e()}):f.jsxs(f.Fragment,{children:[_,m&&f.jsx(nc,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function KIn({part:e,pendingTail:n,onOpenSubagent:t}){var u,h,_,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=Ly(((h=e.state)==null?void 0:h.error)||((_=e.state)==null?void 0:_.output)||""),i=n&&!r?fC(ff(e)):ff(e),a=qH(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!GH(e),c=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(FI,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(cb,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${AH} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:c}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:Ive(),...Gr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[c,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Wa,{size:12})})]})}function WIn(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const c of s){const u=`${i}/${c.id}`;c.type==="tool"&&((a=c.state)!=null&&a.status)&&n.set(u,{status:c.state.status,part:c}),(o=c.children)!=null&&o.length&&r(c.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function hC(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Ws(o,"reason","description")||HH(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function QIn(e){const[n,t]=A.useState({text:"",sequence:0}),r=A.useRef(null);return A.useEffect(()=>{var w,k,v,b,x;const s=((w=e[0])==null?void 0:w.id)??"",{messageId:i,states:a}=WIn(e),o=hC(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?VE({label:ia(o.label)}):"",sequence:y.sequence+1}));return}const c=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,h=[...a].filter(([y,C])=>{var z;return((z=c.get(y))==null?void 0:z.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:VE({label:ia(o.label)}),sequence:y.sequence+1}));return}const _=(k=h.find(([,y])=>Mm(y.part)))==null?void 0:k[1].part;if((_==null?void 0:_.id)==="turn-recovery"){const y=KB((b=(v=_.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${Kce()}${y?` ${y==="retry"?fce():ice()}`:""}`,sequence:C.sequence+1}));return}if((_==null?void 0:_.id)==="turn-retry"){t(y=>({text:Zoe(),sequence:y.sequence+1}));return}const p=h.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>ff(C.part).label).join(", ");t(C=>({text:p.length===1?Mce({labels:y}):Pce({count:tn(p.length),labels:y}),sequence:C.sequence+1}));return}const m=h.filter(([,y])=>y.status==="running");if(m.length>0){const y=(x=m.at(-1))==null?void 0:x[1].part;t(C=>({text:y?fC(ff(y)).label:bce(),sequence:C.sequence+1}));return}h.some(([,y])=>y.status==="completed")&&t(y=>({text:Ece(),sequence:y.sequence+1}))},[e]),n}const XIn=A.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:c,onSelectFork:u,busy:h,onOpenFile:_,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:w,onOpenExperiment:k,experimentName:v,onRespond:b,onOpenPlan:x,onOpenSubagent:y,recoveringTurnId:C,onRecover:z,skills:N}){var B,L,F;wf();const T=((B=hC(n))==null?void 0:B.id)??null,j=A.useMemo(()=>n.filter(U=>LIn(U,T)),[n,T]),M=A.useMemo(()=>{const U=j.filter(K=>K.role==="user"&&!K.id.startsWith(W_));return p9n(a,n,U,K=>K.startsWith(W_))},[n,j,a]),D=A.useRef(new Set),[I,$]=A.useState(!1),q=A.useCallback(U=>j[U].id,[j]),H=A.useCallback(U=>{if(I)return j.map((ne,oe)=>oe);const K=new Set(BB(U));return j.forEach((ne,oe)=>{D.current.has(ne.id)&&K.add(oe)}),[...K].sort((ne,oe)=>ne-oe)},[j,I]),Q=f9n({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:q,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var U;return Math.max(0,j.length*400-(((U=t.current)==null?void 0:U.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:H});A.useLayoutEffect(()=>{const U=()=>Q.scrollToEnd();return r.current=U,i(),()=>{r.current=null}},[Q,r,i]),A.useEffect(()=>{const U=()=>{var oe;const K=window.getSelection();if(!K||K.isCollapsed||!K.rangeCount)return;const ne=K.getRangeAt(0);for(const ue of((oe=t.current)==null?void 0:oe.querySelectorAll("[data-message-id]"))??[])ne.intersectsNode(ue)&&ue.dataset.messageId&&D.current.add(ue.dataset.messageId)};return document.addEventListener("selectionchange",U),()=>document.removeEventListener("selectionchange",U)},[t]);const V=j.at(-1),Z=QIn(n),Y=h?HB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:Z.text},Z.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":I,onClick:()=>$(U=>!U),children:p9e()}),f.jsx("div",{className:"relative",style:{height:Q.getTotalSize()},children:Q.getVirtualItems().map(U=>{var se,G,ae,ce,pe,be;const K=j[U.index],ne=K.parts.find(Mm),oe=(G=(se=ne==null?void 0:ne.state)==null?void 0:se.input)==null?void 0:G.turnId,ue=ne?h||C!==null:!1;return f.jsx("div",{"data-index":U.index,"data-message-id":K.id,ref:Q.measureElement,className:"absolute left-0 w-full pb-4",style:{top:U.start},onClickCapture:Ae=>{!(Ae.target instanceof Element)||!Ae.target.closest("[data-work-toggle]")||(s.current=!1,Q.setOptions({...Q.options,anchorTo:"start"}))},onPointerDownCapture:()=>D.current.add(K.id),onFocusCapture:()=>D.current.add(K.id),children:f.jsx(PIn,{message:K,forkCount:(ae=M.get(K.id))==null?void 0:ae.count,forkIndex:(ce=M.get(K.id))==null?void 0:ce.index,forkPrevId:(pe=M.get(K.id))==null?void 0:pe.prevId,forkNextId:(be=M.get(K.id))==null?void 0:be.nextId,forkDisabled:!o,branchDisabled:h,onFork:c,onSelectFork:u,activePermissionId:T,pendingTailToolId:(Y==null?void 0:Y.messageId)===K.id?Y.toolId:null,onOpenFile:_,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:w,onOpenExperiment:k,experimentName:v,onRespond:b,onOpenPlan:x,onOpenSubagent:y,busy:ue,recoveringTurnId:oe===C?C:null,onRecover:z,skills:N,predictTextTail:h&&K===V&&K.role==="assistant"})},K.id)})})]})}),YIn=(e,n)=>e==="all"?!0:e==="archived"?n:!n,VH=[{id:"active",label:ube,railLabel:RD},{id:"archived",label:iN,railLabel:iN},{id:"all",label:gbe,railLabel:CD}];function ZIn({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=Xa();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Ft,{size:"small",className:"rail-filter-btn",active:e!=="active",title:gN(),"aria-label":gN(),onClick:()=>r(i=>!i),children:f.jsx(ZI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:VH.map(i=>f.jsxs(Dn,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Fi,{size:13})]},i.id))})]})}const JIn=14,e$n=500,t$n=1200;function KH({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.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*JIn,e$n)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function n$n({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:c,onDelete:u}){var z;const{open:h,setOpen:_,ref:p}=Xa(),m=((z=e.title)==null?void 0:z.trim())||"Untitled",[w,k]=A.useState(!1),[v,b]=A.useState(""),x=A.useRef(null);function y(){var N;b(((N=e.title)==null?void 0:N.trim())||""),k(!0)}function C(){var T;const N=v.trim();k(!1),N&&N!==(((T=e.title)==null?void 0:T.trim())||"")&&o(N)}return A.useEffect(()=>{var N,T;w&&((N=x.current)==null||N.focus(),(T=x.current)==null||T.select())},[w]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.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]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.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-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]: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-dot]:hidden ${n?"active":""} ${t?"unread":""} ${h?"menu-open":""} ${w?"editing":""}`,title:`${hu[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?w9e():""}`,onClick:()=>{w||(h?_(!1):a())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),h?_(!1):a())},children:[e.parentSessionId&&!w&&f.jsx(kS,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),w?f.jsx("input",{ref:x,className:"session-title-input","aria-label":hSe(),value:v,onChange:N=>b(N.target.value),onClick:N=>N.stopPropagation(),onBlur:C,onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"?(N.preventDefault(),C()):N.key==="Escape"&&(N.preventDefault(),k(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(KH,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:CN(),"aria-label":CN(),onClick:N=>{N.stopPropagation(),_(T=>!T)},children:f.jsx(Ib,{size:14})}),h&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(Dn,{onClick:N=>{N.stopPropagation(),_(!1),y()},children:f.jsx("span",{children:zD()})}),f.jsx(Dn,{onClick:N=>{N.stopPropagation(),_(!1),c(!e.archived)},children:f.jsx("span",{children:e.archived?LEe():$pe()})}),f.jsx(Dn,{danger:!0,onClick:N=>{N.stopPropagation(),_(!1),u()},children:f.jsx("span",{children:ND()})})]})]})}const jR=[$I,YI,Cf,gh],r$n=()=>[{title:FSe(),prompt:OSe()},{title:t6e(),prompt:WSe()},{title:p6e(),prompt:c6e()},{title:j6e(),prompt:w6e()}],y4=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],TR="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function s$n({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:c,runExperimentName:u,onOpenExperiment:h,experimentName:_,onOpenPlan:p,onOpenSubagent:m,runtime:w,onOpenDemoWelcome:k,composerFocusNonce:v=0,demoRunningRunId:b=null,activeSessionId:x,onActiveSessionChange:y,preferredAgent:C,onPreferredAgentChange:z,children:N}){var Cs,Dl,Es,r_,$f,Bf,$r;const T=dn({mutationFn:te=>i2n(...te)}),j=dn({mutationFn:te=>r2n(...te)}),M=dn({mutationFn:te=>s2n(...te)}),D=dn({mutationFn:te=>Yxn(...te)}),I=dn({mutationFn:te=>Jxn(...te)}),$=dn({mutationFn:te=>t2n(...te)}),q=dn({mutationFn:te=>n2n(...te)}),H=dn({mutationFn:e2n}),Q=A.useMemo(()=>Ga(e),[e]),{data:V=_In}=ut(Q),Z=A.useCallback(te=>{Yr(Q.queryKey,ge=>{if(!ge)return;const Ee=typeof te=="function"?te(ge):te,Ie=new Map(ge.map(Pe=>[Pe.id,Pe]));for(const Pe of Ee)Ie.get(Pe.id)!==Pe&&_o(Je,Q.queryKey,Pe.id),Ie.delete(Pe.id);for(const Pe of Ie.keys())_o(Je,Q.queryKey,Pe);return Ee})},[Q]),Y=x,B=A.useRef(y);B.current=y;const L=A.useRef({projectId:e});L.current.projectId!==e&&(L.current={projectId:e});const[F,U]=A.useState(new Set),[K,ne]=A.useState("active"),[oe,ue]=A.useState(""),[se,G]=A.useState(!1),[ae,ce]=A.useState(!1),[pe,be]=A.useState([]),Ae=A.useRef(0),De=A.useRef({projectId:e,activeId:Y,mainView:i});(De.current.projectId!==e||De.current.activeId!==Y||De.current.mainView!==i)&&(De.current={projectId:e,activeId:Y,mainView:i});const[We,Ne]=A.useState([]),[xe,rt]=A.useState(null),Ze=Y??"new",ct=A.useRef(new Map),Ct=A.useRef(kw);Ct.current={draft:oe,attachments:We,annotations:pe};const qt=e===Fp&&V.length>0&&V.every(te=>Hbn[te.id]===te.activeLeafId)?Hz:null,dt=A.useRef(null);qt!==null&&dt.current===null&&Y!==null&&(dt.current=Ze);const ht=Ze===dt.current?qt:null;A.useLayoutEffect(()=>{const te=ct.current.get(Ze)??kw;return Ct.current=te,ue(te.draft),Ne(te.attachments),be(te.annotations),()=>{const ge=C9n(Ct.current,ht);ge?ct.current.set(Ze,ge):ct.current.delete(Ze)}},[Ze,ht]);const[Le,me]=A.useState(null),Te=A.useRef(Promise.resolve()),He=A.useRef(0),nt=A.useRef(0),[_t,kt]=A.useState(null),yt=A.useRef(null),Zt=A.useRef(!1),un=A.useRef(null),[At,pt,mt]=V2n(e,i==="chat"?Y:null),{data:_n=a$n}=ut(Mu()),[us,xr]=A.useState(C);A.useEffect(()=>xr(C),[C]);const[Qt,Mn]=A.useState({}),[mr,gr]=A.useState(Zp),[_s,Et]=A.useState(null),fn=A.useRef(!1),an=A.useRef(null),[xn,Ir]=A.useState(null),mn=A.useRef(!1),gn=A.useRef(null),[Ln,Nt]=A.useState(new Map),Ot=A.useRef(new Map),Hn=A.useRef(null),zr=A.useRef(null),nr=A.useRef(null),On=A.useRef(!0),[hr,jr]=A.useState(!0),In=A.useRef(null),[Ke,gt]=A.useState(!1),Zr=Xa(),Wn=A.useCallback(te=>{var ge;Ae.current+=1,be(Ee=>[...Ee,{id:`annotation-${Ae.current}`,...te}]),(ge=In.current)==null||ge.focus()},[]),wn=rIn(zr,Wn);sIn(pe),A.useEffect(()=>{gt(!1),wn.dismiss()},[Y,e,wn.dismiss]);const[Qn,rr]=A.useState(0),[As,Tr]=A.useState(!1),[cr,xl]=A.useState(0),[Ya,Jr]=A.useState(0),Rs=A.useRef(!1);function Za(te){if(!Kr)return;if(!ni&&te.source==="command"&&Dy(te.name)&&te.name!=="goal"){zo(te.name,oe,Kr);return}const ge=te.source==="command"?1:W5(te.name,In.current),Ee=CLn(oe,Kr,te.name,ge);ue(Ee.text),window.requestAnimationFrame(()=>{var Ie,Pe;(Ie=In.current)==null||Ie.focus(),(Pe=In.current)==null||Pe.setSelectionRange(Ee.cursor,Ee.cursor),Jr(Ee.cursor)})}function Eo(te){if(Gi)return!1;const ge=te.selectionStart;if(Rs.current||ge!==te.selectionEnd)return!1;const Ee=oe.slice(0,ge).replace(/[ \t]+$/,"").length,Ie=_4(oe,Ee);if(!Ie||Ie.end!==Ee||!kl(Ie.query)||ge>Ee&&ge-Ee!==W5(Ie.query,te))return!1;const Pe=vR(oe,{...Ie,end:ge});return ue(Pe.text),Jr(Pe.cursor),window.requestAnimationFrame(()=>te.setSelectionRange(Pe.cursor,Pe.cursor)),!0}function wa(te){rt(null);let Ie=We.reduce((Pe,Yt)=>Pe+Yt.size,0);for(const Pe of te){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Pe.type))continue;if(Pe.size>31457280){rt(f0e({name:Ce(Pe.name)}));continue}if(Ie+Pe.size>41943040){rt(b0e());continue}Ie+=Pe.size;const Yt=Y,vn=new FileReader;vn.onload=()=>{const hn={dataUrl:vn.result,mediaType:Pe.type,name:Pe.name,size:Pe.size};if(De.current.activeId===Yt){Ne(he=>[...he,hn]);return}const J=ct.current.get(Yt??"new")??kw;ct.current.set(Yt??"new",{...J,attachments:[...J.attachments,hn]})},vn.readAsDataURL(Pe)}}function Ps(te){const ge=Array.from(te.clipboardData.items).filter(Ee=>Ee.kind==="file"&&(Ee.type.startsWith("image/")||Ee.type==="application/pdf")).map(Ee=>Ee.getAsFile()).filter(Ee=>Ee!==null);ge.length>0&&(te.preventDefault(),wa(ge))}const $t=V.find(te=>te.id===Y),qi=us??ESn(_n),Xn=$t?{harness:$t.harness,model:Qt.model??$t.model,serviceTier:Qt.serviceTier!==void 0?Qt.serviceTier:$t.serviceTier,permissionMode:Qt.permissionMode??$t.permissionMode,reasoningLevel:Qt.reasoningLevel??$t.reasoningLevel}:qi?{...qi,...Qt}:null,{data:Ar=i$n}=ut(L2n(Xn==null?void 0:Xn.harness)),st=Xn?_n.find(te=>te.id===Xn.harness):void 0,Jt=st==null?void 0:st.options,bi=A.useMemo(()=>ELn(Ar,Jt==null?void 0:Jt.planActivation),[Ar,Jt==null?void 0:Jt.planActivation]),yi=yR(oe),xi=yi!==null,Kr=_4(oe,Ya),Wr=(Kr==null?void 0:Kr.query)??null,Ui=Wr===null?[]:bi.filter(te=>kLn(te,Wr)),Gi=!xi&&Wr!==null&&(Kr==null?void 0:Kr.end)===Ya&&Ui.length>0,Fs=Gi&&!As?Ui:[],Rr=Fs.length>0,ei=Math.min(Qn,Math.max(0,Fs.length-1));A.useEffect(()=>rr(0),[Wr]);const wi=Xn&&st&&!st.catalogPending&&st.models.length>0&&!st.models.some(te=>te.id===Xn.model)?st.models[0].id:(Xn==null?void 0:Xn.model)??null,Vt=Xn&&{...Xn,model:wi,serviceTier:Rv(st,wi,Xn.serviceTier),reasoningLevel:nI(st,wi,Xn.reasoningLevel)},ki=Db(st,Vt==null?void 0:Vt.model),dc=te=>{if(!Vt)return;const ge={...Vt,...te},Ee={};te.model!==void 0&&te.model!==Vt.model&&(Ee.model=te.model),te.serviceTier!==void 0&&te.serviceTier!==Vt.serviceTier&&(Ee.serviceTier=te.serviceTier),te.permissionMode!==void 0&&te.permissionMode!==Vt.permissionMode&&(Ee.permissionMode=te.permissionMode),te.reasoningLevel!==void 0&&te.reasoningLevel!==Vt.reasoningLevel&&(Ee.reasoningLevel=te.reasoningLevel),gr(Ie=>({...Ie,...Ee})),xr(ge),z(ge).catch(()=>{}),$t?Mn(Ie=>({...Ie,...te})):te.harness&&te.harness!==Vt.harness&&Mn({})},Yn=A.useCallback(te=>{const ge=Te.current.catch(()=>{}).then(()=>{if(!Fn(Q.queryKey))throw new DOMException("Workspace changed","AbortError");return te()});return Te.current=ge.then(()=>{},()=>{}),ge},[Q]),es=te=>{if(te==="plan"&&(st==null?void 0:st.id)==="claude-code"?(gr(Ie=>({...Ie,permissionMode:te})),Mn(Ie=>({...Ie,permissionMode:te}))):(Mn(Ie=>{const Pe={...Ie};return delete Pe.permissionMode,Pe}),dc({permissionMode:te})),!$t)return;const ge=$t.id,Ee=++He.current;me(null),Yn(()=>T.mutateAsync([ge,te])).then(Ie=>{Z(Pe=>Pe.map(Yt=>Yt.id===Ie.id?Ie:Yt)),He.current===Ee&&Mn(Pe=>{const Yt={...Pe};return delete Yt.permissionMode,Yt})}).catch(()=>{He.current===Ee&&(Mn(Ie=>{const Pe={...Ie};return delete Pe.permissionMode,Pe}),me(QEe()))})},Si=te=>dc({reasoningLevel:te}),ks=((Cs=$t==null?void 0:$t.goal)==null?void 0:Cs.trim())||"",Vi=(Vt==null?void 0:Vt.harness)==="claude-code"?Vt.permissionMode==="plan":(Jt==null?void 0:Jt.planActivation)==="command"?_t??($t==null?void 0:$t.planMode)??!1:!1;A.useEffect(()=>{_t===null||($t==null?void 0:$t.planMode)!==_t||(yt.current=null,kt(null))},[$t==null?void 0:$t.planMode,_t]);async function Hs(te){if(gr(Ie=>({...Ie,planMode:te})),yt.current=te,kt(te),!$t)return;const ge=$t.id,Ee=++nt.current;me(null);try{const Ie=await Yn(()=>j.mutateAsync([ge,te]));Z(Pe=>Pe.map(Yt=>Yt.id===Ie.id?Ie:Yt)),nt.current===Ee&&(yt.current=null,kt(null),me(null))}catch(Ie){throw nt.current===Ee&&(yt.current=null,kt(null)),Ie}}async function Qu(){if((Vt==null?void 0:Vt.harness)==="claude-code"){es("auto");return}if($t)try{await Hs(!1)}catch{me(Pme())}}async function hc(){const te=!Vi;try{if((Vt==null?void 0:Vt.harness)==="claude-code")es(te?"plan":"auto");else if((Jt==null?void 0:Jt.planActivation)==="command")await Hs(te);else throw new Error(Yg())}catch{me(TN())}}function Ja(te,ge=""){var Ee;switch(te){case"plan":return hc(),!1;case"new":return zi(),!1;case"resume":return gt(!0),!0;case"model":return xl(Ie=>Ie+1),!0;case"compact":return Xu(),!1;case"goal":return Ci(ge),!1;case"copy":{const Ie=pr.at(-1),Pe=sr&&(Ie==null?void 0:Ie.role)==="assistant"&&!Ie.completedAt,Yt=b9n(Pe?pr.slice(0,-1):pr);return Yt?dC(Yt):bn(mve(),"info"),!1}case"export":{const Ie=((Ee=$t==null?void 0:$t.title)==null?void 0:Ee.trim())||xd(),Pe=$t?y9n(Ie,pr,{user:oge(),assistant:hu[$t.harness]}):null;return Pe?$In(x9n(Ie),Pe):bn(kve(),"info"),!1}}}async function No(te){me(null);const ge=L.current;try{const Ee=await D.mutateAsync([e,te]);if(Je.invalidateQueries({queryKey:oI().queryKey}),L.current!==ge)return;Z(Ie=>[Ee,...Ie.filter(Pe=>Pe.id!==Ee.id)]),ne("all"),y(Ee.id,{projectId:Ee.projectId})}catch(Ee){if(L.current!==ge)return;me(t1e({error:Ce(Ee instanceof Error?Ee.message:String(Ee))}))}}async function Ci(te){var vn;const ge=te.trim();if(!ge){const hn=(vn=$t==null?void 0:$t.goal)==null?void 0:vn.trim();bn(hn?xge({goal:ia(hn)}):Oge(),"info");return}const Ee=De.current,Ie=()=>De.current.activeId===Ee.activeId;me(null);let Pe=Y;if(!Pe){if(!(st!=null&&st.agentReady)||!Vt){me(Yg());return}try{Pe=(await Na(Vt,d4(Jt==null?void 0:Jt.planActivation,void 0,yt.current))).id}catch(hn){me(nN({error:Ce(hn instanceof Error?hn.message:String(hn))}));return}}const Yt=/^(clear|none|off)$/i.test(ge);try{const hn=await Yn(()=>M.mutateAsync([Pe,Yt?null:ge]));Z(J=>J.map(he=>he.id===hn.id?hn:he)),bn(Yt?hge():Fge(),"success")}catch(hn){if(!Ie())return;me(nN({error:Ce(hn instanceof Error?hn.message:String(hn))}))}}async function Xu(){const te=Y;if(!te){bn(lve(),"info");return}if(sr){me(J0e());return}me(null),K==="archived"&&ne("active");const ge=De.current;try{const{message:Ee}=await u2n(te);pt({type:"upsertMessage",sessionId:te,message:Ee})}catch(Ee){if(De.current.activeId!==ge.activeId)return;me(ame({error:Ce(Ee instanceof Error?Ee.message:String(Ee))}))}}function zo(te,ge,Ee){const Ie=vR(ge,Ee);ue(Ie.text),Tr(!0),!Ja(te)&&window.requestAnimationFrame(()=>{var Pe,Yt;(Pe=In.current)==null||Pe.focus(),(Yt=In.current)==null||Yt.setSelectionRange(Ie.cursor,Ie.cursor),Jr(Ie.cursor)})}const qs=A.useCallback(async(te=!1)=>{const ge=L.current;if(ge.projectId!==e||!Fn(Q.queryKey))return null;const Ee=(Je.getQueryData(Q.queryKey)??[]).map(Ie=>Ie.id);try{const Ie=await Je.fetchQuery({...Q,...te?{staleTime:0}:{}});if(L.current!==ge||!Fn(Q.queryKey))return null;const Pe=Ie.filter(vn=>!_l.has(vn.id)),Yt=new Set(Pe.map(vn=>vn.id));for(const vn of Ee)Yt.has(vn)||n_(vn);return Ot.current=new Map(Pe.map(vn=>[vn.id,vn.title])),Pe}catch{return null}},[e]),fs=A.useCallback(async te=>{L.current.projectId!==e||!Fn(Q.queryKey)||await Promise.all([Je.fetchQuery({...ol(te),staleTime:0}),qs(!0)]).catch(()=>{})},[e,qs]);A.useEffect(()=>{const te=_$();U(e===Fp?new Set([Rb,Mb].filter(Ee=>!te.has(Ee))):new Set),G(!1),ce(!1),Nt(new Map),Ot.current=new Map,qs();const ge=L.current;return()=>{L.current===ge&&(L.current={projectId:e})}},[e,qs]),A.useEffect(()=>{gr(Zp),gn.current=null},[Y]),A.useEffect(()=>Ov(te=>{switch(te.type){case"session":{if(te.session.projectId!==e||_l.has(te.session.id))return;const ge=Ot.current.has(te.session.id),Ee=Ot.current.get(te.session.id)!==te.session.title;Ot.current.set(te.session.id,te.session.title),ge&&Ee&&te.session.titleSource==="generated"&&(Nt(Ie=>{const Pe=new Map(Ie);return Pe.set(te.session.id,(Ie.get(te.session.id)??0)+1),Pe}),window.setTimeout(()=>{Nt(Ie=>{if(!Ie.has(te.session.id))return Ie;const Pe=new Map(Ie);return Pe.delete(te.session.id),Pe})},t$n));break}case"sessionDeleted":n_(te.sessionId);break}}),[e]),A.useEffect(()=>Ov(te=>{te.type==="reconnected"&&qs(!0)}),[qs]);const Ki=Y?At.messagesBySession[Y]??CR:CR,ka=Y?At.activeLeafBySession[Y]??null:null;an.current=ka;const pr=A.useMemo(()=>d9n(Ki,ka),[Ki,ka]),pc=A.useRef({projectId:e,ids:At.busySessions});A.useEffect(()=>{const te=pc.current;pc.current={projectId:e,ids:At.busySessions},te.projectId===e&&U(ge=>v9n(ge,te.ids,At.busySessions,V,i==="chat"?Y:null))},[e,At.busySessions,V,Y,i]);const sr=Y?At.busySessions.has(Y):!1,Mf=!sr&&!!(st!=null&&st.agentReady),mc=sr&&HB(pr)!=null,wl=sr&&g9n(pr),Ei=Y?At.queuedBySession[Y]??[]:[],ds=Ei.some(te=>te.dispatchState==="retrying"),eo=Ei.findIndex(te=>te.dispatchState==="blocked"),Wi=Ei.reduce((te,ge)=>ge.dispatchState!=="retrying"||typeof ge.nextRetryAt!="number"?te:te===null?ge.nextRetryAt:Math.min(te,ge.nextRetryAt),null),[to,Of]=A.useState(()=>Date.now());A.useEffect(()=>{if(!ds||Wi===null||(Of(Date.now()),Wi<=Date.now()))return;const te=window.setInterval(()=>{const ge=Date.now();Of(ge),ge>=Wi&&window.clearInterval(te)},1e3);return()=>window.clearInterval(te)},[ds,Wi]),A.useEffect(()=>{const te=Ei.reduce((ge,Ee)=>Ee.planMode??ge,void 0);te!==void 0?(Zt.current=!0,yt.current=te,kt(te)):Zt.current&&(Zt.current=!1,yt.current=null,kt(null))},[Ei]);const on=!!Y&&!(Y in At.messagesBySession)&&mt.isPending,Qi=A.useMemo(()=>{const te=new Set;for(const ge of At.busySessions)(At.messagesBySession[ge]??[]).some(Ee=>Ee.parts.some(Ie=>Ie.type==="prompt"&&Ie.prompt&&!Ie.prompt.resolved&&Ie.prompt.nativeId))&&te.add(ge);return te},[At.busySessions,At.messagesBySession]),ti=Y?Qi.has(Y):!1,Zn=$t,Yu=Zn?Ln.get(Zn.id):void 0,Ss=A.useMemo(()=>{var te;for(let ge=pr.length-1;ge>=0;ge--)for(const Ee of pr[ge].parts)if(Ee.type==="prompt"&&((te=Ee.prompt)==null?void 0:te.kind)==="plan"&&!Ee.prompt.resolved)return{promptId:Ee.id,plan:Ee.prompt.plan??"",synthesized:!!Ee.prompt.synthesized};return null},[pr]),ni=A.useMemo(()=>Y?m9n(pr,Zn==null?void 0:Zn.harness,At.busySessions.has(Y)):null,[pr,Zn==null?void 0:Zn.harness,Y,At.busySessions]),Ni=xi&&!ni,kl=te=>{if(ni||xi)return!1;const ge=K5(te),Ee=bi.find(Ie=>Ie.name===(ge??te));return!Ee||Ee.source!=="command"?!!Ee:ge&&f4(ge)?ge==="plan"||oe.trim().toLowerCase().startsWith(`/${te}`):oe.trim().toLowerCase()===`/${te}`},Zu=A.useMemo(()=>bi.filter(te=>te.source!=="command"),[bi]),[Sa,Df]=A.useState(null),jo=Sa&&Sa.sessionId===Y?Sa:null;A.useEffect(()=>{if(!Sa)return;const te=At.busySessions.has(Sa.sessionId),ge=Sa.sessionId===Y&&Ss&&Ss.promptId!==Sa.promptId;(!te||ge)&&Df(null)},[Sa,Ss,At.busySessions,Y]);const Qh=A.useMemo(()=>hC(pr),[pr]),ri=sr&&!!(st!=null&&st.supportsSteering)&&!!(st!=null&&st.agentReady)&&!Ss&&!ni&&!Qh&&We.length===0&&pe.length===0,gc=A.useMemo(()=>p&&Y?(te,ge,Ee)=>p(te,Y,ge,Ee):void 0,[p,Y]),Xh=A.useMemo(()=>m&&Y?(te,ge,Ee)=>m(Y,te,ge,Ee):void 0,[m,Y]),vc=A.useMemo(()=>o&&((te,ge,Ee,Ie,Pe)=>o(te,Y??void 0,ge,Ee,Ie,Pe)),[o,Y]);A.useEffect(()=>{He.current+=1,nt.current+=1;const te=(Y?At.queuedBySession[Y]??[]:[]).reduce((ge,Ee)=>Ee.planMode??ge,void 0);Zt.current=te!==void 0,yt.current=te??null,kt(te??null),Mn({}),me(null)},[Y]);const Sl=i==="chat"&&(pr.length>0||sr),Ca=(Vt==null?void 0:Vt.harness)??null,Lf=(Vt==null?void 0:Vt.model)??null,Cl=mt.data?null:mt.error,Ju=i==="chat"&&!Sl&&!on&&!Cl,El=ut({...uwn(e,Ca??"claude-code",Lf,E()),enabled:Ju&&Ca!==null,subscribed:Ju&&Ca!==null}),Ea=(Dl=El.data)!=null&&Dl.blank?r$n():((Es=El.data)==null?void 0:Es.prompts)??null,Nl=Ca!==null&&El.isPending,bc=e===Fp?"demo":"project",Yh=te=>{ue(te),Tr(!1),window.requestAnimationFrame(()=>{const ge=In.current;ge&&(ge.focus(),ge.setSelectionRange(te.length,te.length),Jr(te.length))})};A.useEffect(()=>{ht&&(ue(te=>te||ht),Tr(!1),Jr(ht.length))},[ht]),A.useEffect(()=>{if(v===0)return;const te=window.requestAnimationFrame(()=>{const ge=In.current;ge&&(ge.focus(),ge.setSelectionRange(ge.value.length,ge.value.length),ge.scrollIntoView({block:"nearest"}))});return()=>window.cancelAnimationFrame(te)},[v]);const e_=A.useId(),si=e===Fp&&oe===Hz&&!se,Zh=A.useCallback(te=>{const ge=te.scrollHeight-te.scrollTop-te.clientHeight<60;On.current=ge,jr(ge)},[]),no=A.useCallback(()=>{var te;On.current=!0,jr(!0),(te=nr.current)==null||te.call(nr)},[]);A.useEffect(()=>{const te=Hn.current,ge=zr.current;if(!te||!ge)return;const Ee=new ResizeObserver(()=>{var Ie;On.current?(Ie=nr.current)==null||Ie.call(nr):jr(te.scrollHeight-te.scrollTop-te.clientHeight<60)});return Ee.observe(te),Ee.observe(ge),()=>Ee.disconnect()},[Sl]);const Jh=A.useCallback(te=>{te.currentTarget.blur(),no()},[no]);async function zl({queue:te=!1}={}){var wc,kc,Pf,ji,s_,ai;const ge=oe.trim(),Ee=ni?null:NLn(ge,Jt==null?void 0:Jt.planActivation);if(Ee&&Ee.name!=="plan"){ue(f4(Ee.name)?"":Ee.prompt),Tr(!1),Ja(Ee.name,Ee.prompt);return}if(du({name:"first_action",surface:bc,action:"typed_prompt"}),mn.current)return;const Ie=!!Ee,Pe=!Vi,Yt=d4(Jt==null?void 0:Jt.planActivation,Ie?Pe:void 0,yt.current),vn=Ie&&(st==null?void 0:st.id)==="claude-code"?Pe?"plan":"auto":void 0,hn=Ee?Ee.prompt:ge,J=We,he=pe,je=he.map(zn=>({text:zn.text})),Be=e,Me=i;let it=Y;const at=()=>{const zn=De.current;return Fn(Q.queryKey)&&zn.projectId===Be&&zn.activeId===it&&zn.mainView===Me},Bt=()=>{at()&&(ue(zn=>zn||ge),Ne(zn=>zn.length?zn:J),be(zn=>zn.length?zn:he))};if(Ie&&!hn&&J.length===0&&he.length===0){ue(""),Tr(!1);try{if((st==null?void 0:st.id)==="claude-code")es(Pe?"plan":"auto");else if((Jt==null?void 0:Jt.planActivation)==="command")await Hs(Pe);else throw new Error(Yg())}catch{me(TN()),Bt()}return}const Kt=Vt?{...Vt,...vn?{permissionMode:vn}:{}}:null;vn&&es(vn);let Ns=null;const Os=yt.current;Ie&&(Jt==null?void 0:Jt.planActivation)==="command"&&(Ns=++nt.current,yt.current=Pe,kt(Pe));const ps=()=>{!at()||Ns===null||nt.current!==Ns||(yt.current=Os,kt(Os))};if(!hn&&J.length===0&&he.length===0)return;if((hn||he.length>0)&&ni&&J.length===0){ue(""),be([]),ii({promptId:ni,answers:[],note:hn||void 0,annotations:je}).then(zn=>{zn||Bt()});return}const ja=JSON.stringify({text:hn,images:J.map(zn=>({mediaType:zn.mediaType,name:zn.name,dataUrl:zn.dataUrl})),annotations:je,settings:Kt?{model:Kt.model,serviceTier:Kt.serviceTier,permissionMode:Kt.permissionMode,planMode:Yt,reasoningLevel:Kt.reasoningLevel}:null}),so=((wc=gn.current)==null?void 0:wc.signature)===ja?gn.current.id:`ct_${crypto.randomUUID()}`;if(gn.current={signature:ja,id:so},sr){if(!Y||!(st!=null&&st.agentReady)){ps();return}const zn=Y;ue(""),Ne([]),be([]),rt(null);const io=Kt?{model:Kt.model,serviceTier:Kt.serviceTier,permissionMode:Kt.permissionMode,planMode:(Jt==null?void 0:Jt.planActivation)==="command"?Yt??($t==null?void 0:$t.planMode):Yt,reasoningLevel:Kt.reasoningLevel}:{};at()&&Mn({});const Ta=J.map(Br=>({mediaType:Br.mediaType,dataBase64:Br.dataUrl.slice(Br.dataUrl.indexOf(",")+1),name:Br.name}));try{(kc=(await Yn(()=>qz(zn,hn,io,Ta.length?Ta:void 0,je,so,ri&&!te&&!Ie?"steer":void 0))).turn)!=null&&kc.existing&&await fs(zn),at()&&gr(Zp),((Pf=gn.current)==null?void 0:Pf.id)===so&&(gn.current=null)}catch{ps(),Bt()}return}if(!(st!=null&&st.agentReady)){ps();return}if(!Kt){ps();return}let zs=Y;try{ue(Jn=>Jn===oe?"":Jn),Ne(Jn=>Jn===J?[]:Jn),be(Jn=>Jn===he?[]:Jn),rt(null),mn.current=!0;try{if(!zs){const np=await Na(Kt,Yt);zs=np.id,it=np.id}if(!Fn(Q.queryKey))return;const Jn=ol(zs);await Je.fetchQuery({...Jn,...((ji=Je.getQueryState(Jn.queryKey))==null?void 0:ji.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{mn.current=!1}if(!Fn(Q.queryKey))return;pt({type:"optimisticUser",sessionId:zs,text:hn||Zpe(),attachments:J.map(Jn=>({url:Jn.dataUrl,mediaType:Jn.mediaType,name:Jn.name})),annotations:he}),pt({type:"busy",sessionId:zs,busy:!0}),at()&&no(),at()&&K==="archived"&&ne("active");const zn=Kt?{model:Kt.model,serviceTier:Kt.serviceTier,permissionMode:Kt.permissionMode,planMode:Yt,reasoningLevel:Kt.reasoningLevel}:{};at()&&Mn({});const io=J.map(Jn=>({mediaType:Jn.mediaType,dataBase64:Jn.dataUrl.slice(Jn.dataUrl.indexOf(",")+1),name:Jn.name})),Ta=zs;if(!Ta)throw new Error(c9e());(s_=(await Yn(()=>qz(Ta,hn,zn,io.length?io:void 0,je,so))).turn)!=null&&s_.existing&&await fs(Ta),at()&&gr(Zp),((ai=gn.current)==null?void 0:ai.id)===so&&(gn.current=null)}catch(zn){if(!Fn(Q.queryKey)||(Bt(),ps(),!zs))return;const io=zn instanceof Error?zn.message:String(zn);if(!/session is busy/i.test(io)&&await Je.fetchQuery({...Ga(e),staleTime:0}).then(Br=>{var Ll;return!!((Ll=Br.find(Jn=>Jn.id===zs))!=null&&Ll.busy)}).catch(()=>!1)){at()&&(ue(Br=>Br===hn?"":Br),Ne(Br=>Br===J?[]:Br),be(Br=>Br===he?[]:Br));return}pt({type:"busy",sessionId:zs,busy:!1}),pt({type:"localError",sessionId:zs,text:p1e({error:Ce(io)})})}}async function Na(te,ge){const Ee=De.current,Ie=L.current,Pe=await I.mutateAsync([e,te.harness,{model:te.model,serviceTier:te.serviceTier,permissionMode:te.permissionMode,planMode:ge,reasoningLevel:te.reasoningLevel}]);return L.current===Ie&&(Z(Yt=>[Pe,...Yt.filter(vn=>vn.id!==Pe.id)]),Je.getQueryData(Q.queryKey)||qs(!0)),L.current===Ie&&De.current===Ee&&(B.current(Pe.id,{replace:!0}),De.current={...Ee,activeId:Pe.id}),Pe}function ep(){const te=PLn(oe);ue(te),window.requestAnimationFrame(()=>{var ge,Ee;(ge=In.current)==null||ge.focus(),(Ee=In.current)==null||Ee.setSelectionRange(te.length,te.length),Jr(te.length)})}async function jl(){const te=yi;if(!te)return;if(me(null),sr){me(E0e());return}const ge=oe,Ee=De.current;let Ie=Y;const Pe=()=>{const J=De.current;return J.projectId===Ee.projectId&&J.activeId===Ie&&J.mainView===Ee.mainView},Yt=()=>{Pe()&&ue(J=>J||ge)};ue(""),Tr(!1);let vn=Y;if(!vn){if(!(st!=null&&st.agentReady)||!Vt){Yt(),me(Yg());return}try{const J=d4(Jt==null?void 0:Jt.planActivation,void 0,yt.current);vn=(await Na(Vt,J)).id,Ie=vn,Pe()&&Mn({})}catch(J){Yt();const he=J instanceof Error?J.message:String(J);Pe()&&me(eN({error:Ce(he)}));return}}Pe()&&K==="archived"&&ne("active");const hn=`${W_}shell-${Date.now()}`;pt({type:"localShell",sessionId:vn,id:hn,command:te}),Pe()&&no();try{const{message:J}=await _2n(vn,te);pt({type:"upsertMessage",sessionId:vn,message:J})}catch(J){const he=J instanceof Error?J.message:String(J);pt({type:"localShell",sessionId:vn,id:hn,command:te,error:eN({error:Ce(he)})})}}function Tl(){Y&&p2n(Y).catch(()=>{me(q9e())})}const Al=A.useCallback(async(te,ge)=>{if(!(!Y||fn.current)){fn.current=!0,me(null),Et(te);try{const Ee=S9n({model:mr.model,serviceTier:mr.serviceTier,permissionMode:mr.permissionMode,planMode:mr.planMode,reasoningLevel:mr.reasoningLevel}),Ie=Y;(await f2n(Ie,te,ge,Ee)).turn.existing&&await fs(Ie),gr(Zp)}catch{me(t8e())}finally{fn.current=!1,Et(null)}}},[Y,mr,fs]),t_=A.useCallback((te,ge)=>{if(!Y||sr||!(st!=null&&st.agentReady))return;const Ee=Y;pt({type:"busy",sessionId:Ee,busy:!0}),no(),Yn(()=>d2n(Ee,te,ge)).catch(Ie=>{pt({type:"busy",sessionId:Ee,busy:!1});const Pe=Ie instanceof Error?Ie.message:String(Ie);pt({type:"localError",sessionId:Ee,text:p8e({error:Ce(Pe)})})})},[Y,sr,st==null?void 0:st.agentReady,no,Yn]),If=A.useCallback(te=>{if(!Y||sr)return;const ge=Y,Ee=an.current;pt({type:"activeLeaf",sessionId:ge,leafId:te}),Yn(()=>h2n(ge,te)).catch(Ie=>{pt({type:"activeLeaf",sessionId:ge,leafId:Ee});const Pe=Ie instanceof Error?Ie.message:String(Ie);pt({type:"localError",sessionId:ge,text:X9e({error:Ce(Pe)})})})},[Y,sr,Yn]);function za(te){if(!Y)return;const ge=Y;o2n(ge,te).then(({removed:Ee})=>{if(Ee)return fs(ge)}).catch(()=>me(c8e()))}async function Rl(te){if(!Y||xn)return;const ge=Y;me(null),Ir(te);try{await c2n(ge,te),await fs(ge)}catch{me(j8e())}finally{Ir(null)}}A.useEffect(()=>{if(!sr||i!=="chat")return;function te(ge){var Ee;ge.key!=="Escape"||ge.defaultPrevented||(ge.preventDefault(),Tl(),(Ee=In.current)==null||Ee.focus())}return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[sr,Y,i]);function n_(te){Tb(te),ct.current.delete(te),dt.current===te&&(dt.current=null),De.current.projectId===e&&De.current.activeId===te&&De.current.mainView==="chat"&&(ue(""),Ne([]),be([]),B.current(null,{replace:!0})),U(ge=>{if(!ge.has(te))return ge;const Ee=new Set(ge);return Ee.delete(te),Ee}),Ot.current.delete(te)}function tp(te,ge){const Ee=te.archived;Z(Ie=>Ie.map(Pe=>Pe.id===te.id?{...Pe,archived:ge}:Pe)),$.mutateAsync([te.id,ge]).catch(()=>{Z(Ie=>Ie.map(Pe=>Pe.id===te.id?{...Pe,archived:Ee}:Pe))})}function Ms(te,ge){const Ee=te.title;Z(Ie=>Ie.map(Pe=>Pe.id===te.id?{...Pe,title:ge}:Pe)),q.mutateAsync([te.id,ge]).catch(()=>{Z(Ie=>Ie.map(Pe=>Pe.id===te.id?{...Pe,title:Ee}:Pe))})}async function $n(te){var Ee;const ge=((Ee=te.title)==null?void 0:Ee.trim())||xd();if(window.confirm(Eme({title:ia(ge)}))){try{await H.mutateAsync(te.id)}catch(Ie){bn(Mme({title:ia(ge),error:Ce(Ie instanceof Error?Ie.message:String(Ie))}),"error");return}n_(te.id)}}const ii=A.useCallback(te=>{if(!Y)return Promise.resolve(!1);const ge=Y;return pt({type:"busy",sessionId:ge,busy:!0}),Yn(()=>m2n(ge,te)).then(()=>!0).catch(()=>!1).finally(()=>{Fn(Q.queryKey)&&(Je.fetchQuery({...ol(ge),staleTime:0}).catch(()=>{}),Je.fetchQuery({...Ga(e),staleTime:0}).catch(()=>{}))})},[Y,e,Yn,Q]),To=V.filter(te=>YIn(K,te.archived)),yc=/Mac|iPhone|iPad/.test(navigator.platform),Ml=yc?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",hs=yc?"⌘ Enter":"Ctrl + Enter",zi=A.useCallback(()=>{ne("active"),y(null)},[y]),ro=A.useCallback(te=>{ne("all"),y(te)},[y]);A.useEffect(()=>{const te=ge=>{ge.repeat||ge.key!=="Enter"||!ge.metaKey&&!ge.ctrlKey||ge.altKey||!ge.shiftKey||(ge.preventDefault(),zi())};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[zi]);const xc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":Ml,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:zi,children:[f.jsx($h,{size:15}),q4e()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx(II,{size:15}),n2e()]}),vLn.map(te=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&te.activeTabs.includes(i)?"active":""}`,"data-onboarding":te.id==="compute"?"nav-compute":void 0,onClick:()=>a(te.id),children:[te.icon,te.label()]},te.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((r_=VH.find(te=>te.id===K))==null?void 0:r_.railLabel())??RD()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(ZIn,{value:K,onChange:ne})})]}),f.jsxs("div",{className:"rail-body",children:[To.map(te=>f.jsx(n$n,{session:te,active:te.id===Y&&i==="chat",unread:F.has(te.id),busy:At.busySessions.has(te.id),waiting:Qi.has(te.id),revealTitle:Ln.get(te.id),onOpen:()=>{if(y(te.id),e===Fp){Bkn(te.id);const ge=Fbn[te.id];ge&&(du({name:"demo_experiment_started",kind:"curated",experiment:ge}),du({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:ge=>Ms(te,ge),onSetArchived:ge=>tp(te,ge),onDelete:()=>void $n(te)},te.id)),To.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:K==="archived"?Q1e():V.length>0?D1e():nve()})]}),f.jsx(G$,{runtime:w})]}),Ol="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 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",Ao=!r&&f.jsx(Ft,{title:EN(),"aria-label":EN(),onClick:s,children:f.jsx(QI,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&xc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:Ao}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:N})]})]}):f.jsxs(f.Fragment,{children:[r&&xc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[Ao,f.jsxs("div",{className:Ol,children:[f.jsx(L0,{variant:"header",title:Zn?(($f=Zn.title)==null?void 0:$f.trim())||xd():rN(),children:Zn?f.jsx(KH,{title:((Bf=Zn.title)==null?void 0:Bf.trim())||xd(),animate:Yu!==void 0},Yu??"static"):rN()}),k&&f.jsx(Ft,{"data-tip":sN(),"aria-label":sN(),onClick:k,children:f.jsx(x3n,{size:15})})]})]}),Cl?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Cl.message}),f.jsx(Oe,{onClick:()=>void mt.refetch(),children:Ys()})]}):on?f.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:[f.jsx(jt,{}),f.jsx("span",{children:L4e()})]}):Sl?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:Hn,tabIndex:0,role:"region","aria-label":(($r=Zn==null?void 0:Zn.title)==null?void 0:$r.trim())||xd(),onScroll:te=>{Zh(te.currentTarget),wn.dismiss()},children:f.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:zr,children:[f.jsx(uH,{projectId:e,sessionId:Y,children:f.jsx(XIn,{scrollRef:Hn,scrollToEndRef:nr,stickToBottom:On,onPinToBottom:no,messages:pr,allMessages:Ki,canFork:Mf,onFork:t_,onSelectFork:If,busy:sr,onOpenFile:vc,onOpenRun:c,onOpenSpawnedSession:ro,runExperimentName:u,onOpenExperiment:h,experimentName:_,onRespond:ii,onOpenPlan:gc,onOpenSubagent:Xh,recoveringTurnId:_s,onRecover:Al,skills:Zu},Y)}),sr&&ti&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:LCe()}),sr&&!ti&&!mc&&!wl&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:uEe()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx(AS,{})}),f.jsx("h2",{children:qCe()}),f.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-medium",children:[f.jsx(Ou,{size:19}),f.jsx("span",{children:n})]}),Nl&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:TR,"aria-hidden":"true",children:jR.map((te,ge)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${y4[ge].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${y4[ge].icon}`,children:[f.jsx(te,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},ge))}),f.jsxs(Vr,{className:"mt-3",role:"status",children:[f.jsx(jt,{}),f.jsx("span",{children:L6e()})]})]}),Ea&&Ea.length>0&&f.jsx("div",{className:TR,role:"group","aria-label":q6e(),children:Ea.map((te,ge)=>{const Ee=jR[ge],Ie=y4[ge];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Ie.box}`,onClick:()=>{du({name:"project_starter_clicked",slot:ge+1}),du({name:"first_action",surface:bc,action:"starter_click"}),Yh(te.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ee,{size:17,className:Ie.icon}),te.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:te.prompt})]},ge)})})]}),wn.action&&f.jsxs(Oe,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:wn.action.x,top:wn.action.top,transform:"translateX(-50%)"},onMouseDown:te=>te.preventDefault(),onClick:wn.add,children:[f.jsx(WI,{size:14}),Ube()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_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:[Sl&&f.jsx(Ft,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${hr?"opacity-0":"opacity-100"}`,title:jN(),"aria-label":jN(),inert:hr,onClick:Jh,children:sr&&!ti?f.jsx(Ib,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(s3n,{size:16})}),Ss&&!(jo&&Ss.promptId===jo.promptId)&&f.jsx(SDn,{synthesized:Ss.synthesized,agentLabel:Zn?hu[Zn.harness]:rEe(),showResumeModes:(Zn==null?void 0:Zn.harness)==="claude-code",onView:te=>gc==null?void 0:gc(Ss.plan,Ss.promptId,te),onApprove:te=>ii({promptId:Ss.promptId,approve:!0,...te?{resumeMode:te}:{}}),onReject:()=>ii({promptId:Ss.promptId,approve:!1}),onRevise:te=>{Y&&Df({sessionId:Y,promptId:Ss.promptId}),ii({promptId:Ss.promptId,approve:!1,note:te})}}),Ei.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Ei.map((te,ge)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:te.error?`${te.text} -${te.error}`:te.text,children:[te.dispatchState==="blocked"?f.jsx(wS,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(N3n,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:te.text}),te.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:te.dispatchState==="retrying"?k9n(te.nextRetryAt,to):D7e()}),te.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void Rl(te.id),"aria-label":_J({text:te.text}),disabled:xn!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:xn===te.id?uL():Ys()}),f.jsx("button",{onClick:()=>za(te.id),"aria-label":sJ({text:te.text}),disabled:xn!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:G5e()}),ge===eo&&geza(te.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:f.jsx(_r,{size:11})})]},te.id))}),si&&f.jsxs("div",{id:e_,role:"note",className:`composer-demo-hint ${AR}`,children:[f.jsx(gh,{size:16,className:"shrink-0 text-primary"}),f.jsx("span",{className:"flex-1",dir:"auto",children:z2e()}),f.jsx(Ft,{size:"small","aria-label":Xg(),title:Xg(),onClick:()=>{var te;G(!0),(te=In.current)==null||te.focus()},children:f.jsx(_r,{size:14})})]}),b&&!ae&&c&&f.jsxs("div",{role:"note",className:`composer-demo-run-hint ${AR}`,children:[f.jsx(gh,{size:16,className:"shrink-0 text-primary"}),f.jsxs("span",{className:"flex flex-1 flex-wrap items-center gap-x-1.5 gap-y-1",dir:"auto",children:[f.jsx("span",{children:fN()}),f.jsxs(Oe,{size:"small",onClick:()=>c(b,"keepOpen"),children:[f.jsx(ko,{size:14}),u3()]}),f.jsx("span",{children:_N()})]}),f.jsx(Ft,{size:"small","aria-label":Xg(),title:Xg(),onClick:()=>{var te;ce(!0),(te=In.current)==null||te.focus()},children:f.jsx(_r,{size:14})})]}),f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:b?`${fN()} ${u3()} ${_N()}`:""}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${Ei?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[st&&!st.agentReady&&f.jsx("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:st.catalogPending?f.jsxs("span",{children:[st.name," — ",nf()]}):f.jsxs(f.Fragment,{children:[f.jsxs("strong",{children:[st.name," ",n4e()]})," ",st.agentNote?vh(st.agentNote):W7e()]})}),Rr&&f.jsx(OLn,{skills:Fs,activeIndex:ei,onPick:Za,onHover:rr}),Ke&&f.jsx(BLn,{activeSessionId:Y,onClose:()=>gt(!1),onResume:te=>{gt(!1),ne("all"),y(te.id,{projectId:te.projectId})},onImport:te=>{gt(!1),No(te)}}),pe.length>0&&f.jsx(oIn,{annotations:pe,onClear:()=>{be([]),window.requestAnimationFrame(()=>{var te;return(te=In.current)==null?void 0:te.focus()})},onRemove:te=>{const ge=pe.filter(Ee=>Ee.id!==te);be(ge),ge.length===0&&window.requestAnimationFrame(()=>{var Ee;return(Ee=In.current)==null?void 0:Ee.focus()})}}),We.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:We.map((te,ge)=>{const Ee=()=>Ne(Ie=>Ie.filter((Pe,Yt)=>Yt!==ge));return te.mediaType==="application/pdf"?f.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:te.name,children:[f.jsx($b,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:te.name??"document.pdf"}),f.jsx("button",{title:xN(),"aria-label":xN(),onClick:Ee,children:f.jsx(_r,{size:11})})]},ge):f.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:[f.jsx("img",{src:te.dataUrl,alt:TD()}),f.jsx("button",{title:wN(),"aria-label":wN(),onClick:Ee,children:f.jsx(_r,{size:11})})]},ge)})}),xe&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:xe}),Le&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Le}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${Ei?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:In,"aria-describedby":si?e_:void 0,className:"relative z-1 bg-transparent",value:oe,placeholder:ni?jEe():ri&&st?L9e({harness:Ce(hu[st.id]),shortcut:Ce(hs)}):Vt?st!=null&&st.agentReady?c1e({harness:Ce(hu[Vt.harness])}):Wge({harness:Ce(hu[Vt.harness])}):Gpe(),rows:2,onPaste:Ps,onDragOver:te=>{te.dataTransfer.types.includes("Files")&&te.preventDefault()},onDrop:te=>{te.dataTransfer.files.length!==0&&(te.preventDefault(),wa(Array.from(te.dataTransfer.files)))},onChange:te=>{const ge=te.target.value,Ee=te.target.selectionStart;Jr(Ee);const Ie=Ee>0&&/\s/.test(ge[Ee-1])&&!ni&&!Rs.current&&yR(ge)===null?_4(ge,Ee-1):null,Pe=Ie&&K5(Ie.query),Yt=Ie?(ge.slice(0,Ie.start)+ge.slice(Ie.end)).trim():"";if(Ie&&Pe&&(Pe==="plan"||!f4(Pe)&&!Yt)&&vi.some(vn=>vn.name===Pe)){zo(Pe,ge,Ie);return}ue(ge),Tr(!1)},onSelect:te=>Jr(te.currentTarget.selectionStart),onCompositionStart:()=>{Rs.current=!0},onCompositionEnd:()=>{Rs.current=!1},onKeyDown:te=>{if(Rr){if(te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();const ge=te.key==="ArrowDown"?1:-1;rr((ei+ge+Fs.length)%Fs.length);return}if(te.key==="Tab"||te.key==="Enter"){te.preventDefault(),Za(Fs[ei]);return}if(te.key==="Escape"){te.preventDefault(),Tr(!0);return}}if(te.key==="Backspace"&&Eo(te.currentTarget)){te.preventDefault();return}if(te.key==="Enter"&&!te.shiftKey&&!te.nativeEvent.isComposing){if(te.preventDefault(),Ei){jl();return}zl({queue:te.metaKey||te.ctrlKey})}}}),f.jsx(MLn,{text:oe,editingTokenEnd:Kr==null?void 0:Kr.end,isCommand:kl,skills:vi,projectId:e,textareaRef:In})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:Zr.ref,children:[f.jsx(Ft,{type:"button",className:"composer-bare",title:J2(),"aria-label":J2(),"aria-haspopup":"dialog","aria-expanded":Zr.open,onClick:()=>Zr.setOpen(te=>!te),children:f.jsx(Z5n,{size:16})}),Zr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:J2()}),f.jsx(F9n,{})]})]}),f.jsx("input",{ref:un,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:te=>{wa(Array.from(te.target.files??[])),te.target.value=""}}),f.jsx(Ft,{type:"button",className:"composer-attach",title:aN(),"aria-label":aN(),onClick:()=>{var te;return(te=un.current)==null?void 0:te.click()},children:f.jsx(R5n,{size:16})}),ks&&f.jsxs(Oe,{type:"button",variant:"ghost",active:!0,className:"group max-w-60",title:uN({goal:ia(ks)}),"aria-label":uN({goal:ia(ks)}),onClick:()=>void Si("clear"),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(GI,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(_r,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{className:"truncate",children:Qwe()})]}),Vi&&f.jsxs(Oe,{type:"button",variant:"ghost",active:!0,className:"group",title:mN(),"aria-label":mN(),onClick:()=>void Qu(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(u5n,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(_r,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:m3e()})]}),Ei&&f.jsxs(Oe,{type:"button",variant:"ghost",active:!0,className:"group",title:pN(),"aria-label":pN(),onClick:ep,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(Cf,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(_r,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:ED()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx(NSn,{value:Vt,onSelect:dc,onOpenSettings:()=>a("harnesses"),permissionChoices:st!=null&&st.agentReady?(Jt==null?void 0:Jt.permissionModes)??[]:[],defaultPermissionId:(Jt==null?void 0:Jt.defaultPermissionMode)??null,onSelectPermission:es,reasoningChoices:st!=null&&st.agentReady?wi.choices:[],defaultReasoningId:wi.defaultId,onSelectReasoning:ki,lockHarness:!!$t,openRequest:cr}),f.jsx(LLn,{usage:$t==null?void 0:$t.contextUsage})]}),sr&&!ni?f.jsx(Ft,{className:"send-btn",variant:"stop",title:NN(),"aria-label":NN(),onClick:Tl,children:f.jsx(_r,{size:16})}):f.jsx(Ft,{className:`send-btn ${si&&(st!=null&&st.agentReady)?"ring-2 ring-primary ring-offset-2 ring-offset-background":""}`,variant:"primary",title:Ei?SN():l3(),"aria-label":Ei?SN():l3(),onClick:()=>void(Ei?jl():zl()),disabled:Ei?!bi||!Y&&!(st!=null&&st.agentReady):!(st!=null&&st.agentReady)||!oe.trim()&&We.length===0&&pe.length===0,children:f.jsx(HI,{size:16})})]})]})]})]})]})}const AR="flex items-center gap-2.5 mb-2.5 py-2 ps-3.5 pe-2 rounded-lg border border-border bg-surface text-text text-sm leading-normal",i$n=[],a$n=[];function Pa({className:e,...n}){return f.jsx("div",{className:ys("relative flex min-h-0 flex-1 flex-col",e),...n})}function qd({className:e,...n}){return f.jsx("div",{className:ys("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Qo({className:e,...n}){return f.jsx("div",{className:ys("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const RR=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function o$n({projectId:e,sessionId:n,spawnPartId:t,onOpenFile:r,onOpenRun:s,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:c}){var k;const u=ut(ol(n)),h=((k=u.data)==null?void 0:k.messages)??(u.isError?[]:null),_=A.useRef(null),p=A.useRef(null),m=A.useRef(!0);if(A.useLayoutEffect(()=>{m.current=!0;const v=_.current;v&&(v.scrollTop=v.scrollHeight)},[n,t]),A.useLayoutEffect(()=>{const v=_.current;v&&m.current&&(v.scrollTop=v.scrollHeight)},[h]),A.useEffect(()=>{const v=_.current,b=p.current;if(!v||!b)return;const x=new ResizeObserver(()=>{m.current&&(v.scrollTop=v.scrollHeight)});return x.observe(b),x.observe(v),()=>x.disconnect()},[h===null]),h===null)return f.jsx(Pa,{children:f.jsx("div",{className:RR,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:Wfn()})})});let w=null;for(const v of h)if(w=lb(v.parts,t),w)break;return f.jsx(Pa,{children:f.jsx("div",{className:RR,ref:_,onScroll:v=>{const b=v.currentTarget;m.current=b.scrollHeight-b.scrollTop-b.clientHeight<60},children:f.jsx("div",{ref:p,children:w?f.jsx(uH,{projectId:e,sessionId:n,children:f.jsx(VIn,{spawn:w,onOpenFile:r,onOpenRun:s,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:c})}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:tdn()})})})})}function c$n({experiment:e}){var s;const n=ut(Q$(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(qd,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Qo,{children:[Ghe()," ",Ce(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(DB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(IB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?ipe():$he()}):f.jsx(Qo,{children:Zhe()})})}function WH({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:c}){return f.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:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":HNe(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:QNe()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:MD()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(zm,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(Ih,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(Gb,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Ft,{title:RN(),"aria-label":RN(),onClick:c,children:o?f.jsx(jt,{}):f.jsx(B5n,{size:13})})]})}const l$n=/\.(md|mdx|markdown)$/i,u$n=/\.tex$/i,_$n=/\.html?$/i,f$n=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,d$n=/\.(csv|tsv|xlsx?|ods)$/i,h$n=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,p$n=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,m$n=/\.pdf$/i,g$n=/\.(docx?|log|rtf|txt)$/i;function v$n(e){return f$n.test(e)}function pC(e){return l$n.test(e)}function QH(e){return u$n.test(e)}function b$n(e){return _$n.test(e)}function zh({name:e}){const n=pC(e)?"markdown":v$n(e)?"image":d$n.test(e)?"spreadsheet":h$n.test(e)?"code":p$n.test(e)?"archive":m$n.test(e)?"pdf":g$n.test(e)||QH(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.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"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.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"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.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 ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function XH(e,n){const t=navigator.clipboard;if(!t){bn(ID(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>bn(tf(),"success")).catch(r=>bn(r instanceof Error?r.message:String(r),"error"))}function YH({name:e,onCommit:n,onCancel:t}){const[r,s]=A.useState(e),i=A.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Ur,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":mBe({path:Ce(e)}),onFocus:o=>{const c=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,c>0?c:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function ZH(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function JH({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=A.useRef(null),c=A.useRef(a);c.current=a;const[u,h]=A.useState({x:e.x,y:e.y});A.useLayoutEffect(()=>{var k;const m=o.current;if(!m)return;const w=document.activeElement instanceof HTMLElement?document.activeElement:null;return h({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(k=m.querySelector("button"))==null||k.focus(),()=>{m.contains(document.activeElement)&&(w==null||w.focus())}},[e]),A.useEffect(()=>{const m=()=>c.current(),w=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||c.current()},k=v=>{if(v.key==="Tab"){v.preventDefault(),c.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),c.current())};return document.addEventListener("pointerdown",w),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",k,!0),()=>{document.removeEventListener("pointerdown",w),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",k,!0)}},[]);const _=m=>{c.current(),m()},p=(m,w,k=!1)=>f.jsx(Dn,{size:"compact",role:"menuitem",danger:k,onClick:()=>_(w),children:f.jsx("span",{children:m})});return Fi.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":nBe({path:Ce(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,x;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const w=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],k=w.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:w[0]),v=m.key==="ArrowDown"?1:-1;(x=w[(k+v+w.length)%w.length])==null||x.focus()},children:[p(lBe(),n),t&&p(zD(),t),r&&p(Q$e(),r),p(Ife(),s),i&&p(ND(),i,!0)]}),document.body)}const ek=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),MR=["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 OR(){return{dirs:new Map,files:[]}}function eq(e){const n=OR();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(ac,{size:13,className:MR}):f.jsx(Wa,{size:13,className:MR}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(mC,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:c,onRename:u,onCancelRename:h})]})}function mC({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:c,onCancelRename:u}){const h=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),_=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[h.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(y$n,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:c,onCancelRename:u},`d:${m}`)}),_.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&c&&u)return f.jsxs("div",{className:ek,style:{paddingInlineStart:8+t*14},children:[f.jsx(zh,{name:p}),f.jsx(YH,{name:p,onCommit:k=>c(m,k),onCancel:u})]},`f:${m}`);const w=Gr(k=>i(m,k));return f.jsxs("button",{type:"button",className:ek,style:{paddingInlineStart:8+t*14},...w,onContextMenu:k=>{o&&(k.preventDefault(),o(k,m))},onKeyDown:k=>{if(o&&(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10")){k.preventDefault(),o(k,m);return}w.onKeyDown(k)},title:TY({name:Ce(m)}),children:[f.jsx(zh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function x$n({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var z,E;const c=t.branchName,u=ut({...Y$(e,{ref:c}),enabled:r==="files",subscribed:r==="files"}),h=ut({...Uv(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),_=u.data,p=(z=u.error)==null?void 0:z.message,m=u.isFetching,w=Q$(t.id),k=oK({queryKey:w.queryKey})>0,v=(E=h.data)!=null&&E.exists&&h.data.branch===c?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},x=A.useMemo(()=>_?eq(_.entries):null,[_]),y=r==="files"?m:k,C=A.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(WH,{view:r,onViewChange:i,branchLabel:c,branchTitle:`Committed branch ${c}`,githubHref:n.githubEnabled?Ob(n.githubOwner,n.githubRepo,c):void 0,githubTitle:yD({branch:Ce(c)}),refreshing:y,onRefresh:()=>r==="files"?b():void Je.invalidateQueries(w)}),r==="changes"?f.jsx(c$n,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(_==null?void 0:_.truncated)&&f.jsx(Qo,{children:cze()}),p&&x&&f.jsxs(Qo,{children:[wze()," ",Ce(p)]}),f.jsx(qd,{children:x?x.dirs.size===0&&x.files.length===0?f.jsx(Qo,{children:pze()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(mC,{node:x,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,c,j)})}):f.jsx(Qo,{children:p?Wk({error:Ce(p)}):Qk()})})]})]})}function gC({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function w$n({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var B,L,F;const c=n.id,h=((B=ut(Ga(c)).data)==null?void 0:B.some(U=>U.id===e&&U.busy))??!1,_=ut({...Uv(e??""),enabled:!!e,refetchInterval:h?5e3:!1}),p=_.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},w=ut({...Y$(c,m),enabled:!e||_.isSuccess,refetchInterval:h?5e3:!1}),k=w.data,v=(L=_.error??w.error)==null?void 0:L.message,b=_.isFetching||w.isFetching,[x,y]=A.useState(null),[C,z]=A.useState(null),E=A.useCallback(()=>{e&&Je.invalidateQueries(Uv(e)),Je.invalidateQueries({queryKey:Tt("getCodeTree",c),predicate:U=>!fD(U)})},[e,c]),T=A.useRef(h);A.useEffect(()=>{T.current&&!h&&E(),T.current=h},[h,E]);const j=A.useMemo(()=>k?eq(k.entries):null,[k]),M=A.useCallback(U=>{const K=new Set(r);K.has(U)?K.delete(U):K.add(U),i(K)},[r,i]),D=e&&(p!=null&&p.exists)?p:null,I=(D==null?void 0:D.branch)??(D!=null&&D.baselineBranch?ibn({branch:Ce(D.baselineBranch)}):tS()),$=((F=D==null?void 0:D.files)==null?void 0:F.length)??0,q=D?Gvn({branch:Ce(`${I}${$>0?"*":""}`)}):Zvn({branch:Ce(n.baselineBranch)}),H=D?D.branch:n.baselineBranch,Q=(U,K)=>D?a(U,e,void 0,K):a(U,void 0,n.baselineBranch,K),V=(k==null?void 0:k.root)==="worktree",Z=async(U,K)=>{try{await vyn(c,U,K,{sessionId:e}),E()}catch(ne){bn(ne instanceof Error?ne.message:String(ne),"error")}},Y=U=>{const K=(k==null?void 0:k.path)??n.repoPath;XH(K,U)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(WH,{view:D?t:"files",onViewChange:s,showViewToggle:!!D,branchLabel:q,branchTitle:q,githubHref:n.githubEnabled&&H?Ob(n.githubOwner,n.githubRepo,H):void 0,githubTitle:H?yD({branch:Ce(H)}):void 0,refreshing:b,onRefresh:E}),v&&(p||k)&&f.jsxs(Qo,{children:[Pbn()," ",Ce(v)]}),!k||e&&!p?f.jsx(qd,{children:f.jsx(Qo,{children:v?Wk({error:Ce(v)}):Qk()})}):D&&t==="changes"?f.jsx(qd,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!D.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:Ebn()}):f.jsxs(f.Fragment,{children:[D.diff.truncated&&f.jsx(DB,{bytesRead:D.diff.bytesRead,byteLimit:D.diff.byteLimit}),f.jsx(IB,{diff:D.diff.diff,partial:D.diff.truncated})]})}):f.jsxs(qd,{children:[k.truncated&&f.jsx(Qo,{children:fbn()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(gC,{icon:Ou,title:Mbn(),description:PGe()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(mC,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Q,renamingPath:C,onContextMenu:(U,K)=>{y(ZH(U,K))},onRename:(U,K)=>{z(null),Z(U,{action:"rename",newName:K})},onCancelRename:()=>z(null)})}):f.jsx(Qo,{children:bbn()})]}),x&&f.jsx(JH,{target:x,onOpen:()=>Q(x.path,"keepOpen"),onRename:V&&o(x.path)?()=>z(x.path):void 0,onDuplicate:V?()=>void Z(x.path,{action:"duplicate"}):void 0,onCopyPath:()=>Y(x.path),onDelete:V?()=>{window.confirm(H$e({path:Ce(x.path)}))&&Z(x.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function tq({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=A.useMemo(()=>{if(!e)return[];const h=e.replace(/\r\n?/g,` +${te.error}`:te.text,children:[te.dispatchState==="blocked"?f.jsx(wS,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(N3n,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:te.text}),te.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:te.dispatchState==="retrying"?k9n(te.nextRetryAt,to):D7e()}),te.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void Rl(te.id),"aria-label":_J({text:te.text}),disabled:xn!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:xn===te.id?uL():Ys()}),f.jsx("button",{onClick:()=>za(te.id),"aria-label":sJ({text:te.text}),disabled:xn!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:G5e()}),ge===eo&&geza(te.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:f.jsx(_r,{size:11})})]},te.id))}),si&&f.jsxs("div",{id:e_,role:"note",className:`composer-demo-hint ${AR}`,children:[f.jsx(gh,{size:16,className:"shrink-0 text-primary"}),f.jsx("span",{className:"flex-1",dir:"auto",children:z2e()}),f.jsx(Ft,{size:"small","aria-label":Xg(),title:Xg(),onClick:()=>{var te;G(!0),(te=In.current)==null||te.focus()},children:f.jsx(_r,{size:14})})]}),b&&!ae&&c&&f.jsxs("div",{role:"note",className:`composer-demo-run-hint ${AR}`,children:[f.jsx(gh,{size:16,className:"shrink-0 text-primary"}),f.jsxs("span",{className:"flex flex-1 flex-wrap items-center gap-x-1.5 gap-y-1",dir:"auto",children:[f.jsx("span",{children:fN()}),f.jsxs(Oe,{size:"small",onClick:()=>c(b,"keepOpen"),children:[f.jsx(ko,{size:14}),u3()]}),f.jsx("span",{children:_N()})]}),f.jsx(Ft,{size:"small","aria-label":Xg(),title:Xg(),onClick:()=>{var te;ce(!0),(te=In.current)==null||te.focus()},children:f.jsx(_r,{size:14})})]}),f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:b?`${fN()} ${u3()} ${_N()}`:""}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${Ni?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[st&&!st.agentReady&&f.jsx("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:st.catalogPending?f.jsxs("span",{children:[st.name," — ",nf()]}):f.jsxs(f.Fragment,{children:[f.jsxs("strong",{children:[st.name," ",n4e()]})," ",st.agentNote?vh(st.agentNote):W7e()]})}),Rr&&f.jsx(OLn,{skills:Fs,activeIndex:ei,onPick:Za,onHover:rr}),Ke&&f.jsx(BLn,{activeSessionId:Y,onClose:()=>gt(!1),onResume:te=>{gt(!1),ne("all"),y(te.id,{projectId:te.projectId})},onImport:te=>{gt(!1),No(te)}}),pe.length>0&&f.jsx(oIn,{annotations:pe,onClear:()=>{be([]),window.requestAnimationFrame(()=>{var te;return(te=In.current)==null?void 0:te.focus()})},onRemove:te=>{const ge=pe.filter(Ee=>Ee.id!==te);be(ge),ge.length===0&&window.requestAnimationFrame(()=>{var Ee;return(Ee=In.current)==null?void 0:Ee.focus()})}}),We.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:We.map((te,ge)=>{const Ee=()=>Ne(Ie=>Ie.filter((Pe,Yt)=>Yt!==ge));return te.mediaType==="application/pdf"?f.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:te.name,children:[f.jsx($b,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:te.name??"document.pdf"}),f.jsx("button",{title:xN(),"aria-label":xN(),onClick:Ee,children:f.jsx(_r,{size:11})})]},ge):f.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:[f.jsx("img",{src:te.dataUrl,alt:TD()}),f.jsx("button",{title:wN(),"aria-label":wN(),onClick:Ee,children:f.jsx(_r,{size:11})})]},ge)})}),xe&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:xe}),Le&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Le}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${Ni?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:In,"aria-describedby":si?e_:void 0,className:"relative z-1 bg-transparent",value:oe,placeholder:ni?jEe():ri&&st?L9e({harness:Ce(hu[st.id]),shortcut:Ce(hs)}):Vt?st!=null&&st.agentReady?c1e({harness:Ce(hu[Vt.harness])}):Wge({harness:Ce(hu[Vt.harness])}):Gpe(),rows:2,onPaste:Ps,onDragOver:te=>{te.dataTransfer.types.includes("Files")&&te.preventDefault()},onDrop:te=>{te.dataTransfer.files.length!==0&&(te.preventDefault(),wa(Array.from(te.dataTransfer.files)))},onChange:te=>{const ge=te.target.value,Ee=te.target.selectionStart;Jr(Ee);const Ie=Ee>0&&/\s/.test(ge[Ee-1])&&!ni&&!Rs.current&&yR(ge)===null?_4(ge,Ee-1):null,Pe=Ie&&K5(Ie.query),Yt=Ie?(ge.slice(0,Ie.start)+ge.slice(Ie.end)).trim():"";if(Ie&&Pe&&(Pe==="plan"||!f4(Pe)&&!Yt)&&bi.some(vn=>vn.name===Pe)){zo(Pe,ge,Ie);return}ue(ge),Tr(!1)},onSelect:te=>Jr(te.currentTarget.selectionStart),onCompositionStart:()=>{Rs.current=!0},onCompositionEnd:()=>{Rs.current=!1},onKeyDown:te=>{if(Rr){if(te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();const ge=te.key==="ArrowDown"?1:-1;rr((ei+ge+Fs.length)%Fs.length);return}if(te.key==="Tab"||te.key==="Enter"){te.preventDefault(),Za(Fs[ei]);return}if(te.key==="Escape"){te.preventDefault(),Tr(!0);return}}if(te.key==="Backspace"&&Eo(te.currentTarget)){te.preventDefault();return}if(te.key==="Enter"&&!te.shiftKey&&!te.nativeEvent.isComposing){if(te.preventDefault(),Ni){jl();return}zl({queue:te.metaKey||te.ctrlKey})}}}),f.jsx(MLn,{text:oe,editingTokenEnd:Kr==null?void 0:Kr.end,isCommand:kl,skills:bi,projectId:e,textareaRef:In})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:Zr.ref,children:[f.jsx(Ft,{type:"button",className:"composer-bare",title:J2(),"aria-label":J2(),"aria-haspopup":"dialog","aria-expanded":Zr.open,onClick:()=>Zr.setOpen(te=>!te),children:f.jsx(Z5n,{size:16})}),Zr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:J2()}),f.jsx(F9n,{})]})]}),f.jsx("input",{ref:un,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:te=>{wa(Array.from(te.target.files??[])),te.target.value=""}}),f.jsx(Ft,{type:"button",className:"composer-attach",title:aN(),"aria-label":aN(),onClick:()=>{var te;return(te=un.current)==null?void 0:te.click()},children:f.jsx(R5n,{size:16})}),ks&&f.jsxs(Oe,{type:"button",variant:"ghost",active:!0,className:"group max-w-60",title:uN({goal:ia(ks)}),"aria-label":uN({goal:ia(ks)}),onClick:()=>void Ci("clear"),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(GI,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(_r,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{className:"truncate",children:Qwe()})]}),Vi&&f.jsxs(Oe,{type:"button",variant:"ghost",active:!0,className:"group",title:mN(),"aria-label":mN(),onClick:()=>void Qu(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(u5n,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(_r,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:m3e()})]}),Ni&&f.jsxs(Oe,{type:"button",variant:"ghost",active:!0,className:"group",title:pN(),"aria-label":pN(),onClick:ep,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(Cf,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(_r,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:ED()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx(NSn,{value:Vt,onSelect:dc,onOpenSettings:()=>a("harnesses"),permissionChoices:st!=null&&st.agentReady?(Jt==null?void 0:Jt.permissionModes)??[]:[],defaultPermissionId:(Jt==null?void 0:Jt.defaultPermissionMode)??null,onSelectPermission:es,reasoningChoices:st!=null&&st.agentReady?ki.choices:[],defaultReasoningId:ki.defaultId,onSelectReasoning:Si,lockHarness:!!$t,openRequest:cr}),f.jsx(LLn,{usage:$t==null?void 0:$t.contextUsage})]}),sr&&!ni?f.jsx(Ft,{className:"send-btn",variant:"stop",title:NN(),"aria-label":NN(),onClick:Tl,children:f.jsx(_r,{size:16})}):f.jsx(Ft,{className:`send-btn ${si&&(st!=null&&st.agentReady)?"ring-2 ring-primary ring-offset-2 ring-offset-background":""}`,variant:"primary",title:Ni?SN():l3(),"aria-label":Ni?SN():l3(),onClick:()=>void(Ni?jl():zl()),disabled:Ni?!yi||!Y&&!(st!=null&&st.agentReady):!(st!=null&&st.agentReady)||!oe.trim()&&We.length===0&&pe.length===0,children:f.jsx(HI,{size:16})})]})]})]})]})]})}const AR="flex items-center gap-2.5 mb-2.5 py-2 ps-3.5 pe-2 rounded-lg border border-border bg-surface text-text text-sm leading-normal",i$n=[],a$n=[];function Pa({className:e,...n}){return f.jsx("div",{className:ys("relative flex min-h-0 flex-1 flex-col",e),...n})}function qd({className:e,...n}){return f.jsx("div",{className:ys("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Qo({className:e,...n}){return f.jsx("div",{className:ys("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const RR=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function o$n({projectId:e,sessionId:n,spawnPartId:t,onOpenFile:r,onOpenRun:s,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:c}){var k;const u=ut(ol(n)),h=((k=u.data)==null?void 0:k.messages)??(u.isError?[]:null),_=A.useRef(null),p=A.useRef(null),m=A.useRef(!0);if(A.useLayoutEffect(()=>{m.current=!0;const v=_.current;v&&(v.scrollTop=v.scrollHeight)},[n,t]),A.useLayoutEffect(()=>{const v=_.current;v&&m.current&&(v.scrollTop=v.scrollHeight)},[h]),A.useEffect(()=>{const v=_.current,b=p.current;if(!v||!b)return;const x=new ResizeObserver(()=>{m.current&&(v.scrollTop=v.scrollHeight)});return x.observe(b),x.observe(v),()=>x.disconnect()},[h===null]),h===null)return f.jsx(Pa,{children:f.jsx("div",{className:RR,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:Wfn()})})});let w=null;for(const v of h)if(w=lb(v.parts,t),w)break;return f.jsx(Pa,{children:f.jsx("div",{className:RR,ref:_,onScroll:v=>{const b=v.currentTarget;m.current=b.scrollHeight-b.scrollTop-b.clientHeight<60},children:f.jsx("div",{ref:p,children:w?f.jsx(uH,{projectId:e,sessionId:n,children:f.jsx(VIn,{spawn:w,onOpenFile:r,onOpenRun:s,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:c})}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:tdn()})})})})}function c$n({experiment:e}){var s;const n=ut(Q$(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(qd,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Qo,{children:[Ghe()," ",Ce(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(DB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(IB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?ipe():$he()}):f.jsx(Qo,{children:Zhe()})})}function WH({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:c}){return f.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:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":HNe(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:QNe()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:MD()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(zm,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(Ih,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(Gb,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Ft,{title:RN(),"aria-label":RN(),onClick:c,children:o?f.jsx(jt,{}):f.jsx(B5n,{size:13})})]})}const l$n=/\.(md|mdx|markdown)$/i,u$n=/\.tex$/i,_$n=/\.html?$/i,f$n=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,d$n=/\.(csv|tsv|xlsx?|ods)$/i,h$n=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,p$n=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,m$n=/\.pdf$/i,g$n=/\.(docx?|log|rtf|txt)$/i;function v$n(e){return f$n.test(e)}function pC(e){return l$n.test(e)}function QH(e){return u$n.test(e)}function b$n(e){return _$n.test(e)}function zh({name:e}){const n=pC(e)?"markdown":v$n(e)?"image":d$n.test(e)?"spreadsheet":h$n.test(e)?"code":p$n.test(e)?"archive":m$n.test(e)?"pdf":g$n.test(e)||QH(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.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"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.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"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.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 ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function XH(e,n){const t=navigator.clipboard;if(!t){bn(ID(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>bn(tf(),"success")).catch(r=>bn(r instanceof Error?r.message:String(r),"error"))}function YH({name:e,onCommit:n,onCancel:t}){const[r,s]=A.useState(e),i=A.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Ur,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":mBe({path:Ce(e)}),onFocus:o=>{const c=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,c>0?c:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function ZH(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function JH({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=A.useRef(null),c=A.useRef(a);c.current=a;const[u,h]=A.useState({x:e.x,y:e.y});A.useLayoutEffect(()=>{var k;const m=o.current;if(!m)return;const w=document.activeElement instanceof HTMLElement?document.activeElement:null;return h({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(k=m.querySelector("button"))==null||k.focus(),()=>{m.contains(document.activeElement)&&(w==null||w.focus())}},[e]),A.useEffect(()=>{const m=()=>c.current(),w=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||c.current()},k=v=>{if(v.key==="Tab"){v.preventDefault(),c.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),c.current())};return document.addEventListener("pointerdown",w),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",k,!0),()=>{document.removeEventListener("pointerdown",w),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",k,!0)}},[]);const _=m=>{c.current(),m()},p=(m,w,k=!1)=>f.jsx(Dn,{size:"compact",role:"menuitem",danger:k,onClick:()=>_(w),children:f.jsx("span",{children:m})});return gi.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":nBe({path:Ce(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,x;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const w=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],k=w.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:w[0]),v=m.key==="ArrowDown"?1:-1;(x=w[(k+v+w.length)%w.length])==null||x.focus()},children:[p(lBe(),n),t&&p(zD(),t),r&&p(Q$e(),r),p(Ife(),s),i&&p(ND(),i,!0)]}),document.body)}const ek=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),MR=["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 OR(){return{dirs:new Map,files:[]}}function eq(e){const n=OR();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(ac,{size:13,className:MR}):f.jsx(Wa,{size:13,className:MR}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(mC,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:c,onRename:u,onCancelRename:h})]})}function mC({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:c,onCancelRename:u}){const h=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),_=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[h.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(y$n,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:c,onCancelRename:u},`d:${m}`)}),_.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&c&&u)return f.jsxs("div",{className:ek,style:{paddingInlineStart:8+t*14},children:[f.jsx(zh,{name:p}),f.jsx(YH,{name:p,onCommit:k=>c(m,k),onCancel:u})]},`f:${m}`);const w=Gr(k=>i(m,k));return f.jsxs("button",{type:"button",className:ek,style:{paddingInlineStart:8+t*14},...w,onContextMenu:k=>{o&&(k.preventDefault(),o(k,m))},onKeyDown:k=>{if(o&&(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10")){k.preventDefault(),o(k,m);return}w.onKeyDown(k)},title:TY({name:Ce(m)}),children:[f.jsx(zh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function x$n({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var z,N;const c=t.branchName,u=ut({...Y$(e,{ref:c}),enabled:r==="files",subscribed:r==="files"}),h=ut({...Uv(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),_=u.data,p=(z=u.error)==null?void 0:z.message,m=u.isFetching,w=Q$(t.id),k=oK({queryKey:w.queryKey})>0,v=(N=h.data)!=null&&N.exists&&h.data.branch===c?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},x=A.useMemo(()=>_?eq(_.entries):null,[_]),y=r==="files"?m:k,C=A.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(WH,{view:r,onViewChange:i,branchLabel:c,branchTitle:`Committed branch ${c}`,githubHref:n.githubEnabled?Ob(n.githubOwner,n.githubRepo,c):void 0,githubTitle:yD({branch:Ce(c)}),refreshing:y,onRefresh:()=>r==="files"?b():void Je.invalidateQueries(w)}),r==="changes"?f.jsx(c$n,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(_==null?void 0:_.truncated)&&f.jsx(Qo,{children:cze()}),p&&x&&f.jsxs(Qo,{children:[wze()," ",Ce(p)]}),f.jsx(qd,{children:x?x.dirs.size===0&&x.files.length===0?f.jsx(Qo,{children:pze()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(mC,{node:x,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,c,j)})}):f.jsx(Qo,{children:p?Wk({error:Ce(p)}):Qk()})})]})]})}function gC({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function w$n({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var B,L,F;const c=n.id,h=((B=ut(Ga(c)).data)==null?void 0:B.some(U=>U.id===e&&U.busy))??!1,_=ut({...Uv(e??""),enabled:!!e,refetchInterval:h?5e3:!1}),p=_.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},w=ut({...Y$(c,m),enabled:!e||_.isSuccess,refetchInterval:h?5e3:!1}),k=w.data,v=(L=_.error??w.error)==null?void 0:L.message,b=_.isFetching||w.isFetching,[x,y]=A.useState(null),[C,z]=A.useState(null),N=A.useCallback(()=>{e&&Je.invalidateQueries(Uv(e)),Je.invalidateQueries({queryKey:Tt("getCodeTree",c),predicate:U=>!fD(U)})},[e,c]),T=A.useRef(h);A.useEffect(()=>{T.current&&!h&&N(),T.current=h},[h,N]);const j=A.useMemo(()=>k?eq(k.entries):null,[k]),M=A.useCallback(U=>{const K=new Set(r);K.has(U)?K.delete(U):K.add(U),i(K)},[r,i]),D=e&&(p!=null&&p.exists)?p:null,I=(D==null?void 0:D.branch)??(D!=null&&D.baselineBranch?ibn({branch:Ce(D.baselineBranch)}):tS()),$=((F=D==null?void 0:D.files)==null?void 0:F.length)??0,q=D?Gvn({branch:Ce(`${I}${$>0?"*":""}`)}):Zvn({branch:Ce(n.baselineBranch)}),H=D?D.branch:n.baselineBranch,Q=(U,K)=>D?a(U,e,void 0,K):a(U,void 0,n.baselineBranch,K),V=(k==null?void 0:k.root)==="worktree",Z=async(U,K)=>{try{await vyn(c,U,K,{sessionId:e}),N()}catch(ne){bn(ne instanceof Error?ne.message:String(ne),"error")}},Y=U=>{const K=(k==null?void 0:k.path)??n.repoPath;XH(K,U)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(WH,{view:D?t:"files",onViewChange:s,showViewToggle:!!D,branchLabel:q,branchTitle:q,githubHref:n.githubEnabled&&H?Ob(n.githubOwner,n.githubRepo,H):void 0,githubTitle:H?yD({branch:Ce(H)}):void 0,refreshing:b,onRefresh:N}),v&&(p||k)&&f.jsxs(Qo,{children:[Pbn()," ",Ce(v)]}),!k||e&&!p?f.jsx(qd,{children:f.jsx(Qo,{children:v?Wk({error:Ce(v)}):Qk()})}):D&&t==="changes"?f.jsx(qd,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!D.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:Ebn()}):f.jsxs(f.Fragment,{children:[D.diff.truncated&&f.jsx(DB,{bytesRead:D.diff.bytesRead,byteLimit:D.diff.byteLimit}),f.jsx(IB,{diff:D.diff.diff,partial:D.diff.truncated})]})}):f.jsxs(qd,{children:[k.truncated&&f.jsx(Qo,{children:fbn()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(gC,{icon:Ou,title:Mbn(),description:PGe()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(mC,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Q,renamingPath:C,onContextMenu:(U,K)=>{y(ZH(U,K))},onRename:(U,K)=>{z(null),Z(U,{action:"rename",newName:K})},onCancelRename:()=>z(null)})}):f.jsx(Qo,{children:bbn()})]}),x&&f.jsx(JH,{target:x,onOpen:()=>Q(x.path,"keepOpen"),onRename:V&&o(x.path)?()=>z(x.path):void 0,onDuplicate:V?()=>void Z(x.path,{action:"duplicate"}):void 0,onCopyPath:()=>Y(x.path),onDelete:V?()=>{window.confirm(H$e({path:Ce(x.path)}))&&Z(x.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function tq({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=A.useMemo(()=>{if(!e)return[];const h=e.replace(/\r\n?/g,` `),_=F$(h,MS(n));return h.endsWith(` -`)?_.slice(0,-1):_},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=A.useRef(null);A.useEffect(()=>{var h;r!==void 0&&(a?((h=o.current)==null||h.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:c}=k$(i.length),u=A.useMemo(()=>i.map((h,_)=>f.jsxs("div",{ref:_+1===a?o:void 0,className:`file-view-line flex items-stretch ${_+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":_+1,className:`${w$} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${c}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${Hv} ${x$}`,children:H$(h)?f.jsx("br",{}):h})]},_)),[i,c,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${Hv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${c}ch`},"aria-hidden":"true"}),u]})}const k$n="modulepreload",S$n=function(e){return"/"+e},DR={},C$n=function(n,t,r){let s=Promise.resolve();if(t&&t.length>0){let a=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=a(t.map(u=>{if(u=S$n(u),u in DR)return;DR[u]=!0;const h=u.endsWith(".css"),_=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${_}`))return;const p=document.createElement("link");if(p.rel=h?"stylesheet":k$n,h||(p.as="script"),p.crossOrigin="",p.href=u,c&&p.setAttribute("nonce",c),document.head.appendChild(p),h)return new Promise((m,w)=>{p.addEventListener("load",m),p.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return n().catch(i)})},ub=A.createContext(null);function E$n({url:e,name:n}){return f.jsx(Ih,{size:"small",href:e,download:n,"aria-label":Sv({name:Ce(n)}),"data-tip":Sv({name:Ce(n)}),"data-tip-align":"end",children:f.jsx(Lb,{size:13})})}const N$n=A.lazy(()=>C$n(()=>import("./PdfPreview-1o-LUkLU.js"),__vite__mapDeps([0,1])).catch(e=>(console.error("PDF viewer failed to load",e),{default:rq})));function nq(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function rq({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[ktt()," ",f.jsxs("a",{href:e,download:n,children:[_3()," ",Ce(n)]})]})}function tk({kind:e,url:n,name:t,download:r=!0}){const[s,i]=A.useState(!1),a=A.useContext(ub);if(A.useEffect(()=>i(!1),[e,n]),s)return f.jsx(rq,{url:n,name:t});let o;return e==="image"?o=f.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:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?o=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?o=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):o=f.jsx(A.Suspense,{fallback:f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center",children:f.jsx(jt,{})}),children:f.jsx(N$n,{url:n,name:t,download:r,onError:()=>i(!0)},n)}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[o,r&&e!=="pdf"&&a&&Fi.createPortal(f.jsx(E$n,{url:n,name:t}),a)]})}const z$n=e=>({queryKey:Tt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function sq(e,n=!0){return ut({...z$n(e),enabled:n,subscribed:n}).data??null}function j$n(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function T$n(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),c=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const h=u.join("/");if(!h)return null;const _=new URLSearchParams(c);_.delete("path");const p=_.toString();return{path:h,url:`${sf(e,h)}${p?`&${p}`:""}${i}`}}function A$n(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` ----`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const iq="orx:files-tree-width",aq="orx:artifacts-collapsed:",oq=180,cq=320,R$n=8,M$n=280;function O$n(){try{const e=Number(localStorage.getItem(iq));if(Number.isFinite(e)&&e>=oq&&e<=cq)return e}catch{}return M$n}function D$n(e){try{const n=localStorage.getItem(`${aq}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function Q0(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=Q0(t.children??[],n);if(r)return r}}return null}function lq({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(j$n(i))return i;const a=T$n(e,n,i);if(!a)return null;const o=Q0(r,a.path);if(!o)return a.url;const c=a.url.indexOf("#"),u=c===-1?a.url:a.url.slice(0,c),h=c===-1?"":a.url.slice(c);return`${u}&v=${o.modifiedAt}:${o.size}${h}`};return f.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-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_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-prose-emphasis [&_.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-sm [&_.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]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_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-start [&_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-start [&_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]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-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-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_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:f.jsx(hTn,{remarkPlugins:[iH,[aH,fH]],rehypePlugins:[OF],components:{a:({href:i,children:a,...o})=>{const c=!i||i.startsWith("#"),u=c?i:s(i);return u?f.jsx("a",{...o,href:u,...c?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...dH},children:cH(A$n(t))})})}function L$n(e){return e.presentation==="text"&&pC(e.name)?"markdown":nq(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function I$n(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=ZL,i=d6(e,n.path),a=ut({...i,enabled:s,subscribed:s}),o=A.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});A.useEffect(()=>{const h=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&h.projectId===e&&h.path===n.path&&(h.modifiedAt!==n.modifiedAt||h.size!==n.size||h.version!==null&&h.version!==r)&&Je.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const c=a.data;return{text:c&&!c.binary?c.content:null,binary:(c==null?void 0:c.binary)??!1,truncated:(c==null?void 0:c.truncated)??!1,error:c?null:((u=a.error)==null?void 0:u.message)??(c===null?Ufe():null),wantsText:s}}function $$n({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=L$n(n),i=sq(sf(e,n.path)),{text:a,binary:o,truncated:c,error:u,wantsText:h}=I$n(e,n,s,i),[_,p]=A.useState(!1),[m,w]=A.useState(null),k=s==="markdown",v=n.path.split("/").slice(0,-1).join("/"),b=`${sf(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let x;return s==="image"||s==="audio"||s==="video"||s==="pdf"?x=f.jsx(ub.Provider,{value:m,children:f.jsx(tk,{kind:s,url:b,name:n.name})}):s==="download"||!h||o?x=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?Tfe():Ahe()," ",f.jsx("a",{href:b,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?$D():Yfe()})]}):u?x=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Sde()," ",Ce(u)]}):a===null?x=f.jsxs(Vr,{children:[f.jsx(jt,{})," ",SD()]}):k&&!_?x=f.jsx(lq,{projectId:e,folder:v,markdown:a,entries:r}):x=f.jsx(tq,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head @container flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(zh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ce(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0 @max-xl:hidden",children:[she()," ",new Date(n.modifiedAt).toLocaleString(N(),{dateStyle:"medium",timeStyle:"short"})]}),f.jsx("div",{ref:w,className:"contents"}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:nl(n.size)}),k&&f.jsx(Ft,{size:"small",active:_,"data-tip":_?Ev():zd(),"data-tip-align":"end","aria-label":_?Ev():zd(),onClick:()=>p(y=>!y),children:f.jsx(P3,{size:13})}),f.jsx(Ih,{size:"small",href:b,target:"_blank",rel:"noopener noreferrer","data-tip":ZE(),"data-tip-align":"end","aria-label":ZE(),children:f.jsx(of,{size:13})}),f.jsx(Ft,{size:"small","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),onClick:()=>{window.confirm(Gk({path:Ce(n.path)}))&&t(n.path)},children:f.jsx(Ef,{size:13})})]}),f.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 ${k&&!_?"doc":""}`,children:[x,c&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ade()})]})]})}function uq({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:h,onCancelRename:_}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var w;const m={paddingInlineStart:8+Math.min(n,R$n)*14};if(p.isDir){const k=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.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-start cursor-pointer font-[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:m,onClick:()=>s(p.path),children:[f.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":k?rfe({name:Ce(p.name)}):kfe({name:Ce(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Wa,{size:13,className:k?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Ft,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":gde(),"data-tip-align":"end","aria-label":mfe({name:Ce(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(Gk({path:Ce(p.path)}))&&o(p.path)},children:f.jsx(Ef,{size:12})})]}),k&&(((w=p.children)==null?void 0:w.length)??0)>0&&f.jsx(uq,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:h,onCancelRename:_})]},p.path)}return c===p.path?f.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-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(zh,{name:p.name}),f.jsx(YH,{name:p.name,onCommit:k=>h(p.path,k),onCancel:_})]},p.path):f.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-start cursor-pointer font-[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===p.path?"selected":""}`,style:m,title:qQ({path:Ce(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:k=>{k.preventDefault(),i(p.path),u(k,p.path)},onAuxClick:k=>{k.button===1&&(k.preventDefault(),i(p.path),a(p.path))},onKeyDown:k=>{if(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10"){k.preventDefault(),i(p.path),u(k,p.path);return}if(k.key===" "){k.preventDefault(),k.stopPropagation(),i(p.path);return}k.key==="Enter"&&(k.preventDefault(),k.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(zh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function B$n({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=A.useState(null),[a,o]=A.useState(()=>D$n(e.id)),[c,u]=A.useState(O$n),[h,_]=A.useState(null),[p,m]=A.useState(null),w=A.useRef(null);A.useEffect(()=>{try{localStorage.setItem(`${aq}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const k=E=>{var I;E.preventDefault(),E.currentTarget.setPointerCapture(E.pointerId);const T=(I=w.current)==null?void 0:I.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const q=Math.round($.clientX-((T==null?void 0:T.left)??0)),H=Math.min(Math.max(q,oq),cq);u(H);try{localStorage.setItem(iq,String(H))}catch{}},D=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",D),window.removeEventListener("pointercancel",D),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",D),window.addEventListener("pointercancel",D)};A.useEffect(()=>{if(!s||!n)return;const E=Q0(n.entries,s);(!E||E.isDir)&&i(null)},[s,n]);const v=E=>o(T=>{const j=new Set(T);return j.has(E)?j.delete(E):j.add(E),j}),b=E=>{(s===E||s!=null&&s.startsWith(E+"/"))&&i(null),Sxn(e.id,E).catch(()=>{})},x=async(E,T)=>{try{await Cxn(e.id,E,T),T.action==="rename"&&s===E&&i(null)}catch(j){bn(j instanceof Error?j.message:String(j),"error")}},y=E=>{n&&XH(n.dir,E)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(Vr,{className:"p-5",children:[f.jsx(jt,{})," ",Yde()]})});const C=E=>f.jsx(uq,{entries:E,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{_(ZH(T,j))},onRename:(T,j)=>{m(null),x(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),z=s?Q0(n.entries,s):null;return n.entries.length===0?f.jsx(gC,{icon:vS,title:_he(),description:She()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:w,style:{width:c},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:k}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:$de()})]})]}),z?f.jsx($$n,{projectId:e.id,entry:z,onDelete:b,artifactEntries:n.entries},z.path):f.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-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(N5n,{size:22,strokeWidth:1.5}),f.jsx("span",{children:sde()})]}),h&&f.jsx(JH,{target:h,onOpen:()=>t(h.path),onRename:r(h.path)?()=>m(h.path):void 0,onDuplicate:()=>void x(h.path,{action:"duplicate"}),onCopyPath:()=>y(h.path),onDelete:()=>{window.confirm(Gk({path:Ce(h.path)}))&&b(h.path)},onClose:()=>_(null)})]})}const _q=20*1024*1024,fq="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-base [&_h3]:font-semibold [&_h3]:text-text",dq="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",P$n="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",F$n="text-sm font-normal text-text",H$n="mt-1 mb-0 text-sm leading-relaxed text-text";function hq(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function q$n(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function pq({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=A.useState(!1),a=A.useRef(null);return f.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 text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const c=(u=o.dataTransfer.files)==null?void 0:u[0];c&&r(c)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var c;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(c=a.current)==null||c.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const c=(u=o.target.files)==null?void 0:u[0];c&&r(c),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(jt,{}),f.jsx("span",{children:hcn()})]}):f.jsxs(f.Fragment,{children:[f.jsx(nkn,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function mq({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[nl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",wo(n)]})]})}function U$n({skill:e,onError:n}){const t=dn({mutationFn:Wxn}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:F$n,children:e.name}),e.origin&&f.jsx(Wt,{size:"small",children:e.origin})]}),f.jsx(mq,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Ft,{size:"small","data-tip":e.origin?gan():fon(),"data-tip-align":"end","aria-label":e.origin?Aan({name:Ce(e.name)}):lin({name:Ce(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?San({name:Ce(e.name)}):nin({name:Ce(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Ef,{size:13})})]})}function G$n({template:e,onError:n}){const t=dn({mutationFn:Gxn}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:P$n,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:H$n,children:[e.entry,s>0&&(s===1?ran():$an({count:tn(s)}))]})]}),f.jsx(mq,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Ft,{"data-tip":bon(),"data-tip-align":"end","aria-label":kin({name:Ce(e.name)}),disabled:r,onClick:()=>{window.confirm(min({name:Ce(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Ef,{size:13})})]})}function V$n(){var x;const e=dn({mutationFn:Kxn}),n=ut(B2n()),t=n.data,r=A.useRef(null),[s,i]=A.useState(!1),[a,o]=A.useState(!1),c=A.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);A.useLayoutEffect(()=>{c();const y=r.current;if(!y)return;const C=new ResizeObserver(c);return C.observe(y),()=>C.disconnect()},[t,c]);const u=n.isFetching,h=(x=n.error)==null?void 0:x.message,[_,p]=A.useState(!1),[m,w]=A.useState(null),k=()=>{n.refetch()},v=A.useRef(!1),b=A.useCallback(async y=>{if(!v.current){if(w(null),!q$n(y.name)){w(zcn());return}if(y.size>_q){w(OL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await hq(y)})}catch(C){w(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:fq,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:ocn()}),f.jsxs(Oe,{className:"ms-auto",size:"small",onClick:k,disabled:u,children:[f.jsx(Qa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Cm()]})]}),f.jsx("p",{className:dq,children:Tin()}),f.jsx(pq,{accept:".md,.markdown,.zip",busy:_,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Iin()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Qsn()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),h&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[Gan()," ",h]}),t===void 0?h?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",Mon()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Kon()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:c,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(U$n,{skill:y,onError:w},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function K$n(){var h;const e=dn({mutationFn:Uxn}),n=ut($2n()),t=n.data,r=(h=n.error)==null?void 0:h.message,[s,i]=A.useState(!1),[a,o]=A.useState(null),c=A.useRef(!1),u=A.useCallback(async _=>{if(c.current)return;o(null);const p=_.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(Dcn());return}if(_.size>_q){o(OL());return}c.current=!0,i(!0);try{await e.mutateAsync({filename:_.name,contentBase64:await hq(_)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{c.current=!1,i(!1)}},[]);return f.jsxs("section",{className:fq,children:[f.jsx("h3",{children:Eon()}),f.jsx("p",{className:dq,children:xcn()}),f.jsx(pq,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Uin()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:wdn()})]}),onFile:_=>void u(_)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[Zan()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",Pon()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:ecn()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(_=>f.jsx(G$n,{template:_,onError:o},_.name))})]})}function W$n(){return f.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:[f.jsx("h1",{children:ion()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:uan()}),f.jsx(V$n,{}),f.jsx(K$n,{})]})}const Q$n="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function qc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-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-hover-strong [&_.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-0 [&: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]:-start-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]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?Q$n:""}`,onClick:i,onDoubleClick:a,title:s?pdn({label:n}):n,"aria-label":s?cdn({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:jNe(),onPointerDown:c=>c.preventDefault(),onClick:c=>{c.stopPropagation(),o()},children:f.jsx(_r,{size:12})})]})}const LR=["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 X$n({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:LR,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:LR,href:Ob(e,n,t),target:"_blank",rel:"noopener noreferrer",title:Cv({name:Ce(t)}),children:[f.jsx("code",{children:t}),f.jsx(Gb,{size:12})]})}const x4=["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-sm","[&_h2]:font-semibold"].join(" "),IR=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function $R(e){return new Date(e).toLocaleString(N(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function BR(e,n){return R0((e.endedAt??n)-e.createdAt)}function Y$n({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(h=>h.status==="running"||h.status==="starting"),[c,u]=A.useState(()=>Date.now());return A.useEffect(()=>{if(!o)return;u(Date.now());const h=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(h)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.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:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx(cl,{status:a?la(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Oe,{...Gr(h=>s(a.id,h)),children:[f.jsx(ko,{size:15}),fLe()]}),f.jsxs(Oe,{...Gr(i),children:[f.jsx(Bb,{size:15}),gDe()]})]}),e.description&&f.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-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:$De()}),f.jsx(nc,{text:e.description})]}),f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:a?uDe():PLe()}),a&&f.jsxs(f.Fragment,{children:[f.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:[f.jsx(cl,{status:la(a)}),f.jsx(RS,{backend:a.backend}),f.jsxs("span",{title:MLe(),children:[f.jsx(f3n,{size:13}),$R(a.createdAt)]}),f.jsxs("span",{title:GDe(),children:[f.jsx(C3n,{size:13}),BR(a,c)]}),a.commitSha&&f.jsxs("span",{title:SDe(),children:[f.jsx(t5n,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[ZDe()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:IR,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(nc,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:"Git"}),f.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:[f.jsx(X$n,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[iLe()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:$R(e.createdAt),children:[ADe()," ",wo(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:IR,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:ELe()}),f.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-start [&_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((h,_)=>f.jsxs("button",{...Gr(p=>s(h.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[bLe()," ",r.length-_]}),f.jsx(cl,{status:la(h)}),f.jsx("span",{children:wo(h.createdAt)}),f.jsx("span",{children:BR(h,c)}),f.jsx(ko,{size:13})]},h.id))})]})]})})}function PR(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=Fb(t,!0);let i=!1,a=0,o=!1,c=!1;async function u(){if(o){c=!0;return}o=!0;try{for(;;){const _=await fyn(e,a);if(i)return;if(_.dataBase64&&r.write(PR(_.dataBase64)),a=_.nextOffset,_.eof)break}}catch{}finally{o=!1,c&&!i&&(c=!1,u())}}const h=K2n(e,_=>{if(i)return;const p=PR(_.dataBase64);!o&&_.offset===a?(r.write(p),a+=p.length):_.offset+p.length>a&&u()});return u(),()=>{i=!0,h(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function J$n({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:c}){const u=r.filter(h=>h.experimentId===e.id).sort((h,_)=>_.createdAt-h.createdAt);return t==="overview"?f.jsx(Y$n,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(h,_)=>o("terminal",h,_),onOpenCode:h=>c("files",h)}):f.jsx(eBn,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function eBn({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=A.useState(null),[a,o]=A.useState(null),[c,u]=A.useState(!1),h=A.useRef(null),_=t?n.find(v=>v.id===t)??null:n[0]??null,p=(_==null?void 0:_.status)==="running"||(_==null?void 0:_.status)==="starting",m=!!(_&&p&&(_.cancelRequested||a===_.id)),w=v=>{const b=n.findIndex(x=>x.id===v);return b===-1?n.length:n.length-b};A.useEffect(()=>{if(!c)return;const v=b=>{var x;(x=h.current)!=null&&x.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c]);async function k(){if(_){i(null),o(_.id);try{await UL(_.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.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:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Oe,{size:"small",variant:"ghost",disabled:m,onClick:()=>void k(),children:[f.jsx(PI,{size:13}),m?jze():DD()]}),n.length>0&&_&&f.jsxs("div",{className:"run-history relative shrink-0",ref:h,children:[f.jsxs(Oe,{title:tOe(),"aria-expanded":c,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[MN()," ",w(_.id)]}),f.jsx(cl,{status:m?"cancelling":la(_)}),f.jsx(ac,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),c&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(Dn,{className:"justify-start",active:v.id===(_==null?void 0:_.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[MN()," ",w(v.id)]}),f.jsx(cl,{status:la(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:wo(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:_?f.jsx(Z$n,{runId:_.id},_.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?go():HMe()})})]})}let nk=!1;function FR(e){nk=!0;try{return window.confirm(e)}finally{nk=!1}}const rk=e=>e.replace(/\r\n/g,` +`)?_.slice(0,-1):_},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=A.useRef(null);A.useEffect(()=>{var h;r!==void 0&&(a?((h=o.current)==null||h.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:c}=k$(i.length),u=A.useMemo(()=>i.map((h,_)=>f.jsxs("div",{ref:_+1===a?o:void 0,className:`file-view-line flex items-stretch ${_+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":_+1,className:`${w$} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${c}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${Hv} ${x$}`,children:H$(h)?f.jsx("br",{}):h})]},_)),[i,c,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${Hv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${c}ch`},"aria-hidden":"true"}),u]})}const k$n="modulepreload",S$n=function(e){return"/"+e},DR={},C$n=function(n,t,r){let s=Promise.resolve();if(t&&t.length>0){let a=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=a(t.map(u=>{if(u=S$n(u),u in DR)return;DR[u]=!0;const h=u.endsWith(".css"),_=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${_}`))return;const p=document.createElement("link");if(p.rel=h?"stylesheet":k$n,h||(p.as="script"),p.crossOrigin="",p.href=u,c&&p.setAttribute("nonce",c),document.head.appendChild(p),h)return new Promise((m,w)=>{p.addEventListener("load",m),p.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return n().catch(i)})},ub=A.createContext(null);function E$n({url:e,name:n}){return f.jsx(Ih,{size:"small",href:e,download:n,"aria-label":Sv({name:Ce(n)}),"data-tip":Sv({name:Ce(n)}),"data-tip-align":"end",children:f.jsx(Lb,{size:13})})}const N$n=A.lazy(()=>C$n(()=>import("./PdfPreview-DzpsHCnD.js"),__vite__mapDeps([0,1])).catch(e=>(console.error("PDF viewer failed to load",e),{default:rq})));function nq(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function rq({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[ktt()," ",f.jsxs("a",{href:e,download:n,children:[_3()," ",Ce(n)]})]})}function tk({kind:e,url:n,name:t,download:r=!0}){const[s,i]=A.useState(!1),a=A.useContext(ub);if(A.useEffect(()=>i(!1),[e,n]),s)return f.jsx(rq,{url:n,name:t});let o;return e==="image"?o=f.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:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?o=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?o=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):o=f.jsx(A.Suspense,{fallback:f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center",children:f.jsx(jt,{})}),children:f.jsx(N$n,{url:n,name:t,download:r,onError:()=>i(!0)},n)}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[o,r&&e!=="pdf"&&a&&gi.createPortal(f.jsx(E$n,{url:n,name:t}),a)]})}const z$n=e=>({queryKey:Tt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function sq(e,n=!0){return ut({...z$n(e),enabled:n,subscribed:n}).data??null}function j$n(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function T$n(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),c=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const h=u.join("/");if(!h)return null;const _=new URLSearchParams(c);_.delete("path");const p=_.toString();return{path:h,url:`${sf(e,h)}${p?`&${p}`:""}${i}`}}function A$n(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` +---`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const iq="orx:files-tree-width",aq="orx:artifacts-collapsed:",oq=180,cq=320,R$n=8,M$n=280;function O$n(){try{const e=Number(localStorage.getItem(iq));if(Number.isFinite(e)&&e>=oq&&e<=cq)return e}catch{}return M$n}function D$n(e){try{const n=localStorage.getItem(`${aq}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function Q0(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=Q0(t.children??[],n);if(r)return r}}return null}function lq({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(j$n(i))return i;const a=T$n(e,n,i);if(!a)return null;const o=Q0(r,a.path);if(!o)return a.url;const c=a.url.indexOf("#"),u=c===-1?a.url:a.url.slice(0,c),h=c===-1?"":a.url.slice(c);return`${u}&v=${o.modifiedAt}:${o.size}${h}`};return f.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-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_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-prose-emphasis [&_.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-sm [&_.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]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_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-start [&_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-start [&_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]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-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-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_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:f.jsx(hTn,{remarkPlugins:[iH,[aH,fH]],rehypePlugins:[OF],components:{a:({href:i,children:a,...o})=>{const c=!i||i.startsWith("#"),u=c?i:s(i);return u?f.jsx("a",{...o,href:u,...c?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...dH},children:cH(A$n(t))})})}function L$n(e){return e.presentation==="text"&&pC(e.name)?"markdown":nq(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function I$n(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=ZL,i=d6(e,n.path),a=ut({...i,enabled:s,subscribed:s}),o=A.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});A.useEffect(()=>{const h=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&h.projectId===e&&h.path===n.path&&(h.modifiedAt!==n.modifiedAt||h.size!==n.size||h.version!==null&&h.version!==r)&&Je.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const c=a.data;return{text:c&&!c.binary?c.content:null,binary:(c==null?void 0:c.binary)??!1,truncated:(c==null?void 0:c.truncated)??!1,error:c?null:((u=a.error)==null?void 0:u.message)??(c===null?Ufe():null),wantsText:s}}function $$n({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=L$n(n),i=sq(sf(e,n.path)),{text:a,binary:o,truncated:c,error:u,wantsText:h}=I$n(e,n,s,i),[_,p]=A.useState(!1),[m,w]=A.useState(null),k=s==="markdown",v=n.path.split("/").slice(0,-1).join("/"),b=`${sf(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let x;return s==="image"||s==="audio"||s==="video"||s==="pdf"?x=f.jsx(ub.Provider,{value:m,children:f.jsx(tk,{kind:s,url:b,name:n.name})}):s==="download"||!h||o?x=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?Tfe():Ahe()," ",f.jsx("a",{href:b,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?$D():Yfe()})]}):u?x=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Sde()," ",Ce(u)]}):a===null?x=f.jsxs(Vr,{children:[f.jsx(jt,{})," ",SD()]}):k&&!_?x=f.jsx(lq,{projectId:e,folder:v,markdown:a,entries:r}):x=f.jsx(tq,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head @container flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(zh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ce(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0 @max-xl:hidden",children:[she()," ",new Date(n.modifiedAt).toLocaleString(E(),{dateStyle:"medium",timeStyle:"short"})]}),f.jsx("div",{ref:w,className:"contents"}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:nl(n.size)}),k&&f.jsx(Ft,{size:"small",active:_,"data-tip":_?Ev():zd(),"data-tip-align":"end","aria-label":_?Ev():zd(),onClick:()=>p(y=>!y),children:f.jsx(P3,{size:13})}),f.jsx(Ih,{size:"small",href:b,target:"_blank",rel:"noopener noreferrer","data-tip":ZE(),"data-tip-align":"end","aria-label":ZE(),children:f.jsx(of,{size:13})}),f.jsx(Ft,{size:"small","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),onClick:()=>{window.confirm(Gk({path:Ce(n.path)}))&&t(n.path)},children:f.jsx(Ef,{size:13})})]}),f.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 ${k&&!_?"doc":""}`,children:[x,c&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ade()})]})]})}function uq({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:h,onCancelRename:_}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var w;const m={paddingInlineStart:8+Math.min(n,R$n)*14};if(p.isDir){const k=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.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-start cursor-pointer font-[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:m,onClick:()=>s(p.path),children:[f.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":k?rfe({name:Ce(p.name)}):kfe({name:Ce(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Wa,{size:13,className:k?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Ft,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":gde(),"data-tip-align":"end","aria-label":mfe({name:Ce(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(Gk({path:Ce(p.path)}))&&o(p.path)},children:f.jsx(Ef,{size:12})})]}),k&&(((w=p.children)==null?void 0:w.length)??0)>0&&f.jsx(uq,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:h,onCancelRename:_})]},p.path)}return c===p.path?f.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-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(zh,{name:p.name}),f.jsx(YH,{name:p.name,onCommit:k=>h(p.path,k),onCancel:_})]},p.path):f.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-start cursor-pointer font-[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===p.path?"selected":""}`,style:m,title:qQ({path:Ce(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:k=>{k.preventDefault(),i(p.path),u(k,p.path)},onAuxClick:k=>{k.button===1&&(k.preventDefault(),i(p.path),a(p.path))},onKeyDown:k=>{if(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10"){k.preventDefault(),i(p.path),u(k,p.path);return}if(k.key===" "){k.preventDefault(),k.stopPropagation(),i(p.path);return}k.key==="Enter"&&(k.preventDefault(),k.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(zh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function B$n({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=A.useState(null),[a,o]=A.useState(()=>D$n(e.id)),[c,u]=A.useState(O$n),[h,_]=A.useState(null),[p,m]=A.useState(null),w=A.useRef(null);A.useEffect(()=>{try{localStorage.setItem(`${aq}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const k=N=>{var I;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const T=(I=w.current)==null?void 0:I.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const q=Math.round($.clientX-((T==null?void 0:T.left)??0)),H=Math.min(Math.max(q,oq),cq);u(H);try{localStorage.setItem(iq,String(H))}catch{}},D=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",D),window.removeEventListener("pointercancel",D),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",D),window.addEventListener("pointercancel",D)};A.useEffect(()=>{if(!s||!n)return;const N=Q0(n.entries,s);(!N||N.isDir)&&i(null)},[s,n]);const v=N=>o(T=>{const j=new Set(T);return j.has(N)?j.delete(N):j.add(N),j}),b=N=>{(s===N||s!=null&&s.startsWith(N+"/"))&&i(null),Sxn(e.id,N).catch(()=>{})},x=async(N,T)=>{try{await Cxn(e.id,N,T),T.action==="rename"&&s===N&&i(null)}catch(j){bn(j instanceof Error?j.message:String(j),"error")}},y=N=>{n&&XH(n.dir,N)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(Vr,{className:"p-5",children:[f.jsx(jt,{})," ",Yde()]})});const C=N=>f.jsx(uq,{entries:N,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{_(ZH(T,j))},onRename:(T,j)=>{m(null),x(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),z=s?Q0(n.entries,s):null;return n.entries.length===0?f.jsx(gC,{icon:vS,title:_he(),description:She()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:w,style:{width:c},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:k}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:$de()})]})]}),z?f.jsx($$n,{projectId:e.id,entry:z,onDelete:b,artifactEntries:n.entries},z.path):f.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-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(N5n,{size:22,strokeWidth:1.5}),f.jsx("span",{children:sde()})]}),h&&f.jsx(JH,{target:h,onOpen:()=>t(h.path),onRename:r(h.path)?()=>m(h.path):void 0,onDuplicate:()=>void x(h.path,{action:"duplicate"}),onCopyPath:()=>y(h.path),onDelete:()=>{window.confirm(Gk({path:Ce(h.path)}))&&b(h.path)},onClose:()=>_(null)})]})}const _q=20*1024*1024,fq="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-base [&_h3]:font-semibold [&_h3]:text-text",dq="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",P$n="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",F$n="text-sm font-normal text-text",H$n="mt-1 mb-0 text-sm leading-relaxed text-text";function hq(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function q$n(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function pq({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=A.useState(!1),a=A.useRef(null);return f.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 text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const c=(u=o.dataTransfer.files)==null?void 0:u[0];c&&r(c)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var c;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(c=a.current)==null||c.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const c=(u=o.target.files)==null?void 0:u[0];c&&r(c),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(jt,{}),f.jsx("span",{children:hcn()})]}):f.jsxs(f.Fragment,{children:[f.jsx(nkn,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function mq({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[nl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",wo(n)]})]})}function U$n({skill:e,onError:n}){const t=dn({mutationFn:Wxn}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:F$n,children:e.name}),e.origin&&f.jsx(Wt,{size:"small",children:e.origin})]}),f.jsx(mq,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Ft,{size:"small","data-tip":e.origin?gan():fon(),"data-tip-align":"end","aria-label":e.origin?Aan({name:Ce(e.name)}):lin({name:Ce(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?San({name:Ce(e.name)}):nin({name:Ce(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Ef,{size:13})})]})}function G$n({template:e,onError:n}){const t=dn({mutationFn:Gxn}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:P$n,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:H$n,children:[e.entry,s>0&&(s===1?ran():$an({count:tn(s)}))]})]}),f.jsx(mq,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Ft,{"data-tip":bon(),"data-tip-align":"end","aria-label":kin({name:Ce(e.name)}),disabled:r,onClick:()=>{window.confirm(min({name:Ce(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Ef,{size:13})})]})}function V$n(){var x;const e=dn({mutationFn:Kxn}),n=ut(B2n()),t=n.data,r=A.useRef(null),[s,i]=A.useState(!1),[a,o]=A.useState(!1),c=A.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);A.useLayoutEffect(()=>{c();const y=r.current;if(!y)return;const C=new ResizeObserver(c);return C.observe(y),()=>C.disconnect()},[t,c]);const u=n.isFetching,h=(x=n.error)==null?void 0:x.message,[_,p]=A.useState(!1),[m,w]=A.useState(null),k=()=>{n.refetch()},v=A.useRef(!1),b=A.useCallback(async y=>{if(!v.current){if(w(null),!q$n(y.name)){w(zcn());return}if(y.size>_q){w(OL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await hq(y)})}catch(C){w(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:fq,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:ocn()}),f.jsxs(Oe,{className:"ms-auto",size:"small",onClick:k,disabled:u,children:[f.jsx(Qa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Cm()]})]}),f.jsx("p",{className:dq,children:Tin()}),f.jsx(pq,{accept:".md,.markdown,.zip",busy:_,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Iin()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Qsn()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),h&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[Gan()," ",h]}),t===void 0?h?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",Mon()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Kon()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:c,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(U$n,{skill:y,onError:w},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function K$n(){var h;const e=dn({mutationFn:Uxn}),n=ut($2n()),t=n.data,r=(h=n.error)==null?void 0:h.message,[s,i]=A.useState(!1),[a,o]=A.useState(null),c=A.useRef(!1),u=A.useCallback(async _=>{if(c.current)return;o(null);const p=_.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(Dcn());return}if(_.size>_q){o(OL());return}c.current=!0,i(!0);try{await e.mutateAsync({filename:_.name,contentBase64:await hq(_)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{c.current=!1,i(!1)}},[]);return f.jsxs("section",{className:fq,children:[f.jsx("h3",{children:Eon()}),f.jsx("p",{className:dq,children:xcn()}),f.jsx(pq,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Uin()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:wdn()})]}),onFile:_=>void u(_)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[Zan()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",Pon()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:ecn()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(_=>f.jsx(G$n,{template:_,onError:o},_.name))})]})}function W$n(){return f.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:[f.jsx("h1",{children:ion()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:uan()}),f.jsx(V$n,{}),f.jsx(K$n,{})]})}const Q$n="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function qc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-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-hover-strong [&_.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-0 [&: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]:-start-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]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?Q$n:""}`,onClick:i,onDoubleClick:a,title:s?pdn({label:n}):n,"aria-label":s?cdn({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:jNe(),onPointerDown:c=>c.preventDefault(),onClick:c=>{c.stopPropagation(),o()},children:f.jsx(_r,{size:12})})]})}const LR=["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 X$n({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:LR,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:LR,href:Ob(e,n,t),target:"_blank",rel:"noopener noreferrer",title:Cv({name:Ce(t)}),children:[f.jsx("code",{children:t}),f.jsx(Gb,{size:12})]})}const x4=["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-sm","[&_h2]:font-semibold"].join(" "),IR=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function $R(e){return new Date(e).toLocaleString(E(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function BR(e,n){return R0((e.endedAt??n)-e.createdAt)}function Y$n({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(h=>h.status==="running"||h.status==="starting"),[c,u]=A.useState(()=>Date.now());return A.useEffect(()=>{if(!o)return;u(Date.now());const h=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(h)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.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:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx(cl,{status:a?la(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Oe,{...Gr(h=>s(a.id,h)),children:[f.jsx(ko,{size:15}),fLe()]}),f.jsxs(Oe,{...Gr(i),children:[f.jsx(Bb,{size:15}),gDe()]})]}),e.description&&f.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-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:$De()}),f.jsx(nc,{text:e.description})]}),f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:a?uDe():PLe()}),a&&f.jsxs(f.Fragment,{children:[f.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:[f.jsx(cl,{status:la(a)}),f.jsx(RS,{backend:a.backend}),f.jsxs("span",{title:MLe(),children:[f.jsx(f3n,{size:13}),$R(a.createdAt)]}),f.jsxs("span",{title:GDe(),children:[f.jsx(C3n,{size:13}),BR(a,c)]}),a.commitSha&&f.jsxs("span",{title:SDe(),children:[f.jsx(t5n,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[ZDe()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:IR,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(nc,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:"Git"}),f.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:[f.jsx(X$n,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[iLe()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:$R(e.createdAt),children:[ADe()," ",wo(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:IR,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:ELe()}),f.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-start [&_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((h,_)=>f.jsxs("button",{...Gr(p=>s(h.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[bLe()," ",r.length-_]}),f.jsx(cl,{status:la(h)}),f.jsx("span",{children:wo(h.createdAt)}),f.jsx("span",{children:BR(h,c)}),f.jsx(ko,{size:13})]},h.id))})]})]})})}function PR(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=Fb(t,!0);let i=!1,a=0,o=!1,c=!1;async function u(){if(o){c=!0;return}o=!0;try{for(;;){const _=await fyn(e,a);if(i)return;if(_.dataBase64&&r.write(PR(_.dataBase64)),a=_.nextOffset,_.eof)break}}catch{}finally{o=!1,c&&!i&&(c=!1,u())}}const h=K2n(e,_=>{if(i)return;const p=PR(_.dataBase64);!o&&_.offset===a?(r.write(p),a+=p.length):_.offset+p.length>a&&u()});return u(),()=>{i=!0,h(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function J$n({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:c}){const u=r.filter(h=>h.experimentId===e.id).sort((h,_)=>_.createdAt-h.createdAt);return t==="overview"?f.jsx(Y$n,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(h,_)=>o("terminal",h,_),onOpenCode:h=>c("files",h)}):f.jsx(eBn,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function eBn({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=A.useState(null),[a,o]=A.useState(null),[c,u]=A.useState(!1),h=A.useRef(null),_=t?n.find(v=>v.id===t)??null:n[0]??null,p=(_==null?void 0:_.status)==="running"||(_==null?void 0:_.status)==="starting",m=!!(_&&p&&(_.cancelRequested||a===_.id)),w=v=>{const b=n.findIndex(x=>x.id===v);return b===-1?n.length:n.length-b};A.useEffect(()=>{if(!c)return;const v=b=>{var x;(x=h.current)!=null&&x.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c]);async function k(){if(_){i(null),o(_.id);try{await UL(_.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.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:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Oe,{size:"small",variant:"ghost",disabled:m,onClick:()=>void k(),children:[f.jsx(PI,{size:13}),m?jze():DD()]}),n.length>0&&_&&f.jsxs("div",{className:"run-history relative shrink-0",ref:h,children:[f.jsxs(Oe,{title:tOe(),"aria-expanded":c,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[MN()," ",w(_.id)]}),f.jsx(cl,{status:m?"cancelling":la(_)}),f.jsx(ac,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),c&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(Dn,{className:"justify-start",active:v.id===(_==null?void 0:_.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[MN()," ",w(v.id)]}),f.jsx(cl,{status:la(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:wo(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:_?f.jsx(Z$n,{runId:_.id},_.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?go():HMe()})})]})}let nk=!1;function FR(e){nk=!0;try{return window.confirm(e)}finally{nk=!1}}const rk=e=>e.replace(/\r\n/g,` `),HR=(e,n,t)=>{const r=rk(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r `),conflict:null}},Kc=e=>e.draft!==e.baseline,tBn=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),nBn=e=>e.crlf?e.draft.replace(/\n/g,`\r -`):e.draft;function rBn(e,n,t){return!Kc(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class sBn{constructor(){Us(this,"buffer",null);Us(this,"listeners",new Set);Us(this,"saving",!1);Us(this,"saveError",null);Us(this,"revision",0);Us(this,"saveRevision",0);Us(this,"getSnapshot",()=>this.buffer);Us(this,"getRevision",()=>this.revision);Us(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Us(this,"set",n=>{this.buffer=n,this.notify()});Us(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Us(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Us(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Kc(this.buffer)||this.buffer.conflict!==null)}}function iBn({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var Z,Y,B;const c=ut({...C6n(),enabled:r,subscribed:r}),u=((Z=c.data)==null?void 0:Z.engine)??(c.isPending?void 0:null),h=((Y=c.data)==null?void 0:Y.hint)??null,_=((B=c.data)==null?void 0:B.installCommand)??null,[p,m]=A.useState(!1),[w,k]=A.useState(null),[v,b]=A.useState(null),[x,y]=A.useState(!1),[C,z]=A.useState(null),[E,T]=A.useState(null),[j,M]=A.useState(!1),[D,I]=A.useState(0),$=A.useCallback(L=>{M(L),L&&I(F=>F+1)},[]),q=A.useRef(o);q.current=o;const H=A.useRef(!1),Q=A.useRef(null),V=A.useCallback(()=>{if(H.current)return;Q.current=n,H.current=!0,m(!0);const L=q.current;T(null),b(null),z(null),wyn(e,n,{sessionId:t}).then(F=>{var K,ne;const U=F.pdfPath;if(F.ok&&U){k(oe=>({path:U,version:((oe==null?void 0:oe.version)??0)+1,source:L})),y(F.hadErrors),z(F.note),F.hadErrors&&b(((K=F.log)==null?void 0:K.trim())||null),$(!0);return}k(null),y(!1),z(F.note),M(!1),b(((ne=F.log)==null?void 0:ne.trim())||LZe())}).catch(F=>{k(null),y(!1),z(null),M(!1),T(F instanceof Error?F.message:String(F))}).finally(()=>{H.current=!1,m(!1)})},[e,n,t,$]);return A.useEffect(()=>{!r||!s||!a||!u||Q.current!==n&&V()},[r,s,a,u,n,V]),{engine:u,installHint:h,installCommand:_,compiling:p,compiled:w,stale:w!==null&&w.source!==o,log:v,builtWithErrors:x,note:C,error:E,showPdf:j,setShowPdf:$,viewNonce:D,compile:()=>{i==null||i(),V()},dismiss:()=>{T(null),b(null)}}}const aBn=3e4,oBn=3e4,cBn=5*6e4;function lBn({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:c}){var ue,se,G,ae;const u=A.useMemo(()=>N6n(e,n,{sessionId:t}),[e,n,t]),h=ut({...u,enabled:r,subscribed:r}),_=((ue=h.data)==null?void 0:ue.hasToken)??!1,p=((se=h.data)==null?void 0:se.hasSession)??!1,m=((G=h.data)==null?void 0:G.link)??null,w=!h.isPending,[k,v]=A.useState(null),[b,x]=A.useState(0),[y,C]=A.useState(!1),[z,E]=A.useState(null),[T,j]=A.useState(null),[M,D]=A.useState(!1),I=A.useCallback(ce=>{Fn(u.queryKey)&&Je.setQueryData(u.queryKey,pe=>pe&&{...pe,hasSession:ce})},[u]),$=A.useCallback(ce=>{Fn(u.queryKey)&&Je.setQueryData(u.queryKey,ce)},[u]);A.useEffect(()=>{E(null),x(0),L.current=!1,j(null),D(!1),V.current=!1},[r,e,n,t]),A.useEffect(()=>{D(!1)},[a]);const q=A.useRef(!1),H=A.useRef(c);H.current=c;const Q=A.useRef(o);Q.current=o;const V=A.useRef(!1),Z=A.useCallback(ce=>!_||!m||q.current||Q.current?!1:(q.current=!0,C(!0),j(null),Ryn(e,n,{sessionId:t,resolve:ce}).then(pe=>{V.current=!1,E(pe),pe.pulled.includes(n)&&(Q.current?D(!0):H.current(pe.pulled))}).catch(pe=>{V.current=!0,E(null),j(pe instanceof Error?pe.message:String(pe))}).finally(()=>{q.current=!1,C(!1)}),!0),[e,n,t,_,m]),Y=A.useRef(null),B=(k==null?void 0:k.state)==="live";A.useEffect(()=>{if(!r||!s||!w||!_||!m||o||B)return;const ce=`${n}:${m.projectId}:${a}`;Y.current!==ce&&Z()&&(Y.current=ce)},[r,s,w,_,m,n,a,o,y,Z,B]);const L=A.useRef(!1);!y&&z&&z.conflicts.length===0&&!T&&(L.current=!0);const F=r&&w&&!!m&&_&&p&&L.current,U=A.useRef(null),K=A.useRef(Promise.resolve()),ne=A.useRef(!1);ne.current=(k==null?void 0:k.state)==="stopped"&&k.error!=null;const oe=A.useRef(!1);return A.useEffect(()=>{if(!F)return;let ce=!1;const pe=()=>{const Ae=oe.current;oe.current=!1,!(!Ae&&ne.current)&&(K.current=K.current.then(()=>{if(!ce)return Nyn(e,n,{sessionId:t,retry:Ae}).then(De=>{var We;ce||((U.current===null||((We=De.status)==null?void 0:We.state)==="stopped")&&v(De.status),U.current=De.key)}).catch(De=>{ce||v({state:"stopped",error:De instanceof Error?De.message:String(De),needsSession:!1,note:null})})}))};pe();const be=setInterval(pe,oBn);return()=>{ce=!0,clearInterval(be),U.current=null,v(null),K.current=K.current.then(()=>zyn(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),A.useEffect(()=>J2n(ce=>{if(ce.key===U.current){if(ce.type==="live"){v(ce.status);return}ce.paths.includes(n)&&(Q.current?D(!0):H.current(ce.paths))}}),[n]),A.useEffect(()=>{if(!r||!s||!w||!_||!m||o||B)return;const ce=setInterval(()=>{q.current||V.current||Je.fetchQuery({...z6n(e,n,{sessionId:t}),staleTime:0}).then(pe=>{pe.remoteChanged&&Z()}).catch(pe=>{V.current=!0,j(pe instanceof Error?pe.message:String(pe))})},aBn);return()=>clearInterval(ce)},[r,s,w,_,m,o,e,n,t,Z,B]),A.useEffect(()=>{if(!r||!s||!w||!_||!m||!B)return;const ce=setInterval(Z,cBn);return()=>clearInterval(ce)},[r,s,w,_,m,B,Z]),{hasToken:_,hasSession:p,live:k,retryLive:()=>{oe.current=!0,x(ce=>ce+1)},link:m,loaded:w,syncing:y,last:z,error:T??((ae=h.error)==null?void 0:ae.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>D(!1),uploadUrl:Oyn(e,n,{sessionId:t}),saveToken:async ce=>{const pe=await VL(ce);Y.current=null,V.current=!1,j(null),Fn(u.queryKey)&&Je.setQueryData(u.queryKey,be=>be&&{...be,hasToken:pe.hasToken})},saveSession:async ce=>{const pe=await KL(ce,{host:m==null?void 0:m.host});I(pe.hasSession),oe.current=!0,x(be=>be+1)},importSession:async()=>{const ce=await Eyn({host:m==null?void 0:m.host});return I(ce.hasSession),oe.current=!0,x(pe=>pe+1),ce.source},linkProject:async ce=>{E(null),v(null),L.current=!1,Y.current=null,$(await Tyn(e,n,{project:ce,sessionId:t})),i==null||i()},unlink:async()=>{$(await Ayn(e,n,{sessionId:t})),Y.current=null,V.current=!1,E(null),j(null)},sync:ce=>{V.current=!1,Z(ce)&&(Y.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}const qR=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],uBn=4e6,_Bn=200,UR=16e6,fBn=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),GR=e=>e.startsWith("//")?`https:${e}`:e;async function dBn(e,n){var s;let t=uBn;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:c}of e){if(r.has(o)){const w=r.get(o);w&&i.setAttribute(a,w);continue}if(n.aborted)return;if(r.size>=_Bn)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const h=u.headers.get("content-type")??"",_=Number(u.headers.get("content-length"));if(!c.some(w=>h.startsWith(w))||!(Number.isFinite(_)&&_>0&&_<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await fBn(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function hBn(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll(qR.map(c=>c.selector).join(", ")))for(const{selector:c,attribute:u,typePrefixes:h}of qR){if(!o.matches(c))continue;const _=o.getAttribute(u);if(!_)continue;const p=n(_);p&&(p===_?o.setAttribute(u,GR(_)):s.push({element:o,attribute:u,url:p,typePrefixes:h}))}await dBn(s,t);for(const o of r.querySelectorAll("a[href]")){const c=o.getAttribute("href");!c||!C6(c)||(o.setAttribute("href",GR(c)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function pBn(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${UR-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>UR}}function mBn({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=A.useState(null);return A.useEffect(()=>{let o=!1;const c=new AbortController;return a(null),pBn(e,n,t,c.signal).then(async({text:u,partial:h})=>({source:await hBn(u,s,c.signal),partial:h})).then(u=>{o||a(u)}),()=>{o=!0,c.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(jt,{})," ",BD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:WFe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:tHe({name:Ce(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function gBn({overleaf:e}){var _;const n=A.useRef(null),{open:t,setOpen:r,ref:s}=Xa(n),i=A.useId(),[a,o]=A.useState({top:0,left:0,maxHeight:0}),c=((_=e.last)==null?void 0:_.conflicts.length)??0,u=e.hasToken&&!!e.error,h=u?h3():c?Imt():!e.hasToken||!e.link?Zbt():e.syncing?iL():e.blocked?sL():tL();return A.useEffect(()=>{c&&r(!0)},[c,r]),A.useEffect(()=>{u&&bn(h3(),"error",{id:i,duration:5e3})},[u,e.error,i]),A.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),w=Math.min(p.bottom+6,window.innerHeight-80);o({top:w,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-w-8}),(s.current.querySelector("input")??s.current).focus();const k=()=>r(!1),v=b=>{var x;b.target instanceof Node&&!((x=s.current)!=null&&x.contains(b.target))&&k()};return window.addEventListener("resize",k),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Ft,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":h,"data-tip-align":"end","aria-label":TZ({status:h}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(jt,{}):f.jsx(j3n,{size:13,className:u||c?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&Fi.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":SL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Ft,{size:"small","aria-label":pFe(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(_r,{size:13})})}),f.jsx(wBn,{overleaf:e})]}),document.body)]})}const j1=e=>ia(new Intl.ListFormat(N()).format(e.map(Ce)));function vBn(e){if(e.error)return kgt();if(e.syncing)return iL();if(e.blocked)return sL();const n=e.last;return n?n.pulled.length&&n.pushed.length?_bt({pulled:j1(n.pulled),pushed:j1(n.pushed)}):n.pulled.length?sbt({paths:j1(n.pulled)}):n.pushed.length?vbt({paths:j1(n.pushed)}):n.conflicts.length?S1t():tL():Uvt()}function bBn({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:rL()})}function yBn(e){return e.state==="live"?Ugt():e.state==="connecting"?Igt():e.error??s1t()}function VR({overleaf:e,replacing:n}){const[t,r]=A.useState(""),[s,i]=A.useState(!1),[a,o]=A.useState(!1),[c,u]=A.useState(null),h=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},_=a?_yt():n?Cbt():rgt();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:_}),a&&f.jsx(Ur,{className:"basis-full min-w-0","aria-label":d3(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:d3(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(jt,{}),a?f.jsx(Oe,{type:"button",disabled:s||!t.trim(),onClick:()=>h(()=>e.saveSession(t.trim())),children:s?va():Tmt()}):f.jsx(Oe,{type:"button",disabled:s,onClick:()=>h(e.importSession),children:ugt()}),f.jsx(Oe,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?nL():Yvt()})]}),c&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:c})]})}function xBn({overleaf:e}){if(!e.hasSession)return f.jsx(VR,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:_1t()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:yBn(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Oe,{onClick:e.retryLive,children:Ygt()})}),t&&f.jsx(VR,{overleaf:e,replacing:!0})]})}function wBn({overleaf:e}){var p,m,w;const[n,t]=A.useState(""),[r,s]=A.useState(!1),[i,a]=A.useState(null),[o,c]=A.useState(!1),u=()=>{t(""),a(null),c(!0)},h=!e.hasToken||o;async function _(k){k.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{h?(await e.saveToken(v),c(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!h){const k=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(jt,{}),e.error?h3():vBn(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(xBn,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Oe,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?Rbt():((m=e.live)==null?void 0:m.state)==="live"?Syt():void 0,onClick:()=>e.sync(),children:e.error?Ys():gvt()}),f.jsxs(mh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[svt()," ",f.jsx(of,{size:12})]})]}),k.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",U1t()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Oe,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:Y1t()}),f.jsx(Oe,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Ivt()})]})]},v)),((w=e.last)==null?void 0:w.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:aS()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Oe,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:mz()}),f.jsx(mh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:rL()}),f.jsx(Oe,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Svt()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:_,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:h?Iyt():Uyt()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Ur,{className:"basis-full min-w-0","aria-label":h?hz():pz(),"aria-invalid":!!i,type:h?"password":"text",value:n,onChange:k=>t(k.target.value),placeholder:h?hz():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Oe,{type:"submit",disabled:r||!n.trim(),children:r?h?va():ha():h?Gbt():Tgt()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:h?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:h?Umt():pz()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(bBn,{href:e.uploadUrl}),o?f.jsx(Oe,{variant:"ghost",type:"button",onClick:()=>c(!1),children:nL()}):e.hasToken&&f.jsx(Oe,{variant:"ghost",type:"button",onClick:u,children:mz()})]})]})}function kBn({command:e}){const[n,t]=A.useState("idle"),r=A.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Ft,{"data-tip":n==="copied"?tf():n==="select"?OUe():lPe(),"aria-label":jPe(),onClick:()=>void s(),children:n==="copied"?f.jsx(Pi,{size:13}):f.jsx(Sf,{size:13})})]})}function KR(e){const[n,t]=A.useState(!1),[r,s]=A.useState(null);return{busy:n,error:r,trigger:async()=>{t(!0),s(null);try{await e()}catch(a){s(a instanceof Error?a.message:String(a))}finally{t(!1)}}}}function SBn({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:c,onScrollPositionChange:u,lineScrollRequest:h,onLineScrollRequestHandled:_,onEdit:p,artifactVersion:m,artifactEntries:w=[],bufferSession:k,remote:v=!1,restored:b=!1,onRestoreActivated:x,showSource:y=!1,onShowSourceChange:C}){var jr,In;const z=J$(e,n,t??"repo",r,s),E=ut({...z,enabled:!k.saving}),T=E.data??null,j=((jr=E.error)==null?void 0:jr.message)??null,M=Ke=>{Yr(z.queryKey,gt=>(typeof Ke=="function"?Ke(gt??null):Ke)??void 0)},[D,I]=A.useState(0),$=t==="artifacts",q=t==="abs",H=pC(n),Q=QH(n),V=b$n(n),Z=H||V,[Y,B]=A.useState(!1),L=!b||Y,F=()=>{B(!0),x==null||x()};A.useSyncExternalStore(k.subscribe,k.getRevision);const U=k.getSnapshot(),K=k.set,ne=k.saving,oe=k.setSaving,ue=k.saveRevision,se=k.saveError,G=k.setSaveError,ae=A.useRef(null),ce=A.useRef(null),[pe,be]=A.useState(!1),[Ae,De]=A.useState(null),We=A.useRef(c),Ne=(T==null?void 0:T.file)??null,xe=U&&Kc(U)?U.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,rt=xe.split("/").slice(0,-1).join("/"),Ze=(T==null?void 0:T.source)==="artifact",ct=A.useCallback(Ke=>{var gt;return((gt=l5(rt,Ke,q))==null?void 0:gt.path)??null},[q,rt]),Ct=A.useCallback(Ke=>q?GL(Ke):Ze?sf(e,Ke):k3(e,Ke,{sessionId:r,ref:s}),[Ze,s,q,e,r]),qt=A.useCallback(Ke=>{if(C6(Ke))return Ke;const gt=l5(rt,Ke,q);return gt?X8n(Ct(gt.path),gt):null},[q,rt,Ct]),dt=nq(Ne==null?void 0:Ne.presentation),ht=(T==null?void 0:T.source)==="artifact"&&!$,Le=$&&(T==null?void 0:T.source)==="checkout",me=!s&&(T==null?void 0:T.source)==="checkout"&&Ne!=null&&!Ne.notFound,Te=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",He=me&&Ne!=null&&!Ne.binary&&!Ne.truncated&&!dt&&!Te,nt=He&&Ne.version===void 0,_t=U!==null&&Kc(U),St=!nt&&(He&&typeof Ne.version=="string"||_t),yt=(U==null?void 0:U.draft)??rk((Ne==null?void 0:Ne.content)??""),Zt=(U==null?void 0:U.baseline)??rk((Ne==null?void 0:Ne.content)??""),un=St&&U!==null&&Kc(U),At=async Ke=>{const gt=k.getSnapshot();if(!St||!gt||!Kc(gt))return!0;if(k.saving)return!1;if(gt.conflict&&Ke===void 0)return G(gt.conflict.exists?ON():IN()),!1;const Zr=gt.draft,Wn=nBn(gt);oe(!0),G(null);try{await Je.cancelQueries(z);const wn=await gyn(e,xe,Wn,{sessionId:r,expectedVersion:Ke??gt.version});return k.getSnapshot()?(k.saved(Zr,wn.version),M(rr=>rr&&rr.source==="checkout"?{source:"checkout",file:{...rr.file,content:Wn,version:wn.version}}:rr),!0):!1}catch(wn){if(wn instanceof w3){const Qn=k.getSnapshot();return!Qn||!Kc(Qn)||K({...Qn,conflict:{currentVersion:wn.currentVersion,exists:wn.exists}}),!1}return G(wn instanceof Error?wn.message:String(wn)),!1}finally{oe(!1)}},pt=Q&&me&&!Te,mt=iBn({projectId:e,filePath:xe,sessionId:r,enabled:pt,autoRun:L,onManualAction:F,ready:Ne!=null&&!Ne.notFound,source:St?yt:(Ne==null?void 0:Ne.content)??""}),_n=lBn({projectId:e,filePath:xe,sessionId:r,enabled:pt,autoRun:L,onManualAction:F,savedSource:Zt,dirty:un,onPulled:A.useCallback(Ke=>{Ke.includes(xe)&&I(gt=>gt+1)},[xe])}),us=Q&&mt.showPdf&&mt.compiled!=null,xr=nt&&_t,Qt=(St||xr)&&!(Z&&!y)&&!us,Mn=Ne!==null&&!Ne.notFound&&!Ne.binary&&!dt&&!us,mr=Mn&&!Qt&&(!V||y),gr=async()=>{if(Ne)try{if(Ne.truncated&&!Qt){const Ke=fetch(Ct(xe)).then(async gt=>{if(!gt.ok)throw new Error;return new Blob([await gt.text()],{type:"text/plain"})});await navigator.clipboard.write([new ClipboardItem({"text/plain":Ke})])}else await navigator.clipboard.writeText(Qt?yt:Ne.content);be(!0),window.setTimeout(()=>be(!1),1500)}catch{bn(wPe(),"error")}},_s=Ke=>{if(!Ke.metaKey&&!Ke.ctrlKey||Ke.altKey||Ke.shiftKey||Ke.key.toLowerCase()!=="a"||!(Ke.target instanceof Node)||!Ke.currentTarget.contains(Ke.target))return;const gt=ce.current;if(!gt)return;Ke.preventDefault();const Zr=document.createRange();Zr.selectNodeContents(gt);const Wn=window.getSelection();Wn==null||Wn.removeAllRanges(),Wn==null||Wn.addRange(Zr)},Et=mt.compiled?`${k3(e,mt.compiled.path,{sessionId:r})}&v=${mt.compiled.version}`:null,fn=Et?`${Et}&view=${mt.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,an=mt.compiled?mt.compiled.path.split("/").pop()??mt.compiled.path:null,xn=async()=>{un&&!await At()||Q&&mt.engine&&mt.compile()},Ir=async()=>{un&&(L?await xn():await At())},mn=KR(()=>byn(e,xe,{sessionId:r})),gn=KR(()=>yyn(e,xe,{sessionId:r})),Ln=v?hqe():Ne!=null&&Ne.notFound?PN():s?oqe({branch:Ce(s)}):me?null:xqe(),Nt=A.useCallback(()=>{k.saving||I(Ke=>Ke+1)},[k]),Ot=()=>{K(null),G(null),Nt()},Hn=sq(Ct(xe),!s&&!ne);A.useEffect(()=>{if(!j||s)return;const Ke=window.setInterval(()=>{document.visibilityState!=="hidden"&&Nt()},2e3);return()=>window.clearInterval(Ke)},[j,s,Nt]);const zr=`${Ct(xe)}&v=${encodeURIComponent(Hn??m??"")}&reload=${D}`;A.useEffect(()=>{var Zr,Wn;if(!T||k.saving)return;const Ke=T,gt=k.getSnapshot();if(gt&&Kc(gt)){const wn=Ke.source==="checkout"?Ke.file:null,Qn=wn!==null&&wn.path===gt.path&&(!r||wn.root==="worktree"),rr=rBn(gt,Qn&&typeof wn.version=="string"?wn.version:null,Qn&&!wn.notFound);rr&&(rr.currentVersion!==((Zr=gt.conflict)==null?void 0:Zr.currentVersion)||rr.exists!==((Wn=gt.conflict)==null?void 0:Wn.exists))?K({...gt,conflict:rr}):!rr&>.conflict&&K({...gt,conflict:null})}(!gt||!Kc(gt))&&Ke.source==="checkout"&&!Ke.file.notFound&&!Ke.file.binary&&!Ke.file.truncated&&typeof Ke.file.version=="string"&&(K(HR(Ke.file.path,Ke.file.content,Ke.file.version)),G(null))},[T,k,r,ne,ue]);const nr=JSON.stringify(z.queryKey),On=A.useRef({sourceKey:nr,nonce:D,artifactVersion:m,diskVersion:Hn});A.useEffect(()=>{const Ke=On.current;On.current={sourceKey:nr,nonce:D,artifactVersion:m,diskVersion:Hn},Ke.sourceKey===nr&&(Ke.nonce!==D||Ke.diskVersion!==null&&Ke.diskVersion!==Hn||Ke.artifactVersion!=null&&Ke.artifactVersion!==m)&&j6n(e,n,t??"repo",r,s)},[nr,D,m,Hn,e,n,t,r,s]),A.useLayoutEffect(()=>{const Ke=ae.current,gt=We.current;!Ke||!Ne||!gt||(Ke.scrollTop=gt.top,Ke.scrollLeft=gt.left)},[Ne]);const hr=Ke=>{if(Ke.source==="absolute")return OHe();if($)return yHe({root:r?Jg():Zg()});if(s)return NHe({branch:Ce(s)});if(r&&Ke.source==="checkout"&&Ke.file.root==="clone")return MGe();const gt=Ke.source==="checkout"?Ke.file.root:Ke.checkoutRoot;return FHe({root:gt==="worktree"?Jg():Zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",onKeyDown:_s,children:[f.jsxs("div",{className:"file-view-header @container flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(zh,{name:xe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ce(xe),children:xe.split("/").pop()||xe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap [&_svg]:flex-none",title:XQ({branch:Ce(a)}),children:[f.jsx(zm,{size:11}),a]}),Qt&&(ne||un||se)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${se?"text-accent-red":"text-muted"}`,title:se??(ne?va():bGe()),children:ne?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",NUe()]}):se?yUe():PD()}),f.jsx("div",{ref:De,className:"contents"}),Q&&mt.compiled&&f.jsx(Ft,{size:"small",active:!mt.showPdf,"data-tip":mt.stale&&mt.showPdf?Hqe():mt.showPdf?zd():UN(),"data-tip-align":"end","aria-label":mt.showPdf?zd():UN(),onClick:()=>mt.setShowPdf(!mt.showPdf),children:mt.showPdf?f.jsx(P3,{size:13}):f.jsx($b,{size:13,className:mt.stale?"text-accent-amber":void 0})}),Q&&Et&&an&&f.jsx(Ih,{size:"small","data-tip":mt.stale?zFe({name:Ce(an)}):Sv({name:Ce(an)}),"data-tip-align":"end","aria-label":Sv({name:Ce(an)}),href:Et,download:an,children:f.jsx(Lb,{size:13,className:mt.stale?"text-accent-amber":void 0})}),pt&&f.jsx(gBn,{overleaf:_n}),Q&&me&&f.jsx(Ft,{size:"small","data-tip":mt.compiled?HN():DN(),"data-tip-align":"end","aria-label":mt.compiled?HN():DN(),disabled:mt.compiling||!mt.engine,onClick:()=>void xn(),children:mt.compiling?f.jsx(jt,{}):f.jsx(B3n,{size:13})}),Z&&f.jsx(Ft,{size:"small",active:y,"data-tip":y?Ev():zd(),"data-tip-align":"end","aria-label":y?Ev():zd(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(P3,{size:13})}),Mn&&f.jsx(Ft,{size:"small","data-tip":pe?tf():LN(),"data-tip-align":"end","aria-label":pe?tf():LN(),onClick:()=>void gr(),children:pe?f.jsx(Pi,{size:13}):f.jsx(Sf,{size:13})}),Ne!=null&&f.jsxs(f.Fragment,{children:[f.jsx(Ft,{size:"small","data-tip":Ln??mn.error??FN(),"data-tip-align":"end","aria-label":FN(),"aria-description":Ln??void 0,disabled:mn.busy||Ln!=null,onClick:()=>void mn.trigger(),children:mn.busy?f.jsx(jt,{}):f.jsx(of,{size:13})}),f.jsx(Ft,{size:"small","data-tip":Ln??gn.error??qN(),"data-tip-align":"end","aria-label":qN(),"aria-description":Ln??void 0,disabled:gn.busy||Ln!=null,onClick:()=>void gn.trigger(),children:gn.busy?f.jsx(jt,{}):f.jsx(Ou,{size:13})})]})]}),!j&&Le&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:WHe({root:T.file.root==="worktree"?Jg():Zg()})}),nt&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:EGe()}),j&&Ne!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[BN()," ",Ce(j)]}),(U==null?void 0:U.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:U.conflict.exists?ON():IN()}),((In=U==null?void 0:U.conflict)==null?void 0:In.exists)&&U.conflict.currentVersion&&f.jsx(Oe,{disabled:ne,onPointerDown:Ke=>Ke.preventDefault(),onClick:()=>{var Ke;return void At(((Ke=U.conflict)==null?void 0:Ke.currentVersion)??void 0)},children:Dqe()}),f.jsx(Oe,{disabled:ne,onPointerDown:Ke=>Ke.preventDefault(),onClick:Ot,children:oUe()})]}),(mt.error||mt.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${mt.builtWithErrors?"text-subtext":"text-accent-red"}`,children:mt.error??(mt.builtWithErrors?nPe():qBe())}),f.jsx(Ft,{"data-tip":tFe(),"data-tip-align":"end","aria-label":cFe(),onClick:mt.dismiss,children:f.jsx(_r,{size:13})})]}),mt.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:mt.log})]}),pt&&_n.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:zqe()}),f.jsx(Oe,{onClick:()=>{_n.reloaded(),I(Ke=>Ke+1)},children:HPe()})]}),Q&&me&&mt.engine===null&&mt.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[mt.installHint,mt.installCommand&&f.jsx(kBn,{command:mt.installCommand})]}),mt.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:mt.note}),us&&mt.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:JUe()}),f.jsxs("div",{ref:ae,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",tabIndex:mr?0:void 0,onScroll:Ke=>{const gt={top:Math.max(0,Ke.currentTarget.scrollTop),left:Math.max(0,Ke.currentTarget.scrollLeft)};We.current=gt,u==null||u(gt)},children:[!Qt&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:aGe()}),!Qt&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&ht&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:kBe({root:T.checkoutRoot==="worktree"?Jg():Zg()})}),j&&Ne===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[BN()," ",Ce(j)]}):Ne===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:BD()}):Qt?f.jsx(q$,{value:yt,onChange:Ke=>{const gt=k.getSnapshot()??(Ne&&typeof Ne.version=="string"?HR(Ne.path,Ne.content,Ne.version):null);gt&&K(tBn(gt,Ke)),p==null||p(),se&&G(null)},onSave:()=>void Ir(),onBlur:()=>{nk||Ir()},readOnly:xr,path:n,highlightLine:i,scrollRequest:h,onScrollRequestHandled:_,scrollPosition:We.current,onScrollPositionChange:Ke=>{We.current=Ke,u==null||u(Ke)}}):Ne.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?hr(T):PN()}):dt?f.jsx(ub.Provider,{value:Ae,children:f.jsx(tk,{kind:dt,url:zr,name:n.split("/").pop()??n})}):Ne.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[TBe()," ",f.jsx("a",{href:zr,download:n.split("/").pop()??n,children:$D()})]}):us&&fn&&an?f.jsx(ub.Provider,{value:Ae,children:f.jsx(tk,{kind:"pdf",url:fn,name:an,download:!1},fn)}):H&&!y?f.jsx("div",{ref:ce,className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:Ze?f.jsx(lq,{projectId:e,folder:rt,markdown:Ne.content,entries:w}):f.jsx(nc,{text:Ne.content,resolveFilePath:ct,resolveImageSrc:qt,onOpenFile:o&&((Ke,gt,Zr,Wn,wn)=>o(Ke,r,s,wn))})}):V&&!y?f.jsx(mBn,{html:Ne.content,truncated:Ne.truncated,url:zr,name:xe,resolveSrc:qt}):f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:ce,children:f.jsx(tq,{text:Ne.content,path:n,highlightLine:i,scrollRequest:h,onScrollRequestHandled:_})}),Ne.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:FFe()})]})]})]})}const w4=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function CBn({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=Xa(),c=A.useRef(null);return A.useEffect(()=>{if(!i)return;const u=h=>{var _;h.key==="Escape"&&((_=c.current)==null||_.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Ft,{size:"small",className:"project-back text-text","aria-label":VN(),onClick:n,children:f.jsx(M0,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:hXe()}),s&&f.jsx(Ft,{size:"small","data-tip":KN(),"data-tip-align":"end","aria-label":KN(),onClick:s,children:f.jsx(QI,{size:18})})]}),f.jsxs("button",{ref:c,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(ac,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(Dn,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:w4,children:[f.jsx(UI,{size:14}),WQe()]})}),f.jsx(Dn,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:w4,children:[f.jsx(VI,{size:14}),VN()]})}),f.jsx(Dn,{onClick:()=>{var u;(u=c.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:w4,children:[f.jsx(K3n,{size:14}),tXe()]})})]})]})})}function gq({id:e,name:n,hasParent:t,onArchive:r,compact:s=!1}){const i=A.useRef(null),a=Xa(i),o=(c,u)=>{a.setOpen(!1),r(e,c,u)};return f.jsxs("div",{className:"relative nodrag",ref:a.ref,children:[s?f.jsx("button",{type:"button",ref:i,className:"node-action","aria-label":Pz({name:n}),"aria-expanded":a.open,onClick:()=>a.setOpen(c=>!c),children:f.jsx(Ib,{size:15,"aria-hidden":"true"})}):f.jsx("button",{type:"button",className:"btn inline-flex h-7 items-center justify-center rounded-sm border border-border bg-background px-2.5 text-sm text-text hover:bg-surface",ref:i,"aria-label":Pz({name:n}),"aria-expanded":a.open,onClick:()=>a.setOpen(c=>!c),children:upn()}),a.open&&f.jsxs("div",{className:`option-menu absolute end-0 z-50 min-w-44 rounded-lg border border-border bg-background p-1.5 shadow-menu ${s?"bottom-[calc(100%_+_4px)]":"top-[calc(100%_+_4px)]"}`,children:[t&&f.jsx(Dn,{onClick:()=>o("up",!0),children:Xhn()}),f.jsx(Dn,{onClick:()=>o("down",!0),children:rpn()}),t&&f.jsx(Dn,{onClick:()=>o("up",!1),children:n0n()}),f.jsx(Dn,{onClick:()=>o("down",!1),children:l0n()})]})]})}function EBn({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onArchive:a,onCancel:o}){const[c,u]=A.useState(new Set),[h,_]=A.useState(null),p=new Map;for(const k of e){const v=p.get(k.experimentId);v?v.push(k):p.set(k.experimentId,[k])}for(const k of p.values())k.sort((v,b)=>b.createdAt-v.createdAt);const m=[...n].sort((k,v)=>{var y,C,z,E;const b=((C=(y=p.get(k.id))==null?void 0:y[0])==null?void 0:C.createdAt)??k.createdAt;return(((E=(z=p.get(v.id))==null?void 0:z[0])==null?void 0:E.createdAt)??v.createdAt)-b});if(m.length===0)return f.jsx(gC,{icon:gh,title:t??oIe(),description:t?void 0:KLe()});async function w(k){_(null),u(v=>new Set(v).add(k));try{await o(k)}catch(v){u(b=>{const x=new Set(b);return x.delete(k),x}),_(v instanceof Error?v.message:String(v))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[h&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[w$e()," ",h]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":l$e(),children:m.map(k=>{const v=p.get(k.id)??[],b=v[0]??null,x=v.find(E=>E.status==="running"||E.status==="starting"),y=x??b,C=!!(x&&(x.cancelRequested||c.has(x.id))),z=x?C?"cancelling":la(x):b?la(b):"idle";return f.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-divider-subtle 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,"preview"),onDoubleClick:()=>r(k,"keepOpen"),onAuxClick:E=>{E.button===1&&(E.preventDefault(),r(k,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Gr(E=>r(k,E),{stopPropagation:!0}),children:k.title||k.slug}),k.archived&&f.jsx("span",{className:"text-muted text-xs",children:IL()}),f.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:[f.jsx(zm,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:k.branchName})]})]}),f.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:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx(cl,{status:z})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:v.length===1?xIe():DIe({count:tn(v.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:b?wo(b.createdAt):hIe()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":LQ({name:k.title||k.slug}),onClick:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onAuxClick:E=>E.stopPropagation(),children:[f.jsxs(Oe,{size:"small",disabled:!y,title:y?zIe():eIe(),...Gr(E=>{y&&s(k.id,y.id,E)},{stopPropagation:!0}),children:[f.jsx(ko,{size:15}),u3()]}),f.jsxs(Oe,{size:"small",title:bD({branch:Ce(k.branchName)}),...Gr(E=>i(k.id,E),{stopPropagation:!0}),children:[f.jsx(Bb,{size:15}),n$e()]}),f.jsx(gq,{id:k.id,name:k.title||k.slug,hasParent:!!k.parentExperimentId,onArchive:a}),x&&f.jsxs(Oe,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:C,title:C?HIe():QIe(),onClick:()=>void w(x.id),children:[f.jsx(PI,{size:15}),C?Xje():DD()]})]})]},k.id)})})]})}function NBn({onClose:e,onCreateProject:n}){const[t,r]=A.useState(!1),[s,i]=A.useState(null),a=A.useRef(null),o=A.useCallback(c=>{t||(r(!0),i(null),c().catch(()=>i(khn())).finally(()=>r(!1)))},[t]);return A.useEffect(()=>{const c=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e,o]),A.useEffect(()=>{const c=a.current;if(!c)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,h=()=>[...c.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(h()[0]??c).focus();const _=p=>{if(p.key!=="Tab")return;const m=h();if(m.length===0){p.preventDefault(),c.focus();return}const w=m[0],k=m[m.length-1];p.shiftKey&&document.activeElement===w?(p.preventDefault(),k.focus()):!p.shiftKey&&document.activeElement===k&&(p.preventDefault(),w.focus())};return document.addEventListener("keydown",_,!0),()=>{document.removeEventListener("keydown",_,!0),u==null||u.focus()}},[]),Fi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Ft,{className:"absolute end-3.5 top-3.5","aria-label":y3(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(_r,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx(AS,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Qdn()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:Ihn()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[Thn()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:lhn()}),jdn()]}),f.jsx("p",{dir:"auto",children:nhn()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Oe,{onClick:()=>o(n),disabled:t,children:Hdn()}),f.jsx(Oe,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?va():mhn()})]})]})}),document.body)}function ls(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function $y(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}av.prototype=$y.prototype={constructor:av,on:function(e,n){var t=this._,r=jBn(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),QR.hasOwnProperty(n)?{space:QR[n],local:e}:e}function ABn(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===sk&&n.documentElement.namespaceURI===sk?n.createElement(e):n.createElementNS(t,e)}}function RBn(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vq(e){var n=By(e);return(n.local?RBn:ABn)(n)}function MBn(){}function vC(e){return e==null?MBn:function(){return this.querySelector(e)}}function OBn(e){typeof e!="function"&&(e=vC(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=x+1);!(z=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function iPn(e){e||(e=aPn);function n(_,p){return _&&p?e(_.__data__,p.__data__):!_-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function oPn(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cPn(){return Array.from(this)}function lPn(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?yPn:typeof n=="function"?wPn:xPn)(e,n,t??"")):jh(this.node(),e)}function jh(e,n){return e.style.getPropertyValue(n)||kq(e).getComputedStyle(e,null).getPropertyValue(n)}function SPn(e){return function(){delete this[e]}}function CPn(e,n){return function(){this[e]=n}}function EPn(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function NPn(e,n){return arguments.length>1?this.each((n==null?SPn:typeof n=="function"?EPn:CPn)(e,n)):this.node()[e]}function Sq(e){return e.trim().split(/^|\s+/)}function bC(e){return e.classList||new Cq(e)}function Cq(e){this._node=e,this._names=Sq(e.getAttribute("class")||"")}Cq.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Eq(e,n){for(var t=bC(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function tFn(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function ik(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:c,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:h}})}ik.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function _Fn(e){return!e.ctrlKey&&!e.button}function fFn(){return this.parentNode}function dFn(e,n){return n??{x:e.x,y:e.y}}function hFn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Rq(){var e=_Fn,n=fFn,t=dFn,r=hFn,s={},i=$y("start","drag","end"),a=0,o,c,u,h,_=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,uFn).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,z){if(!(h||!e.call(this,C,z))){var E=y(this,n.call(this,C,z),C,z,"mouse");E&&(aa(C.view).on("mousemove.drag",w,X0).on("mouseup.drag",k,X0),Tq(C.view),k4(C),u=!1,o=C.clientX,c=C.clientY,E("start",C))}}function w(C){if(Ud(C),!u){var z=C.clientX-o,E=C.clientY-c;u=z*z+E*E>_}s.mouse("drag",C)}function k(C){aa(C.view).on("mousemove.drag mouseup.drag",null),Aq(C.view,u),Ud(C),s.mouse("end",C)}function v(C,z){if(e.call(this,C,z)){var E=C.changedTouches,T=n.call(this,C,z),j=E.length,M,D;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?A1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?A1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=mFn.exec(e))?new Bi(n[1],n[2],n[3],1):(n=gFn.exec(e))?new Bi(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=vFn.exec(e))?A1(n[1],n[2],n[3],n[4]):(n=bFn.exec(e))?A1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=yFn.exec(e))?nM(n[1],n[2]/100,n[3]/100,1):(n=xFn.exec(e))?nM(n[1],n[2]/100,n[3]/100,n[4]):XR.hasOwnProperty(e)?JR(XR[e]):e==="transparent"?new Bi(NaN,NaN,NaN,0):null}function JR(e){return new Bi(e>>16&255,e>>8&255,e&255,1)}function A1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Bi(e,n,t,r)}function SFn(e){return e instanceof Pm||(e=df(e)),e?(e=e.rgb(),new Bi(e.r,e.g,e.b,e.opacity)):new Bi}function ak(e,n,t,r){return arguments.length===1?SFn(e):new Bi(e,n,t,r??1)}function Bi(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}yC(Bi,ak,Mq(Pm,{brighter(e){return e=e==null?fb:Math.pow(fb,e),new Bi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Y0:Math.pow(Y0,e),new Bi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Bi(Z_(this.r),Z_(this.g),Z_(this.b),db(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:eM,formatHex:eM,formatHex8:CFn,formatRgb:tM,toString:tM}));function eM(){return`#${R_(this.r)}${R_(this.g)}${R_(this.b)}`}function CFn(){return`#${R_(this.r)}${R_(this.g)}${R_(this.b)}${R_((isNaN(this.opacity)?1:this.opacity)*255)}`}function tM(){const e=db(this.opacity);return`${e===1?"rgb(":"rgba("}${Z_(this.r)}, ${Z_(this.g)}, ${Z_(this.b)}${e===1?")":`, ${e})`}`}function db(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Z_(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function R_(e){return e=Z_(e),(e<16?"0":"")+e.toString(16)}function nM(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new mo(e,n,t,r)}function Oq(e){if(e instanceof mo)return new mo(e.h,e.s,e.l,e.opacity);if(e instanceof Pm||(e=df(e)),!e)return new mo;if(e instanceof mo)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,c=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&c<1?0:a,new mo(a,o,c,e.opacity)}function EFn(e,n,t,r){return arguments.length===1?Oq(e):new mo(e,n,t,r??1)}function mo(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}yC(mo,EFn,Mq(Pm,{brighter(e){return e=e==null?fb:Math.pow(fb,e),new mo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Y0:Math.pow(Y0,e),new mo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Bi(S4(e>=240?e-240:e+120,s,r),S4(e,s,r),S4(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new mo(rM(this.h),R1(this.s),R1(this.l),db(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=db(this.opacity);return`${e===1?"hsl(":"hsla("}${rM(this.h)}, ${R1(this.s)*100}%, ${R1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rM(e){return e=(e||0)%360,e<0?e+360:e}function R1(e){return Math.max(0,Math.min(1,e||0))}function S4(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const xC=e=>()=>e;function NFn(e,n){return function(t){return e+t*n}}function zFn(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function jFn(e){return(e=+e)==1?Dq:function(n,t){return t-n?zFn(n,t,e):xC(isNaN(n)?t:n)}}function Dq(e,n){var t=n-e;return t?NFn(e,t):xC(isNaN(e)?n:e)}const hb=(function e(n){var t=jFn(n);function r(s,i){var a=t((s=ak(s)).r,(i=ak(i)).r),o=t(s.g,i.g),c=t(s.b,i.b),u=Dq(s.opacity,i.opacity);return function(h){return s.r=a(h),s.g=o(h),s.b=c(h),s.opacity=u(h),s+""}}return r.gamma=e,r})(1);function TFn(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,c.push({i:a,x:Ko(r,s)})),t=C4.lastIndex;return t180?h+=360:h-u>180&&(u+=360),p.push({i:_.push(s(_)+"rotate(",null,r)-2,x:Ko(u,h)})):h&&_.push(s(_)+"rotate("+h+r)}function o(u,h,_,p){u!==h?p.push({i:_.push(s(_)+"skewX(",null,r)-2,x:Ko(u,h)}):h&&_.push(s(_)+"skewX("+h+r)}function c(u,h,_,p,m,w){if(u!==_||h!==p){var k=m.push(s(m)+"scale(",null,",",null,")");w.push({i:k-4,x:Ko(u,_)},{i:k-2,x:Ko(h,p)})}else(_!==1||p!==1)&&m.push(s(m)+"scale("+_+","+p+")")}return function(u,h){var _=[],p=[];return u=e(u),h=e(h),i(u.translateX,u.translateY,h.translateX,h.translateY,_,p),a(u.rotate,h.rotate,_,p),o(u.skewX,h.skewX,_,p),c(u.scaleX,u.scaleY,h.scaleX,h.scaleY,_,p),u=h=null,function(m){for(var w=-1,k=p.length,v;++w=0&&e._call.call(void 0,n),e=e._next;--Th}function aM(){hf=(mb=J0.now())+Py,Th=o0=0;try{GFn()}finally{Th=0,KFn(),hf=0}}function VFn(){var e=J0.now(),n=e-mb;n>Bq&&(Py-=n,mb=e)}function KFn(){for(var e,n=pb,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:pb=t);c0=e,lk(r)}function lk(e){if(!Th){o0&&(o0=clearTimeout(o0));var n=e-hf;n>24?(e<1/0&&(o0=setTimeout(aM,e-J0.now()-Py)),Jp&&(Jp=clearInterval(Jp))):(Jp||(mb=J0.now(),Jp=setInterval(VFn,Bq)),Th=1,Pq(aM))}}function oM(e,n,t){var r=new gb;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var WFn=$y("start","end","cancel","interrupt"),QFn=[],Hq=0,cM=1,uk=2,cv=3,lM=4,_k=5,lv=6;function Fy(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;XFn(e,t,{name:n,index:r,group:s,on:WFn,tween:QFn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Hq})}function kC(e,n){var t=Co(e,n);if(t.state>Hq)throw new Error("too late; already scheduled");return t}function fc(e,n){var t=Co(e,n);if(t.state>cv)throw new Error("too late; already running");return t}function Co(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function XFn(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=Fq(i,0,t.time);function i(u){t.state=cM,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var h,_,p,m;if(t.state!==cM)return c();for(h in r)if(m=r[h],m.name===t.name){if(m.state===cv)return oM(a);m.state===lM?(m.state=lv,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[h]):+huk&&r.state<_k,r.state=lv,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete t[a]}i&&delete e.__transition}}function YFn(e){return this.each(function(){uv(this,e)})}function ZFn(e,n){var t,r;return function(){var s=fc(this,e),i=s.tween;if(i!==t){r=t=i;for(var a=0,o=r.length;a=0&&(n=n.slice(0,t)),!n||n==="start"})}function EHn(e,n,t){var r,s,i=CHn(n)?kC:fc;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function NHn(e,n){var t=this._id;return arguments.length<2?Co(this.node(),t).on.on(e):this.each(EHn(t,e,n))}function zHn(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function jHn(){return this.on("end.remove",zHn(this._id))}function THn(e){var n=this._name,t=this._id;typeof e!="function"&&(e=vC(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function tqn(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function il(e,n,t){this.k=e,this.x=n,this.y=t}il.prototype={constructor:il,scale:function(e){return e===1?this:new il(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new il(this.k,this.x+this.k*e,this.y+this.k*n)},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 Hy=new il(1,0,0);Vq.prototype=il.prototype;function Vq(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Hy;return e.__zoom}function E4(e){e.stopImmediatePropagation()}function e0(e){e.preventDefault(),e.stopImmediatePropagation()}function nqn(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function rqn(){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 uM(){return this.__zoom||Hy}function sqn(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function iqn(){return navigator.maxTouchPoints||"ontouchstart"in this}function aqn(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Kq(){var e=nqn,n=rqn,t=aqn,r=sqn,s=iqn,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,c=ov,u=$y("start","zoom","end"),h,_,p,m=500,w=150,k=0,v=10;function b(H){H.property("__zoom",uM).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",D).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(H,Q,V,Z){var Y=H.selection?H.selection():H;Y.property("__zoom",uM),H!==Y?z(H,Q,V,Z):Y.interrupt().each(function(){E(this,arguments).event(Z).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},b.scaleBy=function(H,Q,V,Z){b.scaleTo(H,function(){var Y=this.__zoom.k,B=typeof Q=="function"?Q.apply(this,arguments):Q;return Y*B},V,Z)},b.scaleTo=function(H,Q,V,Z){b.transform(H,function(){var Y=n.apply(this,arguments),B=this.__zoom,L=V==null?C(Y):typeof V=="function"?V.apply(this,arguments):V,F=B.invert(L),U=typeof Q=="function"?Q.apply(this,arguments):Q;return t(y(x(B,U),L,F),Y,a)},V,Z)},b.translateBy=function(H,Q,V,Z){b.transform(H,function(){return t(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof V=="function"?V.apply(this,arguments):V),n.apply(this,arguments),a)},null,Z)},b.translateTo=function(H,Q,V,Z,Y){b.transform(H,function(){var B=n.apply(this,arguments),L=this.__zoom,F=Z==null?C(B):typeof Z=="function"?Z.apply(this,arguments):Z;return t(Hy.translate(F[0],F[1]).scale(L.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof V=="function"?-V.apply(this,arguments):-V),B,a)},Z,Y)};function x(H,Q){return Q=Math.max(i[0],Math.min(i[1],Q)),Q===H.k?H:new il(Q,H.x,H.y)}function y(H,Q,V){var Z=Q[0]-V[0]*H.k,Y=Q[1]-V[1]*H.k;return Z===H.x&&Y===H.y?H:new il(H.k,Z,Y)}function C(H){return[(+H[0][0]+ +H[1][0])/2,(+H[0][1]+ +H[1][1])/2]}function z(H,Q,V,Z){H.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 Y=this,B=arguments,L=E(Y,B).event(Z),F=n.apply(Y,B),U=V==null?C(F):typeof V=="function"?V.apply(Y,B):V,K=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),ne=Y.__zoom,oe=typeof Q=="function"?Q.apply(Y,B):Q,ue=c(ne.invert(U).concat(K/ne.k),oe.invert(U).concat(K/oe.k));return function(se){if(se===1)se=oe;else{var G=ue(se),ae=K/G[2];se=new il(ae,U[0]-G[0]*ae,U[1]-G[1]*ae)}L.zoom(null,se)}})}function E(H,Q,V){return!V&&H.__zooming||new T(H,Q)}function T(H,Q){this.that=H,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=n.apply(H,Q),this.taps=0}T.prototype={event:function(H){return H&&(this.sourceEvent=H),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(H,Q){return this.mouse&&H!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&H!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&H!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(H){var Q=aa(this.that).datum();u.call(H,this.that,new tqn(H,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Q)}};function j(H,...Q){if(!e.apply(this,arguments))return;var V=E(this,Q).event(H),Z=this.__zoom,Y=Math.max(i[0],Math.min(i[1],Z.k*Math.pow(2,r.apply(this,arguments)))),B=uo(H);if(V.wheel)(V.mouse[0][0]!==B[0]||V.mouse[0][1]!==B[1])&&(V.mouse[1]=Z.invert(V.mouse[0]=B)),clearTimeout(V.wheel);else{if(Z.k===Y)return;V.mouse=[B,Z.invert(B)],uv(this),V.start()}e0(H),V.wheel=setTimeout(L,w),V.zoom("mouse",t(y(x(Z,Y),V.mouse[0],V.mouse[1]),V.extent,a));function L(){V.wheel=null,V.end()}}function M(H,...Q){if(p||!e.apply(this,arguments))return;var V=H.currentTarget,Z=E(this,Q,!0).event(H),Y=aa(H.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",K,!0),B=uo(H,V),L=H.clientX,F=H.clientY;Tq(H.view),E4(H),Z.mouse=[B,this.__zoom.invert(B)],uv(this),Z.start();function U(ne){if(e0(ne),!Z.moved){var oe=ne.clientX-L,ue=ne.clientY-F;Z.moved=oe*oe+ue*ue>k}Z.event(ne).zoom("mouse",t(y(Z.that.__zoom,Z.mouse[0]=uo(ne,V),Z.mouse[1]),Z.extent,a))}function K(ne){Y.on("mousemove.zoom mouseup.zoom",null),Aq(ne.view,Z.moved),e0(ne),Z.event(ne).end()}}function D(H,...Q){if(e.apply(this,arguments)){var V=this.__zoom,Z=uo(H.changedTouches?H.changedTouches[0]:H,this),Y=V.invert(Z),B=V.k*(H.shiftKey?.5:2),L=t(y(x(V,B),Z,Y),n.apply(this,Q),a);e0(H),o>0?aa(this).transition().duration(o).call(z,L,Z,H):aa(this).call(b.transform,L,Z,H)}}function I(H,...Q){if(e.apply(this,arguments)){var V=H.touches,Z=V.length,Y=E(this,Q,H.changedTouches.length===Z).event(H),B,L,F,U;for(E4(H),L=0;L`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:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,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.`},em=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Wq=["Enter"," ","Escape"],Qq={"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:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"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 Ah;(function(e){e.Strict="strict",e.Loose="loose"})(Ah||(Ah={}));var J_;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(J_||(J_={}));var tm;(function(e){e.Partial="partial",e.Full="full"})(tm||(tm={}));const Xq={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var pu;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(pu||(pu={}));var vb;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(vb||(vb={}));var Dt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Dt||(Dt={}));const _M={[Dt.Left]:Dt.Right,[Dt.Right]:Dt.Left,[Dt.Top]:Dt.Bottom,[Dt.Bottom]:Dt.Top};function Yq(e){return e===null?null:e?"valid":"invalid"}const Zq=e=>"id"in e&&"source"in e&&"target"in e,oqn=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),CC=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Fm=(e,n=[0,0])=>{const{width:t,height:r}=yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},cqn=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):CC(s)?s:n.nodeLookup.get(s.id));const o=a?bb(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return qy(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Uy(t)},Hm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=qy(t,bb(s)),r=!0)}),r?Uy(t):{x:0,y:0,width:0,height:0}},EC=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,c=(n.y-r)/s,u=n.width/s,h=n.height/s,_=[];for(const p of e.values()){const{measured:m,selectable:w=!0,hidden:k=!1}=p;if(a&&!w||k)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x,y}=p.internals.positionAbsolute,C=nU(o,c,u,h,x,y,v,b),z=v*b,E=i&&C>0;(!p.internals.handleBounds||E||C>=z||p.dragging)&&_.push(p)}return _},lqn=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function uqn(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function _qn({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=uqn(e,a),c=Hm(o),u=zC(c,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function Jq({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:c,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},h=a.origin??r;let _=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",So.error005());else{const m=o.measured.width,w=o.measured.height;m&&w&&(_=[[c,u],[c+m,u+w]])}else o&&mf(a.extent)&&(_=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const p=mf(_)?pf(n,_,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",So.error015())),{position:{x:p.x-c+(a.measured.width??0)*h[0],y:p.y-u+(a.measured.height??0)*h[1]},positionAbsolute:p}}async function fqn({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),w=!m&&p.parentId&&a.find(k=>k.id===p.parentId);(m||w)&&a.push(p)}const o=new Set(n.map(p=>p.id)),c=r.filter(p=>p.deletable!==!1),h=lqn(a,c);for(const p of c)o.has(p.id)&&!h.find(w=>w.id===p.id)&&h.push(p);if(!s)return{edges:h,nodes:a};const _=await s({nodes:a,edges:h});return typeof _=="boolean"?_?{edges:h,nodes:a}:{edges:[],nodes:[]}:_}const Rh=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),pf=(e={x:0,y:0},n,t)=>({x:Rh(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:Rh(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function eU(e,n,t){const{width:r,height:s}=yl(t),{x:i,y:a}=t.internals.positionAbsolute;return pf(e,[[i,a],[i+r,a+s]],n)}const fM=(e,n,t)=>et?-Rh(Math.abs(e-t),1,n)/n:0,NC=(e,n,t=15,r=40)=>{const s=fM(e.x,r,n.width-r)*t,i=fM(e.y,r,n.height-r)*t;return[s,i]},qy=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),fk=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),Uy=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),nm=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=CC(e)?e.internals.positionAbsolute:Fm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},bb=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=CC(e)?e.internals.positionAbsolute:Fm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},tU=(e,n)=>Uy(qy(fk(e),fk(n))),nU=(e,n,t,r,s,i,a,o)=>{const c=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(c*u)},yb=(e,n)=>nU(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),dM=e=>vo(e.width)&&vo(e.height)&&vo(e.x)&&vo(e.y),vo=e=>!isNaN(e)&&isFinite(e),rU=(e,n)=>(t,r)=>{},qm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),Um=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?qm(o,a):o},Mh=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function bd(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.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 dqn(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=bd(e,t),s=bd(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=bd(e.top??e.y??0,t),s=bd(e.bottom??e.y??0,t),i=bd(e.left??e.x??0,n),a=bd(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function hqn(e,n,t,r,s,i){const{x:a,y:o}=Mh(e,[n,t,r]),{x:c,y:u}=Mh({x:e.x+e.width,y:e.y+e.height},[n,t,r]),h=s-c,_=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(h),bottom:Math.floor(_)}}const zC=(e,n,t,r,s,i)=>{const a=dqn(i,n,t),o=(n-a.x)/e.width,c=(t-a.y)/e.height,u=Math.min(o,c),h=Rh(u,r,s),_=e.x+e.width/2,p=e.y+e.height/2,m=n/2-_*h,w=t/2-p*h,k=hqn(e,m,w,h,n,t),v={left:Math.min(k.left-a.left,0),top:Math.min(k.top-a.top,0),right:Math.min(k.right-a.right,0),bottom:Math.min(k.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:w-v.top+v.bottom,zoom:h}},rm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function mf(e){return e!=null&&e!=="parent"}function yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function sU(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function iU(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function hM(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function pqn(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function mqn(e){return{...Qq,...e||{}}}function k0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=bo(e),o=Um({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=t?qm(o,n):o;return{xSnapped:c,ySnapped:u,...o}}const jC=e=>({width:e.offsetWidth,height:e.offsetHeight}),aU=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},gqn=["INPUT","SELECT","TEXTAREA"];function oU(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:gqn.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const cU=e=>"clientX"in e,bo=(e,n)=>{var i,a;const t=cU(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},pM=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...jC(a)}})};function lU({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const c=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,h=Math.abs(c-e),_=Math.abs(u-n);return[c,u,h,_]}function D1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function mM({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Dt.Left:return[n-D1(n-r,i),t];case Dt.Right:return[n+D1(r-n,i),t];case Dt.Top:return[n,t-D1(t-s,i)];case Dt.Bottom:return[n,t+D1(s-t,i)]}}function uU({sourceX:e,sourceY:n,sourcePosition:t=Dt.Bottom,targetX:r,targetY:s,targetPosition:i=Dt.Top,curvature:a=.25}){const[o,c]=mM({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,h]=mM({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[_,p,m,w]=lU({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:h});return[`M${e},${n} C${o},${c} ${u},${h} ${r},${s}`,_,p,m,w]}function _U({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const yqn=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,xqn=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),wqn=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",So.error006()),n;const r=t.getEdgeId||yqn;let s;return Zq(e)?s={...e}:s={...e,id:r(e)},xqn(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function fU({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=_U({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const gM={[Dt.Left]:{x:-1,y:0},[Dt.Right]:{x:1,y:0},[Dt.Top]:{x:0,y:-1},[Dt.Bottom]:{x:0,y:1}},kqn=({source:e,sourcePosition:n=Dt.Bottom,target:t})=>n===Dt.Left||n===Dt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function Sqn({source:e,sourcePosition:n=Dt.Bottom,target:t,targetPosition:r=Dt.Top,center:s,offset:i,stepPosition:a}){const o=gM[n],c=gM[r],u={x:e.x+o.x*i,y:e.y+o.y*i},h={x:t.x+c.x*i,y:t.y+c.y*i},_=kqn({source:u,sourcePosition:n,target:h}),p=_.x!==0?"x":"y",m=_[p];let w=[],k,v;const b={x:0,y:0},x={x:0,y:0},[,,y,C]=_U({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*c[p]===-1){p==="x"?(k=s.x??u.x+(h.x-u.x)*a,v=s.y??(u.y+h.y)/2):(k=s.x??(u.x+h.x)/2,v=s.y??u.y+(h.y-u.y)*a);const j=[{x:k,y:u.y},{x:k,y:h.y}],M=[{x:u.x,y:v},{x:h.x,y:v}];o[p]===m?w=p==="x"?j:M:w=p==="x"?M:j}else{const j=[{x:u.x,y:h.y}],M=[{x:h.x,y:u.y}];if(p==="x"?w=o.x===m?M:j:w=o.y===m?j:M,n===r){const H=Math.abs(e[p]-t[p]);if(H<=i){const Q=Math.min(i-1,i-H);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Q:x[p]=(h[p]>t[p]?-1:1)*Q}}if(n!==r){const H=p==="x"?"y":"x",Q=o[p]===c[H],V=u[H]>h[H],Z=u[H]=q?(k=(D.x+I.x)/2,v=w[0].y):(k=w[0].x,v=(D.y+I.y)/2)}const z={x:u.x+b.x,y:u.y+b.y},E={x:h.x+x.x,y:h.y+x.y};return[[e,...z.x!==w[0].x||z.y!==w[0].y?[z]:[],...w,...E.x!==w[w.length-1].x||E.y!==w[w.length-1].y?[E]:[],t],k,v,y,C]}function Cqn(e,n,t,r){const s=Math.min(vM(e,n)/2,vM(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function hk(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Nqn(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=hk(c,n);i.has(u)||(a.push({id:u,color:c.color||t,...c}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const dU=1e3,zqn=10,TC={nodeOrigin:[0,0],nodeExtent:em,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},jqn={...TC,checkEquality:!0};function AC(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function Tqn(e,n,t){const r=AC(TC,t);for(const s of e.values())if(s.parentId)MC(s,e,n,r);else{const i=Fm(s,r.nodeOrigin),a=mf(s.extent)?s.extent:r.nodeExtent,o=pf(i,a,yl(s));s.internals.positionAbsolute=o}}function Aqn(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function RC(e){return e==="manual"}function pk(e,n,t,r={}){var h,_;const s=AC(jqn,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!RC(s.zIndexMode)?dU:0;let c=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const w=Fm(p,s.nodeOrigin),k=mf(p.extent)?p.extent:s.nodeExtent,v=pf(w,k,yl(p));m={...s.defaults,...p,measured:{width:(h=p.measured)==null?void 0:h.width,height:(_=p.measured)==null?void 0:_.height},internals:{positionAbsolute:v,handleBounds:Aqn(p,m),z:hU(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),p.parentId&&MC(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function Rqn(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function MC(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:c}=AC(TC,r),u=e.parentId,h=n.get(u);if(!h){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Rqn(e,t),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&c==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*zqn),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const _=i&&!RC(c)?dU:0,{x:p,y:m,z:w}=Mqn(e,h,a,o,_,c),{positionAbsolute:k}=e.internals,v=p!==k.x||m!==k.y;(v||w!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:k,z:w}})}function hU(e,n,t){const r=vo(e.zIndex)?e.zIndex:0;return RC(t)?r:r+(e.selected?n:0)}function Mqn(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,c=yl(e),u=Fm(e,t),h=mf(e.extent)?pf(u,e.extent,c):u;let _=pf({x:a+h.x,y:o+h.y},r,c);e.extent==="parent"&&(_=eU(_,c,n));const p=hU(e,s,i),m=n.internals.z??0;return{x:_.x,y:_.y,z:m>=p?m+1:p}}function OC(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const c=n.get(o.parentId);if(!c)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??nm(c),h=tU(u,o.rect);i.set(o.parentId,{expandedRect:h,parent:c})}return i.size>0&&i.forEach(({expandedRect:o,parent:c},u)=>{var y;const h=c.internals.positionAbsolute,_=yl(c),p=c.origin??r,m=o.x0||w>0||b||x)&&(s.push({id:u,type:"position",position:{x:c.position.x-m+b,y:c.position.y-w+x}}),(y=t.get(u))==null||y.forEach(C=>{e.some(z=>z.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+w}})})),(_.width0){const m=OC(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:c}}async function Dqn({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function wM(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const c=r.get(a)||new Map;if(r.set(a,c.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function pU(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,h=`${i}-${o}--${s}-${a}`;wM("source",c,h,e,s,a),wM("target",c,u,e,i,o),n.set(r.id,r)}}function mU(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:mU(t,n):!1}function kM(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Lqn(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!mU(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function N4({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,c;const s=[];for(const[u,h]of n){const _=(a=t.get(u))==null?void 0:a.internals.userNode;_&&s.push({..._,position:h.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((c=n.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function Iqn({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=qm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function $qn({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,c=!1,u={x:0,y:0},h=null,_=!1,p=null,m=!1,w=!1,k=null;function v({noDragClassName:x,handleSelector:y,domNode:C,isSelectable:z,nodeId:E,nodeClickDistance:T=0}){p=aa(C);function j({x:$,y:q}){const{nodeLookup:H,nodeExtent:Q,snapGrid:V,snapToGrid:Z,nodeOrigin:Y,onNodeDrag:B,onSelectionDrag:L,onError:F,updateNodePositions:U}=n();i={x:$,y:q};let K=!1;const ne=o.size>1,oe=ne&&Q?fk(Hm(o)):null,ue=ne&&Z?Iqn({dragItems:o,snapGrid:V,x:$,y:q}):null;for(const[se,G]of o){if(!H.has(se))continue;let ae={x:$-G.distance.x,y:q-G.distance.y};Z&&(ae=ue?{x:Math.round(ae.x+ue.x),y:Math.round(ae.y+ue.y)}:qm(ae,V));let ce=null;if(ne&&Q&&!G.extent&&oe){const{positionAbsolute:Ae}=G.internals,De=Ae.x-oe.x+Q[0][0],We=Ae.x+G.measured.width-oe.x2+Q[1][0],Ne=Ae.y-oe.y+Q[0][1],xe=Ae.y+G.measured.height-oe.y2+Q[1][1];ce=[[De,Ne],[We,xe]]}const{position:pe,positionAbsolute:be}=Jq({nodeId:se,nextPosition:ae,nodeLookup:H,nodeExtent:ce||Q,nodeOrigin:Y,onError:F});K=K||G.position.x!==pe.x||G.position.y!==pe.y,G.position=pe,G.internals.positionAbsolute=be}if(w=w||K,!!K&&(U(o,!0),k&&(r||B||!E&&L))){const[se,G]=N4({nodeId:E,dragItems:o,nodeLookup:H});r==null||r(k,o,se,G),B==null||B(k,se,G),E||L==null||L(k,G)}}async function M(){if(!h)return;const{transform:$,panBy:q,autoPanSpeed:H,autoPanOnNodeDrag:Q}=n();if(!Q){c=!1,cancelAnimationFrame(a);return}const[V,Z]=NC(u,h,H);(V!==0||Z!==0)&&(i.x=(i.x??0)-V/$[2],i.y=(i.y??0)-Z/$[2],await q({x:V,y:Z})&&j(i)),a=requestAnimationFrame(M)}function D($){var ne;const{nodeLookup:q,multiSelectionActive:H,nodesDraggable:Q,transform:V,snapGrid:Z,snapToGrid:Y,selectNodesOnDrag:B,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:U}=n();_=!0,(!B||!z)&&!H&&E&&((ne=q.get(E))!=null&&ne.selected||U()),z&&B&&E&&(e==null||e(E));const K=k0($.sourceEvent,{transform:V,snapGrid:Z,snapToGrid:Y,containerBounds:h});if(i=K,o=Lqn(q,Q,K,E),o.size>0&&(t||L||!E&&F)){const[oe,ue]=N4({nodeId:E,dragItems:o,nodeLookup:q});t==null||t($.sourceEvent,o,oe,ue),L==null||L($.sourceEvent,oe,ue),E||F==null||F($.sourceEvent,ue)}}const I=Rq().clickDistance(T).on("start",$=>{const{domNode:q,nodeDragThreshold:H,transform:Q,snapGrid:V,snapToGrid:Z}=n();h=(q==null?void 0:q.getBoundingClientRect())||null,m=!1,w=!1,k=$.sourceEvent,H===0&&D($),i=k0($.sourceEvent,{transform:Q,snapGrid:V,snapToGrid:Z,containerBounds:h}),u=bo($.sourceEvent,h)}).on("drag",$=>{const{autoPanOnNodeDrag:q,transform:H,snapGrid:Q,snapToGrid:V,nodeDragThreshold:Z,nodeLookup:Y}=n(),B=k0($.sourceEvent,{transform:H,snapGrid:Q,snapToGrid:V,containerBounds:h});if(k=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||E&&!Y.has(E))&&(m=!0),!m){if(!c&&q&&_&&(c=!0,M()),!_){const L=bo($.sourceEvent,h),F=L.x-u.x,U=L.y-u.y;Math.sqrt(F*F+U*U)>Z&&D($)}(i.x!==B.xSnapped||i.y!==B.ySnapped)&&o&&_&&(u=bo($.sourceEvent,h),j(B))}}).on("end",$=>{if(!_||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(c=!1,_=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:q,updateNodePositions:H,onNodeDragStop:Q,onSelectionDragStop:V}=n();if(w&&(H(o,!1),w=!1),s||Q||!E&&V){const[Z,Y]=N4({nodeId:E,dragItems:o,nodeLookup:q,dragging:!1});s==null||s($.sourceEvent,o,Z,Y),Q==null||Q($.sourceEvent,Z,Y),E||V==null||V($.sourceEvent,Y)}}}).filter($=>{const q=$.target;return!$.button&&(!x||!kM(q,`.${x}`,C))&&(!y||kM(q,y,C))});p.call(I)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function Bqn(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())yb(s,nm(i))>0&&r.push(i);return r}const Pqn=250;function Fqn(e,n,t,r){var o,c;let s=[],i=1/0;const a=Bqn(e,t,n+Pqn);for(const u of a){const h=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const _ of h){if(r.nodeId===_.nodeId&&r.type===_.type&&r.id===_.id)continue;const{x:p,y:m}=gf(u,_,_.position,!0),w=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));w>n||(w1){const u=r.type==="source"?"target":"source";return s.find(h=>h.type===u)??s[0]}return s[0]}function gU(e,n,t,r,s,i=!1){var u,h,_;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((h=a.internals.handleBounds)==null?void 0:h.source)??[],...((_=a.internals.handleBounds)==null?void 0:_.target)??[]],c=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return c&&i?{...c,...gf(a,c,c.position,!0)}:c}function vU(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function Hqn(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const bU=()=>!0;function qqn(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:c,lib:u,autoPanOnConnect:h,flowId:_,panBy:p,cancelConnection:m,onConnectStart:w,onConnect:k,onConnectEnd:v,isValidConnection:b=bU,onReconnectEnd:x,updateConnection:y,getTransform:C,getFromHandle:z,autoPanSpeed:E,dragThreshold:T=1,handleDomNode:j}){const M=aU(e.target);let D=0,I;const{x:$,y:q}=bo(e),H=vU(i,j),Q=o==null?void 0:o.getBoundingClientRect();let V=!1;if(!Q||!H)return;const Z=gU(s,H,r,c,n);if(!Z)return;let Y=bo(e,Q),B=!1,L=null,F=!1,U=null;function K(){if(!h||!Q)return;const[pe,be]=NC(Y,Q,E);p({x:pe,y:be}),D=requestAnimationFrame(K)}const ne={...Z,nodeId:s,type:H,position:Z.position},oe=c.get(s);let se={inProgress:!0,isValid:null,from:gf(oe,ne,Dt.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:oe,to:Y,toHandle:null,toPosition:_M[ne.position],toNode:null,pointer:Y};function G(){V=!0,y(se),w==null||w(e,{nodeId:s,handleId:r,handleType:H})}T===0&&G();function ae(pe){if(!V){const{x:xe,y:rt}=bo(pe),Ze=xe-$,ct=rt-q;if(!(Ze*Ze+ct*ct>T*T))return;G()}if(!z()||!ne){ce(pe);return}const be=C();Y=bo(pe,Q),I=Fqn(Um(Y,be,!1,[1,1]),t,c,ne),B||(K(),B=!0);const Ae=yU(pe,{handle:I,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:_,nodeLookup:c});U=Ae.handleDomNode,L=Ae.connection,F=Hqn(!!I,Ae.isValid);const De=c.get(s),We=De?gf(De,ne,Dt.Left,!0):se.from,Ne={...se,from:We,isValid:F,to:Ae.toHandle&&F?Mh({x:Ae.toHandle.x,y:Ae.toHandle.y},be):Y,toHandle:Ae.toHandle,toPosition:F&&Ae.toHandle?Ae.toHandle.position:_M[ne.position],toNode:Ae.toHandle?c.get(Ae.toHandle.nodeId):null,pointer:Y};y(Ne),se=Ne}function ce(pe){if(!("touches"in pe&&pe.touches.length>0)){if(V){(I||U)&&L&&F&&(k==null||k(L));const{inProgress:be,...Ae}=se,De={...Ae,toPosition:se.toHandle?se.toPosition:null};v==null||v(pe,De),i&&(x==null||x(pe,De))}m(),cancelAnimationFrame(D),B=!1,F=!1,L=null,U=null,M.removeEventListener("mousemove",ae),M.removeEventListener("mouseup",ce),M.removeEventListener("touchmove",ae),M.removeEventListener("touchend",ce)}}M.addEventListener("mousemove",ae),M.addEventListener("mouseup",ce),M.addEventListener("touchmove",ae),M.addEventListener("touchend",ce)}function yU(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:c,isValidConnection:u=bU,nodeLookup:h}){const _=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${c}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:w}=bo(e),k=a.elementFromPoint(m,w),v=k!=null&&k.classList.contains(`${o}-flow__handle`)?k:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const x=vU(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),z=v.classList.contains("connectable"),E=v.classList.contains("connectableend");if(!y||!x)return b;const T={source:_?y:r,sourceHandle:_?C:s,target:_?r:y,targetHandle:_?s:C};b.connection=T;const M=z&&E&&(t===Ah.Strict?_&&x==="source"||!_&&x==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=gU(y,x,C,h,t,!0)}return b}const mk={onPointerDown:qqn,isValid:yU};function Uqn({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=aa(e);function i({translateExtent:o,width:c,height:u,zoomStep:h=1,pannable:_=!0,zoomable:p=!0,inversePan:m=!1}){const w=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),z=y.sourceEvent.ctrlKey&&rm()?10:1,E=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*h,T=C[2]*Math.pow(2,E*z);n.scaleTo(T)};let k=[0,0];const v=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])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const z=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],E=[z[0]-k[0],z[1]-k[1]];k=z;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-E[0]*T,y:C[1]-E[1]*T},M=[[0,0],[c,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},x=Kq().on("start",v).on("zoom",_?b:null).on("zoom.wheel",p?w:null);s.call(x,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:uo}}const Gy=e=>({x:e.x,y:e.y,zoom:e.k}),z4=({x:e,y:n,zoom:t})=>Hy.translate(e,n).scale(t),Ad=(e,n)=>e.target.closest(`.${n}`),xU=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),Gqn=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,j4=(e,n=0,t=Gqn,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},wU=e=>{const n=e.ctrlKey&&rm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function Vqn({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:u}){return h=>{if(Ad(h,n))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const _=t.property("__zoom").k||1;if(h.ctrlKey&&a){const v=uo(h),b=wU(h),x=_*Math.pow(2,b);r.scaleTo(t,x,v,h);return}const p=h.deltaMode===1?20:1;let m=s===J_.Vertical?0:h.deltaX*p,w=s===J_.Horizontal?0:h.deltaY*p;!rm()&&h.shiftKey&&s!==J_.Vertical&&(m=h.deltaY*p,w=0),r.translateBy(t,-(m/_)*i,-(w/_)*i,{internal:!0});const k=Gy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(h,k),e.panScrollTimeout=setTimeout(()=>{u==null||u(h,k),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(h,k))}}function Kqn({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=Ad(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function Wqn({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=Gy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function Qqn({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&xU(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,Gy(i.transform)))}}function Xqn({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&xU(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=Gy(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},t?150:0)}}}function Yqn({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:c,lib:u,connectionInProgress:h}){return _=>{var v;const p=e||n,m=t&&_.ctrlKey,w=_.type==="wheel";if(_.button===1&&_.type==="mousedown"&&(Ad(_,`${u}-flow__node`)||Ad(_,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||h&&!w||Ad(_,o)&&w||Ad(_,c)&&(!w||s&&w&&!e)||!t&&_.ctrlKey&&w)return!1;if(!t&&_.type==="touchstart"&&((v=_.touches)==null?void 0:v.length)>1)return _.preventDefault(),!1;if(!p&&!s&&!m&&w||!r&&(_.type==="mousedown"||_.type==="touchstart")||Array.isArray(r)&&!r.includes(_.button)&&_.type==="mousedown")return!1;const k=Array.isArray(r)&&r.includes(_.button)||!_.button||_.button<=1;return(!_.ctrlKey||w)&&k}}function Zqn({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),_=Kq().scaleExtent([n,t]).translateExtent(r),p=aa(e).call(_);x({x:s.x,y:s.y,zoom:Rh(s.zoom,n,t)},[[0,0],[h.width,h.height]],r);const m=p.on("wheel.zoom"),w=p.on("dblclick.zoom");_.wheelDelta(wU);async function k(I,$){return p?new Promise(q=>{_==null||_.interpolate(($==null?void 0:$.interpolate)==="linear"?w0:ov).transform(j4(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),I)}):!1}function v({noWheelClassName:I,noPanClassName:$,onPaneContextMenu:q,userSelectionActive:H,panOnScroll:Q,panOnDrag:V,panOnScrollMode:Z,panOnScrollSpeed:Y,preventScrolling:B,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:U,zoomActivationKeyPressed:K,lib:ne,onTransformChange:oe,connectionInProgress:ue,paneClickDistance:se,selectionOnDrag:G}){H&&!u.isZoomingOrPanning&&b();const ae=Q&&!K&&!H;_.clickDistance(G?1/0:!vo(se)||se<0?0:se);const ce=ae?Vqn({zoomPanValues:u,noWheelClassName:I,d3Selection:p,d3Zoom:_,panOnScrollMode:Z,panOnScrollSpeed:Y,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):Kqn({noWheelClassName:I,preventScrolling:B,d3ZoomHandler:m});p.on("wheel.zoom",ce,{passive:!1});const pe=Wqn({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});_.on("start",pe);const be=Qqn({zoomPanValues:u,panOnDrag:V,onPaneContextMenu:!!q,onPanZoom:i,onTransformChange:oe});_.on("zoom",be);const Ae=Xqn({zoomPanValues:u,panOnDrag:V,panOnScroll:Q,onPaneContextMenu:q,onPanZoomEnd:o,onDraggingChange:c});_.on("end",Ae);const De=Yqn({zoomActivationKeyPressed:K,panOnDrag:V,zoomOnScroll:F,panOnScroll:Q,zoomOnDoubleClick:U,zoomOnPinch:L,userSelectionActive:H,noPanClassName:$,noWheelClassName:I,lib:ne,connectionInProgress:ue});_.filter(De),U?p.on("dblclick.zoom",w):p.on("dblclick.zoom",null)}function b(){_.on("zoom",null)}async function x(I,$,q){const H=z4(I),Q=_==null?void 0:_.constrain()(H,$,q);return Q&&await k(Q),Q}async function y(I,$){const q=z4(I);return await k(q,$),q}function C(I){if(p){const $=z4(I),q=p.property("__zoom");(q.k!==I.zoom||q.x!==I.x||q.y!==I.y)&&(_==null||_.transform(p,$,null,{sync:!0}))}}function z(){const I=p?Vq(p.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}async function E(I,$){return p?new Promise(q=>{_==null||_.interpolate(($==null?void 0:$.interpolate)==="linear"?w0:ov).scaleTo(j4(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),I)}):!1}async function T(I,$){return p?new Promise(q=>{_==null||_.interpolate(($==null?void 0:$.interpolate)==="linear"?w0:ov).scaleBy(j4(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),I)}):!1}function j(I){_==null||_.scaleExtent(I)}function M(I){_==null||_.translateExtent(I)}function D(I){const $=!vo(I)||I<0?0:I;_==null||_.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:x,getViewport:z,scaleTo:E,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:D}}var Oh;(function(e){e.Line="line",e.Handle="handle"})(Oh||(Oh={}));function Jqn({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,c=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(c[0]=c[0]*-1),o&&i&&(c[1]=c[1]*-1),c}function SM(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function lu(e,n){return Math.max(0,n-e)}function uu(e,n){return Math.max(0,e-n)}function L1(e,n,t){return Math.max(0,n-e,e-t)}function CM(e,n){return e?!n:n}function eUn(e,n,t,r,s,i,a,o){let{affectsX:c,affectsY:u}=n;const{isHorizontal:h,isVertical:_}=n,p=h&&_,{xSnapped:m,ySnapped:w}=t,{minWidth:k,maxWidth:v,minHeight:b,maxHeight:x}=r,{x:y,y:C,width:z,height:E,aspectRatio:T}=e;let j=Math.floor(h?m-e.pointerX:0),M=Math.floor(_?w-e.pointerY:0);const D=z+(c?-j:j),I=E+(u?-M:M),$=-i[0]*z,q=-i[1]*E;let H=L1(D,k,v),Q=L1(I,b,x);if(a){let Y=0,B=0;c&&j<0?Y=lu(y+j+$,a[0][0]):!c&&j>0&&(Y=uu(y+D+$,a[1][0])),u&&M<0?B=lu(C+M+q,a[0][1]):!u&&M>0&&(B=uu(C+I+q,a[1][1])),H=Math.max(H,Y),Q=Math.max(Q,B)}if(o){let Y=0,B=0;c&&j>0?Y=uu(y+j,o[0][0]):!c&&j<0&&(Y=lu(y+D,o[1][0])),u&&M>0?B=uu(C+M,o[0][1]):!u&&M<0&&(B=lu(C+I,o[1][1])),H=Math.max(H,Y),Q=Math.max(Q,B)}if(s){if(h){const Y=L1(D/T,b,x)*T;if(H=Math.max(H,Y),a){let B=0;!c&&!u||c&&!u&&p?B=uu(C+q+D/T,a[1][1])*T:B=lu(C+q+(c?j:-j)/T,a[0][1])*T,H=Math.max(H,B)}if(o){let B=0;!c&&!u||c&&!u&&p?B=lu(C+D/T,o[1][1])*T:B=uu(C+(c?j:-j)/T,o[0][1])*T,H=Math.max(H,B)}}if(_){const Y=L1(I*T,k,v)/T;if(Q=Math.max(Q,Y),a){let B=0;!c&&!u||u&&!c&&p?B=uu(y+I*T+$,a[1][0])/T:B=lu(y+(u?M:-M)*T+$,a[0][0])/T,Q=Math.max(Q,B)}if(o){let B=0;!c&&!u||u&&!c&&p?B=lu(y+I*T,o[1][0])/T:B=uu(y+(u?M:-M)*T,o[0][0])/T,Q=Math.max(Q,B)}}}M=M+(M<0?Q:-Q),j=j+(j<0?H:-H),s&&(p?D>I*T?M=(CM(c,u)?-j:j)/T:j=(CM(c,u)?-M:M)*T:h?(M=j/T,u=c):(j=M*T,c=u));const V=c?y+j:y,Z=u?C+M:C;return{width:z+(c?-j:j),height:E+(u?-M:M),x:i[0]*j*(c?-1:1)+V,y:i[1]*M*(u?-1:1)+Z}}const kU={width:0,height:0,x:0,y:0},tUn={...kU,pointerX:0,pointerY:0,aspectRatio:1};function nUn(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,c=t[1]*a;return[[r-o,s-c],[r+i-o,s+a-c]]}function rUn({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=aa(e);let a={controlDirection:SM("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:h,keepAspectRatio:_,resizeDirection:p,onResizeStart:m,onResize:w,onResizeEnd:k,shouldResize:v}){let b={...kU},x={...tUn};a={boundaries:h,resizeDirection:p,keepAspectRatio:_,controlDirection:SM(u)};let y,C=null,z=[],E,T,j,M=!1;const D=Rq().on("start",I=>{const{nodeLookup:$,transform:q,snapGrid:H,snapToGrid:Q,nodeOrigin:V,paneDomNode:Z}=t();if(y=$.get(n),!y)return;C=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:Y,ySnapped:B}=k0(I.sourceEvent,{transform:q,snapGrid:H,snapToGrid:Q,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},x={...b,pointerX:Y,pointerY:B,aspectRatio:b.width/b.height},E=void 0,T=mf(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(E=$.get(y.parentId)),E&&y.extent==="parent"&&(T=[[0,0],[E.measured.width,E.measured.height]]),z=[],j=void 0;for(const[L,F]of $)if(F.parentId===n&&(z.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const U=nUn(F,y,F.origin??V);j?j=[[Math.min(U[0][0],j[0][0]),Math.min(U[0][1],j[0][1])],[Math.max(U[1][0],j[1][0]),Math.max(U[1][1],j[1][1])]]:j=U}m==null||m(I,{...b})}).on("drag",I=>{const{transform:$,snapGrid:q,snapToGrid:H,nodeOrigin:Q}=t(),V=k0(I.sourceEvent,{transform:$,snapGrid:q,snapToGrid:H,containerBounds:C}),Z=[];if(!y)return;const{x:Y,y:B,width:L,height:F}=b,U={},K=y.origin??Q,{width:ne,height:oe,x:ue,y:se}=eUn(x,a.controlDirection,V,a.boundaries,a.keepAspectRatio,K,T,j),G=ne!==L,ae=oe!==F,ce=ue!==Y&&G,pe=se!==B&&ae;if(!ce&&!pe&&!G&&!ae)return;if((ce||pe||K[0]===1||K[1]===1)&&(U.x=ce?ue:b.x,U.y=pe?se:b.y,b.x=U.x,b.y=U.y,z.length>0)){const We=ue-Y,Ne=se-B;for(const xe of z)xe.position={x:xe.position.x-We+K[0]*(ne-L),y:xe.position.y-Ne+K[1]*(oe-F)},Z.push(xe)}if((G||ae)&&(U.width=G&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ne:b.width,U.height=ae&&(!a.resizeDirection||a.resizeDirection==="vertical")?oe:b.height,b.width=U.width,b.height=U.height),E&&y.expandParent){const We=K[0]*(U.width??0);U.x&&U.x{M&&(k==null||k(I,{...b}),s==null||s({...b}),M=!1)});i.call(D)}function c(){i.on(".drag",null)}return{update:o,destroy:c}}const sUn={},EM=e=>{let n;const t=new Set,r=(h,_)=>{const p=typeof h=="function"?h(n):h;if(!Object.is(p,n)){const m=n;n=_??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(w=>w(n,m))}},s=()=>n,c={setState:r,getState:s,getInitialState:()=>u,subscribe:h=>(t.add(h),()=>t.delete(h)),destroy:()=>{(sUn?"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."),t.clear()}},u=n=e(r,s,c);return c},iUn=e=>e?EM(e):EM,{useDebugValue:aUn}=et,{useSyncExternalStoreWithSelector:oUn}=IW,cUn=e=>e;function SU(e,n=cUn,t){const r=oUn(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return aUn(r),r}const NM=(e,n)=>{const t=iUn(e),r=(s,i=n)=>SU(t,s,i);return Object.assign(r,t),r},lUn=(e,n)=>e?NM(e,n):NM;function Cr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const Vy=A.createContext(null),uUn=Vy.Provider,CU=So.error001("react");function Rn(e,n){const t=A.useContext(Vy);if(t===null)throw new Error(CU);return SU(t,e,n)}function Nr(){const e=A.useContext(Vy);if(e===null)throw new Error(CU);return A.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const zM={display:"none"},_Un={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},EU="react-flow__node-desc",NU="react-flow__edge-desc",fUn="react-flow__aria-live",dUn=e=>e.ariaLiveMessage,hUn=e=>e.ariaLabelConfig;function pUn({rfId:e}){const n=Rn(dUn);return f.jsx("div",{id:`${fUn}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:_Un,children:n})}function mUn({rfId:e,disableKeyboardA11y:n}){const t=Rn(hUn);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${EU}-${e}`,style:zM,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${NU}-${e}`,style:zM,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(pUn,{rfId:e})]})}const Ky=A.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:ls(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});Ky.displayName="Panel";const jM="https://reactflow.dev?utm_source=attribution";function gUn({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(Ky,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${jM}`,children:f.jsx("a",{href:jM,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const vUn=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},I1=e=>e.id;function bUn(e,n){return Cr(e.selectedNodes.map(I1),n.selectedNodes.map(I1))&&Cr(e.selectedEdges.map(I1),n.selectedEdges.map(I1))}function yUn({onSelectionChange:e}){const n=Nr(),{selectedNodes:t,selectedEdges:r}=Rn(vUn,bUn);return A.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const xUn=e=>!!e.onSelectionChangeHandlers;function wUn({onSelectionChange:e}){const n=Rn(xUn);return e||n?f.jsx(yUn,{onSelectionChange:e}):null}const zU=[0,0],kUn={x:0,y:0,zoom:1},SUn=["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"],TM=[...SUn,"rfId"],CUn=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}),AM={translateExtent:em,nodeOrigin:zU,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function EUn(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:c}=Rn(CUn,Cr),u=Nr();A.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=AM,o()}),[]);const h=A.useRef(AM);return A.useEffect(()=>{for(const _ of TM){const p=e[_],m=h.current[_];p!==m&&(typeof e[_]>"u"||(_==="nodes"?n(p):_==="edges"?t(p):_==="minZoom"?r(p):_==="maxZoom"?s(p):_==="translateExtent"?i(p):_==="nodeExtent"?a(p):_==="ariaLabelConfig"?u.setState({ariaLabelConfig:mqn(p)}):_==="fitView"?u.setState({fitViewQueued:p}):_==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[_]:p})))}h.current=e},TM.map(_=>e[_])),null}function RM(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function NUn(e){var r;const[n,t]=A.useState(e==="system"?null:e);return A.useEffect(()=>{if(e!=="system"){t(e);return}const s=RM(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=RM())!=null&&r.matches?"dark":"light"}const MM=typeof document<"u"?document:null;function sm(e=null,n={target:MM,actInsideInputWithModifier:!0}){const[t,r]=A.useState(!1),s=A.useRef(!1),i=A.useRef(new Set([])),[a,o]=A.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(_=>typeof _=="string").map(_=>_.replace("+",` +`):e.draft;function rBn(e,n,t){return!Kc(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class sBn{constructor(){Us(this,"buffer",null);Us(this,"listeners",new Set);Us(this,"saving",!1);Us(this,"saveError",null);Us(this,"revision",0);Us(this,"saveRevision",0);Us(this,"getSnapshot",()=>this.buffer);Us(this,"getRevision",()=>this.revision);Us(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Us(this,"set",n=>{this.buffer=n,this.notify()});Us(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Us(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Us(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Kc(this.buffer)||this.buffer.conflict!==null)}}function iBn({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var Z,Y,B;const c=ut({...C6n(),enabled:r,subscribed:r}),u=((Z=c.data)==null?void 0:Z.engine)??(c.isPending?void 0:null),h=((Y=c.data)==null?void 0:Y.hint)??null,_=((B=c.data)==null?void 0:B.installCommand)??null,[p,m]=A.useState(!1),[w,k]=A.useState(null),[v,b]=A.useState(null),[x,y]=A.useState(!1),[C,z]=A.useState(null),[N,T]=A.useState(null),[j,M]=A.useState(!1),[D,I]=A.useState(0),$=A.useCallback(L=>{M(L),L&&I(F=>F+1)},[]),q=A.useRef(o);q.current=o;const H=A.useRef(!1),Q=A.useRef(null),V=A.useCallback(()=>{if(H.current)return;Q.current=n,H.current=!0,m(!0);const L=q.current;T(null),b(null),z(null),wyn(e,n,{sessionId:t}).then(F=>{var K,ne;const U=F.pdfPath;if(F.ok&&U){k(oe=>({path:U,version:((oe==null?void 0:oe.version)??0)+1,source:L})),y(F.hadErrors),z(F.note),F.hadErrors&&b(((K=F.log)==null?void 0:K.trim())||null),$(!0);return}k(null),y(!1),z(F.note),M(!1),b(((ne=F.log)==null?void 0:ne.trim())||LZe())}).catch(F=>{k(null),y(!1),z(null),M(!1),T(F instanceof Error?F.message:String(F))}).finally(()=>{H.current=!1,m(!1)})},[e,n,t,$]);return A.useEffect(()=>{!r||!s||!a||!u||Q.current!==n&&V()},[r,s,a,u,n,V]),{engine:u,installHint:h,installCommand:_,compiling:p,compiled:w,stale:w!==null&&w.source!==o,log:v,builtWithErrors:x,note:C,error:N,showPdf:j,setShowPdf:$,viewNonce:D,compile:()=>{i==null||i(),V()},dismiss:()=>{T(null),b(null)}}}const aBn=3e4,oBn=3e4,cBn=5*6e4;function lBn({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:c}){var ue,se,G,ae;const u=A.useMemo(()=>N6n(e,n,{sessionId:t}),[e,n,t]),h=ut({...u,enabled:r,subscribed:r}),_=((ue=h.data)==null?void 0:ue.hasToken)??!1,p=((se=h.data)==null?void 0:se.hasSession)??!1,m=((G=h.data)==null?void 0:G.link)??null,w=!h.isPending,[k,v]=A.useState(null),[b,x]=A.useState(0),[y,C]=A.useState(!1),[z,N]=A.useState(null),[T,j]=A.useState(null),[M,D]=A.useState(!1),I=A.useCallback(ce=>{Fn(u.queryKey)&&Je.setQueryData(u.queryKey,pe=>pe&&{...pe,hasSession:ce})},[u]),$=A.useCallback(ce=>{Fn(u.queryKey)&&Je.setQueryData(u.queryKey,ce)},[u]);A.useEffect(()=>{N(null),x(0),L.current=!1,j(null),D(!1),V.current=!1},[r,e,n,t]),A.useEffect(()=>{D(!1)},[a]);const q=A.useRef(!1),H=A.useRef(c);H.current=c;const Q=A.useRef(o);Q.current=o;const V=A.useRef(!1),Z=A.useCallback(ce=>!_||!m||q.current||Q.current?!1:(q.current=!0,C(!0),j(null),Ryn(e,n,{sessionId:t,resolve:ce}).then(pe=>{V.current=!1,N(pe),pe.pulled.includes(n)&&(Q.current?D(!0):H.current(pe.pulled))}).catch(pe=>{V.current=!0,N(null),j(pe instanceof Error?pe.message:String(pe))}).finally(()=>{q.current=!1,C(!1)}),!0),[e,n,t,_,m]),Y=A.useRef(null),B=(k==null?void 0:k.state)==="live";A.useEffect(()=>{if(!r||!s||!w||!_||!m||o||B)return;const ce=`${n}:${m.projectId}:${a}`;Y.current!==ce&&Z()&&(Y.current=ce)},[r,s,w,_,m,n,a,o,y,Z,B]);const L=A.useRef(!1);!y&&z&&z.conflicts.length===0&&!T&&(L.current=!0);const F=r&&w&&!!m&&_&&p&&L.current,U=A.useRef(null),K=A.useRef(Promise.resolve()),ne=A.useRef(!1);ne.current=(k==null?void 0:k.state)==="stopped"&&k.error!=null;const oe=A.useRef(!1);return A.useEffect(()=>{if(!F)return;let ce=!1;const pe=()=>{const Ae=oe.current;oe.current=!1,!(!Ae&&ne.current)&&(K.current=K.current.then(()=>{if(!ce)return Nyn(e,n,{sessionId:t,retry:Ae}).then(De=>{var We;ce||((U.current===null||((We=De.status)==null?void 0:We.state)==="stopped")&&v(De.status),U.current=De.key)}).catch(De=>{ce||v({state:"stopped",error:De instanceof Error?De.message:String(De),needsSession:!1,note:null})})}))};pe();const be=setInterval(pe,oBn);return()=>{ce=!0,clearInterval(be),U.current=null,v(null),K.current=K.current.then(()=>zyn(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),A.useEffect(()=>J2n(ce=>{if(ce.key===U.current){if(ce.type==="live"){v(ce.status);return}ce.paths.includes(n)&&(Q.current?D(!0):H.current(ce.paths))}}),[n]),A.useEffect(()=>{if(!r||!s||!w||!_||!m||o||B)return;const ce=setInterval(()=>{q.current||V.current||Je.fetchQuery({...z6n(e,n,{sessionId:t}),staleTime:0}).then(pe=>{pe.remoteChanged&&Z()}).catch(pe=>{V.current=!0,j(pe instanceof Error?pe.message:String(pe))})},aBn);return()=>clearInterval(ce)},[r,s,w,_,m,o,e,n,t,Z,B]),A.useEffect(()=>{if(!r||!s||!w||!_||!m||!B)return;const ce=setInterval(Z,cBn);return()=>clearInterval(ce)},[r,s,w,_,m,B,Z]),{hasToken:_,hasSession:p,live:k,retryLive:()=>{oe.current=!0,x(ce=>ce+1)},link:m,loaded:w,syncing:y,last:z,error:T??((ae=h.error)==null?void 0:ae.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>D(!1),uploadUrl:Oyn(e,n,{sessionId:t}),saveToken:async ce=>{const pe=await VL(ce);Y.current=null,V.current=!1,j(null),Fn(u.queryKey)&&Je.setQueryData(u.queryKey,be=>be&&{...be,hasToken:pe.hasToken})},saveSession:async ce=>{const pe=await KL(ce,{host:m==null?void 0:m.host});I(pe.hasSession),oe.current=!0,x(be=>be+1)},importSession:async()=>{const ce=await Eyn({host:m==null?void 0:m.host});return I(ce.hasSession),oe.current=!0,x(pe=>pe+1),ce.source},linkProject:async ce=>{N(null),v(null),L.current=!1,Y.current=null,$(await Tyn(e,n,{project:ce,sessionId:t})),i==null||i()},unlink:async()=>{$(await Ayn(e,n,{sessionId:t})),Y.current=null,V.current=!1,N(null),j(null)},sync:ce=>{V.current=!1,Z(ce)&&(Y.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}const qR=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],uBn=4e6,_Bn=200,UR=16e6,fBn=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),GR=e=>e.startsWith("//")?`https:${e}`:e;async function dBn(e,n){var s;let t=uBn;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:c}of e){if(r.has(o)){const w=r.get(o);w&&i.setAttribute(a,w);continue}if(n.aborted)return;if(r.size>=_Bn)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const h=u.headers.get("content-type")??"",_=Number(u.headers.get("content-length"));if(!c.some(w=>h.startsWith(w))||!(Number.isFinite(_)&&_>0&&_<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await fBn(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function hBn(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll(qR.map(c=>c.selector).join(", ")))for(const{selector:c,attribute:u,typePrefixes:h}of qR){if(!o.matches(c))continue;const _=o.getAttribute(u);if(!_)continue;const p=n(_);p&&(p===_?o.setAttribute(u,GR(_)):s.push({element:o,attribute:u,url:p,typePrefixes:h}))}await dBn(s,t);for(const o of r.querySelectorAll("a[href]")){const c=o.getAttribute("href");!c||!C6(c)||(o.setAttribute("href",GR(c)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function pBn(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${UR-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>UR}}function mBn({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=A.useState(null);return A.useEffect(()=>{let o=!1;const c=new AbortController;return a(null),pBn(e,n,t,c.signal).then(async({text:u,partial:h})=>({source:await hBn(u,s,c.signal),partial:h})).then(u=>{o||a(u)}),()=>{o=!0,c.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(jt,{})," ",BD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:WFe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:tHe({name:Ce(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function gBn({overleaf:e}){var _;const n=A.useRef(null),{open:t,setOpen:r,ref:s}=Xa(n),i=A.useId(),[a,o]=A.useState({top:0,left:0,maxHeight:0}),c=((_=e.last)==null?void 0:_.conflicts.length)??0,u=e.hasToken&&!!e.error,h=u?h3():c?Imt():!e.hasToken||!e.link?Zbt():e.syncing?iL():e.blocked?sL():tL();return A.useEffect(()=>{c&&r(!0)},[c,r]),A.useEffect(()=>{u&&bn(h3(),"error",{id:i,duration:5e3})},[u,e.error,i]),A.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),w=Math.min(p.bottom+6,window.innerHeight-80);o({top:w,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-w-8}),(s.current.querySelector("input")??s.current).focus();const k=()=>r(!1),v=b=>{var x;b.target instanceof Node&&!((x=s.current)!=null&&x.contains(b.target))&&k()};return window.addEventListener("resize",k),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Ft,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":h,"data-tip-align":"end","aria-label":TZ({status:h}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(jt,{}):f.jsx(j3n,{size:13,className:u||c?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&gi.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":SL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Ft,{size:"small","aria-label":pFe(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(_r,{size:13})})}),f.jsx(wBn,{overleaf:e})]}),document.body)]})}const j1=e=>ia(new Intl.ListFormat(E()).format(e.map(Ce)));function vBn(e){if(e.error)return kgt();if(e.syncing)return iL();if(e.blocked)return sL();const n=e.last;return n?n.pulled.length&&n.pushed.length?_bt({pulled:j1(n.pulled),pushed:j1(n.pushed)}):n.pulled.length?sbt({paths:j1(n.pulled)}):n.pushed.length?vbt({paths:j1(n.pushed)}):n.conflicts.length?S1t():tL():Uvt()}function bBn({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:rL()})}function yBn(e){return e.state==="live"?Ugt():e.state==="connecting"?Igt():e.error??s1t()}function VR({overleaf:e,replacing:n}){const[t,r]=A.useState(""),[s,i]=A.useState(!1),[a,o]=A.useState(!1),[c,u]=A.useState(null),h=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},_=a?_yt():n?Cbt():rgt();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:_}),a&&f.jsx(Ur,{className:"basis-full min-w-0","aria-label":d3(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:d3(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(jt,{}),a?f.jsx(Oe,{type:"button",disabled:s||!t.trim(),onClick:()=>h(()=>e.saveSession(t.trim())),children:s?va():Tmt()}):f.jsx(Oe,{type:"button",disabled:s,onClick:()=>h(e.importSession),children:ugt()}),f.jsx(Oe,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?nL():Yvt()})]}),c&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:c})]})}function xBn({overleaf:e}){if(!e.hasSession)return f.jsx(VR,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:_1t()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:yBn(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Oe,{onClick:e.retryLive,children:Ygt()})}),t&&f.jsx(VR,{overleaf:e,replacing:!0})]})}function wBn({overleaf:e}){var p,m,w;const[n,t]=A.useState(""),[r,s]=A.useState(!1),[i,a]=A.useState(null),[o,c]=A.useState(!1),u=()=>{t(""),a(null),c(!0)},h=!e.hasToken||o;async function _(k){k.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{h?(await e.saveToken(v),c(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!h){const k=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(jt,{}),e.error?h3():vBn(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(xBn,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Oe,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?Rbt():((m=e.live)==null?void 0:m.state)==="live"?Syt():void 0,onClick:()=>e.sync(),children:e.error?Ys():gvt()}),f.jsxs(mh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[svt()," ",f.jsx(of,{size:12})]})]}),k.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",U1t()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Oe,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:Y1t()}),f.jsx(Oe,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Ivt()})]})]},v)),((w=e.last)==null?void 0:w.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:aS()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Oe,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:mz()}),f.jsx(mh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:rL()}),f.jsx(Oe,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Svt()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:_,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:h?Iyt():Uyt()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Ur,{className:"basis-full min-w-0","aria-label":h?hz():pz(),"aria-invalid":!!i,type:h?"password":"text",value:n,onChange:k=>t(k.target.value),placeholder:h?hz():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Oe,{type:"submit",disabled:r||!n.trim(),children:r?h?va():ha():h?Gbt():Tgt()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:h?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:h?Umt():pz()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(bBn,{href:e.uploadUrl}),o?f.jsx(Oe,{variant:"ghost",type:"button",onClick:()=>c(!1),children:nL()}):e.hasToken&&f.jsx(Oe,{variant:"ghost",type:"button",onClick:u,children:mz()})]})]})}function kBn({command:e}){const[n,t]=A.useState("idle"),r=A.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Ft,{"data-tip":n==="copied"?tf():n==="select"?OUe():lPe(),"aria-label":jPe(),onClick:()=>void s(),children:n==="copied"?f.jsx(Fi,{size:13}):f.jsx(Sf,{size:13})})]})}function KR(e){const[n,t]=A.useState(!1),[r,s]=A.useState(null);return{busy:n,error:r,trigger:async()=>{t(!0),s(null);try{await e()}catch(a){s(a instanceof Error?a.message:String(a))}finally{t(!1)}}}}function SBn({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:c,onScrollPositionChange:u,lineScrollRequest:h,onLineScrollRequestHandled:_,onEdit:p,artifactVersion:m,artifactEntries:w=[],bufferSession:k,remote:v=!1,restored:b=!1,onRestoreActivated:x,showSource:y=!1,onShowSourceChange:C}){var jr,In;const z=J$(e,n,t??"repo",r,s),N=ut({...z,enabled:!k.saving}),T=N.data??null,j=((jr=N.error)==null?void 0:jr.message)??null,M=Ke=>{Yr(z.queryKey,gt=>(typeof Ke=="function"?Ke(gt??null):Ke)??void 0)},[D,I]=A.useState(0),$=t==="artifacts",q=t==="abs",H=pC(n),Q=QH(n),V=b$n(n),Z=H||V,[Y,B]=A.useState(!1),L=!b||Y,F=()=>{B(!0),x==null||x()};A.useSyncExternalStore(k.subscribe,k.getRevision);const U=k.getSnapshot(),K=k.set,ne=k.saving,oe=k.setSaving,ue=k.saveRevision,se=k.saveError,G=k.setSaveError,ae=A.useRef(null),ce=A.useRef(null),[pe,be]=A.useState(!1),[Ae,De]=A.useState(null),We=A.useRef(c),Ne=(T==null?void 0:T.file)??null,xe=U&&Kc(U)?U.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,rt=xe.split("/").slice(0,-1).join("/"),Ze=(T==null?void 0:T.source)==="artifact",ct=A.useCallback(Ke=>{var gt;return((gt=l5(rt,Ke,q))==null?void 0:gt.path)??null},[q,rt]),Ct=A.useCallback(Ke=>q?GL(Ke):Ze?sf(e,Ke):k3(e,Ke,{sessionId:r,ref:s}),[Ze,s,q,e,r]),qt=A.useCallback(Ke=>{if(C6(Ke))return Ke;const gt=l5(rt,Ke,q);return gt?X8n(Ct(gt.path),gt):null},[q,rt,Ct]),dt=nq(Ne==null?void 0:Ne.presentation),ht=(T==null?void 0:T.source)==="artifact"&&!$,Le=$&&(T==null?void 0:T.source)==="checkout",me=!s&&(T==null?void 0:T.source)==="checkout"&&Ne!=null&&!Ne.notFound,Te=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",He=me&&Ne!=null&&!Ne.binary&&!Ne.truncated&&!dt&&!Te,nt=He&&Ne.version===void 0,_t=U!==null&&Kc(U),kt=!nt&&(He&&typeof Ne.version=="string"||_t),yt=(U==null?void 0:U.draft)??rk((Ne==null?void 0:Ne.content)??""),Zt=(U==null?void 0:U.baseline)??rk((Ne==null?void 0:Ne.content)??""),un=kt&&U!==null&&Kc(U),At=async Ke=>{const gt=k.getSnapshot();if(!kt||!gt||!Kc(gt))return!0;if(k.saving)return!1;if(gt.conflict&&Ke===void 0)return G(gt.conflict.exists?ON():IN()),!1;const Zr=gt.draft,Wn=nBn(gt);oe(!0),G(null);try{await Je.cancelQueries(z);const wn=await gyn(e,xe,Wn,{sessionId:r,expectedVersion:Ke??gt.version});return k.getSnapshot()?(k.saved(Zr,wn.version),M(rr=>rr&&rr.source==="checkout"?{source:"checkout",file:{...rr.file,content:Wn,version:wn.version}}:rr),!0):!1}catch(wn){if(wn instanceof w3){const Qn=k.getSnapshot();return!Qn||!Kc(Qn)||K({...Qn,conflict:{currentVersion:wn.currentVersion,exists:wn.exists}}),!1}return G(wn instanceof Error?wn.message:String(wn)),!1}finally{oe(!1)}},pt=Q&&me&&!Te,mt=iBn({projectId:e,filePath:xe,sessionId:r,enabled:pt,autoRun:L,onManualAction:F,ready:Ne!=null&&!Ne.notFound,source:kt?yt:(Ne==null?void 0:Ne.content)??""}),_n=lBn({projectId:e,filePath:xe,sessionId:r,enabled:pt,autoRun:L,onManualAction:F,savedSource:Zt,dirty:un,onPulled:A.useCallback(Ke=>{Ke.includes(xe)&&I(gt=>gt+1)},[xe])}),us=Q&&mt.showPdf&&mt.compiled!=null,xr=nt&&_t,Qt=(kt||xr)&&!(Z&&!y)&&!us,Mn=Ne!==null&&!Ne.notFound&&!Ne.binary&&!dt&&!us,mr=Mn&&!Qt&&(!V||y),gr=async()=>{if(Ne)try{if(Ne.truncated&&!Qt){const Ke=fetch(Ct(xe)).then(async gt=>{if(!gt.ok)throw new Error;return new Blob([await gt.text()],{type:"text/plain"})});await navigator.clipboard.write([new ClipboardItem({"text/plain":Ke})])}else await navigator.clipboard.writeText(Qt?yt:Ne.content);be(!0),window.setTimeout(()=>be(!1),1500)}catch{bn(wPe(),"error")}},_s=Ke=>{if(!Ke.metaKey&&!Ke.ctrlKey||Ke.altKey||Ke.shiftKey||Ke.key.toLowerCase()!=="a"||!(Ke.target instanceof Node)||!Ke.currentTarget.contains(Ke.target))return;const gt=ce.current;if(!gt)return;Ke.preventDefault();const Zr=document.createRange();Zr.selectNodeContents(gt);const Wn=window.getSelection();Wn==null||Wn.removeAllRanges(),Wn==null||Wn.addRange(Zr)},Et=mt.compiled?`${k3(e,mt.compiled.path,{sessionId:r})}&v=${mt.compiled.version}`:null,fn=Et?`${Et}&view=${mt.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,an=mt.compiled?mt.compiled.path.split("/").pop()??mt.compiled.path:null,xn=async()=>{un&&!await At()||Q&&mt.engine&&mt.compile()},Ir=async()=>{un&&(L?await xn():await At())},mn=KR(()=>byn(e,xe,{sessionId:r})),gn=KR(()=>yyn(e,xe,{sessionId:r})),Ln=v?hqe():Ne!=null&&Ne.notFound?PN():s?oqe({branch:Ce(s)}):me?null:xqe(),Nt=A.useCallback(()=>{k.saving||I(Ke=>Ke+1)},[k]),Ot=()=>{K(null),G(null),Nt()},Hn=sq(Ct(xe),!s&&!ne);A.useEffect(()=>{if(!j||s)return;const Ke=window.setInterval(()=>{document.visibilityState!=="hidden"&&Nt()},2e3);return()=>window.clearInterval(Ke)},[j,s,Nt]);const zr=`${Ct(xe)}&v=${encodeURIComponent(Hn??m??"")}&reload=${D}`;A.useEffect(()=>{var Zr,Wn;if(!T||k.saving)return;const Ke=T,gt=k.getSnapshot();if(gt&&Kc(gt)){const wn=Ke.source==="checkout"?Ke.file:null,Qn=wn!==null&&wn.path===gt.path&&(!r||wn.root==="worktree"),rr=rBn(gt,Qn&&typeof wn.version=="string"?wn.version:null,Qn&&!wn.notFound);rr&&(rr.currentVersion!==((Zr=gt.conflict)==null?void 0:Zr.currentVersion)||rr.exists!==((Wn=gt.conflict)==null?void 0:Wn.exists))?K({...gt,conflict:rr}):!rr&>.conflict&&K({...gt,conflict:null})}(!gt||!Kc(gt))&&Ke.source==="checkout"&&!Ke.file.notFound&&!Ke.file.binary&&!Ke.file.truncated&&typeof Ke.file.version=="string"&&(K(HR(Ke.file.path,Ke.file.content,Ke.file.version)),G(null))},[T,k,r,ne,ue]);const nr=JSON.stringify(z.queryKey),On=A.useRef({sourceKey:nr,nonce:D,artifactVersion:m,diskVersion:Hn});A.useEffect(()=>{const Ke=On.current;On.current={sourceKey:nr,nonce:D,artifactVersion:m,diskVersion:Hn},Ke.sourceKey===nr&&(Ke.nonce!==D||Ke.diskVersion!==null&&Ke.diskVersion!==Hn||Ke.artifactVersion!=null&&Ke.artifactVersion!==m)&&j6n(e,n,t??"repo",r,s)},[nr,D,m,Hn,e,n,t,r,s]),A.useLayoutEffect(()=>{const Ke=ae.current,gt=We.current;!Ke||!Ne||!gt||(Ke.scrollTop=gt.top,Ke.scrollLeft=gt.left)},[Ne]);const hr=Ke=>{if(Ke.source==="absolute")return OHe();if($)return yHe({root:r?Jg():Zg()});if(s)return NHe({branch:Ce(s)});if(r&&Ke.source==="checkout"&&Ke.file.root==="clone")return MGe();const gt=Ke.source==="checkout"?Ke.file.root:Ke.checkoutRoot;return FHe({root:gt==="worktree"?Jg():Zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",onKeyDown:_s,children:[f.jsxs("div",{className:"file-view-header @container flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(zh,{name:xe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ce(xe),children:xe.split("/").pop()||xe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap [&_svg]:flex-none",title:XQ({branch:Ce(a)}),children:[f.jsx(zm,{size:11}),a]}),Qt&&(ne||un||se)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${se?"text-accent-red":"text-muted"}`,title:se??(ne?va():bGe()),children:ne?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",NUe()]}):se?yUe():PD()}),f.jsx("div",{ref:De,className:"contents"}),Q&&mt.compiled&&f.jsx(Ft,{size:"small",active:!mt.showPdf,"data-tip":mt.stale&&mt.showPdf?Hqe():mt.showPdf?zd():UN(),"data-tip-align":"end","aria-label":mt.showPdf?zd():UN(),onClick:()=>mt.setShowPdf(!mt.showPdf),children:mt.showPdf?f.jsx(P3,{size:13}):f.jsx($b,{size:13,className:mt.stale?"text-accent-amber":void 0})}),Q&&Et&&an&&f.jsx(Ih,{size:"small","data-tip":mt.stale?zFe({name:Ce(an)}):Sv({name:Ce(an)}),"data-tip-align":"end","aria-label":Sv({name:Ce(an)}),href:Et,download:an,children:f.jsx(Lb,{size:13,className:mt.stale?"text-accent-amber":void 0})}),pt&&f.jsx(gBn,{overleaf:_n}),Q&&me&&f.jsx(Ft,{size:"small","data-tip":mt.compiled?HN():DN(),"data-tip-align":"end","aria-label":mt.compiled?HN():DN(),disabled:mt.compiling||!mt.engine,onClick:()=>void xn(),children:mt.compiling?f.jsx(jt,{}):f.jsx(B3n,{size:13})}),Z&&f.jsx(Ft,{size:"small",active:y,"data-tip":y?Ev():zd(),"data-tip-align":"end","aria-label":y?Ev():zd(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(P3,{size:13})}),Mn&&f.jsx(Ft,{size:"small","data-tip":pe?tf():LN(),"data-tip-align":"end","aria-label":pe?tf():LN(),onClick:()=>void gr(),children:pe?f.jsx(Fi,{size:13}):f.jsx(Sf,{size:13})}),Ne!=null&&f.jsxs(f.Fragment,{children:[f.jsx(Ft,{size:"small","data-tip":Ln??mn.error??FN(),"data-tip-align":"end","aria-label":FN(),"aria-description":Ln??void 0,disabled:mn.busy||Ln!=null,onClick:()=>void mn.trigger(),children:mn.busy?f.jsx(jt,{}):f.jsx(of,{size:13})}),f.jsx(Ft,{size:"small","data-tip":Ln??gn.error??qN(),"data-tip-align":"end","aria-label":qN(),"aria-description":Ln??void 0,disabled:gn.busy||Ln!=null,onClick:()=>void gn.trigger(),children:gn.busy?f.jsx(jt,{}):f.jsx(Ou,{size:13})})]})]}),!j&&Le&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:WHe({root:T.file.root==="worktree"?Jg():Zg()})}),nt&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:EGe()}),j&&Ne!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[BN()," ",Ce(j)]}),(U==null?void 0:U.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:U.conflict.exists?ON():IN()}),((In=U==null?void 0:U.conflict)==null?void 0:In.exists)&&U.conflict.currentVersion&&f.jsx(Oe,{disabled:ne,onPointerDown:Ke=>Ke.preventDefault(),onClick:()=>{var Ke;return void At(((Ke=U.conflict)==null?void 0:Ke.currentVersion)??void 0)},children:Dqe()}),f.jsx(Oe,{disabled:ne,onPointerDown:Ke=>Ke.preventDefault(),onClick:Ot,children:oUe()})]}),(mt.error||mt.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${mt.builtWithErrors?"text-subtext":"text-accent-red"}`,children:mt.error??(mt.builtWithErrors?nPe():qBe())}),f.jsx(Ft,{"data-tip":tFe(),"data-tip-align":"end","aria-label":cFe(),onClick:mt.dismiss,children:f.jsx(_r,{size:13})})]}),mt.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:mt.log})]}),pt&&_n.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:zqe()}),f.jsx(Oe,{onClick:()=>{_n.reloaded(),I(Ke=>Ke+1)},children:HPe()})]}),Q&&me&&mt.engine===null&&mt.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[mt.installHint,mt.installCommand&&f.jsx(kBn,{command:mt.installCommand})]}),mt.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:mt.note}),us&&mt.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:JUe()}),f.jsxs("div",{ref:ae,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",tabIndex:mr?0:void 0,onScroll:Ke=>{const gt={top:Math.max(0,Ke.currentTarget.scrollTop),left:Math.max(0,Ke.currentTarget.scrollLeft)};We.current=gt,u==null||u(gt)},children:[!Qt&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:aGe()}),!Qt&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&ht&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:kBe({root:T.checkoutRoot==="worktree"?Jg():Zg()})}),j&&Ne===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[BN()," ",Ce(j)]}):Ne===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:BD()}):Qt?f.jsx(q$,{value:yt,onChange:Ke=>{const gt=k.getSnapshot()??(Ne&&typeof Ne.version=="string"?HR(Ne.path,Ne.content,Ne.version):null);gt&&K(tBn(gt,Ke)),p==null||p(),se&&G(null)},onSave:()=>void Ir(),onBlur:()=>{nk||Ir()},readOnly:xr,path:n,highlightLine:i,scrollRequest:h,onScrollRequestHandled:_,scrollPosition:We.current,onScrollPositionChange:Ke=>{We.current=Ke,u==null||u(Ke)}}):Ne.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?hr(T):PN()}):dt?f.jsx(ub.Provider,{value:Ae,children:f.jsx(tk,{kind:dt,url:zr,name:n.split("/").pop()??n})}):Ne.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[TBe()," ",f.jsx("a",{href:zr,download:n.split("/").pop()??n,children:$D()})]}):us&&fn&&an?f.jsx(ub.Provider,{value:Ae,children:f.jsx(tk,{kind:"pdf",url:fn,name:an,download:!1},fn)}):H&&!y?f.jsx("div",{ref:ce,className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:Ze?f.jsx(lq,{projectId:e,folder:rt,markdown:Ne.content,entries:w}):f.jsx(nc,{text:Ne.content,resolveFilePath:ct,resolveImageSrc:qt,onOpenFile:o&&((Ke,gt,Zr,Wn,wn)=>o(Ke,r,s,wn))})}):V&&!y?f.jsx(mBn,{html:Ne.content,truncated:Ne.truncated,url:zr,name:xe,resolveSrc:qt}):f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:ce,children:f.jsx(tq,{text:Ne.content,path:n,highlightLine:i,scrollRequest:h,onScrollRequestHandled:_})}),Ne.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:FFe()})]})]})]})}const w4=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function CBn({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=Xa(),c=A.useRef(null);return A.useEffect(()=>{if(!i)return;const u=h=>{var _;h.key==="Escape"&&((_=c.current)==null||_.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Ft,{size:"small",className:"project-back text-text","aria-label":VN(),onClick:n,children:f.jsx(M0,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:hXe()}),s&&f.jsx(Ft,{size:"small","data-tip":KN(),"data-tip-align":"end","aria-label":KN(),onClick:s,children:f.jsx(QI,{size:18})})]}),f.jsxs("button",{ref:c,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(ac,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(Dn,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:w4,children:[f.jsx(UI,{size:14}),WQe()]})}),f.jsx(Dn,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:w4,children:[f.jsx(VI,{size:14}),VN()]})}),f.jsx(Dn,{onClick:()=>{var u;(u=c.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:w4,children:[f.jsx(K3n,{size:14}),tXe()]})})]})]})})}function gq({id:e,name:n,hasParent:t,onArchive:r,compact:s=!1}){const i=A.useRef(null),a=Xa(i),[o,c]=A.useState({top:0,left:0}),u=()=>{if(!a.open&&i.current){const _=i.current.getBoundingClientRect(),p=window.innerHeight-_.bottom>=160;c({top:p?_.bottom+4:Math.max(4,_.top-160),left:Math.max(4,Math.min(_.right-176,window.innerWidth-180))})}a.setOpen(_=>!_)},h=(_,p)=>{a.setOpen(!1),r(e,_,p)};return f.jsxs("div",{className:"nodrag",children:[s?f.jsx("button",{type:"button",ref:i,className:"node-action","aria-label":Pz({name:n}),"aria-expanded":a.open,onClick:u,children:f.jsx(Ib,{size:15,"aria-hidden":"true"})}):f.jsx("button",{type:"button",className:"btn inline-flex h-7 items-center justify-center rounded-sm border border-border bg-background px-2.5 text-sm text-text hover:bg-surface",ref:i,"aria-label":Pz({name:n}),"aria-expanded":a.open,onClick:u,children:upn()}),a.open&&gi.createPortal(f.jsxs("div",{ref:a.ref,className:"option-menu fixed z-50 min-w-44 rounded-lg border border-border bg-background p-1.5 shadow-menu",style:o,children:[t&&f.jsx(Dn,{onClick:()=>h("up",!0),children:Xhn()}),f.jsx(Dn,{onClick:()=>h("down",!0),children:rpn()}),t&&f.jsx(Dn,{onClick:()=>h("up",!1),children:l0n()}),f.jsx(Dn,{onClick:()=>h("down",!1),children:m0n()})]}),document.body)]})}function EBn({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onArchive:a,onCancel:o}){const[c,u]=A.useState(new Set),[h,_]=A.useState(null),p=new Map;for(const k of e){const v=p.get(k.experimentId);v?v.push(k):p.set(k.experimentId,[k])}for(const k of p.values())k.sort((v,b)=>b.createdAt-v.createdAt);const m=[...n].sort((k,v)=>{var y,C,z,N;const b=((C=(y=p.get(k.id))==null?void 0:y[0])==null?void 0:C.createdAt)??k.createdAt;return(((N=(z=p.get(v.id))==null?void 0:z[0])==null?void 0:N.createdAt)??v.createdAt)-b});if(m.length===0)return f.jsx(gC,{icon:gh,title:t??oIe(),description:t?void 0:KLe()});async function w(k){_(null),u(v=>new Set(v).add(k));try{await o(k)}catch(v){u(b=>{const x=new Set(b);return x.delete(k),x}),_(v instanceof Error?v.message:String(v))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[h&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[w$e()," ",h]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":l$e(),children:m.map(k=>{const v=p.get(k.id)??[],b=v[0]??null,x=v.find(N=>N.status==="running"||N.status==="starting"),y=x??b,C=!!(x&&(x.cancelRequested||c.has(x.id))),z=x?C?"cancelling":la(x):b?la(b):"idle";return f.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-divider-subtle 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,"preview"),onDoubleClick:()=>r(k,"keepOpen"),onAuxClick:N=>{N.button===1&&(N.preventDefault(),r(k,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Gr(N=>r(k,N),{stopPropagation:!0}),children:k.title||k.slug}),k.archived&&f.jsx("span",{className:"text-muted text-xs",children:IL()}),f.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:[f.jsx(zm,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:k.branchName})]})]}),f.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:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx(cl,{status:z})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:v.length===1?xIe():DIe({count:tn(v.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:b?wo(b.createdAt):hIe()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":LQ({name:k.title||k.slug}),onClick:N=>N.stopPropagation(),onDoubleClick:N=>N.stopPropagation(),onAuxClick:N=>N.stopPropagation(),children:[f.jsxs(Oe,{size:"small",disabled:!y,title:y?zIe():eIe(),...Gr(N=>{y&&s(k.id,y.id,N)},{stopPropagation:!0}),children:[f.jsx(ko,{size:15}),u3()]}),f.jsxs(Oe,{size:"small",title:bD({branch:Ce(k.branchName)}),...Gr(N=>i(k.id,N),{stopPropagation:!0}),children:[f.jsx(Bb,{size:15}),n$e()]}),f.jsx(gq,{id:k.id,name:k.title||k.slug,hasParent:!!k.parentExperimentId,onArchive:a}),x&&f.jsxs(Oe,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:C,title:C?HIe():QIe(),onClick:()=>void w(x.id),children:[f.jsx(PI,{size:15}),C?Xje():DD()]})]})]},k.id)})})]})}function NBn({onClose:e,onCreateProject:n}){const[t,r]=A.useState(!1),[s,i]=A.useState(null),a=A.useRef(null),o=A.useCallback(c=>{t||(r(!0),i(null),c().catch(()=>i(khn())).finally(()=>r(!1)))},[t]);return A.useEffect(()=>{const c=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e,o]),A.useEffect(()=>{const c=a.current;if(!c)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,h=()=>[...c.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(h()[0]??c).focus();const _=p=>{if(p.key!=="Tab")return;const m=h();if(m.length===0){p.preventDefault(),c.focus();return}const w=m[0],k=m[m.length-1];p.shiftKey&&document.activeElement===w?(p.preventDefault(),k.focus()):!p.shiftKey&&document.activeElement===k&&(p.preventDefault(),w.focus())};return document.addEventListener("keydown",_,!0),()=>{document.removeEventListener("keydown",_,!0),u==null||u.focus()}},[]),gi.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Ft,{className:"absolute end-3.5 top-3.5","aria-label":y3(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(_r,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx(AS,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Qdn()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:Ihn()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[Thn()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:lhn()}),jdn()]}),f.jsx("p",{dir:"auto",children:nhn()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Oe,{onClick:()=>o(n),disabled:t,children:Hdn()}),f.jsx(Oe,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?va():mhn()})]})]})}),document.body)}function ls(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function $y(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}av.prototype=$y.prototype={constructor:av,on:function(e,n){var t=this._,r=jBn(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),QR.hasOwnProperty(n)?{space:QR[n],local:e}:e}function ABn(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===sk&&n.documentElement.namespaceURI===sk?n.createElement(e):n.createElementNS(t,e)}}function RBn(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vq(e){var n=By(e);return(n.local?RBn:ABn)(n)}function MBn(){}function vC(e){return e==null?MBn:function(){return this.querySelector(e)}}function OBn(e){typeof e!="function"&&(e=vC(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=x+1);!(z=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function iPn(e){e||(e=aPn);function n(_,p){return _&&p?e(_.__data__,p.__data__):!_-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function oPn(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cPn(){return Array.from(this)}function lPn(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?yPn:typeof n=="function"?wPn:xPn)(e,n,t??"")):jh(this.node(),e)}function jh(e,n){return e.style.getPropertyValue(n)||kq(e).getComputedStyle(e,null).getPropertyValue(n)}function SPn(e){return function(){delete this[e]}}function CPn(e,n){return function(){this[e]=n}}function EPn(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function NPn(e,n){return arguments.length>1?this.each((n==null?SPn:typeof n=="function"?EPn:CPn)(e,n)):this.node()[e]}function Sq(e){return e.trim().split(/^|\s+/)}function bC(e){return e.classList||new Cq(e)}function Cq(e){this._node=e,this._names=Sq(e.getAttribute("class")||"")}Cq.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Eq(e,n){for(var t=bC(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function tFn(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function ik(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:c,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:h}})}ik.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function _Fn(e){return!e.ctrlKey&&!e.button}function fFn(){return this.parentNode}function dFn(e,n){return n??{x:e.x,y:e.y}}function hFn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Rq(){var e=_Fn,n=fFn,t=dFn,r=hFn,s={},i=$y("start","drag","end"),a=0,o,c,u,h,_=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,uFn).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,z){if(!(h||!e.call(this,C,z))){var N=y(this,n.call(this,C,z),C,z,"mouse");N&&(aa(C.view).on("mousemove.drag",w,X0).on("mouseup.drag",k,X0),Tq(C.view),k4(C),u=!1,o=C.clientX,c=C.clientY,N("start",C))}}function w(C){if(Ud(C),!u){var z=C.clientX-o,N=C.clientY-c;u=z*z+N*N>_}s.mouse("drag",C)}function k(C){aa(C.view).on("mousemove.drag mouseup.drag",null),Aq(C.view,u),Ud(C),s.mouse("end",C)}function v(C,z){if(e.call(this,C,z)){var N=C.changedTouches,T=n.call(this,C,z),j=N.length,M,D;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?A1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?A1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=mFn.exec(e))?new Pi(n[1],n[2],n[3],1):(n=gFn.exec(e))?new Pi(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=vFn.exec(e))?A1(n[1],n[2],n[3],n[4]):(n=bFn.exec(e))?A1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=yFn.exec(e))?nM(n[1],n[2]/100,n[3]/100,1):(n=xFn.exec(e))?nM(n[1],n[2]/100,n[3]/100,n[4]):XR.hasOwnProperty(e)?JR(XR[e]):e==="transparent"?new Pi(NaN,NaN,NaN,0):null}function JR(e){return new Pi(e>>16&255,e>>8&255,e&255,1)}function A1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Pi(e,n,t,r)}function SFn(e){return e instanceof Pm||(e=df(e)),e?(e=e.rgb(),new Pi(e.r,e.g,e.b,e.opacity)):new Pi}function ak(e,n,t,r){return arguments.length===1?SFn(e):new Pi(e,n,t,r??1)}function Pi(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}yC(Pi,ak,Mq(Pm,{brighter(e){return e=e==null?fb:Math.pow(fb,e),new Pi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Y0:Math.pow(Y0,e),new Pi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pi(Z_(this.r),Z_(this.g),Z_(this.b),db(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:eM,formatHex:eM,formatHex8:CFn,formatRgb:tM,toString:tM}));function eM(){return`#${R_(this.r)}${R_(this.g)}${R_(this.b)}`}function CFn(){return`#${R_(this.r)}${R_(this.g)}${R_(this.b)}${R_((isNaN(this.opacity)?1:this.opacity)*255)}`}function tM(){const e=db(this.opacity);return`${e===1?"rgb(":"rgba("}${Z_(this.r)}, ${Z_(this.g)}, ${Z_(this.b)}${e===1?")":`, ${e})`}`}function db(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Z_(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function R_(e){return e=Z_(e),(e<16?"0":"")+e.toString(16)}function nM(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new mo(e,n,t,r)}function Oq(e){if(e instanceof mo)return new mo(e.h,e.s,e.l,e.opacity);if(e instanceof Pm||(e=df(e)),!e)return new mo;if(e instanceof mo)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,c=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&c<1?0:a,new mo(a,o,c,e.opacity)}function EFn(e,n,t,r){return arguments.length===1?Oq(e):new mo(e,n,t,r??1)}function mo(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}yC(mo,EFn,Mq(Pm,{brighter(e){return e=e==null?fb:Math.pow(fb,e),new mo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Y0:Math.pow(Y0,e),new mo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Pi(S4(e>=240?e-240:e+120,s,r),S4(e,s,r),S4(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new mo(rM(this.h),R1(this.s),R1(this.l),db(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=db(this.opacity);return`${e===1?"hsl(":"hsla("}${rM(this.h)}, ${R1(this.s)*100}%, ${R1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rM(e){return e=(e||0)%360,e<0?e+360:e}function R1(e){return Math.max(0,Math.min(1,e||0))}function S4(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const xC=e=>()=>e;function NFn(e,n){return function(t){return e+t*n}}function zFn(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function jFn(e){return(e=+e)==1?Dq:function(n,t){return t-n?zFn(n,t,e):xC(isNaN(n)?t:n)}}function Dq(e,n){var t=n-e;return t?NFn(e,t):xC(isNaN(e)?n:e)}const hb=(function e(n){var t=jFn(n);function r(s,i){var a=t((s=ak(s)).r,(i=ak(i)).r),o=t(s.g,i.g),c=t(s.b,i.b),u=Dq(s.opacity,i.opacity);return function(h){return s.r=a(h),s.g=o(h),s.b=c(h),s.opacity=u(h),s+""}}return r.gamma=e,r})(1);function TFn(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,c.push({i:a,x:Ko(r,s)})),t=C4.lastIndex;return t180?h+=360:h-u>180&&(u+=360),p.push({i:_.push(s(_)+"rotate(",null,r)-2,x:Ko(u,h)})):h&&_.push(s(_)+"rotate("+h+r)}function o(u,h,_,p){u!==h?p.push({i:_.push(s(_)+"skewX(",null,r)-2,x:Ko(u,h)}):h&&_.push(s(_)+"skewX("+h+r)}function c(u,h,_,p,m,w){if(u!==_||h!==p){var k=m.push(s(m)+"scale(",null,",",null,")");w.push({i:k-4,x:Ko(u,_)},{i:k-2,x:Ko(h,p)})}else(_!==1||p!==1)&&m.push(s(m)+"scale("+_+","+p+")")}return function(u,h){var _=[],p=[];return u=e(u),h=e(h),i(u.translateX,u.translateY,h.translateX,h.translateY,_,p),a(u.rotate,h.rotate,_,p),o(u.skewX,h.skewX,_,p),c(u.scaleX,u.scaleY,h.scaleX,h.scaleY,_,p),u=h=null,function(m){for(var w=-1,k=p.length,v;++w=0&&e._call.call(void 0,n),e=e._next;--Th}function aM(){hf=(mb=J0.now())+Py,Th=o0=0;try{GFn()}finally{Th=0,KFn(),hf=0}}function VFn(){var e=J0.now(),n=e-mb;n>Bq&&(Py-=n,mb=e)}function KFn(){for(var e,n=pb,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:pb=t);c0=e,lk(r)}function lk(e){if(!Th){o0&&(o0=clearTimeout(o0));var n=e-hf;n>24?(e<1/0&&(o0=setTimeout(aM,e-J0.now()-Py)),Jp&&(Jp=clearInterval(Jp))):(Jp||(mb=J0.now(),Jp=setInterval(VFn,Bq)),Th=1,Pq(aM))}}function oM(e,n,t){var r=new gb;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var WFn=$y("start","end","cancel","interrupt"),QFn=[],Hq=0,cM=1,uk=2,cv=3,lM=4,_k=5,lv=6;function Fy(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;XFn(e,t,{name:n,index:r,group:s,on:WFn,tween:QFn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Hq})}function kC(e,n){var t=Co(e,n);if(t.state>Hq)throw new Error("too late; already scheduled");return t}function fc(e,n){var t=Co(e,n);if(t.state>cv)throw new Error("too late; already running");return t}function Co(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function XFn(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=Fq(i,0,t.time);function i(u){t.state=cM,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var h,_,p,m;if(t.state!==cM)return c();for(h in r)if(m=r[h],m.name===t.name){if(m.state===cv)return oM(a);m.state===lM?(m.state=lv,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[h]):+huk&&r.state<_k,r.state=lv,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete t[a]}i&&delete e.__transition}}function YFn(e){return this.each(function(){uv(this,e)})}function ZFn(e,n){var t,r;return function(){var s=fc(this,e),i=s.tween;if(i!==t){r=t=i;for(var a=0,o=r.length;a=0&&(n=n.slice(0,t)),!n||n==="start"})}function EHn(e,n,t){var r,s,i=CHn(n)?kC:fc;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function NHn(e,n){var t=this._id;return arguments.length<2?Co(this.node(),t).on.on(e):this.each(EHn(t,e,n))}function zHn(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function jHn(){return this.on("end.remove",zHn(this._id))}function THn(e){var n=this._name,t=this._id;typeof e!="function"&&(e=vC(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function tqn(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function il(e,n,t){this.k=e,this.x=n,this.y=t}il.prototype={constructor:il,scale:function(e){return e===1?this:new il(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new il(this.k,this.x+this.k*e,this.y+this.k*n)},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 Hy=new il(1,0,0);Vq.prototype=il.prototype;function Vq(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Hy;return e.__zoom}function E4(e){e.stopImmediatePropagation()}function e0(e){e.preventDefault(),e.stopImmediatePropagation()}function nqn(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function rqn(){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 uM(){return this.__zoom||Hy}function sqn(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function iqn(){return navigator.maxTouchPoints||"ontouchstart"in this}function aqn(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Kq(){var e=nqn,n=rqn,t=aqn,r=sqn,s=iqn,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,c=ov,u=$y("start","zoom","end"),h,_,p,m=500,w=150,k=0,v=10;function b(H){H.property("__zoom",uM).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",D).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(H,Q,V,Z){var Y=H.selection?H.selection():H;Y.property("__zoom",uM),H!==Y?z(H,Q,V,Z):Y.interrupt().each(function(){N(this,arguments).event(Z).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},b.scaleBy=function(H,Q,V,Z){b.scaleTo(H,function(){var Y=this.__zoom.k,B=typeof Q=="function"?Q.apply(this,arguments):Q;return Y*B},V,Z)},b.scaleTo=function(H,Q,V,Z){b.transform(H,function(){var Y=n.apply(this,arguments),B=this.__zoom,L=V==null?C(Y):typeof V=="function"?V.apply(this,arguments):V,F=B.invert(L),U=typeof Q=="function"?Q.apply(this,arguments):Q;return t(y(x(B,U),L,F),Y,a)},V,Z)},b.translateBy=function(H,Q,V,Z){b.transform(H,function(){return t(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof V=="function"?V.apply(this,arguments):V),n.apply(this,arguments),a)},null,Z)},b.translateTo=function(H,Q,V,Z,Y){b.transform(H,function(){var B=n.apply(this,arguments),L=this.__zoom,F=Z==null?C(B):typeof Z=="function"?Z.apply(this,arguments):Z;return t(Hy.translate(F[0],F[1]).scale(L.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof V=="function"?-V.apply(this,arguments):-V),B,a)},Z,Y)};function x(H,Q){return Q=Math.max(i[0],Math.min(i[1],Q)),Q===H.k?H:new il(Q,H.x,H.y)}function y(H,Q,V){var Z=Q[0]-V[0]*H.k,Y=Q[1]-V[1]*H.k;return Z===H.x&&Y===H.y?H:new il(H.k,Z,Y)}function C(H){return[(+H[0][0]+ +H[1][0])/2,(+H[0][1]+ +H[1][1])/2]}function z(H,Q,V,Z){H.on("start.zoom",function(){N(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(Z).end()}).tween("zoom",function(){var Y=this,B=arguments,L=N(Y,B).event(Z),F=n.apply(Y,B),U=V==null?C(F):typeof V=="function"?V.apply(Y,B):V,K=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),ne=Y.__zoom,oe=typeof Q=="function"?Q.apply(Y,B):Q,ue=c(ne.invert(U).concat(K/ne.k),oe.invert(U).concat(K/oe.k));return function(se){if(se===1)se=oe;else{var G=ue(se),ae=K/G[2];se=new il(ae,U[0]-G[0]*ae,U[1]-G[1]*ae)}L.zoom(null,se)}})}function N(H,Q,V){return!V&&H.__zooming||new T(H,Q)}function T(H,Q){this.that=H,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=n.apply(H,Q),this.taps=0}T.prototype={event:function(H){return H&&(this.sourceEvent=H),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(H,Q){return this.mouse&&H!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&H!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&H!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(H){var Q=aa(this.that).datum();u.call(H,this.that,new tqn(H,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Q)}};function j(H,...Q){if(!e.apply(this,arguments))return;var V=N(this,Q).event(H),Z=this.__zoom,Y=Math.max(i[0],Math.min(i[1],Z.k*Math.pow(2,r.apply(this,arguments)))),B=uo(H);if(V.wheel)(V.mouse[0][0]!==B[0]||V.mouse[0][1]!==B[1])&&(V.mouse[1]=Z.invert(V.mouse[0]=B)),clearTimeout(V.wheel);else{if(Z.k===Y)return;V.mouse=[B,Z.invert(B)],uv(this),V.start()}e0(H),V.wheel=setTimeout(L,w),V.zoom("mouse",t(y(x(Z,Y),V.mouse[0],V.mouse[1]),V.extent,a));function L(){V.wheel=null,V.end()}}function M(H,...Q){if(p||!e.apply(this,arguments))return;var V=H.currentTarget,Z=N(this,Q,!0).event(H),Y=aa(H.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",K,!0),B=uo(H,V),L=H.clientX,F=H.clientY;Tq(H.view),E4(H),Z.mouse=[B,this.__zoom.invert(B)],uv(this),Z.start();function U(ne){if(e0(ne),!Z.moved){var oe=ne.clientX-L,ue=ne.clientY-F;Z.moved=oe*oe+ue*ue>k}Z.event(ne).zoom("mouse",t(y(Z.that.__zoom,Z.mouse[0]=uo(ne,V),Z.mouse[1]),Z.extent,a))}function K(ne){Y.on("mousemove.zoom mouseup.zoom",null),Aq(ne.view,Z.moved),e0(ne),Z.event(ne).end()}}function D(H,...Q){if(e.apply(this,arguments)){var V=this.__zoom,Z=uo(H.changedTouches?H.changedTouches[0]:H,this),Y=V.invert(Z),B=V.k*(H.shiftKey?.5:2),L=t(y(x(V,B),Z,Y),n.apply(this,Q),a);e0(H),o>0?aa(this).transition().duration(o).call(z,L,Z,H):aa(this).call(b.transform,L,Z,H)}}function I(H,...Q){if(e.apply(this,arguments)){var V=H.touches,Z=V.length,Y=N(this,Q,H.changedTouches.length===Z).event(H),B,L,F,U;for(E4(H),L=0;L`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:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,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.`},em=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Wq=["Enter"," ","Escape"],Qq={"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:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"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 Ah;(function(e){e.Strict="strict",e.Loose="loose"})(Ah||(Ah={}));var J_;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(J_||(J_={}));var tm;(function(e){e.Partial="partial",e.Full="full"})(tm||(tm={}));const Xq={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var pu;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(pu||(pu={}));var vb;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(vb||(vb={}));var Dt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Dt||(Dt={}));const _M={[Dt.Left]:Dt.Right,[Dt.Right]:Dt.Left,[Dt.Top]:Dt.Bottom,[Dt.Bottom]:Dt.Top};function Yq(e){return e===null?null:e?"valid":"invalid"}const Zq=e=>"id"in e&&"source"in e&&"target"in e,oqn=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),CC=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Fm=(e,n=[0,0])=>{const{width:t,height:r}=yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},cqn=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):CC(s)?s:n.nodeLookup.get(s.id));const o=a?bb(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return qy(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Uy(t)},Hm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=qy(t,bb(s)),r=!0)}),r?Uy(t):{x:0,y:0,width:0,height:0}},EC=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,c=(n.y-r)/s,u=n.width/s,h=n.height/s,_=[];for(const p of e.values()){const{measured:m,selectable:w=!0,hidden:k=!1}=p;if(a&&!w||k)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x,y}=p.internals.positionAbsolute,C=nU(o,c,u,h,x,y,v,b),z=v*b,N=i&&C>0;(!p.internals.handleBounds||N||C>=z||p.dragging)&&_.push(p)}return _},lqn=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function uqn(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function _qn({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=uqn(e,a),c=Hm(o),u=zC(c,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function Jq({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:c,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},h=a.origin??r;let _=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",So.error005());else{const m=o.measured.width,w=o.measured.height;m&&w&&(_=[[c,u],[c+m,u+w]])}else o&&mf(a.extent)&&(_=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const p=mf(_)?pf(n,_,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",So.error015())),{position:{x:p.x-c+(a.measured.width??0)*h[0],y:p.y-u+(a.measured.height??0)*h[1]},positionAbsolute:p}}async function fqn({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),w=!m&&p.parentId&&a.find(k=>k.id===p.parentId);(m||w)&&a.push(p)}const o=new Set(n.map(p=>p.id)),c=r.filter(p=>p.deletable!==!1),h=lqn(a,c);for(const p of c)o.has(p.id)&&!h.find(w=>w.id===p.id)&&h.push(p);if(!s)return{edges:h,nodes:a};const _=await s({nodes:a,edges:h});return typeof _=="boolean"?_?{edges:h,nodes:a}:{edges:[],nodes:[]}:_}const Rh=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),pf=(e={x:0,y:0},n,t)=>({x:Rh(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:Rh(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function eU(e,n,t){const{width:r,height:s}=yl(t),{x:i,y:a}=t.internals.positionAbsolute;return pf(e,[[i,a],[i+r,a+s]],n)}const fM=(e,n,t)=>et?-Rh(Math.abs(e-t),1,n)/n:0,NC=(e,n,t=15,r=40)=>{const s=fM(e.x,r,n.width-r)*t,i=fM(e.y,r,n.height-r)*t;return[s,i]},qy=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),fk=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),Uy=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),nm=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=CC(e)?e.internals.positionAbsolute:Fm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},bb=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=CC(e)?e.internals.positionAbsolute:Fm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},tU=(e,n)=>Uy(qy(fk(e),fk(n))),nU=(e,n,t,r,s,i,a,o)=>{const c=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(c*u)},yb=(e,n)=>nU(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),dM=e=>vo(e.width)&&vo(e.height)&&vo(e.x)&&vo(e.y),vo=e=>!isNaN(e)&&isFinite(e),rU=(e,n)=>(t,r)=>{},qm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),Um=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?qm(o,a):o},Mh=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function bd(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.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 dqn(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=bd(e,t),s=bd(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=bd(e.top??e.y??0,t),s=bd(e.bottom??e.y??0,t),i=bd(e.left??e.x??0,n),a=bd(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function hqn(e,n,t,r,s,i){const{x:a,y:o}=Mh(e,[n,t,r]),{x:c,y:u}=Mh({x:e.x+e.width,y:e.y+e.height},[n,t,r]),h=s-c,_=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(h),bottom:Math.floor(_)}}const zC=(e,n,t,r,s,i)=>{const a=dqn(i,n,t),o=(n-a.x)/e.width,c=(t-a.y)/e.height,u=Math.min(o,c),h=Rh(u,r,s),_=e.x+e.width/2,p=e.y+e.height/2,m=n/2-_*h,w=t/2-p*h,k=hqn(e,m,w,h,n,t),v={left:Math.min(k.left-a.left,0),top:Math.min(k.top-a.top,0),right:Math.min(k.right-a.right,0),bottom:Math.min(k.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:w-v.top+v.bottom,zoom:h}},rm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function mf(e){return e!=null&&e!=="parent"}function yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function sU(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function iU(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function hM(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function pqn(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function mqn(e){return{...Qq,...e||{}}}function k0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=bo(e),o=Um({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=t?qm(o,n):o;return{xSnapped:c,ySnapped:u,...o}}const jC=e=>({width:e.offsetWidth,height:e.offsetHeight}),aU=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},gqn=["INPUT","SELECT","TEXTAREA"];function oU(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:gqn.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const cU=e=>"clientX"in e,bo=(e,n)=>{var i,a;const t=cU(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},pM=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...jC(a)}})};function lU({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const c=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,h=Math.abs(c-e),_=Math.abs(u-n);return[c,u,h,_]}function D1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function mM({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Dt.Left:return[n-D1(n-r,i),t];case Dt.Right:return[n+D1(r-n,i),t];case Dt.Top:return[n,t-D1(t-s,i)];case Dt.Bottom:return[n,t+D1(s-t,i)]}}function uU({sourceX:e,sourceY:n,sourcePosition:t=Dt.Bottom,targetX:r,targetY:s,targetPosition:i=Dt.Top,curvature:a=.25}){const[o,c]=mM({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,h]=mM({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[_,p,m,w]=lU({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:h});return[`M${e},${n} C${o},${c} ${u},${h} ${r},${s}`,_,p,m,w]}function _U({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const yqn=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,xqn=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),wqn=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",So.error006()),n;const r=t.getEdgeId||yqn;let s;return Zq(e)?s={...e}:s={...e,id:r(e)},xqn(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function fU({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=_U({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const gM={[Dt.Left]:{x:-1,y:0},[Dt.Right]:{x:1,y:0},[Dt.Top]:{x:0,y:-1},[Dt.Bottom]:{x:0,y:1}},kqn=({source:e,sourcePosition:n=Dt.Bottom,target:t})=>n===Dt.Left||n===Dt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function Sqn({source:e,sourcePosition:n=Dt.Bottom,target:t,targetPosition:r=Dt.Top,center:s,offset:i,stepPosition:a}){const o=gM[n],c=gM[r],u={x:e.x+o.x*i,y:e.y+o.y*i},h={x:t.x+c.x*i,y:t.y+c.y*i},_=kqn({source:u,sourcePosition:n,target:h}),p=_.x!==0?"x":"y",m=_[p];let w=[],k,v;const b={x:0,y:0},x={x:0,y:0},[,,y,C]=_U({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*c[p]===-1){p==="x"?(k=s.x??u.x+(h.x-u.x)*a,v=s.y??(u.y+h.y)/2):(k=s.x??(u.x+h.x)/2,v=s.y??u.y+(h.y-u.y)*a);const j=[{x:k,y:u.y},{x:k,y:h.y}],M=[{x:u.x,y:v},{x:h.x,y:v}];o[p]===m?w=p==="x"?j:M:w=p==="x"?M:j}else{const j=[{x:u.x,y:h.y}],M=[{x:h.x,y:u.y}];if(p==="x"?w=o.x===m?M:j:w=o.y===m?j:M,n===r){const H=Math.abs(e[p]-t[p]);if(H<=i){const Q=Math.min(i-1,i-H);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Q:x[p]=(h[p]>t[p]?-1:1)*Q}}if(n!==r){const H=p==="x"?"y":"x",Q=o[p]===c[H],V=u[H]>h[H],Z=u[H]=q?(k=(D.x+I.x)/2,v=w[0].y):(k=w[0].x,v=(D.y+I.y)/2)}const z={x:u.x+b.x,y:u.y+b.y},N={x:h.x+x.x,y:h.y+x.y};return[[e,...z.x!==w[0].x||z.y!==w[0].y?[z]:[],...w,...N.x!==w[w.length-1].x||N.y!==w[w.length-1].y?[N]:[],t],k,v,y,C]}function Cqn(e,n,t,r){const s=Math.min(vM(e,n)/2,vM(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function hk(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Nqn(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=hk(c,n);i.has(u)||(a.push({id:u,color:c.color||t,...c}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const dU=1e3,zqn=10,TC={nodeOrigin:[0,0],nodeExtent:em,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},jqn={...TC,checkEquality:!0};function AC(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function Tqn(e,n,t){const r=AC(TC,t);for(const s of e.values())if(s.parentId)MC(s,e,n,r);else{const i=Fm(s,r.nodeOrigin),a=mf(s.extent)?s.extent:r.nodeExtent,o=pf(i,a,yl(s));s.internals.positionAbsolute=o}}function Aqn(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function RC(e){return e==="manual"}function pk(e,n,t,r={}){var h,_;const s=AC(jqn,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!RC(s.zIndexMode)?dU:0;let c=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const w=Fm(p,s.nodeOrigin),k=mf(p.extent)?p.extent:s.nodeExtent,v=pf(w,k,yl(p));m={...s.defaults,...p,measured:{width:(h=p.measured)==null?void 0:h.width,height:(_=p.measured)==null?void 0:_.height},internals:{positionAbsolute:v,handleBounds:Aqn(p,m),z:hU(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),p.parentId&&MC(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function Rqn(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function MC(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:c}=AC(TC,r),u=e.parentId,h=n.get(u);if(!h){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Rqn(e,t),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&c==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*zqn),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const _=i&&!RC(c)?dU:0,{x:p,y:m,z:w}=Mqn(e,h,a,o,_,c),{positionAbsolute:k}=e.internals,v=p!==k.x||m!==k.y;(v||w!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:k,z:w}})}function hU(e,n,t){const r=vo(e.zIndex)?e.zIndex:0;return RC(t)?r:r+(e.selected?n:0)}function Mqn(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,c=yl(e),u=Fm(e,t),h=mf(e.extent)?pf(u,e.extent,c):u;let _=pf({x:a+h.x,y:o+h.y},r,c);e.extent==="parent"&&(_=eU(_,c,n));const p=hU(e,s,i),m=n.internals.z??0;return{x:_.x,y:_.y,z:m>=p?m+1:p}}function OC(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const c=n.get(o.parentId);if(!c)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??nm(c),h=tU(u,o.rect);i.set(o.parentId,{expandedRect:h,parent:c})}return i.size>0&&i.forEach(({expandedRect:o,parent:c},u)=>{var y;const h=c.internals.positionAbsolute,_=yl(c),p=c.origin??r,m=o.x0||w>0||b||x)&&(s.push({id:u,type:"position",position:{x:c.position.x-m+b,y:c.position.y-w+x}}),(y=t.get(u))==null||y.forEach(C=>{e.some(z=>z.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+w}})})),(_.width0){const m=OC(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:c}}async function Dqn({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function wM(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const c=r.get(a)||new Map;if(r.set(a,c.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function pU(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,h=`${i}-${o}--${s}-${a}`;wM("source",c,h,e,s,a),wM("target",c,u,e,i,o),n.set(r.id,r)}}function mU(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:mU(t,n):!1}function kM(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Lqn(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!mU(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function N4({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,c;const s=[];for(const[u,h]of n){const _=(a=t.get(u))==null?void 0:a.internals.userNode;_&&s.push({..._,position:h.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((c=n.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function Iqn({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=qm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function $qn({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,c=!1,u={x:0,y:0},h=null,_=!1,p=null,m=!1,w=!1,k=null;function v({noDragClassName:x,handleSelector:y,domNode:C,isSelectable:z,nodeId:N,nodeClickDistance:T=0}){p=aa(C);function j({x:$,y:q}){const{nodeLookup:H,nodeExtent:Q,snapGrid:V,snapToGrid:Z,nodeOrigin:Y,onNodeDrag:B,onSelectionDrag:L,onError:F,updateNodePositions:U}=n();i={x:$,y:q};let K=!1;const ne=o.size>1,oe=ne&&Q?fk(Hm(o)):null,ue=ne&&Z?Iqn({dragItems:o,snapGrid:V,x:$,y:q}):null;for(const[se,G]of o){if(!H.has(se))continue;let ae={x:$-G.distance.x,y:q-G.distance.y};Z&&(ae=ue?{x:Math.round(ae.x+ue.x),y:Math.round(ae.y+ue.y)}:qm(ae,V));let ce=null;if(ne&&Q&&!G.extent&&oe){const{positionAbsolute:Ae}=G.internals,De=Ae.x-oe.x+Q[0][0],We=Ae.x+G.measured.width-oe.x2+Q[1][0],Ne=Ae.y-oe.y+Q[0][1],xe=Ae.y+G.measured.height-oe.y2+Q[1][1];ce=[[De,Ne],[We,xe]]}const{position:pe,positionAbsolute:be}=Jq({nodeId:se,nextPosition:ae,nodeLookup:H,nodeExtent:ce||Q,nodeOrigin:Y,onError:F});K=K||G.position.x!==pe.x||G.position.y!==pe.y,G.position=pe,G.internals.positionAbsolute=be}if(w=w||K,!!K&&(U(o,!0),k&&(r||B||!N&&L))){const[se,G]=N4({nodeId:N,dragItems:o,nodeLookup:H});r==null||r(k,o,se,G),B==null||B(k,se,G),N||L==null||L(k,G)}}async function M(){if(!h)return;const{transform:$,panBy:q,autoPanSpeed:H,autoPanOnNodeDrag:Q}=n();if(!Q){c=!1,cancelAnimationFrame(a);return}const[V,Z]=NC(u,h,H);(V!==0||Z!==0)&&(i.x=(i.x??0)-V/$[2],i.y=(i.y??0)-Z/$[2],await q({x:V,y:Z})&&j(i)),a=requestAnimationFrame(M)}function D($){var ne;const{nodeLookup:q,multiSelectionActive:H,nodesDraggable:Q,transform:V,snapGrid:Z,snapToGrid:Y,selectNodesOnDrag:B,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:U}=n();_=!0,(!B||!z)&&!H&&N&&((ne=q.get(N))!=null&&ne.selected||U()),z&&B&&N&&(e==null||e(N));const K=k0($.sourceEvent,{transform:V,snapGrid:Z,snapToGrid:Y,containerBounds:h});if(i=K,o=Lqn(q,Q,K,N),o.size>0&&(t||L||!N&&F)){const[oe,ue]=N4({nodeId:N,dragItems:o,nodeLookup:q});t==null||t($.sourceEvent,o,oe,ue),L==null||L($.sourceEvent,oe,ue),N||F==null||F($.sourceEvent,ue)}}const I=Rq().clickDistance(T).on("start",$=>{const{domNode:q,nodeDragThreshold:H,transform:Q,snapGrid:V,snapToGrid:Z}=n();h=(q==null?void 0:q.getBoundingClientRect())||null,m=!1,w=!1,k=$.sourceEvent,H===0&&D($),i=k0($.sourceEvent,{transform:Q,snapGrid:V,snapToGrid:Z,containerBounds:h}),u=bo($.sourceEvent,h)}).on("drag",$=>{const{autoPanOnNodeDrag:q,transform:H,snapGrid:Q,snapToGrid:V,nodeDragThreshold:Z,nodeLookup:Y}=n(),B=k0($.sourceEvent,{transform:H,snapGrid:Q,snapToGrid:V,containerBounds:h});if(k=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||N&&!Y.has(N))&&(m=!0),!m){if(!c&&q&&_&&(c=!0,M()),!_){const L=bo($.sourceEvent,h),F=L.x-u.x,U=L.y-u.y;Math.sqrt(F*F+U*U)>Z&&D($)}(i.x!==B.xSnapped||i.y!==B.ySnapped)&&o&&_&&(u=bo($.sourceEvent,h),j(B))}}).on("end",$=>{if(!_||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(c=!1,_=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:q,updateNodePositions:H,onNodeDragStop:Q,onSelectionDragStop:V}=n();if(w&&(H(o,!1),w=!1),s||Q||!N&&V){const[Z,Y]=N4({nodeId:N,dragItems:o,nodeLookup:q,dragging:!1});s==null||s($.sourceEvent,o,Z,Y),Q==null||Q($.sourceEvent,Z,Y),N||V==null||V($.sourceEvent,Y)}}}).filter($=>{const q=$.target;return!$.button&&(!x||!kM(q,`.${x}`,C))&&(!y||kM(q,y,C))});p.call(I)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function Bqn(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())yb(s,nm(i))>0&&r.push(i);return r}const Pqn=250;function Fqn(e,n,t,r){var o,c;let s=[],i=1/0;const a=Bqn(e,t,n+Pqn);for(const u of a){const h=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const _ of h){if(r.nodeId===_.nodeId&&r.type===_.type&&r.id===_.id)continue;const{x:p,y:m}=gf(u,_,_.position,!0),w=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));w>n||(w1){const u=r.type==="source"?"target":"source";return s.find(h=>h.type===u)??s[0]}return s[0]}function gU(e,n,t,r,s,i=!1){var u,h,_;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((h=a.internals.handleBounds)==null?void 0:h.source)??[],...((_=a.internals.handleBounds)==null?void 0:_.target)??[]],c=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return c&&i?{...c,...gf(a,c,c.position,!0)}:c}function vU(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function Hqn(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const bU=()=>!0;function qqn(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:c,lib:u,autoPanOnConnect:h,flowId:_,panBy:p,cancelConnection:m,onConnectStart:w,onConnect:k,onConnectEnd:v,isValidConnection:b=bU,onReconnectEnd:x,updateConnection:y,getTransform:C,getFromHandle:z,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:j}){const M=aU(e.target);let D=0,I;const{x:$,y:q}=bo(e),H=vU(i,j),Q=o==null?void 0:o.getBoundingClientRect();let V=!1;if(!Q||!H)return;const Z=gU(s,H,r,c,n);if(!Z)return;let Y=bo(e,Q),B=!1,L=null,F=!1,U=null;function K(){if(!h||!Q)return;const[pe,be]=NC(Y,Q,N);p({x:pe,y:be}),D=requestAnimationFrame(K)}const ne={...Z,nodeId:s,type:H,position:Z.position},oe=c.get(s);let se={inProgress:!0,isValid:null,from:gf(oe,ne,Dt.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:oe,to:Y,toHandle:null,toPosition:_M[ne.position],toNode:null,pointer:Y};function G(){V=!0,y(se),w==null||w(e,{nodeId:s,handleId:r,handleType:H})}T===0&&G();function ae(pe){if(!V){const{x:xe,y:rt}=bo(pe),Ze=xe-$,ct=rt-q;if(!(Ze*Ze+ct*ct>T*T))return;G()}if(!z()||!ne){ce(pe);return}const be=C();Y=bo(pe,Q),I=Fqn(Um(Y,be,!1,[1,1]),t,c,ne),B||(K(),B=!0);const Ae=yU(pe,{handle:I,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:_,nodeLookup:c});U=Ae.handleDomNode,L=Ae.connection,F=Hqn(!!I,Ae.isValid);const De=c.get(s),We=De?gf(De,ne,Dt.Left,!0):se.from,Ne={...se,from:We,isValid:F,to:Ae.toHandle&&F?Mh({x:Ae.toHandle.x,y:Ae.toHandle.y},be):Y,toHandle:Ae.toHandle,toPosition:F&&Ae.toHandle?Ae.toHandle.position:_M[ne.position],toNode:Ae.toHandle?c.get(Ae.toHandle.nodeId):null,pointer:Y};y(Ne),se=Ne}function ce(pe){if(!("touches"in pe&&pe.touches.length>0)){if(V){(I||U)&&L&&F&&(k==null||k(L));const{inProgress:be,...Ae}=se,De={...Ae,toPosition:se.toHandle?se.toPosition:null};v==null||v(pe,De),i&&(x==null||x(pe,De))}m(),cancelAnimationFrame(D),B=!1,F=!1,L=null,U=null,M.removeEventListener("mousemove",ae),M.removeEventListener("mouseup",ce),M.removeEventListener("touchmove",ae),M.removeEventListener("touchend",ce)}}M.addEventListener("mousemove",ae),M.addEventListener("mouseup",ce),M.addEventListener("touchmove",ae),M.addEventListener("touchend",ce)}function yU(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:c,isValidConnection:u=bU,nodeLookup:h}){const _=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${c}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:w}=bo(e),k=a.elementFromPoint(m,w),v=k!=null&&k.classList.contains(`${o}-flow__handle`)?k:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const x=vU(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),z=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!y||!x)return b;const T={source:_?y:r,sourceHandle:_?C:s,target:_?r:y,targetHandle:_?s:C};b.connection=T;const M=z&&N&&(t===Ah.Strict?_&&x==="source"||!_&&x==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=gU(y,x,C,h,t,!0)}return b}const mk={onPointerDown:qqn,isValid:yU};function Uqn({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=aa(e);function i({translateExtent:o,width:c,height:u,zoomStep:h=1,pannable:_=!0,zoomable:p=!0,inversePan:m=!1}){const w=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),z=y.sourceEvent.ctrlKey&&rm()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*h,T=C[2]*Math.pow(2,N*z);n.scaleTo(T)};let k=[0,0];const v=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])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const z=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[z[0]-k[0],z[1]-k[1]];k=z;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-N[0]*T,y:C[1]-N[1]*T},M=[[0,0],[c,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},x=Kq().on("start",v).on("zoom",_?b:null).on("zoom.wheel",p?w:null);s.call(x,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:uo}}const Gy=e=>({x:e.x,y:e.y,zoom:e.k}),z4=({x:e,y:n,zoom:t})=>Hy.translate(e,n).scale(t),Ad=(e,n)=>e.target.closest(`.${n}`),xU=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),Gqn=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,j4=(e,n=0,t=Gqn,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},wU=e=>{const n=e.ctrlKey&&rm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function Vqn({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:u}){return h=>{if(Ad(h,n))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const _=t.property("__zoom").k||1;if(h.ctrlKey&&a){const v=uo(h),b=wU(h),x=_*Math.pow(2,b);r.scaleTo(t,x,v,h);return}const p=h.deltaMode===1?20:1;let m=s===J_.Vertical?0:h.deltaX*p,w=s===J_.Horizontal?0:h.deltaY*p;!rm()&&h.shiftKey&&s!==J_.Vertical&&(m=h.deltaY*p,w=0),r.translateBy(t,-(m/_)*i,-(w/_)*i,{internal:!0});const k=Gy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(h,k),e.panScrollTimeout=setTimeout(()=>{u==null||u(h,k),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(h,k))}}function Kqn({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=Ad(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function Wqn({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=Gy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function Qqn({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&xU(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,Gy(i.transform)))}}function Xqn({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&xU(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=Gy(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},t?150:0)}}}function Yqn({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:c,lib:u,connectionInProgress:h}){return _=>{var v;const p=e||n,m=t&&_.ctrlKey,w=_.type==="wheel";if(_.button===1&&_.type==="mousedown"&&(Ad(_,`${u}-flow__node`)||Ad(_,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||h&&!w||Ad(_,o)&&w||Ad(_,c)&&(!w||s&&w&&!e)||!t&&_.ctrlKey&&w)return!1;if(!t&&_.type==="touchstart"&&((v=_.touches)==null?void 0:v.length)>1)return _.preventDefault(),!1;if(!p&&!s&&!m&&w||!r&&(_.type==="mousedown"||_.type==="touchstart")||Array.isArray(r)&&!r.includes(_.button)&&_.type==="mousedown")return!1;const k=Array.isArray(r)&&r.includes(_.button)||!_.button||_.button<=1;return(!_.ctrlKey||w)&&k}}function Zqn({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),_=Kq().scaleExtent([n,t]).translateExtent(r),p=aa(e).call(_);x({x:s.x,y:s.y,zoom:Rh(s.zoom,n,t)},[[0,0],[h.width,h.height]],r);const m=p.on("wheel.zoom"),w=p.on("dblclick.zoom");_.wheelDelta(wU);async function k(I,$){return p?new Promise(q=>{_==null||_.interpolate(($==null?void 0:$.interpolate)==="linear"?w0:ov).transform(j4(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),I)}):!1}function v({noWheelClassName:I,noPanClassName:$,onPaneContextMenu:q,userSelectionActive:H,panOnScroll:Q,panOnDrag:V,panOnScrollMode:Z,panOnScrollSpeed:Y,preventScrolling:B,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:U,zoomActivationKeyPressed:K,lib:ne,onTransformChange:oe,connectionInProgress:ue,paneClickDistance:se,selectionOnDrag:G}){H&&!u.isZoomingOrPanning&&b();const ae=Q&&!K&&!H;_.clickDistance(G?1/0:!vo(se)||se<0?0:se);const ce=ae?Vqn({zoomPanValues:u,noWheelClassName:I,d3Selection:p,d3Zoom:_,panOnScrollMode:Z,panOnScrollSpeed:Y,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):Kqn({noWheelClassName:I,preventScrolling:B,d3ZoomHandler:m});p.on("wheel.zoom",ce,{passive:!1});const pe=Wqn({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});_.on("start",pe);const be=Qqn({zoomPanValues:u,panOnDrag:V,onPaneContextMenu:!!q,onPanZoom:i,onTransformChange:oe});_.on("zoom",be);const Ae=Xqn({zoomPanValues:u,panOnDrag:V,panOnScroll:Q,onPaneContextMenu:q,onPanZoomEnd:o,onDraggingChange:c});_.on("end",Ae);const De=Yqn({zoomActivationKeyPressed:K,panOnDrag:V,zoomOnScroll:F,panOnScroll:Q,zoomOnDoubleClick:U,zoomOnPinch:L,userSelectionActive:H,noPanClassName:$,noWheelClassName:I,lib:ne,connectionInProgress:ue});_.filter(De),U?p.on("dblclick.zoom",w):p.on("dblclick.zoom",null)}function b(){_.on("zoom",null)}async function x(I,$,q){const H=z4(I),Q=_==null?void 0:_.constrain()(H,$,q);return Q&&await k(Q),Q}async function y(I,$){const q=z4(I);return await k(q,$),q}function C(I){if(p){const $=z4(I),q=p.property("__zoom");(q.k!==I.zoom||q.x!==I.x||q.y!==I.y)&&(_==null||_.transform(p,$,null,{sync:!0}))}}function z(){const I=p?Vq(p.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}async function N(I,$){return p?new Promise(q=>{_==null||_.interpolate(($==null?void 0:$.interpolate)==="linear"?w0:ov).scaleTo(j4(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),I)}):!1}async function T(I,$){return p?new Promise(q=>{_==null||_.interpolate(($==null?void 0:$.interpolate)==="linear"?w0:ov).scaleBy(j4(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),I)}):!1}function j(I){_==null||_.scaleExtent(I)}function M(I){_==null||_.translateExtent(I)}function D(I){const $=!vo(I)||I<0?0:I;_==null||_.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:x,getViewport:z,scaleTo:N,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:D}}var Oh;(function(e){e.Line="line",e.Handle="handle"})(Oh||(Oh={}));function Jqn({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,c=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(c[0]=c[0]*-1),o&&i&&(c[1]=c[1]*-1),c}function SM(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function lu(e,n){return Math.max(0,n-e)}function uu(e,n){return Math.max(0,e-n)}function L1(e,n,t){return Math.max(0,n-e,e-t)}function CM(e,n){return e?!n:n}function eUn(e,n,t,r,s,i,a,o){let{affectsX:c,affectsY:u}=n;const{isHorizontal:h,isVertical:_}=n,p=h&&_,{xSnapped:m,ySnapped:w}=t,{minWidth:k,maxWidth:v,minHeight:b,maxHeight:x}=r,{x:y,y:C,width:z,height:N,aspectRatio:T}=e;let j=Math.floor(h?m-e.pointerX:0),M=Math.floor(_?w-e.pointerY:0);const D=z+(c?-j:j),I=N+(u?-M:M),$=-i[0]*z,q=-i[1]*N;let H=L1(D,k,v),Q=L1(I,b,x);if(a){let Y=0,B=0;c&&j<0?Y=lu(y+j+$,a[0][0]):!c&&j>0&&(Y=uu(y+D+$,a[1][0])),u&&M<0?B=lu(C+M+q,a[0][1]):!u&&M>0&&(B=uu(C+I+q,a[1][1])),H=Math.max(H,Y),Q=Math.max(Q,B)}if(o){let Y=0,B=0;c&&j>0?Y=uu(y+j,o[0][0]):!c&&j<0&&(Y=lu(y+D,o[1][0])),u&&M>0?B=uu(C+M,o[0][1]):!u&&M<0&&(B=lu(C+I,o[1][1])),H=Math.max(H,Y),Q=Math.max(Q,B)}if(s){if(h){const Y=L1(D/T,b,x)*T;if(H=Math.max(H,Y),a){let B=0;!c&&!u||c&&!u&&p?B=uu(C+q+D/T,a[1][1])*T:B=lu(C+q+(c?j:-j)/T,a[0][1])*T,H=Math.max(H,B)}if(o){let B=0;!c&&!u||c&&!u&&p?B=lu(C+D/T,o[1][1])*T:B=uu(C+(c?j:-j)/T,o[0][1])*T,H=Math.max(H,B)}}if(_){const Y=L1(I*T,k,v)/T;if(Q=Math.max(Q,Y),a){let B=0;!c&&!u||u&&!c&&p?B=uu(y+I*T+$,a[1][0])/T:B=lu(y+(u?M:-M)*T+$,a[0][0])/T,Q=Math.max(Q,B)}if(o){let B=0;!c&&!u||u&&!c&&p?B=lu(y+I*T,o[1][0])/T:B=uu(y+(u?M:-M)*T,o[0][0])/T,Q=Math.max(Q,B)}}}M=M+(M<0?Q:-Q),j=j+(j<0?H:-H),s&&(p?D>I*T?M=(CM(c,u)?-j:j)/T:j=(CM(c,u)?-M:M)*T:h?(M=j/T,u=c):(j=M*T,c=u));const V=c?y+j:y,Z=u?C+M:C;return{width:z+(c?-j:j),height:N+(u?-M:M),x:i[0]*j*(c?-1:1)+V,y:i[1]*M*(u?-1:1)+Z}}const kU={width:0,height:0,x:0,y:0},tUn={...kU,pointerX:0,pointerY:0,aspectRatio:1};function nUn(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,c=t[1]*a;return[[r-o,s-c],[r+i-o,s+a-c]]}function rUn({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=aa(e);let a={controlDirection:SM("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:h,keepAspectRatio:_,resizeDirection:p,onResizeStart:m,onResize:w,onResizeEnd:k,shouldResize:v}){let b={...kU},x={...tUn};a={boundaries:h,resizeDirection:p,keepAspectRatio:_,controlDirection:SM(u)};let y,C=null,z=[],N,T,j,M=!1;const D=Rq().on("start",I=>{const{nodeLookup:$,transform:q,snapGrid:H,snapToGrid:Q,nodeOrigin:V,paneDomNode:Z}=t();if(y=$.get(n),!y)return;C=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:Y,ySnapped:B}=k0(I.sourceEvent,{transform:q,snapGrid:H,snapToGrid:Q,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},x={...b,pointerX:Y,pointerY:B,aspectRatio:b.width/b.height},N=void 0,T=mf(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=$.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),z=[],j=void 0;for(const[L,F]of $)if(F.parentId===n&&(z.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const U=nUn(F,y,F.origin??V);j?j=[[Math.min(U[0][0],j[0][0]),Math.min(U[0][1],j[0][1])],[Math.max(U[1][0],j[1][0]),Math.max(U[1][1],j[1][1])]]:j=U}m==null||m(I,{...b})}).on("drag",I=>{const{transform:$,snapGrid:q,snapToGrid:H,nodeOrigin:Q}=t(),V=k0(I.sourceEvent,{transform:$,snapGrid:q,snapToGrid:H,containerBounds:C}),Z=[];if(!y)return;const{x:Y,y:B,width:L,height:F}=b,U={},K=y.origin??Q,{width:ne,height:oe,x:ue,y:se}=eUn(x,a.controlDirection,V,a.boundaries,a.keepAspectRatio,K,T,j),G=ne!==L,ae=oe!==F,ce=ue!==Y&&G,pe=se!==B&&ae;if(!ce&&!pe&&!G&&!ae)return;if((ce||pe||K[0]===1||K[1]===1)&&(U.x=ce?ue:b.x,U.y=pe?se:b.y,b.x=U.x,b.y=U.y,z.length>0)){const We=ue-Y,Ne=se-B;for(const xe of z)xe.position={x:xe.position.x-We+K[0]*(ne-L),y:xe.position.y-Ne+K[1]*(oe-F)},Z.push(xe)}if((G||ae)&&(U.width=G&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ne:b.width,U.height=ae&&(!a.resizeDirection||a.resizeDirection==="vertical")?oe:b.height,b.width=U.width,b.height=U.height),N&&y.expandParent){const We=K[0]*(U.width??0);U.x&&U.x{M&&(k==null||k(I,{...b}),s==null||s({...b}),M=!1)});i.call(D)}function c(){i.on(".drag",null)}return{update:o,destroy:c}}const sUn={},EM=e=>{let n;const t=new Set,r=(h,_)=>{const p=typeof h=="function"?h(n):h;if(!Object.is(p,n)){const m=n;n=_??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(w=>w(n,m))}},s=()=>n,c={setState:r,getState:s,getInitialState:()=>u,subscribe:h=>(t.add(h),()=>t.delete(h)),destroy:()=>{(sUn?"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."),t.clear()}},u=n=e(r,s,c);return c},iUn=e=>e?EM(e):EM,{useDebugValue:aUn}=et,{useSyncExternalStoreWithSelector:oUn}=IW,cUn=e=>e;function SU(e,n=cUn,t){const r=oUn(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return aUn(r),r}const NM=(e,n)=>{const t=iUn(e),r=(s,i=n)=>SU(t,s,i);return Object.assign(r,t),r},lUn=(e,n)=>e?NM(e,n):NM;function Cr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const Vy=A.createContext(null),uUn=Vy.Provider,CU=So.error001("react");function Rn(e,n){const t=A.useContext(Vy);if(t===null)throw new Error(CU);return SU(t,e,n)}function Nr(){const e=A.useContext(Vy);if(e===null)throw new Error(CU);return A.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const zM={display:"none"},_Un={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},EU="react-flow__node-desc",NU="react-flow__edge-desc",fUn="react-flow__aria-live",dUn=e=>e.ariaLiveMessage,hUn=e=>e.ariaLabelConfig;function pUn({rfId:e}){const n=Rn(dUn);return f.jsx("div",{id:`${fUn}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:_Un,children:n})}function mUn({rfId:e,disableKeyboardA11y:n}){const t=Rn(hUn);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${EU}-${e}`,style:zM,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${NU}-${e}`,style:zM,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(pUn,{rfId:e})]})}const Ky=A.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:ls(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});Ky.displayName="Panel";const jM="https://reactflow.dev?utm_source=attribution";function gUn({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(Ky,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${jM}`,children:f.jsx("a",{href:jM,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const vUn=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},I1=e=>e.id;function bUn(e,n){return Cr(e.selectedNodes.map(I1),n.selectedNodes.map(I1))&&Cr(e.selectedEdges.map(I1),n.selectedEdges.map(I1))}function yUn({onSelectionChange:e}){const n=Nr(),{selectedNodes:t,selectedEdges:r}=Rn(vUn,bUn);return A.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const xUn=e=>!!e.onSelectionChangeHandlers;function wUn({onSelectionChange:e}){const n=Rn(xUn);return e||n?f.jsx(yUn,{onSelectionChange:e}):null}const zU=[0,0],kUn={x:0,y:0,zoom:1},SUn=["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"],TM=[...SUn,"rfId"],CUn=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}),AM={translateExtent:em,nodeOrigin:zU,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function EUn(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:c}=Rn(CUn,Cr),u=Nr();A.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=AM,o()}),[]);const h=A.useRef(AM);return A.useEffect(()=>{for(const _ of TM){const p=e[_],m=h.current[_];p!==m&&(typeof e[_]>"u"||(_==="nodes"?n(p):_==="edges"?t(p):_==="minZoom"?r(p):_==="maxZoom"?s(p):_==="translateExtent"?i(p):_==="nodeExtent"?a(p):_==="ariaLabelConfig"?u.setState({ariaLabelConfig:mqn(p)}):_==="fitView"?u.setState({fitViewQueued:p}):_==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[_]:p})))}h.current=e},TM.map(_=>e[_])),null}function RM(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function NUn(e){var r;const[n,t]=A.useState(e==="system"?null:e);return A.useEffect(()=>{if(e!=="system"){t(e);return}const s=RM(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=RM())!=null&&r.matches?"dark":"light"}const MM=typeof document<"u"?document:null;function sm(e=null,n={target:MM,actInsideInputWithModifier:!0}){const[t,r]=A.useState(!1),s=A.useRef(!1),i=A.useRef(new Set([])),[a,o]=A.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(_=>typeof _=="string").map(_=>_.replace("+",` `).replace(` `,` +`).split(` -`)),h=u.reduce((_,p)=>_.concat(...p),[]);return[u,h]}return[[],[]]},[e]);return A.useEffect(()=>{const c=(n==null?void 0:n.target)??MM,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const h=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&oU(m))return!1;const k=DM(m.code,o);if(i.current.add(m[k]),OM(a,i.current,!1)){const x=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},_=m=>{const w=DM(m.code,o);OM(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[w]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",_),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",_),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function OM(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function DM(e,n){return n.includes(e)?"code":"key"}const zUn=()=>{const e=Nr();return A.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),c=zC(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(c,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:c}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-c},h=t.snapGrid??s,_=t.snapToGrid??i;return Um(u,r,_,h)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=Mh(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function jU(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const c of a)jUn(c,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function jUn(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function TUn(e,n){return jU(e,n)}function AUn(e,n){return jU(e,n)}function N_(e,n){return{id:e,type:"select",selected:n}}function Rd(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(N_(i.id,a)))}return r}function LM({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),c=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;c!==void 0&&c!==a&&t.push({id:a.id,item:a,type:"replace"}),c===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function IM(e){return{id:e.id,type:"remove"}}const RUn=rU();function MUn(e,n,t={}){return wqn(e,n,{...t,onError:t.onError??RUn})}const $M=e=>oqn(e),OUn=e=>Zq(e);function TU(e){return A.forwardRef(e)}const DUn=typeof window<"u"?A.useLayoutEffect:A.useEffect;function BM(e){const[n,t]=A.useState(BigInt(0)),[r]=A.useState(()=>LUn(()=>t(s=>s+BigInt(1))));return DUn(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function LUn(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const AU=A.createContext(null);function IUn({children:e}){const n=Nr(),t=A.useCallback(o=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:h,onNodesChange:_,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:w}=n.getState();let k=c;for(const b of o)k=typeof b=="function"?b(k):b;let v=LM({items:k,lookup:p});for(const b of w.values())v=b(v);h&&u(k),v.length>0?_==null||_(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:x,setNodes:y}=n.getState();b&&y(x)})},[]),r=BM(t),s=A.useCallback(o=>{const{edges:c=[],setEdges:u,hasDefaultEdges:h,onEdgesChange:_,edgeLookup:p}=n.getState();let m=c;for(const w of o)m=typeof w=="function"?w(m):w;h?u(m):_&&_(LM({items:m,lookup:p}))},[]),i=BM(s),a=A.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(AU.Provider,{value:a,children:e})}function $Un(){const e=A.useContext(AU);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const BUn=e=>!!e.panZoom;function DC(){const e=zUn(),n=Nr(),t=$Un(),r=Rn(BUn),s=A.useMemo(()=>{const i=_=>n.getState().nodeLookup.get(_),a=_=>{t.nodeQueue.push(_)},o=_=>{t.edgeQueue.push(_)},c=_=>{var b,x;const{nodeLookup:p,nodeOrigin:m}=n.getState(),w=$M(_)?_:p.get(_.id),k=w.parentId?iU(w.position,w.measured,w.parentId,p,m):w.position,v={...w,position:k,width:((b=w.measured)==null?void 0:b.width)??w.width,height:((x=w.measured)==null?void 0:x.height)??w.height};return nm(v)},u=(_,p,m={replace:!1})=>{a(w=>w.map(k=>{if(k.id===_){const v=typeof p=="function"?p(k):p;return m.replace&&$M(v)?v:{...k,...v}}return k}))},h=(_,p,m={replace:!1})=>{o(w=>w.map(k=>{if(k.id===_){const v=typeof p=="function"?p(k):p;return m.replace&&OUn(v)?v:{...k,...v}}return k}))};return{getNodes:()=>n.getState().nodes.map(_=>({..._})),getNode:_=>{var p;return(p=i(_))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:_=[]}=n.getState();return _.map(p=>({...p}))},getEdge:_=>n.getState().edgeLookup.get(_),setNodes:a,setEdges:o,addNodes:_=>{const p=Array.isArray(_)?_:[_];t.nodeQueue.push(m=>[...m,...p])},addEdges:_=>{const p=Array.isArray(_)?_:[_];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:_=[],edges:p=[],transform:m}=n.getState(),[w,k,v]=m;return{nodes:_.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x:w,y:k,zoom:v}}},deleteElements:async({nodes:_=[],edges:p=[]})=>{const{nodes:m,edges:w,onNodesDelete:k,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:x,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:z,edges:E}=await fqn({nodesToRemove:_,edgesToRemove:p,nodes:m,edges:w,onBeforeDelete:C}),T=E.length>0,j=z.length>0;if(T){const M=E.map(IM);v==null||v(E),x(M)}if(j){const M=z.map(IM);k==null||k(z),b(M)}return(j||T)&&(y==null||y({nodes:z,edges:E})),{deletedNodes:z,deletedEdges:E}},getIntersectingNodes:(_,p=!0,m)=>{const w=dM(_),k=w?_:c(_),v=m!==void 0;return k?(m||n.getState().nodes).filter(b=>{const x=n.getState().nodeLookup.get(b.id);if(x&&!w&&(b.id===_.id||!x.internals.positionAbsolute))return!1;const y=nm(v?b:x),C=yb(y,k);return p&&C>0||C>=y.width*y.height||C>=k.width*k.height}):[]},isNodeIntersecting:(_,p,m=!0)=>{const k=dM(_)?_:c(_);if(!k)return!1;const v=yb(k,p);return m&&v>0||v>=p.width*p.height||v>=k.width*k.height},updateNode:u,updateNodeData:(_,p,m={replace:!1})=>{u(_,w=>{const k=typeof p=="function"?p(w):p;return m.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},m)},updateEdge:h,updateEdgeData:(_,p,m={replace:!1})=>{h(_,w=>{const k=typeof p=="function"?p(w):p;return m.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},m)},getNodesBounds:_=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return cqn(_,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:_,id:p,nodeId:m})=>{var w;return Array.from(((w=n.getState().connectionLookup.get(`${m}-${_}${p?`-${p}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:_,handleId:p,nodeId:m})=>{var w;return Array.from(((w=n.getState().connectionLookup.get(`${m}${_?p?`-${_}-${p}`:`-${_}`:""}`))==null?void 0:w.values())??[])},fitView:async _=>{const p=n.getState().fitViewResolver??pqn();return n.setState({fitViewQueued:!0,fitViewOptions:_,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return A.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const PM=e=>e.selected,PUn=typeof window<"u"?window:void 0;function FUn({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Nr(),{deleteElements:r}=DC(),s=sm(e,{actInsideInputWithModifier:!1}),i=sm(n,{target:PUn});A.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(PM),edges:a.filter(PM)}),t.setState({nodesSelectionActive:!1})}},[s]),A.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function HUn(e){const n=Nr();A.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=jC(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",So.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const Wy={position:"absolute",width:"100%",height:"100%",top:0,left:0},qUn=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function UUn({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=J_.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:u,minZoom:h,maxZoom:_,zoomActivationKeyCode:p,preventScrolling:m=!0,children:w,noWheelClassName:k,noPanClassName:v,onViewportChange:b,isControlledViewport:x,paneClickDistance:y,selectionOnDrag:C}){const z=Nr(),E=A.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=Rn(qUn,Cr),D=sm(p),I=A.useRef();HUn(E);const $=A.useCallback(q=>{b==null||b({x:q[0],y:q[1],zoom:q[2]}),x||z.setState({transform:q})},[b,x]);return A.useEffect(()=>{if(E.current){I.current=Zqn({domNode:E.current,minZoom:h,maxZoom:_,translateExtent:u,viewport:c,onDraggingChange:V=>z.setState(Z=>Z.paneDragging===V?Z:{paneDragging:V}),onPanZoomStart:(V,Z)=>{const{onViewportChangeStart:Y,onMoveStart:B}=z.getState();B==null||B(V,Z),Y==null||Y(Z)},onPanZoom:(V,Z)=>{const{onViewportChange:Y,onMove:B}=z.getState();B==null||B(V,Z),Y==null||Y(Z)},onPanZoomEnd:(V,Z)=>{const{onViewportChangeEnd:Y,onMoveEnd:B}=z.getState();B==null||B(V,Z),Y==null||Y(Z)}});const{x:q,y:H,zoom:Q}=I.current.getViewport();return z.setState({panZoom:I.current,transform:[q,H,Q],domNode:E.current.closest(".react-flow")}),()=>{var V;(V=I.current)==null||V.destroy()}}},[]),A.useEffect(()=>{var q;(q=I.current)==null||q.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:D,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:k,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,D,m,v,T,k,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:E,style:Wy,children:w})}const GUn=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function VUn(){const{userSelectionActive:e,userSelectionRect:n}=Rn(GUn,Cr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const T4=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},KUn=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function WUn({isSelecting:e,selectionKeyPressed:n,selectionMode:t=tm.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:h,onPaneScroll:_,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:w,children:k}){const v=A.useRef(0),b=Nr(),{userSelectionActive:x,elementsSelectable:y,dragging:C,panBy:z,autoPanSpeed:E}=Rn(KUn,Cr),T=y&&(e||x),j=A.useRef(null),M=A.useRef(),D=A.useRef(new Set),I=A.useRef(new Set),$=A.useRef(!1),q=A.useRef(!1),H=A.useRef({x:0,y:0}),Q=A.useRef(!1),V=G=>{if(q.current||$.current||b.getState().connection.inProgress){q.current=!1,$.current=!1;return}u==null||u(G),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},Z=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}h==null||h(G)},Y=_?G=>_(G):void 0,B=G=>{q.current&&(G.stopPropagation(),q.current=!1)},L=G=>{var xe,rt;const{domNode:ae,transform:ce}=b.getState();if(M.current=ae==null?void 0:ae.getBoundingClientRect(),!M.current)return;const pe=G.target===j.current;if(!pe&&!!G.target.closest(".nokey")||!e||!(a&&pe||n)||G.button!==0||!G.isPrimary)return;(rt=(xe=G.target)==null?void 0:xe.setPointerCapture)==null||rt.call(xe,G.pointerId),q.current=!1;const{x:De,y:We}=bo(G.nativeEvent,M.current),Ne=Um({x:De,y:We},ce);b.setState({userSelectionRect:{width:0,height:0,startX:Ne.x,startY:Ne.y,x:De,y:We}}),pe||(G.stopPropagation(),G.preventDefault())};function F(G,ae){const{userSelectionRect:ce}=b.getState();if(!ce)return;const{transform:pe,nodeLookup:be,edgeLookup:Ae,connectionLookup:De,triggerNodeChanges:We,triggerEdgeChanges:Ne,defaultEdgeOptions:xe}=b.getState(),rt={x:ce.startX,y:ce.startY},{x:Ze,y:ct}=Mh(rt,pe),Ct={startX:rt.x,startY:rt.y,x:GLe.id)),I.current=new Set;const ht=(xe==null?void 0:xe.selectable)??!0;for(const Le of D.current){const me=De.get(Le);if(me)for(const{edgeId:Te}of me.values()){const He=Ae.get(Te);He&&(He.selectable??ht)&&I.current.add(Te)}}if(!hM(qt,D.current)){const Le=Rd(be,D.current,!0);We(Le)}if(!hM(dt,I.current)){const Le=Rd(Ae,I.current);Ne(Le)}b.setState({userSelectionRect:Ct,userSelectionActive:!0,nodesSelectionActive:!1})}function U(){if(!s||!M.current)return;const[G,ae]=NC(H.current,M.current,E);z({x:G,y:ae}).then(ce=>{if(!q.current||!ce){v.current=requestAnimationFrame(U);return}const{x:pe,y:be}=H.current;F(pe,be),v.current=requestAnimationFrame(U)})}const K=()=>{cancelAnimationFrame(v.current),v.current=0,Q.current=!1};A.useEffect(()=>()=>K(),[]);const ne=G=>{const{userSelectionRect:ae,transform:ce,resetSelectedElements:pe}=b.getState();if(!M.current||!ae)return;const{x:be,y:Ae}=bo(G.nativeEvent,M.current);H.current={x:be,y:Ae};const De=Mh({x:ae.startX,y:ae.startY},ce);if(!q.current){const We=n?0:i;if(Math.hypot(be-De.x,Ae-De.y)<=We)return;pe(),o==null||o(G)}q.current=!0,Q.current||(U(),Q.current=!0),F(be,Ae)},oe=G=>{var ae,ce;if(!T){G.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}G.button===0&&((ce=(ae=G.target)==null?void 0:ae.releasePointerCapture)==null||ce.call(ae,G.pointerId),!x&&G.target===j.current&&b.getState().userSelectionRect&&(V==null||V(G)),b.setState({userSelectionActive:!1,userSelectionRect:null}),q.current&&(c==null||c(G),b.setState({nodesSelectionActive:D.current.size>0})),K())},ue=G=>{var ae,ce;(ce=(ae=G.target)==null?void 0:ae.releasePointerCapture)==null||ce.call(ae,G.pointerId),K()},se=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:ls(["react-flow__pane",{draggable:se,dragging:C,selection:e}]),onClick:T?void 0:T4(V,j),onContextMenu:T4(Z,j),onWheel:T4(Y,j),onPointerEnter:T?void 0:p,onPointerMove:T?ne:m,onPointerUp:oe,onPointerCancel:T?ue:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?B:void 0,onPointerLeave:w,ref:j,style:Wy,children:[k,f.jsx(VUn,{})]})}function gk({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:c}=n.getState(),u=o.get(e);if(!u){c==null||c("012",So.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function RU({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Nr(),[c,u]=A.useState(!1),h=A.useRef();return A.useEffect(()=>{h.current=$qn({getStoreItems:()=>o.getState(),onNodeMouseDown:_=>{gk({id:_,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),A.useEffect(()=>{if(!(n||!e.current||!h.current))return h.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var _;(_=h.current)==null||_.destroy()}},[t,r,n,i,e,s,a]),c}const QUn=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function MU(){const e=Nr();return A.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:c,nodeLookup:u,nodeOrigin:h}=e.getState(),_=new Map,p=QUn(a),m=s?i[0]:5,w=s?i[1]:5,k=t.direction.x*m*t.factor,v=t.direction.y*w*t.factor;for(const[,b]of u){if(!p(b))continue;let x={x:b.internals.positionAbsolute.x+k,y:b.internals.positionAbsolute.y+v};s&&(x=qm(x,i));const{position:y,positionAbsolute:C}=Jq({nodeId:b.id,nextPosition:x,nodeLookup:u,nodeExtent:r,nodeOrigin:h,onError:o});b.position=y,b.internals.positionAbsolute=C,_.set(b.id,b)}c(_)},[])}const LC=A.createContext(null),XUn=LC.Provider;LC.Consumer;const OU=()=>A.useContext(LC),YUn=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),DU=A.createContext(null);function ZUn({children:e}){const n=Rn(YUn,Cr);return f.jsx(DU.Provider,{value:n,children:e})}function JUn(){const e=A.useContext(DU);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const eGn={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},tGn=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:c,isValid:u}=a;if(!o&&!s)return eGn;const h=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===n&&(c==null?void 0:c.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:h,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===Ah.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:h&&u}};function nGn({type:e="source",position:n=Dt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:c,className:u,onMouseDown:h,onTouchStart:_,...p},m){var Q,V;const w=a||null,k=e==="target",v=Nr(),b=OU(),{connectOnClick:x,noPanClassName:y,rfId:C}=JUn(),{connectingFrom:z,connectingTo:E,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:D,valid:I}=Rn(tGn(b,w,e),Cr);b||(V=(Q=v.getState()).onError)==null||V.call(Q,"010",So.error010());const $=Z=>{const{defaultEdgeOptions:Y,onConnect:B,hasDefaultEdges:L}=v.getState(),F={...Y,...Z};if(L){const{edges:U,setEdges:K,onError:ne}=v.getState();K(MUn(F,U,{onError:ne}))}B==null||B(F),o==null||o(F)},q=Z=>{if(!b)return;const Y=cU(Z.nativeEvent);if(s&&(Y&&Z.button===0||!Y)){const B=v.getState();mk.onPointerDown(Z.nativeEvent,{handleDomNode:Z.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:k,handleId:w,nodeId:b,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...L)=>{var F,U;return(U=(F=v.getState()).onConnectEnd)==null?void 0:U.call(F,...L)},updateConnection:B.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var F,U;return((U=(F=v.getState()).isValidConnection)==null?void 0:U.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}Y?h==null||h(Z):_==null||_(Z)},H=Z=>{const{onClickConnectStart:Y,onClickConnectEnd:B,connectionClickStartHandle:L,connectionMode:F,isValidConnection:U,lib:K,rfId:ne,nodeLookup:oe,connection:ue}=v.getState();if(!b||!L&&!s)return;if(!L){Y==null||Y(Z.nativeEvent,{nodeId:b,handleId:w,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:w}});return}const se=aU(Z.target),G=t||U,{connection:ae,isValid:ce}=mk.isValid(Z.nativeEvent,{handle:{nodeId:b,id:w,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:G,flowId:ne,doc:se,lib:K,nodeLookup:oe});ce&&ae&&$(ae);const pe=structuredClone(ue);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,B==null||B(Z,pe),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":w,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${w}-${e}`,className:ls(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!k,target:k,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:z,connectingto:E,valid:I,connectionindicator:r&&(!M||j)&&(M||D?i:s)}]),onMouseDown:q,onTouchStart:q,onClick:x?H:void 0,ref:m,...p,children:c})}const Fu=A.memo(TU(nGn));function rGn({data:e,isConnectable:n,sourcePosition:t=Dt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(Fu,{type:"source",position:t,isConnectable:n})]})}function sGn({data:e,isConnectable:n,targetPosition:t=Dt.Top,sourcePosition:r=Dt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(Fu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(Fu,{type:"source",position:r,isConnectable:n})]})}function iGn(){return null}function aGn({data:e,isConnectable:n,targetPosition:t=Dt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Fu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const xb={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},FM={input:rGn,default:sGn,output:aGn,group:iGn};function oGn(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const cGn=e=>{const{width:n,height:t,x:r,y:s}=Hm(e.nodeLookup,{filter:i=>!!i.selected});return{width:vo(n)?n:null,height:vo(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function lGn({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Nr(),{width:s,height:i,transformString:a,userSelectionActive:o}=Rn(cGn,Cr),c=MU(),u=A.useRef(null);A.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const h=!o&&s!==null&&i!==null;if(RU({nodeRef:u,disabled:!h}),!h)return null;const _=e?m=>{const w=r.getState().nodes.filter(k=>k.selected);e(m,w)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(xb,m.key)&&(m.preventDefault(),c({direction:xb[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:ls(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:_,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const HM=typeof window<"u"?window:void 0,uGn=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function LU({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:h,selectionMode:_,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:w,panActivationKeyCode:k,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:z,panOnScrollMode:E,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:D,translateExtent:I,minZoom:$,maxZoom:q,preventScrolling:H,onSelectionContextMenu:Q,noWheelClassName:V,noPanClassName:Z,disableKeyboardA11y:Y,onViewportChange:B,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:U}=Rn(uGn,Cr),K=sm(u,{target:HM}),ne=sm(k,{target:HM}),oe=ne||j,ue=ne||C,se=h&&oe!==!0,G=K||U||se;return FUn({deleteKeyCode:c,multiSelectionKeyCode:w}),f.jsx(UUn,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:ue,panOnScrollSpeed:z,panOnScrollMode:E,zoomOnDoubleClick:T,panOnDrag:!K&&oe,defaultViewport:D,translateExtent:I,minZoom:$,maxZoom:q,zoomActivationKeyCode:v,preventScrolling:H,noWheelClassName:V,noPanClassName:Z,onViewportChange:B,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:se,children:f.jsxs(WUn,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:oe,autoPanOnSelection:M,isSelecting:!!G,selectionMode:_,selectionKeyPressed:K,paneClickDistance:o,selectionOnDrag:se,children:[e,F&&f.jsx(lGn,{onSelectionContextMenu:Q,noPanClassName:Z,disableKeyboardA11y:Y})]})})}LU.displayName="FlowRenderer";const _Gn=A.memo(LU),fGn=e=>n=>e?EC(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function dGn(e){return Rn(A.useCallback(fGn(e),[e]),Cr)}const hGn=e=>e.updateNodeInternals;function pGn(){const e=Rn(hGn),[n]=A.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return A.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function mGn({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Nr(),i=A.useRef(null),a=A.useRef(null),o=A.useRef(e.sourcePosition),c=A.useRef(e.targetPosition),u=A.useRef(n),h=t&&!!e.internals.handleBounds;return A.useEffect(()=>{i.current&&!e.hidden&&(!h||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[h,e.hidden]),A.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),A.useEffect(()=>{if(i.current){const _=u.current!==n,p=o.current!==e.sourcePosition,m=c.current!==e.targetPosition;(_||p||m)&&(u.current=n,o.current=e.sourcePosition,c.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function gGn({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:c,nodesConnectable:u,nodesFocusable:h,resizeObserver:_,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:w,rfId:k,nodeTypes:v,nodeClickDistance:b,onError:x}){const{node:y,internals:C,isParent:z}=Rn(G=>{const ae=G.nodeLookup.get(e),ce=G.parentLookup.has(e);return{node:ae,internals:ae.internals,isParent:ce}},Cr);let E=y.type||"default",T=(v==null?void 0:v[E])||FM[E];T===void 0&&(x==null||x("003",So.error003(E)),E="default",T=(v==null?void 0:v.default)||FM.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||c&&typeof y.selectable>"u"),D=!!(y.connectable||u&&typeof y.connectable>"u"),I=!!(y.focusable||h&&typeof y.focusable>"u"),$=Nr(),q=sU(y),H=mGn({node:y,nodeType:E,hasDimensions:q,resizeObserver:_}),Q=RU({nodeRef:H,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),V=MU();if(y.hidden)return null;const Z=yl(y),Y=oGn(y),B=M||j||n||t||r||s,L=t?G=>t(G,{...C.userNode}):void 0,F=r?G=>r(G,{...C.userNode}):void 0,U=s?G=>s(G,{...C.userNode}):void 0,K=i?G=>i(G,{...C.userNode}):void 0,ne=a?G=>a(G,{...C.userNode}):void 0,oe=G=>{const{selectNodesOnDrag:ae,nodeDragThreshold:ce}=$.getState();M&&(!ae||!j||ce>0)&&gk({id:e,store:$,nodeRef:H}),n&&n(G,{...C.userNode})},ue=G=>{if(!(oU(G.nativeEvent)||w)){if(Wq.includes(G.key)&&M){const ae=G.key==="Escape";gk({id:e,store:$,unselect:ae,nodeRef:H})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(xb,G.key)){G.preventDefault();const{ariaLabelConfig:ae}=$.getState();$.setState({ariaLiveMessage:ae["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:xb[G.key],factor:G.shiftKey?4:1})}}},se=()=>{var De;if(w||!((De=H.current)!=null&&De.matches(":focus-visible")))return;const{transform:G,width:ae,height:ce,autoPanOnNodeFocus:pe,setCenter:be}=$.getState();if(!pe)return;EC(new Map([[e,y]]),{x:0,y:0,width:ae,height:ce},G,!0).length>0||be(y.position.x+Z.width/2,y.position.y+Z.height/2,{zoom:G[2]})};return f.jsx("div",{className:ls(["react-flow__node",`react-flow__node-${E}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:z,draggable:j,dragging:Q}]),ref:H,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:B?"all":"none",visibility:q?"visible":"hidden",...y.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:U,onContextMenu:K,onClick:oe,onDoubleClick:ne,onKeyDown:I?ue:void 0,tabIndex:I?0:void 0,onFocus:I?se:void 0,role:y.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${EU}-${k}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(XUn,{value:e,children:f.jsx(T,{id:e,data:y.data,type:E,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:D,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Q,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...Z})})})}var vGn=A.memo(gGn);const bGn=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function IU(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=Rn(bGn,Cr),a=dGn(e.onlyRenderVisibleElements),o=pGn();return f.jsx("div",{className:"react-flow__nodes",style:Wy,children:a.map(c=>f.jsx(vGn,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}IU.displayName="NodeRenderer";const yGn=A.memo(IU);function xGn(e){return Rn(A.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&bqn({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),Cr)}const wGn=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},kGn=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},qM={[vb.Arrow]:wGn,[vb.ArrowClosed]:kGn};function SGn(e){const n=Nr();return A.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(qM,e)?qM[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",So.error009(e)),null)},[e])}const CGn=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const c=SGn(n);return c?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(c,{color:t,strokeWidth:a})}):null},$U=({defaultColor:e,rfId:n})=>{const t=Rn(i=>i.edges),r=Rn(i=>i.defaultEdgeOptions),s=A.useMemo(()=>Nqn(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(CGn,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};$U.displayName="MarkerDefinitions";var EGn=A.memo($U);function BU({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:c,className:u,...h}){const[_,p]=A.useState({x:1,y:0,width:0,height:0}),m=ls(["react-flow__edge-textwrapper",u]),w=A.useRef(null);return A.useEffect(()=>{if(w.current){const k=w.current.getBBox();p({x:k.x,y:k.y,width:k.width,height:k.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-_.width/2} ${n-_.height/2})`,className:m,visibility:_.width?"visible":"hidden",...h,children:[s&&f.jsx("rect",{width:_.width+2*a[0],x:-a[0],y:-a[1],height:_.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:_.height/2,dy:"0.3em",ref:w,style:r,children:t}),c]}):null}BU.displayName="EdgeText";const NGn=A.memo(BU);function Qy({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:u=20,...h}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...h,d:e,fill:"none",className:ls(["react-flow__edge-path",h.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&vo(n)&&vo(t)?f.jsx(NGn,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function UM({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Dt.Left||e===Dt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function PU({sourceX:e,sourceY:n,sourcePosition:t=Dt.Bottom,targetX:r,targetY:s,targetPosition:i=Dt.Top}){const[a,o]=UM({pos:t,x1:e,y1:n,x2:r,y2:s}),[c,u]=UM({pos:i,x1:r,y1:s,x2:e,y2:n}),[h,_,p,m]=lU({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:c,targetControlY:u});return[`M${e},${n} C${a},${o} ${c},${u} ${r},${s}`,h,_,p,m]}function FU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:b})=>{const[x,y,C]=PU({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),z=e.isInternal?void 0:n;return f.jsx(Qy,{id:z,path:x,labelX:y,labelY:C,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:b})})}const zGn=FU({isInternal:!1}),HU=FU({isInternal:!0});zGn.displayName="SimpleBezierEdge";HU.displayName="SimpleBezierEdgeInternal";function qU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,sourcePosition:m=Dt.Bottom,targetPosition:w=Dt.Top,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:x})=>{const[y,C,z]=dk({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:w,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),E=e.isInternal?void 0:n;return f.jsx(Qy,{id:E,path:y,labelX:C,labelY:z,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:k,markerStart:v,interactionWidth:x})})}const UU=qU({isInternal:!1}),GU=qU({isInternal:!0});UU.displayName="SmoothStepEdge";GU.displayName="SmoothStepEdgeInternal";function VU(e){return A.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(UU,{...t,id:r,pathOptions:A.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const jGn=VU({isInternal:!1}),KU=VU({isInternal:!0});jGn.displayName="StepEdge";KU.displayName="StepEdgeInternal";function WU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:m,markerStart:w,interactionWidth:k})=>{const[v,b,x]=fU({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(Qy,{id:y,path:v,labelX:b,labelY:x,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:m,markerStart:w,interactionWidth:k})})}const TGn=WU({isInternal:!1}),QU=WU({isInternal:!0});TGn.displayName="StraightEdge";QU.displayName="StraightEdgeInternal";function XU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Dt.Bottom,targetPosition:o=Dt.Top,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:x})=>{const[y,C,z]=uU({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),E=e.isInternal?void 0:n;return f.jsx(Qy,{id:E,path:y,labelX:C,labelY:z,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:x})})}const AGn=XU({isInternal:!1}),YU=XU({isInternal:!0});AGn.displayName="BezierEdge";YU.displayName="BezierEdgeInternal";const GM={default:YU,straight:QU,step:KU,smoothstep:GU,simplebezier:HU},VM={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},RGn=(e,n,t)=>t===Dt.Left?e-n:t===Dt.Right?e+n:e,MGn=(e,n,t)=>t===Dt.Top?e-n:t===Dt.Bottom?e+n:e,KM="react-flow__edgeupdater";function WM({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:ls([KM,`${KM}-${o}`]),cx:RGn(n,r,e),cy:MGn(t,r,e),r,stroke:"transparent",fill:"transparent"})}function OGn({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:c,onReconnect:u,onReconnectStart:h,onReconnectEnd:_,setReconnecting:p,setUpdateHover:m}){const w=Nr(),k=(C,z)=>{if(C.button!==0)return;const{autoPanOnConnect:E,domNode:T,connectionMode:j,connectionRadius:M,lib:D,onConnectStart:I,cancelConnection:$,nodeLookup:q,rfId:H,panBy:Q,updateConnection:V}=w.getState(),Z=z.type==="target",Y=(F,U)=>{p(!1),_==null||_(F,t,z.type,U)},B=F=>u==null?void 0:u(t,F),L=(F,U)=>{p(!0),h==null||h(C,t,z.type),I==null||I(F,U)};mk.onPointerDown(C.nativeEvent,{autoPanOnConnect:E,connectionMode:j,connectionRadius:M,domNode:T,handleId:z.id,nodeId:z.nodeId,nodeLookup:q,isTarget:Z,edgeUpdaterType:z.type,lib:D,flowId:H,cancelConnection:$,panBy:Q,isValidConnection:(...F)=>{var U,K;return((K=(U=w.getState()).isValidConnection)==null?void 0:K.call(U,...F))??!0},onConnect:B,onConnectStart:L,onConnectEnd:(...F)=>{var U,K;return(K=(U=w.getState()).onConnectEnd)==null?void 0:K.call(U,...F)},onReconnectEnd:Y,updateConnection:V,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>k(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>k(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),x=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(WM,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:x,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(WM,{position:c,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:x,onMouseOut:y,type:"target"})]})}function DGn({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,reconnectRadius:h,onReconnect:_,onReconnectStart:p,onReconnectEnd:m,rfId:w,edgeTypes:k,noPanClassName:v,onError:b,disableKeyboardA11y:x}){let y=Rn(be=>be.edgeLookup.get(e));const C=Rn(be=>be.defaultEdgeOptions);y=C?{...C,...y}:y;let z=y.type||"default",E=(k==null?void 0:k[z])||GM[z];E===void 0&&(b==null||b("011",So.error011(z)),z="default",E=(k==null?void 0:k.default)||GM.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof _<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),D=A.useRef(null),[I,$]=A.useState(!1),[q,H]=A.useState(!1),Q=Nr(),{zIndex:V=y.zIndex,sourceX:Z,sourceY:Y,targetX:B,targetY:L,sourcePosition:F,targetPosition:U}=Rn(A.useCallback(be=>{const Ae=be.nodeLookup.get(y.source),De=be.nodeLookup.get(y.target);if(!Ae||!De)return VM;const We=Eqn({id:e,sourceNode:Ae,targetNode:De,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:be.connectionMode,onError:b}),Ne=vqn({selected:y.selected,zIndex:y.zIndex,sourceNode:Ae,targetNode:De,elevateOnSelect:be.elevateEdgesOnSelect,zIndexMode:be.zIndexMode});return{...We||VM,zIndex:Ne}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),Cr),K=A.useMemo(()=>y.markerStart?`url('#${hk(y.markerStart,w)}')`:void 0,[y.markerStart,w]),ne=A.useMemo(()=>y.markerEnd?`url('#${hk(y.markerEnd,w)}')`:void 0,[y.markerEnd,w]);if(y.hidden||Z===null||Y===null||B===null||L===null)return null;const oe=be=>{var Ne;const{addSelectedEdges:Ae,unselectNodesAndEdges:De,multiSelectionActive:We}=Q.getState();M&&(Q.setState({nodesSelectionActive:!1}),y.selected&&We?(De({nodes:[],edges:[y]}),(Ne=D.current)==null||Ne.blur()):Ae([e])),s&&s(be,y)},ue=i?be=>{i(be,{...y})}:void 0,se=a?be=>{a(be,{...y})}:void 0,G=o?be=>{o(be,{...y})}:void 0,ae=c?be=>{c(be,{...y})}:void 0,ce=u?be=>{u(be,{...y})}:void 0,pe=be=>{var Ae;if(!x&&Wq.includes(be.key)&&M){const{unselectNodesAndEdges:De,addSelectedEdges:We}=Q.getState();be.key==="Escape"?((Ae=D.current)==null||Ae.blur(),De({edges:[y]})):We([e])}};return f.jsx("svg",{style:{zIndex:V},children:f.jsxs("g",{className:ls(["react-flow__edge",`react-flow__edge-${z}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:I,selectable:M}]),onClick:oe,onDoubleClick:ue,onContextMenu:se,onMouseEnter:G,onMouseMove:ae,onMouseLeave:ce,onKeyDown:T?pe:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"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":T?`${NU}-${w}`:void 0,ref:D,...y.domAttributes,children:[!q&&f.jsx(E,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,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:Y,targetX:B,targetY:L,sourcePosition:F,targetPosition:U,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:K,markerEnd:ne,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(OGn,{edge:y,isReconnectable:j,reconnectRadius:h,onReconnect:_,onReconnectStart:p,onReconnectEnd:m,sourceX:Z,sourceY:Y,targetX:B,targetY:L,sourcePosition:F,targetPosition:U,setUpdateHover:$,setReconnecting:H})]})})}var LGn=A.memo(DGn);const IGn=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ZU({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:h,reconnectRadius:_,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:w,disableKeyboardA11y:k}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,onError:y}=Rn(IGn,Cr),C=xGn(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(EGn,{defaultColor:e,rfId:t}),C.map(z=>f.jsx(LGn,{id:z,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,onClick:h,reconnectRadius:_,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:w,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:k},z))]})}ZU.displayName="EdgeRenderer";const $Gn=A.memo(ZU),BGn=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function PGn({children:e}){const n=Rn(BGn);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function FGn(e){const n=DC(),t=A.useRef(!1);A.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const HGn=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function qGn(e){const n=Rn(HGn),t=Nr();return A.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function UGn(e){return e.connection.inProgress?{...e.connection,to:Um(e.connection.to,e.transform)}:{...e.connection}}function GGn(e){return UGn}function VGn(e){const n=GGn();return Rn(n,Cr)}const KGn=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function WGn({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:c}=Rn(KGn,Cr);return!(i&&s&&c)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:ls(["react-flow__connection",Yq(o)]),children:f.jsx(JU,{style:n,type:t,CustomComponent:r,isValid:o})})})}const JU=({style:e,type:n=pu.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:c,to:u,toNode:h,toHandle:_,toPosition:p,pointer:m}=VGn();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:p,connectionStatus:Yq(r),toNode:h,toHandle:_,pointer:m});let w="";const k={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case pu.Bezier:[w]=uU(k);break;case pu.SimpleBezier:[w]=PU(k);break;case pu.Step:[w]=dk({...k,borderRadius:0});break;case pu.SmoothStep:[w]=dk(k);break;default:[w]=fU(k)}return f.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};JU.displayName="ConnectionLine";const QGn={};function QM(e=QGn){A.useRef(e),Nr(),A.useEffect(()=>{},[e])}function XGn(){Nr(),A.useRef(!1),A.useEffect(()=>{},[])}function eG({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,onSelectionContextMenu:_,onSelectionStart:p,onSelectionEnd:m,connectionLineType:w,connectionLineStyle:k,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:x,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:z,panActivationKeyCode:E,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:D,defaultViewport:I,translateExtent:$,minZoom:q,maxZoom:H,preventScrolling:Q,defaultMarkerColor:V,zoomOnScroll:Z,zoomOnPinch:Y,panOnScroll:B,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:U,panOnDrag:K,autoPanOnSelection:ne,onPaneClick:oe,onPaneMouseEnter:ue,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneScroll:ae,onPaneContextMenu:ce,paneClickDistance:pe,nodeClickDistance:be,onEdgeContextMenu:Ae,onEdgeMouseEnter:De,onEdgeMouseMove:We,onEdgeMouseLeave:Ne,reconnectRadius:xe,onReconnect:rt,onReconnectStart:Ze,onReconnectEnd:ct,noDragClassName:Ct,noWheelClassName:qt,noPanClassName:dt,disableKeyboardA11y:ht,nodeExtent:Le,rfId:me,viewport:Te,onViewportChange:He}){return QM(e),QM(n),XGn(),FGn(t),qGn(Te),f.jsx(_Gn,{onPaneClick:oe,onPaneMouseEnter:ue,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneContextMenu:ce,onPaneScroll:ae,paneClickDistance:pe,deleteKeyCode:j,selectionKeyCode:x,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:z,panActivationKeyCode:E,zoomActivationKeyCode:T,elementsSelectable:D,zoomOnScroll:Z,zoomOnPinch:Y,zoomOnDoubleClick:U,panOnScroll:B,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:K,autoPanOnSelection:ne,defaultViewport:I,translateExtent:$,minZoom:q,maxZoom:H,onSelectionContextMenu:_,preventScrolling:Q,noDragClassName:Ct,noWheelClassName:qt,noPanClassName:dt,disableKeyboardA11y:ht,onViewportChange:He,isControlledViewport:!!Te,children:f.jsxs(PGn,{children:[f.jsx($Gn,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:rt,onReconnectStart:Ze,onReconnectEnd:ct,onlyRenderVisibleElements:M,onEdgeContextMenu:Ae,onEdgeMouseEnter:De,onEdgeMouseMove:We,onEdgeMouseLeave:Ne,reconnectRadius:xe,defaultMarkerColor:V,noPanClassName:dt,disableKeyboardA11y:ht,rfId:me}),f.jsx(WGn,{style:k,type:w,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(yGn,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,nodeClickDistance:be,onlyRenderVisibleElements:M,noPanClassName:dt,noDragClassName:Ct,disableKeyboardA11y:ht,nodeExtent:Le,rfId:me}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}eG.displayName="GraphView";const YGn=A.memo(eG),ZGn=rU(),XM=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c=.5,maxZoom:u=2,nodeOrigin:h,nodeExtent:_,zIndexMode:p="basic"}={})=>{const m=new Map,w=new Map,k=new Map,v=new Map,b=r??n??[],x=t??e??[],y=h??[0,0],C=_??em;pU(k,v,b);const{nodesInitialized:z}=pk(x,m,w,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let E=[0,0,1];if(a&&s&&i){const T=Hm(m,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:j,y:M,zoom:D}=zC(T,s,i,c,u,(o==null?void 0:o.padding)??.1);E=[j,M,D]}return{rfId:"1",width:s??0,height:i??0,transform:E,nodes:x,nodesInitialized:z,nodeLookup:m,parentLookup:w,edges:b,edgeLookup:v,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:em,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ah.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:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...Xq},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ZGn,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Qq,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},JGn=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:_,zIndexMode:p})=>lUn((m,w)=>{async function k(){const{nodeLookup:v,panZoom:b,fitViewOptions:x,fitViewResolver:y,width:C,height:z,minZoom:E,maxZoom:T}=w();b&&(await _qn({nodes:v,width:C,height:z,panZoom:b,minZoom:E,maxZoom:T},x),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...XM({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:_,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:x,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:z,zIndexMode:E,nodesSelectionActive:T}=w(),{nodesInitialized:j,hasSelectedNodes:M}=pk(v,b,x,{nodeOrigin:y,nodeExtent:_,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:E}),D=T&&M;z&&j?(k(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:D})},setEdges:v=>{const{connectionLookup:b,edgeLookup:x}=w();pU(b,x,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:x}=w();x(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:x}=w();x(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:x,parentLookup:y,domNode:C,nodeOrigin:z,nodeExtent:E,debug:T,fitViewQueued:j,zIndexMode:M}=w(),{changes:D,updatedInternals:I}=Oqn(v,x,y,C,z,E,M);I&&(Tqn(x,y,{nodeOrigin:z,nodeExtent:E,zIndexMode:M}),j?(k(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(D==null?void 0:D.length)>0&&(T&&console.log("React Flow: trigger node changes",D),b==null||b(D)))},updateNodePositions:(v,b=!1)=>{const x=[];let y=[];const{nodeLookup:C,triggerNodeChanges:z,connection:E,updateConnection:T,onNodesChangeMiddlewareMap:j}=w();for(const[M,D]of v){const I=C.get(M),$=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(D!=null&&D.position)),q={id:M,type:"position",position:$?{x:Math.max(0,D.position.x),y:Math.max(0,D.position.y)}:D.position,dragging:b};if(I&&E.inProgress&&E.fromNode.id===I.id){const H=gf(I,E.fromHandle,Dt.Left,!0);T({...E,from:H})}$&&I.parentId&&x.push({id:M,parentId:I.parentId,rect:{...D.internals.positionAbsolute,width:D.measured.width??0,height:D.measured.height??0}}),y.push(q)}if(x.length>0){const{parentLookup:M,nodeOrigin:D}=w(),I=OC(x,C,M,D);y.push(...I)}for(const M of j.values())y=M(y);z(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:x,nodes:y,hasDefaultNodes:C,debug:z}=w();if(v!=null&&v.length){if(C){const E=TUn(v,y);x(E)}z&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:x,edges:y,hasDefaultEdges:C,debug:z}=w();if(v!=null&&v.length){if(C){const E=AUn(v,y);x(E)}z&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:z}=w();if(b){const E=v.map(T=>N_(T,!0));C(E);return}C(Rd(y,new Set([...v]),!0)),z(Rd(x))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:z}=w();if(b){const E=v.map(T=>N_(T,!0));z(E);return}z(Rd(x,new Set([...v]))),C(Rd(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:x,nodes:y,nodeLookup:C,triggerNodeChanges:z,triggerEdgeChanges:E}=w(),T=v||y,j=b||x,M=[];for(const I of T){if(!I.selected)continue;const $=C.get(I.id);$&&($.selected=!1),M.push(N_(I.id,!1))}const D=[];for(const I of j)I.selected&&D.push(N_(I.id,!1));z(M),E(D)},setMinZoom:v=>{const{panZoom:b,maxZoom:x}=w();b==null||b.setScaleExtent([v,x]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:x}=w();b==null||b.setScaleExtent([x,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=w().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:x,triggerEdgeChanges:y,elementsSelectable:C}=w();if(!C)return;const z=b.reduce((T,j)=>j.selected?[...T,N_(j.id,!1)]:T,[]),E=v.reduce((T,j)=>j.selected?[...T,N_(j.id,!1)]:T,[]);x(z),y(E)},setNodeExtent:v=>{const{nodes:b,nodeLookup:x,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:z,nodeExtent:E,zIndexMode:T}=w();v[0][0]===E[0][0]&&v[0][1]===E[0][1]&&v[1][0]===E[1][0]&&v[1][1]===E[1][1]||(pk(b,x,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:z,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:x,height:y,panZoom:C,translateExtent:z}=w();return Dqn({delta:v,panZoom:C,transform:b,translateExtent:z,width:x,height:y})},setCenter:async(v,b,x)=>{const{width:y,height:C,maxZoom:z,panZoom:E}=w();if(!E)return!1;const T=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:z;return await E.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{m({connection:{...Xq}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...XM()})}},Object.is);function eVn({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:c,fitView:u,nodeOrigin:h,nodeExtent:_,zIndexMode:p,children:m}){const[w]=A.useState(()=>JGn({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:c,nodeOrigin:h,nodeExtent:_,zIndexMode:p}));return f.jsx(uUn,{value:w,children:f.jsx(IUn,{children:f.jsx(ZUn,{children:m})})})}function tVn({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:c,minZoom:u,maxZoom:h,nodeOrigin:_,nodeExtent:p,zIndexMode:m}){return A.useContext(Vy)?f.jsx(f.Fragment,{children:e}):f.jsx(eVn,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:h,nodeOrigin:_,nodeExtent:p,zIndexMode:m,children:e})}const nVn={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function rVn({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:c,onInit:u,onMove:h,onMoveStart:_,onMoveEnd:p,onConnect:m,onConnectStart:w,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:z,onNodeDoubleClick:E,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:D,onEdgesDelete:I,onDelete:$,onSelectionChange:q,onSelectionDragStart:H,onSelectionDrag:Q,onSelectionDragStop:V,onSelectionContextMenu:Z,onSelectionStart:Y,onSelectionEnd:B,onBeforeDelete:L,connectionMode:F,connectionLineType:U=pu.Bezier,connectionLineStyle:K,connectionLineComponent:ne,connectionLineContainerStyle:oe,deleteKeyCode:ue="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:G=!1,selectionMode:ae=tm.Full,panActivationKeyCode:ce="Space",multiSelectionKeyCode:pe=rm()?"Meta":"Control",zoomActivationKeyCode:be=rm()?"Meta":"Control",snapToGrid:Ae,snapGrid:De,onlyRenderVisibleElements:We=!1,selectNodesOnDrag:Ne,nodesDraggable:xe,autoPanOnNodeFocus:rt,nodesConnectable:Ze,nodesFocusable:ct,nodeOrigin:Ct=zU,edgesFocusable:qt,edgesReconnectable:dt,elementsSelectable:ht=!0,defaultViewport:Le=kUn,minZoom:me=.5,maxZoom:Te=2,translateExtent:He=em,preventScrolling:nt=!0,nodeExtent:_t,defaultMarkerColor:St="#b1b1b7",zoomOnScroll:yt=!0,zoomOnPinch:Zt=!0,panOnScroll:un=!1,panOnScrollSpeed:At=.5,panOnScrollMode:pt=J_.Free,zoomOnDoubleClick:mt=!0,panOnDrag:_n=!0,onPaneClick:us,onPaneMouseEnter:xr,onPaneMouseMove:Qt,onPaneMouseLeave:Mn,onPaneScroll:mr,onPaneContextMenu:gr,paneClickDistance:_s=1,nodeClickDistance:Et=0,children:fn,onReconnect:an,onReconnectStart:xn,onReconnectEnd:Ir,onEdgeContextMenu:mn,onEdgeDoubleClick:gn,onEdgeMouseEnter:Ln,onEdgeMouseMove:Nt,onEdgeMouseLeave:Ot,reconnectRadius:Hn=10,onNodesChange:zr,onEdgesChange:nr,noDragClassName:On="nodrag",noWheelClassName:hr="nowheel",noPanClassName:jr="nopan",fitView:In,fitViewOptions:Ke,connectOnClick:gt,attributionPosition:Zr,proOptions:Wn,defaultEdgeOptions:wn,elevateNodesOnSelect:Qn=!0,elevateEdgesOnSelect:rr=!1,disableKeyboardA11y:As=!1,autoPanOnConnect:Tr,autoPanOnNodeDrag:cr,autoPanOnSelection:xl=!0,autoPanSpeed:Ya,connectionRadius:Jr,isValidConnection:Rs,onError:Za,style:Eo,id:wa,nodeDragThreshold:Ps,connectionDragThreshold:$t,viewport:qi,onViewportChange:Xn,width:Ar,height:st,colorMode:Jt="light",debug:vi,onScroll:bi,ariaLabelConfig:yi,zIndexMode:Kr="basic",...Wr},Ui){const Gi=wa||"1",Fs=NUn(Jt),Rr=A.useCallback(ei=>{ei.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),bi==null||bi(ei)},[bi]);return f.jsx("div",{"data-testid":"rf__wrapper",...Wr,onScroll:Rr,style:{...Eo,...nVn},ref:Ui,className:ls(["react-flow",s,Fs]),id:wa,role:"application",children:f.jsxs(tVn,{nodes:e,edges:n,width:Ar,height:st,fitView:In,fitViewOptions:Ke,minZoom:me,maxZoom:Te,nodeOrigin:Ct,nodeExtent:_t,zIndexMode:Kr,children:[f.jsx(EUn,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:w,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:xe,autoPanOnNodeFocus:rt,nodesConnectable:Ze,nodesFocusable:ct,edgesFocusable:qt,edgesReconnectable:dt,elementsSelectable:ht,elevateNodesOnSelect:Qn,elevateEdgesOnSelect:rr,minZoom:me,maxZoom:Te,nodeExtent:_t,onNodesChange:zr,onEdgesChange:nr,snapToGrid:Ae,snapGrid:De,connectionMode:F,translateExtent:He,connectOnClick:gt,defaultEdgeOptions:wn,fitView:In,fitViewOptions:Ke,onNodesDelete:D,onEdgesDelete:I,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Q,onSelectionDragStart:H,onSelectionDragStop:V,onMove:h,onMoveStart:_,onMoveEnd:p,noPanClassName:jr,nodeOrigin:Ct,rfId:Gi,autoPanOnConnect:Tr,autoPanOnNodeDrag:cr,autoPanSpeed:Ya,onError:Za,connectionRadius:Jr,isValidConnection:Rs,selectNodesOnDrag:Ne,nodeDragThreshold:Ps,connectionDragThreshold:$t,onBeforeDelete:L,debug:vi,ariaLabelConfig:yi,zIndexMode:Kr}),f.jsx(YGn,{onInit:u,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:z,onNodeDoubleClick:E,nodeTypes:i,edgeTypes:a,connectionLineType:U,connectionLineStyle:K,connectionLineComponent:ne,connectionLineContainerStyle:oe,selectionKeyCode:se,selectionOnDrag:G,selectionMode:ae,deleteKeyCode:ue,multiSelectionKeyCode:pe,panActivationKeyCode:ce,zoomActivationKeyCode:be,onlyRenderVisibleElements:We,defaultViewport:Le,translateExtent:He,minZoom:me,maxZoom:Te,preventScrolling:nt,zoomOnScroll:yt,zoomOnPinch:Zt,zoomOnDoubleClick:mt,panOnScroll:un,panOnScrollSpeed:At,panOnScrollMode:pt,panOnDrag:_n,autoPanOnSelection:xl,onPaneClick:us,onPaneMouseEnter:xr,onPaneMouseMove:Qt,onPaneMouseLeave:Mn,onPaneScroll:mr,onPaneContextMenu:gr,paneClickDistance:_s,nodeClickDistance:Et,onSelectionContextMenu:Z,onSelectionStart:Y,onSelectionEnd:B,onReconnect:an,onReconnectStart:xn,onReconnectEnd:Ir,onEdgeContextMenu:mn,onEdgeDoubleClick:gn,onEdgeMouseEnter:Ln,onEdgeMouseMove:Nt,onEdgeMouseLeave:Ot,reconnectRadius:Hn,defaultMarkerColor:St,noDragClassName:On,noWheelClassName:hr,noPanClassName:jr,rfId:Gi,disableKeyboardA11y:As,nodeExtent:_t,viewport:qi,onViewportChange:Xn}),f.jsx(wUn,{onSelectionChange:q}),fn,f.jsx(gUn,{proOptions:Wn,position:Zr}),f.jsx(mUn,{rfId:Gi,disableKeyboardA11y:As})]})})}var sVn=TU(rVn);function iVn({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ls(["react-flow__background-pattern",t,r])})}function aVn({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:ls(["react-flow__background-pattern","dots",n])})}var ul;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ul||(ul={}));const oVn={[ul.Dots]:1,[ul.Lines]:1,[ul.Cross]:6},cVn=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function tG({id:e,variant:n=ul.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:c,className:u,patternClassName:h}){const _=A.useRef(null),{transform:p,patternId:m}=Rn(cVn,Cr),w=r||oVn[n],k=n===ul.Dots,v=n===ul.Cross,b=Array.isArray(t)?t:[t,t],x=[b[0]*p[2]||1,b[1]*p[2]||1],y=w*p[2],C=Array.isArray(i)?i:[i,i],z=v?[y,y]:x,E=[C[0]*p[2]||1+z[0]/2,C[1]*p[2]||1+z[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:ls(["react-flow__background",u]),style:{...c,...Wy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:_,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%x[0],y:p[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:k?f.jsx(aVn,{radius:y/2,className:h}):f.jsx(iVn,{dimensions:z,lineWidth:s,variant:n,className:h})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}tG.displayName="Background";const lVn=A.memo(tG);function uVn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function _Vn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function fVn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.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 dVn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 hVn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 $1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:ls(["react-flow__controls-button",n]),...t,children:e})}const pVn=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function nG({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:c,className:u,children:h,position:_="bottom-left",orientation:p="vertical","aria-label":m}){const w=Nr(),{isInteractive:k,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:x}=Rn(pVn,Cr),{zoomIn:y,zoomOut:C,fitView:z}=DC(),E=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{z(s),o==null||o()},M=()=>{w.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),c==null||c(!k)},D=p==="horizontal"?"horizontal":"vertical";return f.jsxs(Ky,{className:ls(["react-flow__controls",D,u]),position:_,style:e,"data-testid":"rf__controls","aria-label":m??x["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx($1,{onClick:E,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(uVn,{})}),f.jsx($1,{onClick:T,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(_Vn,{})})]}),t&&f.jsx($1,{className:"react-flow__controls-fitview",onClick:j,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:f.jsx(fVn,{})}),r&&f.jsx($1,{className:"react-flow__controls-interactive",onClick:M,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:k?f.jsx(hVn,{}):f.jsx(dVn,{})}),h]})}nG.displayName="Controls";A.memo(nG);function mVn({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:c,className:u,borderRadius:h,shapeRendering:_,selected:p,onClick:m}){const{background:w,backgroundColor:k}=i||{},v=a||w||k;return f.jsx("rect",{className:ls(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:h,ry:h,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:c},shapeRendering:_,onClick:m?b=>m(b,e):void 0})}const gVn=A.memo(mVn),vVn=e=>e.nodes.map(n=>n.id),A4=e=>e instanceof Function?e:()=>e;function bVn({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=gVn,onClick:a}){const o=Rn(vVn,Cr),c=A4(n),u=A4(e),h=A4(t),_=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(xVn,{id:p,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:_},p))})}function yVn({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:c}){const{node:u,x:h,y:_,width:p,height:m}=Rn(w=>{const k=w.nodeLookup.get(e);if(!k)return{node:void 0,x:0,y:0,width:0,height:0};const v=k.internals.userNode,{x:b,y:x}=k.internals.positionAbsolute,{width:y,height:C}=yl(v);return{node:v,x:b,y:x,width:y,height:C}},Cr);return!u||u.hidden||!sU(u)?null:f.jsx(o,{x:h,y:_,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:c,id:u.id})}const xVn=A.memo(yVn);var wVn=A.memo(bVn);const kVn=200,SVn=150,CVn=e=>!e.hidden,EVn=e=>{const n={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:n,boundingRect:e.nodeLookup.size>0?tU(Hm(e.nodeLookup,{filter:CVn}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},NVn="react-flow__minimap-desc";function rG({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:c,maskColor:u,maskStrokeColor:h,maskStrokeWidth:_,position:p="bottom-right",onClick:m,onNodeClick:w,pannable:k=!1,zoomable:v=!1,ariaLabel:b,inversePan:x,zoomStep:y=1,offsetScale:C=5}){const z=Nr(),E=A.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:D,translateExtent:I,flowWidth:$,flowHeight:q,ariaLabelConfig:H}=Rn(EVn,Cr),Q=(e==null?void 0:e.width)??kVn,V=(e==null?void 0:e.height)??SVn,Z=T.width/Q,Y=T.height/V,B=Math.max(Z,Y),L=B*Q,F=B*V,U=C*B,K=T.x-(L-T.width)/2-U,ne=T.y-(F-T.height)/2-U,oe=L+U*2,ue=F+U*2,se=`${NVn}-${M}`,G=A.useRef(0),ae=A.useRef();G.current=B,A.useEffect(()=>{if(E.current&&D)return ae.current=Uqn({domNode:E.current,panZoom:D,getTransform:()=>z.getState().transform,getViewScale:()=>G.current}),()=>{var Ae;(Ae=ae.current)==null||Ae.destroy()}},[D]),A.useEffect(()=>{var Ae;(Ae=ae.current)==null||Ae.update({translateExtent:I,width:$,height:q,inversePan:x,pannable:k,zoomStep:y,zoomable:v})},[k,v,x,y,I,$,q]);const ce=m?Ae=>{var Ne;const[De,We]=((Ne=ae.current)==null?void 0:Ne.pointer(Ae))||[0,0];m(Ae,{x:De,y:We})}:void 0,pe=w?A.useCallback((Ae,De)=>{const We=z.getState().nodeLookup.get(De).internals.userNode;w(Ae,We)},[]):void 0,be=b??H["minimap.ariaLabel"];return f.jsx(Ky,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof _=="number"?_*B:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:ls(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Q,height:V,viewBox:`${K} ${ne} ${oe} ${ue}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:E,onClick:ce,children:[be&&f.jsx("title",{id:se,children:be}),f.jsx(wVn,{onClick:pe,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${K-U},${ne-U}h${oe+U*2}v${ue+U*2}h${-oe-U*2}z - M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}rG.displayName="MiniMap";A.memo(rG);const zVn=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,jVn={[Oh.Line]:"right",[Oh.Handle]:"bottom-right"};function TVn({nodeId:e,position:n,variant:t=Oh.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:_=!1,resizeDirection:p,autoScale:m=!0,shouldResize:w,onResizeStart:k,onResize:v,onResizeEnd:b}){const x=OU(),y=typeof e=="string"?e:x,C=Nr(),z=A.useRef(null),E=t===Oh.Handle,T=Rn(A.useCallback(zVn(E&&m),[E,m]),Cr),j=A.useRef(null),M=n??jVn[t];A.useEffect(()=>{if(!(!z.current||!y))return j.current||(j.current=rUn({domNode:z.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:I,transform:$,snapGrid:q,snapToGrid:H,nodeOrigin:Q,domNode:V}=C.getState();return{nodeLookup:I,transform:$,snapGrid:q,snapToGrid:H,nodeOrigin:Q,paneDomNode:V}},onChange:(I,$)=>{const{triggerNodeChanges:q,nodeLookup:H,parentLookup:Q,nodeOrigin:V}=C.getState(),Z=[],Y={x:I.x,y:I.y},B=H.get(y);if(B&&B.expandParent&&B.parentId){const L=B.origin??V,F=I.width??B.measured.width??0,U=I.height??B.measured.height??0,K={id:B.id,parentId:B.parentId,rect:{width:F,height:U,...iU({x:I.x??B.position.x,y:I.y??B.position.y},{width:F,height:U},B.parentId,H,L)}},ne=OC([K],H,Q,V);Z.push(...ne),Y.x=I.x?Math.max(L[0]*F,I.x):void 0,Y.y=I.y?Math.max(L[1]*U,I.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const L={id:y,type:"position",position:{...Y}};Z.push(L)}if(I.width!==void 0&&I.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};Z.push(F)}for(const L of $){const F={...L,type:"position"};Z.push(F)}q(Z)},onEnd:({width:I,height:$})=>{const q={id:y,type:"dimensions",resizing:!1,dimensions:{width:I,height:$}};C.getState().triggerNodeChanges([q])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:c,maxWidth:u,maxHeight:h},keepAspectRatio:_,resizeDirection:p,onResizeStart:k,onResize:v,onResizeEnd:b,shouldResize:w}),()=>{var I;(I=j.current)==null||I.destroy()}},[M,o,c,u,h,_,k,v,b,w]);const D=M.split("-");return f.jsx("div",{className:ls(["react-flow__resize-control","nodrag",...D,t,r]),ref:z,style:{...s,scale:T,...a&&{[E?"backgroundColor":"borderColor"]:a}},children:i})}A.memo(TVn);function AVn(){const[e,n]=A.useState(0),[t,r]=A.useState(0);return{ref:A.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),c=new MutationObserver(a);return o.observe(i),c.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const B1=8;function RVn(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=A.useState({viewWidth:0,viewHeight:0});A.useEffect(()=>{function h(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",h),h(),()=>window.removeEventListener("resize",h)},[]);let o=0,c=0,u=0;if(e){const{distance:h}=e;switch(e.anchor){case"left":o=e.x-t-h,c=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+h,c=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,c=e.y+e.height+h;break;case"above":o=e.x+e.width/2-t/2,c=e.y-r-h;break}const _=o,p=c;o=Math.min(Math.max(o,B1),i-t-B1),c=Math.min(Math.max(c,B1),s-r-B1),u=e.anchor==="left"||e.anchor==="right"?p-c:_-o}return{x:o,y:c,arrowAdjustment:u}}const R4=380,M4=12,MVn=350,OVn=150,vk=new EventTarget;function DVn(){vk.dispatchEvent(new Event("move"))}function LVn(e,n){const[t,r]=A.useState(null),s=A.useRef(void 0),i=A.useRef(void 0);A.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return vk.addEventListener("move",u),()=>{vk.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),A.useEffect(()=>{r(u=>{var _;if(!u)return u;const h=((_=e.current)==null?void 0:_.getBoundingClientRect())??null;return h&&u.x===h.x&&u.y===h.y&&u.width===h.width&&u.height===h.height?u:h})},[e,n]);const a=A.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},MVn)},[e]),o=A.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),OVn)},[]),c=A.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:c}}function IVn(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(N(),t)}function $Vn({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:c}){const u=AVn(),h=s.right+M4+R4<=window.innerWidth,_=s.x-M4-R4>=0,p=h?"right":_?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:w}=RVn({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:M4},u),k=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ut({...k6n(k??""),enabled:!!k,subscribed:!!k}),b=A.useMemo(()=>{if(!v)return null;const I=v;let $=I.diff;if(I.truncated){const V=$.lastIndexOf(` +`)),h=u.reduce((_,p)=>_.concat(...p),[]);return[u,h]}return[[],[]]},[e]);return A.useEffect(()=>{const c=(n==null?void 0:n.target)??MM,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const h=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&oU(m))return!1;const k=DM(m.code,o);if(i.current.add(m[k]),OM(a,i.current,!1)){const x=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},_=m=>{const w=DM(m.code,o);OM(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[w]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",_),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",_),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function OM(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function DM(e,n){return n.includes(e)?"code":"key"}const zUn=()=>{const e=Nr();return A.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),c=zC(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(c,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:c}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-c},h=t.snapGrid??s,_=t.snapToGrid??i;return Um(u,r,_,h)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=Mh(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function jU(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const c of a)jUn(c,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function jUn(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function TUn(e,n){return jU(e,n)}function AUn(e,n){return jU(e,n)}function N_(e,n){return{id:e,type:"select",selected:n}}function Rd(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(N_(i.id,a)))}return r}function LM({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),c=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;c!==void 0&&c!==a&&t.push({id:a.id,item:a,type:"replace"}),c===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function IM(e){return{id:e.id,type:"remove"}}const RUn=rU();function MUn(e,n,t={}){return wqn(e,n,{...t,onError:t.onError??RUn})}const $M=e=>oqn(e),OUn=e=>Zq(e);function TU(e){return A.forwardRef(e)}const DUn=typeof window<"u"?A.useLayoutEffect:A.useEffect;function BM(e){const[n,t]=A.useState(BigInt(0)),[r]=A.useState(()=>LUn(()=>t(s=>s+BigInt(1))));return DUn(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function LUn(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const AU=A.createContext(null);function IUn({children:e}){const n=Nr(),t=A.useCallback(o=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:h,onNodesChange:_,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:w}=n.getState();let k=c;for(const b of o)k=typeof b=="function"?b(k):b;let v=LM({items:k,lookup:p});for(const b of w.values())v=b(v);h&&u(k),v.length>0?_==null||_(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:x,setNodes:y}=n.getState();b&&y(x)})},[]),r=BM(t),s=A.useCallback(o=>{const{edges:c=[],setEdges:u,hasDefaultEdges:h,onEdgesChange:_,edgeLookup:p}=n.getState();let m=c;for(const w of o)m=typeof w=="function"?w(m):w;h?u(m):_&&_(LM({items:m,lookup:p}))},[]),i=BM(s),a=A.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(AU.Provider,{value:a,children:e})}function $Un(){const e=A.useContext(AU);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const BUn=e=>!!e.panZoom;function DC(){const e=zUn(),n=Nr(),t=$Un(),r=Rn(BUn),s=A.useMemo(()=>{const i=_=>n.getState().nodeLookup.get(_),a=_=>{t.nodeQueue.push(_)},o=_=>{t.edgeQueue.push(_)},c=_=>{var b,x;const{nodeLookup:p,nodeOrigin:m}=n.getState(),w=$M(_)?_:p.get(_.id),k=w.parentId?iU(w.position,w.measured,w.parentId,p,m):w.position,v={...w,position:k,width:((b=w.measured)==null?void 0:b.width)??w.width,height:((x=w.measured)==null?void 0:x.height)??w.height};return nm(v)},u=(_,p,m={replace:!1})=>{a(w=>w.map(k=>{if(k.id===_){const v=typeof p=="function"?p(k):p;return m.replace&&$M(v)?v:{...k,...v}}return k}))},h=(_,p,m={replace:!1})=>{o(w=>w.map(k=>{if(k.id===_){const v=typeof p=="function"?p(k):p;return m.replace&&OUn(v)?v:{...k,...v}}return k}))};return{getNodes:()=>n.getState().nodes.map(_=>({..._})),getNode:_=>{var p;return(p=i(_))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:_=[]}=n.getState();return _.map(p=>({...p}))},getEdge:_=>n.getState().edgeLookup.get(_),setNodes:a,setEdges:o,addNodes:_=>{const p=Array.isArray(_)?_:[_];t.nodeQueue.push(m=>[...m,...p])},addEdges:_=>{const p=Array.isArray(_)?_:[_];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:_=[],edges:p=[],transform:m}=n.getState(),[w,k,v]=m;return{nodes:_.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x:w,y:k,zoom:v}}},deleteElements:async({nodes:_=[],edges:p=[]})=>{const{nodes:m,edges:w,onNodesDelete:k,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:x,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:z,edges:N}=await fqn({nodesToRemove:_,edgesToRemove:p,nodes:m,edges:w,onBeforeDelete:C}),T=N.length>0,j=z.length>0;if(T){const M=N.map(IM);v==null||v(N),x(M)}if(j){const M=z.map(IM);k==null||k(z),b(M)}return(j||T)&&(y==null||y({nodes:z,edges:N})),{deletedNodes:z,deletedEdges:N}},getIntersectingNodes:(_,p=!0,m)=>{const w=dM(_),k=w?_:c(_),v=m!==void 0;return k?(m||n.getState().nodes).filter(b=>{const x=n.getState().nodeLookup.get(b.id);if(x&&!w&&(b.id===_.id||!x.internals.positionAbsolute))return!1;const y=nm(v?b:x),C=yb(y,k);return p&&C>0||C>=y.width*y.height||C>=k.width*k.height}):[]},isNodeIntersecting:(_,p,m=!0)=>{const k=dM(_)?_:c(_);if(!k)return!1;const v=yb(k,p);return m&&v>0||v>=p.width*p.height||v>=k.width*k.height},updateNode:u,updateNodeData:(_,p,m={replace:!1})=>{u(_,w=>{const k=typeof p=="function"?p(w):p;return m.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},m)},updateEdge:h,updateEdgeData:(_,p,m={replace:!1})=>{h(_,w=>{const k=typeof p=="function"?p(w):p;return m.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},m)},getNodesBounds:_=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return cqn(_,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:_,id:p,nodeId:m})=>{var w;return Array.from(((w=n.getState().connectionLookup.get(`${m}-${_}${p?`-${p}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:_,handleId:p,nodeId:m})=>{var w;return Array.from(((w=n.getState().connectionLookup.get(`${m}${_?p?`-${_}-${p}`:`-${_}`:""}`))==null?void 0:w.values())??[])},fitView:async _=>{const p=n.getState().fitViewResolver??pqn();return n.setState({fitViewQueued:!0,fitViewOptions:_,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return A.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const PM=e=>e.selected,PUn=typeof window<"u"?window:void 0;function FUn({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Nr(),{deleteElements:r}=DC(),s=sm(e,{actInsideInputWithModifier:!1}),i=sm(n,{target:PUn});A.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(PM),edges:a.filter(PM)}),t.setState({nodesSelectionActive:!1})}},[s]),A.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function HUn(e){const n=Nr();A.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=jC(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",So.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const Wy={position:"absolute",width:"100%",height:"100%",top:0,left:0},qUn=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function UUn({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=J_.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:u,minZoom:h,maxZoom:_,zoomActivationKeyCode:p,preventScrolling:m=!0,children:w,noWheelClassName:k,noPanClassName:v,onViewportChange:b,isControlledViewport:x,paneClickDistance:y,selectionOnDrag:C}){const z=Nr(),N=A.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=Rn(qUn,Cr),D=sm(p),I=A.useRef();HUn(N);const $=A.useCallback(q=>{b==null||b({x:q[0],y:q[1],zoom:q[2]}),x||z.setState({transform:q})},[b,x]);return A.useEffect(()=>{if(N.current){I.current=Zqn({domNode:N.current,minZoom:h,maxZoom:_,translateExtent:u,viewport:c,onDraggingChange:V=>z.setState(Z=>Z.paneDragging===V?Z:{paneDragging:V}),onPanZoomStart:(V,Z)=>{const{onViewportChangeStart:Y,onMoveStart:B}=z.getState();B==null||B(V,Z),Y==null||Y(Z)},onPanZoom:(V,Z)=>{const{onViewportChange:Y,onMove:B}=z.getState();B==null||B(V,Z),Y==null||Y(Z)},onPanZoomEnd:(V,Z)=>{const{onViewportChangeEnd:Y,onMoveEnd:B}=z.getState();B==null||B(V,Z),Y==null||Y(Z)}});const{x:q,y:H,zoom:Q}=I.current.getViewport();return z.setState({panZoom:I.current,transform:[q,H,Q],domNode:N.current.closest(".react-flow")}),()=>{var V;(V=I.current)==null||V.destroy()}}},[]),A.useEffect(()=>{var q;(q=I.current)==null||q.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:D,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:k,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,D,m,v,T,k,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:N,style:Wy,children:w})}const GUn=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function VUn(){const{userSelectionActive:e,userSelectionRect:n}=Rn(GUn,Cr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const T4=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},KUn=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function WUn({isSelecting:e,selectionKeyPressed:n,selectionMode:t=tm.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:h,onPaneScroll:_,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:w,children:k}){const v=A.useRef(0),b=Nr(),{userSelectionActive:x,elementsSelectable:y,dragging:C,panBy:z,autoPanSpeed:N}=Rn(KUn,Cr),T=y&&(e||x),j=A.useRef(null),M=A.useRef(),D=A.useRef(new Set),I=A.useRef(new Set),$=A.useRef(!1),q=A.useRef(!1),H=A.useRef({x:0,y:0}),Q=A.useRef(!1),V=G=>{if(q.current||$.current||b.getState().connection.inProgress){q.current=!1,$.current=!1;return}u==null||u(G),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},Z=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}h==null||h(G)},Y=_?G=>_(G):void 0,B=G=>{q.current&&(G.stopPropagation(),q.current=!1)},L=G=>{var xe,rt;const{domNode:ae,transform:ce}=b.getState();if(M.current=ae==null?void 0:ae.getBoundingClientRect(),!M.current)return;const pe=G.target===j.current;if(!pe&&!!G.target.closest(".nokey")||!e||!(a&&pe||n)||G.button!==0||!G.isPrimary)return;(rt=(xe=G.target)==null?void 0:xe.setPointerCapture)==null||rt.call(xe,G.pointerId),q.current=!1;const{x:De,y:We}=bo(G.nativeEvent,M.current),Ne=Um({x:De,y:We},ce);b.setState({userSelectionRect:{width:0,height:0,startX:Ne.x,startY:Ne.y,x:De,y:We}}),pe||(G.stopPropagation(),G.preventDefault())};function F(G,ae){const{userSelectionRect:ce}=b.getState();if(!ce)return;const{transform:pe,nodeLookup:be,edgeLookup:Ae,connectionLookup:De,triggerNodeChanges:We,triggerEdgeChanges:Ne,defaultEdgeOptions:xe}=b.getState(),rt={x:ce.startX,y:ce.startY},{x:Ze,y:ct}=Mh(rt,pe),Ct={startX:rt.x,startY:rt.y,x:GLe.id)),I.current=new Set;const ht=(xe==null?void 0:xe.selectable)??!0;for(const Le of D.current){const me=De.get(Le);if(me)for(const{edgeId:Te}of me.values()){const He=Ae.get(Te);He&&(He.selectable??ht)&&I.current.add(Te)}}if(!hM(qt,D.current)){const Le=Rd(be,D.current,!0);We(Le)}if(!hM(dt,I.current)){const Le=Rd(Ae,I.current);Ne(Le)}b.setState({userSelectionRect:Ct,userSelectionActive:!0,nodesSelectionActive:!1})}function U(){if(!s||!M.current)return;const[G,ae]=NC(H.current,M.current,N);z({x:G,y:ae}).then(ce=>{if(!q.current||!ce){v.current=requestAnimationFrame(U);return}const{x:pe,y:be}=H.current;F(pe,be),v.current=requestAnimationFrame(U)})}const K=()=>{cancelAnimationFrame(v.current),v.current=0,Q.current=!1};A.useEffect(()=>()=>K(),[]);const ne=G=>{const{userSelectionRect:ae,transform:ce,resetSelectedElements:pe}=b.getState();if(!M.current||!ae)return;const{x:be,y:Ae}=bo(G.nativeEvent,M.current);H.current={x:be,y:Ae};const De=Mh({x:ae.startX,y:ae.startY},ce);if(!q.current){const We=n?0:i;if(Math.hypot(be-De.x,Ae-De.y)<=We)return;pe(),o==null||o(G)}q.current=!0,Q.current||(U(),Q.current=!0),F(be,Ae)},oe=G=>{var ae,ce;if(!T){G.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}G.button===0&&((ce=(ae=G.target)==null?void 0:ae.releasePointerCapture)==null||ce.call(ae,G.pointerId),!x&&G.target===j.current&&b.getState().userSelectionRect&&(V==null||V(G)),b.setState({userSelectionActive:!1,userSelectionRect:null}),q.current&&(c==null||c(G),b.setState({nodesSelectionActive:D.current.size>0})),K())},ue=G=>{var ae,ce;(ce=(ae=G.target)==null?void 0:ae.releasePointerCapture)==null||ce.call(ae,G.pointerId),K()},se=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:ls(["react-flow__pane",{draggable:se,dragging:C,selection:e}]),onClick:T?void 0:T4(V,j),onContextMenu:T4(Z,j),onWheel:T4(Y,j),onPointerEnter:T?void 0:p,onPointerMove:T?ne:m,onPointerUp:oe,onPointerCancel:T?ue:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?B:void 0,onPointerLeave:w,ref:j,style:Wy,children:[k,f.jsx(VUn,{})]})}function gk({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:c}=n.getState(),u=o.get(e);if(!u){c==null||c("012",So.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function RU({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Nr(),[c,u]=A.useState(!1),h=A.useRef();return A.useEffect(()=>{h.current=$qn({getStoreItems:()=>o.getState(),onNodeMouseDown:_=>{gk({id:_,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),A.useEffect(()=>{if(!(n||!e.current||!h.current))return h.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var _;(_=h.current)==null||_.destroy()}},[t,r,n,i,e,s,a]),c}const QUn=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function MU(){const e=Nr();return A.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:c,nodeLookup:u,nodeOrigin:h}=e.getState(),_=new Map,p=QUn(a),m=s?i[0]:5,w=s?i[1]:5,k=t.direction.x*m*t.factor,v=t.direction.y*w*t.factor;for(const[,b]of u){if(!p(b))continue;let x={x:b.internals.positionAbsolute.x+k,y:b.internals.positionAbsolute.y+v};s&&(x=qm(x,i));const{position:y,positionAbsolute:C}=Jq({nodeId:b.id,nextPosition:x,nodeLookup:u,nodeExtent:r,nodeOrigin:h,onError:o});b.position=y,b.internals.positionAbsolute=C,_.set(b.id,b)}c(_)},[])}const LC=A.createContext(null),XUn=LC.Provider;LC.Consumer;const OU=()=>A.useContext(LC),YUn=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),DU=A.createContext(null);function ZUn({children:e}){const n=Rn(YUn,Cr);return f.jsx(DU.Provider,{value:n,children:e})}function JUn(){const e=A.useContext(DU);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const eGn={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},tGn=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:c,isValid:u}=a;if(!o&&!s)return eGn;const h=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===n&&(c==null?void 0:c.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:h,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===Ah.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:h&&u}};function nGn({type:e="source",position:n=Dt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:c,className:u,onMouseDown:h,onTouchStart:_,...p},m){var Q,V;const w=a||null,k=e==="target",v=Nr(),b=OU(),{connectOnClick:x,noPanClassName:y,rfId:C}=JUn(),{connectingFrom:z,connectingTo:N,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:D,valid:I}=Rn(tGn(b,w,e),Cr);b||(V=(Q=v.getState()).onError)==null||V.call(Q,"010",So.error010());const $=Z=>{const{defaultEdgeOptions:Y,onConnect:B,hasDefaultEdges:L}=v.getState(),F={...Y,...Z};if(L){const{edges:U,setEdges:K,onError:ne}=v.getState();K(MUn(F,U,{onError:ne}))}B==null||B(F),o==null||o(F)},q=Z=>{if(!b)return;const Y=cU(Z.nativeEvent);if(s&&(Y&&Z.button===0||!Y)){const B=v.getState();mk.onPointerDown(Z.nativeEvent,{handleDomNode:Z.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:k,handleId:w,nodeId:b,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...L)=>{var F,U;return(U=(F=v.getState()).onConnectEnd)==null?void 0:U.call(F,...L)},updateConnection:B.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var F,U;return((U=(F=v.getState()).isValidConnection)==null?void 0:U.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}Y?h==null||h(Z):_==null||_(Z)},H=Z=>{const{onClickConnectStart:Y,onClickConnectEnd:B,connectionClickStartHandle:L,connectionMode:F,isValidConnection:U,lib:K,rfId:ne,nodeLookup:oe,connection:ue}=v.getState();if(!b||!L&&!s)return;if(!L){Y==null||Y(Z.nativeEvent,{nodeId:b,handleId:w,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:w}});return}const se=aU(Z.target),G=t||U,{connection:ae,isValid:ce}=mk.isValid(Z.nativeEvent,{handle:{nodeId:b,id:w,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:G,flowId:ne,doc:se,lib:K,nodeLookup:oe});ce&&ae&&$(ae);const pe=structuredClone(ue);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,B==null||B(Z,pe),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":w,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${w}-${e}`,className:ls(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!k,target:k,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:z,connectingto:N,valid:I,connectionindicator:r&&(!M||j)&&(M||D?i:s)}]),onMouseDown:q,onTouchStart:q,onClick:x?H:void 0,ref:m,...p,children:c})}const Fu=A.memo(TU(nGn));function rGn({data:e,isConnectable:n,sourcePosition:t=Dt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(Fu,{type:"source",position:t,isConnectable:n})]})}function sGn({data:e,isConnectable:n,targetPosition:t=Dt.Top,sourcePosition:r=Dt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(Fu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(Fu,{type:"source",position:r,isConnectable:n})]})}function iGn(){return null}function aGn({data:e,isConnectable:n,targetPosition:t=Dt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Fu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const xb={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},FM={input:rGn,default:sGn,output:aGn,group:iGn};function oGn(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const cGn=e=>{const{width:n,height:t,x:r,y:s}=Hm(e.nodeLookup,{filter:i=>!!i.selected});return{width:vo(n)?n:null,height:vo(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function lGn({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Nr(),{width:s,height:i,transformString:a,userSelectionActive:o}=Rn(cGn,Cr),c=MU(),u=A.useRef(null);A.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const h=!o&&s!==null&&i!==null;if(RU({nodeRef:u,disabled:!h}),!h)return null;const _=e?m=>{const w=r.getState().nodes.filter(k=>k.selected);e(m,w)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(xb,m.key)&&(m.preventDefault(),c({direction:xb[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:ls(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:_,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const HM=typeof window<"u"?window:void 0,uGn=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function LU({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:h,selectionMode:_,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:w,panActivationKeyCode:k,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:z,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:D,translateExtent:I,minZoom:$,maxZoom:q,preventScrolling:H,onSelectionContextMenu:Q,noWheelClassName:V,noPanClassName:Z,disableKeyboardA11y:Y,onViewportChange:B,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:U}=Rn(uGn,Cr),K=sm(u,{target:HM}),ne=sm(k,{target:HM}),oe=ne||j,ue=ne||C,se=h&&oe!==!0,G=K||U||se;return FUn({deleteKeyCode:c,multiSelectionKeyCode:w}),f.jsx(UUn,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:ue,panOnScrollSpeed:z,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!K&&oe,defaultViewport:D,translateExtent:I,minZoom:$,maxZoom:q,zoomActivationKeyCode:v,preventScrolling:H,noWheelClassName:V,noPanClassName:Z,onViewportChange:B,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:se,children:f.jsxs(WUn,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:oe,autoPanOnSelection:M,isSelecting:!!G,selectionMode:_,selectionKeyPressed:K,paneClickDistance:o,selectionOnDrag:se,children:[e,F&&f.jsx(lGn,{onSelectionContextMenu:Q,noPanClassName:Z,disableKeyboardA11y:Y})]})})}LU.displayName="FlowRenderer";const _Gn=A.memo(LU),fGn=e=>n=>e?EC(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function dGn(e){return Rn(A.useCallback(fGn(e),[e]),Cr)}const hGn=e=>e.updateNodeInternals;function pGn(){const e=Rn(hGn),[n]=A.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return A.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function mGn({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Nr(),i=A.useRef(null),a=A.useRef(null),o=A.useRef(e.sourcePosition),c=A.useRef(e.targetPosition),u=A.useRef(n),h=t&&!!e.internals.handleBounds;return A.useEffect(()=>{i.current&&!e.hidden&&(!h||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[h,e.hidden]),A.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),A.useEffect(()=>{if(i.current){const _=u.current!==n,p=o.current!==e.sourcePosition,m=c.current!==e.targetPosition;(_||p||m)&&(u.current=n,o.current=e.sourcePosition,c.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function gGn({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:c,nodesConnectable:u,nodesFocusable:h,resizeObserver:_,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:w,rfId:k,nodeTypes:v,nodeClickDistance:b,onError:x}){const{node:y,internals:C,isParent:z}=Rn(G=>{const ae=G.nodeLookup.get(e),ce=G.parentLookup.has(e);return{node:ae,internals:ae.internals,isParent:ce}},Cr);let N=y.type||"default",T=(v==null?void 0:v[N])||FM[N];T===void 0&&(x==null||x("003",So.error003(N)),N="default",T=(v==null?void 0:v.default)||FM.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||c&&typeof y.selectable>"u"),D=!!(y.connectable||u&&typeof y.connectable>"u"),I=!!(y.focusable||h&&typeof y.focusable>"u"),$=Nr(),q=sU(y),H=mGn({node:y,nodeType:N,hasDimensions:q,resizeObserver:_}),Q=RU({nodeRef:H,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),V=MU();if(y.hidden)return null;const Z=yl(y),Y=oGn(y),B=M||j||n||t||r||s,L=t?G=>t(G,{...C.userNode}):void 0,F=r?G=>r(G,{...C.userNode}):void 0,U=s?G=>s(G,{...C.userNode}):void 0,K=i?G=>i(G,{...C.userNode}):void 0,ne=a?G=>a(G,{...C.userNode}):void 0,oe=G=>{const{selectNodesOnDrag:ae,nodeDragThreshold:ce}=$.getState();M&&(!ae||!j||ce>0)&&gk({id:e,store:$,nodeRef:H}),n&&n(G,{...C.userNode})},ue=G=>{if(!(oU(G.nativeEvent)||w)){if(Wq.includes(G.key)&&M){const ae=G.key==="Escape";gk({id:e,store:$,unselect:ae,nodeRef:H})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(xb,G.key)){G.preventDefault();const{ariaLabelConfig:ae}=$.getState();$.setState({ariaLiveMessage:ae["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:xb[G.key],factor:G.shiftKey?4:1})}}},se=()=>{var De;if(w||!((De=H.current)!=null&&De.matches(":focus-visible")))return;const{transform:G,width:ae,height:ce,autoPanOnNodeFocus:pe,setCenter:be}=$.getState();if(!pe)return;EC(new Map([[e,y]]),{x:0,y:0,width:ae,height:ce},G,!0).length>0||be(y.position.x+Z.width/2,y.position.y+Z.height/2,{zoom:G[2]})};return f.jsx("div",{className:ls(["react-flow__node",`react-flow__node-${N}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:z,draggable:j,dragging:Q}]),ref:H,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:B?"all":"none",visibility:q?"visible":"hidden",...y.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:U,onContextMenu:K,onClick:oe,onDoubleClick:ne,onKeyDown:I?ue:void 0,tabIndex:I?0:void 0,onFocus:I?se:void 0,role:y.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${EU}-${k}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(XUn,{value:e,children:f.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:D,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Q,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...Z})})})}var vGn=A.memo(gGn);const bGn=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function IU(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=Rn(bGn,Cr),a=dGn(e.onlyRenderVisibleElements),o=pGn();return f.jsx("div",{className:"react-flow__nodes",style:Wy,children:a.map(c=>f.jsx(vGn,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}IU.displayName="NodeRenderer";const yGn=A.memo(IU);function xGn(e){return Rn(A.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&bqn({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),Cr)}const wGn=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},kGn=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},qM={[vb.Arrow]:wGn,[vb.ArrowClosed]:kGn};function SGn(e){const n=Nr();return A.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(qM,e)?qM[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",So.error009(e)),null)},[e])}const CGn=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const c=SGn(n);return c?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(c,{color:t,strokeWidth:a})}):null},$U=({defaultColor:e,rfId:n})=>{const t=Rn(i=>i.edges),r=Rn(i=>i.defaultEdgeOptions),s=A.useMemo(()=>Nqn(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(CGn,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};$U.displayName="MarkerDefinitions";var EGn=A.memo($U);function BU({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:c,className:u,...h}){const[_,p]=A.useState({x:1,y:0,width:0,height:0}),m=ls(["react-flow__edge-textwrapper",u]),w=A.useRef(null);return A.useEffect(()=>{if(w.current){const k=w.current.getBBox();p({x:k.x,y:k.y,width:k.width,height:k.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-_.width/2} ${n-_.height/2})`,className:m,visibility:_.width?"visible":"hidden",...h,children:[s&&f.jsx("rect",{width:_.width+2*a[0],x:-a[0],y:-a[1],height:_.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:_.height/2,dy:"0.3em",ref:w,style:r,children:t}),c]}):null}BU.displayName="EdgeText";const NGn=A.memo(BU);function Qy({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:u=20,...h}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...h,d:e,fill:"none",className:ls(["react-flow__edge-path",h.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&vo(n)&&vo(t)?f.jsx(NGn,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function UM({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Dt.Left||e===Dt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function PU({sourceX:e,sourceY:n,sourcePosition:t=Dt.Bottom,targetX:r,targetY:s,targetPosition:i=Dt.Top}){const[a,o]=UM({pos:t,x1:e,y1:n,x2:r,y2:s}),[c,u]=UM({pos:i,x1:r,y1:s,x2:e,y2:n}),[h,_,p,m]=lU({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:c,targetControlY:u});return[`M${e},${n} C${a},${o} ${c},${u} ${r},${s}`,h,_,p,m]}function FU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:b})=>{const[x,y,C]=PU({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),z=e.isInternal?void 0:n;return f.jsx(Qy,{id:z,path:x,labelX:y,labelY:C,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:b})})}const zGn=FU({isInternal:!1}),HU=FU({isInternal:!0});zGn.displayName="SimpleBezierEdge";HU.displayName="SimpleBezierEdgeInternal";function qU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,sourcePosition:m=Dt.Bottom,targetPosition:w=Dt.Top,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:x})=>{const[y,C,z]=dk({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:w,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return f.jsx(Qy,{id:N,path:y,labelX:C,labelY:z,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:k,markerStart:v,interactionWidth:x})})}const UU=qU({isInternal:!1}),GU=qU({isInternal:!0});UU.displayName="SmoothStepEdge";GU.displayName="SmoothStepEdgeInternal";function VU(e){return A.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(UU,{...t,id:r,pathOptions:A.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const jGn=VU({isInternal:!1}),KU=VU({isInternal:!0});jGn.displayName="StepEdge";KU.displayName="StepEdgeInternal";function WU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:m,markerStart:w,interactionWidth:k})=>{const[v,b,x]=fU({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(Qy,{id:y,path:v,labelX:b,labelY:x,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:m,markerStart:w,interactionWidth:k})})}const TGn=WU({isInternal:!1}),QU=WU({isInternal:!0});TGn.displayName="StraightEdge";QU.displayName="StraightEdgeInternal";function XU(e){return A.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Dt.Bottom,targetPosition:o=Dt.Top,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:x})=>{const[y,C,z]=uU({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return f.jsx(Qy,{id:N,path:y,labelX:C,labelY:z,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:x})})}const AGn=XU({isInternal:!1}),YU=XU({isInternal:!0});AGn.displayName="BezierEdge";YU.displayName="BezierEdgeInternal";const GM={default:YU,straight:QU,step:KU,smoothstep:GU,simplebezier:HU},VM={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},RGn=(e,n,t)=>t===Dt.Left?e-n:t===Dt.Right?e+n:e,MGn=(e,n,t)=>t===Dt.Top?e-n:t===Dt.Bottom?e+n:e,KM="react-flow__edgeupdater";function WM({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:ls([KM,`${KM}-${o}`]),cx:RGn(n,r,e),cy:MGn(t,r,e),r,stroke:"transparent",fill:"transparent"})}function OGn({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:c,onReconnect:u,onReconnectStart:h,onReconnectEnd:_,setReconnecting:p,setUpdateHover:m}){const w=Nr(),k=(C,z)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:j,connectionRadius:M,lib:D,onConnectStart:I,cancelConnection:$,nodeLookup:q,rfId:H,panBy:Q,updateConnection:V}=w.getState(),Z=z.type==="target",Y=(F,U)=>{p(!1),_==null||_(F,t,z.type,U)},B=F=>u==null?void 0:u(t,F),L=(F,U)=>{p(!0),h==null||h(C,t,z.type),I==null||I(F,U)};mk.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:j,connectionRadius:M,domNode:T,handleId:z.id,nodeId:z.nodeId,nodeLookup:q,isTarget:Z,edgeUpdaterType:z.type,lib:D,flowId:H,cancelConnection:$,panBy:Q,isValidConnection:(...F)=>{var U,K;return((K=(U=w.getState()).isValidConnection)==null?void 0:K.call(U,...F))??!0},onConnect:B,onConnectStart:L,onConnectEnd:(...F)=>{var U,K;return(K=(U=w.getState()).onConnectEnd)==null?void 0:K.call(U,...F)},onReconnectEnd:Y,updateConnection:V,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>k(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>k(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),x=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(WM,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:x,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(WM,{position:c,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:x,onMouseOut:y,type:"target"})]})}function DGn({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,reconnectRadius:h,onReconnect:_,onReconnectStart:p,onReconnectEnd:m,rfId:w,edgeTypes:k,noPanClassName:v,onError:b,disableKeyboardA11y:x}){let y=Rn(be=>be.edgeLookup.get(e));const C=Rn(be=>be.defaultEdgeOptions);y=C?{...C,...y}:y;let z=y.type||"default",N=(k==null?void 0:k[z])||GM[z];N===void 0&&(b==null||b("011",So.error011(z)),z="default",N=(k==null?void 0:k.default)||GM.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof _<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),D=A.useRef(null),[I,$]=A.useState(!1),[q,H]=A.useState(!1),Q=Nr(),{zIndex:V=y.zIndex,sourceX:Z,sourceY:Y,targetX:B,targetY:L,sourcePosition:F,targetPosition:U}=Rn(A.useCallback(be=>{const Ae=be.nodeLookup.get(y.source),De=be.nodeLookup.get(y.target);if(!Ae||!De)return VM;const We=Eqn({id:e,sourceNode:Ae,targetNode:De,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:be.connectionMode,onError:b}),Ne=vqn({selected:y.selected,zIndex:y.zIndex,sourceNode:Ae,targetNode:De,elevateOnSelect:be.elevateEdgesOnSelect,zIndexMode:be.zIndexMode});return{...We||VM,zIndex:Ne}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),Cr),K=A.useMemo(()=>y.markerStart?`url('#${hk(y.markerStart,w)}')`:void 0,[y.markerStart,w]),ne=A.useMemo(()=>y.markerEnd?`url('#${hk(y.markerEnd,w)}')`:void 0,[y.markerEnd,w]);if(y.hidden||Z===null||Y===null||B===null||L===null)return null;const oe=be=>{var Ne;const{addSelectedEdges:Ae,unselectNodesAndEdges:De,multiSelectionActive:We}=Q.getState();M&&(Q.setState({nodesSelectionActive:!1}),y.selected&&We?(De({nodes:[],edges:[y]}),(Ne=D.current)==null||Ne.blur()):Ae([e])),s&&s(be,y)},ue=i?be=>{i(be,{...y})}:void 0,se=a?be=>{a(be,{...y})}:void 0,G=o?be=>{o(be,{...y})}:void 0,ae=c?be=>{c(be,{...y})}:void 0,ce=u?be=>{u(be,{...y})}:void 0,pe=be=>{var Ae;if(!x&&Wq.includes(be.key)&&M){const{unselectNodesAndEdges:De,addSelectedEdges:We}=Q.getState();be.key==="Escape"?((Ae=D.current)==null||Ae.blur(),De({edges:[y]})):We([e])}};return f.jsx("svg",{style:{zIndex:V},children:f.jsxs("g",{className:ls(["react-flow__edge",`react-flow__edge-${z}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:I,selectable:M}]),onClick:oe,onDoubleClick:ue,onContextMenu:se,onMouseEnter:G,onMouseMove:ae,onMouseLeave:ce,onKeyDown:T?pe:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"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":T?`${NU}-${w}`:void 0,ref:D,...y.domAttributes,children:[!q&&f.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,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:Y,targetX:B,targetY:L,sourcePosition:F,targetPosition:U,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:K,markerEnd:ne,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(OGn,{edge:y,isReconnectable:j,reconnectRadius:h,onReconnect:_,onReconnectStart:p,onReconnectEnd:m,sourceX:Z,sourceY:Y,targetX:B,targetY:L,sourcePosition:F,targetPosition:U,setUpdateHover:$,setReconnecting:H})]})})}var LGn=A.memo(DGn);const IGn=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ZU({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:h,reconnectRadius:_,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:w,disableKeyboardA11y:k}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,onError:y}=Rn(IGn,Cr),C=xGn(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(EGn,{defaultColor:e,rfId:t}),C.map(z=>f.jsx(LGn,{id:z,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,onClick:h,reconnectRadius:_,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:w,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:k},z))]})}ZU.displayName="EdgeRenderer";const $Gn=A.memo(ZU),BGn=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function PGn({children:e}){const n=Rn(BGn);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function FGn(e){const n=DC(),t=A.useRef(!1);A.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const HGn=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function qGn(e){const n=Rn(HGn),t=Nr();return A.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function UGn(e){return e.connection.inProgress?{...e.connection,to:Um(e.connection.to,e.transform)}:{...e.connection}}function GGn(e){return UGn}function VGn(e){const n=GGn();return Rn(n,Cr)}const KGn=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function WGn({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:c}=Rn(KGn,Cr);return!(i&&s&&c)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:ls(["react-flow__connection",Yq(o)]),children:f.jsx(JU,{style:n,type:t,CustomComponent:r,isValid:o})})})}const JU=({style:e,type:n=pu.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:c,to:u,toNode:h,toHandle:_,toPosition:p,pointer:m}=VGn();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:p,connectionStatus:Yq(r),toNode:h,toHandle:_,pointer:m});let w="";const k={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case pu.Bezier:[w]=uU(k);break;case pu.SimpleBezier:[w]=PU(k);break;case pu.Step:[w]=dk({...k,borderRadius:0});break;case pu.SmoothStep:[w]=dk(k);break;default:[w]=fU(k)}return f.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};JU.displayName="ConnectionLine";const QGn={};function QM(e=QGn){A.useRef(e),Nr(),A.useEffect(()=>{},[e])}function XGn(){Nr(),A.useRef(!1),A.useEffect(()=>{},[])}function eG({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,onSelectionContextMenu:_,onSelectionStart:p,onSelectionEnd:m,connectionLineType:w,connectionLineStyle:k,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:x,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:z,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:D,defaultViewport:I,translateExtent:$,minZoom:q,maxZoom:H,preventScrolling:Q,defaultMarkerColor:V,zoomOnScroll:Z,zoomOnPinch:Y,panOnScroll:B,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:U,panOnDrag:K,autoPanOnSelection:ne,onPaneClick:oe,onPaneMouseEnter:ue,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneScroll:ae,onPaneContextMenu:ce,paneClickDistance:pe,nodeClickDistance:be,onEdgeContextMenu:Ae,onEdgeMouseEnter:De,onEdgeMouseMove:We,onEdgeMouseLeave:Ne,reconnectRadius:xe,onReconnect:rt,onReconnectStart:Ze,onReconnectEnd:ct,noDragClassName:Ct,noWheelClassName:qt,noPanClassName:dt,disableKeyboardA11y:ht,nodeExtent:Le,rfId:me,viewport:Te,onViewportChange:He}){return QM(e),QM(n),XGn(),FGn(t),qGn(Te),f.jsx(_Gn,{onPaneClick:oe,onPaneMouseEnter:ue,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneContextMenu:ce,onPaneScroll:ae,paneClickDistance:pe,deleteKeyCode:j,selectionKeyCode:x,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:z,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:D,zoomOnScroll:Z,zoomOnPinch:Y,zoomOnDoubleClick:U,panOnScroll:B,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:K,autoPanOnSelection:ne,defaultViewport:I,translateExtent:$,minZoom:q,maxZoom:H,onSelectionContextMenu:_,preventScrolling:Q,noDragClassName:Ct,noWheelClassName:qt,noPanClassName:dt,disableKeyboardA11y:ht,onViewportChange:He,isControlledViewport:!!Te,children:f.jsxs(PGn,{children:[f.jsx($Gn,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:rt,onReconnectStart:Ze,onReconnectEnd:ct,onlyRenderVisibleElements:M,onEdgeContextMenu:Ae,onEdgeMouseEnter:De,onEdgeMouseMove:We,onEdgeMouseLeave:Ne,reconnectRadius:xe,defaultMarkerColor:V,noPanClassName:dt,disableKeyboardA11y:ht,rfId:me}),f.jsx(WGn,{style:k,type:w,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(yGn,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,nodeClickDistance:be,onlyRenderVisibleElements:M,noPanClassName:dt,noDragClassName:Ct,disableKeyboardA11y:ht,nodeExtent:Le,rfId:me}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}eG.displayName="GraphView";const YGn=A.memo(eG),ZGn=rU(),XM=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c=.5,maxZoom:u=2,nodeOrigin:h,nodeExtent:_,zIndexMode:p="basic"}={})=>{const m=new Map,w=new Map,k=new Map,v=new Map,b=r??n??[],x=t??e??[],y=h??[0,0],C=_??em;pU(k,v,b);const{nodesInitialized:z}=pk(x,m,w,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let N=[0,0,1];if(a&&s&&i){const T=Hm(m,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:j,y:M,zoom:D}=zC(T,s,i,c,u,(o==null?void 0:o.padding)??.1);N=[j,M,D]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:x,nodesInitialized:z,nodeLookup:m,parentLookup:w,edges:b,edgeLookup:v,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:em,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ah.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:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...Xq},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ZGn,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Qq,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},JGn=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:_,zIndexMode:p})=>lUn((m,w)=>{async function k(){const{nodeLookup:v,panZoom:b,fitViewOptions:x,fitViewResolver:y,width:C,height:z,minZoom:N,maxZoom:T}=w();b&&(await _qn({nodes:v,width:C,height:z,panZoom:b,minZoom:N,maxZoom:T},x),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...XM({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:_,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:x,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:z,zIndexMode:N,nodesSelectionActive:T}=w(),{nodesInitialized:j,hasSelectedNodes:M}=pk(v,b,x,{nodeOrigin:y,nodeExtent:_,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),D=T&&M;z&&j?(k(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:D})},setEdges:v=>{const{connectionLookup:b,edgeLookup:x}=w();pU(b,x,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:x}=w();x(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:x}=w();x(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:x,parentLookup:y,domNode:C,nodeOrigin:z,nodeExtent:N,debug:T,fitViewQueued:j,zIndexMode:M}=w(),{changes:D,updatedInternals:I}=Oqn(v,x,y,C,z,N,M);I&&(Tqn(x,y,{nodeOrigin:z,nodeExtent:N,zIndexMode:M}),j?(k(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(D==null?void 0:D.length)>0&&(T&&console.log("React Flow: trigger node changes",D),b==null||b(D)))},updateNodePositions:(v,b=!1)=>{const x=[];let y=[];const{nodeLookup:C,triggerNodeChanges:z,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:j}=w();for(const[M,D]of v){const I=C.get(M),$=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(D!=null&&D.position)),q={id:M,type:"position",position:$?{x:Math.max(0,D.position.x),y:Math.max(0,D.position.y)}:D.position,dragging:b};if(I&&N.inProgress&&N.fromNode.id===I.id){const H=gf(I,N.fromHandle,Dt.Left,!0);T({...N,from:H})}$&&I.parentId&&x.push({id:M,parentId:I.parentId,rect:{...D.internals.positionAbsolute,width:D.measured.width??0,height:D.measured.height??0}}),y.push(q)}if(x.length>0){const{parentLookup:M,nodeOrigin:D}=w(),I=OC(x,C,M,D);y.push(...I)}for(const M of j.values())y=M(y);z(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:x,nodes:y,hasDefaultNodes:C,debug:z}=w();if(v!=null&&v.length){if(C){const N=TUn(v,y);x(N)}z&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:x,edges:y,hasDefaultEdges:C,debug:z}=w();if(v!=null&&v.length){if(C){const N=AUn(v,y);x(N)}z&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:z}=w();if(b){const N=v.map(T=>N_(T,!0));C(N);return}C(Rd(y,new Set([...v]),!0)),z(Rd(x))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:z}=w();if(b){const N=v.map(T=>N_(T,!0));z(N);return}z(Rd(x,new Set([...v]))),C(Rd(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:x,nodes:y,nodeLookup:C,triggerNodeChanges:z,triggerEdgeChanges:N}=w(),T=v||y,j=b||x,M=[];for(const I of T){if(!I.selected)continue;const $=C.get(I.id);$&&($.selected=!1),M.push(N_(I.id,!1))}const D=[];for(const I of j)I.selected&&D.push(N_(I.id,!1));z(M),N(D)},setMinZoom:v=>{const{panZoom:b,maxZoom:x}=w();b==null||b.setScaleExtent([v,x]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:x}=w();b==null||b.setScaleExtent([x,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=w().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:x,triggerEdgeChanges:y,elementsSelectable:C}=w();if(!C)return;const z=b.reduce((T,j)=>j.selected?[...T,N_(j.id,!1)]:T,[]),N=v.reduce((T,j)=>j.selected?[...T,N_(j.id,!1)]:T,[]);x(z),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:x,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:z,nodeExtent:N,zIndexMode:T}=w();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(pk(b,x,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:z,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:x,height:y,panZoom:C,translateExtent:z}=w();return Dqn({delta:v,panZoom:C,transform:b,translateExtent:z,width:x,height:y})},setCenter:async(v,b,x)=>{const{width:y,height:C,maxZoom:z,panZoom:N}=w();if(!N)return!1;const T=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:z;return await N.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{m({connection:{...Xq}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...XM()})}},Object.is);function eVn({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:c,fitView:u,nodeOrigin:h,nodeExtent:_,zIndexMode:p,children:m}){const[w]=A.useState(()=>JGn({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:c,nodeOrigin:h,nodeExtent:_,zIndexMode:p}));return f.jsx(uUn,{value:w,children:f.jsx(IUn,{children:f.jsx(ZUn,{children:m})})})}function tVn({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:c,minZoom:u,maxZoom:h,nodeOrigin:_,nodeExtent:p,zIndexMode:m}){return A.useContext(Vy)?f.jsx(f.Fragment,{children:e}):f.jsx(eVn,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:h,nodeOrigin:_,nodeExtent:p,zIndexMode:m,children:e})}const nVn={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function rVn({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:c,onInit:u,onMove:h,onMoveStart:_,onMoveEnd:p,onConnect:m,onConnectStart:w,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:z,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:D,onEdgesDelete:I,onDelete:$,onSelectionChange:q,onSelectionDragStart:H,onSelectionDrag:Q,onSelectionDragStop:V,onSelectionContextMenu:Z,onSelectionStart:Y,onSelectionEnd:B,onBeforeDelete:L,connectionMode:F,connectionLineType:U=pu.Bezier,connectionLineStyle:K,connectionLineComponent:ne,connectionLineContainerStyle:oe,deleteKeyCode:ue="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:G=!1,selectionMode:ae=tm.Full,panActivationKeyCode:ce="Space",multiSelectionKeyCode:pe=rm()?"Meta":"Control",zoomActivationKeyCode:be=rm()?"Meta":"Control",snapToGrid:Ae,snapGrid:De,onlyRenderVisibleElements:We=!1,selectNodesOnDrag:Ne,nodesDraggable:xe,autoPanOnNodeFocus:rt,nodesConnectable:Ze,nodesFocusable:ct,nodeOrigin:Ct=zU,edgesFocusable:qt,edgesReconnectable:dt,elementsSelectable:ht=!0,defaultViewport:Le=kUn,minZoom:me=.5,maxZoom:Te=2,translateExtent:He=em,preventScrolling:nt=!0,nodeExtent:_t,defaultMarkerColor:kt="#b1b1b7",zoomOnScroll:yt=!0,zoomOnPinch:Zt=!0,panOnScroll:un=!1,panOnScrollSpeed:At=.5,panOnScrollMode:pt=J_.Free,zoomOnDoubleClick:mt=!0,panOnDrag:_n=!0,onPaneClick:us,onPaneMouseEnter:xr,onPaneMouseMove:Qt,onPaneMouseLeave:Mn,onPaneScroll:mr,onPaneContextMenu:gr,paneClickDistance:_s=1,nodeClickDistance:Et=0,children:fn,onReconnect:an,onReconnectStart:xn,onReconnectEnd:Ir,onEdgeContextMenu:mn,onEdgeDoubleClick:gn,onEdgeMouseEnter:Ln,onEdgeMouseMove:Nt,onEdgeMouseLeave:Ot,reconnectRadius:Hn=10,onNodesChange:zr,onEdgesChange:nr,noDragClassName:On="nodrag",noWheelClassName:hr="nowheel",noPanClassName:jr="nopan",fitView:In,fitViewOptions:Ke,connectOnClick:gt,attributionPosition:Zr,proOptions:Wn,defaultEdgeOptions:wn,elevateNodesOnSelect:Qn=!0,elevateEdgesOnSelect:rr=!1,disableKeyboardA11y:As=!1,autoPanOnConnect:Tr,autoPanOnNodeDrag:cr,autoPanOnSelection:xl=!0,autoPanSpeed:Ya,connectionRadius:Jr,isValidConnection:Rs,onError:Za,style:Eo,id:wa,nodeDragThreshold:Ps,connectionDragThreshold:$t,viewport:qi,onViewportChange:Xn,width:Ar,height:st,colorMode:Jt="light",debug:bi,onScroll:yi,ariaLabelConfig:xi,zIndexMode:Kr="basic",...Wr},Ui){const Gi=wa||"1",Fs=NUn(Jt),Rr=A.useCallback(ei=>{ei.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),yi==null||yi(ei)},[yi]);return f.jsx("div",{"data-testid":"rf__wrapper",...Wr,onScroll:Rr,style:{...Eo,...nVn},ref:Ui,className:ls(["react-flow",s,Fs]),id:wa,role:"application",children:f.jsxs(tVn,{nodes:e,edges:n,width:Ar,height:st,fitView:In,fitViewOptions:Ke,minZoom:me,maxZoom:Te,nodeOrigin:Ct,nodeExtent:_t,zIndexMode:Kr,children:[f.jsx(EUn,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:w,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:xe,autoPanOnNodeFocus:rt,nodesConnectable:Ze,nodesFocusable:ct,edgesFocusable:qt,edgesReconnectable:dt,elementsSelectable:ht,elevateNodesOnSelect:Qn,elevateEdgesOnSelect:rr,minZoom:me,maxZoom:Te,nodeExtent:_t,onNodesChange:zr,onEdgesChange:nr,snapToGrid:Ae,snapGrid:De,connectionMode:F,translateExtent:He,connectOnClick:gt,defaultEdgeOptions:wn,fitView:In,fitViewOptions:Ke,onNodesDelete:D,onEdgesDelete:I,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Q,onSelectionDragStart:H,onSelectionDragStop:V,onMove:h,onMoveStart:_,onMoveEnd:p,noPanClassName:jr,nodeOrigin:Ct,rfId:Gi,autoPanOnConnect:Tr,autoPanOnNodeDrag:cr,autoPanSpeed:Ya,onError:Za,connectionRadius:Jr,isValidConnection:Rs,selectNodesOnDrag:Ne,nodeDragThreshold:Ps,connectionDragThreshold:$t,onBeforeDelete:L,debug:bi,ariaLabelConfig:xi,zIndexMode:Kr}),f.jsx(YGn,{onInit:u,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:z,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:U,connectionLineStyle:K,connectionLineComponent:ne,connectionLineContainerStyle:oe,selectionKeyCode:se,selectionOnDrag:G,selectionMode:ae,deleteKeyCode:ue,multiSelectionKeyCode:pe,panActivationKeyCode:ce,zoomActivationKeyCode:be,onlyRenderVisibleElements:We,defaultViewport:Le,translateExtent:He,minZoom:me,maxZoom:Te,preventScrolling:nt,zoomOnScroll:yt,zoomOnPinch:Zt,zoomOnDoubleClick:mt,panOnScroll:un,panOnScrollSpeed:At,panOnScrollMode:pt,panOnDrag:_n,autoPanOnSelection:xl,onPaneClick:us,onPaneMouseEnter:xr,onPaneMouseMove:Qt,onPaneMouseLeave:Mn,onPaneScroll:mr,onPaneContextMenu:gr,paneClickDistance:_s,nodeClickDistance:Et,onSelectionContextMenu:Z,onSelectionStart:Y,onSelectionEnd:B,onReconnect:an,onReconnectStart:xn,onReconnectEnd:Ir,onEdgeContextMenu:mn,onEdgeDoubleClick:gn,onEdgeMouseEnter:Ln,onEdgeMouseMove:Nt,onEdgeMouseLeave:Ot,reconnectRadius:Hn,defaultMarkerColor:kt,noDragClassName:On,noWheelClassName:hr,noPanClassName:jr,rfId:Gi,disableKeyboardA11y:As,nodeExtent:_t,viewport:qi,onViewportChange:Xn}),f.jsx(wUn,{onSelectionChange:q}),fn,f.jsx(gUn,{proOptions:Wn,position:Zr}),f.jsx(mUn,{rfId:Gi,disableKeyboardA11y:As})]})})}var sVn=TU(rVn);function iVn({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ls(["react-flow__background-pattern",t,r])})}function aVn({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:ls(["react-flow__background-pattern","dots",n])})}var ul;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ul||(ul={}));const oVn={[ul.Dots]:1,[ul.Lines]:1,[ul.Cross]:6},cVn=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function tG({id:e,variant:n=ul.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:c,className:u,patternClassName:h}){const _=A.useRef(null),{transform:p,patternId:m}=Rn(cVn,Cr),w=r||oVn[n],k=n===ul.Dots,v=n===ul.Cross,b=Array.isArray(t)?t:[t,t],x=[b[0]*p[2]||1,b[1]*p[2]||1],y=w*p[2],C=Array.isArray(i)?i:[i,i],z=v?[y,y]:x,N=[C[0]*p[2]||1+z[0]/2,C[1]*p[2]||1+z[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:ls(["react-flow__background",u]),style:{...c,...Wy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:_,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%x[0],y:p[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:k?f.jsx(aVn,{radius:y/2,className:h}):f.jsx(iVn,{dimensions:z,lineWidth:s,variant:n,className:h})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}tG.displayName="Background";const lVn=A.memo(tG);function uVn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function _Vn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function fVn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.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 dVn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 hVn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 $1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:ls(["react-flow__controls-button",n]),...t,children:e})}const pVn=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function nG({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:c,className:u,children:h,position:_="bottom-left",orientation:p="vertical","aria-label":m}){const w=Nr(),{isInteractive:k,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:x}=Rn(pVn,Cr),{zoomIn:y,zoomOut:C,fitView:z}=DC(),N=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{z(s),o==null||o()},M=()=>{w.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),c==null||c(!k)},D=p==="horizontal"?"horizontal":"vertical";return f.jsxs(Ky,{className:ls(["react-flow__controls",D,u]),position:_,style:e,"data-testid":"rf__controls","aria-label":m??x["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx($1,{onClick:N,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(uVn,{})}),f.jsx($1,{onClick:T,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(_Vn,{})})]}),t&&f.jsx($1,{className:"react-flow__controls-fitview",onClick:j,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:f.jsx(fVn,{})}),r&&f.jsx($1,{className:"react-flow__controls-interactive",onClick:M,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:k?f.jsx(hVn,{}):f.jsx(dVn,{})}),h]})}nG.displayName="Controls";A.memo(nG);function mVn({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:c,className:u,borderRadius:h,shapeRendering:_,selected:p,onClick:m}){const{background:w,backgroundColor:k}=i||{},v=a||w||k;return f.jsx("rect",{className:ls(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:h,ry:h,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:c},shapeRendering:_,onClick:m?b=>m(b,e):void 0})}const gVn=A.memo(mVn),vVn=e=>e.nodes.map(n=>n.id),A4=e=>e instanceof Function?e:()=>e;function bVn({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=gVn,onClick:a}){const o=Rn(vVn,Cr),c=A4(n),u=A4(e),h=A4(t),_=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(xVn,{id:p,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:_},p))})}function yVn({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:c}){const{node:u,x:h,y:_,width:p,height:m}=Rn(w=>{const k=w.nodeLookup.get(e);if(!k)return{node:void 0,x:0,y:0,width:0,height:0};const v=k.internals.userNode,{x:b,y:x}=k.internals.positionAbsolute,{width:y,height:C}=yl(v);return{node:v,x:b,y:x,width:y,height:C}},Cr);return!u||u.hidden||!sU(u)?null:f.jsx(o,{x:h,y:_,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:c,id:u.id})}const xVn=A.memo(yVn);var wVn=A.memo(bVn);const kVn=200,SVn=150,CVn=e=>!e.hidden,EVn=e=>{const n={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:n,boundingRect:e.nodeLookup.size>0?tU(Hm(e.nodeLookup,{filter:CVn}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},NVn="react-flow__minimap-desc";function rG({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:c,maskColor:u,maskStrokeColor:h,maskStrokeWidth:_,position:p="bottom-right",onClick:m,onNodeClick:w,pannable:k=!1,zoomable:v=!1,ariaLabel:b,inversePan:x,zoomStep:y=1,offsetScale:C=5}){const z=Nr(),N=A.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:D,translateExtent:I,flowWidth:$,flowHeight:q,ariaLabelConfig:H}=Rn(EVn,Cr),Q=(e==null?void 0:e.width)??kVn,V=(e==null?void 0:e.height)??SVn,Z=T.width/Q,Y=T.height/V,B=Math.max(Z,Y),L=B*Q,F=B*V,U=C*B,K=T.x-(L-T.width)/2-U,ne=T.y-(F-T.height)/2-U,oe=L+U*2,ue=F+U*2,se=`${NVn}-${M}`,G=A.useRef(0),ae=A.useRef();G.current=B,A.useEffect(()=>{if(N.current&&D)return ae.current=Uqn({domNode:N.current,panZoom:D,getTransform:()=>z.getState().transform,getViewScale:()=>G.current}),()=>{var Ae;(Ae=ae.current)==null||Ae.destroy()}},[D]),A.useEffect(()=>{var Ae;(Ae=ae.current)==null||Ae.update({translateExtent:I,width:$,height:q,inversePan:x,pannable:k,zoomStep:y,zoomable:v})},[k,v,x,y,I,$,q]);const ce=m?Ae=>{var Ne;const[De,We]=((Ne=ae.current)==null?void 0:Ne.pointer(Ae))||[0,0];m(Ae,{x:De,y:We})}:void 0,pe=w?A.useCallback((Ae,De)=>{const We=z.getState().nodeLookup.get(De).internals.userNode;w(Ae,We)},[]):void 0,be=b??H["minimap.ariaLabel"];return f.jsx(Ky,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof _=="number"?_*B:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:ls(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Q,height:V,viewBox:`${K} ${ne} ${oe} ${ue}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:N,onClick:ce,children:[be&&f.jsx("title",{id:se,children:be}),f.jsx(wVn,{onClick:pe,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${K-U},${ne-U}h${oe+U*2}v${ue+U*2}h${-oe-U*2}z + M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}rG.displayName="MiniMap";A.memo(rG);const zVn=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,jVn={[Oh.Line]:"right",[Oh.Handle]:"bottom-right"};function TVn({nodeId:e,position:n,variant:t=Oh.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:_=!1,resizeDirection:p,autoScale:m=!0,shouldResize:w,onResizeStart:k,onResize:v,onResizeEnd:b}){const x=OU(),y=typeof e=="string"?e:x,C=Nr(),z=A.useRef(null),N=t===Oh.Handle,T=Rn(A.useCallback(zVn(N&&m),[N,m]),Cr),j=A.useRef(null),M=n??jVn[t];A.useEffect(()=>{if(!(!z.current||!y))return j.current||(j.current=rUn({domNode:z.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:I,transform:$,snapGrid:q,snapToGrid:H,nodeOrigin:Q,domNode:V}=C.getState();return{nodeLookup:I,transform:$,snapGrid:q,snapToGrid:H,nodeOrigin:Q,paneDomNode:V}},onChange:(I,$)=>{const{triggerNodeChanges:q,nodeLookup:H,parentLookup:Q,nodeOrigin:V}=C.getState(),Z=[],Y={x:I.x,y:I.y},B=H.get(y);if(B&&B.expandParent&&B.parentId){const L=B.origin??V,F=I.width??B.measured.width??0,U=I.height??B.measured.height??0,K={id:B.id,parentId:B.parentId,rect:{width:F,height:U,...iU({x:I.x??B.position.x,y:I.y??B.position.y},{width:F,height:U},B.parentId,H,L)}},ne=OC([K],H,Q,V);Z.push(...ne),Y.x=I.x?Math.max(L[0]*F,I.x):void 0,Y.y=I.y?Math.max(L[1]*U,I.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const L={id:y,type:"position",position:{...Y}};Z.push(L)}if(I.width!==void 0&&I.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};Z.push(F)}for(const L of $){const F={...L,type:"position"};Z.push(F)}q(Z)},onEnd:({width:I,height:$})=>{const q={id:y,type:"dimensions",resizing:!1,dimensions:{width:I,height:$}};C.getState().triggerNodeChanges([q])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:c,maxWidth:u,maxHeight:h},keepAspectRatio:_,resizeDirection:p,onResizeStart:k,onResize:v,onResizeEnd:b,shouldResize:w}),()=>{var I;(I=j.current)==null||I.destroy()}},[M,o,c,u,h,_,k,v,b,w]);const D=M.split("-");return f.jsx("div",{className:ls(["react-flow__resize-control","nodrag",...D,t,r]),ref:z,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}A.memo(TVn);function AVn(){const[e,n]=A.useState(0),[t,r]=A.useState(0);return{ref:A.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),c=new MutationObserver(a);return o.observe(i),c.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const B1=8;function RVn(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=A.useState({viewWidth:0,viewHeight:0});A.useEffect(()=>{function h(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",h),h(),()=>window.removeEventListener("resize",h)},[]);let o=0,c=0,u=0;if(e){const{distance:h}=e;switch(e.anchor){case"left":o=e.x-t-h,c=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+h,c=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,c=e.y+e.height+h;break;case"above":o=e.x+e.width/2-t/2,c=e.y-r-h;break}const _=o,p=c;o=Math.min(Math.max(o,B1),i-t-B1),c=Math.min(Math.max(c,B1),s-r-B1),u=e.anchor==="left"||e.anchor==="right"?p-c:_-o}return{x:o,y:c,arrowAdjustment:u}}const R4=380,M4=12,MVn=350,OVn=150,vk=new EventTarget;function DVn(){vk.dispatchEvent(new Event("move"))}function LVn(e,n){const[t,r]=A.useState(null),s=A.useRef(void 0),i=A.useRef(void 0);A.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return vk.addEventListener("move",u),()=>{vk.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),A.useEffect(()=>{r(u=>{var _;if(!u)return u;const h=((_=e.current)==null?void 0:_.getBoundingClientRect())??null;return h&&u.x===h.x&&u.y===h.y&&u.width===h.width&&u.height===h.height?u:h})},[e,n]);const a=A.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},MVn)},[e]),o=A.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),OVn)},[]),c=A.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:c}}function IVn(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(E(),t)}function $Vn({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:c}){const u=AVn(),h=s.right+M4+R4<=window.innerWidth,_=s.x-M4-R4>=0,p=h?"right":_?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:w}=RVn({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:M4},u),k=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ut({...k6n(k??""),enabled:!!k,subscribed:!!k}),b=A.useMemo(()=>{if(!v)return null;const I=v;let $=I.diff;if(I.truncated){const V=$.lastIndexOf(` diff --git `);$=V!==-1?$.slice(0,V+1):$.slice(0,$.lastIndexOf(` -`)+1)}let q=[];try{q=$.trim()?J3($):[]}catch{return null}if(I.truncated&&q.every(V=>V.hunks.length===0))return null;let H=0,Q=0;for(const V of q){const Z=_y(V);H+=Z.additions,Q+=Z.deletions}return{fileCount:q.length,additions:H,deletions:Q,truncated:I.truncated}},[v]),x={done:0,failed:0,cancelled:0,live:0};for(const I of n)I.status==="done"?x.done+=1:I.status==="failed"?x.failed+=1:I.status==="cancelled"?x.cancelled+=1:x.live+=1;const y=t?R0((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,z=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,E=A.useRef(null),[T,j]=A.useState(!1),[M,D]=A.useState(!1);return A.useEffect(()=>{j(!1)},[z]),A.useEffect(()=>{const I=E.current;I&&D(I.scrollHeight>I.clientHeight+1)},[z,T]),Fi.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.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-border-hover-strong [&_.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-sm [&_.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]: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-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:R4,left:m,top:w,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:c,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx(cl,{status:t?la(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Gr(i),children:[f.jsx(ko,{size:13}),rDe()]}),f.jsxs("button",{type:"button",...Gr(a),children:[f.jsx(Bb,{size:13}),LOe()]})]}),z&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:E,children:z}),z&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(I=>!I),children:T?OD():Ije()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(N(),{style:"short"}).format([n.length===1?mYe():kYe({count:tn(n.length)}),...x.done>0?[zXe({count:tn(x.done)})]:[],...x.failed>0?[DXe({count:tn(x.failed)})]:[],...x.cancelled>0?[xXe({count:tn(x.cancelled)})]:[],...x.live>0?[nYe({count:tn(x.live)})]:[]])}),t&&oS(t.backend)&&f.jsx(RS,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:wo(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(zm,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[XOe()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?TX({parent:Ce(r??"parent")}):kX({parent:Ce(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?lYe():b.truncated?QXe({count:tn(b.fileCount)}):HXe({count:tn(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[qOe()," ",IVn(e.createdAt)]})]})]}),document.body)}const YM=["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-sm [&_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(" "),BVn=264,ZM=132,_v=44,PVn=72,FVn=148,HVn=44;function qVn(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function UVn(e,n){const t=new Map,r=o=>{const c=t.get(o)??1+o.children.reduce((u,h)=>u+r(h),0);return t.set(o,c),c},s=new Map,i=o=>{const c=s.get(o)??(n(o)||o.children.some(i));return s.set(o,c),c};function a(o){if(n(o)){const h=[];let _=0;for(const p of o.children)i(p)?h.push(...a(p)):_+=r(p);return _>0&&h.push({kind:"elided",id:`el-${o.exp.id}`,count:_,children:[]}),[{kind:"exp",exp:o.exp,children:h}]}if(!i(o))return[];let c=0;const u=[];return(function h(_){c+=1;for(const p of _.children)n(p)?u.push(...a(p)):i(p)?h(p):c+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:c,children:u}]}return e.flatMap(a)}function bk(e){return e.kind==="exp"?BVn:FVn}function P1(e){return e.kind==="exp"?e.exp.id:e.id}function fv(e){if(e.children.length===0)return bk(e);const n=e.children.reduce((t,r)=>t+fv(r),0)+_v*(e.children.length-1);return Math.max(bk(e),n)}function GVn(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const VVn=A.memo(function({data:n}){wf();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:c,onOpenView:u,onOpenCode:h,onArchive:_}=n,p=r?la(r):void 0,m=p==="running"||p==="starting"||p==="cancelling",w=i?jpn():m?m0n():Wc(),k=s.slice(-8),v=A.useRef(null),b=LVn(v,n);return f.jsxs("div",{ref:v,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.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-start [&_.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-xs [&_.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]: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-xs [&_.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-sm [&_.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]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${m?"live":""} ${t.archived?"opacity-80":""}`,onMouseEnter:b.onMouseEnter,onMouseLeave:b.onMouseLeave,children:[f.jsx(Fu,{type:"target",position:Dt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Gr(x=>u(t.id,"overview",x)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:t.archived?IL():w}),f.jsx(cl,{status:p??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:Amn()}),k.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:k.map(x=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${GVn(la(x))}`,title:h6(la(x))},x.id))}):f.jsx("span",{children:umn()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:wo(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:x=>x.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:gmn(),...Gr(x=>u(t.id,"terminal",x)),children:[f.jsx(ko,{size:13}),$L()]}),f.jsxs("button",{className:"node-action",title:bD({branch:Ce(t.branchName)}),...Gr(x=>h(t.id,t.branchName,"files",x)),children:[f.jsx(Bb,{size:13}),I0n()]}),f.jsx(gq,{id:t.id,name:t.slug,hasParent:!!t.parentExperimentId,onArchive:_,compact:!0}),o&&c&&f.jsx("a",{className:"node-action node-action-ext",title:Cv({name:Ce(t.branchName)}),"aria-label":Cv({name:Ce(t.branchName)}),href:Ob(o,c,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:x=>x.stopPropagation(),children:f.jsx(Gb,{size:13})})]}),f.jsx(Fu,{type:"source",position:Dt.Bottom}),b.rect&&f.jsx($Vn,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:b.rect,onOpenLogs:s.length>0?x=>u(t.id,"terminal",x):void 0,onOpenCode:x=>h(t.id,t.branchName,"files",x),onMouseEnter:b.keepOpen,onMouseLeave:b.onMouseLeave})]})}),KVn=A.memo(function({data:n}){wf();const{count:t,onShowProjectScope:r}=n;return f.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-hover-faint text-muted text-sm font-medium text-start 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:$mn(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(Fu,{type:"target",position:Dt.Top}),f.jsx(Ib,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?Qpn():Hpn({count:tn(t)}),f.jsx("span",{className:"elided-node-sub",children:Smn()})]}),f.jsx(Fu,{type:"source",position:Dt.Bottom})]})}),WVn={exp:VVn,elided:KVn},sG={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},QVn={...sG.style,strokeDasharray:"4 4"};function XVn({experiments:e,hasArchivedExperiments:n,allExperiments:t,runs:r,project:s,onOpenView:i,onOpenCode:a,onArchive:o,agentSessionId:c,onShowProjectScope:u,viewport:h,onViewportChange:_}){const{nodes:p,edges:m}=A.useMemo(()=>{const w=new Map;for(const E of r){const T=w.get(E.experimentId);T?T.push(E):w.set(E.experimentId,[E])}for(const E of w.values())E.sort((T,j)=>T.createdAt-j.createdAt);const k=[],v=[],b=E=>!c||E.exp.chatSessionId===c,x=UVn(qVn(e),b),y=new Map(t.map(E=>[E.id,E.slug]));function C(E,T,j){const M=T-bk(E)/2;if(E.kind==="exp"){const $=w.get(E.exp.id)??[];k.push({id:E.exp.id,type:"exp",position:{x:M,y:j},data:{exp:E.exp,latestRun:$[$.length-1]??null,runs:$,isBaseline:!E.exp.parentExperimentId,parentSlug:E.exp.parentExperimentId?y.get(E.exp.parentExperimentId)??null:null,githubOwner:s.githubEnabled?s.githubOwner:"",githubRepo:s.githubEnabled?s.githubRepo:"",onOpenView:i,onOpenCode:a,onArchive:o}})}else k.push({id:E.id,type:"elided",position:{x:M,y:j+(ZM-HVn)/2},data:{count:E.count,onShowProjectScope:u}});if(E.children.length===0)return;const D=E.children.reduce(($,q)=>$+fv(q),0)+_v*(E.children.length-1);let I=T-D/2;for(const $ of E.children){const q=fv($),H=E.kind==="elided"||$.kind==="elided";v.push({id:`e-${P1(E)}-${P1($)}`,source:P1(E),target:P1($),...H?{style:QVn}:{}}),C($,I+q/2,j+ZM+PVn),I+=q+_v}}let z=0;for(const E of x){const T=fv(E);C(E,z+T/2,0),z+=T+_v}return{nodes:k,edges:v}},[e,t,r,i,a,o,s.githubOwner,s.githubRepo,s.githubEnabled,c,u]);return e.length===0?f.jsxs("div",{className:YM,children:[f.jsx("p",{className:"empty-state-title",children:n?x3():rmn()}),!n&&f.jsx("p",{className:"empty-state-hint",children:T0n()})]}):p.length===0&&c?f.jsxs("div",{className:YM,children:[f.jsx("p",{className:"empty-state-title",children:n?x3():X0n()}),!n&&f.jsx("p",{className:"empty-state-hint",children:k0n()})]}):f.jsx(sVn,{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:p,edges:m,nodeTypes:WVn,defaultEdgeOptions:sG,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:DVn,onMoveEnd:(w,k)=>{w&&_(k)},minZoom:.15,defaultViewport:h??void 0,fitView:h===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(lVn,{variant:ul.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},c??"project")}const t0=["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-sm [&_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(" ");function YVn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ZVn(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),c=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/")||E6(i))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[w,k]=[m(i),m(p)];return w===k?"":w.startsWith(`${k}/`)?w.slice(k.length).replace(/^\/+/,""):null},h=i.startsWith("/")&&c?u(c):null,_=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(h!==null)return h?{path:h,source:"artifacts"}:null;if(_!==null)i=_;else{const p=s?YVn(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),w=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),k=m||w?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};w?(a=w[1],i=w[2]):k&&(i=k[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function JVn(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const eKn=10,JM=1448,tKn=80,nKn=48;function eO(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function tO(e){const n=A.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function rKn({runtime:e,projectId:n,pane:t}){var Yt,vn,hn;const r=dn({mutationFn:Qbn}),s=pi(),i=_D({select:J=>J.location}),a=cf(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",c=A.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:c.current;(a==null?void 0:a.kind)==="task"&&(c.current=u);const h=t!==void 0,_=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=A.useState(null),[w,k]=A.useState(0),v=A.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==w)&&(v.current={href:i.href,jump:w,value:v.current.value+1});const b=A.useMemo(()=>{const J=t?fo(t):"experiments";return typeof J=="object"&&"path"in J&&J.line&&p!==v.current.value?{...J,lineScrollRequest:v.current.value}:J},[t,p,i.href,w]),x=ut(Ga(n)),y=A.useMemo(()=>{var J;return((J=x.data)==null?void 0:J.map(he=>he.id))??null},[x.data]),C=A.useRef(new Set),z=A.useRef(new Set),E=A.useRef({}),[T,j]=A.useState(0),M=A.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const D=A.useCallback((J,he=!1)=>{const je=M.current;je.projectId&&s.navigate({href:X1(je.projectId,je.activeSessionId,J),replace:he})},[s]),I=A.useCallback(J=>{const he=rl(J);D(he.kind==="file"?{...he,line:void 0}:he)},[D]),$=A.useCallback(()=>D(void 0),[D]),q=A.useCallback(J=>{(t==null?void 0:t.kind)==="experiment"&&D({...t,runId:J??void 0})},[t,D]),H=A.useCallback(J=>{s.navigate({href:J?`/projects/${encodeURIComponent(J)}`:"/projects"})},[s]),Q=A.useCallback(J=>{var he;if(n)if(J==="chat"){const je=c.current;s.navigate({href:X1(n,je,(he=Tu(Ki.current,je??"new"))==null?void 0:he.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${J==="skills"?"skills":`settings/${J}`}`})},[s,n]),V=wf(),{status:Z}=u6(e.kind==="local"),Y=A.useMemo(()=>hh(),[n]),B=ut(Y),L=B.data??null,F=A.useCallback(J=>{Yr(Y.queryKey,he=>(typeof J=="function"?J(he??null):J)??void 0)},[Y]),U=A.useMemo(()=>Em(),[n]),K=ut(U),ne=K.data??null,oe=A.useCallback(J=>{Yr(U.queryKey,he=>(typeof J=="function"?J(he??null):J)??void 0)},[U]),ue=A.useRef(void 0);ue.current=ne==null?void 0:ne.tourCompleted;const se=[!x.data&&x.error?CD():null,!B.data&&B.error?f0():null,!K.data&&K.error?p_e():null].filter(J=>J!==null),G=se.length?j_e({items:new Intl.ListFormat(V).format(se)}):null,ae=A.useRef(null),ce=ut(Lv(n)),pe=ce.data??[],be=!ce.isPending,[Ae,De]=A.useState(!1),Ne=ut(Eu(n)).data??[],xe=A.useRef(Ne);xe.current=Ne;const rt=A.useRef(new Map),Ze=A.useRef(new Set),ct=A.useRef(null),Ct=A.useRef(!1),qt=A.useRef(new Map),dt=A.useRef(new Map),ht=A.useRef(0),Le=A.useRef(pe);Le.current=pe;const Te=ut(S6n(n)).data??null,[He,nt]=A.useState("table"),[_t,St]=A.useState(!1),[yt,Zt]=A.useState("project"),un=A.useRef(null),{open:At,setOpen:pt,ref:mt}=Xa(un),[_n,us]=A.useState(!1),xr=pe.every(J=>J.chatSessionId),Qt=u&&xr?yt:"project",Mn=A.useMemo(()=>Qt!=="agent"?pe:pe.filter(J=>J.chatSessionId===u),[pe,Qt,u]),mr=A.useMemo(()=>pe.filter(J=>_t||!J.archived),[pe,_t]),gr=A.useMemo(()=>Mn.filter(J=>_t||!J.archived),[Mn,_t]),_s=A.useCallback(async(J,he,je)=>{try{await uyn(J,he,je),await Je.invalidateQueries({queryKey:Lv(n).queryKey})}catch(Be){bn(Be instanceof Error?Be.message:String(Be),"error")}},[n]),Et=A.useMemo(()=>{if(Qt!=="agent")return Ne;const J=new Set(Mn.map(he=>he.id));return Ne.filter(he=>J.has(he.experimentId))},[Ne,Mn,Qt]),[fn,an]=A.useState([]),[xn,Ir]=A.useState(!1),[mn,gn]=A.useState(!1),[Ln,Nt]=A.useState(!1),[Ot,Hn]=A.useState(!1),[zr,nr]=A.useState(null),[On,hr]=A.useState([]),[jr,In]=A.useState([]),Ke=A.useRef(new Map),gt=A.useRef(new Map),Zr=J=>{let he=gt.current.get(J);return he||(he=new sBn,gt.current.set(J,he)),he},[Wn,wn]=A.useState([]),[Qn,rr]=A.useState([]),[As,Tr]=A.useState([]),[cr,xl]=A.useState([]),[Ya,Jr]=A.useState(null),[Rs,Za]=A.useState("files"),[Eo,wa]=A.useState(new Set),[Ps,$t]=A.useState(!1),[qi,Xn]=A.useState(null),[Ar,st]=A.useState(d$),[Jt,vi]=A.useState(()=>window.innerWidth>=JM),bi=o==="chat"&&!h&&Jt,[yi,Kr]=A.useState(!0),[Wr,Ui]=A.useState(!1),Gi=A.useRef(zS()),Fs=A.useRef(u);Fs.current=u;const Rr=A.useRef(fn);Rr.current=fn;const ei=A.useRef(cr);ei.current=cr;const xi=A.useRef(null),Vt=A.useCallback(J=>{const he=[...J];ei.current=he,xl(he)},[]),wi=A.useCallback(J=>{xi.current=J,Jr(J)},[]),dc=A.useCallback(J=>{const he=Lt(J);hr(Me=>qp(Me,he)),In(Me=>qp(Me,he)),wn(Me=>qp(Me,he)),rr(Me=>qp(Me,he)),Tr(Me=>qp(Me,he));const je=Qi.current;if(je&&"path"in J){const Me=Bs(je,Fs.current,J);Ke.current.delete(Me),gt.current.delete(Me),z.current.delete(Me),C.current.delete(Me)}const Be=Rr.current.filter(Me=>Lt(Me)!==he);Rr.current=Be,an(Be)},[]),Yn=A.useCallback(J=>{const he=Lt(J),je=[...Rr.current.filter(Be=>Lt(Be)!==he),c1(J)];Rr.current=je,an(je),I(J)},[I]),es=A.useCallback((J,he,je)=>{const Be=Lt(J),Me=xi.current,it=uDn({order:ei.current,previewKey:Me?Lt(Me):null},Be,he);it.replacedKey&&Me&&typeof Me!="string"&&Lt(Me)===it.replacedKey&&dc(Me),Vt(it.order),it.previewKey===null?wi(null):it.previewKey===Be&&wi(c1(J));const at=[...Rr.current.filter(Bt=>Lt(Bt)!==Be),c1(J)];Rr.current=at,an(at),D(rl(J,je))},[dc,Vt,wi,D]),ki=A.useCallback(J=>{const he=xi.current;he&&Lt(he)===Lt(J)&&wi(null)},[wi]);A.useEffect(()=>{let J=!1;const he=Be=>{const Me=xi.current,it=Be.target;if(it instanceof Element&&it.closest("input, textarea, [contenteditable='true']")!==null){J=!1;return}if(Me&&Lt(Me)===Lt(Gi.current.rightTab)&&(Be.metaKey||Be.ctrlKey)&&!Be.altKey&&!Be.shiftKey&&Be.key.toLowerCase()==="k"){Be.preventDefault(),J=!0;return}if(J&&Be.key==="Enter"){Be.preventDefault(),J=!1;const Bt=xi.current;Bt&&ki(Bt);return}J=!1},je=()=>{J=!1};return window.addEventListener("keydown",he),window.addEventListener("blur",je),window.addEventListener("pointerdown",je),()=>{window.removeEventListener("keydown",he),window.removeEventListener("blur",je),window.removeEventListener("pointerdown",je)}},[ki]);const ks=A.useCallback((J,he)=>{const je=Lt(J),Be=xi.current;Be&&Lt(Be)===je&&wi(null);const Me=_Dn({order:ei.current,previewKey:Be?Lt(Be):null},je,Rr.current.map(Lt));Vt(Me.order);const it=Rr.current.filter(Bt=>Lt(Bt)!==je);if(Rr.current=it,an(it),!he)return;const at=Me.fallbackKey?it.find(Bt=>Lt(Bt)===Me.fallbackKey):void 0;at?I(at):($(),$t(!1))},[Vt,wi,I,$]),Vi=Q,Hs=A.useMemo(()=>({rightTab:c1(b),tabHistory:fn,experimentsTabOpen:xn,filesTabOpen:mn,artifactsTabOpen:Ln,terminalTabOpen:Ot,expTabs:On,fileTabs:jr,planTabs:Wn,subagentTabs:Qn,codeTabs:As,contentTabOrder:ei.current,previewTab:xi.current,filesView:Rs,filesToggled:Eo,selectedRunId:_,scope:yt,panelOpen:h,panelMax:Ps,treeViewport:qi}),[b,fn,xn,mn,Ln,Ot,On,jr,Wn,Qn,As,cr,Ya,Rs,Eo,_,yt,h,Ps,qi]);Gi.current=Hs;const Qu=A.useCallback(()=>Object.fromEntries(Ke.current),[]),hc=A.useRef(void 0),Ja=A.useCallback(()=>{clearTimeout(hc.current),hc.current=setTimeout(()=>j(J=>J+1),200)},[]);A.useEffect(()=>()=>clearTimeout(hc.current),[]);const No=A.useCallback((J,he,je)=>{if(an(J.tabHistory),Rr.current=J.tabHistory,Ir(J.experimentsTabOpen),gn(J.filesTabOpen),Nt(J.artifactsTabOpen),Hn(J.terminalTabOpen),hr(J.expTabs),In(J.fileTabs),wn(Me=>Me===J.planTabs?Me:J.planTabs.map(it=>{var at;return{...it,plan:((at=Me.find(Bt=>Bt.sessionId===it.sessionId&&Bt.promptId===it.promptId))==null?void 0:at.plan)??""}})),rr(J.subagentTabs),Tr(J.codeTabs),Vt(J.contentTabOrder),wi(J.previewTab),Za(J.filesView),wa(J.filesToggled),Zt(J.scope),$t(J.panelMax),Xn(J.treeViewport),us(M.current.activeSessionId===Id&&J.fileTabs.some(Me=>b_(Me,{path:iw,source:"artifacts"}))),je){for(const[Me,it]of Object.entries((he==null?void 0:he.scroll)??{}))Ke.current.set(Me,it);Object.assign(E.current,he==null?void 0:he.sourceModes)}const Be=M.current;if(Be.projectId)for(const Me of J.fileTabs){const it=Bs(Be.projectId,Be.activeSessionId,Me);z.current.has(it)||C.current.add(it)}},[Vt,wi]),{ready:Si,loaded:Xu,error:zo,retry:qs,capture:fs,workspace:Ki}=Akn({projectId:ne&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",firstDemoOpen:(ne==null?void 0:ne.tourCompleted)===!1,state:Hs,apply:No,getScroll:Qu,sourceModes:E.current,revision:T}),ka=A.useRef(null);A.useLayoutEffect(()=>{if(!Si||!be||(a==null?void 0:a.kind)!=="task")return;const J=ka.current;(J==null?void 0:J.projectId)===n&&J.taskId===u&&J.scope!==Qt&&Xn(null),ka.current={projectId:n,taskId:u,scope:Qt}},[Si,be,a==null?void 0:a.kind,n,u,Qt]);const pr=A.useCallback((J,he)=>{var Bt;const je=(he==null?void 0:he.projectId)??n;if(!je)return;const Be=je===n;J&&Be&&he!=null&&he.replace&&u===null&&(fs(),jkn(je,J));const Me=Tu(l$(je),J??"new"),it=Me?Me.active:Vc(je)?(Bt=jS(J??void 0,ue.current===!1))==null?void 0:Bt.active:void 0,at=Be&&(he!=null&&he.replace)&&J&&u===null?M.current.pane:it;s.navigate({href:X1(je,J,at),replace:Be&&(he==null?void 0:he.replace)})},[s,n,u,fs]);A.useEffect(()=>{Si&&(a==null?void 0:a.kind)!=="task"&&!c.current&&Ki.current.lastTaskId&&(y!=null&&y.includes(Ki.current.lastTaskId))&&(c.current=Ki.current.lastTaskId,j(J=>J+1))},[Si,a==null?void 0:a.kind,Ki,y]),fQ({shouldBlockFn:({next:J})=>{var he;return((he=cf(J.pathname))==null?void 0:he.projectId)!==n&&[...gt.current.values()].some(je=>je.needsProtection)&&!FR($N())},enableBeforeUnload:()=>[...gt.current.values()].some(J=>J.needsProtection)});const pc=A.useRef(null);A.useEffect(()=>{const J=Pb(i.href);!ne||!Si||!J||(qb.queue({lastLocation:J,railOpen:yi,panelWidth:Ar,experimentsView:He},pc.current===J?250:0),pc.current=J)},[i.href,ne,Si,yi,Ar,He]);const sr=(ne==null?void 0:ne.onboardingCompleted)??!1,[Mf,mc]=A.useState(!1),[wl,Ci]=A.useState(null),[ds,eo]=A.useState(0),Wi=A.useCallback(()=>mc(!0),[]),to=A.useCallback(async J=>{const he=ue.current===!1,je=await r.mutateAsync({tourCompleted:!0});he&&du({name:"demo_welcome_choice",choice:J}),oe(Be=>Be&&{...Be,tourCompleted:je.tourCompleted}),mc(!1),J==="explore_demo"&&eo(Be=>Be+1)},[]),Of=A.useCallback(async()=>{await to("create_project"),Ui(!0)},[to]);A.useEffect(()=>{!n||!Vc(n)||!sr||ne!=null&&ne.tourCompleted||Wi()},[n,sr,Wi,ne==null?void 0:ne.tourCompleted]);const on=(L==null?void 0:L.find(J=>J.id===n))??null;A.useEffect(()=>{const J=G||ne===null?null:on==null?void 0:on.name;document.title=J?`${ia(J)} — OpenResearch`:"OpenResearch"},[G,ne,on]);const Qi=A.useRef(n);Qi.current=n;const ti=A.useCallback(J=>{n&&du({name:"first_action",surface:Vc(n)?"demo":"project",action:J})},[n]);A.useEffect(()=>{o!=="chat"&&o!=="skills"&&ti("open_settings")},[o,ti]);const Zn=A.useCallback((J=!1)=>{J&&(!M.current.isTask||M.current.pane)||(ti("open_experiment"),Ir(!0),D({kind:"home",view:"experiments"},J))},[D,ti]),Yu=()=>{B.refetch(),K.refetch(),x.refetch()},Ss=A.useRef(!1);A.useEffect(()=>{if(!ne||Ss.current)return;Ss.current=!0,ae.current=ne.preferredAgent;const J=ES()??ne.workspace;J&&(Kr(J.railOpen),st(Math.min(J.panelWidth,i0())),nt(J.experimentsView))},[ne]),A.useEffect(()=>{y&&c.current&&!y.includes(c.current)&&(c.current=null)},[y]);const ni=A.useRef(Promise.resolve()),Ei=A.useRef(0),kl=A.useCallback(J=>{const he=++Ei.current;oe(Be=>Be&&{...Be,preferredAgent:J});const je=ni.current.then(()=>r.mutateAsync({preferredAgent:J})).then(Be=>{ae.current=Be.preferredAgent,he===Ei.current&&oe(Me=>Me&&{...Me,preferredAgent:Be.preferredAgent})}).catch(Be=>{throw he===Ei.current&&oe(Me=>Me&&{...Me,preferredAgent:ae.current}),Be});return ni.current=je.catch(()=>{}),je},[]);A.useEffect(()=>{const J=()=>{st(he=>Math.min(he,i0())),vi(window.innerWidth>=JM)};return window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]);const Zu=A.useCallback(J=>{Ct.current=!1,qt.current.clear(),dt.current.clear();const he=++ht.current;Je.fetchQuery(Eu(J)).then(je=>{if(Qi.current!==J||ct.current!==J||ht.current!==he)return;qt.current=new Map(je.map(Me=>[Me.id,Me]));const Be=[...dt.current.values()].some(Me=>{const it=qt.current.get(Me.id);return!it||it.status!=="running"&&it.updatedAt<=Me.updatedAt});dt.current.clear();for(const Me of je){const it=rt.current.get(Me.id);(!it||it.updatedAt{var it;return je.some(at=>at.id===Me&&at.status==="running")?Me:((it=je.find(at=>at.status==="running"))==null?void 0:it.id)??null}),Be&&Zn(!0)}).catch(()=>{ht.current===he&&(dt.current.clear(),De(!0))})},[Zn]);A.useEffect(()=>{if(n)return ct.current=n,rt.current.clear(),Ze.current.clear(),oyn(n).catch(()=>{}),Zu(n),()=>{ht.current++}},[Zu,n]);const Sa=A.useCallback(()=>{Nt(!0),Yn("artifacts")},[Yn]),Df=A.useCallback(()=>{Hn(!0),Yn("terminal")},[Yn]),jo=u??(n?`project:${n}`:null);A.useEffect(()=>{nr(h?b==="terminal"?jo:J=>J===jo?J:null:null)},[h,b,jo]),awn({onReconnect:()=>{const J=Qi.current;J&&(ct.current=J,rt.current.clear(),Ze.current.clear(),Zu(J))},onRun:J=>{if(J.projectId!==Qi.current||J.projectId!==ct.current)return;const he=rt.current.get(J.id),je=Ze.current.has(J.id);if(he&&he.updatedAt>J.updatedAt||(rt.current.set(J.id,J),Ze.current.add(J.id),Vc(J.projectId)&&Ci(it=>J.status==="running"?it??J.id:it===J.id?null:it),J.status!=="running"||(he==null?void 0:he.status)==="running"))return;const Be=qt.current.get(J.id),Me=Ct.current&&(!Be||Be.status!=="running"&&Be.updatedAt<=J.updatedAt);je&&he||Me?Zn(!0):Ct.current||dt.current.set(J.id,J)}});const Qh=A.useCallback(()=>Zt("project"),[]),ri=A.useCallback((J,he="overview",je="preview",Be)=>{ti("open_experiment");const Me={id:J,view:he};hr(it=>it.some(at=>fw(at,Me))?it:[...it,Me]),es(Me,je,Be)},[es]),gc=A.useCallback((J,he="preview")=>{const je=xe.current.filter(Me=>Me.id===J||Me.id.startsWith(J)),Be=je.length===1?je[0]:null;Be&&ri(Be.experimentId,"terminal",he,Be.id)},[ri]),Xh=A.useMemo(()=>new Map(pe.map(J=>{var he;return[J.id,((he=J.title)==null?void 0:he.trim())||J.slug||Wc()]})),[pe,V]),vc=tO(Xh),Sl=A.useMemo(()=>{const J=new Map;for(const he of Ne)J.set(he.id,vc.get(he.experimentId)??Wc());return J},[vc,Ne,V]),Ca=tO(Sl),Lf=A.useCallback(J=>{const he=Ca.get(J);if(he)return he;const je=[...Ca].filter(([Be])=>Be.startsWith(J));return je.length===1?je[0][1]:""},[Ca]),Cl=A.useCallback(J=>{const he=vc.get(J);if(he)return he;const je=[...vc].filter(([Be])=>Be.startsWith(J));return je.length===1?je[0][1]:""},[vc]),Ju=A.useCallback((J,he="preview")=>{const je=Le.current.filter(Be=>Be.id===J||Be.id.startsWith(J));je.length===1&&ri(je[0].id,"overview",he)},[ri]),El=A.useCallback(J=>{const he=On.findIndex(je=>fw(je,J));he!==-1&&(hr(je=>je.filter((Be,Me)=>Me!==he)),ks(J,Lt(b)===Lt(J)))},[On,ks,b]),Ea=A.useCallback((J,he="preview")=>{J.line!=null&&k(Me=>Me+1);const je=Qi.current;if(je){const Me=Bs(je,Fs.current,J);Gi.current.fileTabs.some(it=>b_(it,J))||C.current.delete(Me),z.current.add(Me)}const Be=o$(J);In(Me=>{const it=Me.findIndex(Bt=>b_(Bt,J));if(it===-1)return[...Me,Be];const at=Me.slice();return at[it]=Be,at}),es(J,he)},[es]),Nl=A.useCallback((J,he,je,Be,Me,it)=>{const at=L==null?void 0:L.find(ps=>ps.id===n),Bt=ZVn(J,at==null?void 0:at.repoPath,he,(at==null?void 0:at.artifactsDir)??(at==null?void 0:at.filesDir),at==null?void 0:at.slug);if(!Bt)return null;const Kt=Me?Le.current.find(ps=>ps.id===Me||Me.length>=6&&ps.id.startsWith(Me)):void 0,Ns=je??(Kt==null?void 0:Kt.branchName),Os=Bt.source==null||Bt.source==="repo";return Ns&&Os&&(Bt.ref=Ns),it&&!Bt.ref&&Os&&(Bt.branchLabel=it),Be!=null&&(Bt.line=Be),Bt},[L,n]),bc=A.useCallback((J,he,je,Be,Me,it,at="preview")=>{const Bt=Nl(J,he,je,Be,Me,it);Bt&&Ea(Bt,at)},[Ea,Nl]),Yh=A.useCallback(J=>Ea({path:J,source:"artifacts"},"keepOpen"),[Ea]),e_=A.useCallback((J,he,je,Be,Me,it="preview")=>{const at=Nl(J,he,Me,je,Be);at&&Ea(at,it)},[Ea,Nl]),si=A.useCallback((J,he)=>{ki(J),he()},[ki]),Zh=A.useCallback(J=>{var Be;const he=jr.findIndex(Me=>b_(Me,J));if(he===-1)return;const je=n?Bs(n,u,J):null;je&&((Be=gt.current.get(je))!=null&&Be.needsProtection)&&!FR($N())||(In(Me=>Me.filter((it,at)=>at!==he)),je&&(Ke.current.delete(je),gt.current.delete(je),z.current.delete(je),C.current.delete(je),delete E.current[je]),u===Id&&b_(J,{path:iw,source:"artifacts"})&&us(!1),ks(J,Lt(b)===Lt(J)))},[u,jr,ks,n,b]),no=A.useCallback(J=>{J.lineScrollRequest!==void 0&&m(J.lineScrollRequest)},[]),Jh=A.useCallback((J,he,je,Be="preview")=>{const Me={kind:"plan",sessionId:he,promptId:je,plan:J};wn(it=>{const at=it.findIndex(Kt=>Kt.promptId===je);if(at===-1)return[...it,Me];const Bt=it.slice();return Bt[at]=Me,Bt}),es(Me,Be)},[es]),zl=A.useCallback(J=>{const he=Wn.findIndex(je=>je.promptId===J.promptId);he!==-1&&(wn(je=>je.filter((Be,Me)=>Me!==he)),ks(J,Lt(b)===Lt(J)))},[ks,Wn,b]),Na=A.useCallback((J,he,je,Be="preview")=>{const Me={kind:"subagent",sessionId:J,spawnPartId:he,label:je};rr(it=>it.some(at=>at.spawnPartId===he)?it:[...it,Me]),es(Me,Be)},[es]),ep=A.useCallback(J=>{const he=Qn.findIndex(je=>je.spawnPartId===J.spawnPartId);he!==-1&&(rr(je=>je.filter((Be,Me)=>Me!==he)),ks(J,Lt(b)===Lt(J)))},[ks,b,Qn]),[jl,Tl]=A.useState({});A.useEffect(()=>{if(Tl(at=>{const Bt=new Set(Qn.map(Kt=>Kt.spawnPartId));return Object.keys(at).every(Kt=>Bt.has(Kt))?at:Object.fromEntries(Object.entries(at).filter(([Kt])=>Bt.has(Kt)))}),Qn.length===0)return;let J=!0;const he=new Set,je=(at,Bt,Kt)=>{Tl(Ns=>{var ps;let Os=Ns;for(const ja of Bt)if(!(Kt&&he.has(ja.spawnPartId)))for(const so of at){const zs=lb(so.parts,ja.spawnPartId);if(!zs)continue;Kt||he.add(ja.spawnPartId);const wc={label:UIn(zs),running:((ps=zs.state)==null?void 0:ps.status)==="running"},kc=Os[ja.spawnPartId];(!kc||kc.label!==wc.label||kc.running!==wc.running)&&(Os===Ns&&(Os={...Ns}),Os[ja.spawnPartId]=wc);break}return Os})};let Be=0;const Me=()=>{const at=++Be;for(const Bt of new Set(Qn.map(Kt=>Kt.sessionId)))Je.fetchQuery({...ol(Bt),staleTime:0}).then(({messages:Kt})=>{J&&at===Be&&je(Kt,Qn.filter(Ns=>Ns.sessionId===Bt),!0)}).catch(()=>{})};Me();const it=Ov(at=>{if(at.type==="reconnected"){he.clear(),Me();return}if(at.type!=="message")return;const Bt=Qn.filter(Kt=>Kt.sessionId===at.sessionId);Bt.length&&je([at.message],Bt,!1)});return()=>{J=!1,it()}},[Qn]);const Al=A.useCallback((J,he,je="files",Be="preview")=>{const Me={code:!0,experimentId:J,branch:he,view:je,toggled:new Set};Tr(it=>it.some(at=>dd(at,Me))?it.map(at=>dd(at,Me)?{...at,experimentId:J,view:je}:at):[...it,Me]),es(Me,Be)},[es]),t_=A.useCallback((J,he)=>{Tr(je=>je.map(Be=>dd(Be,J)?{...Be,...he}:Be)),he.view&&D(rl({...J,...he}))},[]),If=A.useCallback(J=>{const he=As.findIndex(je=>dd(je,J));he!==-1&&(Tr(je=>je.filter((Be,Me)=>Me!==he)),ks(J,Lt(b)===Lt(J)))},[As,ks,b]),za=A.useCallback(()=>{gn(!0),Yn("files")},[Yn]),Rl=A.useCallback(J=>{J==="experiments"?Ir(!1):J==="files"?gn(!1):J==="terminal"?(Hn(!1),nr(null)):Nt(!1),ks(J,b===J)},[ks,b]),n_=J=>{J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId);const je=document.body.style.userSelect;document.body.style.userSelect="none";const Be=Ps,Me=J.clientX,it=Ar;let at=!1;function Bt(){window.removeEventListener("pointermove",Kt),window.removeEventListener("pointerup",Bt),window.removeEventListener("pointercancel",Bt),document.body.style.userSelect=je}function Kt(Ns){if(Be){const so=Ns.clientX-Me;if(at||sops+tKn){$t(!0);return}$t(!1);const ja=Math.min(Math.max(Os,Pv),ps);st(ja)}window.addEventListener("pointermove",Kt),window.addEventListener("pointerup",Bt),window.addEventListener("pointercancel",Bt)},tp=(J,he)=>{F(je=>je?eO(je,J):[J]),s.navigate({href:`/projects/${encodeURIComponent(J.id)}${he?"/settings/git":""}`}),he&&bn(he,"error")},Ms=typeof b=="object"&&"id"in b?b:null,$n=typeof b=="object"&&"path"in b?b:null,ii=($n==null?void 0:$n.source)==="artifacts"&&Te?Q0(Te.entries,$n.path):null,To=ii?`${ii.modifiedAt}:${ii.size}`:null,yc=u===Id&&_n?jr.find(J=>b_(J,{path:iw,source:"artifacts"})):void 0,Ml=yc?[yc]:[],hs=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,Ni=hs==null?void 0:hs.sessionId,ro=hs==null?void 0:hs.promptId,xc=!!(Ni&&ro&&(y!=null&&y.includes(Ni))),Ol=ut({...ol(Ni??""),enabled:xc,subscribed:xc}),Ao=A.useMemo(()=>{var he;if(!Ni||!ro||!Ol.data)return null;const J=Ol.data.messages.flatMap(je=>{const Be=lb(je.parts,ro);return Be?[Be]:[]})[0];return{key:`${Ni}:${ro}`,text:((he=J==null?void 0:J.prompt)==null?void 0:he.plan)??null}},[Ni,ro,Ol.data]),Cs=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Dl=typeof b=="object"&&"code"in b?b:null,Es=Dl?As.find(J=>dd(J,Dl))??null:null,r_=new Map;for(const J of[...On,...jr,...Wn,...Qn,...As])r_.set(Lt(J),J);const $f=yc?Lt(yc):null,Bf=cr.filter(J=>J!==$f).map(J=>r_.get(J)).filter(Ekn),$r=J=>Ya!==null&&Lt(Ya)===Lt(J),te=J=>f.jsx(qc,{active:$n!==null&&b_($n,J),label:J.path.split("/").pop()||J.path,icon:f.jsx(qI,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>ki(J),onClose:()=>Zh(J)},`file:${NS(J)}`),ge=Ms?pe.find(J=>J.id===Ms.id)??null:null,Ee=Es?pe.find(J=>J.id===Es.experimentId&&J.branchName===Es.branch)??null:null,Ie=J=>{var je,Be;if("path"in J)return te(J);if("id"in J){const Me=pe.find(it=>it.id===J.id);return f.jsx(qc,{active:Ms!==null&&fw(Ms,J),label:Me?Me.title||Me.slug:"…",icon:J.view==="overview"?f.jsx(h3n,{size:12,className:"shrink-0"}):f.jsx(ko,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>ki(J),onClose:()=>El(J)},Lt(J))}if("kind"in J&&J.kind==="plan")return f.jsx(qc,{active:hs!==null&&hs.promptId===J.promptId,label:AD(),icon:f.jsx(yS,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>ki(J),onClose:()=>zl(J)},Lt(J));if("kind"in J)return f.jsx(qc,{active:Cs!==null&&Cs.spawnPartId===J.spawnPartId,label:((je=jl[J.spawnPartId])==null?void 0:je.label)??J.label??L_e(),shimmer:((Be=jl[J.spawnPartId])==null?void 0:Be.running)??!1,icon:f.jsx(kS,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>ki(J),onClose:()=>ep(J)},Lt(J));const he=pe.find(Me=>Me.id===J.experimentId);return f.jsx(qc,{active:Es!==null&&dd(Es,J),label:(he==null?void 0:he.slug)??J.branch,icon:f.jsx(Ou,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>ki(J),onClose:()=>If(J)},Lt(J))};if(!a||a.kind==="resume")return null;if(G)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:t0,children:[f.jsx("p",{children:G}),f.jsx(Oe,{variant:"primary",onClick:Yu,children:Ys()})]}),e.kind==="ssh"&&f.jsx(G3,{runtime:e,corner:!0})]});if(L&&!on)return f.jsxs("div",{className:t0,children:[go(),f.jsx(Oe,{onClick:()=>H(null),children:f0()})]});if(zo&&!Si)return f.jsxs("div",{className:t0,children:[f.jsx("p",{role:"alert",children:zo}),f.jsx(Oe,{onClick:qs,children:Ys()})]});if(L===null||ne===null||!Xu||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:t0,children:f.jsx(jt,{})}),e.kind==="ssh"&&f.jsx(G3,{runtime:e,corner:!0})]});if(!on||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:t0,children:[go(),f.jsx(Oe,{onClick:()=>H(null),children:f0()})]});const Pe=f.jsx(CBn,{projectName:((Yt=L.find(J=>J.id===n))==null?void 0:Yt.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Ui(!0),onRepository:()=>Vi("git"),onCollapse:()=>Kr(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(g$,{}),e.kind==="local"&&f.jsx(K$,{status:Z}),zo&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:zo}),f.jsx(Oe,{onClick:qs,children:Ys()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${bi?"workspace-card-visible":""}`,children:[n&&f.jsx(s$n,{projectId:n,projectName:(on==null?void 0:on.name)??"",railHeader:Pe,railOpen:yi,onShowRail:()=>Kr(!0),mainView:o,onSelectMainView:Vi,onOpenFile:e_,onOpenRun:gc,runExperimentName:Lf,onOpenExperiment:Ju,experimentName:Cl,onOpenPlan:Jh,onOpenSubagent:Na,composerFocusNonce:ds,demoRunningRunId:wl,runtime:e,onOpenDemoWelcome:on&&Vc(on.id)?Wi:void 0,activeSessionId:u,onActiveSessionChange:pr,preferredAgent:ne.preferredAgent,onPreferredAgentChange:kl,children:o==="skills"?f.jsx(W$n,{}):o!=="chat"?f.jsx(yLn,{remote:e.kind==="ssh",tab:o,project:on,onProjectUpdate:J=>{F(he=>he?eO(he,J):[J])},onSelectTab:Vi}):null}),o==="chat"&&f.jsx(K8n,{expanded:bi,experiments:pe,runs:Ne,onOpenExperiment:(J,he)=>ri(J,"overview","preview",he),rightOffset:h?Ar+28:void 0,activeView:h&&(b==="files"||b==="artifacts"||b==="experiments"||b==="terminal")?b:null,projectId:on.id,onCompute:()=>Vi("compute"),sessionId:u,busy:((vn=x.data)==null?void 0:vn.some(J=>J.id===u&&J.busy))??!1,onChanges:()=>{Za("changes"),za()},onFiles:()=>{Za("files"),za()},onTerminal:Df,onArtifacts:Sa,onExperiments:()=>Zn()}),o==="chat"&&h&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Ps?"max":""}`,style:Ps?void 0:{width:Ar},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Ps?"cursor-e-resize":"cursor-col-resize"}`,title:Ps?Cle():vle(),onPointerDown:n_}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.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:[Ml.map(te),mn&&f.jsx(qc,{active:b==="files",label:c3(),icon:f.jsx(Ou,{size:12,className:"shrink-0"}),onSelect:()=>Yn("files"),onClose:()=>Rl("files")}),Ot&&f.jsx(qc,{active:b==="terminal",label:Tv(),icon:f.jsx(ko,{size:12,className:"shrink-0"}),onSelect:()=>Yn("terminal"),onClose:()=>Rl("terminal")}),Ln&&f.jsx(qc,{active:b==="artifacts",label:wD(),icon:f.jsx(vS,{size:12,className:"shrink-0"}),onSelect:()=>Yn("artifacts"),onClose:()=>Rl("artifacts")}),xn&&f.jsx(qc,{active:b==="experiments",label:kD(),icon:f.jsx(gh,{size:12,className:"shrink-0"}),onSelect:()=>Yn("experiments"),onClose:()=>Rl("experiments")}),Bf.map(Ie)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Ft,{title:Ps?XE():QE(),"aria-label":Ps?XE():QE(),onClick:()=>$t(J=>!J),children:Ps?f.jsx(b5n,{size:14}):f.jsx(m5n,{size:14})}),f.jsx(Ft,{title:A0(),"aria-label":A0(),onClick:()=>{$(),$t(!1)},children:f.jsx(_r,{size:14})})]})]}),b==="terminal"&&Ot?null:!Si||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!be||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Ae?f.jsx(Pa,{children:f.jsx(jt,{})}):Ms&&(!ge||_&&!Ne.some(J=>J.id===_&&J.experimentId===Ms.id))||Dl&&!Ee||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Pa,{children:f.jsx("div",{className:"p-6 text-subtext",children:go()})}):b==="artifacts"?f.jsx(Pa,{children:on&&f.jsx(B$n,{project:on,artifacts:Te,onOpenFile:Yh,canRenameFile:J=>{var he;return!((he=gt.current.get(Bs(on.id,u,{path:J,source:"artifacts"})))!=null&&he.needsProtection)}},on.id)}):b==="experiments"?f.jsxs(Pa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("label",{className:"inline-flex items-center gap-1 text-sm text-subtext",children:[f.jsx("input",{type:"checkbox",checked:_t,onChange:J=>St(J.target.checked)}),w_e()]}),f.jsxs("div",{className:"option-picker relative inline-flex",ref:mt,children:[f.jsx(Ft,{size:"small",ref:un,className:"experiment-scope-trigger",active:Qt==="agent",title:Ule({scope:Qt==="agent"?KE():WE()}),"aria-label":mue(),"aria-expanded":At,onClick:()=>pt(J=>!J),children:f.jsx(X3n,{size:16,strokeWidth:2.5})}),At&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-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:[f.jsxs(Dn,{"aria-pressed":Qt==="agent",disabled:!u||!xr,title:u?xr?void 0:kue():Iue(),onClick:()=>{Zt("agent"),pt(!1)},children:[f.jsx("span",{children:KE()}),Qt==="agent"&&f.jsx(Pi,{size:13})]}),f.jsxs(Dn,{"aria-pressed":Qt==="project",onClick:()=>{Zt("project"),pt(!1)},children:[f.jsx("span",{children:WE()}),Qt==="project"&&f.jsx(Pi,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_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":Yle(),children:[f.jsx("button",{className:He==="table"?"active":"","aria-pressed":He==="table",onClick:()=>nt("table"),children:q_e()}),f.jsx("button",{className:He==="tree"?"active":"","aria-pressed":He==="tree",onClick:()=>nt("tree"),children:X_e()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:He==="tree"?on&&f.jsx(XVn,{experiments:mr,allExperiments:pe,hasArchivedExperiments:Mn.length>0&&gr.length===0,runs:Et,project:on,onOpenView:ri,onOpenCode:Al,onArchive:_s,agentSessionId:Qt==="agent"?u:null,onShowProjectScope:Qh,viewport:qi,onViewportChange:Xn}):f.jsx(EBn,{runs:Et,emptyHint:!_t&&Mn.length>0&&gr.length===0?x3():Qt==="agent"&&pe.length>0?Tue():void 0,experiments:gr,onOpen:(J,he)=>{ri(J.id,"overview",he)},onOpenLogs:(J,he,je)=>{ri(J,"terminal",je,he)},onOpenCode:(J,he)=>{const je=pe.find(Be=>Be.id===J);je&&Al(je.id,je.branchName,"files",he)},onArchive:_s,onCancel:UL})})]}):b==="files"?f.jsx(Pa,{children:on?f.jsx(w$n,{sessionId:u??void 0,project:on,view:Rs,toggled:Eo,onViewChange:Za,onToggledChange:wa,canRenameFile:J=>{var he;return!((he=gt.current.get(Bs(on.id,u,{path:J,source:"repo",sessionId:u??void 0})))!=null&&he.needsProtection)},onOpenFile:(J,he,je,Be)=>bc(J,he,je,void 0,void 0,void 0,Be)},`files:${u??`project:${on.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(qd,{children:f.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:[f.jsx(UI,{size:22}),f.jsx("p",{children:c_e()})]})})})}):$n?f.jsx(Pa,{children:n&&f.jsx(SBn,{remote:e.kind==="ssh",restored:C.current.has(Bs(n,u,$n)),onRestoreActivated:()=>{const J=Bs(n,u,$n);C.current.delete(J),z.current.add(J)},showSource:E.current[Bs(n,u,$n)]??!1,onShowSourceChange:J=>{E.current[Bs(n,u,$n)]=J,j(he=>he+1)},projectId:n,path:$n.path,source:$n.source,sessionId:$n.source==="artifacts"?u??void 0:$n.sessionId,gitRef:$n.ref,line:$n.line,branchLabel:JVn($n,on==null?void 0:on.baselineBranch),artifactVersion:To,artifactEntries:$n.source==="artifacts"?Te==null?void 0:Te.entries:void 0,bufferSession:Zr(Bs(n,u,$n)),onOpenFile:(J,he,je,Be)=>si($n,()=>bc(J,he,je,void 0,void 0,void 0,Be)),scrollPosition:Ke.current.get(Bs(n,u,$n)),onScrollPositionChange:J=>{Ke.current.set(Bs(n,u,$n),J),Ja()},lineScrollRequest:$n.lineScrollRequest,onLineScrollRequestHandled:()=>no($n),onEdit:()=>ki($n)},Bs(n,u,$n))}):hs?f.jsx(Pa,{children:f.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:f.jsx(nc,{text:(Ao==null?void 0:Ao.key)===`${hs.sessionId}:${hs.promptId}`?Ao.text??go():((hn=Wn.find(J=>J.promptId===hs.promptId))==null?void 0:hn.plan)||SD(),onOpenFile:(J,he,je,Be,Me)=>si(hs,()=>bc(J,hs.sessionId,Be,he,je,void 0,Me))})})}):Cs?f.jsx(o$n,{projectId:n,sessionId:Cs.sessionId,spawnPartId:Cs.spawnPartId,onOpenFile:(J,he,je,Be,Me)=>si(Cs,()=>e_(J,Cs.sessionId,he,je,Be,Me)),onOpenRun:(J,he)=>si(Cs,()=>gc(J,he)),runExperimentName:Lf,onOpenExperiment:(J,he)=>si(Cs,()=>Ju(J,he)),experimentName:Cl,onOpenSubagent:(J,he,je)=>si(Cs,()=>Na(Cs.sessionId,J,he,je))},Cs.spawnPartId):Es?f.jsx(Pa,{children:n&&on&&Es&&Ee&&f.jsx(x$n,{projectId:n,project:on,experiment:Ee,view:Es.view,toggled:Es.toggled,onViewChange:J=>t_(Es,{view:J}),onToggledChange:J=>t_(Es,{toggled:J}),onOpenFile:(J,he,je,Be)=>si(Es,()=>bc(J,he,je,void 0,void 0,Ee.branchName,Be))},`code:${Es.branch}`)}):f.jsx(Pa,{children:Ms&&ge&&on&&f.jsx(J$n,{experiment:ge,project:on,view:Ms.view,runs:Ne,selectedRunId:_,onSelectRun:q,parentExperiment:pe.find(J=>J.id===ge.parentExperimentId)??null,onOpenView:(J,he,je)=>{si(Ms,()=>ri(ge.id,J,je,he))},onOpenCode:(J,he)=>si(Ms,()=>Al(ge.id,ge.branchName,J,he))},`${Ms.id}:${Ms.view}`)}),Ot&&zr!==null&&zr===jo&&on&&f.jsx(Pa,{className:b==="terminal"?void 0:"hidden",children:f.jsx(Q8n,{projectId:on.id,sessionId:u,active:b==="terminal"},jo)})]})]}),Wr&&f.jsx(m$,{remote:e.kind==="ssh",onClose:()=>Ui(!1),onCreated:(J,he)=>{Ui(!1),tp(J,he)}}),Mf&&on&&Vc(on.id)&&f.jsx(NBn,{onClose:to,onCreateProject:Of})]})}const yk=sc()({validateSearch:e=>({pane:SS(e.pane)}),beforeLoad:({location:e})=>{if(!cf(e.pathname))throw BK()},component:sKn});function sKn(){const{projectId:e}=yk.useParams(),{pane:n}=yk.useSearch(),t=pi(),r=_D({select:s=>s.location});return A.useEffect(()=>{const s=iKn(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(z0,{}),f.jsx(rKn,{projectId:e,pane:n,runtime:u$()},e)]})}function iKn(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&SS(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const iG=sc()({component:aKn});function aKn(){const{projectId:e}=iG.useParams();return f.jsx(g6n,{projectId:e})}const oKn=sc()({}),cKn=sc()({}),lKn=sc()({}),uKn=sc()({}),_Kn=b6n.update({id:"/",path:"/",getParentRoute:()=>Ub}),IC=y6n.update({id:"/projects",path:"/projects",getParentRoute:()=>Ub}),fKn=x6n.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>Ub}),dKn=w6n.update({id:"/",path:"/",getParentRoute:()=>IC}),Wh=yk.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>IC}),hKn=iG.update({id:"/",path:"/",getParentRoute:()=>Wh}),pKn=oKn.update({id:"/skills",path:"/skills",getParentRoute:()=>Wh}),mKn=cKn.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>Wh}),gKn=lKn.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>Wh}),vKn=uKn.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>Wh}),bKn={ProjectsProjectIdSkillsRoute:pKn,ProjectsProjectIdIndexRoute:hKn,ProjectsProjectIdSettingsTabRoute:mKn,ProjectsProjectIdTasksSessionIdRoute:gKn,ProjectsProjectIdTasksNewRoute:vKn},yKn=Wh._addFileChildren(bKn),xKn={ProjectsProjectIdRoute:yKn,ProjectsIndexRoute:dKn},wKn=IC._addFileChildren(xKn),kKn={IndexRoute:_Kn,ProjectsRoute:wKn,RemoteLaunchRoute:fKn},SKn=Ub._addFileChildren(kKn)._addFileTypes(),CKn=oQ({routeTree:SKn,context:{queryClient:Je},trailingSlash:"never",defaultPendingComponent:_6,defaultErrorComponent:f6,defaultNotFoundComponent:p6n}),aG=N();document.documentElement.lang=aG;document.documentElement.dir="ltr";eI(aG);pK.createRoot(document.getElementById("root")).render(f.jsxs(A.StrictMode,{children:[f.jsx(jV,{client:Je,children:f.jsx(uQ,{router:CKn})}),f.jsx(Q4n,{})]}));export{ac as C,Ft as I,ub as M,$h as P,YI as S,x5n as a,WN as b,ot as c,Ur as d,E$n as e,tn as f,N as g,Fi as h,QN as i,f as j,A as r}; +`)+1)}let q=[];try{q=$.trim()?J3($):[]}catch{return null}if(I.truncated&&q.every(V=>V.hunks.length===0))return null;let H=0,Q=0;for(const V of q){const Z=_y(V);H+=Z.additions,Q+=Z.deletions}return{fileCount:q.length,additions:H,deletions:Q,truncated:I.truncated}},[v]),x={done:0,failed:0,cancelled:0,live:0};for(const I of n)I.status==="done"?x.done+=1:I.status==="failed"?x.failed+=1:I.status==="cancelled"?x.cancelled+=1:x.live+=1;const y=t?R0((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,z=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,N=A.useRef(null),[T,j]=A.useState(!1),[M,D]=A.useState(!1);return A.useEffect(()=>{j(!1)},[z]),A.useEffect(()=>{const I=N.current;I&&D(I.scrollHeight>I.clientHeight+1)},[z,T]),gi.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.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-border-hover-strong [&_.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-sm [&_.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]: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-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:R4,left:m,top:w,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:c,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx(cl,{status:t?la(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Gr(i),children:[f.jsx(ko,{size:13}),rDe()]}),f.jsxs("button",{type:"button",...Gr(a),children:[f.jsx(Bb,{size:13}),LOe()]})]}),z&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:z}),z&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(I=>!I),children:T?OD():Ije()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(E(),{style:"short"}).format([n.length===1?mYe():kYe({count:tn(n.length)}),...x.done>0?[zXe({count:tn(x.done)})]:[],...x.failed>0?[DXe({count:tn(x.failed)})]:[],...x.cancelled>0?[xXe({count:tn(x.cancelled)})]:[],...x.live>0?[nYe({count:tn(x.live)})]:[]])}),t&&oS(t.backend)&&f.jsx(RS,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:wo(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(zm,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[XOe()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?TX({parent:Ce(r??"parent")}):kX({parent:Ce(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?lYe():b.truncated?QXe({count:tn(b.fileCount)}):HXe({count:tn(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[qOe()," ",IVn(e.createdAt)]})]})]}),document.body)}const YM=["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-sm [&_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(" "),BVn=264,ZM=132,_v=44,PVn=72,FVn=148,HVn=44;function qVn(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function UVn(e,n){const t=new Map,r=o=>{const c=t.get(o)??1+o.children.reduce((u,h)=>u+r(h),0);return t.set(o,c),c},s=new Map,i=o=>{const c=s.get(o)??(n(o)||o.children.some(i));return s.set(o,c),c};function a(o){if(n(o)){const h=[];let _=0;for(const p of o.children)i(p)?h.push(...a(p)):_+=r(p);return _>0&&h.push({kind:"elided",id:`el-${o.exp.id}`,count:_,children:[]}),[{kind:"exp",exp:o.exp,children:h}]}if(!i(o))return[];let c=0;const u=[];return(function h(_){c+=1;for(const p of _.children)n(p)?u.push(...a(p)):i(p)?h(p):c+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:c,children:u}]}return e.flatMap(a)}function bk(e){return e.kind==="exp"?BVn:FVn}function P1(e){return e.kind==="exp"?e.exp.id:e.id}function fv(e){if(e.children.length===0)return bk(e);const n=e.children.reduce((t,r)=>t+fv(r),0)+_v*(e.children.length-1);return Math.max(bk(e),n)}function GVn(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const VVn=A.memo(function({data:n}){wf();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:c,onOpenView:u,onOpenCode:h,onArchive:_}=n,p=r?la(r):void 0,m=p==="running"||p==="starting"||p==="cancelling",w=i?jpn():m?T0n():Wc(),k=s.slice(-8),v=A.useRef(null),b=LVn(v,n);return f.jsxs("div",{ref:v,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.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-start [&_.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-xs [&_.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]: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-xs [&_.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-sm [&_.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]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${m?"live":""} ${t.archived?"opacity-80":""}`,onMouseEnter:b.onMouseEnter,onMouseLeave:b.onMouseLeave,children:[f.jsx(Fu,{type:"target",position:Dt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Gr(x=>u(t.id,"overview",x)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:t.archived?IL():w}),f.jsx(cl,{status:p??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:$mn()}),k.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:k.map(x=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${GVn(la(x))}`,title:h6(la(x))},x.id))}):f.jsx("span",{children:Smn()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:wo(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:x=>x.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:Amn(),...Gr(x=>u(t.id,"terminal",x)),children:[f.jsx(ko,{size:13}),$L()]}),f.jsxs("button",{className:"node-action",title:bD({branch:Ce(t.branchName)}),...Gr(x=>h(t.id,t.branchName,"files",x)),children:[f.jsx(Bb,{size:13}),Y0n()]}),f.jsx(gq,{id:t.id,name:t.slug,hasParent:!!t.parentExperimentId,onArchive:_,compact:!0}),o&&c&&f.jsx("a",{className:"node-action node-action-ext",title:Cv({name:Ce(t.branchName)}),"aria-label":Cv({name:Ce(t.branchName)}),href:Ob(o,c,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:x=>x.stopPropagation(),children:f.jsx(Gb,{size:13})})]}),f.jsx(Fu,{type:"source",position:Dt.Bottom}),b.rect&&f.jsx($Vn,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:b.rect,onOpenLogs:s.length>0?x=>u(t.id,"terminal",x):void 0,onOpenCode:x=>h(t.id,t.branchName,"files",x),onMouseEnter:b.keepOpen,onMouseLeave:b.onMouseLeave})]})}),KVn=A.memo(function({data:n}){wf();const{count:t,onRevealHidden:r}=n;return f.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-hover-faint text-muted text-sm font-medium text-start 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:k0n(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(Fu,{type:"target",position:Dt.Top}),f.jsx(Ib,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?n0n():Hpn({count:tn(t)}),f.jsx("span",{className:"elided-node-sub",children:Qpn()})]}),f.jsx(Fu,{type:"source",position:Dt.Bottom})]})}),WVn={exp:VVn,elided:KVn},sG={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},QVn={...sG.style,strokeDasharray:"4 4"};function XVn({experiments:e,hasArchivedExperiments:n,allExperiments:t,runs:r,project:s,onOpenView:i,onOpenCode:a,onArchive:o,agentSessionId:c,onRevealHidden:u,viewport:h,onViewportChange:_}){const{nodes:p,edges:m}=A.useMemo(()=>{const w=new Map;for(const T of r){const j=w.get(T.experimentId);j?j.push(T):w.set(T.experimentId,[T])}for(const T of w.values())T.sort((j,M)=>j.createdAt-M.createdAt);const k=[],v=[],b=new Set(e.map(T=>T.id)),x=T=>b.has(T.exp.id)&&(!c||T.exp.chatSessionId===c),y=UVn(qVn(t),x),C=new Map(t.map(T=>[T.id,T.slug]));function z(T,j,M){const D=j-bk(T)/2;if(T.kind==="exp"){const q=w.get(T.exp.id)??[];k.push({id:T.exp.id,type:"exp",position:{x:D,y:M},data:{exp:T.exp,latestRun:q[q.length-1]??null,runs:q,isBaseline:!T.exp.parentExperimentId,parentSlug:T.exp.parentExperimentId?C.get(T.exp.parentExperimentId)??null:null,githubOwner:s.githubEnabled?s.githubOwner:"",githubRepo:s.githubEnabled?s.githubRepo:"",onOpenView:i,onOpenCode:a,onArchive:o}})}else k.push({id:T.id,type:"elided",position:{x:D,y:M+(ZM-HVn)/2},data:{count:T.count,onRevealHidden:u}});if(T.children.length===0)return;const I=T.children.reduce((q,H)=>q+fv(H),0)+_v*(T.children.length-1);let $=j-I/2;for(const q of T.children){const H=fv(q),Q=T.kind==="elided"||q.kind==="elided";v.push({id:`e-${P1(T)}-${P1(q)}`,source:P1(T),target:P1(q),...Q?{style:QVn}:{}}),z(q,$+H/2,M+ZM+PVn),$+=H+_v}}let N=0;for(const T of y){const j=fv(T);z(T,N+j/2,0),N+=j+_v}return{nodes:k,edges:v}},[e,t,r,i,a,o,s.githubOwner,s.githubRepo,s.githubEnabled,c,u]);return e.length===0?f.jsxs("div",{className:YM,children:[f.jsx("p",{className:"empty-state-title",children:n?x3():gmn()}),!n&&f.jsx("p",{className:"empty-state-hint",children:U0n()})]}):p.length===0&&c?f.jsxs("div",{className:YM,children:[f.jsx("p",{className:"empty-state-title",children:n?x3():umn()}),!n&&f.jsx("p",{className:"empty-state-hint",children:I0n()})]}):f.jsx(sVn,{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:p,edges:m,nodeTypes:WVn,defaultEdgeOptions:sG,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:DVn,onMoveEnd:(w,k)=>{w&&_(k)},minZoom:.15,defaultViewport:h??void 0,fitView:h===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(lVn,{variant:ul.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},c??"project")}const t0=["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-sm [&_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(" ");function YVn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ZVn(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),c=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/")||E6(i))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[w,k]=[m(i),m(p)];return w===k?"":w.startsWith(`${k}/`)?w.slice(k.length).replace(/^\/+/,""):null},h=i.startsWith("/")&&c?u(c):null,_=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(h!==null)return h?{path:h,source:"artifacts"}:null;if(_!==null)i=_;else{const p=s?YVn(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),w=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),k=m||w?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};w?(a=w[1],i=w[2]):k&&(i=k[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function JVn(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const eKn=10,JM=1448,tKn=80,nKn=48;function eO(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function tO(e){const n=A.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function rKn({runtime:e,projectId:n,pane:t}){var Yt,vn,hn;const r=dn({mutationFn:Qbn}),s=pi(),i=_D({select:J=>J.location}),a=cf(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",c=A.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:c.current;(a==null?void 0:a.kind)==="task"&&(c.current=u);const h=t!==void 0,_=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=A.useState(null),[w,k]=A.useState(0),v=A.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==w)&&(v.current={href:i.href,jump:w,value:v.current.value+1});const b=A.useMemo(()=>{const J=t?fo(t):"experiments";return typeof J=="object"&&"path"in J&&J.line&&p!==v.current.value?{...J,lineScrollRequest:v.current.value}:J},[t,p,i.href,w]),x=ut(Ga(n)),y=A.useMemo(()=>{var J;return((J=x.data)==null?void 0:J.map(he=>he.id))??null},[x.data]),C=A.useRef(new Set),z=A.useRef(new Set),N=A.useRef({}),[T,j]=A.useState(0),M=A.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const D=A.useCallback((J,he=!1)=>{const je=M.current;je.projectId&&s.navigate({href:X1(je.projectId,je.activeSessionId,J),replace:he})},[s]),I=A.useCallback(J=>{const he=rl(J);D(he.kind==="file"?{...he,line:void 0}:he)},[D]),$=A.useCallback(()=>D(void 0),[D]),q=A.useCallback(J=>{(t==null?void 0:t.kind)==="experiment"&&D({...t,runId:J??void 0})},[t,D]),H=A.useCallback(J=>{s.navigate({href:J?`/projects/${encodeURIComponent(J)}`:"/projects"})},[s]),Q=A.useCallback(J=>{var he;if(n)if(J==="chat"){const je=c.current;s.navigate({href:X1(n,je,(he=Tu(Ki.current,je??"new"))==null?void 0:he.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${J==="skills"?"skills":`settings/${J}`}`})},[s,n]),V=wf(),{status:Z}=u6(e.kind==="local"),Y=A.useMemo(()=>hh(),[n]),B=ut(Y),L=B.data??null,F=A.useCallback(J=>{Yr(Y.queryKey,he=>(typeof J=="function"?J(he??null):J)??void 0)},[Y]),U=A.useMemo(()=>Em(),[n]),K=ut(U),ne=K.data??null,oe=A.useCallback(J=>{Yr(U.queryKey,he=>(typeof J=="function"?J(he??null):J)??void 0)},[U]),ue=A.useRef(void 0);ue.current=ne==null?void 0:ne.tourCompleted;const se=[!x.data&&x.error?CD():null,!B.data&&B.error?f0():null,!K.data&&K.error?p_e():null].filter(J=>J!==null),G=se.length?j_e({items:new Intl.ListFormat(V).format(se)}):null,ae=A.useRef(null),ce=ut(Lv(n)),pe=ce.data??[],be=!ce.isPending,[Ae,De]=A.useState(!1),Ne=ut(Eu(n)).data??[],xe=A.useRef(Ne);xe.current=Ne;const rt=A.useRef(new Map),Ze=A.useRef(new Set),ct=A.useRef(null),Ct=A.useRef(!1),qt=A.useRef(new Map),dt=A.useRef(new Map),ht=A.useRef(0),Le=A.useRef(pe);Le.current=pe;const Te=ut(S6n(n)).data??null,[He,nt]=A.useState("table"),[_t,kt]=A.useState(!1),[yt,Zt]=A.useState("project"),un=A.useRef(null),{open:At,setOpen:pt,ref:mt}=Xa(un),[_n,us]=A.useState(!1),xr=pe.every(J=>J.chatSessionId),Qt=u&&xr?yt:"project",Mn=A.useMemo(()=>Qt!=="agent"?pe:pe.filter(J=>J.chatSessionId===u),[pe,Qt,u]),mr=A.useMemo(()=>pe.filter(J=>_t||!J.archived),[pe,_t]),gr=A.useMemo(()=>Mn.filter(J=>_t||!J.archived),[Mn,_t]),_s=A.useCallback(async(J,he,je)=>{try{await uyn(J,he,je),await Je.invalidateQueries({queryKey:Lv(n).queryKey})}catch(Be){bn(Be instanceof Error?Be.message:String(Be),"error")}},[n]),Et=A.useMemo(()=>{if(Qt!=="agent")return Ne;const J=new Set(Mn.map(he=>he.id));return Ne.filter(he=>J.has(he.experimentId))},[Ne,Mn,Qt]),[fn,an]=A.useState([]),[xn,Ir]=A.useState(!1),[mn,gn]=A.useState(!1),[Ln,Nt]=A.useState(!1),[Ot,Hn]=A.useState(!1),[zr,nr]=A.useState(null),[On,hr]=A.useState([]),[jr,In]=A.useState([]),Ke=A.useRef(new Map),gt=A.useRef(new Map),Zr=J=>{let he=gt.current.get(J);return he||(he=new sBn,gt.current.set(J,he)),he},[Wn,wn]=A.useState([]),[Qn,rr]=A.useState([]),[As,Tr]=A.useState([]),[cr,xl]=A.useState([]),[Ya,Jr]=A.useState(null),[Rs,Za]=A.useState("files"),[Eo,wa]=A.useState(new Set),[Ps,$t]=A.useState(!1),[qi,Xn]=A.useState(null),[Ar,st]=A.useState(d$),[Jt,bi]=A.useState(()=>window.innerWidth>=JM),yi=o==="chat"&&!h&&Jt,[xi,Kr]=A.useState(!0),[Wr,Ui]=A.useState(!1),Gi=A.useRef(zS()),Fs=A.useRef(u);Fs.current=u;const Rr=A.useRef(fn);Rr.current=fn;const ei=A.useRef(cr);ei.current=cr;const wi=A.useRef(null),Vt=A.useCallback(J=>{const he=[...J];ei.current=he,xl(he)},[]),ki=A.useCallback(J=>{wi.current=J,Jr(J)},[]),dc=A.useCallback(J=>{const he=Lt(J);hr(Me=>qp(Me,he)),In(Me=>qp(Me,he)),wn(Me=>qp(Me,he)),rr(Me=>qp(Me,he)),Tr(Me=>qp(Me,he));const je=Qi.current;if(je&&"path"in J){const Me=Bs(je,Fs.current,J);Ke.current.delete(Me),gt.current.delete(Me),z.current.delete(Me),C.current.delete(Me)}const Be=Rr.current.filter(Me=>Lt(Me)!==he);Rr.current=Be,an(Be)},[]),Yn=A.useCallback(J=>{const he=Lt(J),je=[...Rr.current.filter(Be=>Lt(Be)!==he),c1(J)];Rr.current=je,an(je),I(J)},[I]),es=A.useCallback((J,he,je)=>{const Be=Lt(J),Me=wi.current,it=uDn({order:ei.current,previewKey:Me?Lt(Me):null},Be,he);it.replacedKey&&Me&&typeof Me!="string"&&Lt(Me)===it.replacedKey&&dc(Me),Vt(it.order),it.previewKey===null?ki(null):it.previewKey===Be&&ki(c1(J));const at=[...Rr.current.filter(Bt=>Lt(Bt)!==Be),c1(J)];Rr.current=at,an(at),D(rl(J,je))},[dc,Vt,ki,D]),Si=A.useCallback(J=>{const he=wi.current;he&&Lt(he)===Lt(J)&&ki(null)},[ki]);A.useEffect(()=>{let J=!1;const he=Be=>{const Me=wi.current,it=Be.target;if(it instanceof Element&&it.closest("input, textarea, [contenteditable='true']")!==null){J=!1;return}if(Me&&Lt(Me)===Lt(Gi.current.rightTab)&&(Be.metaKey||Be.ctrlKey)&&!Be.altKey&&!Be.shiftKey&&Be.key.toLowerCase()==="k"){Be.preventDefault(),J=!0;return}if(J&&Be.key==="Enter"){Be.preventDefault(),J=!1;const Bt=wi.current;Bt&&Si(Bt);return}J=!1},je=()=>{J=!1};return window.addEventListener("keydown",he),window.addEventListener("blur",je),window.addEventListener("pointerdown",je),()=>{window.removeEventListener("keydown",he),window.removeEventListener("blur",je),window.removeEventListener("pointerdown",je)}},[Si]);const ks=A.useCallback((J,he)=>{const je=Lt(J),Be=wi.current;Be&&Lt(Be)===je&&ki(null);const Me=_Dn({order:ei.current,previewKey:Be?Lt(Be):null},je,Rr.current.map(Lt));Vt(Me.order);const it=Rr.current.filter(Bt=>Lt(Bt)!==je);if(Rr.current=it,an(it),!he)return;const at=Me.fallbackKey?it.find(Bt=>Lt(Bt)===Me.fallbackKey):void 0;at?I(at):($(),$t(!1))},[Vt,ki,I,$]),Vi=Q,Hs=A.useMemo(()=>({rightTab:c1(b),tabHistory:fn,experimentsTabOpen:xn,filesTabOpen:mn,artifactsTabOpen:Ln,terminalTabOpen:Ot,expTabs:On,fileTabs:jr,planTabs:Wn,subagentTabs:Qn,codeTabs:As,contentTabOrder:ei.current,previewTab:wi.current,filesView:Rs,filesToggled:Eo,selectedRunId:_,scope:yt,panelOpen:h,panelMax:Ps,treeViewport:qi}),[b,fn,xn,mn,Ln,Ot,On,jr,Wn,Qn,As,cr,Ya,Rs,Eo,_,yt,h,Ps,qi]);Gi.current=Hs;const Qu=A.useCallback(()=>Object.fromEntries(Ke.current),[]),hc=A.useRef(void 0),Ja=A.useCallback(()=>{clearTimeout(hc.current),hc.current=setTimeout(()=>j(J=>J+1),200)},[]);A.useEffect(()=>()=>clearTimeout(hc.current),[]);const No=A.useCallback((J,he,je)=>{if(an(J.tabHistory),Rr.current=J.tabHistory,Ir(J.experimentsTabOpen),gn(J.filesTabOpen),Nt(J.artifactsTabOpen),Hn(J.terminalTabOpen),hr(J.expTabs),In(J.fileTabs),wn(Me=>Me===J.planTabs?Me:J.planTabs.map(it=>{var at;return{...it,plan:((at=Me.find(Bt=>Bt.sessionId===it.sessionId&&Bt.promptId===it.promptId))==null?void 0:at.plan)??""}})),rr(J.subagentTabs),Tr(J.codeTabs),Vt(J.contentTabOrder),ki(J.previewTab),Za(J.filesView),wa(J.filesToggled),Zt(J.scope),$t(J.panelMax),Xn(J.treeViewport),us(M.current.activeSessionId===Id&&J.fileTabs.some(Me=>b_(Me,{path:iw,source:"artifacts"}))),je){for(const[Me,it]of Object.entries((he==null?void 0:he.scroll)??{}))Ke.current.set(Me,it);Object.assign(N.current,he==null?void 0:he.sourceModes)}const Be=M.current;if(Be.projectId)for(const Me of J.fileTabs){const it=Bs(Be.projectId,Be.activeSessionId,Me);z.current.has(it)||C.current.add(it)}},[Vt,ki]),{ready:Ci,loaded:Xu,error:zo,retry:qs,capture:fs,workspace:Ki}=Akn({projectId:ne&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",firstDemoOpen:(ne==null?void 0:ne.tourCompleted)===!1,state:Hs,apply:No,getScroll:Qu,sourceModes:N.current,revision:T}),ka=A.useRef(null);A.useLayoutEffect(()=>{if(!Ci||!be||(a==null?void 0:a.kind)!=="task")return;const J=ka.current;(J==null?void 0:J.projectId)===n&&J.taskId===u&&J.scope!==Qt&&Xn(null),ka.current={projectId:n,taskId:u,scope:Qt}},[Ci,be,a==null?void 0:a.kind,n,u,Qt]);const pr=A.useCallback((J,he)=>{var Bt;const je=(he==null?void 0:he.projectId)??n;if(!je)return;const Be=je===n;J&&Be&&he!=null&&he.replace&&u===null&&(fs(),jkn(je,J));const Me=Tu(l$(je),J??"new"),it=Me?Me.active:Vc(je)?(Bt=jS(J??void 0,ue.current===!1))==null?void 0:Bt.active:void 0,at=Be&&(he!=null&&he.replace)&&J&&u===null?M.current.pane:it;s.navigate({href:X1(je,J,at),replace:Be&&(he==null?void 0:he.replace)})},[s,n,u,fs]);A.useEffect(()=>{Ci&&(a==null?void 0:a.kind)!=="task"&&!c.current&&Ki.current.lastTaskId&&(y!=null&&y.includes(Ki.current.lastTaskId))&&(c.current=Ki.current.lastTaskId,j(J=>J+1))},[Ci,a==null?void 0:a.kind,Ki,y]),fQ({shouldBlockFn:({next:J})=>{var he;return((he=cf(J.pathname))==null?void 0:he.projectId)!==n&&[...gt.current.values()].some(je=>je.needsProtection)&&!FR($N())},enableBeforeUnload:()=>[...gt.current.values()].some(J=>J.needsProtection)});const pc=A.useRef(null);A.useEffect(()=>{const J=Pb(i.href);!ne||!Ci||!J||(qb.queue({lastLocation:J,railOpen:xi,panelWidth:Ar,experimentsView:He},pc.current===J?250:0),pc.current=J)},[i.href,ne,Ci,xi,Ar,He]);const sr=(ne==null?void 0:ne.onboardingCompleted)??!1,[Mf,mc]=A.useState(!1),[wl,Ei]=A.useState(null),[ds,eo]=A.useState(0),Wi=A.useCallback(()=>mc(!0),[]),to=A.useCallback(async J=>{const he=ue.current===!1,je=await r.mutateAsync({tourCompleted:!0});he&&du({name:"demo_welcome_choice",choice:J}),oe(Be=>Be&&{...Be,tourCompleted:je.tourCompleted}),mc(!1),J==="explore_demo"&&eo(Be=>Be+1)},[]),Of=A.useCallback(async()=>{await to("create_project"),Ui(!0)},[to]);A.useEffect(()=>{!n||!Vc(n)||!sr||ne!=null&&ne.tourCompleted||Wi()},[n,sr,Wi,ne==null?void 0:ne.tourCompleted]);const on=(L==null?void 0:L.find(J=>J.id===n))??null;A.useEffect(()=>{const J=G||ne===null?null:on==null?void 0:on.name;document.title=J?`${ia(J)} — OpenResearch`:"OpenResearch"},[G,ne,on]);const Qi=A.useRef(n);Qi.current=n;const ti=A.useCallback(J=>{n&&du({name:"first_action",surface:Vc(n)?"demo":"project",action:J})},[n]);A.useEffect(()=>{o!=="chat"&&o!=="skills"&&ti("open_settings")},[o,ti]);const Zn=A.useCallback((J=!1)=>{J&&(!M.current.isTask||M.current.pane)||(ti("open_experiment"),Ir(!0),D({kind:"home",view:"experiments"},J))},[D,ti]),Yu=()=>{B.refetch(),K.refetch(),x.refetch()},Ss=A.useRef(!1);A.useEffect(()=>{if(!ne||Ss.current)return;Ss.current=!0,ae.current=ne.preferredAgent;const J=ES()??ne.workspace;J&&(Kr(J.railOpen),st(Math.min(J.panelWidth,i0())),nt(J.experimentsView))},[ne]),A.useEffect(()=>{y&&c.current&&!y.includes(c.current)&&(c.current=null)},[y]);const ni=A.useRef(Promise.resolve()),Ni=A.useRef(0),kl=A.useCallback(J=>{const he=++Ni.current;oe(Be=>Be&&{...Be,preferredAgent:J});const je=ni.current.then(()=>r.mutateAsync({preferredAgent:J})).then(Be=>{ae.current=Be.preferredAgent,he===Ni.current&&oe(Me=>Me&&{...Me,preferredAgent:Be.preferredAgent})}).catch(Be=>{throw he===Ni.current&&oe(Me=>Me&&{...Me,preferredAgent:ae.current}),Be});return ni.current=je.catch(()=>{}),je},[]);A.useEffect(()=>{const J=()=>{st(he=>Math.min(he,i0())),bi(window.innerWidth>=JM)};return window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]);const Zu=A.useCallback(J=>{Ct.current=!1,qt.current.clear(),dt.current.clear();const he=++ht.current;Je.fetchQuery(Eu(J)).then(je=>{if(Qi.current!==J||ct.current!==J||ht.current!==he)return;qt.current=new Map(je.map(Me=>[Me.id,Me]));const Be=[...dt.current.values()].some(Me=>{const it=qt.current.get(Me.id);return!it||it.status!=="running"&&it.updatedAt<=Me.updatedAt});dt.current.clear();for(const Me of je){const it=rt.current.get(Me.id);(!it||it.updatedAt{var it;return je.some(at=>at.id===Me&&at.status==="running")?Me:((it=je.find(at=>at.status==="running"))==null?void 0:it.id)??null}),Be&&Zn(!0)}).catch(()=>{ht.current===he&&(dt.current.clear(),De(!0))})},[Zn]);A.useEffect(()=>{if(n)return ct.current=n,rt.current.clear(),Ze.current.clear(),oyn(n).catch(()=>{}),Zu(n),()=>{ht.current++}},[Zu,n]);const Sa=A.useCallback(()=>{Nt(!0),Yn("artifacts")},[Yn]),Df=A.useCallback(()=>{Hn(!0),Yn("terminal")},[Yn]),jo=u??(n?`project:${n}`:null);A.useEffect(()=>{nr(h?b==="terminal"?jo:J=>J===jo?J:null:null)},[h,b,jo]),awn({onReconnect:()=>{const J=Qi.current;J&&(ct.current=J,rt.current.clear(),Ze.current.clear(),Zu(J))},onRun:J=>{if(J.projectId!==Qi.current||J.projectId!==ct.current)return;const he=rt.current.get(J.id),je=Ze.current.has(J.id);if(he&&he.updatedAt>J.updatedAt||(rt.current.set(J.id,J),Ze.current.add(J.id),Vc(J.projectId)&&Ei(it=>J.status==="running"?it??J.id:it===J.id?null:it),J.status!=="running"||(he==null?void 0:he.status)==="running"))return;const Be=qt.current.get(J.id),Me=Ct.current&&(!Be||Be.status!=="running"&&Be.updatedAt<=J.updatedAt);je&&he||Me?Zn(!0):Ct.current||dt.current.set(J.id,J)}});const Qh=A.useCallback(()=>Zt("project"),[]),ri=A.useCallback((J,he="overview",je="preview",Be)=>{ti("open_experiment");const Me={id:J,view:he};hr(it=>it.some(at=>fw(at,Me))?it:[...it,Me]),es(Me,je,Be)},[es]),gc=A.useCallback((J,he="preview")=>{const je=xe.current.filter(Me=>Me.id===J||Me.id.startsWith(J)),Be=je.length===1?je[0]:null;Be&&ri(Be.experimentId,"terminal",he,Be.id)},[ri]),Xh=A.useMemo(()=>new Map(pe.map(J=>{var he;return[J.id,((he=J.title)==null?void 0:he.trim())||J.slug||Wc()]})),[pe,V]),vc=tO(Xh),Sl=A.useMemo(()=>{const J=new Map;for(const he of Ne)J.set(he.id,vc.get(he.experimentId)??Wc());return J},[vc,Ne,V]),Ca=tO(Sl),Lf=A.useCallback(J=>{const he=Ca.get(J);if(he)return he;const je=[...Ca].filter(([Be])=>Be.startsWith(J));return je.length===1?je[0][1]:""},[Ca]),Cl=A.useCallback(J=>{const he=vc.get(J);if(he)return he;const je=[...vc].filter(([Be])=>Be.startsWith(J));return je.length===1?je[0][1]:""},[vc]),Ju=A.useCallback((J,he="preview")=>{const je=Le.current.filter(Be=>Be.id===J||Be.id.startsWith(J));je.length===1&&ri(je[0].id,"overview",he)},[ri]),El=A.useCallback(J=>{const he=On.findIndex(je=>fw(je,J));he!==-1&&(hr(je=>je.filter((Be,Me)=>Me!==he)),ks(J,Lt(b)===Lt(J)))},[On,ks,b]),Ea=A.useCallback((J,he="preview")=>{J.line!=null&&k(Me=>Me+1);const je=Qi.current;if(je){const Me=Bs(je,Fs.current,J);Gi.current.fileTabs.some(it=>b_(it,J))||C.current.delete(Me),z.current.add(Me)}const Be=o$(J);In(Me=>{const it=Me.findIndex(Bt=>b_(Bt,J));if(it===-1)return[...Me,Be];const at=Me.slice();return at[it]=Be,at}),es(J,he)},[es]),Nl=A.useCallback((J,he,je,Be,Me,it)=>{const at=L==null?void 0:L.find(ps=>ps.id===n),Bt=ZVn(J,at==null?void 0:at.repoPath,he,(at==null?void 0:at.artifactsDir)??(at==null?void 0:at.filesDir),at==null?void 0:at.slug);if(!Bt)return null;const Kt=Me?Le.current.find(ps=>ps.id===Me||Me.length>=6&&ps.id.startsWith(Me)):void 0,Ns=je??(Kt==null?void 0:Kt.branchName),Os=Bt.source==null||Bt.source==="repo";return Ns&&Os&&(Bt.ref=Ns),it&&!Bt.ref&&Os&&(Bt.branchLabel=it),Be!=null&&(Bt.line=Be),Bt},[L,n]),bc=A.useCallback((J,he,je,Be,Me,it,at="preview")=>{const Bt=Nl(J,he,je,Be,Me,it);Bt&&Ea(Bt,at)},[Ea,Nl]),Yh=A.useCallback(J=>Ea({path:J,source:"artifacts"},"keepOpen"),[Ea]),e_=A.useCallback((J,he,je,Be,Me,it="preview")=>{const at=Nl(J,he,Me,je,Be);at&&Ea(at,it)},[Ea,Nl]),si=A.useCallback((J,he)=>{Si(J),he()},[Si]),Zh=A.useCallback(J=>{var Be;const he=jr.findIndex(Me=>b_(Me,J));if(he===-1)return;const je=n?Bs(n,u,J):null;je&&((Be=gt.current.get(je))!=null&&Be.needsProtection)&&!FR($N())||(In(Me=>Me.filter((it,at)=>at!==he)),je&&(Ke.current.delete(je),gt.current.delete(je),z.current.delete(je),C.current.delete(je),delete N.current[je]),u===Id&&b_(J,{path:iw,source:"artifacts"})&&us(!1),ks(J,Lt(b)===Lt(J)))},[u,jr,ks,n,b]),no=A.useCallback(J=>{J.lineScrollRequest!==void 0&&m(J.lineScrollRequest)},[]),Jh=A.useCallback((J,he,je,Be="preview")=>{const Me={kind:"plan",sessionId:he,promptId:je,plan:J};wn(it=>{const at=it.findIndex(Kt=>Kt.promptId===je);if(at===-1)return[...it,Me];const Bt=it.slice();return Bt[at]=Me,Bt}),es(Me,Be)},[es]),zl=A.useCallback(J=>{const he=Wn.findIndex(je=>je.promptId===J.promptId);he!==-1&&(wn(je=>je.filter((Be,Me)=>Me!==he)),ks(J,Lt(b)===Lt(J)))},[ks,Wn,b]),Na=A.useCallback((J,he,je,Be="preview")=>{const Me={kind:"subagent",sessionId:J,spawnPartId:he,label:je};rr(it=>it.some(at=>at.spawnPartId===he)?it:[...it,Me]),es(Me,Be)},[es]),ep=A.useCallback(J=>{const he=Qn.findIndex(je=>je.spawnPartId===J.spawnPartId);he!==-1&&(rr(je=>je.filter((Be,Me)=>Me!==he)),ks(J,Lt(b)===Lt(J)))},[ks,b,Qn]),[jl,Tl]=A.useState({});A.useEffect(()=>{if(Tl(at=>{const Bt=new Set(Qn.map(Kt=>Kt.spawnPartId));return Object.keys(at).every(Kt=>Bt.has(Kt))?at:Object.fromEntries(Object.entries(at).filter(([Kt])=>Bt.has(Kt)))}),Qn.length===0)return;let J=!0;const he=new Set,je=(at,Bt,Kt)=>{Tl(Ns=>{var ps;let Os=Ns;for(const ja of Bt)if(!(Kt&&he.has(ja.spawnPartId)))for(const so of at){const zs=lb(so.parts,ja.spawnPartId);if(!zs)continue;Kt||he.add(ja.spawnPartId);const wc={label:UIn(zs),running:((ps=zs.state)==null?void 0:ps.status)==="running"},kc=Os[ja.spawnPartId];(!kc||kc.label!==wc.label||kc.running!==wc.running)&&(Os===Ns&&(Os={...Ns}),Os[ja.spawnPartId]=wc);break}return Os})};let Be=0;const Me=()=>{const at=++Be;for(const Bt of new Set(Qn.map(Kt=>Kt.sessionId)))Je.fetchQuery({...ol(Bt),staleTime:0}).then(({messages:Kt})=>{J&&at===Be&&je(Kt,Qn.filter(Ns=>Ns.sessionId===Bt),!0)}).catch(()=>{})};Me();const it=Ov(at=>{if(at.type==="reconnected"){he.clear(),Me();return}if(at.type!=="message")return;const Bt=Qn.filter(Kt=>Kt.sessionId===at.sessionId);Bt.length&&je([at.message],Bt,!1)});return()=>{J=!1,it()}},[Qn]);const Al=A.useCallback((J,he,je="files",Be="preview")=>{const Me={code:!0,experimentId:J,branch:he,view:je,toggled:new Set};Tr(it=>it.some(at=>dd(at,Me))?it.map(at=>dd(at,Me)?{...at,experimentId:J,view:je}:at):[...it,Me]),es(Me,Be)},[es]),t_=A.useCallback((J,he)=>{Tr(je=>je.map(Be=>dd(Be,J)?{...Be,...he}:Be)),he.view&&D(rl({...J,...he}))},[]),If=A.useCallback(J=>{const he=As.findIndex(je=>dd(je,J));he!==-1&&(Tr(je=>je.filter((Be,Me)=>Me!==he)),ks(J,Lt(b)===Lt(J)))},[As,ks,b]),za=A.useCallback(()=>{gn(!0),Yn("files")},[Yn]),Rl=A.useCallback(J=>{J==="experiments"?Ir(!1):J==="files"?gn(!1):J==="terminal"?(Hn(!1),nr(null)):Nt(!1),ks(J,b===J)},[ks,b]),n_=J=>{J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId);const je=document.body.style.userSelect;document.body.style.userSelect="none";const Be=Ps,Me=J.clientX,it=Ar;let at=!1;function Bt(){window.removeEventListener("pointermove",Kt),window.removeEventListener("pointerup",Bt),window.removeEventListener("pointercancel",Bt),document.body.style.userSelect=je}function Kt(Ns){if(Be){const so=Ns.clientX-Me;if(at||sops+tKn){$t(!0);return}$t(!1);const ja=Math.min(Math.max(Os,Pv),ps);st(ja)}window.addEventListener("pointermove",Kt),window.addEventListener("pointerup",Bt),window.addEventListener("pointercancel",Bt)},tp=(J,he)=>{F(je=>je?eO(je,J):[J]),s.navigate({href:`/projects/${encodeURIComponent(J.id)}${he?"/settings/git":""}`}),he&&bn(he,"error")},Ms=typeof b=="object"&&"id"in b?b:null,$n=typeof b=="object"&&"path"in b?b:null,ii=($n==null?void 0:$n.source)==="artifacts"&&Te?Q0(Te.entries,$n.path):null,To=ii?`${ii.modifiedAt}:${ii.size}`:null,yc=u===Id&&_n?jr.find(J=>b_(J,{path:iw,source:"artifacts"})):void 0,Ml=yc?[yc]:[],hs=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,zi=hs==null?void 0:hs.sessionId,ro=hs==null?void 0:hs.promptId,xc=!!(zi&&ro&&(y!=null&&y.includes(zi))),Ol=ut({...ol(zi??""),enabled:xc,subscribed:xc}),Ao=A.useMemo(()=>{var he;if(!zi||!ro||!Ol.data)return null;const J=Ol.data.messages.flatMap(je=>{const Be=lb(je.parts,ro);return Be?[Be]:[]})[0];return{key:`${zi}:${ro}`,text:((he=J==null?void 0:J.prompt)==null?void 0:he.plan)??null}},[zi,ro,Ol.data]),Cs=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Dl=typeof b=="object"&&"code"in b?b:null,Es=Dl?As.find(J=>dd(J,Dl))??null:null,r_=new Map;for(const J of[...On,...jr,...Wn,...Qn,...As])r_.set(Lt(J),J);const $f=yc?Lt(yc):null,Bf=cr.filter(J=>J!==$f).map(J=>r_.get(J)).filter(Ekn),$r=J=>Ya!==null&&Lt(Ya)===Lt(J),te=J=>f.jsx(qc,{active:$n!==null&&b_($n,J),label:J.path.split("/").pop()||J.path,icon:f.jsx(qI,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>Si(J),onClose:()=>Zh(J)},`file:${NS(J)}`),ge=Ms?pe.find(J=>J.id===Ms.id)??null:null,Ee=Es?pe.find(J=>J.id===Es.experimentId&&J.branchName===Es.branch)??null:null,Ie=J=>{var je,Be;if("path"in J)return te(J);if("id"in J){const Me=pe.find(it=>it.id===J.id);return f.jsx(qc,{active:Ms!==null&&fw(Ms,J),label:Me?Me.title||Me.slug:"…",icon:J.view==="overview"?f.jsx(h3n,{size:12,className:"shrink-0"}):f.jsx(ko,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>Si(J),onClose:()=>El(J)},Lt(J))}if("kind"in J&&J.kind==="plan")return f.jsx(qc,{active:hs!==null&&hs.promptId===J.promptId,label:AD(),icon:f.jsx(yS,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>Si(J),onClose:()=>zl(J)},Lt(J));if("kind"in J)return f.jsx(qc,{active:Cs!==null&&Cs.spawnPartId===J.spawnPartId,label:((je=jl[J.spawnPartId])==null?void 0:je.label)??J.label??L_e(),shimmer:((Be=jl[J.spawnPartId])==null?void 0:Be.running)??!1,icon:f.jsx(kS,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>Si(J),onClose:()=>ep(J)},Lt(J));const he=pe.find(Me=>Me.id===J.experimentId);return f.jsx(qc,{active:Es!==null&&dd(Es,J),label:(he==null?void 0:he.slug)??J.branch,icon:f.jsx(Ou,{size:12,className:"shrink-0"}),preview:$r(J),onSelect:()=>Yn(J),onPromote:()=>Si(J),onClose:()=>If(J)},Lt(J))};if(!a||a.kind==="resume")return null;if(G)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:t0,children:[f.jsx("p",{children:G}),f.jsx(Oe,{variant:"primary",onClick:Yu,children:Ys()})]}),e.kind==="ssh"&&f.jsx(G3,{runtime:e,corner:!0})]});if(L&&!on)return f.jsxs("div",{className:t0,children:[go(),f.jsx(Oe,{onClick:()=>H(null),children:f0()})]});if(zo&&!Ci)return f.jsxs("div",{className:t0,children:[f.jsx("p",{role:"alert",children:zo}),f.jsx(Oe,{onClick:qs,children:Ys()})]});if(L===null||ne===null||!Xu||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:t0,children:f.jsx(jt,{})}),e.kind==="ssh"&&f.jsx(G3,{runtime:e,corner:!0})]});if(!on||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:t0,children:[go(),f.jsx(Oe,{onClick:()=>H(null),children:f0()})]});const Pe=f.jsx(CBn,{projectName:((Yt=L.find(J=>J.id===n))==null?void 0:Yt.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Ui(!0),onRepository:()=>Vi("git"),onCollapse:()=>Kr(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(g$,{}),e.kind==="local"&&f.jsx(K$,{status:Z}),zo&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:zo}),f.jsx(Oe,{onClick:qs,children:Ys()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${yi?"workspace-card-visible":""}`,children:[n&&f.jsx(s$n,{projectId:n,projectName:(on==null?void 0:on.name)??"",railHeader:Pe,railOpen:xi,onShowRail:()=>Kr(!0),mainView:o,onSelectMainView:Vi,onOpenFile:e_,onOpenRun:gc,runExperimentName:Lf,onOpenExperiment:Ju,experimentName:Cl,onOpenPlan:Jh,onOpenSubagent:Na,composerFocusNonce:ds,demoRunningRunId:wl,runtime:e,onOpenDemoWelcome:on&&Vc(on.id)?Wi:void 0,activeSessionId:u,onActiveSessionChange:pr,preferredAgent:ne.preferredAgent,onPreferredAgentChange:kl,children:o==="skills"?f.jsx(W$n,{}):o!=="chat"?f.jsx(yLn,{remote:e.kind==="ssh",tab:o,project:on,onProjectUpdate:J=>{F(he=>he?eO(he,J):[J])},onSelectTab:Vi}):null}),o==="chat"&&f.jsx(K8n,{expanded:yi,experiments:pe,runs:Ne,onOpenExperiment:(J,he)=>ri(J,"overview","preview",he),rightOffset:h?Ar+28:void 0,activeView:h&&(b==="files"||b==="artifacts"||b==="experiments"||b==="terminal")?b:null,projectId:on.id,onCompute:()=>Vi("compute"),sessionId:u,busy:((vn=x.data)==null?void 0:vn.some(J=>J.id===u&&J.busy))??!1,onChanges:()=>{Za("changes"),za()},onFiles:()=>{Za("files"),za()},onTerminal:Df,onArtifacts:Sa,onExperiments:()=>Zn()}),o==="chat"&&h&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Ps?"max":""}`,style:Ps?void 0:{width:Ar},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Ps?"cursor-e-resize":"cursor-col-resize"}`,title:Ps?Cle():vle(),onPointerDown:n_}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.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:[Ml.map(te),mn&&f.jsx(qc,{active:b==="files",label:c3(),icon:f.jsx(Ou,{size:12,className:"shrink-0"}),onSelect:()=>Yn("files"),onClose:()=>Rl("files")}),Ot&&f.jsx(qc,{active:b==="terminal",label:Tv(),icon:f.jsx(ko,{size:12,className:"shrink-0"}),onSelect:()=>Yn("terminal"),onClose:()=>Rl("terminal")}),Ln&&f.jsx(qc,{active:b==="artifacts",label:wD(),icon:f.jsx(vS,{size:12,className:"shrink-0"}),onSelect:()=>Yn("artifacts"),onClose:()=>Rl("artifacts")}),xn&&f.jsx(qc,{active:b==="experiments",label:kD(),icon:f.jsx(gh,{size:12,className:"shrink-0"}),onSelect:()=>Yn("experiments"),onClose:()=>Rl("experiments")}),Bf.map(Ie)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Ft,{title:Ps?XE():QE(),"aria-label":Ps?XE():QE(),onClick:()=>$t(J=>!J),children:Ps?f.jsx(b5n,{size:14}):f.jsx(m5n,{size:14})}),f.jsx(Ft,{title:A0(),"aria-label":A0(),onClick:()=>{$(),$t(!1)},children:f.jsx(_r,{size:14})})]})]}),b==="terminal"&&Ot?null:!Ci||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!be||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Ae?f.jsx(Pa,{children:f.jsx(jt,{})}):Ms&&(!ge||_&&!Ne.some(J=>J.id===_&&J.experimentId===Ms.id))||Dl&&!Ee||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Pa,{children:f.jsx("div",{className:"p-6 text-subtext",children:go()})}):b==="artifacts"?f.jsx(Pa,{children:on&&f.jsx(B$n,{project:on,artifacts:Te,onOpenFile:Yh,canRenameFile:J=>{var he;return!((he=gt.current.get(Bs(on.id,u,{path:J,source:"artifacts"})))!=null&&he.needsProtection)}},on.id)}):b==="experiments"?f.jsxs(Pa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("label",{className:"inline-flex items-center gap-1 text-sm text-subtext",children:[f.jsx("input",{type:"checkbox",checked:_t,onChange:J=>kt(J.target.checked)}),w_e()]}),f.jsxs("div",{className:"option-picker relative inline-flex",ref:mt,children:[f.jsx(Ft,{size:"small",ref:un,className:"experiment-scope-trigger",active:Qt==="agent",title:Ule({scope:Qt==="agent"?KE():WE()}),"aria-label":mue(),"aria-expanded":At,onClick:()=>pt(J=>!J),children:f.jsx(X3n,{size:16,strokeWidth:2.5})}),At&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-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:[f.jsxs(Dn,{"aria-pressed":Qt==="agent",disabled:!u||!xr,title:u?xr?void 0:kue():Iue(),onClick:()=>{Zt("agent"),pt(!1)},children:[f.jsx("span",{children:KE()}),Qt==="agent"&&f.jsx(Fi,{size:13})]}),f.jsxs(Dn,{"aria-pressed":Qt==="project",onClick:()=>{Zt("project"),pt(!1)},children:[f.jsx("span",{children:WE()}),Qt==="project"&&f.jsx(Fi,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_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":Yle(),children:[f.jsx("button",{className:He==="table"?"active":"","aria-pressed":He==="table",onClick:()=>nt("table"),children:q_e()}),f.jsx("button",{className:He==="tree"?"active":"","aria-pressed":He==="tree",onClick:()=>nt("tree"),children:X_e()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:He==="tree"?on&&f.jsx(XVn,{experiments:mr,allExperiments:pe,hasArchivedExperiments:Mn.length>0&&gr.length===0,runs:Et,project:on,onOpenView:ri,onOpenCode:Al,onArchive:_s,agentSessionId:Qt==="agent"?u:null,onRevealHidden:()=>{kt(!0),Qh()},viewport:qi,onViewportChange:Xn}):f.jsx(EBn,{runs:Et,emptyHint:!_t&&Mn.length>0&&gr.length===0?x3():Qt==="agent"&&pe.length>0?Tue():void 0,experiments:gr,onOpen:(J,he)=>{ri(J.id,"overview",he)},onOpenLogs:(J,he,je)=>{ri(J,"terminal",je,he)},onOpenCode:(J,he)=>{const je=pe.find(Be=>Be.id===J);je&&Al(je.id,je.branchName,"files",he)},onArchive:_s,onCancel:UL})})]}):b==="files"?f.jsx(Pa,{children:on?f.jsx(w$n,{sessionId:u??void 0,project:on,view:Rs,toggled:Eo,onViewChange:Za,onToggledChange:wa,canRenameFile:J=>{var he;return!((he=gt.current.get(Bs(on.id,u,{path:J,source:"repo",sessionId:u??void 0})))!=null&&he.needsProtection)},onOpenFile:(J,he,je,Be)=>bc(J,he,je,void 0,void 0,void 0,Be)},`files:${u??`project:${on.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(qd,{children:f.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:[f.jsx(UI,{size:22}),f.jsx("p",{children:c_e()})]})})})}):$n?f.jsx(Pa,{children:n&&f.jsx(SBn,{remote:e.kind==="ssh",restored:C.current.has(Bs(n,u,$n)),onRestoreActivated:()=>{const J=Bs(n,u,$n);C.current.delete(J),z.current.add(J)},showSource:N.current[Bs(n,u,$n)]??!1,onShowSourceChange:J=>{N.current[Bs(n,u,$n)]=J,j(he=>he+1)},projectId:n,path:$n.path,source:$n.source,sessionId:$n.source==="artifacts"?u??void 0:$n.sessionId,gitRef:$n.ref,line:$n.line,branchLabel:JVn($n,on==null?void 0:on.baselineBranch),artifactVersion:To,artifactEntries:$n.source==="artifacts"?Te==null?void 0:Te.entries:void 0,bufferSession:Zr(Bs(n,u,$n)),onOpenFile:(J,he,je,Be)=>si($n,()=>bc(J,he,je,void 0,void 0,void 0,Be)),scrollPosition:Ke.current.get(Bs(n,u,$n)),onScrollPositionChange:J=>{Ke.current.set(Bs(n,u,$n),J),Ja()},lineScrollRequest:$n.lineScrollRequest,onLineScrollRequestHandled:()=>no($n),onEdit:()=>Si($n)},Bs(n,u,$n))}):hs?f.jsx(Pa,{children:f.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:f.jsx(nc,{text:(Ao==null?void 0:Ao.key)===`${hs.sessionId}:${hs.promptId}`?Ao.text??go():((hn=Wn.find(J=>J.promptId===hs.promptId))==null?void 0:hn.plan)||SD(),onOpenFile:(J,he,je,Be,Me)=>si(hs,()=>bc(J,hs.sessionId,Be,he,je,void 0,Me))})})}):Cs?f.jsx(o$n,{projectId:n,sessionId:Cs.sessionId,spawnPartId:Cs.spawnPartId,onOpenFile:(J,he,je,Be,Me)=>si(Cs,()=>e_(J,Cs.sessionId,he,je,Be,Me)),onOpenRun:(J,he)=>si(Cs,()=>gc(J,he)),runExperimentName:Lf,onOpenExperiment:(J,he)=>si(Cs,()=>Ju(J,he)),experimentName:Cl,onOpenSubagent:(J,he,je)=>si(Cs,()=>Na(Cs.sessionId,J,he,je))},Cs.spawnPartId):Es?f.jsx(Pa,{children:n&&on&&Es&&Ee&&f.jsx(x$n,{projectId:n,project:on,experiment:Ee,view:Es.view,toggled:Es.toggled,onViewChange:J=>t_(Es,{view:J}),onToggledChange:J=>t_(Es,{toggled:J}),onOpenFile:(J,he,je,Be)=>si(Es,()=>bc(J,he,je,void 0,void 0,Ee.branchName,Be))},`code:${Es.branch}`)}):f.jsx(Pa,{children:Ms&&ge&&on&&f.jsx(J$n,{experiment:ge,project:on,view:Ms.view,runs:Ne,selectedRunId:_,onSelectRun:q,parentExperiment:pe.find(J=>J.id===ge.parentExperimentId)??null,onOpenView:(J,he,je)=>{si(Ms,()=>ri(ge.id,J,je,he))},onOpenCode:(J,he)=>si(Ms,()=>Al(ge.id,ge.branchName,J,he))},`${Ms.id}:${Ms.view}`)}),Ot&&zr!==null&&zr===jo&&on&&f.jsx(Pa,{className:b==="terminal"?void 0:"hidden",children:f.jsx(Q8n,{projectId:on.id,sessionId:u,active:b==="terminal"},jo)})]})]}),Wr&&f.jsx(m$,{remote:e.kind==="ssh",onClose:()=>Ui(!1),onCreated:(J,he)=>{Ui(!1),tp(J,he)}}),Mf&&on&&Vc(on.id)&&f.jsx(NBn,{onClose:to,onCreateProject:Of})]})}const yk=sc()({validateSearch:e=>({pane:SS(e.pane)}),beforeLoad:({location:e})=>{if(!cf(e.pathname))throw BK()},component:sKn});function sKn(){const{projectId:e}=yk.useParams(),{pane:n}=yk.useSearch(),t=pi(),r=_D({select:s=>s.location});return A.useEffect(()=>{const s=iKn(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(z0,{}),f.jsx(rKn,{projectId:e,pane:n,runtime:u$()},e)]})}function iKn(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&SS(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const iG=sc()({component:aKn});function aKn(){const{projectId:e}=iG.useParams();return f.jsx(g6n,{projectId:e})}const oKn=sc()({}),cKn=sc()({}),lKn=sc()({}),uKn=sc()({}),_Kn=b6n.update({id:"/",path:"/",getParentRoute:()=>Ub}),IC=y6n.update({id:"/projects",path:"/projects",getParentRoute:()=>Ub}),fKn=x6n.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>Ub}),dKn=w6n.update({id:"/",path:"/",getParentRoute:()=>IC}),Wh=yk.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>IC}),hKn=iG.update({id:"/",path:"/",getParentRoute:()=>Wh}),pKn=oKn.update({id:"/skills",path:"/skills",getParentRoute:()=>Wh}),mKn=cKn.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>Wh}),gKn=lKn.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>Wh}),vKn=uKn.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>Wh}),bKn={ProjectsProjectIdSkillsRoute:pKn,ProjectsProjectIdIndexRoute:hKn,ProjectsProjectIdSettingsTabRoute:mKn,ProjectsProjectIdTasksSessionIdRoute:gKn,ProjectsProjectIdTasksNewRoute:vKn},yKn=Wh._addFileChildren(bKn),xKn={ProjectsProjectIdRoute:yKn,ProjectsIndexRoute:dKn},wKn=IC._addFileChildren(xKn),kKn={IndexRoute:_Kn,ProjectsRoute:wKn,RemoteLaunchRoute:fKn},SKn=Ub._addFileChildren(kKn)._addFileTypes(),CKn=oQ({routeTree:SKn,context:{queryClient:Je},trailingSlash:"never",defaultPendingComponent:_6,defaultErrorComponent:f6,defaultNotFoundComponent:p6n}),aG=E();document.documentElement.lang=aG;document.documentElement.dir="ltr";eI(aG);pK.createRoot(document.getElementById("root")).render(f.jsxs(A.StrictMode,{children:[f.jsx(jV,{client:Je,children:f.jsx(uQ,{router:CKn})}),f.jsx(Q4n,{})]}));export{ac as C,Ft as I,ub as M,$h as P,YI as S,x5n as a,WN as b,ot as c,Ur as d,E$n as e,tn as f,E as g,gi as h,QN as i,f as j,A as r}; diff --git a/ui/dist/assets/index-aOLopP0k.css b/ui/dist/assets/index-aOLopP0k.css new file mode 100644 index 00000000..96bb494e --- /dev/null +++ b/ui/dist/assets/index-aOLopP0k.css @@ -0,0 +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-leading:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--spacing:.25rem;--container-xl:36rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--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-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-diff-selection:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-selection:color-mix(in oklab, var(--surface) 76%, var(--primary))}}:root,:host{--color-diff-gutter-selection:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-gutter-selection:color-mix(in oklab, var(--surface) 68%, var(--primary))}}:root,:host{--color-diff-insert-gutter:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-insert-gutter:color-mix(in oklab, var(--base) 84%, var(--accent-green))}}:root,:host{--color-diff-delete-gutter:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-delete-gutter:color-mix(in oklab, var(--base) 86%, var(--accent-red))}}:root,:host{--color-diff-insert-code:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-insert-code:color-mix(in oklab, var(--base) 91%, var(--accent-green))}}:root,:host{--color-diff-delete-code:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-delete-code:color-mix(in oklab, var(--base) 92%, var(--accent-red))}}:root,:host{--color-diff-insert-edit:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-insert-edit:color-mix(in oklab, var(--base) 72%, var(--accent-green))}}:root,:host{--color-diff-delete-edit:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-delete-edit:color-mix(in oklab, var(--base) 78%, var(--accent-red))}}:root,:host{--color-diff-omit-gutter:var(--base)}@supports (color:color-mix(in lab,red,red)){:root,:host{--color-diff-omit-gutter:color-mix(in oklab, var(--base) 86%, var(--text))}}}@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:1rem;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)}.file-view-editarea::selection{background:var(--editor-selection)}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-auto{pointer-events:auto}.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}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.-inset-14{inset:calc(var(--spacing) * -14)}.-inset-\[7px\]{top:-7px;right:-7px;bottom:-7px;left:-7px}.inset-0{top:0;right:0;bottom:0;left:0}.inset-auto{inset:auto}.inset-x-0{inset-inline:0}.inset-x-4{inset-inline:calc(var(--spacing) * 4)}.inset-x-6{inset-inline:calc(var(--spacing) * 6)}.inset-y-0{inset-block:0}.start-0{inset-inline-start:calc(var(--spacing) * 0)}.start-2{inset-inline-start:calc(var(--spacing) * 2)}.start-3{inset-inline-start:calc(var(--spacing) * 3)}.-end-\[3px\]{inset-inline-end:-3px}.end-0{inset-inline-end:calc(var(--spacing) * 0)}.end-1\.5{inset-inline-end:calc(var(--spacing) * 1.5)}.end-3{inset-inline-end:calc(var(--spacing) * 3)}.end-3\.5{inset-inline-end:calc(var(--spacing) * 3.5)}.top-0{top:0}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-3{top:calc(var(--spacing) * 3)}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-5{top:calc(var(--spacing) * 5)}.top-7{top:calc(var(--spacing) * 7)}.top-16{top:calc(var(--spacing) * 16)}.top-\[calc\(100\%_\+_6px\)\]{top:calc(100% + 6px)}.right-5{right:calc(var(--spacing) * 5)}.bottom-0{bottom:0}.bottom-6{bottom:calc(var(--spacing) * 6)}.bottom-32{bottom:calc(var(--spacing) * 32)}.bottom-\[calc\(100\%_\+_4px\)\]{bottom:calc(100% + 4px)}.bottom-\[calc\(100\%_\+_6px\)\]{bottom:calc(100% + 6px)}.bottom-\[calc\(100\%_\+_8px\)\]{bottom:calc(100% + 8px)}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.z-0{z-index:0}.z-1{z-index:1}.z-2{z-index:2}.z-4{z-index:4}.z-5{z-index:5}.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-70{z-index:70}.z-100{z-index:100}.z-200{z-index:200}.col-span-2{grid-column:span 2/span 2}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.row-start-1{grid-row-start:1}.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}.m-3{margin:calc(var(--spacing) * 3)}.m-5{margin:calc(var(--spacing) * 5)}.m-auto{margin:auto}.mx-0{margin-inline:0}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.-my-0\.5{margin-block:calc(var(--spacing) * -.5)}.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-4{margin-block:calc(var(--spacing) * 4)}.my-6{margin-block:calc(var(--spacing) * 6)}.my-\[5px\]{margin-block:5px}.ms-0{margin-inline-start:0}.ms-1{margin-inline-start:var(--spacing)}.ms-2{margin-inline-start:calc(var(--spacing) * 2)}.ms-3\.5{margin-inline-start:calc(var(--spacing) * 3.5)}.ms-6{margin-inline-start:calc(var(--spacing) * 6)}.ms-auto{margin-inline-start:auto}.me-0{margin-inline-end:0}.me-0\.5{margin-inline-end:calc(var(--spacing) * .5)}.me-1{margin-inline-end:var(--spacing)}.me-2{margin-inline-end:calc(var(--spacing) * 2)}.me-3\.5{margin-inline-end:calc(var(--spacing) * 3.5)}.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{margin-top:calc(var(--spacing) * 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-\[5px\]{margin-top:5px}.mt-\[13px\]{margin-top:13px}.mt-auto{margin-top:auto}.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{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-1{margin-left:var(--spacing)}.box-border{box-sizing:border-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.table{display:table}.field-sizing-content{field-sizing:content}.size-1\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-5\.5{height:calc(var(--spacing) * 5.5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.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-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-40{height:calc(var(--spacing) * 40)}.h-80{height:calc(var(--spacing) * 80)}.h-96{height:calc(var(--spacing) * 96)}.h-\[7px\]{height:7px}.h-\[9px\]{height:9px}.h-\[13px\]{height:13px}.h-\[15px\]{height:15px}.h-\[min\(42rem\,calc\(100vh-2\.5rem\)\)\]{height:min(42rem,100vh - 2.5rem)}.h-\[min\(48rem\,calc\(100vh-2\.5rem\)\)\]{height:min(48rem,100vh - 2.5rem)}.h-auto{height:auto}.h-dvh{height:100dvh}.h-full{height:100%}.h-px{height:1px}.max-h-36{max-height:calc(var(--spacing) * 36)}.max-h-45{max-height:calc(var(--spacing) * 45)}.max-h-48{max-height:calc(var(--spacing) * 48)}.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-120{max-height:calc(var(--spacing) * 120)}.max-h-\[calc\(100vh_-_40px\)\]{max-height:calc(100vh - 40px)}.max-h-\[calc\(100vh_-_var\(--modal-top\)_-_1\.25rem\)\]{max-height:calc(100vh - var(--modal-top) - 1.25rem)}.max-h-\[calc\(100vh_-_var\(--modal-top\)_-_48px\)\]{max-height:calc(100vh - var(--modal-top) - 48px)}.max-h-\[calc\(100vh_-_var\(--new-project-modal-top\)_-_1\.25rem\)\]{max-height:calc(100vh - var(--new-project-modal-top) - 1.25rem)}.max-h-\[min\(18rem\,40vh\)\]{max-height:min(18rem,40vh)}.max-h-\[min\(70vh\,_720px\)\]{max-height:min(70vh,720px)}.max-h-full{max-height:100%}.max-h-none{max-height:none}.min-h-0{min-height:0}.min-h-6{min-height:calc(var(--spacing) * 6)}.min-h-7{min-height:calc(var(--spacing) * 7)}.min-h-8{min-height:calc(var(--spacing) * 8)}.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-22{min-height:calc(var(--spacing) * 22)}.min-h-41{min-height:calc(var(--spacing) * 41)}.min-h-dvh{min-height:100dvh}.min-h-full{min-height:100%}.w-0{width:0}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\/5{width:40%}.w-4{width:calc(var(--spacing) * 4)}.w-4\/5{width:80%}.w-5{width:calc(var(--spacing) * 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-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-9\.5{width:calc(var(--spacing) * 9.5)}.w-10{width:calc(var(--spacing) * 10)}.w-10\.5{width:calc(var(--spacing) * 10.5)}.w-36{width:calc(var(--spacing) * 36)}.w-37{width:calc(var(--spacing) * 37)}.w-40{width:calc(var(--spacing) * 40)}.w-52{width:calc(var(--spacing) * 52)}.w-52\.5{width:calc(var(--spacing) * 52.5)}.w-60{width:calc(var(--spacing) * 60)}.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-96{width:calc(var(--spacing) * 96)}.w-110{width:calc(var(--spacing) * 110)}.w-120{width:calc(var(--spacing) * 120)}.w-140{width:calc(var(--spacing) * 140)}.w-160{width:calc(var(--spacing) * 160)}.w-180{width:calc(var(--spacing) * 180)}.w-200{width:calc(var(--spacing) * 200)}.w-\[7px\]{width:7px}.w-\[9px\]{width:9px}.w-\[13px\]{width:13px}.w-\[15px\]{width:15px}.w-\[min\(440px\,_calc\(100vw_-_48px\)\)\]{width:min(440px,100vw - 48px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-36{max-width:calc(var(--spacing) * 36)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-48{max-width:calc(var(--spacing) * 48)}.max-w-55{max-width:calc(var(--spacing) * 55)}.max-w-60{max-width:calc(var(--spacing) * 60)}.max-w-64{max-width:calc(var(--spacing) * 64)}.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-105{max-width:calc(var(--spacing) * 105)}.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-290{max-width:calc(var(--spacing) * 290)}.max-w-\[88\%\]{max-width:88%}.max-w-\[94vw\]{max-width:94vw}.max-w-\[calc\(100vw-1rem\)\]{max-width:calc(100vw - 1rem)}.max-w-\[calc\(100vw_-_40px\)\]{max-width:calc(100vw - 40px)}.max-w-full{max-width:100%}.max-w-none{max-width:none}.max-w-readable{max-width:var(--readable-col)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-16{min-width:calc(var(--spacing) * 16)}.min-w-20{min-width:calc(var(--spacing) * 20)}.min-w-44{min-width:calc(var(--spacing) * 44)}.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-60{min-width:calc(var(--spacing) * 60)}.min-w-80{min-width:calc(var(--spacing) * 80)}.min-w-full{min-width:100%}.flex-1{flex:1}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-full{flex-basis:100%}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[or-pulse_1\.2s_ease-in-out_infinite\]{animation:1.2s ease-in-out infinite or-pulse}.animate-\[spin_0\.8s_linear_infinite\]{animation:.8s linear infinite spin}.animate-\[spin_0\.9s_linear_infinite\]{animation:.9s linear infinite spin}.animate-\[title-char-in_240ms_ease-out_both\]{animation:.24s ease-out both title-char-in}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-e-resize{cursor:e-resize}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.cursor-zoom-in{cursor:zoom-in}.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-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-\[2rem_minmax\(0\,1fr\)_2rem\]{grid-template-columns:2rem minmax(0,1fr) 2rem}.grid-cols-\[8\.5rem_5rem\]{grid-template-columns:8.5rem 5rem}.grid-cols-\[9rem_minmax\(0\,1fr\)\]{grid-template-columns:9rem minmax(0,1fr)}.grid-cols-\[24px_minmax\(0\,_1fr\)\]{grid-template-columns:24px minmax(0,1fr)}.grid-cols-\[24px_minmax\(0\,_1fr\)_28px\]{grid-template-columns:24px minmax(0,1fr) 28px}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto_minmax\(0\,1fr\)_auto\]{grid-template-columns:auto minmax(0,1fr) auto}.grid-cols-\[minmax\(0\,1fr\)_9rem_9rem_minmax\(18rem\,max-content\)\]{grid-template-columns:minmax(0,1fr) 9rem 9rem minmax(18rem,max-content)}.grid-cols-\[minmax\(0\,_1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.grid-cols-\[minmax\(12rem\,18rem\)_minmax\(12rem\,18rem\)\]{grid-template-columns:minmax(12rem,18rem) minmax(12rem,18rem)}.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!important}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.\!items-stretch{align-items:stretch!important}.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}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-1\.5{column-gap:calc(var(--spacing) * 1.5)}.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-5{column-gap:calc(var(--spacing) * 5)}.gap-x-8{column-gap:calc(var(--spacing) * 8)}.gap-x-12{column-gap:calc(var(--spacing) * 12)}.gap-y-1{row-gap:var(--spacing)}.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}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border-variant>:not(:last-child)){border-color:var(--border-variant)}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.justify-self-end{justify-self:flex-end}.justify-self-start{justify-self:flex-start}.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{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-none{border-radius:0}.rounded-sm{border-radius:6px}.rounded-xl{border-radius:12px}.rounded-xs{border-radius:4px}.rounded-s-none{border-start-start-radius:0;border-end-start-radius:0}.rounded-e-none{border-start-end-radius:0;border-end-end-radius:0}.rounded-b-lg{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.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-x-0{border-inline-style:var(--tw-border-style);border-inline-width:0}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-s-0{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.border-s-2{border-inline-start-style:var(--tw-border-style);border-inline-start-width:2px}.border-s-\[3px\]{border-inline-start-style:var(--tw-border-style);border-inline-start-width:3px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.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-dashed{--tw-border-style:dashed;border-style:dashed}.border-solid{--tw-border-style:solid;border-style:solid}.border-accent-amber,.border-accent-amber\/45{border-color:var(--accent-amber)}@supports (color:color-mix(in lab,red,red)){.border-accent-amber\/45{border-color:color-mix(in oklab,var(--accent-amber) 45%,transparent)}}.border-accent-blue,.border-accent-blue\/45{border-color:var(--accent-blue)}@supports (color:color-mix(in lab,red,red)){.border-accent-blue\/45{border-color:color-mix(in oklab,var(--accent-blue) 45%,transparent)}}.border-accent-green,.border-accent-green\/45{border-color:var(--accent-green)}@supports (color:color-mix(in lab,red,red)){.border-accent-green\/45{border-color:color-mix(in oklab,var(--accent-green) 45%,transparent)}}.border-accent-red{border-color:var(--accent-red)}.border-border{border-color:var(--border)}.border-border-strong{border-color:var(--border-strong)}.border-border-variant{border-color:var(--border-variant)}.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border) 50%,transparent)}}.border-danger-notice-border{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.border-danger-notice-border{border-color:color-mix(in srgb,var(--accent-red) 35%,var(--border-variant))}}.border-primary,.border-primary\/45{border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.border-primary\/45{border-color:color-mix(in oklab,var(--primary) 45%,transparent)}}.border-transparent{border-color:#0000}.border-s-accent-blue{border-inline-start-color:var(--accent-blue)}.border-s-accent-red{border-inline-start-color:var(--accent-red)}.border-s-border{border-inline-start-color:var(--border)}.border-s-border-variant{border-inline-start-color:var(--border-variant)}.border-s-plan-caret{border-inline-start-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.border-s-plan-caret{border-inline-start-color:color-mix(in oklab,var(--base) 35%,var(--text))}}.border-e-border-variant{border-inline-end-color:var(--border-variant)}.border-t-accent-amber{border-top-color:var(--accent-amber)}.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-b-accent-amber{border-bottom-color:var(--accent-amber)}.border-b-border{border-bottom-color:var(--border)}.border-b-border-variant{border-bottom-color:var(--border-variant)}.border-b-divider-subtle{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.border-b-divider-subtle{border-bottom-color:color-mix(in oklab,var(--text) 7%,transparent)}}.bg-accent{background-color:var(--accent)}.bg-accent-amber{background-color:var(--accent-amber)}.bg-accent-amber-subtle{background-color:var(--accent-amber-subtle)}.bg-accent-blue{background-color:var(--accent-blue)}.bg-accent-blue-subtle{background-color:var(--accent-blue-subtle)}.bg-accent-green{background-color:var(--accent-green)}.bg-accent-green-subtle{background-color:var(--accent-green-subtle)}.bg-accent-red{background-color:var(--accent-red)}.bg-accent-red-subtle{background-color:var(--accent-red-subtle)}.bg-accent-teal{background-color:var(--accent-teal)}.bg-background{background-color:var(--base)}.bg-border-variant{background-color:var(--border-variant)}.bg-canvas{background-color:var(--canvas)}.bg-current{background-color:currentColor}.bg-hover-faint{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-hover-faint{background-color:color-mix(in oklab,var(--text) 3%,transparent)}}.bg-hover-muted{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-hover-muted{background-color:color-mix(in oklab,var(--text) 8%,transparent)}}.bg-hover-subtle{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.bg-hover-subtle{background-color:color-mix(in oklab,var(--text) 10%,transparent)}}.bg-modal-backdrop{background-color:#1d1b1a6b}.bg-modal-backdrop-light{background-color:#1d1b1a66}.bg-muted{background-color:var(--muted)}.bg-panel{background-color:var(--panel)}.bg-primary{background-color:var(--primary)}.bg-primary-subtle{background-color:var(--primary-subtle)}.bg-skill-blue-subtle{background-color:var(--skill-blue-subtle)}.bg-surface{background-color:var(--surface)}.bg-surface-bright{background-color:var(--surface-bright)}.bg-terminal{background-color:var(--term-bg)}.bg-terminal-app{background-color:var(--term-app-bg)}.bg-text{background-color:var(--text)}.bg-transparent{background-color:#0000}.bg-white{background-color:#fff}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-none{background-image:none}.from-background{--tw-gradient-from:var(--base);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-terminal{--tw-gradient-from:var(--term-bg);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.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-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.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-0{padding-inline:0}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.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-\[9px\]{padding-inline:9px}.px-\[11px\]{padding-inline:11px}.px-\[13px\]{padding-inline:13px}.px-\[15px\]{padding-inline:15px}.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}.ps-1{padding-inline-start:var(--spacing)}.ps-1\.5{padding-inline-start:calc(var(--spacing) * 1.5)}.ps-2{padding-inline-start:calc(var(--spacing) * 2)}.ps-2\.5{padding-inline-start:calc(var(--spacing) * 2.5)}.ps-3{padding-inline-start:calc(var(--spacing) * 3)}.ps-3\.5{padding-inline-start:calc(var(--spacing) * 3.5)}.ps-4{padding-inline-start:calc(var(--spacing) * 4)}.ps-4\.5{padding-inline-start:calc(var(--spacing) * 4.5)}.ps-5{padding-inline-start:calc(var(--spacing) * 5)}.ps-\[2ch\]{padding-inline-start:2ch}.ps-\[31px\]{padding-inline-start:31px}.pe-0{padding-inline-end:0}.pe-0\.5{padding-inline-end:calc(var(--spacing) * .5)}.pe-1{padding-inline-end:var(--spacing)}.pe-1\.5{padding-inline-end:calc(var(--spacing) * 1.5)}.pe-2{padding-inline-end:calc(var(--spacing) * 2)}.pe-2\.5{padding-inline-end:calc(var(--spacing) * 2.5)}.pe-4{padding-inline-end:calc(var(--spacing) * 4)}.pe-8{padding-inline-end:calc(var(--spacing) * 8)}.pe-10{padding-inline-end:calc(var(--spacing) * 10)}.pe-14{padding-inline-end:calc(var(--spacing) * 14)}.pe-\[1ch\]{padding-inline-end:1ch}.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-5{padding-top:calc(var(--spacing) * 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)}.pt-\[var\(--new-project-modal-top\)\]{padding-top:var(--new-project-modal-top)}.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-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 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-\[2ch\]{padding-left:2ch}.text-center{text-align:center}.text-end{text-align:end}.text-left{text-align:left}.text-right{text-align:right}.text-start{text-align:start}.align-baseline{vertical-align:baseline}.align-middle{vertical-align:middle}.font-\[inherit\]{font-family:inherit}.font-mono{font-family:var(--mono)}.font-sans{font-family:var(--sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-menu{font-size:.8125rem;line-height:var(--tw-leading,1.25rem)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-0{--tw-leading:0px;line-height:0}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.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\.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-medium{--tw-font-weight:var(--font-weight-medium)!important;font-weight:var(--font-weight-medium)!important}.\!font-normal{--tw-font-weight:var(--font-weight-normal)!important;font-weight:var(--font-weight-normal)!important}.font-\[375\]{--tw-font-weight:375;font-weight:375}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.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\.05em\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\[0\.06em\]{--tw-tracking:.06em;letter-spacing:.06em}.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}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-accent-red{color:var(--accent-red)!important}.text-accent-amber{color:var(--accent-amber)}.text-accent-blue{color:var(--accent-blue)}.text-accent-green{color:var(--accent-green)}.text-accent-orange{color:var(--accent-orange)}.text-accent-purple{color:var(--accent-purple)}.text-accent-red{color:var(--accent-red)}.text-accent-teal{color:var(--accent-teal)}.text-background{color:var(--base)}.text-inherit{color:inherit}.text-muted{color:var(--muted)}.text-primary{color:var(--primary)}.text-skill-blue{color:var(--skill-blue)}.text-skill-blue-slash{color:var(--skill-blue-slash)}.text-subtext{color:var(--subtext)}.text-text,.text-text\/80{color:var(--text)}@supports (color:color-mix(in lab,red,red)){.text-text\/80{color:color-mix(in oklab,var(--text) 80%,transparent)}}.text-transparent{color:#0000}.text-white{color:#fff}.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-2{text-underline-offset:2px}.underline-offset-3{text-underline-offset:3px}.caret-text{caret-color:var(--text)}.opacity-0{opacity:0}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-52{opacity:.52}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px 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-card{--tw-shadow:0 14px 36px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.shadow-card{--tw-shadow:0 14px 36px var(--tw-shadow-color,color-mix(in oklab, var(--text) 6%, transparent))}}.shadow-card{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-control{--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-control-subtle{--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)}.shadow-dropdown{--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-elevated{--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-elevated{--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-elevated{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-file-line{--tw-shadow:inset 2px 0 0 var(--tw-shadow-color,var(--accent-blue));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-floating{--tw-shadow:0 8px 24px var(--tw-shadow-color,#00000024);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-hairline{--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-logo{--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-menu{--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-modal{--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-plan{--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-plan-menu{--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-popover{--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-tree{--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)}.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)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-primary{--tw-ring-color:var(--primary)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-background{--tw-ring-offset-color:var(--base)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.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{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[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-\[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-\[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-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}.\[--new-project-modal-top\:clamp\(4rem\,20vh\,24rem\)\]{--new-project-modal-top:clamp(4rem, 20vh, 24rem)}.\[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-open\/limit\:rotate-90:is(:where(.group\/limit):is([open],:popover-open,:open) *){rotate:90deg}.group-focus-within\:pointer-events-auto:is(:where(.group):focus-within *){pointer-events:auto}.group-focus-within\:opacity-100:is(:where(.group):focus-within *),.group-focus-within\/turn\:opacity-100:is(:where(.group\/turn):focus-within *){opacity:1}@media(hover:hover){.group-hover\:pointer-events-auto:is(:where(.group):hover *){pointer-events:auto}.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:opacity-0:is(:where(.group):hover *){opacity:0}.group-hover\:opacity-100:is(:where(.group):hover *),.group-hover\/skill\:opacity-100:is(:where(.group\/skill):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}.placeholder\:text-muted::placeholder{color:var(--muted)}.backdrop\:bg-image-backdrop::backdrop{background-color:#1d1b1ad9}.backdrop\:bg-modal-backdrop-light::backdrop{background-color:#1d1b1a66}.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\:start-0:after{content:var(--tw-content);inset-inline-start:calc(var(--spacing) * 0)}.after\:end-0:after{content:var(--tw-content);inset-inline-end:calc(var(--spacing) * 0)}.after\:top-full:after{content:var(--tw-content);top:100%}.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}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\:border-text:focus-within{border-color:var(--text)}.focus-within\:bg-surface-bright:focus-within{background-color:var(--surface-bright)}@media(hover:hover){.hover\:border-border-strong:hover{border-color:var(--border-strong)}.hover\:border-text:hover{border-color:var(--text)}.hover\:bg-surface:hover{background-color:var(--surface)}.hover\:bg-surface-bright:hover{background-color:var(--surface-bright)}.hover\:bg-transparent:hover{background-color:#0000}.hover\:text-accent-red:hover{color:var(--accent-red)}.hover\:text-primary-hover:hover{color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:text-primary-hover:hover{color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.hover\:text-text:hover{color:var(--text)}.hover\:underline:hover{text-decoration-line:underline}.hover\:decoration-primary:hover{-webkit-text-decoration-color:var(--primary);text-decoration-color:var(--primary)}}.focus\:pointer-events-auto:focus{pointer-events:auto}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:border-text:focus{border-color:var(--text)}.focus\:opacity-100:focus,.focus-visible\:opacity-100:focus-visible{opacity:1}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.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-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-offset-\[-2px\]:focus-visible{outline-offset:-2px}.focus-visible\:outline-primary:focus-visible{outline-color:var(--primary)}.focus-visible\:outline-text:focus-visible{outline-color:var(--text)}.focus-visible\:outline-solid:focus-visible{--tw-outline-style:solid;outline-style:solid}.disabled\:cursor-default:disabled{cursor:default}.disabled\:opacity-45:disabled{opacity:.45}.disabled\:opacity-50:disabled{opacity:.5}@media(prefers-reduced-motion:reduce){.motion-reduce\:transition-none{transition-property:none}}@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\:inset-x-12{inset-inline:calc(var(--spacing) * 12)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:px-12{padding-inline:calc(var(--spacing) * 12)}}@media(min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container not (min-width:36rem){.\@max-xl\:hidden{display:none}}@container not (min-width:32rem){.\@max-lg\:hidden{display:none}}@container (min-width:24rem){.\@sm\:flex-row{flex-direction:row}.\@sm\:items-center{align-items:center}.\@sm\:justify-between{justify-content:space-between}.\@sm\:self-auto{align-self:auto}}@container (min-width:32rem){.\@lg\:flex-row{flex-direction:row}.\@lg\:items-center{align-items:center}.\@lg\:gap-2{gap:calc(var(--spacing) * 2)}}@media(prefers-color-scheme:dark){.dark\:invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.\[\&_\+_\.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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.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(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.badge\]\:ms-2 .badge{margin-inline-start:calc(var(--spacing) * 2)}.\[\&_\.btn\]\:inline-flex .btn{display:inline-flex}.\[\&_\.btn\]\:items-center .btn{align-items:center}.\[\&_\.btn\]\:gap-\[5px\] .btn{gap:5px}.\[\&_\.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-xs .chev{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.chev\]\:text-muted .chev{color:var(--muted)}.\[\&_\.cmd-inline\]\:mx-2 .cmd-inline{margin-inline:calc(var(--spacing) * 2)}.\[\&_\.cmd-inline\]\:gap-2 .cmd-inline{gap:calc(var(--spacing) * 2)}.\[\&_\.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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.count-badge\]\:font-medium .count-badge{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.count-badge\]\:text-text .count-badge{color:var(--text)}.\[\&_\.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-base .error{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.error\]\:text-sm .error{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.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-sm .file-chip{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.file-chip\]\:font-medium .file-chip{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-start .folder-picker-control{text-align:start}.\[\&_\.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-control-subtle .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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.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(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_\.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}.\[\&_\.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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.hc-actions_button\]\:font-medium .hc-actions button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.hc-actions_button\]\:text-text .hc-actions button{color:var(--text)}.\[\&_\.hc-actions_button\:hover\]\:border-border-hover-strong .hc-actions button:hover{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.hc-actions_button\:hover\]\:border-border-hover-strong .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\]\: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-xs .hc-foot{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.hc-foot\]\:text-muted .hc-foot{color:var(--muted)}.\[\&_\.hc-foot_\.hc-command\]\:min-w-0 .hc-foot .hc-command{min-width:0}.\[\&_\.hc-foot_\.hc-command\]\:overflow-hidden .hc-foot .hc-command{overflow:hidden}.\[\&_\.hc-foot_\.hc-command\]\:text-ellipsis .hc-foot .hc-command{text-overflow:ellipsis}.\[\&_\.hc-foot_\.hc-command\]\:whitespace-nowrap .hc-foot .hc-command{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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-slug\]\:min-w-0 .hc-slug{min-width:0}.\[\&_\.hc-slug\]\:overflow-hidden .hc-slug{overflow:hidden}.\[\&_\.hc-slug\]\:text-sm .hc-slug{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.hc-slug\]\:font-semibold .hc-slug{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-sm .hc-toggle{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.hc-toggle\]\:font-medium .hc-toggle{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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\]\:ms-2 .icon-btn{margin-inline-start:calc(var(--spacing) * 2)}.\[\&_\.icon-btn\]\:align-middle .icon-btn{vertical-align:middle}.\[\&_\.id\]\:text-xs .id{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.id\]\:text-muted .id{color:var(--muted)}.\[\&_\.k\]\:text-sm .k{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.k\]\:font-medium .k{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.k\]\:text-subtext .k{color:var(--subtext)}.\[\&_\.k\]\:text-text .k{color:var(--text)}.\[\&_\.katex\]\:text-prose-emphasis .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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.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-base .kv .v{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.kv_\.v\]\:break-normal .kv .v{overflow-wrap:normal;word-break:normal}.\[\&_\.md\]\:max-w-readable .md{max-width:var(--readable-col)}.\[\&_\.md\]\:text-base .md{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.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-2xl .md h1{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.\[\&_\.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-xl .md h2{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_\.md_h3\]\:text-lg .md h3{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_\.model-id\]\:block .model-id{display:block}.\[\&_\.model-id\]\:text-xs .model-id{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.model-id\]\:text-muted .model-id{color:var(--muted)}.\[\&_\.model-item\]\:ps-6 .model-item{padding-inline-start: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}.\[\&_\.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}.\[\&_\.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-sm .node-action{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.node-action\]\:font-medium .node-action{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.node-action\]\:text-text .node-action{color:var(--text)}.\[\&_\.node-action\]\:no-underline .node-action{text-decoration-line:none}.\[\&_\.node-action-ext\]\:ms-auto .node-action-ext{margin-inline-start: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-xs .node-eyebrow{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.node-eyebrow\]\:font-medium .node-eyebrow{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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-xs .node-meta{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-start .node-overview-link{text-align:start}.\[\&_\.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\]\:text-sm .node-slug{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.node-slug\]\:font-semibold .node-slug{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.node-title\]\:text-text .node-title{color:var(--text)}.\[\&_\.openresearch-diff-file\]\:w-full .openresearch-diff-file{width:100%}.\[\&_\.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\(--color-diff-delete-code\)\] .openresearch-diff-file{--diff-code-delete-background-color:var(--color-diff-delete-code)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-delete-edit-background-color\:var\(--color-diff-delete-edit\)\] .openresearch-diff-file{--diff-code-delete-edit-background-color:var(--color-diff-delete-edit)}.\[\&_\.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\(--color-diff-insert-code\)\] .openresearch-diff-file{--diff-code-insert-background-color:var(--color-diff-insert-code)}.\[\&_\.openresearch-diff-file\]\:\[--diff-code-insert-edit-background-color\:var\(--color-diff-insert-edit\)\] .openresearch-diff-file{--diff-code-insert-edit-background-color:var(--color-diff-insert-edit)}.\[\&_\.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\(--color-diff-delete-gutter\)\] .openresearch-diff-file{--diff-gutter-delete-background-color:var(--color-diff-delete-gutter)}.\[\&_\.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\(--color-diff-insert-gutter\)\] .openresearch-diff-file{--diff-gutter-insert-background-color:var(--color-diff-insert-gutter)}.\[\&_\.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\(--color-diff-gutter-selection\)\] .openresearch-diff-file{--diff-gutter-selected-background-color:var(--color-diff-gutter-selection)}.\[\&_\.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\(--color-diff-omit-gutter\)\] .openresearch-diff-file{--diff-omit-gutter-line-color:var(--color-diff-omit-gutter)}.\[\&_\.openresearch-diff-file\]\:\[--diff-selection-background-color\:var\(--color-diff-selection\)\] .openresearch-diff-file{--diff-selection-background-color:var(--color-diff-selection)}.\[\&_\.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_\.diff-code\]\:py-0 .openresearch-diff-file .diff-code{padding-block:0}.\[\&_\.openresearch-diff-file_\.diff-code\]\:ps-\[2ch\] .openresearch-diff-file .diff-code{padding-inline-start:2ch}.\[\&_\.openresearch-diff-file_\.diff-code\]\:pe-4 .openresearch-diff-file .diff-code{padding-inline-end:calc(var(--spacing) * 4)}.\[\&_\.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-border .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top-color:var(--border)}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-delete\)\]\:bg-diff-delete-code .openresearch-diff-file .diff-line:has(.diff-code-delete){background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-delete\)\]\:bg-diff-delete-code .openresearch-diff-file .diff-line:has(.diff-code-delete){background-color:color-mix(in oklab,var(--base) 92%,var(--accent-red))}}.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-insert\)\]\:bg-diff-insert-code .openresearch-diff-file .diff-line:has(.diff-code-insert){background-color:var(--base)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file_\.diff-line\:has\(\.diff-code-insert\)\]\:bg-diff-insert-code .openresearch-diff-file .diff-line:has(.diff-code-insert){background-color:color-mix(in oklab,var(--base) 91%,var(--accent-green))}}.\[\&_\.openresearch-diff-file\.diff-unified\]\:table-fixed .openresearch-diff-file.diff-unified{table-layout:fixed}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:first-child\]\:p-0 .openresearch-diff-file.diff-unified .diff-line>td:first-child{padding:0}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:w-\[7ch\] .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:7ch}.\[\&_\.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-e .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:border-e-border .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){border-inline-end-color:var(--border)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:ps-3\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-inline-start:calc(var(--spacing) * 3.5)}.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:pe-2\.5 .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){padding-inline-end:calc(var(--spacing) * 2.5)}.\[\&_\.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\)\]\: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\)\]\:text-end .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){text-align:end}.\[\&_\.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-diff-gutter-text .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.openresearch-diff-file\.diff-unified_\.diff-line_\>_td\:nth-child\(2\)\]\:text-diff-gutter-text .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){color:color-mix(in oklab,var(--text) 45%,var(--base))}}.\[\&_\.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-\[7ch\] .openresearch-diff-file.diff-unified col.diff-gutter-col:nth-child(2){width:7ch}.\[\&_\.option-menu\]\:w-max .option-menu{width:max-content}.\[\&_\.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\]\:ps-3 .paper-destination{padding-inline-start:calc(var(--spacing) * 3)}.\[\&_\.paper-destination\]\:pe-2 .paper-destination{padding-inline-end:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pt-2 .paper-destination{padding-top:calc(var(--spacing) * 2)}.\[\&_\.paper-destination\]\:pb-2 .paper-destination{padding-bottom:calc(var(--spacing) * 2)}.\[\&_\.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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.paper-destination_code\]\:font-normal .paper-destination code{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_\.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\]\:text-xs .paper-pick .id{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.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-sm .paper-pick .title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.paper-pick_\.title\]\:font-medium .paper-pick .title{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.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\]\:text-xs .paper-results .id{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.paper-results_\.id\]\:text-muted .paper-results .id{color:var(--muted)}.\[\&_\.paper-results_\.title\]\:text-sm .paper-results .title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.paper-results_\.title\]\:font-medium .paper-results .title{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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-start .paper-results button{text-align:start}.\[\&_\.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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.path_code\]\:font-medium .path code{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.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)}.\[\&_\.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-default-title\]\:text-base .project-default-title,.\[\&_\.project-field-label\]\:text-base .project-field-label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.project-field-label\]\:font-medium .project-field-label{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.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(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.project-location-label\]\:font-medium .project-location-label{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.project-location-label\]\:text-text .project-location-label{color:var(--text)}.\[\&_\.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-base .project-path-notice{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.project-path-notice\]\:text-sm .project-path-notice{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.project-path-notice\]\:leading-\[1\.4\] .project-path-notice{--tw-leading:1.4;line-height:1.4}.\[\&_\.project-path-notice\]\:leading-relaxed .project-path-notice{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_\.project-path-notice\]\:text-subtext .project-path-notice{color:var(--subtext)}.\[\&_\.project-path-notice\]\:text-text .project-path-notice{color:var(--text)}.\[\&_\.project-path-notice\.error\]\:border-danger-notice-border .project-path-notice.error{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.project-path-notice\.error\]\:border-danger-notice-border .project-path-notice.error{border-color:color-mix(in srgb,var(--accent-red) 35%,var(--border-variant))}}.\[\&_\.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\]\:pt-0 .rail-body{padding-top:0}.\[\&_\.rail-body\]\:pb-1 .rail-body{padding-bottom: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\]\:text-sm .repo-hint{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.repo-hint\]\:font-normal .repo-hint{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_\.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}.\[\&_\.sel\]\:font-medium .sel{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.sel\]\:text-text .sel{color:var(--text)}.\[\&_\.session-dot\]\:inline-flex .session-dot{display:inline-flex}.\[\&_\.session-dot\]\:w-4 .session-dot{width:calc(var(--spacing) * 4)}.\[\&_\.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-dot\:empty\]\:hidden .session-dot:empty{display:none}.\[\&_\.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\:focus-visible\]\:inline-flex .session-menu-btn:focus-visible{display:inline-flex}.\[\&_\.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-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\]\:\[mask-image\:linear-gradient\(to_right\,black_calc\(100\%_-_16px\)\,transparent\)\] .session-title{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 16px),#0000);mask-image:linear-gradient(90deg,#000 calc(100% - 16px),#0000)}.\[\&_\.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\]\: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-form\]\:mt-6 .settings-form{margin-top:calc(var(--spacing) * 6)}.\[\&_\.settings-form\]\:border-t-0 .settings-form{border-top-style:var(--tw-border-style);border-top-width:0}.\[\&_\.settings-form\]\:pt-0 .settings-form{padding-top:0}.\[\&_\.settings-sub\]\:mb-3 .settings-sub{margin-bottom:calc(var(--spacing) * 3)}.\[\&_\.skill-chip\]\:align-baseline .skill-chip{vertical-align:baseline}.\[\&_\.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-xs .stats{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\.stats\]\:font-medium .stats{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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-hover-strong .tab-close:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_\.tab-close\:hover\]\:bg-hover-strong .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\]\:pe-1 .tab-label>span{padding-inline-end: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\]\:pe-1 .tab-label:after{padding-inline-end:var(--spacing)}.\[\&_\.tab-label\:\:after\]\:font-medium .tab-label:after{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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}.\[\&_\.title\]\:max-w-60 .title{max-width:calc(var(--spacing) * 60)}.\[\&_\.title\]\:overflow-hidden .title{overflow:hidden}.\[\&_\.title\]\:text-sm .title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.title\]\:font-medium .title{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\.title\]\:text-ellipsis .title{text-overflow:ellipsis}.\[\&_\.title\]\:whitespace-nowrap .title{white-space:nowrap}.\[\&_\.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\]\:flex .v{display:flex}.\[\&_\.v\]\:min-w-0 .v{min-width:0}.\[\&_\.v\]\:flex-wrap .v{flex-wrap:wrap}.\[\&_\.v\]\:items-center .v{align-items:center}.\[\&_\.v\]\:gap-2 .v{gap:calc(var(--spacing) * 2)}.\[\&_\.v\]\:font-sans .v{font-family:var(--sans)}.\[\&_\.v\]\:text-base .v{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\.v\]\:text-sm .v{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\.v\]\:break-words .v{overflow-wrap:break-word}.\[\&_\.v\]\:break-all .v{word-break:break-all}.\[\&_\.v\]\:text-text .v{color:var(--text)}.\[\&_\: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(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\: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(--font-weight-medium);font-weight:var(--font-weight-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-base>.error{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_\>_\.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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\>_\.seg_button\]\:font-medium>.seg button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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}.\[\&_\>_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(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_\>_label\]\:gap-2>label{gap:calc(var(--spacing) * 2)}.\[\&_\>_p\]\:m-0>p{margin:0}.\[\&_\>_p\]\:text-sm>p{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_\>_p\]\:leading-relaxed>p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_\>_p\]\:text-text>p{color:var(--text)}.\[\&_\>_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)}.\[\&_\[data-tip-align\=\'end\'\]\:\:after\]\:start-auto [data-tip-align=end]:after{inset-inline-start:auto}.\[\&_\[data-tip-align\=\'end\'\]\:\:after\]\:end-0 [data-tip-align=end]:after{inset-inline-end:calc(var(--spacing) * 0)}.\[\&_\[data-tip-align\=\'end\'\]\:\:after\]\:translate-none [data-tip-align=end]:after{translate:none}.\[\&_\[data-tip-align\=\'start\'\]\:\:after\]\:start-0 [data-tip-align=start]:after{inset-inline-start:calc(var(--spacing) * 0)}.\[\&_\[data-tip-align\=\'start\'\]\:\:after\]\:translate-none [data-tip-align=start]:after{translate:none}.\[\&_a\]\:text-sm a{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_a\]\:whitespace-nowrap a{white-space:nowrap}.\[\&_a\]\:text-primary a{color:var(--primary)}.\[\&_a\]\:text-subtext a{color:var(--subtext)}.\[\&_blockquote\]\:mx-0 blockquote{margin-inline:0}.\[\&_blockquote\]\:my-1\.5 blockquote{margin-block:calc(var(--spacing) * 1.5)}.\[\&_blockquote\]\:border-s-\[3px\] blockquote{border-inline-start-style:var(--tw-border-style);border-inline-start-width:3px}.\[\&_blockquote\]\:border-s-border blockquote{border-inline-start-color:var(--border)}.\[\&_blockquote\]\:ps-2\.5 blockquote{padding-inline-start:calc(var(--spacing) * 2.5)}.\[\&_blockquote\]\:pe-0 blockquote{padding-inline-end:0}.\[\&_blockquote\]\:pt-0\.5 blockquote{padding-top:calc(var(--spacing) * .5)}.\[\&_blockquote\]\:pb-0\.5 blockquote{padding-bottom:calc(var(--spacing) * .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\]\: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-border button{border-color:var(--border)}.\[\&_button\]\:border-b-border-variant button{border-bottom-color:var(--border-variant)}.\[\&_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-\[11px\] button{padding-block:11px}.\[\&_button\]\:text-start button{text-align:start}.\[\&_button\]\:text-sm button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_button\]\:font-medium button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_button\]\:text-muted button{color:var(--muted)}.\[\&_button\]\:text-text button{color:var(--text)}.\[\&_button\]\:\[font\:inherit\] button{font:inherit}.\[\&_button\.active\]\:bg-background button.active{background-color:var(--base)}.\[\&_button\.active\]\:bg-surface button.active{background-color:var(--surface)}.\[\&_button\.active\]\:shadow-diff-active 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\.active\]\:shadow-segment button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&_button\.active\]\:shadow-segment button.active{--tw-shadow:0 1px 3px var(--tw-shadow-color,color-mix(in oklab, var(--text) 25%, transparent))}}.\[\&_button\.active\]\:shadow-segment 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\:disabled\]\:cursor-default button:disabled{cursor:default}.\[\&_button\:disabled\]\:text-muted button:disabled{color:var(--muted)}.\[\&_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\]\: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\]\:font-mono code{font-family:var(--mono)}.\[\&_code\]\:text-sm code{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_code\]\:text-xs code{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_code\]\:font-medium code{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_code\]\:text-ellipsis code{text-overflow:ellipsis}.\[\&_code\]\:whitespace-nowrap code{white-space:nowrap}.\[\&_code\]\:whitespace-pre-wrap code{white-space:pre-wrap}.\[\&_code\]\:text-primary code{color:var(--primary)}.\[\&_code\]\:text-text code{color:var(--text)}.\[\&_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(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.\[\&_h1\]\:text-4xl h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.\[\&_h1\]\:text-xl h1{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_h1\]\:text-prose-emphasis h1{font-size:1.05em}.\[\&_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(--font-weight-semibold);font-weight:var(--font-weight-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-3xl h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.\[\&_h2\]\:text-4xl h2{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.\[\&_h2\]\:text-5xl h2{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.\[\&_h2\]\:text-lg h2{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_h2\]\:text-sm h2{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_h2\]\:text-xl h2{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_h2\]\:text-prose-emphasis h2{font-size:1.05em}.\[\&_h2\]\:leading-tight h2{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.\[\&_h2\]\:font-medium h2{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_h2\]\:font-semibold h2{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_h2\]\:tracking-\[-0\.02em\] h2{--tw-tracking:-.02em;letter-spacing:-.02em}.\[\&_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-3 h3{margin-top:calc(var(--spacing) * 3)}.\[\&_h3\]\:mt-5\.5 h3{margin-top:calc(var(--spacing) * 5.5)}.\[\&_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-base h3{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_h3\]\:text-xl h3{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_h3\]\:text-prose-emphasis h3{font-size:1.05em}.\[\&_h3\]\:leading-\[1\.35\] h3{--tw-leading:1.35;line-height:1.35}.\[\&_h3\]\:font-semibold h3{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-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-lg h4{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_h4\]\:text-sm h4{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_h4\]\:text-prose-emphasis h4{font-size:1.05em}.\[\&_h4\]\:leading-\[1\.4\] h4{--tw-leading:1.4;line-height:1.4}.\[\&_h4\]\:font-semibold h4{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_h4\]\:text-accent-amber h4{color:var(--accent-amber)}.\[\&_h4\]\:text-text h4{color:var(--text)}.\[\&_img\]\:mx-auto img{margin-inline:auto}.\[\&_img\]\:my-0 img{margin-block:0}.\[\&_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\]\:max-h-\[min\(480px\,60vh\)\] img{max-height:min(480px,60vh)}.\[\&_img\]\:w-13 img{width:calc(var(--spacing) * 13)}.\[\&_img\]\:w-auto img{width:auto}.\[\&_img\]\:max-w-55 img{max-width:calc(var(--spacing) * 55)}.\[\&_img\]\:max-w-full img{max-width:100%}.\[\&_img\]\:rounded-none img{border-radius:0}.\[\&_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-0 img{border-style:var(--tw-border-style);border-width:0}.\[\&_img\]\:border-border img{border-color:var(--border)}.\[\&_img\]\:border-border-variant img{border-color:var(--border-variant)}.\[\&_img\]\:object-contain img{object-fit:contain}.\[\&_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\]\:px-2\.5 input{padding-inline:calc(var(--spacing) * 2.5)}.\[\&_input\]\:py-2 input{padding-block:calc(var(--spacing) * 2)}.\[\&_input\]\:font-sans input{font-family:var(--sans)}.\[\&_input\]\:text-sm input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_input\]\:font-normal input{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_input\]\:text-text input{color:var(--text)}.\[\&_input\]\:outline-none input{--tw-outline-style:none;outline-style:none}.\[\&_input\:\:placeholder\]\:text-subtext input::placeholder{color:var(--subtext)}.\[\&_label\]\:flex label{display:flex}.\[\&_label\]\:flex-col label{flex-direction:column}.\[\&_label\]\:gap-1 label{gap:var(--spacing)}.\[\&_label\]\:text-sm label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_label\]\:font-medium label{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-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(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_legend\]\:font-medium legend{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_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\]\:ps-5\.5 ol{padding-inline-start: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-\[46ch\] p{max-width:46ch}.\[\&_p\]\:text-sm p{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_p\]\:leading-normal p{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_p\]\:text-balance p{text-wrap:balance}.\[\&_p\]\:text-subtext p{color:var(--subtext)}.\[\&_p\]\:text-text p{color:var(--text)}.\[\&_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(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.\[\&_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(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.\[\&_p\.empty-state-title\]\:font-normal p.empty-state-title{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_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-border-muted pre{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.\[\&_pre\]\:border-border-muted 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(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_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(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_pre_code\]\:text-inherit pre code{color:inherit}.\[\&_select\]\:font-sans select{font-family:var(--sans)}.\[\&_select\]\:text-sm select{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_select\]\:font-normal select{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.\[\&_select\]\:text-text select{color:var(--text)}.\[\&_span\]\:absolute span{position:absolute}.\[\&_span\]\:start-\[3px\] span{inset-inline-start:3px}.\[\&_span\]\:top-\[3px\] span{top:3px}.\[\&_span\]\:h-3\.5 span{height:calc(var(--spacing) * 3.5)}.\[\&_span\]\:w-3\.5 span{width:calc(var(--spacing) * 3.5)}.\[\&_span\]\:translate-x-4 span{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&_span\]\:overflow-hidden span{overflow:hidden}.\[\&_span\]\:rounded-full span{border-radius:999px}.\[\&_span\]\:bg-background span{background-color:var(--base)}.\[\&_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(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_strong\]\:font-semibold strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-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\]\: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-sm table{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_tbody_tr\:hover_td\]\:bg-surface-bright tbody tr:hover td{background-color:var(--surface-bright)}.\[\&_td\]\:h-12 td{height:calc(var(--spacing) * 12)}.\[\&_td\]\:border-b td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_td\]\:border-b-border-variant td{border-bottom-color:var(--border-variant)}.\[\&_td\]\:border-b-divider-faint td{border-bottom-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&_td\]\:border-b-divider-faint td{border-bottom-color:color-mix(in oklab,var(--text) 6%,transparent)}}.\[\&_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\]\:ps-0 td{padding-inline-start:0}.\[\&_td\]\:pe-2\.5 td{padding-inline-end:calc(var(--spacing) * 2.5)}.\[\&_td\]\:pt-0 td{padding-top:0}.\[\&_td\]\:pb-0 td{padding-bottom:0}.\[\&_td\]\:text-start td{text-align:start}.\[\&_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\]\: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\]\:text-end td:last-child{text-align:end}.\[\&_td\:last-child\]\:whitespace-nowrap td:last-child{white-space:nowrap}.\[\&_td\[colspan\]\]\:text-start td[colspan]{text-align:start}.\[\&_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\]\:font-mono textarea{font-family:var(--mono)}.\[\&_textarea\]\:text-base textarea{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\[\&_textarea\]\:text-sm textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_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\]\:text-start th{text-align:start}.\[\&_th\]\:text-sm th{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_th\]\:font-medium th{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_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)}.\[\&_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(--font-weight-medium);font-weight:var(--font-weight-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\]\:ps-5\.5 ul{padding-inline-start: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-hover-muted.active{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\.active\]\:bg-hover-muted.active{background-color:color-mix(in oklab,var(--text) 8%,transparent)}}.\[\&\.active\]\:bg-panel.active{background-color:var(--panel)}.\[\&\.active\]\:bg-surface.active{background-color:var(--surface)}.\[\&\.active\]\:font-medium.active{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&\.active\]\:text-muted.active{color:var(--muted)}.\[\&\.active\]\:text-primary.active{color:var(--primary)}.\[\&\.active\]\:text-text.active{color:var(--text)}.\[\&\.active\:\:after\]\:absolute.active:after{position:absolute}.\[\&\.active\:\:after\]\:start-0.active:after{inset-inline-start:calc(var(--spacing) * 0)}.\[\&\.active\:\:after\]\:end-0.active:after{inset-inline-end:calc(var(--spacing) * 0)}.\[\&\.active\:\:after\]\:-bottom-px.active:after{bottom:-1px}.\[\&\.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\]\:start-auto.align-right{inset-inline-start:auto}.\[\&\.align-right\]\:end-0.align-right{inset-inline-end:calc(var(--spacing) * 0)}.\[\&\.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)}.\[\&\.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\]\:pe-0\.5.closable{padding-inline-end:calc(var(--spacing) * .5)}.\[\&\.code\]\:text-accent-orange.code{color:var(--accent-orange)}.\[\&\.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-dot\]\:hidden.editing .session-dot,.\[\&\.editing_\.session-menu-btn\]\:hidden.editing .session-menu-btn{display:none}.\[\&\.err\]\:bg-accent-red.err{background-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-danger-outline.fail{border-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\.fail\]\:border-danger-outline.fail{border-color:color-mix(in oklab,var(--accent-red) 55%,transparent)}}.\[\&\.failed\]\:text-accent-red.failed{color:var(--accent-red)}.\[\&\.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-tree-live.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)}.\[\&\.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-panel-max.max{--tw-shadow:0 12px 40px var(--tw-shadow-color,var(--text))}@supports (color:color-mix(in lab,red,red)){.\[\&\.max\]\:shadow-panel-max.max{--tw-shadow:0 12px 40px var(--tw-shadow-color,color-mix(in oklab, var(--text) 22%, transparent))}}.\[\&\.max\]\:shadow-panel-max.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-dot\]\:hidden.menu-open .session-dot{display:none}.\[\&\.menu-open_\.session-menu-btn\]\:inline-flex.menu-open .session-menu-btn{display:inline-flex}.\[\&\.muted\]\:text-muted.muted{color:var(--muted)}.\[\&\.ok\]\:bg-accent-green.ok{background-color:var(--accent-green)}.\[\&\.on\]\:bg-primary.on{background-color:var(--primary)}.\[\&\.on\]\:text-background.on{color:var(--base)}.\[\&\.open\]\:rotate-90.open{rotate:90deg}.\[\&\.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-s-accent-amber.permission{border-inline-start-color:var(--accent-amber)}.\[\&\.plan\]\:border-s-accent-blue.plan{border-inline-start-color:var(--accent-blue)}.\[\&\.question\]\:border-s-accent-purple.question{border-inline-start-color:var(--accent-purple)}.\[\&\.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-selected.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\]\:start-auto.session-menu{inset-inline-start:auto}.\[\&\.session-menu\]\:end-1\.5.session-menu{inset-inline-end:calc(var(--spacing) * 1.5)}.\[\&\.session-menu\]\:top-\[calc\(100\%_-_2px\)\].session-menu{top:calc(100% - 2px)}.\[\&\.session-menu\]\:min-w-35.session-menu{min-width:calc(var(--spacing) * 35)}.\[\&\.spreadsheet\]\:text-accent-green.spreadsheet,.\[\&\.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)}.\[\&\.warn\]\:bg-accent-amber.warn{background-color:var(--accent-amber)}.\[\&\:\:-webkit-details-marker\]\:hidden::-webkit-details-marker{display:none}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}.\[\&\:\:-webkit-search-cancel-button\]\:hidden::-webkit-search-cancel-button{display:none}.\[\&\:\:after\]\:pointer-events-none:after{pointer-events:none}.\[\&\:\:after\]\:absolute:after{position:absolute}.\[\&\:\:after\]\:start-0:after{inset-inline-start:calc(var(--spacing) * 0)}.\[\&\:\:after\]\:end-0:after{inset-inline-end:calc(var(--spacing) * 0)}.\[\&\:\:after\]\:top-full:after{top:100%}.\[\&\:\: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)}.\[\&\:active\]\:bg-resizer-hover:active{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\]\:bg-resizer-hover:active{background-color:color-mix(in oklab,var(--text) 12%,transparent)}}.\[\&\:active\:not\(\:disabled\)\]\:border-primary-active:active:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\:not\(\:disabled\)\]\:border-primary-active:active:not(:disabled){border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\:active\:not\(\:disabled\)\]\:bg-danger-active:active:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\:not\(\:disabled\)\]\:bg-danger-active:active:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 14%,transparent)}}.\[\&\:active\:not\(\:disabled\)\]\:bg-highlight:active:not(:disabled){background-color:var(--highlight)}.\[\&\:active\:not\(\:disabled\)\]\:bg-primary-active:active:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:active\:not\(\:disabled\)\]\:bg-primary-active:active:not(:disabled){background-color:color-mix(in oklab,var(--primary) 80%,var(--text))}}.\[\&\:disabled\]\:cursor-default:disabled{cursor:default}.\[\&\:focus\]\:border-accent-blue:focus{border-color:var(--accent-blue)}.\[\&\: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-visible_\.session-dot\]\:hidden:focus-visible .session-dot{display:none}.\[\&\:focus-visible_\.session-menu-btn\]\:inline-flex:focus-visible .session-menu-btn{display:inline-flex}.\[\&\:has\(\.session-menu-btn\:focus-visible\)_\.session-dot\]\:hidden:has(.session-menu-btn:focus-visible) .session-dot{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\]\:border-primary:hover{border-color:var(--primary)}.\[\&\:hover\]\:border-text:hover{border-color:var(--text)}.\[\&\:hover\]\:bg-canvas:hover{background-color:var(--canvas)}.\[\&\:hover\]\:bg-highlight:hover{background-color:var(--highlight)}.\[\&\:hover\]\:bg-panel:hover{background-color:var(--panel)}.\[\&\:hover\]\:bg-resizer-hover:hover{background-color:var(--text)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\]\:bg-resizer-hover:hover{background-color:color-mix(in oklab,var(--text) 12%,transparent)}}.\[\&\:hover\]\:bg-surface:hover{background-color:var(--surface)}.\[\&\:hover\]\:bg-text:hover{background-color:var(--text)}.\[\&\:hover\]\:text-background:hover{color:var(--base)}.\[\&\:hover\]\:text-text:hover{color:var(--text)}.\[\&\:hover\]\:underline:hover{text-decoration-line:underline}.\[\&\:hover\]\:shadow-tree-hover: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_\.ft-row-delete\]\:opacity-100:hover .ft-row-delete,.\[\&\:hover_\.md-code-copy\]\:opacity-100:hover .md-code-copy{opacity:1}.\[\&\:hover_\.session-dot\]\:hidden:hover .session-dot{display:none}.\[\&\:hover_\.session-menu-btn\]\:inline-flex:hover .session-menu-btn{display:inline-flex}.\[\&\:hover\:not\(\.active\)\]\:bg-surface:hover:not(.active){background-color:var(--surface)}.\[\&\: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-accent-blue:hover:not(:disabled){border-color:var(--accent-blue)}.\[\&\:hover\:not\(\:disabled\)\]\:border-border-strong:hover:not(:disabled){border-color:var(--border-strong)}.\[\&\:hover\:not\(\:disabled\)\]\:border-primary-hover:hover:not(:disabled){border-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:border-primary-hover:hover:not(:disabled){border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\:hover\:not\(\:disabled\)\]\:border-text:hover:not(:disabled){border-color:var(--text)}.\[\&\:hover\:not\(\:disabled\)\]\:bg-accent-amber-subtle:hover:not(:disabled){background-color:var(--accent-amber-subtle)}.\[\&\:hover\:not\(\:disabled\)\]\:bg-accent-blue\/90:hover:not(:disabled){background-color:var(--accent-blue)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-accent-blue\/90:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-blue) 90%,transparent)}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-danger-hover:hover:not(:disabled){background-color:var(--accent-red)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-danger-hover:hover:not(:disabled){background-color:color-mix(in oklab,var(--accent-red) 8%,transparent)}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-primary-hover:hover:not(:disabled){background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-primary-hover:hover:not(:disabled){background-color:color-mix(in oklab,var(--primary) 88%,var(--text))}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-stop-hover:hover:not(:disabled){background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.\[\&\:hover\:not\(\:disabled\)\]\:bg-stop-hover:hover:not(:disabled){background-color:color-mix(in oklab,var(--surface) 88%,var(--text))}}.\[\&\:hover\:not\(\:disabled\)\]\:bg-surface:hover:not(:disabled){background-color:var(--surface)}.\[\&\:hover\:not\(\:disabled\)\]\:text-accent-red:hover:not(:disabled){color:var(--accent-red)}.\[\&\:hover\:not\(\:disabled\)\]\:text-text:hover:not(:disabled){color:var(--text)}.\[\&\: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\]\:-start-px:not(.active)+.tab:not(.active):before{inset-inline-start:-1px}.\[\&\: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\]\: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)}.\[\&\>\.settings-form\:first-child\]\:mt-0>.settings-form:first-child{margin-top:0}.\[\&\>div\:first-child\]\:border-t-0>div:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.\[\&\[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}: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\)\)\]\:ms-auto{margin-inline-start:auto}.\[\@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:720px){.\[\@container\(\(max-width\:_720px\)\)\]\:hidden{display:none}.\[\@container\(\(max-width\:_720px\)\)\]\:\!w-full{width:100%!important}}@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))}}@media(max-width:520px){.\[\@media\(\(max-width\:_520px\)\)\]\:flex-col{flex-direction:column}.\[\@media\(\(max-width\:_520px\)\)\]\:items-start{align-items:flex-start}}@media(max-width:600px){.\[\@media\(\(max-width\:_600px\)\)\]\:col-span-2{grid-column:span 2/span 2}.\[\@media\(\(max-width\:_600px\)\)\]\:grid-cols-2{grid-template-columns:repeat(2,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(max-width:960px){.\[\@media\(\(max-width\:_960px\)\)\]\:col-span-3{grid-column:span 3/span 3}.\[\@media\(\(max-width\:_960px\)\)\]\:mb-1{margin-bottom:var(--spacing)}.\[\@media\(\(max-width\:_960px\)\)\]\:block{display:block}.\[\@media\(\(max-width\:_960px\)\)\]\:hidden{display:none}.\[\@media\(\(max-width\:_960px\)\)\]\:grid-cols-\[minmax\(0\,0\.8fr\)_minmax\(0\,0\.8fr\)_minmax\(0\,1\.4fr\)\]{grid-template-columns:minmax(0,.8fr) minmax(0,.8fr) minmax(0,1.4fr)}.\[\@media\(\(max-width\:_960px\)\)\]\:flex-wrap{flex-wrap:wrap}.\[\@media\(\(max-width\:_960px\)\)\]\:items-start{align-items:flex-start}.\[\@media\(\(max-width\:_960px\)\)\]\:gap-x-4{column-gap:calc(var(--spacing) * 4)}.\[\@media\(\(max-width\:_960px\)\)\]\:gap-y-3{row-gap:calc(var(--spacing) * 3)}.\[\@media\(\(max-width\:_960px\)\)\]\:px-4{padding-inline:calc(var(--spacing) * 4)}.\[\@media\(\(max-width\:_960px\)\)\]\:py-4{padding-block:calc(var(--spacing) * 4)}.\[\@media\(\(max-width\:_960px\)\)\]\:pt-6{padding-top:calc(var(--spacing) * 6)}.\[\@media\(\(max-width\:_960px\)\)\]\:break-all{word-break:break-all}.\[\@media\(\(max-width\:_960px\)\)\]\:whitespace-normal{white-space:normal}}@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;--border:#d4d4d4;--border-variant:#e5e5e5;--accent-orange:#da642c;--accent-red:#d94654;--accent-teal:#209a84;--accent-blue:#3a8dff;--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;--skill-blue:#184f91;--skill-blue-subtle:#d9e9fb;--skill-blue-slash:#7fa6d2;--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;--modal-top:min(30vh, 260px);--term-bg:#1a1a1a;--term-foreground:#e6e1e0;--term-selection:#2c3441;--term-app-bg:#fdfbfb;--term-app-foreground:#1d1b1a;--term-app-selection:#e9e2d8;--term-app-ansi-black:#1d1b1a;--term-app-ansi-red:#c0392b;--term-app-ansi-green:#3d8b37;--term-app-ansi-yellow:#b26a00;--term-app-ansi-blue:#2a6fcb;--term-app-ansi-magenta:#8e44ad;--term-app-ansi-cyan:#1a8a7a;--term-app-ansi-white:#8f8a85;--term-app-ansi-bright-black:#6b6663;--term-app-ansi-bright-red:#d94654;--term-app-ansi-bright-green:#5eb64c;--term-app-ansi-bright-yellow:#da9100;--term-app-ansi-bright-blue:#3a8dff;--term-app-ansi-bright-magenta:#9c5cff;--term-app-ansi-bright-cyan:#209a84;--term-app-ansi-bright-white:#1d1b1a;--tool-shimmer:var(--text)}@supports (color:color-mix(in lab,red,red)){:root{--tool-shimmer:color-mix(in srgb, var(--text) 58%, var(--subtext))}}:root{--editor-selection:var(--primary)}@supports (color:color-mix(in lab,red,red)){:root{--editor-selection:color-mix(in oklab, var(--primary) 22%, transparent)}}:root{--readable-col:840px;--border-strong:var(--border);--accent:var(--primary);--teal:var(--accent-teal);--green:var(--accent-green);--red:var(--accent-red);--amber:var(--accent-amber);--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}:root[data-theme=light]{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;--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;--skill-blue:#79adf0;--skill-blue-subtle:#183452;--skill-blue-slash:#527ca8;--accent-purple-subtle:#251933;--dots-muted:#2a2523;--dots-strong:#555;--term-app-bg:#141110;--term-app-foreground:#e6e1e0;--term-app-selection:#2c3441;--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}.tinker-logo{clip-path:inset(34% 9%)}:root[data-theme=dark] .tinker-logo{filter:invert();mix-blend-mode:screen}:root:is([lang=fa],[lang=ar]) #root :where(p,h1,h2,h3,h4,h5,h6,button,label,li,th,td,dt,dd,[role=status],[role=alert]),.md :where(p,h1,h2,h3,h4,li,th,td,blockquote),:root:is([lang=fa],[lang=ar]) #root .file-view-note{unicode-bidi:plaintext}:where(pre,code,.font-mono,.code-source-text,.xterm,.openresearch-diff){direction:ltr;unicode-bidi:isolate}.xterm{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:var(--tool-shimmer);opacity:1}}.tool-running-shimmer{color:#0000;background:linear-gradient(100deg,var(--muted) 12%,var(--subtext) 34%,var(--tool-shimmer) 50%,var(--subtext) 66%,var(--muted) 88%);-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-group-summary .tool-group-label{transition:color .12s}.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;cursor:pointer;font-weight:inherit;text-align: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;display:inline}.tool-line,.tool-group-summary{font-weight:375}.tool-group-rows .tool-line{font-size:var(--text-sm)}.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}.md .file-chip{padding-block:.5px;line-height:1.3}.md .file-chip .file-chip-open{color:currentColor;opacity:.6}.md .file-chip .file-chip-label{text-decoration-line:underline;-webkit-text-decoration-color:var(--border-strong);text-decoration-color:var(--border-strong);text-underline-offset:2px;text-decoration-thickness:.6px}.md .file-chip:hover:not(:disabled) .file-chip-label,.md .file-chip:focus-visible .file-chip-label{-webkit-text-decoration-color:var(--primary);text-decoration-color:var(--primary)}.md .file-chip:disabled .file-chip-label{text-decoration-line:none}.md .file-chip:disabled .file-chip-open{display:none}.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}.project-row:hover .project-row-title{text-underline-offset:2px;text-decoration-line:underline}.project-row:has(.project-row-secondary:hover) .project-row-title{text-decoration-line:none}@media(hover:none){.project-row-delete{opacity:1;pointer-events:auto}}.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){.activity-pulse{animation:none}.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)}}.workspace-body .chat-header{padding-inline-end:8.5rem}.workspace-card-visible .chat-pane{padding-inline-end:16rem}.workspace-card-visible .chat-header{padding-inline-end:1rem}.workspace-card-visible .workspace-tools{top:1.25rem}.code-source-text,.openresearch-diff .diff-line{font-family:var(--mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.55;-moz-tab-size:4;tab-size:4;line-height:1.55}.code-source-wrap,.openresearch-diff .diff-code{overflow-wrap:normal;word-break:normal;overflow-wrap:break-word;white-space:pre-wrap}@property --tw-leading{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes pulse{50%{opacity:.5}} diff --git a/ui/dist/index.html b/ui/dist/index.html index a1788e3d..301cbc14 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -49,8 +49,8 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - - + + , document.body, )}
diff --git a/ui/src/components/ExperimentsTable.tsx b/ui/src/components/ExperimentsTable.tsx index 2e50dab9..3d6ea353 100644 --- a/ui/src/components/ExperimentsTable.tsx +++ b/ui/src/components/ExperimentsTable.tsx @@ -7,11 +7,12 @@ import { fmtNumber, runDisplayStatus, timeAgo, type Experiment, type Run } from import { StatusBadge } from "./StatusBadge"; import { tabOpenGestureHandlers, type TabOpenIntent } from "../tabPreview"; import { Button } from "./ui"; -import { ArchiveMenu } from "./ArchiveMenu"; +import { ArchiveMenu, type ArchiveActions } from "./ArchiveMenu"; export function ExperimentsTable({ runs, experiments, + archiveActions, emptyHint, onOpen, onOpenLogs, @@ -21,11 +22,12 @@ export function ExperimentsTable({ }: { runs: Run[]; experiments: Experiment[]; + archiveActions: Map; emptyHint?: string; onOpen: (experiment: Experiment, intent: TabOpenIntent) => void; onOpenLogs: (experimentId: string, runId: string, intent: TabOpenIntent) => void; onOpenCode: (experimentId: string, intent: TabOpenIntent) => void; - onArchive: (id: string, direction: "up" | "down", archived: boolean) => void; + onArchive: (id: string, direction: "ancestors" | "descendants" | "only", archived: boolean) => void; onCancel: (runId: string) => Promise; }) { const [pendingCancellation, setPendingCancellation] = useState>(new Set()); @@ -166,17 +168,10 @@ export function ExperimentsTable({ {m.experiments_table_code()} - {liveRun && ( )} +
); diff --git a/ui/src/components/TreeView.tsx b/ui/src/components/TreeView.tsx index 7d9093a5..4cb798c6 100644 --- a/ui/src/components/TreeView.tsx +++ b/ui/src/components/TreeView.tsx @@ -12,9 +12,10 @@ import { type NodeProps, type Viewport, } from "@xyflow/react"; -import { Ellipsis, FolderTree, Terminal } from "lucide-react"; +import { Archive, Ellipsis, FolderTree, Terminal } from "lucide-react"; +import { createPortal } from "react-dom"; import { GitHubMark } from "./BackendLogos"; -import { memo, useMemo, useRef } from "react"; +import { memo, useMemo, useRef, useState } from "react"; import { githubBranchUrl, fmtNumber, @@ -27,7 +28,9 @@ import { import type { ExperimentView } from "./DetailDrawer"; import type { CodeView } from "./CodeTab"; import { ExpHoverCard, dismissTreeHoverCards, useHoverIntent } from "./ExpHoverCard"; -import { ArchiveMenu } from "./ArchiveMenu"; +import { ArchiveMenu, type ArchiveActions } from "./ArchiveMenu"; +import { usePopover } from "./ModelPicker"; +import { MenuItem } from "./ui"; import { statusLabel, StatusBadge } from "./StatusBadge"; import { tabOpenGestureHandlers, type TabOpenIntent } from "../tabPreview"; @@ -48,6 +51,8 @@ const MAX_SQUARES = 8; // Keep in sync with the inline `.elided-node` classes below. const ELIDED_W = 148; const ELIDED_H = 44; +const ARCHIVED_W = 160; +const ARCHIVED_GAP_Y = 64; type ExpNodeData = { exp: Experiment; @@ -64,28 +69,35 @@ type ExpNodeData = { view: CodeView, intent: TabOpenIntent, ) => void; - onArchive: (id: string, direction: "up" | "down", archived: boolean) => void; + onArchive: (id: string, direction: "ancestors" | "descendants" | "only", archived: boolean) => void; + actions: ArchiveActions; }; type ExpFlowNode = Node; +type ArchivedNodeData = { + rootId: string; + count: number; + onRestoreRegion: (id: string) => void; +}; +type ArchivedFlowNode = Node; + type ElidedNodeData = { count: number; - archived: boolean; - onRevealHidden: (archived: boolean) => void; + onShowProjectScope: () => void; }; type ElidedFlowNode = Node; -type FlowNode = ExpFlowNode | ElidedFlowNode; +type FlowNode = ExpFlowNode | ArchivedFlowNode | ElidedFlowNode; interface TreeNode { exp: Experiment; children: TreeNode[]; } -/** What the layout actually draws: real experiments plus "…" placeholders - * standing in for experiments from other tasks (Current task scope only). */ +/** What the layout draws: experiment cards and hidden-region pills. */ type DisplayNode = | { kind: "exp"; exp: Experiment; children: DisplayNode[] } - | { kind: "elided"; id: string; count: number; archived: boolean; children: DisplayNode[] }; + | { kind: "archived"; id: string; rootId: string; count: number; children: DisplayNode[] } + | { kind: "elided"; id: string; count: number; children: DisplayNode[] }; function buildForest(experiments: Experiment[]): TreeNode[] { const byId = new Map(experiments.map((e) => [e.id, { exp: e, children: [] as TreeNode[] }])); @@ -109,7 +121,7 @@ function buildForest(experiments: Experiment[]): TreeNode[] { /** Keep the nodes `mine` accepts, collapse each maximal rejected region on the * path to them into one "…" pill, and drop rejected subtrees that lead * nowhere. Elided ids key off the region root, so they're stable across renders. */ -function elideHiddenRegions(roots: TreeNode[], mine: (n: TreeNode) => boolean, isArchivedHidden: (n: TreeNode) => boolean): DisplayNode[] { +function elideHiddenRegions(roots: TreeNode[], mine: (n: TreeNode) => boolean): DisplayNode[] { // Memoized so the pass stays linear on deep chains. const sizes = new Map(); const size = (n: TreeNode): number => { @@ -123,23 +135,13 @@ function elideHiddenRegions(roots: TreeNode[], mine: (n: TreeNode) => boolean, i mines.set(n, memo); return memo; }; - const archived = new Map(); - const hasArchived = (n: TreeNode): boolean => { - const memo = archived.get(n) ?? (isArchivedHidden(n) || n.children.some(hasArchived)); - archived.set(n, memo); - return memo; - }; function visit(node: TreeNode): DisplayNode[] { if (mine(node)) { const children: DisplayNode[] = []; let foreignCount = 0; - let foreignArchived = false; for (const c of node.children) { if (hasMine(c)) children.push(...visit(c)); - else { - foreignCount += size(c); - foreignArchived ||= hasArchived(c); - } + else foreignCount += size(c); } // The pill goes after the real children (not createdAt-sorted) so the // placeholder stays out of the chronological left-to-right reading. @@ -148,37 +150,54 @@ function elideHiddenRegions(roots: TreeNode[], mine: (n: TreeNode) => boolean, i kind: "elided", id: `el-${node.exp.id}`, count: foreignCount, - archived: foreignArchived, children: [], }); return [{ kind: "exp", exp: node.exp, children }]; } if (!hasMine(node)) return []; let count = 0; - let regionArchived = false; const mineChildren: DisplayNode[] = []; // Walk the foreign region rooted here, tallying every node in it and // recursing out through each kept descendant; `size(c)` swallows whole // foreign subtrees that contain nothing kept. (function absorb(n: TreeNode) { count += 1; - regionArchived ||= isArchivedHidden(n); for (const c of n.children) { if (mine(c)) mineChildren.push(...visit(c)); else if (hasMine(c)) absorb(c); - else { - count += size(c); - regionArchived ||= hasArchived(c); - } + else count += size(c); } })(node); - return [{ kind: "elided", id: `el-${node.exp.id}`, count, archived: regionArchived, children: mineChildren }]; + return [{ kind: "elided", id: `el-${node.exp.id}`, count, children: mineChildren }]; } return roots.flatMap(visit); } +function collapseArchivedRegions(roots: DisplayNode[]): DisplayNode[] { + function visit(node: DisplayNode): DisplayNode { + if (node.kind !== "exp" || !node.exp.archived) + return { ...node, children: node.children.map(visit) }; + let count = 0; + const children: DisplayNode[] = []; + function absorb(archived: DisplayNode & { kind: "exp" }) { + count += 1; + for (const child of archived.children) { + if (child.kind === "exp" && child.exp.archived) absorb(child); + else children.push(visit(child)); + } + } + absorb(node); + return { kind: "archived", id: `ar-${node.exp.id}`, rootId: node.exp.id, count, children }; + } + return roots.map(visit); +} + function nodeWidth(node: DisplayNode): number { - return node.kind === "exp" ? NODE_W : ELIDED_W; + return node.kind === "exp" ? NODE_W : node.kind === "archived" ? ARCHIVED_W : ELIDED_W; +} + +function nodeHeight(node: DisplayNode): number { + return node.kind === "exp" ? NODE_H : ELIDED_H; } function nodeId(node: DisplayNode): string { @@ -201,7 +220,7 @@ function runSquareClass(status: string): string { const ExpNode = memo(function ExpNode({ data }: NodeProps) { useLocale(); - const { exp, latestRun, runs, isBaseline, parentSlug, githubOwner, githubRepo, onOpenView, onOpenCode, onArchive } = data; + const { exp, latestRun, runs, isBaseline, parentSlug, githubOwner, githubRepo, onOpenView, onOpenCode, onArchive, actions } = data; const status = latestRun ? runDisplayStatus(latestRun) : undefined; const live = status === "running" || status === "starting" || status === "cancelling"; const kind = isBaseline ? m.tree_baseline() : live ? m.tree_running() : m.tree_experiment(); @@ -283,10 +302,9 @@ const ExpNode = memo(function ExpNode({ data }: NodeProps) { {m.tree_view_code()} - {/* Icon-only: labeled actions + the link overflow the card's fixed width. */} {githubOwner && githubRepo && ) { > } +
{/* Node and card share one leave handler — React's enter/leave pairing @@ -319,9 +338,55 @@ const ExpNode = memo(function ExpNode({ data }: NodeProps) { ); }); +const ArchivedNode = memo(function ArchivedNode({ data }: NodeProps) { + useLocale(); + const { rootId, count, onRestoreRegion } = data; + const triggerRef = useRef(null); + const menu = usePopover(triggerRef); + const [position, setPosition] = useState({ top: 0, left: 0 }); + const toggle = () => { + if (!menu.open && triggerRef.current) { + const rect = triggerRef.current.getBoundingClientRect(); + const below = window.innerHeight - rect.bottom >= 44; + setPosition({ + top: below ? rect.bottom + 4 : Math.max(4, rect.top - 44), + left: Math.max(4, Math.min(rect.left, window.innerWidth - 232)), + }); + } + menu.setOpen((open) => !open); + }; + return ( +
+ + + + {menu.open && createPortal( +
+ { + menu.setOpen(false); + onRestoreRegion(rootId); + }}> + {count === 1 ? m.tree_restore_only() : m.tree_restore_archived_count({ count: fmtNumber(count) })} + +
, document.body, + )} +
+ ); +}); + const ElidedNode = memo(function ElidedNode({ data }: NodeProps) { useLocale(); - const { count, archived, onRevealHidden } = data; + const { count, onShowProjectScope } = data; // A div, not a )} {menu.open && createPortal( -
+
{actions.archiveAbove && choose("ancestors", true)}>{m.tree_archive_above()}} {actions.archiveOnly && choose("only", true)}>{m.tree_archive_only()}} {actions.archiveDown && choose("descendants", true)}>{m.tree_archive_down()}} diff --git a/ui/src/components/TreeView.tsx b/ui/src/components/TreeView.tsx index 4cb798c6..7e44deff 100644 --- a/ui/src/components/TreeView.tsx +++ b/ui/src/components/TreeView.tsx @@ -371,7 +371,7 @@ const ArchivedNode = memo(function ArchivedNode({ data }: NodeProps {menu.open && createPortal( -
+
{ menu.setOpen(false); onRestoreRegion(rootId); From 1346de48884e932709c231a4171a99f45fda88fd Mon Sep 17 00:00:00 2001 From: Daniel Kim Date: Mon, 28 Sep 2026 14:57:47 -0700 Subject: [PATCH 6/6] Keep task-scoped archive restore within its session --- src/commands/up.rs | 3 +- src/local/experiments.rs | 45 +++++++++++++++++-- ...iew-iShJCj-I.js => PdfPreview-BpcsGwOT.js} | 2 +- .../{index-BVSdx42J.js => index-CYNqmXcL.js} | 26 +++++------ ui/dist/index.html | 2 +- ui/src/App.tsx | 6 +-- ui/src/api.ts | 2 +- 7 files changed, 62 insertions(+), 24 deletions(-) rename ui/dist/assets/{PdfPreview-iShJCj-I.js => PdfPreview-BpcsGwOT.js} (99%) rename ui/dist/assets/{index-BVSdx42J.js => index-CYNqmXcL.js} (98%) diff --git a/src/commands/up.rs b/src/commands/up.rs index baec35f0..e8177b91 100644 --- a/src/commands/up.rs +++ b/src/commands/up.rs @@ -1964,9 +1964,10 @@ async fn set_experiment_archive( "descendants" => local::experiments::ArchiveDirection::Descendants, "only" => local::experiments::ArchiveDirection::Only, "region" => local::experiments::ArchiveDirection::Region, + "taskRegion" => local::experiments::ArchiveDirection::TaskRegion, _ => { return Err(bad_request( - "direction must be ancestors, descendants, only, or region", + "direction must be ancestors, descendants, only, region, or taskRegion", )) } }; diff --git a/src/local/experiments.rs b/src/local/experiments.rs index 582bcce2..1d7587f0 100644 --- a/src/local/experiments.rs +++ b/src/local/experiments.rs @@ -70,6 +70,7 @@ pub enum ArchiveDirection { Descendants, Only, Region, + TaskRegion, } pub fn set_archived( @@ -93,8 +94,13 @@ fn archive_ids( ) -> Vec { match direction { ArchiveDirection::Only => vec![selected.id.clone()], - ArchiveDirection::Region => { - if !selected.archived { + ArchiveDirection::Region | ArchiveDirection::TaskRegion => { + let in_scope = |experiment: &LocalExperiment| { + !matches!(direction, ArchiveDirection::TaskRegion) + || selected.chat_session_id.is_some() + && experiment.chat_session_id == selected.chat_session_id + }; + if !selected.archived || !in_scope(selected) { return Vec::new(); } let by_id: HashMap<_, _> = experiments.iter().map(|e| (e.id.as_str(), e)).collect(); @@ -104,7 +110,7 @@ fn archive_ids( .as_deref() .and_then(|id| by_id.get(id)) { - if !parent.archived { + if !parent.archived || !in_scope(parent) { break; } root = parent; @@ -120,7 +126,11 @@ fn archive_ids( while let Some(experiment) = stack.pop() { ids.push(experiment.id.clone()); if let Some(next) = children.get(experiment.id.as_str()) { - stack.extend(next.iter().copied().filter(|child| child.archived)); + stack.extend( + next.iter() + .copied() + .filter(|child| child.archived && in_scope(child)), + ); } } ids @@ -349,6 +359,33 @@ mod tests { assert!(ids.contains(&"sibling".to_string())); } + #[test] + fn task_region_does_not_restore_other_sessions() { + let mut foreign_root = experiment(None, "foreign-root"); + foreign_root.archived = true; + foreign_root.chat_session_id = Some("other".into()); + let mut selected = experiment(Some(&foreign_root.id), "selected"); + selected.id = "selected".into(); + selected.archived = true; + selected.chat_session_id = Some("mine".into()); + let mut mine = experiment(Some(&selected.id), "mine"); + mine.id = "mine".into(); + mine.archived = true; + mine.chat_session_id = Some("mine".into()); + let mut foreign_sibling = experiment(Some(&foreign_root.id), "foreign-sibling"); + foreign_sibling.id = "foreign-sibling".into(); + foreign_sibling.archived = true; + foreign_sibling.chat_session_id = Some("other".into()); + let ids = archive_ids( + &[foreign_root, selected.clone(), mine, foreign_sibling], + &selected, + ArchiveDirection::TaskRegion, + ); + assert_eq!(ids.len(), 2); + assert!(ids.contains(&"selected".to_string())); + assert!(ids.contains(&"mine".to_string())); + } + #[test] fn default_parent_skips_archived_roots() { let dir = std::env::temp_dir().join(format!("orx-archive-root-{}", uuid::Uuid::new_v4())); diff --git a/ui/dist/assets/PdfPreview-iShJCj-I.js b/ui/dist/assets/PdfPreview-BpcsGwOT.js similarity index 99% rename from ui/dist/assets/PdfPreview-iShJCj-I.js rename to ui/dist/assets/PdfPreview-BpcsGwOT.js index ec40e478..25b04e46 100644 --- a/ui/dist/assets/PdfPreview-iShJCj-I.js +++ b/ui/dist/assets/PdfPreview-BpcsGwOT.js @@ -1,4 +1,4 @@ -var a1=Object.defineProperty;var cw=h=>{throw TypeError(h)};var o1=(h,e,t)=>e in h?a1(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t;var L=(h,e,t)=>o1(h,typeof e!="symbol"?e+"":e,t),By=(h,e,t)=>e.has(h)||cw("Cannot "+t);var a=(h,e,t)=>(By(h,e,"read from private field"),t?t.call(h):e.get(h)),b=(h,e,t)=>e.has(h)?cw("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,t),g=(h,e,t,n)=>(By(h,e,"write to private field"),n?n.call(h,t):e.set(h,t),t),y=(h,e,t)=>(By(h,e,"access private method"),t);var Zt=(h,e,t,n)=>({set _(i){g(h,e,i,t)},get _(){return a(h,e,n)}});import{g as vy,c as LA,r as gi,M as l1,j as fe,f as ku,I as Bu,a as c1,i as hw,P as h1,b as dw,S as d1,d as u1,C as f1,e as p1,h as g1}from"./index-BVSdx42J.js";const m1=()=>"Find in document",v1=()=>"在文档中查找",y1=()=>"جست‌وجو در سند",b1=()=>"البحث في المستند",E1=()=>"Buscar en el documento",w1=()=>"दस्तावेज़ में खोजें",uw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?v1():t==="fa"?y1():t==="ar"?b1():t==="es"?E1():t==="hi"?w1():m1()}),A1=()=>"Fit to width",x1=()=>"适应宽度",S1=()=>"متناسب با عرض",T1=()=>"ملاءمة العرض",C1=()=>"Ajustar al ancho",P1=()=>"चौड़ाई में फ़िट करें",fw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?x1():t==="fa"?S1():t==="ar"?T1():t==="es"?C1():t==="hi"?P1():A1()}),I1=()=>"Next match",R1=()=>"下一个匹配项",O1=()=>"مورد بعدی",M1=()=>"التطابق التالي",D1=()=>"Coincidencia siguiente",L1=()=>"अगला मिलान",pw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?R1():t==="fa"?O1():t==="ar"?M1():t==="es"?D1():t==="hi"?L1():I1()}),N1=()=>"Previous match",F1=()=>"上一个匹配项",k1=()=>"مورد قبلی",B1=()=>"التطابق السابق",j1=()=>"Coincidencia anterior",U1=()=>"पिछला मिलान",gw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?F1():t==="fa"?k1():t==="ar"?B1():t==="es"?j1():t==="hi"?U1():N1()});/** +var a1=Object.defineProperty;var cw=h=>{throw TypeError(h)};var o1=(h,e,t)=>e in h?a1(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t;var L=(h,e,t)=>o1(h,typeof e!="symbol"?e+"":e,t),By=(h,e,t)=>e.has(h)||cw("Cannot "+t);var a=(h,e,t)=>(By(h,e,"read from private field"),t?t.call(h):e.get(h)),b=(h,e,t)=>e.has(h)?cw("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,t),g=(h,e,t,n)=>(By(h,e,"write to private field"),n?n.call(h,t):e.set(h,t),t),y=(h,e,t)=>(By(h,e,"access private method"),t);var Zt=(h,e,t,n)=>({set _(i){g(h,e,i,t)},get _(){return a(h,e,n)}});import{g as vy,c as LA,r as gi,M as l1,j as fe,f as ku,I as Bu,a as c1,i as hw,P as h1,b as dw,S as d1,d as u1,C as f1,e as p1,h as g1}from"./index-CYNqmXcL.js";const m1=()=>"Find in document",v1=()=>"在文档中查找",y1=()=>"جست‌وجو در سند",b1=()=>"البحث في المستند",E1=()=>"Buscar en el documento",w1=()=>"दस्तावेज़ में खोजें",uw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?v1():t==="fa"?y1():t==="ar"?b1():t==="es"?E1():t==="hi"?w1():m1()}),A1=()=>"Fit to width",x1=()=>"适应宽度",S1=()=>"متناسب با عرض",T1=()=>"ملاءمة العرض",C1=()=>"Ajustar al ancho",P1=()=>"चौड़ाई में फ़िट करें",fw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?x1():t==="fa"?S1():t==="ar"?T1():t==="es"?C1():t==="hi"?P1():A1()}),I1=()=>"Next match",R1=()=>"下一个匹配项",O1=()=>"مورد بعدی",M1=()=>"التطابق التالي",D1=()=>"Coincidencia siguiente",L1=()=>"अगला मिलान",pw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?R1():t==="fa"?O1():t==="ar"?M1():t==="es"?D1():t==="hi"?L1():I1()}),N1=()=>"Previous match",F1=()=>"上一个匹配项",k1=()=>"مورد قبلی",B1=()=>"التطابق السابق",j1=()=>"Coincidencia anterior",U1=()=>"पिछला मिलान",gw=((h={},e={})=>{const t=e.locale??vy();return t==="zh-CN"?F1():t==="fa"?k1():t==="ar"?B1():t==="es"?j1():t==="hi"?U1():N1()});/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. diff --git a/ui/dist/assets/index-BVSdx42J.js b/ui/dist/assets/index-CYNqmXcL.js similarity index 98% rename from ui/dist/assets/index-BVSdx42J.js rename to ui/dist/assets/index-CYNqmXcL.js index ad99404c..6cbc8534 100644 --- a/ui/dist/assets/index-BVSdx42J.js +++ b/ui/dist/assets/index-CYNqmXcL.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PdfPreview-iShJCj-I.js","assets/PdfPreview-DNMWzGmA.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PdfPreview-BpcsGwOT.js","assets/PdfPreview-DNMWzGmA.css"])))=>i.map(i=>d[i]); var wV=Object.defineProperty;var P9=e=>{throw TypeError(e)};var kV=(e,n,t)=>n in e?wV(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Ws=(e,n,t)=>kV(e,typeof n!="symbol"?n+"":n,t),M2=(e,n,t)=>n.has(e)||P9("Cannot "+t);var le=(e,n,t)=>(M2(e,n,"read from private field"),t?t.call(e):n.get(e)),lt=(e,n,t)=>n.has(e)?P9("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Ue=(e,n,t,r)=>(M2(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),Ht=(e,n,t)=>(M2(e,n,"access private method"),t);var Op=(e,n,t,r)=>({set _(s){Ue(e,n,s,t)},get _(){return le(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function vm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O2={exports:{}},Dp={};/** * @license React * react-jsx-runtime.production.js @@ -46,8 +46,8 @@ var wV=Object.defineProperty;var P9=e=>{throw TypeError(e)};var kV=(e,n,t)=>n in `);for(R=S=0;SR||de[S]!==Se[R]){var Be=` `+de[S].replace(" at new "," at ");return l.displayName&&Be.includes("")&&(Be=Be.replace("",l.displayName)),Be}while(1<=S&&0<=R);break}}}finally{Ke=!1,Error.prepareStackTrace=g}return(g=l?l.displayName||l.name:"")?Le(g):""}function xe(l,d){switch(l.tag){case 26:case 27:case 5:return Le(l.type);case 16:return Le("Lazy");case 13:return l.child!==d&&d!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return Ne(l.type,!1);case 11:return Ne(l.type.render,!1);case 1:return Ne(l.type,!0);case 31:return Le("Activity");default:return""}}function rt(l){try{var d="",g=null;do d+=xe(l,g),g=l,l=l.return;while(l);return d}catch(S){return` Error generating stack: `+S.message+` -`+S.stack}}var Ze=Object.prototype.hasOwnProperty,ot=e.unstable_scheduleCallback,kt=e.unstable_cancelCallback,qt=e.unstable_shouldYield,dt=e.unstable_requestPaint,pt=e.unstable_now,Ie=e.unstable_getCurrentPriorityLevel,pe=e.unstable_ImmediatePriority,je=e.unstable_UserBlockingPriority,He=e.unstable_NormalPriority,st=e.unstable_LowPriority,_t=e.unstable_IdlePriority,Ct=e.log,bt=e.unstable_setDisableYieldValue,Yt=null,un=null;function Tt(l){if(typeof Ct=="function"&&bt(l),un&&typeof un.setStrictMode=="function")try{un.setStrictMode(Yt,l)}catch{}}var ht=Math.clz32?Math.clz32:gs,mt=Math.log,_n=Math.LN2;function gs(l){return l>>>=0,l===0?32:31-(mt(l)/_n|0)|0}var br=256,Kt=262144,Bn=4194304;function _r(l){var d=l&42;if(d!==0)return d;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function yr(l,d,g){var S=l.pendingLanes;if(S===0)return 0;var R=0,O=l.suspendedLanes,X=l.pingedLanes;l=l.warmLanes;var re=S&134217727;return re!==0?(S=re&~O,S!==0?R=_r(S):(X&=re,X!==0?R=_r(X):g||(g=re&~l,g!==0&&(R=_r(g))))):(re=S&~O,re!==0?R=_r(re):X!==0?R=_r(X):g||(g=S&~l,g!==0&&(R=_r(g)))),R===0?0:d!==0&&d!==R&&(d&O)===0&&(O=R&-R,g=d&-d,O>=g||O===32&&(g&4194048)!==0)?d:R}function Wr(l,d){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&d)===0}function Nt(l,d){switch(l){case 1:case 2:case 4:case 8:case 64:return d+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 d+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 vn(){var l=Bn;return Bn<<=1,(Bn&62914560)===0&&(Bn=4194304),l}function fn(l){for(var d=[],g=0;31>g;g++)d.push(l);return d}function hn(l,d){l.pendingLanes|=d,d!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Ir(l,d,g,S,R,O){var X=l.pendingLanes;l.pendingLanes=g,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=g,l.entangledLanes&=g,l.errorRecoveryDisabledLanes&=g,l.shellSuspendCounter=0;var re=l.entanglements,de=l.expirationTimes,Se=l.hiddenUpdates;for(g=X&~g;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var Yr=/[\n"\\]/g;function Rr(l){return l.replace(Yr,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function wo(l,d,g,S,R,O,X,re){l.name="",X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?l.type=X:l.removeAttribute("type"),d!=null?X==="number"?(d===0&&l.value===""||l.value!=d)&&(l.value=""+Xr(d)):l.value!==""+Xr(d)&&(l.value=""+Xr(d)):X!=="submit"&&X!=="reset"||l.removeAttribute("value"),d!=null?Hs(l,X,Xr(d)):g!=null?Hs(l,X,Xr(g)):S!=null&&l.removeAttribute("value"),R==null&&O!=null&&(l.defaultChecked=!!O),R!=null&&(l.checked=R&&typeof R!="function"&&typeof R!="symbol"),re!=null&&typeof re!="function"&&typeof re!="symbol"&&typeof re!="boolean"?l.name=""+Xr(re):l.removeAttribute("name")}function wi(l,d,g,S,R,O,X,re){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(l.type=O),d!=null||g!=null){if(!(O!=="submit"&&O!=="reset"||d!=null)){xi(l);return}g=g!=null?""+Xr(g):"",d=d!=null?""+Xr(d):g,re||d===l.value||(l.value=d),l.defaultValue=d}S=S??R,S=typeof S!="function"&&typeof S!="symbol"&&!!S,l.checked=re?l.checked:!!S,l.defaultChecked=!!S,X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"&&(l.name=X),xi(l)}function Hs(l,d,g){d==="number"&&Hi(l.ownerDocument)===l||l.defaultValue===""+g||(l.defaultValue=""+g)}function oi(l,d,g,S){if(l=l.options,d){d={};for(var R=0;R"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ko=!1;if(Vs)try{var ir={};Object.defineProperty(ir,"passive",{get:function(){ko=!0}}),window.addEventListener("test",ir,ir),window.removeEventListener("test",ir,ir)}catch{ko=!1}var ki=null,dr=null,fc=null;function Yu(){if(fc)return fc;var l,d=dr,g=d.length,S,R="value"in ki?ki.value:ki.textContent,O=R.length;for(l=0;l=bc),i_=" ",a_=!1;function Rl(l,d){switch(l){case"keyup":return Ff.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ml(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Co=!1;function Ol(l,d){switch(l){case"compositionend":return Ml(d);case"keypress":return d.which!==32?null:(a_=!0,i_);case"textInput":return l=d.data,l===i_&&a_?null:l;default:return null}}function Dl(l,d){if(Co)return l==="compositionend"||!vc&&Rl(l,d)?(l=Yu(),fc=dr=ki=null,Co=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1=d)return{node:g,offset:d-l};l=S}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Ee(g)}}function Pe(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?Pe(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function Jt(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var d=Hi(l.document);d instanceof l.HTMLIFrameElement;){try{var g=typeof d.contentWindow.location.href=="string"}catch{g=!1}if(g)l=d.contentWindow;else break;d=Hi(l.document)}return d}function mn(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}var Dn=Vs&&"documentMode"in document&&11>=document.documentMode,rn=null,Sr=null,J=null,ge=!1;function Ae(l,d,g){var S=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;ge||rn==null||rn!==Hi(S)||(S=rn,"selectionStart"in S&&mn(S)?S={start:S.selectionStart,end:S.selectionEnd}:(S=(S.ownerDocument&&S.ownerDocument.defaultView||window).getSelection(),S={anchorNode:S.anchorNode,anchorOffset:S.anchorOffset,focusNode:S.focusNode,focusOffset:S.focusOffset}),J&&me(J,S)||(J=S,S=zg(Sr,"onSelect"),0>=X,R-=X,jo=1<<32-ht(d)+R|g<cn?(jn=zt,zt=null):jn=zt.sibling;var qn=ze(we,zt,ke[cn],Fe);if(qn===null){zt===null&&(zt=jn);break}l&&zt&&qn.alternate===null&&d(we,zt),ve=O(qn,ve,cn),Hn===null?Ft=qn:Hn.sibling=qn,Hn=qn,zt=jn}if(cn===ke.length)return g(we,zt),Tn&&Cc(we,cn),Ft;if(zt===null){for(;cncn?(jn=zt,zt=null):jn=zt.sibling;var au=ze(we,zt,qn.value,Fe);if(au===null){zt===null&&(zt=jn);break}l&&zt&&au.alternate===null&&d(we,zt),ve=O(au,ve,cn),Hn===null?Ft=au:Hn.sibling=au,Hn=au,zt=jn}if(qn.done)return g(we,zt),Tn&&Cc(we,cn),Ft;if(zt===null){for(;!qn.done;cn++,qn=ke.next())qn=qe(we,qn.value,Fe),qn!==null&&(ve=O(qn,ve,cn),Hn===null?Ft=qn:Hn.sibling=qn,Hn=qn);return Tn&&Cc(we,cn),Ft}for(zt=S(zt);!qn.done;cn++,qn=ke.next())qn=Me(zt,we,cn,qn.value,Fe),qn!==null&&(l&&qn.alternate!==null&&zt.delete(qn.key===null?cn:qn.key),ve=O(qn,ve,cn),Hn===null?Ft=qn:Hn.sibling=qn,Hn=qn);return l&&zt.forEach(function(xV){return d(we,xV)}),Tn&&Cc(we,cn),Ft}function rr(we,ve,ke,Fe){if(typeof ke=="object"&&ke!==null&&ke.type===k&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var Ft=ke.key;ve!==null;){if(ve.key===Ft){if(Ft=ke.type,Ft===k){if(ve.tag===7){g(we,ve.sibling),Fe=R(ve,ke.props.children),Fe.return=we,we=Fe;break e}}else if(ve.elementType===Ft||typeof Ft=="object"&&Ft!==null&&Ft.$$typeof===j&&h_(Ft)===ve.type){g(we,ve.sibling),Fe=R(ve,ke.props),op(Fe,ke),Fe.return=we,we=Fe;break e}g(we,ve);break}else d(we,ve);ve=ve.sibling}ke.type===k?(Fe=l_(ke.props.children,we.mode,Fe,ke.key),Fe.return=we,we=Fe):(Fe=Gm(ke.type,ke.key,ke.props,null,we.mode,Fe),op(Fe,ke),Fe.return=we,we=Fe)}return X(we);case w:e:{for(Ft=ke.key;ve!==null;){if(ve.key===Ft)if(ve.tag===4&&ve.stateNode.containerInfo===ke.containerInfo&&ve.stateNode.implementation===ke.implementation){g(we,ve.sibling),Fe=R(ve,ke.children||[]),Fe.return=we,we=Fe;break e}else{g(we,ve);break}else d(we,ve);ve=ve.sibling}Fe=Yy(ke,we.mode,Fe),Fe.return=we,we=Fe}return X(we);case j:return ke=h_(ke),rr(we,ve,ke,Fe)}if(Q(ke))return St(we,ve,ke,Fe);if(B(ke)){if(Ft=B(ke),typeof Ft!="function")throw Error(r(150));return ke=Ft.call(ke),Gt(we,ve,ke,Fe)}if(typeof ke.then=="function")return rr(we,ve,Zm(ke),Fe);if(ke.$$typeof===y)return rr(we,ve,Wm(we,ke),Fe);Jm(we,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,ve!==null&&ve.tag===6?(g(we,ve.sibling),Fe=R(ve,ke),Fe.return=we,we=Fe):(g(we,ve),Fe=Xy(ke,we.mode,Fe),Fe.return=we,we=Fe),X(we)):g(we,ve)}return function(we,ve,ke,Fe){try{ap=0;var Ft=rr(we,ve,ke,Fe);return Zf=null,Ft}catch(zt){if(zt===Yf||zt===Xm)throw zt;var Hn=Ki(29,zt,null,we.mode);return Hn.lanes=Fe,Hn.return=we,Hn}finally{}}}var m_=e7(!0),t7=e7(!1),ql=!1;function lx(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ux(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Ul(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function Gl(l,d,g){var S=l.updateQueue;if(S===null)return null;if(S=S.shared,(Gn&2)!==0){var R=S.pending;return R===null?d.next=d:(d.next=R.next,R.next=d),S.pending=d,d=Um(l),$C(l,null,g),d}return kc(l,S,d,g),Um(l)}function cp(l,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194048)!==0)){var S=d.lanes;S&=l.pendingLanes,g|=S,d.lanes=g,yn(l,g)}}function _x(l,d){var g=l.updateQueue,S=l.alternate;if(S!==null&&(S=S.updateQueue,g===S)){var R=null,O=null;if(g=g.firstBaseUpdate,g!==null){do{var X={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};O===null?R=O=X:O=O.next=X,g=g.next}while(g!==null);O===null?R=O=d:O=O.next=d}else R=O=d;g={baseState:S.baseState,firstBaseUpdate:R,lastBaseUpdate:O,shared:S.shared,callbacks:S.callbacks},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=d:l.next=d,g.lastBaseUpdate=d}var fx=!1;function lp(){if(fx){var l=Xf;if(l!==null)throw l}}function up(l,d,g,S){fx=!1;var R=l.updateQueue;ql=!1;var O=R.firstBaseUpdate,X=R.lastBaseUpdate,re=R.shared.pending;if(re!==null){R.shared.pending=null;var de=re,Se=de.next;de.next=null,X===null?O=Se:X.next=Se,X=de;var Be=l.alternate;Be!==null&&(Be=Be.updateQueue,re=Be.lastBaseUpdate,re!==X&&(re===null?Be.firstBaseUpdate=Se:re.next=Se,Be.lastBaseUpdate=de))}if(O!==null){var qe=R.baseState;X=0,Be=Se=de=null,re=O;do{var ze=re.lane&-536870913,Me=ze!==re.lane;if(Me?(zn&ze)===ze:(S&ze)===ze){ze!==0&&ze===Qf&&(fx=!0),Be!==null&&(Be=Be.next={lane:0,tag:re.tag,payload:re.payload,callback:null,next:null});e:{var St=l,Gt=re;ze=d;var rr=g;switch(Gt.tag){case 1:if(St=Gt.payload,typeof St=="function"){qe=St.call(rr,qe,ze);break e}qe=St;break e;case 3:St.flags=St.flags&-65537|128;case 0:if(St=Gt.payload,ze=typeof St=="function"?St.call(rr,qe,ze):St,ze==null)break e;qe=_({},qe,ze);break e;case 2:ql=!0}}ze=re.callback,ze!==null&&(l.flags|=64,Me&&(l.flags|=8192),Me=R.callbacks,Me===null?R.callbacks=[ze]:Me.push(ze))}else Me={lane:ze,tag:re.tag,payload:re.payload,callback:re.callback,next:null},Be===null?(Se=Be=Me,de=qe):Be=Be.next=Me,X|=ze;if(re=re.next,re===null){if(re=R.shared.pending,re===null)break;Me=re,re=Me.next,Me.next=null,R.lastBaseUpdate=Me,R.shared.pending=null}}while(!0);Be===null&&(de=qe),R.baseState=de,R.firstBaseUpdate=Se,R.lastBaseUpdate=Be,O===null&&(R.shared.lanes=0),Xl|=X,l.lanes=X,l.memoizedState=qe}}function n7(l,d){if(typeof l!="function")throw Error(r(191,l));l.call(d)}function r7(l,d){var g=l.callbacks;if(g!==null)for(l.callbacks=null,l=0;lO?O:8;var X=V.T,re={};V.T=re,Tx(l,!1,d,g);try{var de=R(),Se=V.S;if(Se!==null&&Se(re,de),de!==null&&typeof de=="object"&&typeof de.then=="function"){var Be=uG(de,S);dp(l,d,Be,Zi(l))}else dp(l,d,S,Zi(l))}catch(qe){dp(l,d,{then:function(){},status:"rejected",reason:qe},Zi())}finally{Z.p=O,X!==null&&re.types!==null&&(X.types=re.types),V.T=X}}function mG(){}function jx(l,d,g,S){if(l.tag!==5)throw Error(r(476));var R=D7(l).queue;O7(l,R,d,Y,g===null?mG:function(){return L7(l),g(S)})}function D7(l){var d=l.memoizedState;if(d!==null)return d;d={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jc,lastRenderedState:Y},next:null};var g={};return d.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jc,lastRenderedState:g},next:null},l.memoizedState=d,l=l.alternate,l!==null&&(l.memoizedState=d),d}function L7(l){var d=D7(l);d.next===null&&(d=l.alternate.memoizedState),dp(l,d.next.queue,{},Zi())}function Ax(){return $s(Ap)}function I7(){return ss().memoizedState}function $7(){return ss().memoizedState}function gG(l){for(var d=l.return;d!==null;){switch(d.tag){case 24:case 3:var g=Zi();l=Ul(g);var S=Gl(d,l,g);S!==null&&(Ri(S,d,g),cp(S,d,g)),d={cache:ix()},l.payload=d;return}d=d.return}}function vG(l,d,g){var S=Zi();g={lane:S,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},lg(l)?P7(d,g):(g=hr(l,d,g,S),g!==null&&(Ri(g,l,S),F7(g,d,S)))}function B7(l,d,g){var S=Zi();dp(l,d,g,S)}function dp(l,d,g,S){var R={lane:S,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(lg(l))P7(d,R);else{var O=l.alternate;if(l.lanes===0&&(O===null||O.lanes===0)&&(O=d.lastRenderedReducer,O!==null))try{var X=d.lastRenderedState,re=O(X,g);if(R.hasEagerState=!0,R.eagerState=re,te(re,X))return kc(l,d,R,0),ar===null&&Pr(),!1}catch{}finally{}if(g=hr(l,d,R,S),g!==null)return Ri(g,l,S),F7(g,d,S),!0}return!1}function Tx(l,d,g,S){if(S={lane:2,revertLane:l2(),gesture:null,action:S,hasEagerState:!1,eagerState:null,next:null},lg(l)){if(d)throw Error(r(479))}else d=hr(l,g,S,2),d!==null&&Ri(d,l,2)}function lg(l){var d=l.alternate;return l===an||d!==null&&d===an}function P7(l,d){ed=ng=!0;var g=l.pending;g===null?d.next=d:(d.next=g.next,g.next=d),l.pending=d}function F7(l,d,g){if((g&4194048)!==0){var S=d.lanes;S&=l.pendingLanes,g|=S,d.lanes=g,yn(l,g)}}var hp={readContext:$s,use:ig,useCallback:Fr,useContext:Fr,useEffect:Fr,useImperativeHandle:Fr,useLayoutEffect:Fr,useInsertionEffect:Fr,useMemo:Fr,useReducer:Fr,useRef:Fr,useState:Fr,useDebugValue:Fr,useDeferredValue:Fr,useTransition:Fr,useSyncExternalStore:Fr,useId:Fr,useHostTransitionStatus:Fr,useFormState:Fr,useActionState:Fr,useOptimistic:Fr,useMemoCache:Fr,useCacheRefresh:Fr};hp.useEffectEvent=Fr;var H7={readContext:$s,use:ig,useCallback:function(l,d){return li().memoizedState=[l,d===void 0?null:d],l},useContext:$s,useEffect:C7,useImperativeHandle:function(l,d,g){g=g!=null?g.concat([l]):null,og(4194308,4,j7.bind(null,d,l),g)},useLayoutEffect:function(l,d){return og(4194308,4,l,d)},useInsertionEffect:function(l,d){og(4,2,l,d)},useMemo:function(l,d){var g=li();d=d===void 0?null:d;var S=l();if(g_){Tt(!0);try{l()}finally{Tt(!1)}}return g.memoizedState=[S,d],S},useReducer:function(l,d,g){var S=li();if(g!==void 0){var R=g(d);if(g_){Tt(!0);try{g(d)}finally{Tt(!1)}}}else R=d;return S.memoizedState=S.baseState=R,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:R},S.queue=l,l=l.dispatch=vG.bind(null,an,l),[S.memoizedState,l]},useRef:function(l){var d=li();return l={current:l},d.memoizedState=l},useState:function(l){l=Sx(l);var d=l.queue,g=B7.bind(null,an,d);return d.dispatch=g,[l.memoizedState,g]},useDebugValue:Nx,useDeferredValue:function(l,d){var g=li();return zx(g,l,d)},useTransition:function(){var l=Sx(!1);return l=O7.bind(null,an,l.queue,!0,!1),li().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,d,g){var S=an,R=li();if(Tn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=d(),ar===null)throw Error(r(349));(zn&127)!==0||l7(S,d,g)}R.memoizedState=g;var O={value:g,getSnapshot:d};return R.queue=O,C7(_7.bind(null,S,O,l),[l]),S.flags|=2048,nd(9,{destroy:void 0},u7.bind(null,S,O,g,d),null),g},useId:function(){var l=li(),d=ar.identifierPrefix;if(Tn){var g=Ao,S=jo;g=(S&~(1<<32-ht(S)-1)).toString(32)+g,d="_"+d+"R_"+g,g=rg++,0<\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof S.is=="string"?X.createElement("select",{is:S.is}):X.createElement("select"),S.multiple?O.multiple=!0:S.size&&(O.size=S.size);break;default:O=typeof S.is=="string"?X.createElement(R,{is:S.is}):X.createElement(R)}}O[Fn]=d,O[sr]=S;e:for(X=d.child;X!==null;){if(X.tag===5||X.tag===6)O.appendChild(X.stateNode);else if(X.tag!==4&&X.tag!==27&&X.child!==null){X.child.return=X,X=X.child;continue}if(X===d)break e;for(;X.sibling===null;){if(X.return===null||X.return===d)break e;X=X.return}X.sibling.return=X.return,X=X.sibling}d.stateNode=O;e:switch(Ps(O,R,S),R){case"button":case"input":case"select":case"textarea":S=!!S.autoFocus;break e;case"img":S=!0;break e;default:S=!1}S&&Tc(d)}}return gr(d),Gx(d,d.type,l===null?null:l.memoizedProps,d.pendingProps,g),null;case 6:if(l&&d.stateNode!=null)l.memoizedProps!==S&&Tc(d);else{if(typeof S!="string"&&d.stateNode===null)throw Error(r(166));if(l=ue.current,Kf(d)){if(l=d.stateNode,g=d.memoizedProps,S=null,R=Is,R!==null)switch(R.tag){case 27:case 5:S=R.memoizedProps}l[Fn]=d,l=!!(l.nodeValue===g||S!==null&&S.suppressHydrationWarning===!0||o9(l.nodeValue,g)),l||Fl(d,!0)}else l=jg(l).createTextNode(S),l[Fn]=d,d.stateNode=l}return gr(d),null;case 31:if(g=d.memoizedState,l===null||l.memoizedState!==null){if(S=Kf(d),g!==null){if(l===null){if(!S)throw Error(r(318));if(l=d.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(557));l[Fn]=d}else u_(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;gr(d),l=!1}else g=tx(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),l=!0;if(!l)return d.flags&256?(Qi(d),d):(Qi(d),null);if((d.flags&128)!==0)throw Error(r(558))}return gr(d),null;case 13:if(S=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(R=Kf(d),S!==null&&S.dehydrated!==null){if(l===null){if(!R)throw Error(r(318));if(R=d.memoizedState,R=R!==null?R.dehydrated:null,!R)throw Error(r(317));R[Fn]=d}else u_(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;gr(d),R=!1}else R=tx(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=R),R=!0;if(!R)return d.flags&256?(Qi(d),d):(Qi(d),null)}return Qi(d),(d.flags&128)!==0?(d.lanes=g,d):(g=S!==null,l=l!==null&&l.memoizedState!==null,g&&(S=d.child,R=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(R=S.alternate.memoizedState.cachePool.pool),O=null,S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(O=S.memoizedState.cachePool.pool),O!==R&&(S.flags|=2048)),g!==l&&g&&(d.child.flags|=8192),hg(d,d.updateQueue),gr(d),null);case 4:return oe(),l===null&&d2(d.stateNode.containerInfo),gr(d),null;case 10:return Nc(d.type),gr(d),null;case 19:if(q(rs),S=d.memoizedState,S===null)return gr(d),null;if(R=(d.flags&128)!==0,O=S.rendering,O===null)if(R)mp(S,!1);else{if(Hr!==0||l!==null&&(l.flags&128)!==0)for(l=d.child;l!==null;){if(O=tg(l),O!==null){for(d.flags|=128,mp(S,!1),l=O.updateQueue,d.updateQueue=l,hg(d,l),d.subtreeFlags=0,l=g,g=d.child;g!==null;)BC(g,l),g=g.sibling;return K(rs,rs.current&1|2),Tn&&Cc(d,S.treeForkCount),d.child}l=l.sibling}S.tail!==null&&pt()>bg&&(d.flags|=128,R=!0,mp(S,!1),d.lanes=4194304)}else{if(!R)if(l=tg(O),l!==null){if(d.flags|=128,R=!0,l=l.updateQueue,d.updateQueue=l,hg(d,l),mp(S,!0),S.tail===null&&S.tailMode==="hidden"&&!O.alternate&&!Tn)return gr(d),null}else 2*pt()-S.renderingStartTime>bg&&g!==536870912&&(d.flags|=128,R=!0,mp(S,!1),d.lanes=4194304);S.isBackwards?(O.sibling=d.child,d.child=O):(l=S.last,l!==null?l.sibling=O:d.child=O,S.last=O)}return S.tail!==null?(l=S.tail,S.rendering=l,S.tail=l.sibling,S.renderingStartTime=pt(),l.sibling=null,g=rs.current,K(rs,R?g&1|2:g&1),Tn&&Cc(d,S.treeForkCount),l):(gr(d),null);case 22:case 23:return Qi(d),hx(),S=d.memoizedState!==null,l!==null?l.memoizedState!==null!==S&&(d.flags|=8192):S&&(d.flags|=8192),S?(g&536870912)!==0&&(d.flags&128)===0&&(gr(d),d.subtreeFlags&6&&(d.flags|=8192)):gr(d),g=d.updateQueue,g!==null&&hg(d,g.retryQueue),g=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),S=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(S=d.memoizedState.cachePool.pool),S!==g&&(d.flags|=2048),l!==null&&q(d_),null;case 24:return g=null,l!==null&&(g=l.memoizedState.cache),d.memoizedState.cache!==g&&(d.flags|=2048),Nc(cs),gr(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function kG(l,d){switch(Jy(d),d.tag){case 1:return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return Nc(cs),oe(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 26:case 27:case 5:return he(d),null;case 31:if(d.memoizedState!==null){if(Qi(d),d.alternate===null)throw Error(r(340));u_()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 13:if(Qi(d),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(r(340));u_()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return q(rs),null;case 4:return oe(),null;case 10:return Nc(d.type),null;case 22:case 23:return Qi(d),hx(),l!==null&&q(d_),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 24:return Nc(cs),null;case 25:return null;default:return null}}function f8(l,d){switch(Jy(d),d.tag){case 3:Nc(cs),oe();break;case 26:case 27:case 5:he(d);break;case 4:oe();break;case 31:d.memoizedState!==null&&Qi(d);break;case 13:Qi(d);break;case 19:q(rs);break;case 10:Nc(d.type);break;case 22:case 23:Qi(d),hx(),l!==null&&q(d_);break;case 24:Nc(cs)}}function gp(l,d){try{var g=d.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var R=S.next;g=R;do{if((g.tag&l)===l){S=void 0;var O=g.create,X=g.inst;S=O(),X.destroy=S}g=g.next}while(g!==R)}}catch(re){Zn(d,d.return,re)}}function Wl(l,d,g){try{var S=d.updateQueue,R=S!==null?S.lastEffect:null;if(R!==null){var O=R.next;S=O;do{if((S.tag&l)===l){var X=S.inst,re=X.destroy;if(re!==void 0){X.destroy=void 0,R=d;var de=g,Se=re;try{Se()}catch(Be){Zn(R,de,Be)}}}S=S.next}while(S!==O)}}catch(Be){Zn(d,d.return,Be)}}function d8(l){var d=l.updateQueue;if(d!==null){var g=l.stateNode;try{r7(d,g)}catch(S){Zn(l,l.return,S)}}}function h8(l,d,g){g.props=v_(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(S){Zn(l,d,S)}}function vp(l,d){try{var g=l.ref;if(g!==null){switch(l.tag){case 26:case 27:case 5:var S=l.stateNode;break;case 30:S=l.stateNode;break;default:S=l.stateNode}typeof g=="function"?l.refCleanup=g(S):g.current=S}}catch(R){Zn(l,d,R)}}function To(l,d){var g=l.ref,S=l.refCleanup;if(g!==null)if(typeof S=="function")try{S()}catch(R){Zn(l,d,R)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(R){Zn(l,d,R)}else g.current=null}function p8(l){var d=l.type,g=l.memoizedProps,S=l.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":g.autoFocus&&S.focus();break e;case"img":g.src?S.src=g.src:g.srcSet&&(S.srcset=g.srcSet)}}catch(R){Zn(l,l.return,R)}}function Vx(l,d,g){try{var S=l.stateNode;GG(S,l.type,g,d),S[sr]=d}catch(R){Zn(l,l.return,R)}}function m8(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&tu(l.type)||l.tag===4}function Kx(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||m8(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&tu(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Wx(l,d,g){var S=l.tag;if(S===5||S===6)l=l.stateNode,d?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(l,d):(d=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,d.appendChild(l),g=g._reactRootContainer,g!=null||d.onclick!==null||(d.onclick=Gs));else if(S!==4&&(S===27&&tu(l.type)&&(g=l.stateNode,d=null),l=l.child,l!==null))for(Wx(l,d,g),l=l.sibling;l!==null;)Wx(l,d,g),l=l.sibling}function pg(l,d,g){var S=l.tag;if(S===5||S===6)l=l.stateNode,d?g.insertBefore(l,d):g.appendChild(l);else if(S!==4&&(S===27&&tu(l.type)&&(g=l.stateNode),l=l.child,l!==null))for(pg(l,d,g),l=l.sibling;l!==null;)pg(l,d,g),l=l.sibling}function g8(l){var d=l.stateNode,g=l.memoizedProps;try{for(var S=l.type,R=d.attributes;R.length;)d.removeAttributeNode(R[0]);Ps(d,S,g),d[Fn]=l,d[sr]=g}catch(O){Zn(l,l.return,O)}}var Rc=!1,_s=!1,Qx=!1,v8=typeof WeakSet=="function"?WeakSet:Set,As=null;function SG(l,d){if(l=l.containerInfo,m2=Lg,l=Jt(l),mn(l)){if("selectionStart"in l)var g={start:l.selectionStart,end:l.selectionEnd};else e:{g=(g=l.ownerDocument)&&g.defaultView||window;var S=g.getSelection&&g.getSelection();if(S&&S.rangeCount!==0){g=S.anchorNode;var R=S.anchorOffset,O=S.focusNode;S=S.focusOffset;try{g.nodeType,O.nodeType}catch{g=null;break e}var X=0,re=-1,de=-1,Se=0,Be=0,qe=l,ze=null;t:for(;;){for(var Me;qe!==g||R!==0&&qe.nodeType!==3||(re=X+R),qe!==O||S!==0&&qe.nodeType!==3||(de=X+S),qe.nodeType===3&&(X+=qe.nodeValue.length),(Me=qe.firstChild)!==null;)ze=qe,qe=Me;for(;;){if(qe===l)break t;if(ze===g&&++Se===R&&(re=X),ze===O&&++Be===S&&(de=X),(Me=qe.nextSibling)!==null)break;qe=ze,ze=qe.parentNode}qe=Me}g=re===-1||de===-1?null:{start:re,end:de}}else g=null}g=g||{start:0,end:0}}else g=null;for(g2={focusedElem:l,selectionRange:g},Lg=!1,As=d;As!==null;)if(d=As,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,As=l;else for(;As!==null;){switch(d=As,O=d.alternate,l=d.flags,d.tag){case 0:if((l&4)!==0&&(l=d.updateQueue,l=l!==null?l.events:null,l!==null))for(g=0;g title"))),Ps(O,S,g),O[Fn]=l,er(O),S=O;break e;case"link":var X=S9("link","href",R).get(S+(g.href||""));if(X){for(var re=0;rerr&&(X=rr,rr=Gt,Gt=X);var we=Oe(re,Gt),ve=Oe(re,rr);if(we&&ve&&(Me.rangeCount!==1||Me.anchorNode!==we.node||Me.anchorOffset!==we.offset||Me.focusNode!==ve.node||Me.focusOffset!==ve.offset)){var ke=qe.createRange();ke.setStart(we.node,we.offset),Me.removeAllRanges(),Gt>rr?(Me.addRange(ke),Me.extend(ve.node,ve.offset)):(ke.setEnd(ve.node,ve.offset),Me.addRange(ke))}}}}for(qe=[],Me=re;Me=Me.parentNode;)Me.nodeType===1&&qe.push({element:Me,left:Me.scrollLeft,top:Me.scrollTop});for(typeof re.focus=="function"&&re.focus(),re=0;reg?32:g,V.T=null,g=n2,n2=null;var O=Zl,X=Ic;if(xs=0,od=Zl=null,Ic=0,(Gn&6)!==0)throw Error(r(331));var re=Gn;if(Gn|=4,j8(O.current),E8(O,O.current,X,g),Gn=re,Sp(0,!1),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(Yt,O)}catch{}return!0}finally{Z.p=R,V.T=S,K8(l,d)}}function Q8(l,d,g){d=Na(g,d),d=Dx(l.stateNode,d,2),l=Gl(l,d,2),l!==null&&(hn(l,2),Ro(l))}function Zn(l,d,g){if(l.tag===3)Q8(l,l,g);else for(;d!==null;){if(d.tag===3){Q8(d,l,g);break}else if(d.tag===1){var S=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(Yl===null||!Yl.has(S))){l=Na(g,l),g=X7(2),S=Gl(d,g,2),S!==null&&(Y7(g,S,d,l),hn(S,2),Ro(S));break}}d=d.return}}function a2(l,d,g){var S=l.pingCache;if(S===null){S=l.pingCache=new NG;var R=new Set;S.set(d,R)}else R=S.get(d),R===void 0&&(R=new Set,S.set(d,R));R.has(g)||(Zx=!0,R.add(g),l=RG.bind(null,l,d,g),d.then(l,l))}function RG(l,d,g){var S=l.pingCache;S!==null&&S.delete(d),l.pingedLanes|=l.suspendedLanes&g,l.warmLanes&=~g,ar===l&&(zn&g)===g&&(Hr===4||Hr===3&&(zn&62914560)===zn&&300>pt()-vg?(Gn&2)===0&&cd(l,0):Jx|=g,ad===zn&&(ad=0)),Ro(l)}function X8(l,d){d===0&&(d=vn()),l=zo(l,d),l!==null&&(hn(l,d),Ro(l))}function MG(l){var d=l.memoizedState,g=0;d!==null&&(g=d.retryLane),X8(l,g)}function OG(l,d){var g=0;switch(l.tag){case 31:case 13:var S=l.stateNode,R=l.memoizedState;R!==null&&(g=R.retryLane);break;case 19:S=l.stateNode;break;case 22:S=l.stateNode._retryCache;break;default:throw Error(r(314))}S!==null&&S.delete(d),X8(l,g)}function DG(l,d){return ot(l,d)}var Cg=null,ud=null,o2=!1,Eg=!1,c2=!1,eu=0;function Ro(l){l!==ud&&l.next===null&&(ud===null?Cg=ud=l:ud=ud.next=l),Eg=!0,o2||(o2=!0,IG())}function Sp(l,d){if(!c2&&Eg){c2=!0;do for(var g=!1,S=Cg;S!==null;){if(l!==0){var R=S.pendingLanes;if(R===0)var O=0;else{var X=S.suspendedLanes,re=S.pingedLanes;O=(1<<31-ht(42|l)+1)-1,O&=R&~(X&~re),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(g=!0,e9(S,O))}else O=zn,O=yr(S,S===ar?O:0,S.cancelPendingCommit!==null||S.timeoutHandle!==-1),(O&3)===0||Wr(S,O)||(g=!0,e9(S,O));S=S.next}while(g);c2=!1}}function LG(){Y8()}function Y8(){Eg=o2=!1;var l=0;eu!==0&&KG()&&(l=eu);for(var d=pt(),g=null,S=Cg;S!==null;){var R=S.next,O=Z8(S,d);O===0?(S.next=null,g===null?Cg=R:g.next=R,R===null&&(ud=g)):(g=S,(l!==0||(O&3)!==0)&&(Eg=!0)),S=R}xs!==0&&xs!==5||Sp(l),eu!==0&&(eu=0)}function Z8(l,d){for(var g=l.suspendedLanes,S=l.pingedLanes,R=l.expirationTimes,O=l.pendingLanes&-62914561;0re)break;var Be=de.transferSize,qe=de.initiatorType;Be&&c9(qe)&&(de=de.responseEnd,X+=Be*(de"u"?null:document;function y9(l,d,g){var S=_d;if(S&&typeof d=="string"&&d){var R=Rr(d);R='link[rel="'+l+'"][href="'+R+'"]',typeof g=="string"&&(R+='[crossorigin="'+g+'"]'),b9.has(R)||(b9.add(R),l={rel:l,crossOrigin:g,href:d},S.querySelector(R)===null&&(d=S.createElement("link"),Ps(d,"link",l),er(d),S.head.appendChild(d)))}}function nV(l){$c.D(l),y9("dns-prefetch",l,null)}function rV(l,d){$c.C(l,d),y9("preconnect",l,d)}function sV(l,d,g){$c.L(l,d,g);var S=_d;if(S&&l&&d){var R='link[rel="preload"][as="'+Rr(d)+'"]';d==="image"&&g&&g.imageSrcSet?(R+='[imagesrcset="'+Rr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(R+='[imagesizes="'+Rr(g.imageSizes)+'"]')):R+='[href="'+Rr(l)+'"]';var O=R;switch(d){case"style":O=fd(l);break;case"script":O=dd(l)}Ma.has(O)||(l=_({rel:"preload",href:d==="image"&&g&&g.imageSrcSet?void 0:l,as:d},g),Ma.set(O,l),S.querySelector(R)!==null||d==="style"&&S.querySelector(zp(O))||d==="script"&&S.querySelector(jp(O))||(d=S.createElement("link"),Ps(d,"link",l),er(d),S.head.appendChild(d)))}}function iV(l,d){$c.m(l,d);var g=_d;if(g&&l){var S=d&&typeof d.as=="string"?d.as:"script",R='link[rel="modulepreload"][as="'+Rr(S)+'"][href="'+Rr(l)+'"]',O=R;switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=dd(l)}if(!Ma.has(O)&&(l=_({rel:"modulepreload",href:l},d),Ma.set(O,l),g.querySelector(R)===null)){switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(jp(O)))return}S=g.createElement("link"),Ps(S,"link",l),er(S),g.head.appendChild(S)}}}function aV(l,d,g){$c.S(l,d,g);var S=_d;if(S&&l){var R=wr(S).hoistableStyles,O=fd(l);d=d||"default";var X=R.get(O);if(!X){var re={loading:0,preload:null};if(X=S.querySelector(zp(O)))re.loading=5;else{l=_({rel:"stylesheet",href:l,"data-precedence":d},g),(g=Ma.get(O))&&S2(l,g);var de=X=S.createElement("link");er(de),Ps(de,"link",l),de._p=new Promise(function(Se,Be){de.onload=Se,de.onerror=Be}),de.addEventListener("load",function(){re.loading|=1}),de.addEventListener("error",function(){re.loading|=2}),re.loading|=4,Tg(X,d,S)}X={type:"stylesheet",instance:X,count:1,state:re},R.set(O,X)}}}function oV(l,d){$c.X(l,d);var g=_d;if(g&&l){var S=wr(g).hoistableScripts,R=dd(l),O=S.get(R);O||(O=g.querySelector(jp(R)),O||(l=_({src:l,async:!0},d),(d=Ma.get(R))&&C2(l,d),O=g.createElement("script"),er(O),Ps(O,"link",l),g.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},S.set(R,O))}}function cV(l,d){$c.M(l,d);var g=_d;if(g&&l){var S=wr(g).hoistableScripts,R=dd(l),O=S.get(R);O||(O=g.querySelector(jp(R)),O||(l=_({src:l,async:!0,type:"module"},d),(d=Ma.get(R))&&C2(l,d),O=g.createElement("script"),er(O),Ps(O,"link",l),g.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},S.set(R,O))}}function x9(l,d,g,S){var R=(R=ue.current)?Ag(R):null;if(!R)throw Error(r(446));switch(l){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(d=fd(g.href),g=wr(R).hoistableStyles,S=g.get(d),S||(S={type:"style",instance:null,count:0,state:null},g.set(d,S)),S):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){l=fd(g.href);var O=wr(R).hoistableStyles,X=O.get(l);if(X||(R=R.ownerDocument||R,X={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(l,X),(O=R.querySelector(zp(l)))&&!O._p&&(X.instance=O,X.state.loading=5),Ma.has(l)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},Ma.set(l,g),O||lV(R,l,g,X.state))),d&&S===null)throw Error(r(528,""));return X}if(d&&S!==null)throw Error(r(529,""));return null;case"script":return d=g.async,g=g.src,typeof g=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=dd(g),g=wr(R).hoistableScripts,S=g.get(d),S||(S={type:"script",instance:null,count:0,state:null},g.set(d,S)),S):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,l))}}function fd(l){return'href="'+Rr(l)+'"'}function zp(l){return'link[rel="stylesheet"]['+l+"]"}function w9(l){return _({},l,{"data-precedence":l.precedence,precedence:null})}function lV(l,d,g,S){l.querySelector('link[rel="preload"][as="style"]['+d+"]")?S.loading=1:(d=l.createElement("link"),S.preload=d,d.addEventListener("load",function(){return S.loading|=1}),d.addEventListener("error",function(){return S.loading|=2}),Ps(d,"link",g),er(d),l.head.appendChild(d))}function dd(l){return'[src="'+Rr(l)+'"]'}function jp(l){return"script[async]"+l}function k9(l,d,g){if(d.count++,d.instance===null)switch(d.type){case"style":var S=l.querySelector('style[data-href~="'+Rr(g.href)+'"]');if(S)return d.instance=S,er(S),S;var R=_({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return S=(l.ownerDocument||l).createElement("style"),er(S),Ps(S,"style",R),Tg(S,g.precedence,l),d.instance=S;case"stylesheet":R=fd(g.href);var O=l.querySelector(zp(R));if(O)return d.state.loading|=4,d.instance=O,er(O),O;S=w9(g),(R=Ma.get(R))&&S2(S,R),O=(l.ownerDocument||l).createElement("link"),er(O);var X=O;return X._p=new Promise(function(re,de){X.onload=re,X.onerror=de}),Ps(O,"link",S),d.state.loading|=4,Tg(O,g.precedence,l),d.instance=O;case"script":return O=dd(g.src),(R=l.querySelector(jp(O)))?(d.instance=R,er(R),R):(S=g,(R=Ma.get(O))&&(S=_({},g),C2(S,R)),l=l.ownerDocument||l,R=l.createElement("script"),er(R),Ps(R,"link",S),l.head.appendChild(R),d.instance=R);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(S=d.instance,d.state.loading|=4,Tg(S,g.precedence,l));return d.instance}function Tg(l,d,g){for(var S=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),R=S.length?S[S.length-1]:null,O=R,X=0;X title"):null)}function uV(l,d,g){if(g===1||d.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;switch(d.rel){case"stylesheet":return l=d.disabled,typeof d.precedence=="string"&&l==null;default:return!0}case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function E9(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function _V(l,d,g,S){if(g.type==="stylesheet"&&(typeof S.media!="string"||matchMedia(S.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var R=fd(S.href),O=d.querySelector(zp(R));if(O){d=O._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(l.count++,l=Mg.bind(l),d.then(l,l)),g.state.loading|=4,g.instance=O,er(O);return}O=d.ownerDocument||d,S=w9(S),(R=Ma.get(R))&&S2(S,R),O=O.createElement("link"),er(O);var X=O;X._p=new Promise(function(re,de){X.onload=re,X.onerror=de}),Ps(O,"link",S),g.instance=O}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(g,d),(d=g.state.preload)&&(g.state.loading&3)===0&&(l.count++,g=Mg.bind(l),d.addEventListener("load",g),d.addEventListener("error",g))}}var E2=0;function fV(l,d){return l.stylesheets&&l.count===0&&Dg(l,l.stylesheets),0E2?50:800)+d);return l.unsuspend=g,function(){l.unsuspend=null,clearTimeout(S),clearTimeout(R)}}:null}function Mg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dg(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Og=null;function Dg(l,d){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Og=new Map,d.forEach(dV,l),Og=null,Mg.call(l))}function dV(l,d){if(!(d.state.loading&4)){var g=Og.get(l);if(g)var S=g.get(null);else{g=new Map,Og.set(l,g);for(var R=l.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),L2.exports=_K(),L2.exports}var dK=fK();const hK=!1;var RO=T.useLayoutEffect;function pK(e,n,t){T.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function mK(e){const n=T.useRef(null);return T.useImperativeHandle(e,()=>n.current,[]),n}function k0(e){return e[e.length-1]}function hh(e,n){return typeof e=="function"?e(n):e}const MO=Object.prototype.hasOwnProperty,gK=Object.prototype.propertyIsEnumerable;function OO(e){for(const n in e)if(MO.call(e,n))return!0;return!1}const vK=()=>Object.create(null),x_=(e,n)=>O_(e,n,vK);function O_(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=_E(e)&&_E(s);if(!i&&!(hv(e)&&hv(s)))return s;const a=i?e:lE(e);if(!a)return s;const o=i?s:lE(s);if(!o)return s;const c=a.length,u=o.length,h=i?new Array(u):t();let _=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!uE(t)||!t.hasOwnProperty("isPrototypeOf"))}function uE(e){return Object.prototype.toString.call(e)==="[object Object]"}function _E(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Au(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!Au(e[a],n[a],t)))return!1;return s===i}return!1}const bK=/[\x00-\x1f\x7f"<>`{}]/g;function yK(e){return e.replace(bK,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function fE(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return yK(n)}const xK=["http:","https:","mailto:","tel:"];function pv(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function Ip(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=fE(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+fE(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function wK(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function kK(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const c=t;n.delete(c.key),c.next&&(t=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const c={key:i,value:a,prev:r};r&&(r.next=c),r=c,t||(t=c),n.set(i,c)}},clear(){n.clear(),t=void 0,r=void 0}}}const Nu=4,DO=5;function LO(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const c=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=c,t[4]=c,t[5]=c,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!I.parse&&I.caseSensitive===j&&I.prefix===z&&I.suffix===A));if(D)x=D;else{const I=SK(N,_,j,z,A);x=I,I.parent=s,I.depth=i;let B;N===1?B=s.dynamic??(s.dynamic=[]):N===3?B=s.optional??(s.optional=[]):B=s.wildcard??(s.wildcard=[]),B.push(I),B.length===2&&(a==null||a.push(B))}break}}s=x}if(k&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=Ld(_);b.kind=DO,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&_.endsWith("/")){const b=Ld(_);b.kind=Nu,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=k??null,s.priority=((h=p==null?void 0:p.params)==null?void 0:h.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=_)}if(t.children)for(const _ of t.children)wb(e,n,_,c,s,i,a,o)}function IO(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function Ld(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function SK(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function CK(e,n){const t=Ld("/"),r=new Uint16Array(6),s=[];for(const i of e)wb(!1,r,i,1,t,0,s);for(const i of s)i.sort(IO);n.masksTree=t,n.flatCache=mv(1e3)}function EK(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=Rk(e,n.masksTree);return n.flatCache.set(e,r),r}function NK(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=Ld("/"),wb(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),Rk(r,a,t)}function zK(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=Rk(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=BO(i.route)),n.matchCache.set(r,i),i}function jK(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function AK(e,n=!1,t){const r=Ld(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let c=0;wb(n,s,e,1,r,0,i,u=>{if(t==null||t(u,c),u.id in a&&Tk(),a[u.id]=u,c!==0&&u.path){const h=jK(u.fullPath);(!o[h]||u.fullPath.endsWith("/"))&&(o[h]=u)}c++});for(const u of i)u.sort(IO);return{processedTree:{segmentTree:r,singleCache:mv(1e3),matchCache:mv(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Rk(e,n,t=!1){const r=e.split("/"),s=RK(e,r,n,t);if(!s)return null;const[i]=$O(e,r,s);return{route:s.node.route,rawParams:i}}function $O(e,n,t){var h,_,p,m;const r=TK(t.node);let s=null;const i=Object.create(null);let a=((h=t.extract)==null?void 0:h.part)??0,o=((_=t.extract)==null?void 0:_.node)??0,c=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;z--){const A=_.wildcard[z],{prefix:j,suffix:M}=A;if(!(j&&(y||!(A.caseSensitive?C:N??(N=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const D=n.slice(p).join("/"),I=D.slice(-M.length);if((A.caseSensitive?I:I.toLowerCase())!==M||D.length-M.length=0;A--){const j=_.optional[A];o.push({node:j,index:p,skipped:z,statics:w,dynamics:k,optionals:v,extract:b,rawParams:x})}if(!y)for(let A=_.optional.length-1;A>=0;A--){const j=_.optional[A],{prefix:M,suffix:D}=j;if(M||D){const I=j.caseSensitive?C:N??(N=C.toLowerCase());if(M&&!I.startsWith(M)||D&&I.indexOf(D,I.length-D.length)=0;z--){const A=_.dynamic[z],{prefix:j,suffix:M}=A;if(j||M){const D=A.caseSensitive?C:N??(N=C.toLowerCase());if(j&&!D.startsWith(j)||M&&D.indexOf(M,D.length-M.length)=0;z--){const A=_.pathless[z];o.push({node:A,index:p,skipped:m,statics:w,dynamics:k,optionals:v,extract:b,rawParams:x})}}if(u)return u;if(r&&c){let h=c.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===Nu)>(e.node.kind===Nu)||n.node.kind===Nu==(e.node.kind===Nu)&&n.node.depth>e.node.depth))):!0}function P1(e){return F1(e.filter(n=>n!==void 0).join("/"))}function F1(e){return e.replace(/\/{2,}/g,"/")}function PO(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function el(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function FO(e){return el(PO(e))}function gv(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function OK(e,n,t){return gv(e,t)===gv(n,t)}function DK({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=F1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=F1(e)),a=e.split("/");a.length>1&&k0(a)==="";)a.pop();const u=n.split("/");for(let h=0,_=u.length;h<_;h++){const p=u[h];p===""?h?h===_-1&&a.push(p):a=[p]:p===".."?a.length>1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(k0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),c=(s?F1(o):o)||"/";return i&&r&&r.set(i,c),c}function LK(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function P2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>pE(s,t)).join("/"):pE(r,t)}function hE({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,c,u="";for(;oe.state.__TSR_key||e.href;function qK(e){const n=e.getAttribute(mE);if(n)return`[${mE}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let Vg=!1;const H1="window";function J4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function gE(e){const n=new Set;for(const t of e){if(t===H1)continue;const r=J4(t);r&&n.add(r)}return n}function UK(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||HK,i=new Set,a=o=>{const c=hu[o]||(hu[o]={});for(const u of i)u===document?c[H1]={scrollX,scrollY}:u.isConnected&&(c[qK(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,Vg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{Vg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),FK()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var k;const c=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,h=r.next,_=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),w=o.fromLocation&&s(o.fromLocation);if(r.restoring&&w&&w!==m){const v=hu[w];if(v){let b=hu[m];for(const x in v){if(x===H1){if(h)continue}else{const y=J4(x);if(!y||h&&u&&(p??(p=gE(u)),p.has(y)))continue}b||(b=hu[m]={}),b[x]??(b[x]=v[x])}}}Vg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let x=!1;if(h){!v&&u&&(p??(p=gE(u)));const y=v&&b&&_,C=r.restoring?hu[m]:void 0;if(C)for(const N in C){const{scrollX:z,scrollY:A}=C[N];if(N===H1){if(y)continue;scrollTo({top:A,left:z,behavior:c}),x=!0}else{const j=J4(N);j&&(j.scrollLeft=z,j.scrollTop=A,p==null||p.delete(j))}}if(!v){const N={top:0,left:0,behavior:c};if(x||scrollTo(N),p)for(const z of p)z.scrollTo(N)}}!x&&v&&b&&((k=document.getElementById(v))==null||k.scrollIntoView(b))}finally{Vg=!1}}))}function GK(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function F2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function VK(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=F2(s):Array.isArray(i)?i.push(F2(s)):t[r]=[i,F2(s)]}return t}const KK=/^(?:\s|["[{\d-]|fa|nu|tr)/,WK=XK(JSON.parse),QK=YK(JSON.stringify,JSON.parse);function XK(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=VK(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function YK(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!KK.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=GK(s,r);return i?`?${i}`:""}}const $d="__root__";function ZK(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function HO(e){return e instanceof Response&&!!e.options}function JK(e){return{input:({url:n})=>{for(const t of e)n=e3(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=qO(e[t],n);return n}}}function eW(e){const n=FO(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=P1(["/",n,i.pathname]),i)}}function e3(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function qO(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function tW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),c=t(void 0),u=t([]),h=r(()=>u.get().map(k=>i.get(k).get())),_=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:h.get(),location:o.get(),resolvedLocation:c.get()}));function p(k){let v=i.get(k);return v||(v=t(void 0),i.set(k,v)),v}const m={status:a,location:o,resolvedLocation:c,ids:u,matches:h,byRoute:i,__store:_,getMatchStore:p,setMatches:w};function w(k){const v=u.get(),b=k.map(x=>x.routeId);s(()=>{kK(v,b)||u.set(b);for(const x of v)b.includes(x)||i.get(x).set(()=>{});for(const x of k){const y=p(x.routeId);y.get()!==x&&y.set(x)}})}return m}var Tu="__TSR_index",vE="popstate",bE="beforeunload";function nW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...c})=>{var _,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((_=e.getBlockers)==null?void 0:_.call(e))??[],h=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&u.length&&h)for(const m of u){const w=vv(c.path,c.state);if(await m.blockerFn({currentLocation:n,nextLocation:w,action:c.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,c)=>{const u=n.state[Tu];o=yE(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:a,state:o})},replace:(a,o,c)=>{const u=n.state[Tu];o=yE(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[Tu]!==0,createHref:a=>e.createHref(a),block:a=>{var c;if(!e.setBlockers)return()=>{};const o=((c=e.getBlockers)==null?void 0:c.call(e))??[];return e.setBlockers([...o,a]),()=>{var h,_;const u=((h=e.getBlockers)==null?void 0:h.call(e))??[];(_=e.setBlockers)==null||_.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function yE(e,n){n||(n={});const t=Mk();return{...n,key:t,__TSR_key:t,[Tu]:e}}function rW(e){var A,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),c=(()=>vv(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((A=n.history.state)!=null&&A.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=Mk();n.history.replaceState({[Tu]:0,key:M,__TSR_key:M},"")}let u=c(),h,_=!1,p=!1,m=!1,w=!1;const k=()=>u;let v;const b=()=>{v&&(z._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),z._ignoreSubscribers=!1,v=void 0,h=void 0)},x=(M,D,I)=>{const B=o(D),U=!!v;U||(h=u),u=vv(D,I),v=[B,I,(v==null?void 0:v[2])||M],U||queueMicrotask(()=>b())},y=M=>{u=c(),z.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=c(),D=M.state[Tu]-u.state[Tu],I=D===1,B=D===-1,U=!I&&!B||_;_=!1;const H=U?"GO":B?"BACK":"FORWARD",Q=U?{type:"GO",index:D}:{type:B?"BACK":"FORWARD"};if(m)m=!1;else{const V=i();if(typeof document<"u"&&V.length){for(const Z of V)if(await Z.blockerFn({currentLocation:u,nextLocation:M,action:H})){p=!0,n.history.go(1),z.notify(Q);return}}}u=c(),z.notify(Q)},N=M=>{if(w){w=!1;return}let D=!1;const I=i();if(typeof document<"u"&&I.length)for(const B of I){const U=B.enableBeforeUnload??!0;if(U===!0){D=!0;break}if(typeof U=="function"&&U()===!0){D=!0;break}}if(D)return M.preventDefault(),M.returnValue=""},z=nW({getLocation:k,getLength:()=>n.history.length,pushState:(M,D)=>x(!0,M,D),replaceState:(M,D)=>x(!1,M,D),back:M=>(M&&(m=!0),w=!0,n.history.back()),forward:M=>{M&&(m=!0),w=!0,n.history.forward()},go:M=>{_=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(bE,N,{capture:!0}),n.removeEventListener(vE,C)},onBlocked:()=>{h&&u!==h&&(u=h)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(bE,N,{capture:!0}),n.addEventListener(vE,C),n.history.pushState=function(...M){const D=t.apply(n.history,M);return z._ignoreSubscribers||y("PUSH"),D},n.history.replaceState=function(...M){const D=r.apply(n.history,M);return z._ignoreSubscribers||y("REPLACE"),D},z}function sW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function vv(e,n){const t=sW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=Mk();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[Tu]:0,key:i,__TSR_key:i}}}function Mk(){return(Math.random()+1).toString(36).substring(7)}function xE(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function kb(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function wE({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function iW(e,n,t,r){var s,i,a,o;for(const c of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===c.routeId)||(i=(s=e.routesById[c.routeId].options).onLeave)==null||i.call(s,c)}for(const c of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[c.routeId].options)[n.some(u=>u.routeId===c.routeId)?"onStay":"onEnter"])==null||o.call(a,c)}}var aW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??hK??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=LK(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=rW()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=mv(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=tW(this.latestLocation,u),UK(this)}const o=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==o||a!==c){this.basepath=o;const u=[],h=FO(o);h&&h!=="/"&&u.push(eW({basepath:o})),c&&u.push(c),this.rewrite=u.length===0?void 0:u.length===1?u[0]:JK(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=AK(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&CK(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:c,search:u,hash:h,href:_,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const b=this.options.parseSearch(u),x=this.options.stringifySearch(b);return{href:c+x+h,publicHref:c+x+h,pathname:Ip(c).path,external:!1,searchStr:x,search:x_(r==null?void 0:r.search,b),hash:Ip(h.slice(1)).path,state:O_(r==null?void 0:r.state,p)}}const m=new URL(_,this.origin),w=e3(this.rewrite,m),k=this.options.parseSearch(w.search),v=this.options.stringifySearch(k);return w.search=v,{href:w.href.replace(w.origin,""),publicHref:_,pathname:Ip(w.pathname).path,external:!!this.rewrite&&w.origin!==this.origin,searchStr:v,search:x_(r==null?void 0:r.search,k),hash:Ip(w.hash.slice(1)).path,state:O_(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const c=s(a);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>DK({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=zK(el(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,D;if(i.href){const I=vv(i.href,{});i={...i,to:e3(this.rewrite,new URL(I.pathname,this.origin)).pathname,search:this.options.parseSearch(I.search),hash:I.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const c=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],h=o[3],_=this.resolvePathWithBase(c,i.to?`${i.to}`:".");let p=kE(i.params,h);const m=this.routesByPath[el(_)];let w;if(m)w=this.getRouteBranch(m);else if(_.includes("$"))w=[];else{const[I,B,U]=this.getMatchedRoutes(_);w=I,this.options.notFoundRoute&&(!U||U.path!=="/"&&B["**"])&&(w=[...w,this.options.notFoundRoute])}if(w.length&&OO(p))for(const I of w){const B=((M=I.options.params)==null?void 0:M.stringify)??I.options.stringifyParams;if(B){p===h&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,B(p))}catch{}}}const k=t.leaveParams?_:Ip(hE({path:_,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((D=this.options.search)!=null&&D.strict)){const I={};w.forEach(B=>{if(B.options.validateSearch)try{Object.assign(I,q1(B.options.validateSearch,{...I,...v}))}catch{}}),v=I}v=cW(v,i,w,t._includeValidateSearch),v=x_(u,v);const b=this.options.stringifySearch(v),x=i.hash===!0?a.hash:i.hash?hh(i.hash,a.hash):void 0,y=x?`#${x}`:"";let C=i.state===!0?a.state:i.state?hh(i.state,a.state):{};i.state&&(C=O_(a.state,C));const N=`${k}${b}${y}`;let z,A,j=!1;if(this.rewrite){const I=new URL(N,this.origin),B=qO(this.rewrite,I);z=I.href.replace(I.origin,""),B.origin!==this.origin?(A=B.href,j=!0):A=B.pathname+B.search+B.hash}else z=wK(N),A=z;return{publicHref:A,href:z,pathname:k,search:v,searchStr:b,state:C,hash:x??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=EK(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:c,...u}=i.route,h=kE(c,a);s.maskedLocation=r({from:t.from,...u,params:h})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=el(this.latestLocation.href)===el(s.href)&&Au(wE(s.state),wE(this.latestLocation.state)),o=this._commitPromise;let c;const u=new Promise(h=>{c=h});if(u.resolve=()=>{c(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:h,hashScrollIntoView:_,...p}=s;h&&(p={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=_??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const c=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=c;const u=this.commitLocation({...c,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===c&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var c,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const _=this.buildLocation({to:t,...a});s=s??_.publicHref,i=i??_.publicHref}const h=!o&&i?i:s;if(pv(h,this.protocolAllowlist))return;if(!a.ignoreBlocker){const _=((u=(c=this.history).getBlockers)==null?void 0:u.call(c))??[];for(const p of _)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(h):window.location.href=h;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await gW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,c=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(kb(o,c)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,h;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(_=>!s||s(_)).map(_=>_.id)),o=[];for(const[_,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(_),o.push(_));const c=_=>{if(a.has(_.id)){const p=this.routesById[_.routeId],m={..._,invalid:!0,...(t!=null&&t.forcePending||_.status==="error"||_.status==="notFound")&&xE(p)?{status:"pending",error:void 0}:void 0};return _._flight=void 0,m}return _};this._committed=r.map(c);for(const[_,p]of this._cache)a.has(_)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const _ of a)(h=this._flights)==null||h.delete(_);for(const _ of o)_.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&pv(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[h,_]of r)(!i||i(_))&&(o.push(h),a.push(_));const c=[];for(const[h,_]of s??[])(!i||_.some(i))&&(c.push(h),a.push(..._));for(const h of o)r.delete(h);for(const h of c)s.delete(h);for(const h of a){const _=h._flight;h._flight=void 0,_&&!--_[2]&&(((u=this._flights)==null?void 0:u.get(h.id))===_&&this._flights.delete(h.id),c.push(_[1]))}for(const h of c)h.abort()},this.loadRouteChunk=Bd,this.preloadRoute=t=>vW(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=NK(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!c||t.params&&!Au(c.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?Au(o.search,i.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??QK,parseSearch:e.parseSearch??WK,protocolAllowlist:e.protocolAllowlist??xK}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=BO(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:el(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?lW(this.options.notFoundMode,i):void 0,c=new Array(i.length),u=this._committed,h=(w,k)=>{const v=u[k];return(v==null?void 0:v.routeId)===w.id?v:w===this.options.notFoundRoute?u.find(b=>b.routeId===w.id):void 0};let _;for(let w=0;w{const m=p(c.preSearchFilters?c.preSearchFilters.reduce((w,k)=>k(w),_):_);return c.postSearchFilters?c.postSearchFilters.reduce((w,k)=>k(w),m):m};s.push(h)}const u=c.validateSearch;if(r&&u){const h=({search:_,next:p,meta:m})=>{const w=p(_);try{const k=q1(u,w);if(m&&k)for(const v in k)v in w||(m.defaulted||(m.defaulted=new Map)).set(v,k[v]);return{...w,...k}}catch{}return w};s.push(h)}}const i=(o,c,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return c;const _=hh(n.search,c);return u&&(u.explicit=_),_}const h=(_,p)=>{if(p){const m=u||{};return{search:i(o+1,_,m),meta:m}}return i(o+1,_,u)};return s[o]({search:c,next:h,meta:u})};return i(0,e)}function lW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return $d}function kE(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,hh(e,t))}function SE(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function t3(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function uW(e,n){const t=t3(e,"component");let r=t3(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function Bd(e,n,t){const r=()=>n===!1?void 0:n?t3(e,n):uW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...c}=a.options;Object.assign(e.options,c),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function Ok(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Cf(e,n){return e.routesById[n.routeId]}function C0(e,n,t){return HO(e)?[sa,e]:ph(e)?(e.routeId||(e.routeId=t),[Sb,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[al,e]):[Wo,e]}function Dk(e,n){var r,s;let t=C0(n,!0,e.id);if(t[0]!==al)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=C0(i,!0,e.id)}return t}function l0(e,n,t,r,s){return s[0].signal.aborted?Ou:$k(e,n,t,Dk(t,r),s)}async function _W(e,n,t,r,s,i){var h,_;const[a,o]=n,c=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:w.id};try{const C=m._ctx||(m._ctx=w.options.context?w.options.context({...v,deps:m.loaderDeps,context:k})||{}:void 0);m.context={...k,...C}}catch(C){return tl(e,m),[p,l0(e,n,w,C,t)]}if(c.aborted)return[p,Ou];const b=m.paramsError??m.searchError;if(b!==void 0)return tl(e,m),[p,l0(e,n,w,b,t)];const x=w.options.beforeLoad;if(!x)continue;const y=m.status;p>=i&&(m.status="pending",(_=t[7])==null||_.call(t));try{E0(e,m,"beforeLoad",t[0]);const C=await Sf(x({...v,search:m.search,context:m.context,...e.options.additionalContext}),c);if(c.aborted)return[p,Ou];const N=$k(e,n,w,C0(C,!1,w.id),t);if(N[0]!==Wo)return tl(e,m),[p,N];m.context={...m.context,...C}}catch(C){return tl(e,m),[p,l0(e,n,w,C,t)]}finally{m.status=y,E0(e,m,!1,t[0])}}s()}function Lk(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function tl(e,n){var r;const t=n._flight;n._flight=void 0,(r=Lk(e,n,t))==null||r.abort()}function Ii(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(c=>c.id===a.id)))o[2]=0;else{const c=Lk(e,a,o);c&&s.push(c)}}for(const a of s)a.abort()}function Ik(e){for(const n of e){const t=n._flight;t&&t[2]++}}function E0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function UO(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:c=>e.navigate({...c,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function CE(e,n,t,r,s,i,a){const o=a[0],c=o.signal;if(c.aborted)return Ou;if(!s)return[Wo,void 0];let u=t._flight;E0(e,t,"loader",o);try{if(!u){const h=new AbortController;u=[Promise.resolve().then(()=>s(UO(e,n,t,r,h,i,!!a[3]))).then(_=>C0(_,!1,r.id),_=>C0(_,!0,r.id)).then(_=>{var p;return _[0]!==Wo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||h.abort()),_[0]===al&&u[2]?Dk(r,_[1]):_}),h,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],$k(e,n,r,await Sf(u[0],c),a)}catch(h){if(h!==c||!c.aborted)throw h;return tl(e,t),Ou}finally{E0(e,t,!1,o)}}function EE(e,n,t){n[0]!==sa&&(e.status="success",e.error=void 0,n[0]===Wo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function fW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&tl(e,r)}function NE(e,n){return n[0]===al||n[0]===Sb?{...e,status:n[0]===al?"error":"notFound",error:n[1],_flight:void 0}:e}function dW(e,n,t,r,s,i,a){var B,U;const o=n[1][t],c=Cf(e,o),u=!!i[3],h=e._cache.get(o.id);let _,p=!1,m;try{if(o.status==="success"&&(_=c.options.shouldReload,typeof _=="function"&&(_=_(UO(e,n,o,c,i[0],s,u))),i[0].signal.aborted&&(m=Ou)),!m)if(o.status!=="success")p=!0;else{const H=u||o.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||_||_===void 0&&Date.now()-o.updatedAt>=H&&(i[5]||o.cause==="enter"||i[2].some(Q=>Q.routeId===o.routeId&&Q.id!==o.id)))}}catch(H){o.invalid=!0,tl(e,o),m=l0(e,n,c,H,i)}const w=c.options.loader,k=typeof w=="function",v=k?w:w==null?void 0:w.handler,b=!u||c.options.preload!==!1;let x=b&&w?(B=e._flights)==null?void 0:B.get(o.id):void 0;x===o._flight||m?x=void 0:x&&!p&&!u&&_===void 0?p=!0:p||(x=void 0);const y=!!(w&&p&&o.status==="success"&&!u&&!i[4]&&((k?void 0:w.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,N=C&&!y&&(o.status!=="success"||!!w),z=t>=a?i[7]:void 0,A=c.lazyFn&&c._lazy!==!0?z:void 0;if(C&&!w&&(o.invalid=!1,o.updatedAt=Date.now()),x&&x[2]++,N){const H=o._flight;o._flight=x,(U=Lk(e,o,H))==null||U.abort(),t>=a&&(o.status="pending"),z==null||z()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):N?CE(e,n,o,c,v,s,i):Promise.resolve([Wo,o.loaderData])).then(H=>(N&&(EE(o,H,u),H[0]===Wo&&(w&&!i[0].signal.aborted&&fW(e,o,h),t>=a&&(o.status="pending"))),H)),M=Sf(Promise.resolve().then(()=>Bd(c,void 0,A)),i[0].signal).then(()=>{},H=>n[1].some((Q,V)=>V<=t&&(Q.status==="error"||Q.status==="notFound"||Q._notFound))?void 0:[t,l0(e,n,c,H,i)]).then(H=>j.then(Q=>(N&&!H&&Q[0]===Wo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",z==null||z()),H)));if(r.push([t,j,M]),!y)return j.then(H=>NE(o,H));const D={...o,status:"pending",preload:!1,_flight:x};o.invalid=!1,o.isFetching="loader";const I=CE(e,n,D,c,v,s,i).then(H=>(o.isFetching=!1,EE(D,H,!1),H));return(n[2]??(n[2]=[])).push([t,I,M,D]),I.then(H=>NE(D,H))}async function n3(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const c=Cf(e,n[o]);try{const u=Bd(c,!1);u&&await Sf(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(c.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function Y_(e,n){n[2]&&(Ii(e,n[2].map(t=>t[3])),n[2]=void 0)}async function zE(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=sa)throw[o,a];!s&&a[0]!==Wo&&(s=[o,a],await Promise.all((t??[]).map(c=>{if(!(c[0]<=o))return c[1].then(u=>{if(u[0]===sa)throw[c[0],u]})})))}})))}catch(i){return i}return n??s}function $k(e,n,t,r,s,i){for(;r[0]===sa;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[sa,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(c){r=i?[al,c]:Dk(t,c),i=!0}}return r}async function GO(e,n,t,r,s,i){const a=n[1];let o=await s,c=!1;const u=a.findIndex(m=>m._notFound),h=m=>m[1][0]===Sb?n3(e,a,m,r.signal):m[0];let _=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=sa)_=0;else if(o){_=o[2]??(o[2]=await h(o));for(const m of t){if(m[0]>=_)break;const w=await m[1];if(w[0]!==Wo&&w[0]=_)break;const w=await m[2];if(w){o=w;break}}if(((o==null?void 0:o[1][0])??0)>=sa){const m=o[1];if(m[0]!==sa||m[1].options.reloadDocument||m[2])return Y_(e,n),m;c=!0,o=[0,[al,new Error("Too many redirects")]]}const p=o?o[2]??await h(o):u;if(p>=0){const m=o==null?void 0:o[1],w=m==null?void 0:m[0],k=a[p],v=m==null?void 0:m[1],b=()=>{m&&(k._notFound=void 0,w===al?k.status="error":(v.routeId=k.routeId,k.routeId===e.routeTree.id?(k.status="success",k._notFound=!0):k.status="notFound"),k.error=v,k.isFetching=!1)};b(),m||i==null||i();const x=Cf(e,k);try{await Sf(m?Promise.resolve().then(()=>Bd(x,w===al?"errorComponent":"notFoundComponent")):Promise.all([Bd(x),Bd(x,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return Y_(e,n),Ou}m?c&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),Y_(e,n),Ii(e,a),b()):k.status="success"}return n}async function VO(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let c=r;cx._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const x=await n3(e,t,void 0,i,u);t[u]._notFound=void 0,t[x]._notFound=!0,u=x}let h=u<0?t.length:u+1,_=0;for(;_{for(let x=m;x=sa&&(h=0);k()}if(!i.aborted&&!r[3]){const x=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),x.push(C[1]));for(const y of x)y.abort()}const b=GO(e,s,p,r[0],zE(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=zE(s[2],void 0,void 0,b.then(x=>S0(x)?0:Ok(t).length,()=>0))),a=await b}catch(c){if(Y_(e,s),c===i&&i.aborted)return Ou;throw c}return S0(a)?a:VO(e,a,i,r[6]===t.length?r[6]:0)}function r3(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>r3(e,n),x);return}s[2]=0}const v=t.map(x=>({...x,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(x=>(x&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+w),x));return}}function $p(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function jE(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!Ok(n[3]).some(i=>i.id===t[1]))return;let s;try{await Sf(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function WO(e,n){e._committed=n,e.stores.setMatches(n)}function hW(e,n,t,r){const s=e._committed,i=e._cache;for(const c of t)c.preload=!1,r&&(c._assetEnd=void 0);const a=Ok(t).length,o=new Map;{const c=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((_,p)=>_.id===u.id&&(p=(u.preload?h.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:h.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,WO(e,t),Ii(e,[...i.values(),...s],[...t,...o.values()]),iW(e,s,t,n)}async function Kg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function QO(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function pW(e,n,t,r,s){const i=t.map(c=>({...c}));Ik(i);for(const c of r)tl(e,i[c[0]]),i[c[0]]=c[3];const a=[n[2],i];let o;try{o=await GO(e,a,r,n[0],s)}catch(c){throw Ii(e,i),c}if(S0(o)){Ii(e,i),o[0]===sa&&e._tx===n&&e._committed===t&&await QO(e,n,o);return}if(await VO(e,o,n[0].signal),e._tx!==n||e._committed!==t){Ii(e,i);return}for(const c of i){const u=e._cache.get(c.id);u!=null&&u._flight&&u._flight===c._flight&&(e._cache.delete(c.id),tl(e,u))}WO(e,i),Ii(e,t,i)}async function mW(e,n,t,r,s,i){const a=await KO(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(S0(a)){const _=a[0]===sa&&e._tx===n;if((!_||a[1].options.reloadDocument)&&$p(e,n),Ii(e,n[3]),n[3]=[],!_)return;if(e._tx!==n){$p(e,n);return}await QO(e,n,a);return}const o=a[1];if(e._tx===n&&await jE(e,n),e._tx!==n){$p(e,n),Ii(e,o),Y_(e,a);return}const c=n[2],u=kb(c,e.stores.resolvedLocation.get()),h=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await jE(e,n),e._tx!==n){$p(e,n),Ii(e,o),Y_(e,a);return}const _=()=>{$p(e,n),hW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(_,o);if(e._tx!==n){Y_(e,a);return}h!=null&&h.length&&pW(e,n,o,h,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function gW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,c=e._handoff,u=c==null?void 0:c[0](),h=new AbortController,_=e._preflight;if(e._preflight=h,u||c==null||c[1](),_==null||_.abort(),!h.signal.aborted){const N=kb(i,r);e.emit({type:"onBeforeNavigate",...N}),h.signal.aborted||e.emit({type:"onBeforeLoad",...N})}if(h.signal.aborted){await Kg(e,t);return}const p=s.href===i.href;let m=h;const w=e.matchRoutes(i,{_controller:h});Ik(w);const k=u?c[1](w):void 0;if(k?m=u:u==null||u.abort(),h.signal.aborted){Ii(e,w),await Kg(e,t);return}e._preflight=void 0;let v;const b=()=>mW(e,y,p,()=>r3(e,y),n==null?void 0:n.sync,k),x=n!=null&&n.sync?new Promise(N=>v=N):Promise.resolve().then(b).then(),y=[m,o,i,w,Date.now(),x];if(e._tx=y,t){for(const N of e.stores.matches.get()){if(e._tx!==y)break;N.isFetching&&E0(e,N,!1)}t[0].abort(),Ii(e,t[3],y[3],!0)}if(e._tx!==y){Ii(e,y[3]),y[3]=[],v==null||v(),await Kg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(k||!e._committed.length&&((C=w[0])==null?void 0:C.status)!=="success"&&!w.some(N=>N._notFound))&&r3(e,y),v==null||v(b()),await x,await Kg(e,y)}async function vW(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,c;try{try{a=e.matchRoutes(t,{_controller:i}),Ik(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),c=await KO(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),Ii(e,a)),i.abort()}if(!S0(c))return c[1];if(!o||c.length<3)return;t=c[2]}catch(u){ph(u)||console.error(u);return}}}const bW="Error preloading route! ☝️";var XO=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var c,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(c=this.options).getParentRoute)==null?void 0:u.call(c),r?this._path=$d:this.parentRoute||Tk();let s=r?$d:t==null?void 0:t.path;s&&s!=="/"&&(s=PO(s));const i=(t==null?void 0:t.id)||s;let a=r?$d:P1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=P1(["/",a]));const o=a==="__root__"?"/":P1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=el(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>ZK({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},yW=class extends XO{constructor(e){super(e)}},Bk=class extends T.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?T.createElement(this.props.errorComponent??xW,{error:e,reset:this.reset}):this.props.children}};function xW({error:e}){const[n,t]=T.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function wW({children:e,fallback:n=null}){return f.jsx(tt.Fragment,{children:YO()?e:n})}function YO(){return tt.useSyncExternalStore(kW,()=>!0,()=>!1)}function kW(){return()=>{}}var ZO=T.createContext(null);function vi(e){return T.useContext(ZO)}var Cb=T.createContext(void 0),SW=T.createContext(void 0),Er=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Er||{});function CW({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,h,_){const p=h.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:h.deps;if(m!==void 0&&m.dep===u){m.version=_,h.depsTail=m;return}const w=u.subsTail;if(w!==void 0&&w.version===_&&w.sub===h)return;const k=h.depsTail=u.subsTail={version:_,dep:u,sub:h,prevDep:p,nextDep:m,prevSub:w,nextSub:void 0};m!==void 0&&(m.prevDep=k),p!==void 0?p.nextDep=k:h.deps=k,w!==void 0?w.nextSub=k:u.subs=k}function s(u,h=u.sub){const _=u.dep,p=u.prevDep,m=u.nextDep,w=u.nextSub,k=u.prevSub;return m!==void 0?m.prevDep=p:h.depsTail=p,p!==void 0?p.nextDep=m:h.deps=m,w!==void 0?w.prevSub=k:_.subsTail=k,k!==void 0?k.nextSub=w:(_.subs=w)===void 0&&t(_),m}function i(u){let h=u.nextSub,_;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&c(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const w=p.subs;if(w!==void 0){const k=(u=w).nextSub;k!==void 0&&(_={value:h,prev:_},h=k);continue}}if((u=h)!==void 0){h=u.nextSub;continue}for(;_!==void 0;)if(u=_.value,_=_.prev,u!==void 0){h=u.nextSub;continue e}break}while(!0)}function a(u,h){let _,p=0,m=!1;e:do{const w=u.dep,k=w.flags;if(h.flags&16)m=!0;else if((k&17)===17){if(e(w)){const v=w.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((k&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(_={value:u,prev:_}),u=w.deps,h=w,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=h.subs,b=v.nextSub!==void 0;if(b?(u=_.value,_=_.prev):u=v,m){if(e(h)){b&&o(v),h=u.sub;continue}m=!1}else h.flags&=-33;h=u.sub;const x=u.nextDep;if(x!==void 0){u=x;continue e}}return m}while(!0)}function o(u){do{const h=u.sub,_=h.flags;(_&48)===32&&(h.flags=_|16,(_&6)===2&&n(h))}while((u=u.nextSub)!==void 0)}function c(u,h){let _=h.depsTail;for(;_!==void 0;){if(_===u)return!0;_=_.prevDep}return!1}}function EW(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const s3=[];let U1=0;const{link:AE,unlink:NW,propagate:zW,checkDirty:JO,shallowPropagate:TE}=CW({update(e){return e._update()},notify(e){s3[i3++]=e,e.flags&=~Er.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Er.Mutable|Er.Dirty,yv(e))}});let Wg=0,i3=0,Bo,a3=0;function jW(e){try{++a3,e()}finally{--a3||eD()}}function yv(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=NW(t,e)}function eD(){if(!(a3>0)){for(;Wg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(i){const a=Bo,o=(n==null?void 0:n.compare)??Object.is;if(t)Bo=s,++U1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=Er.Mutable|Er.RecursedCheck);try{const c=s._snapshot,u=typeof i=="function"?i(c):i===void 0&&t?r(c):i;return c===void 0||!o(c,u)?(s._snapshot=u,!0):!1}finally{Bo=a,t&&(s.flags&=~Er.RecursedCheck),yv(s)}}};return t?(s.flags=Er.Mutable|Er.Dirty,s.get=function(){const i=s.flags;if(i&Er.Dirty||i&Er.Pending&&JO(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&TE(a)}}else i&Er.Pending&&(s.flags=i&~Er.Pending);return Bo!==void 0&&AE(s,Bo,U1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(zW(a),TE(a),eD())}},s}function AW(e){const n=()=>{const r=Bo;Bo=t,++U1,t.depsTail=void 0,t.flags=Er.Watching|Er.RecursedCheck;try{return e()}finally{Bo=r,t.flags&=~Er.RecursedCheck,yv(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Er.Watching|Er.RecursedCheck,notify(){const r=this.flags;r&Er.Dirty||r&Er.Pending&&JO(this.deps,this)?n():this.flags=Er.Watching},stop(){this.flags=Er.None,this.depsTail=void 0,yv(this)}};return n(),t}var H2={exports:{}},q2={},U2={exports:{}},G2={};/** +`+S.stack}}var Ze=Object.prototype.hasOwnProperty,ot=e.unstable_scheduleCallback,kt=e.unstable_cancelCallback,qt=e.unstable_shouldYield,dt=e.unstable_requestPaint,pt=e.unstable_now,Ie=e.unstable_getCurrentPriorityLevel,pe=e.unstable_ImmediatePriority,je=e.unstable_UserBlockingPriority,He=e.unstable_NormalPriority,st=e.unstable_LowPriority,_t=e.unstable_IdlePriority,Ct=e.log,bt=e.unstable_setDisableYieldValue,Yt=null,un=null;function Tt(l){if(typeof Ct=="function"&&bt(l),un&&typeof un.setStrictMode=="function")try{un.setStrictMode(Yt,l)}catch{}}var ht=Math.clz32?Math.clz32:gs,mt=Math.log,_n=Math.LN2;function gs(l){return l>>>=0,l===0?32:31-(mt(l)/_n|0)|0}var br=256,Gt=262144,Bn=4194304;function _r(l){var d=l&42;if(d!==0)return d;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function yr(l,d,g){var S=l.pendingLanes;if(S===0)return 0;var R=0,O=l.suspendedLanes,X=l.pingedLanes;l=l.warmLanes;var re=S&134217727;return re!==0?(S=re&~O,S!==0?R=_r(S):(X&=re,X!==0?R=_r(X):g||(g=re&~l,g!==0&&(R=_r(g))))):(re=S&~O,re!==0?R=_r(re):X!==0?R=_r(X):g||(g=S&~l,g!==0&&(R=_r(g)))),R===0?0:d!==0&&d!==R&&(d&O)===0&&(O=R&-R,g=d&-d,O>=g||O===32&&(g&4194048)!==0)?d:R}function Wr(l,d){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&d)===0}function Nt(l,d){switch(l){case 1:case 2:case 4:case 8:case 64:return d+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 d+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 vn(){var l=Bn;return Bn<<=1,(Bn&62914560)===0&&(Bn=4194304),l}function fn(l){for(var d=[],g=0;31>g;g++)d.push(l);return d}function hn(l,d){l.pendingLanes|=d,d!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Ir(l,d,g,S,R,O){var X=l.pendingLanes;l.pendingLanes=g,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=g,l.entangledLanes&=g,l.errorRecoveryDisabledLanes&=g,l.shellSuspendCounter=0;var re=l.entanglements,de=l.expirationTimes,Se=l.hiddenUpdates;for(g=X&~g;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var Yr=/[\n"\\]/g;function Rr(l){return l.replace(Yr,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function wo(l,d,g,S,R,O,X,re){l.name="",X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?l.type=X:l.removeAttribute("type"),d!=null?X==="number"?(d===0&&l.value===""||l.value!=d)&&(l.value=""+Xr(d)):l.value!==""+Xr(d)&&(l.value=""+Xr(d)):X!=="submit"&&X!=="reset"||l.removeAttribute("value"),d!=null?Hs(l,X,Xr(d)):g!=null?Hs(l,X,Xr(g)):S!=null&&l.removeAttribute("value"),R==null&&O!=null&&(l.defaultChecked=!!O),R!=null&&(l.checked=R&&typeof R!="function"&&typeof R!="symbol"),re!=null&&typeof re!="function"&&typeof re!="symbol"&&typeof re!="boolean"?l.name=""+Xr(re):l.removeAttribute("name")}function wi(l,d,g,S,R,O,X,re){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(l.type=O),d!=null||g!=null){if(!(O!=="submit"&&O!=="reset"||d!=null)){xi(l);return}g=g!=null?""+Xr(g):"",d=d!=null?""+Xr(d):g,re||d===l.value||(l.value=d),l.defaultValue=d}S=S??R,S=typeof S!="function"&&typeof S!="symbol"&&!!S,l.checked=re?l.checked:!!S,l.defaultChecked=!!S,X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"&&(l.name=X),xi(l)}function Hs(l,d,g){d==="number"&&Hi(l.ownerDocument)===l||l.defaultValue===""+g||(l.defaultValue=""+g)}function oi(l,d,g,S){if(l=l.options,d){d={};for(var R=0;R"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ko=!1;if(Vs)try{var ir={};Object.defineProperty(ir,"passive",{get:function(){ko=!0}}),window.addEventListener("test",ir,ir),window.removeEventListener("test",ir,ir)}catch{ko=!1}var ki=null,dr=null,fc=null;function Yu(){if(fc)return fc;var l,d=dr,g=d.length,S,R="value"in ki?ki.value:ki.textContent,O=R.length;for(l=0;l=bc),i_=" ",a_=!1;function Rl(l,d){switch(l){case"keyup":return Ff.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ml(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Co=!1;function Ol(l,d){switch(l){case"compositionend":return Ml(d);case"keypress":return d.which!==32?null:(a_=!0,i_);case"textInput":return l=d.data,l===i_&&a_?null:l;default:return null}}function Dl(l,d){if(Co)return l==="compositionend"||!vc&&Rl(l,d)?(l=Yu(),fc=dr=ki=null,Co=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1=d)return{node:g,offset:d-l};l=S}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Ee(g)}}function Pe(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?Pe(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function Jt(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var d=Hi(l.document);d instanceof l.HTMLIFrameElement;){try{var g=typeof d.contentWindow.location.href=="string"}catch{g=!1}if(g)l=d.contentWindow;else break;d=Hi(l.document)}return d}function mn(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}var Dn=Vs&&"documentMode"in document&&11>=document.documentMode,rn=null,Sr=null,J=null,ge=!1;function Ae(l,d,g){var S=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;ge||rn==null||rn!==Hi(S)||(S=rn,"selectionStart"in S&&mn(S)?S={start:S.selectionStart,end:S.selectionEnd}:(S=(S.ownerDocument&&S.ownerDocument.defaultView||window).getSelection(),S={anchorNode:S.anchorNode,anchorOffset:S.anchorOffset,focusNode:S.focusNode,focusOffset:S.focusOffset}),J&&me(J,S)||(J=S,S=zg(Sr,"onSelect"),0>=X,R-=X,jo=1<<32-ht(d)+R|g<cn?(jn=zt,zt=null):jn=zt.sibling;var qn=ze(we,zt,ke[cn],Fe);if(qn===null){zt===null&&(zt=jn);break}l&&zt&&qn.alternate===null&&d(we,zt),ve=O(qn,ve,cn),Hn===null?Ft=qn:Hn.sibling=qn,Hn=qn,zt=jn}if(cn===ke.length)return g(we,zt),Tn&&Cc(we,cn),Ft;if(zt===null){for(;cncn?(jn=zt,zt=null):jn=zt.sibling;var au=ze(we,zt,qn.value,Fe);if(au===null){zt===null&&(zt=jn);break}l&&zt&&au.alternate===null&&d(we,zt),ve=O(au,ve,cn),Hn===null?Ft=au:Hn.sibling=au,Hn=au,zt=jn}if(qn.done)return g(we,zt),Tn&&Cc(we,cn),Ft;if(zt===null){for(;!qn.done;cn++,qn=ke.next())qn=qe(we,qn.value,Fe),qn!==null&&(ve=O(qn,ve,cn),Hn===null?Ft=qn:Hn.sibling=qn,Hn=qn);return Tn&&Cc(we,cn),Ft}for(zt=S(zt);!qn.done;cn++,qn=ke.next())qn=Me(zt,we,cn,qn.value,Fe),qn!==null&&(l&&qn.alternate!==null&&zt.delete(qn.key===null?cn:qn.key),ve=O(qn,ve,cn),Hn===null?Ft=qn:Hn.sibling=qn,Hn=qn);return l&&zt.forEach(function(xV){return d(we,xV)}),Tn&&Cc(we,cn),Ft}function rr(we,ve,ke,Fe){if(typeof ke=="object"&&ke!==null&&ke.type===k&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var Ft=ke.key;ve!==null;){if(ve.key===Ft){if(Ft=ke.type,Ft===k){if(ve.tag===7){g(we,ve.sibling),Fe=R(ve,ke.props.children),Fe.return=we,we=Fe;break e}}else if(ve.elementType===Ft||typeof Ft=="object"&&Ft!==null&&Ft.$$typeof===j&&h_(Ft)===ve.type){g(we,ve.sibling),Fe=R(ve,ke.props),op(Fe,ke),Fe.return=we,we=Fe;break e}g(we,ve);break}else d(we,ve);ve=ve.sibling}ke.type===k?(Fe=l_(ke.props.children,we.mode,Fe,ke.key),Fe.return=we,we=Fe):(Fe=Gm(ke.type,ke.key,ke.props,null,we.mode,Fe),op(Fe,ke),Fe.return=we,we=Fe)}return X(we);case w:e:{for(Ft=ke.key;ve!==null;){if(ve.key===Ft)if(ve.tag===4&&ve.stateNode.containerInfo===ke.containerInfo&&ve.stateNode.implementation===ke.implementation){g(we,ve.sibling),Fe=R(ve,ke.children||[]),Fe.return=we,we=Fe;break e}else{g(we,ve);break}else d(we,ve);ve=ve.sibling}Fe=Yy(ke,we.mode,Fe),Fe.return=we,we=Fe}return X(we);case j:return ke=h_(ke),rr(we,ve,ke,Fe)}if(Q(ke))return St(we,ve,ke,Fe);if(B(ke)){if(Ft=B(ke),typeof Ft!="function")throw Error(r(150));return ke=Ft.call(ke),Vt(we,ve,ke,Fe)}if(typeof ke.then=="function")return rr(we,ve,Zm(ke),Fe);if(ke.$$typeof===y)return rr(we,ve,Wm(we,ke),Fe);Jm(we,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,ve!==null&&ve.tag===6?(g(we,ve.sibling),Fe=R(ve,ke),Fe.return=we,we=Fe):(g(we,ve),Fe=Xy(ke,we.mode,Fe),Fe.return=we,we=Fe),X(we)):g(we,ve)}return function(we,ve,ke,Fe){try{ap=0;var Ft=rr(we,ve,ke,Fe);return Zf=null,Ft}catch(zt){if(zt===Yf||zt===Xm)throw zt;var Hn=Ki(29,zt,null,we.mode);return Hn.lanes=Fe,Hn.return=we,Hn}finally{}}}var m_=e7(!0),t7=e7(!1),ql=!1;function lx(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ux(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Ul(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function Gl(l,d,g){var S=l.updateQueue;if(S===null)return null;if(S=S.shared,(Gn&2)!==0){var R=S.pending;return R===null?d.next=d:(d.next=R.next,R.next=d),S.pending=d,d=Um(l),$C(l,null,g),d}return kc(l,S,d,g),Um(l)}function cp(l,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194048)!==0)){var S=d.lanes;S&=l.pendingLanes,g|=S,d.lanes=g,yn(l,g)}}function _x(l,d){var g=l.updateQueue,S=l.alternate;if(S!==null&&(S=S.updateQueue,g===S)){var R=null,O=null;if(g=g.firstBaseUpdate,g!==null){do{var X={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};O===null?R=O=X:O=O.next=X,g=g.next}while(g!==null);O===null?R=O=d:O=O.next=d}else R=O=d;g={baseState:S.baseState,firstBaseUpdate:R,lastBaseUpdate:O,shared:S.shared,callbacks:S.callbacks},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=d:l.next=d,g.lastBaseUpdate=d}var fx=!1;function lp(){if(fx){var l=Xf;if(l!==null)throw l}}function up(l,d,g,S){fx=!1;var R=l.updateQueue;ql=!1;var O=R.firstBaseUpdate,X=R.lastBaseUpdate,re=R.shared.pending;if(re!==null){R.shared.pending=null;var de=re,Se=de.next;de.next=null,X===null?O=Se:X.next=Se,X=de;var Be=l.alternate;Be!==null&&(Be=Be.updateQueue,re=Be.lastBaseUpdate,re!==X&&(re===null?Be.firstBaseUpdate=Se:re.next=Se,Be.lastBaseUpdate=de))}if(O!==null){var qe=R.baseState;X=0,Be=Se=de=null,re=O;do{var ze=re.lane&-536870913,Me=ze!==re.lane;if(Me?(zn&ze)===ze:(S&ze)===ze){ze!==0&&ze===Qf&&(fx=!0),Be!==null&&(Be=Be.next={lane:0,tag:re.tag,payload:re.payload,callback:null,next:null});e:{var St=l,Vt=re;ze=d;var rr=g;switch(Vt.tag){case 1:if(St=Vt.payload,typeof St=="function"){qe=St.call(rr,qe,ze);break e}qe=St;break e;case 3:St.flags=St.flags&-65537|128;case 0:if(St=Vt.payload,ze=typeof St=="function"?St.call(rr,qe,ze):St,ze==null)break e;qe=_({},qe,ze);break e;case 2:ql=!0}}ze=re.callback,ze!==null&&(l.flags|=64,Me&&(l.flags|=8192),Me=R.callbacks,Me===null?R.callbacks=[ze]:Me.push(ze))}else Me={lane:ze,tag:re.tag,payload:re.payload,callback:re.callback,next:null},Be===null?(Se=Be=Me,de=qe):Be=Be.next=Me,X|=ze;if(re=re.next,re===null){if(re=R.shared.pending,re===null)break;Me=re,re=Me.next,Me.next=null,R.lastBaseUpdate=Me,R.shared.pending=null}}while(!0);Be===null&&(de=qe),R.baseState=de,R.firstBaseUpdate=Se,R.lastBaseUpdate=Be,O===null&&(R.shared.lanes=0),Xl|=X,l.lanes=X,l.memoizedState=qe}}function n7(l,d){if(typeof l!="function")throw Error(r(191,l));l.call(d)}function r7(l,d){var g=l.callbacks;if(g!==null)for(l.callbacks=null,l=0;lO?O:8;var X=V.T,re={};V.T=re,Tx(l,!1,d,g);try{var de=R(),Se=V.S;if(Se!==null&&Se(re,de),de!==null&&typeof de=="object"&&typeof de.then=="function"){var Be=uG(de,S);dp(l,d,Be,Zi(l))}else dp(l,d,S,Zi(l))}catch(qe){dp(l,d,{then:function(){},status:"rejected",reason:qe},Zi())}finally{Z.p=O,X!==null&&re.types!==null&&(X.types=re.types),V.T=X}}function mG(){}function jx(l,d,g,S){if(l.tag!==5)throw Error(r(476));var R=D7(l).queue;O7(l,R,d,Y,g===null?mG:function(){return L7(l),g(S)})}function D7(l){var d=l.memoizedState;if(d!==null)return d;d={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jc,lastRenderedState:Y},next:null};var g={};return d.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jc,lastRenderedState:g},next:null},l.memoizedState=d,l=l.alternate,l!==null&&(l.memoizedState=d),d}function L7(l){var d=D7(l);d.next===null&&(d=l.alternate.memoizedState),dp(l,d.next.queue,{},Zi())}function Ax(){return $s(Ap)}function I7(){return ss().memoizedState}function $7(){return ss().memoizedState}function gG(l){for(var d=l.return;d!==null;){switch(d.tag){case 24:case 3:var g=Zi();l=Ul(g);var S=Gl(d,l,g);S!==null&&(Ri(S,d,g),cp(S,d,g)),d={cache:ix()},l.payload=d;return}d=d.return}}function vG(l,d,g){var S=Zi();g={lane:S,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},lg(l)?P7(d,g):(g=hr(l,d,g,S),g!==null&&(Ri(g,l,S),F7(g,d,S)))}function B7(l,d,g){var S=Zi();dp(l,d,g,S)}function dp(l,d,g,S){var R={lane:S,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(lg(l))P7(d,R);else{var O=l.alternate;if(l.lanes===0&&(O===null||O.lanes===0)&&(O=d.lastRenderedReducer,O!==null))try{var X=d.lastRenderedState,re=O(X,g);if(R.hasEagerState=!0,R.eagerState=re,te(re,X))return kc(l,d,R,0),ar===null&&Pr(),!1}catch{}finally{}if(g=hr(l,d,R,S),g!==null)return Ri(g,l,S),F7(g,d,S),!0}return!1}function Tx(l,d,g,S){if(S={lane:2,revertLane:l2(),gesture:null,action:S,hasEagerState:!1,eagerState:null,next:null},lg(l)){if(d)throw Error(r(479))}else d=hr(l,g,S,2),d!==null&&Ri(d,l,2)}function lg(l){var d=l.alternate;return l===an||d!==null&&d===an}function P7(l,d){ed=ng=!0;var g=l.pending;g===null?d.next=d:(d.next=g.next,g.next=d),l.pending=d}function F7(l,d,g){if((g&4194048)!==0){var S=d.lanes;S&=l.pendingLanes,g|=S,d.lanes=g,yn(l,g)}}var hp={readContext:$s,use:ig,useCallback:Fr,useContext:Fr,useEffect:Fr,useImperativeHandle:Fr,useLayoutEffect:Fr,useInsertionEffect:Fr,useMemo:Fr,useReducer:Fr,useRef:Fr,useState:Fr,useDebugValue:Fr,useDeferredValue:Fr,useTransition:Fr,useSyncExternalStore:Fr,useId:Fr,useHostTransitionStatus:Fr,useFormState:Fr,useActionState:Fr,useOptimistic:Fr,useMemoCache:Fr,useCacheRefresh:Fr};hp.useEffectEvent=Fr;var H7={readContext:$s,use:ig,useCallback:function(l,d){return li().memoizedState=[l,d===void 0?null:d],l},useContext:$s,useEffect:C7,useImperativeHandle:function(l,d,g){g=g!=null?g.concat([l]):null,og(4194308,4,j7.bind(null,d,l),g)},useLayoutEffect:function(l,d){return og(4194308,4,l,d)},useInsertionEffect:function(l,d){og(4,2,l,d)},useMemo:function(l,d){var g=li();d=d===void 0?null:d;var S=l();if(g_){Tt(!0);try{l()}finally{Tt(!1)}}return g.memoizedState=[S,d],S},useReducer:function(l,d,g){var S=li();if(g!==void 0){var R=g(d);if(g_){Tt(!0);try{g(d)}finally{Tt(!1)}}}else R=d;return S.memoizedState=S.baseState=R,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:R},S.queue=l,l=l.dispatch=vG.bind(null,an,l),[S.memoizedState,l]},useRef:function(l){var d=li();return l={current:l},d.memoizedState=l},useState:function(l){l=Sx(l);var d=l.queue,g=B7.bind(null,an,d);return d.dispatch=g,[l.memoizedState,g]},useDebugValue:Nx,useDeferredValue:function(l,d){var g=li();return zx(g,l,d)},useTransition:function(){var l=Sx(!1);return l=O7.bind(null,an,l.queue,!0,!1),li().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,d,g){var S=an,R=li();if(Tn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=d(),ar===null)throw Error(r(349));(zn&127)!==0||l7(S,d,g)}R.memoizedState=g;var O={value:g,getSnapshot:d};return R.queue=O,C7(_7.bind(null,S,O,l),[l]),S.flags|=2048,nd(9,{destroy:void 0},u7.bind(null,S,O,g,d),null),g},useId:function(){var l=li(),d=ar.identifierPrefix;if(Tn){var g=Ao,S=jo;g=(S&~(1<<32-ht(S)-1)).toString(32)+g,d="_"+d+"R_"+g,g=rg++,0<\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof S.is=="string"?X.createElement("select",{is:S.is}):X.createElement("select"),S.multiple?O.multiple=!0:S.size&&(O.size=S.size);break;default:O=typeof S.is=="string"?X.createElement(R,{is:S.is}):X.createElement(R)}}O[Fn]=d,O[sr]=S;e:for(X=d.child;X!==null;){if(X.tag===5||X.tag===6)O.appendChild(X.stateNode);else if(X.tag!==4&&X.tag!==27&&X.child!==null){X.child.return=X,X=X.child;continue}if(X===d)break e;for(;X.sibling===null;){if(X.return===null||X.return===d)break e;X=X.return}X.sibling.return=X.return,X=X.sibling}d.stateNode=O;e:switch(Ps(O,R,S),R){case"button":case"input":case"select":case"textarea":S=!!S.autoFocus;break e;case"img":S=!0;break e;default:S=!1}S&&Tc(d)}}return gr(d),Gx(d,d.type,l===null?null:l.memoizedProps,d.pendingProps,g),null;case 6:if(l&&d.stateNode!=null)l.memoizedProps!==S&&Tc(d);else{if(typeof S!="string"&&d.stateNode===null)throw Error(r(166));if(l=ue.current,Kf(d)){if(l=d.stateNode,g=d.memoizedProps,S=null,R=Is,R!==null)switch(R.tag){case 27:case 5:S=R.memoizedProps}l[Fn]=d,l=!!(l.nodeValue===g||S!==null&&S.suppressHydrationWarning===!0||o9(l.nodeValue,g)),l||Fl(d,!0)}else l=jg(l).createTextNode(S),l[Fn]=d,d.stateNode=l}return gr(d),null;case 31:if(g=d.memoizedState,l===null||l.memoizedState!==null){if(S=Kf(d),g!==null){if(l===null){if(!S)throw Error(r(318));if(l=d.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(557));l[Fn]=d}else u_(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;gr(d),l=!1}else g=tx(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),l=!0;if(!l)return d.flags&256?(Qi(d),d):(Qi(d),null);if((d.flags&128)!==0)throw Error(r(558))}return gr(d),null;case 13:if(S=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(R=Kf(d),S!==null&&S.dehydrated!==null){if(l===null){if(!R)throw Error(r(318));if(R=d.memoizedState,R=R!==null?R.dehydrated:null,!R)throw Error(r(317));R[Fn]=d}else u_(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;gr(d),R=!1}else R=tx(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=R),R=!0;if(!R)return d.flags&256?(Qi(d),d):(Qi(d),null)}return Qi(d),(d.flags&128)!==0?(d.lanes=g,d):(g=S!==null,l=l!==null&&l.memoizedState!==null,g&&(S=d.child,R=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(R=S.alternate.memoizedState.cachePool.pool),O=null,S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(O=S.memoizedState.cachePool.pool),O!==R&&(S.flags|=2048)),g!==l&&g&&(d.child.flags|=8192),hg(d,d.updateQueue),gr(d),null);case 4:return oe(),l===null&&d2(d.stateNode.containerInfo),gr(d),null;case 10:return Nc(d.type),gr(d),null;case 19:if(q(rs),S=d.memoizedState,S===null)return gr(d),null;if(R=(d.flags&128)!==0,O=S.rendering,O===null)if(R)mp(S,!1);else{if(Hr!==0||l!==null&&(l.flags&128)!==0)for(l=d.child;l!==null;){if(O=tg(l),O!==null){for(d.flags|=128,mp(S,!1),l=O.updateQueue,d.updateQueue=l,hg(d,l),d.subtreeFlags=0,l=g,g=d.child;g!==null;)BC(g,l),g=g.sibling;return K(rs,rs.current&1|2),Tn&&Cc(d,S.treeForkCount),d.child}l=l.sibling}S.tail!==null&&pt()>bg&&(d.flags|=128,R=!0,mp(S,!1),d.lanes=4194304)}else{if(!R)if(l=tg(O),l!==null){if(d.flags|=128,R=!0,l=l.updateQueue,d.updateQueue=l,hg(d,l),mp(S,!0),S.tail===null&&S.tailMode==="hidden"&&!O.alternate&&!Tn)return gr(d),null}else 2*pt()-S.renderingStartTime>bg&&g!==536870912&&(d.flags|=128,R=!0,mp(S,!1),d.lanes=4194304);S.isBackwards?(O.sibling=d.child,d.child=O):(l=S.last,l!==null?l.sibling=O:d.child=O,S.last=O)}return S.tail!==null?(l=S.tail,S.rendering=l,S.tail=l.sibling,S.renderingStartTime=pt(),l.sibling=null,g=rs.current,K(rs,R?g&1|2:g&1),Tn&&Cc(d,S.treeForkCount),l):(gr(d),null);case 22:case 23:return Qi(d),hx(),S=d.memoizedState!==null,l!==null?l.memoizedState!==null!==S&&(d.flags|=8192):S&&(d.flags|=8192),S?(g&536870912)!==0&&(d.flags&128)===0&&(gr(d),d.subtreeFlags&6&&(d.flags|=8192)):gr(d),g=d.updateQueue,g!==null&&hg(d,g.retryQueue),g=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),S=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(S=d.memoizedState.cachePool.pool),S!==g&&(d.flags|=2048),l!==null&&q(d_),null;case 24:return g=null,l!==null&&(g=l.memoizedState.cache),d.memoizedState.cache!==g&&(d.flags|=2048),Nc(cs),gr(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function kG(l,d){switch(Jy(d),d.tag){case 1:return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return Nc(cs),oe(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 26:case 27:case 5:return he(d),null;case 31:if(d.memoizedState!==null){if(Qi(d),d.alternate===null)throw Error(r(340));u_()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 13:if(Qi(d),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(r(340));u_()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return q(rs),null;case 4:return oe(),null;case 10:return Nc(d.type),null;case 22:case 23:return Qi(d),hx(),l!==null&&q(d_),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 24:return Nc(cs),null;case 25:return null;default:return null}}function f8(l,d){switch(Jy(d),d.tag){case 3:Nc(cs),oe();break;case 26:case 27:case 5:he(d);break;case 4:oe();break;case 31:d.memoizedState!==null&&Qi(d);break;case 13:Qi(d);break;case 19:q(rs);break;case 10:Nc(d.type);break;case 22:case 23:Qi(d),hx(),l!==null&&q(d_);break;case 24:Nc(cs)}}function gp(l,d){try{var g=d.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var R=S.next;g=R;do{if((g.tag&l)===l){S=void 0;var O=g.create,X=g.inst;S=O(),X.destroy=S}g=g.next}while(g!==R)}}catch(re){Zn(d,d.return,re)}}function Wl(l,d,g){try{var S=d.updateQueue,R=S!==null?S.lastEffect:null;if(R!==null){var O=R.next;S=O;do{if((S.tag&l)===l){var X=S.inst,re=X.destroy;if(re!==void 0){X.destroy=void 0,R=d;var de=g,Se=re;try{Se()}catch(Be){Zn(R,de,Be)}}}S=S.next}while(S!==O)}}catch(Be){Zn(d,d.return,Be)}}function d8(l){var d=l.updateQueue;if(d!==null){var g=l.stateNode;try{r7(d,g)}catch(S){Zn(l,l.return,S)}}}function h8(l,d,g){g.props=v_(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(S){Zn(l,d,S)}}function vp(l,d){try{var g=l.ref;if(g!==null){switch(l.tag){case 26:case 27:case 5:var S=l.stateNode;break;case 30:S=l.stateNode;break;default:S=l.stateNode}typeof g=="function"?l.refCleanup=g(S):g.current=S}}catch(R){Zn(l,d,R)}}function To(l,d){var g=l.ref,S=l.refCleanup;if(g!==null)if(typeof S=="function")try{S()}catch(R){Zn(l,d,R)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(R){Zn(l,d,R)}else g.current=null}function p8(l){var d=l.type,g=l.memoizedProps,S=l.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":g.autoFocus&&S.focus();break e;case"img":g.src?S.src=g.src:g.srcSet&&(S.srcset=g.srcSet)}}catch(R){Zn(l,l.return,R)}}function Vx(l,d,g){try{var S=l.stateNode;GG(S,l.type,g,d),S[sr]=d}catch(R){Zn(l,l.return,R)}}function m8(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&tu(l.type)||l.tag===4}function Kx(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||m8(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&tu(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Wx(l,d,g){var S=l.tag;if(S===5||S===6)l=l.stateNode,d?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(l,d):(d=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,d.appendChild(l),g=g._reactRootContainer,g!=null||d.onclick!==null||(d.onclick=Gs));else if(S!==4&&(S===27&&tu(l.type)&&(g=l.stateNode,d=null),l=l.child,l!==null))for(Wx(l,d,g),l=l.sibling;l!==null;)Wx(l,d,g),l=l.sibling}function pg(l,d,g){var S=l.tag;if(S===5||S===6)l=l.stateNode,d?g.insertBefore(l,d):g.appendChild(l);else if(S!==4&&(S===27&&tu(l.type)&&(g=l.stateNode),l=l.child,l!==null))for(pg(l,d,g),l=l.sibling;l!==null;)pg(l,d,g),l=l.sibling}function g8(l){var d=l.stateNode,g=l.memoizedProps;try{for(var S=l.type,R=d.attributes;R.length;)d.removeAttributeNode(R[0]);Ps(d,S,g),d[Fn]=l,d[sr]=g}catch(O){Zn(l,l.return,O)}}var Rc=!1,_s=!1,Qx=!1,v8=typeof WeakSet=="function"?WeakSet:Set,As=null;function SG(l,d){if(l=l.containerInfo,m2=Lg,l=Jt(l),mn(l)){if("selectionStart"in l)var g={start:l.selectionStart,end:l.selectionEnd};else e:{g=(g=l.ownerDocument)&&g.defaultView||window;var S=g.getSelection&&g.getSelection();if(S&&S.rangeCount!==0){g=S.anchorNode;var R=S.anchorOffset,O=S.focusNode;S=S.focusOffset;try{g.nodeType,O.nodeType}catch{g=null;break e}var X=0,re=-1,de=-1,Se=0,Be=0,qe=l,ze=null;t:for(;;){for(var Me;qe!==g||R!==0&&qe.nodeType!==3||(re=X+R),qe!==O||S!==0&&qe.nodeType!==3||(de=X+S),qe.nodeType===3&&(X+=qe.nodeValue.length),(Me=qe.firstChild)!==null;)ze=qe,qe=Me;for(;;){if(qe===l)break t;if(ze===g&&++Se===R&&(re=X),ze===O&&++Be===S&&(de=X),(Me=qe.nextSibling)!==null)break;qe=ze,ze=qe.parentNode}qe=Me}g=re===-1||de===-1?null:{start:re,end:de}}else g=null}g=g||{start:0,end:0}}else g=null;for(g2={focusedElem:l,selectionRange:g},Lg=!1,As=d;As!==null;)if(d=As,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,As=l;else for(;As!==null;){switch(d=As,O=d.alternate,l=d.flags,d.tag){case 0:if((l&4)!==0&&(l=d.updateQueue,l=l!==null?l.events:null,l!==null))for(g=0;g title"))),Ps(O,S,g),O[Fn]=l,er(O),S=O;break e;case"link":var X=S9("link","href",R).get(S+(g.href||""));if(X){for(var re=0;rerr&&(X=rr,rr=Vt,Vt=X);var we=Oe(re,Vt),ve=Oe(re,rr);if(we&&ve&&(Me.rangeCount!==1||Me.anchorNode!==we.node||Me.anchorOffset!==we.offset||Me.focusNode!==ve.node||Me.focusOffset!==ve.offset)){var ke=qe.createRange();ke.setStart(we.node,we.offset),Me.removeAllRanges(),Vt>rr?(Me.addRange(ke),Me.extend(ve.node,ve.offset)):(ke.setEnd(ve.node,ve.offset),Me.addRange(ke))}}}}for(qe=[],Me=re;Me=Me.parentNode;)Me.nodeType===1&&qe.push({element:Me,left:Me.scrollLeft,top:Me.scrollTop});for(typeof re.focus=="function"&&re.focus(),re=0;reg?32:g,V.T=null,g=n2,n2=null;var O=Zl,X=Ic;if(xs=0,od=Zl=null,Ic=0,(Gn&6)!==0)throw Error(r(331));var re=Gn;if(Gn|=4,j8(O.current),E8(O,O.current,X,g),Gn=re,Sp(0,!1),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(Yt,O)}catch{}return!0}finally{Z.p=R,V.T=S,K8(l,d)}}function Q8(l,d,g){d=Na(g,d),d=Dx(l.stateNode,d,2),l=Gl(l,d,2),l!==null&&(hn(l,2),Ro(l))}function Zn(l,d,g){if(l.tag===3)Q8(l,l,g);else for(;d!==null;){if(d.tag===3){Q8(d,l,g);break}else if(d.tag===1){var S=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(Yl===null||!Yl.has(S))){l=Na(g,l),g=X7(2),S=Gl(d,g,2),S!==null&&(Y7(g,S,d,l),hn(S,2),Ro(S));break}}d=d.return}}function a2(l,d,g){var S=l.pingCache;if(S===null){S=l.pingCache=new NG;var R=new Set;S.set(d,R)}else R=S.get(d),R===void 0&&(R=new Set,S.set(d,R));R.has(g)||(Zx=!0,R.add(g),l=RG.bind(null,l,d,g),d.then(l,l))}function RG(l,d,g){var S=l.pingCache;S!==null&&S.delete(d),l.pingedLanes|=l.suspendedLanes&g,l.warmLanes&=~g,ar===l&&(zn&g)===g&&(Hr===4||Hr===3&&(zn&62914560)===zn&&300>pt()-vg?(Gn&2)===0&&cd(l,0):Jx|=g,ad===zn&&(ad=0)),Ro(l)}function X8(l,d){d===0&&(d=vn()),l=zo(l,d),l!==null&&(hn(l,d),Ro(l))}function MG(l){var d=l.memoizedState,g=0;d!==null&&(g=d.retryLane),X8(l,g)}function OG(l,d){var g=0;switch(l.tag){case 31:case 13:var S=l.stateNode,R=l.memoizedState;R!==null&&(g=R.retryLane);break;case 19:S=l.stateNode;break;case 22:S=l.stateNode._retryCache;break;default:throw Error(r(314))}S!==null&&S.delete(d),X8(l,g)}function DG(l,d){return ot(l,d)}var Cg=null,ud=null,o2=!1,Eg=!1,c2=!1,eu=0;function Ro(l){l!==ud&&l.next===null&&(ud===null?Cg=ud=l:ud=ud.next=l),Eg=!0,o2||(o2=!0,IG())}function Sp(l,d){if(!c2&&Eg){c2=!0;do for(var g=!1,S=Cg;S!==null;){if(l!==0){var R=S.pendingLanes;if(R===0)var O=0;else{var X=S.suspendedLanes,re=S.pingedLanes;O=(1<<31-ht(42|l)+1)-1,O&=R&~(X&~re),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(g=!0,e9(S,O))}else O=zn,O=yr(S,S===ar?O:0,S.cancelPendingCommit!==null||S.timeoutHandle!==-1),(O&3)===0||Wr(S,O)||(g=!0,e9(S,O));S=S.next}while(g);c2=!1}}function LG(){Y8()}function Y8(){Eg=o2=!1;var l=0;eu!==0&&KG()&&(l=eu);for(var d=pt(),g=null,S=Cg;S!==null;){var R=S.next,O=Z8(S,d);O===0?(S.next=null,g===null?Cg=R:g.next=R,R===null&&(ud=g)):(g=S,(l!==0||(O&3)!==0)&&(Eg=!0)),S=R}xs!==0&&xs!==5||Sp(l),eu!==0&&(eu=0)}function Z8(l,d){for(var g=l.suspendedLanes,S=l.pingedLanes,R=l.expirationTimes,O=l.pendingLanes&-62914561;0re)break;var Be=de.transferSize,qe=de.initiatorType;Be&&c9(qe)&&(de=de.responseEnd,X+=Be*(de"u"?null:document;function y9(l,d,g){var S=_d;if(S&&typeof d=="string"&&d){var R=Rr(d);R='link[rel="'+l+'"][href="'+R+'"]',typeof g=="string"&&(R+='[crossorigin="'+g+'"]'),b9.has(R)||(b9.add(R),l={rel:l,crossOrigin:g,href:d},S.querySelector(R)===null&&(d=S.createElement("link"),Ps(d,"link",l),er(d),S.head.appendChild(d)))}}function nV(l){$c.D(l),y9("dns-prefetch",l,null)}function rV(l,d){$c.C(l,d),y9("preconnect",l,d)}function sV(l,d,g){$c.L(l,d,g);var S=_d;if(S&&l&&d){var R='link[rel="preload"][as="'+Rr(d)+'"]';d==="image"&&g&&g.imageSrcSet?(R+='[imagesrcset="'+Rr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(R+='[imagesizes="'+Rr(g.imageSizes)+'"]')):R+='[href="'+Rr(l)+'"]';var O=R;switch(d){case"style":O=fd(l);break;case"script":O=dd(l)}Ma.has(O)||(l=_({rel:"preload",href:d==="image"&&g&&g.imageSrcSet?void 0:l,as:d},g),Ma.set(O,l),S.querySelector(R)!==null||d==="style"&&S.querySelector(zp(O))||d==="script"&&S.querySelector(jp(O))||(d=S.createElement("link"),Ps(d,"link",l),er(d),S.head.appendChild(d)))}}function iV(l,d){$c.m(l,d);var g=_d;if(g&&l){var S=d&&typeof d.as=="string"?d.as:"script",R='link[rel="modulepreload"][as="'+Rr(S)+'"][href="'+Rr(l)+'"]',O=R;switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=dd(l)}if(!Ma.has(O)&&(l=_({rel:"modulepreload",href:l},d),Ma.set(O,l),g.querySelector(R)===null)){switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(jp(O)))return}S=g.createElement("link"),Ps(S,"link",l),er(S),g.head.appendChild(S)}}}function aV(l,d,g){$c.S(l,d,g);var S=_d;if(S&&l){var R=wr(S).hoistableStyles,O=fd(l);d=d||"default";var X=R.get(O);if(!X){var re={loading:0,preload:null};if(X=S.querySelector(zp(O)))re.loading=5;else{l=_({rel:"stylesheet",href:l,"data-precedence":d},g),(g=Ma.get(O))&&S2(l,g);var de=X=S.createElement("link");er(de),Ps(de,"link",l),de._p=new Promise(function(Se,Be){de.onload=Se,de.onerror=Be}),de.addEventListener("load",function(){re.loading|=1}),de.addEventListener("error",function(){re.loading|=2}),re.loading|=4,Tg(X,d,S)}X={type:"stylesheet",instance:X,count:1,state:re},R.set(O,X)}}}function oV(l,d){$c.X(l,d);var g=_d;if(g&&l){var S=wr(g).hoistableScripts,R=dd(l),O=S.get(R);O||(O=g.querySelector(jp(R)),O||(l=_({src:l,async:!0},d),(d=Ma.get(R))&&C2(l,d),O=g.createElement("script"),er(O),Ps(O,"link",l),g.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},S.set(R,O))}}function cV(l,d){$c.M(l,d);var g=_d;if(g&&l){var S=wr(g).hoistableScripts,R=dd(l),O=S.get(R);O||(O=g.querySelector(jp(R)),O||(l=_({src:l,async:!0,type:"module"},d),(d=Ma.get(R))&&C2(l,d),O=g.createElement("script"),er(O),Ps(O,"link",l),g.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},S.set(R,O))}}function x9(l,d,g,S){var R=(R=ue.current)?Ag(R):null;if(!R)throw Error(r(446));switch(l){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(d=fd(g.href),g=wr(R).hoistableStyles,S=g.get(d),S||(S={type:"style",instance:null,count:0,state:null},g.set(d,S)),S):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){l=fd(g.href);var O=wr(R).hoistableStyles,X=O.get(l);if(X||(R=R.ownerDocument||R,X={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(l,X),(O=R.querySelector(zp(l)))&&!O._p&&(X.instance=O,X.state.loading=5),Ma.has(l)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},Ma.set(l,g),O||lV(R,l,g,X.state))),d&&S===null)throw Error(r(528,""));return X}if(d&&S!==null)throw Error(r(529,""));return null;case"script":return d=g.async,g=g.src,typeof g=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=dd(g),g=wr(R).hoistableScripts,S=g.get(d),S||(S={type:"script",instance:null,count:0,state:null},g.set(d,S)),S):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,l))}}function fd(l){return'href="'+Rr(l)+'"'}function zp(l){return'link[rel="stylesheet"]['+l+"]"}function w9(l){return _({},l,{"data-precedence":l.precedence,precedence:null})}function lV(l,d,g,S){l.querySelector('link[rel="preload"][as="style"]['+d+"]")?S.loading=1:(d=l.createElement("link"),S.preload=d,d.addEventListener("load",function(){return S.loading|=1}),d.addEventListener("error",function(){return S.loading|=2}),Ps(d,"link",g),er(d),l.head.appendChild(d))}function dd(l){return'[src="'+Rr(l)+'"]'}function jp(l){return"script[async]"+l}function k9(l,d,g){if(d.count++,d.instance===null)switch(d.type){case"style":var S=l.querySelector('style[data-href~="'+Rr(g.href)+'"]');if(S)return d.instance=S,er(S),S;var R=_({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return S=(l.ownerDocument||l).createElement("style"),er(S),Ps(S,"style",R),Tg(S,g.precedence,l),d.instance=S;case"stylesheet":R=fd(g.href);var O=l.querySelector(zp(R));if(O)return d.state.loading|=4,d.instance=O,er(O),O;S=w9(g),(R=Ma.get(R))&&S2(S,R),O=(l.ownerDocument||l).createElement("link"),er(O);var X=O;return X._p=new Promise(function(re,de){X.onload=re,X.onerror=de}),Ps(O,"link",S),d.state.loading|=4,Tg(O,g.precedence,l),d.instance=O;case"script":return O=dd(g.src),(R=l.querySelector(jp(O)))?(d.instance=R,er(R),R):(S=g,(R=Ma.get(O))&&(S=_({},g),C2(S,R)),l=l.ownerDocument||l,R=l.createElement("script"),er(R),Ps(R,"link",S),l.head.appendChild(R),d.instance=R);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(S=d.instance,d.state.loading|=4,Tg(S,g.precedence,l));return d.instance}function Tg(l,d,g){for(var S=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),R=S.length?S[S.length-1]:null,O=R,X=0;X title"):null)}function uV(l,d,g){if(g===1||d.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;switch(d.rel){case"stylesheet":return l=d.disabled,typeof d.precedence=="string"&&l==null;default:return!0}case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function E9(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function _V(l,d,g,S){if(g.type==="stylesheet"&&(typeof S.media!="string"||matchMedia(S.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var R=fd(S.href),O=d.querySelector(zp(R));if(O){d=O._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(l.count++,l=Mg.bind(l),d.then(l,l)),g.state.loading|=4,g.instance=O,er(O);return}O=d.ownerDocument||d,S=w9(S),(R=Ma.get(R))&&S2(S,R),O=O.createElement("link"),er(O);var X=O;X._p=new Promise(function(re,de){X.onload=re,X.onerror=de}),Ps(O,"link",S),g.instance=O}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(g,d),(d=g.state.preload)&&(g.state.loading&3)===0&&(l.count++,g=Mg.bind(l),d.addEventListener("load",g),d.addEventListener("error",g))}}var E2=0;function fV(l,d){return l.stylesheets&&l.count===0&&Dg(l,l.stylesheets),0E2?50:800)+d);return l.unsuspend=g,function(){l.unsuspend=null,clearTimeout(S),clearTimeout(R)}}:null}function Mg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dg(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Og=null;function Dg(l,d){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Og=new Map,d.forEach(dV,l),Og=null,Mg.call(l))}function dV(l,d){if(!(d.state.loading&4)){var g=Og.get(l);if(g)var S=g.get(null);else{g=new Map,Og.set(l,g);for(var R=l.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),L2.exports=_K(),L2.exports}var dK=fK();const hK=!1;var RO=T.useLayoutEffect;function pK(e,n,t){T.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function mK(e){const n=T.useRef(null);return T.useImperativeHandle(e,()=>n.current,[]),n}function k0(e){return e[e.length-1]}function hh(e,n){return typeof e=="function"?e(n):e}const MO=Object.prototype.hasOwnProperty,gK=Object.prototype.propertyIsEnumerable;function OO(e){for(const n in e)if(MO.call(e,n))return!0;return!1}const vK=()=>Object.create(null),x_=(e,n)=>O_(e,n,vK);function O_(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=_E(e)&&_E(s);if(!i&&!(hv(e)&&hv(s)))return s;const a=i?e:lE(e);if(!a)return s;const o=i?s:lE(s);if(!o)return s;const c=a.length,u=o.length,h=i?new Array(u):t();let _=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!uE(t)||!t.hasOwnProperty("isPrototypeOf"))}function uE(e){return Object.prototype.toString.call(e)==="[object Object]"}function _E(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Au(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!Au(e[a],n[a],t)))return!1;return s===i}return!1}const bK=/[\x00-\x1f\x7f"<>`{}]/g;function yK(e){return e.replace(bK,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function fE(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return yK(n)}const xK=["http:","https:","mailto:","tel:"];function pv(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function Ip(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=fE(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+fE(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function wK(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function kK(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const c=t;n.delete(c.key),c.next&&(t=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const c={key:i,value:a,prev:r};r&&(r.next=c),r=c,t||(t=c),n.set(i,c)}},clear(){n.clear(),t=void 0,r=void 0}}}const Nu=4,DO=5;function LO(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const c=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=c,t[4]=c,t[5]=c,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!I.parse&&I.caseSensitive===j&&I.prefix===z&&I.suffix===A));if(D)x=D;else{const I=SK(N,_,j,z,A);x=I,I.parent=s,I.depth=i;let B;N===1?B=s.dynamic??(s.dynamic=[]):N===3?B=s.optional??(s.optional=[]):B=s.wildcard??(s.wildcard=[]),B.push(I),B.length===2&&(a==null||a.push(B))}break}}s=x}if(k&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=Ld(_);b.kind=DO,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&_.endsWith("/")){const b=Ld(_);b.kind=Nu,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=k??null,s.priority=((h=p==null?void 0:p.params)==null?void 0:h.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=_)}if(t.children)for(const _ of t.children)wb(e,n,_,c,s,i,a,o)}function IO(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function Ld(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function SK(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function CK(e,n){const t=Ld("/"),r=new Uint16Array(6),s=[];for(const i of e)wb(!1,r,i,1,t,0,s);for(const i of s)i.sort(IO);n.masksTree=t,n.flatCache=mv(1e3)}function EK(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=Rk(e,n.masksTree);return n.flatCache.set(e,r),r}function NK(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=Ld("/"),wb(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),Rk(r,a,t)}function zK(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=Rk(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=BO(i.route)),n.matchCache.set(r,i),i}function jK(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function AK(e,n=!1,t){const r=Ld(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let c=0;wb(n,s,e,1,r,0,i,u=>{if(t==null||t(u,c),u.id in a&&Tk(),a[u.id]=u,c!==0&&u.path){const h=jK(u.fullPath);(!o[h]||u.fullPath.endsWith("/"))&&(o[h]=u)}c++});for(const u of i)u.sort(IO);return{processedTree:{segmentTree:r,singleCache:mv(1e3),matchCache:mv(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Rk(e,n,t=!1){const r=e.split("/"),s=RK(e,r,n,t);if(!s)return null;const[i]=$O(e,r,s);return{route:s.node.route,rawParams:i}}function $O(e,n,t){var h,_,p,m;const r=TK(t.node);let s=null;const i=Object.create(null);let a=((h=t.extract)==null?void 0:h.part)??0,o=((_=t.extract)==null?void 0:_.node)??0,c=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;z--){const A=_.wildcard[z],{prefix:j,suffix:M}=A;if(!(j&&(y||!(A.caseSensitive?C:N??(N=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const D=n.slice(p).join("/"),I=D.slice(-M.length);if((A.caseSensitive?I:I.toLowerCase())!==M||D.length-M.length=0;A--){const j=_.optional[A];o.push({node:j,index:p,skipped:z,statics:w,dynamics:k,optionals:v,extract:b,rawParams:x})}if(!y)for(let A=_.optional.length-1;A>=0;A--){const j=_.optional[A],{prefix:M,suffix:D}=j;if(M||D){const I=j.caseSensitive?C:N??(N=C.toLowerCase());if(M&&!I.startsWith(M)||D&&I.indexOf(D,I.length-D.length)=0;z--){const A=_.dynamic[z],{prefix:j,suffix:M}=A;if(j||M){const D=A.caseSensitive?C:N??(N=C.toLowerCase());if(j&&!D.startsWith(j)||M&&D.indexOf(M,D.length-M.length)=0;z--){const A=_.pathless[z];o.push({node:A,index:p,skipped:m,statics:w,dynamics:k,optionals:v,extract:b,rawParams:x})}}if(u)return u;if(r&&c){let h=c.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===Nu)>(e.node.kind===Nu)||n.node.kind===Nu==(e.node.kind===Nu)&&n.node.depth>e.node.depth))):!0}function P1(e){return F1(e.filter(n=>n!==void 0).join("/"))}function F1(e){return e.replace(/\/{2,}/g,"/")}function PO(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function el(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function FO(e){return el(PO(e))}function gv(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function OK(e,n,t){return gv(e,t)===gv(n,t)}function DK({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=F1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=F1(e)),a=e.split("/");a.length>1&&k0(a)==="";)a.pop();const u=n.split("/");for(let h=0,_=u.length;h<_;h++){const p=u[h];p===""?h?h===_-1&&a.push(p):a=[p]:p===".."?a.length>1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(k0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),c=(s?F1(o):o)||"/";return i&&r&&r.set(i,c),c}function LK(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function P2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>pE(s,t)).join("/"):pE(r,t)}function hE({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,c,u="";for(;oe.state.__TSR_key||e.href;function qK(e){const n=e.getAttribute(mE);if(n)return`[${mE}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let Vg=!1;const H1="window";function J4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function gE(e){const n=new Set;for(const t of e){if(t===H1)continue;const r=J4(t);r&&n.add(r)}return n}function UK(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||HK,i=new Set,a=o=>{const c=hu[o]||(hu[o]={});for(const u of i)u===document?c[H1]={scrollX,scrollY}:u.isConnected&&(c[qK(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,Vg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{Vg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),FK()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var k;const c=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,h=r.next,_=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),w=o.fromLocation&&s(o.fromLocation);if(r.restoring&&w&&w!==m){const v=hu[w];if(v){let b=hu[m];for(const x in v){if(x===H1){if(h)continue}else{const y=J4(x);if(!y||h&&u&&(p??(p=gE(u)),p.has(y)))continue}b||(b=hu[m]={}),b[x]??(b[x]=v[x])}}}Vg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let x=!1;if(h){!v&&u&&(p??(p=gE(u)));const y=v&&b&&_,C=r.restoring?hu[m]:void 0;if(C)for(const N in C){const{scrollX:z,scrollY:A}=C[N];if(N===H1){if(y)continue;scrollTo({top:A,left:z,behavior:c}),x=!0}else{const j=J4(N);j&&(j.scrollLeft=z,j.scrollTop=A,p==null||p.delete(j))}}if(!v){const N={top:0,left:0,behavior:c};if(x||scrollTo(N),p)for(const z of p)z.scrollTo(N)}}!x&&v&&b&&((k=document.getElementById(v))==null||k.scrollIntoView(b))}finally{Vg=!1}}))}function GK(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function F2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function VK(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=F2(s):Array.isArray(i)?i.push(F2(s)):t[r]=[i,F2(s)]}return t}const KK=/^(?:\s|["[{\d-]|fa|nu|tr)/,WK=XK(JSON.parse),QK=YK(JSON.stringify,JSON.parse);function XK(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=VK(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function YK(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!KK.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=GK(s,r);return i?`?${i}`:""}}const $d="__root__";function ZK(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function HO(e){return e instanceof Response&&!!e.options}function JK(e){return{input:({url:n})=>{for(const t of e)n=e3(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=qO(e[t],n);return n}}}function eW(e){const n=FO(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=P1(["/",n,i.pathname]),i)}}function e3(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function qO(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function tW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),c=t(void 0),u=t([]),h=r(()=>u.get().map(k=>i.get(k).get())),_=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:h.get(),location:o.get(),resolvedLocation:c.get()}));function p(k){let v=i.get(k);return v||(v=t(void 0),i.set(k,v)),v}const m={status:a,location:o,resolvedLocation:c,ids:u,matches:h,byRoute:i,__store:_,getMatchStore:p,setMatches:w};function w(k){const v=u.get(),b=k.map(x=>x.routeId);s(()=>{kK(v,b)||u.set(b);for(const x of v)b.includes(x)||i.get(x).set(()=>{});for(const x of k){const y=p(x.routeId);y.get()!==x&&y.set(x)}})}return m}var Tu="__TSR_index",vE="popstate",bE="beforeunload";function nW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...c})=>{var _,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((_=e.getBlockers)==null?void 0:_.call(e))??[],h=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&u.length&&h)for(const m of u){const w=vv(c.path,c.state);if(await m.blockerFn({currentLocation:n,nextLocation:w,action:c.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,c)=>{const u=n.state[Tu];o=yE(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:a,state:o})},replace:(a,o,c)=>{const u=n.state[Tu];o=yE(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[Tu]!==0,createHref:a=>e.createHref(a),block:a=>{var c;if(!e.setBlockers)return()=>{};const o=((c=e.getBlockers)==null?void 0:c.call(e))??[];return e.setBlockers([...o,a]),()=>{var h,_;const u=((h=e.getBlockers)==null?void 0:h.call(e))??[];(_=e.setBlockers)==null||_.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function yE(e,n){n||(n={});const t=Mk();return{...n,key:t,__TSR_key:t,[Tu]:e}}function rW(e){var A,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),c=(()=>vv(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((A=n.history.state)!=null&&A.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=Mk();n.history.replaceState({[Tu]:0,key:M,__TSR_key:M},"")}let u=c(),h,_=!1,p=!1,m=!1,w=!1;const k=()=>u;let v;const b=()=>{v&&(z._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),z._ignoreSubscribers=!1,v=void 0,h=void 0)},x=(M,D,I)=>{const B=o(D),U=!!v;U||(h=u),u=vv(D,I),v=[B,I,(v==null?void 0:v[2])||M],U||queueMicrotask(()=>b())},y=M=>{u=c(),z.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=c(),D=M.state[Tu]-u.state[Tu],I=D===1,B=D===-1,U=!I&&!B||_;_=!1;const H=U?"GO":B?"BACK":"FORWARD",Q=U?{type:"GO",index:D}:{type:B?"BACK":"FORWARD"};if(m)m=!1;else{const V=i();if(typeof document<"u"&&V.length){for(const Z of V)if(await Z.blockerFn({currentLocation:u,nextLocation:M,action:H})){p=!0,n.history.go(1),z.notify(Q);return}}}u=c(),z.notify(Q)},N=M=>{if(w){w=!1;return}let D=!1;const I=i();if(typeof document<"u"&&I.length)for(const B of I){const U=B.enableBeforeUnload??!0;if(U===!0){D=!0;break}if(typeof U=="function"&&U()===!0){D=!0;break}}if(D)return M.preventDefault(),M.returnValue=""},z=nW({getLocation:k,getLength:()=>n.history.length,pushState:(M,D)=>x(!0,M,D),replaceState:(M,D)=>x(!1,M,D),back:M=>(M&&(m=!0),w=!0,n.history.back()),forward:M=>{M&&(m=!0),w=!0,n.history.forward()},go:M=>{_=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(bE,N,{capture:!0}),n.removeEventListener(vE,C)},onBlocked:()=>{h&&u!==h&&(u=h)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(bE,N,{capture:!0}),n.addEventListener(vE,C),n.history.pushState=function(...M){const D=t.apply(n.history,M);return z._ignoreSubscribers||y("PUSH"),D},n.history.replaceState=function(...M){const D=r.apply(n.history,M);return z._ignoreSubscribers||y("REPLACE"),D},z}function sW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function vv(e,n){const t=sW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=Mk();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[Tu]:0,key:i,__TSR_key:i}}}function Mk(){return(Math.random()+1).toString(36).substring(7)}function xE(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function kb(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function wE({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function iW(e,n,t,r){var s,i,a,o;for(const c of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===c.routeId)||(i=(s=e.routesById[c.routeId].options).onLeave)==null||i.call(s,c)}for(const c of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[c.routeId].options)[n.some(u=>u.routeId===c.routeId)?"onStay":"onEnter"])==null||o.call(a,c)}}var aW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??hK??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=LK(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=rW()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=mv(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=tW(this.latestLocation,u),UK(this)}const o=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==o||a!==c){this.basepath=o;const u=[],h=FO(o);h&&h!=="/"&&u.push(eW({basepath:o})),c&&u.push(c),this.rewrite=u.length===0?void 0:u.length===1?u[0]:JK(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=AK(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&CK(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:c,search:u,hash:h,href:_,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const b=this.options.parseSearch(u),x=this.options.stringifySearch(b);return{href:c+x+h,publicHref:c+x+h,pathname:Ip(c).path,external:!1,searchStr:x,search:x_(r==null?void 0:r.search,b),hash:Ip(h.slice(1)).path,state:O_(r==null?void 0:r.state,p)}}const m=new URL(_,this.origin),w=e3(this.rewrite,m),k=this.options.parseSearch(w.search),v=this.options.stringifySearch(k);return w.search=v,{href:w.href.replace(w.origin,""),publicHref:_,pathname:Ip(w.pathname).path,external:!!this.rewrite&&w.origin!==this.origin,searchStr:v,search:x_(r==null?void 0:r.search,k),hash:Ip(w.hash.slice(1)).path,state:O_(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const c=s(a);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>DK({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=zK(el(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,D;if(i.href){const I=vv(i.href,{});i={...i,to:e3(this.rewrite,new URL(I.pathname,this.origin)).pathname,search:this.options.parseSearch(I.search),hash:I.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const c=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],h=o[3],_=this.resolvePathWithBase(c,i.to?`${i.to}`:".");let p=kE(i.params,h);const m=this.routesByPath[el(_)];let w;if(m)w=this.getRouteBranch(m);else if(_.includes("$"))w=[];else{const[I,B,U]=this.getMatchedRoutes(_);w=I,this.options.notFoundRoute&&(!U||U.path!=="/"&&B["**"])&&(w=[...w,this.options.notFoundRoute])}if(w.length&&OO(p))for(const I of w){const B=((M=I.options.params)==null?void 0:M.stringify)??I.options.stringifyParams;if(B){p===h&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,B(p))}catch{}}}const k=t.leaveParams?_:Ip(hE({path:_,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((D=this.options.search)!=null&&D.strict)){const I={};w.forEach(B=>{if(B.options.validateSearch)try{Object.assign(I,q1(B.options.validateSearch,{...I,...v}))}catch{}}),v=I}v=cW(v,i,w,t._includeValidateSearch),v=x_(u,v);const b=this.options.stringifySearch(v),x=i.hash===!0?a.hash:i.hash?hh(i.hash,a.hash):void 0,y=x?`#${x}`:"";let C=i.state===!0?a.state:i.state?hh(i.state,a.state):{};i.state&&(C=O_(a.state,C));const N=`${k}${b}${y}`;let z,A,j=!1;if(this.rewrite){const I=new URL(N,this.origin),B=qO(this.rewrite,I);z=I.href.replace(I.origin,""),B.origin!==this.origin?(A=B.href,j=!0):A=B.pathname+B.search+B.hash}else z=wK(N),A=z;return{publicHref:A,href:z,pathname:k,search:v,searchStr:b,state:C,hash:x??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=EK(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:c,...u}=i.route,h=kE(c,a);s.maskedLocation=r({from:t.from,...u,params:h})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=el(this.latestLocation.href)===el(s.href)&&Au(wE(s.state),wE(this.latestLocation.state)),o=this._commitPromise;let c;const u=new Promise(h=>{c=h});if(u.resolve=()=>{c(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:h,hashScrollIntoView:_,...p}=s;h&&(p={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=_??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const c=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=c;const u=this.commitLocation({...c,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===c&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var c,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const _=this.buildLocation({to:t,...a});s=s??_.publicHref,i=i??_.publicHref}const h=!o&&i?i:s;if(pv(h,this.protocolAllowlist))return;if(!a.ignoreBlocker){const _=((u=(c=this.history).getBlockers)==null?void 0:u.call(c))??[];for(const p of _)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(h):window.location.href=h;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await gW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,c=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(kb(o,c)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,h;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(_=>!s||s(_)).map(_=>_.id)),o=[];for(const[_,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(_),o.push(_));const c=_=>{if(a.has(_.id)){const p=this.routesById[_.routeId],m={..._,invalid:!0,...(t!=null&&t.forcePending||_.status==="error"||_.status==="notFound")&&xE(p)?{status:"pending",error:void 0}:void 0};return _._flight=void 0,m}return _};this._committed=r.map(c);for(const[_,p]of this._cache)a.has(_)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const _ of a)(h=this._flights)==null||h.delete(_);for(const _ of o)_.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&pv(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[h,_]of r)(!i||i(_))&&(o.push(h),a.push(_));const c=[];for(const[h,_]of s??[])(!i||_.some(i))&&(c.push(h),a.push(..._));for(const h of o)r.delete(h);for(const h of c)s.delete(h);for(const h of a){const _=h._flight;h._flight=void 0,_&&!--_[2]&&(((u=this._flights)==null?void 0:u.get(h.id))===_&&this._flights.delete(h.id),c.push(_[1]))}for(const h of c)h.abort()},this.loadRouteChunk=Bd,this.preloadRoute=t=>vW(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=NK(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!c||t.params&&!Au(c.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?Au(o.search,i.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??QK,parseSearch:e.parseSearch??WK,protocolAllowlist:e.protocolAllowlist??xK}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=BO(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:el(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?lW(this.options.notFoundMode,i):void 0,c=new Array(i.length),u=this._committed,h=(w,k)=>{const v=u[k];return(v==null?void 0:v.routeId)===w.id?v:w===this.options.notFoundRoute?u.find(b=>b.routeId===w.id):void 0};let _;for(let w=0;w{const m=p(c.preSearchFilters?c.preSearchFilters.reduce((w,k)=>k(w),_):_);return c.postSearchFilters?c.postSearchFilters.reduce((w,k)=>k(w),m):m};s.push(h)}const u=c.validateSearch;if(r&&u){const h=({search:_,next:p,meta:m})=>{const w=p(_);try{const k=q1(u,w);if(m&&k)for(const v in k)v in w||(m.defaulted||(m.defaulted=new Map)).set(v,k[v]);return{...w,...k}}catch{}return w};s.push(h)}}const i=(o,c,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return c;const _=hh(n.search,c);return u&&(u.explicit=_),_}const h=(_,p)=>{if(p){const m=u||{};return{search:i(o+1,_,m),meta:m}}return i(o+1,_,u)};return s[o]({search:c,next:h,meta:u})};return i(0,e)}function lW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return $d}function kE(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,hh(e,t))}function SE(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function t3(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function uW(e,n){const t=t3(e,"component");let r=t3(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function Bd(e,n,t){const r=()=>n===!1?void 0:n?t3(e,n):uW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...c}=a.options;Object.assign(e.options,c),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function Ok(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Cf(e,n){return e.routesById[n.routeId]}function C0(e,n,t){return HO(e)?[sa,e]:ph(e)?(e.routeId||(e.routeId=t),[Sb,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[al,e]):[Wo,e]}function Dk(e,n){var r,s;let t=C0(n,!0,e.id);if(t[0]!==al)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=C0(i,!0,e.id)}return t}function l0(e,n,t,r,s){return s[0].signal.aborted?Ou:$k(e,n,t,Dk(t,r),s)}async function _W(e,n,t,r,s,i){var h,_;const[a,o]=n,c=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:w.id};try{const C=m._ctx||(m._ctx=w.options.context?w.options.context({...v,deps:m.loaderDeps,context:k})||{}:void 0);m.context={...k,...C}}catch(C){return tl(e,m),[p,l0(e,n,w,C,t)]}if(c.aborted)return[p,Ou];const b=m.paramsError??m.searchError;if(b!==void 0)return tl(e,m),[p,l0(e,n,w,b,t)];const x=w.options.beforeLoad;if(!x)continue;const y=m.status;p>=i&&(m.status="pending",(_=t[7])==null||_.call(t));try{E0(e,m,"beforeLoad",t[0]);const C=await Sf(x({...v,search:m.search,context:m.context,...e.options.additionalContext}),c);if(c.aborted)return[p,Ou];const N=$k(e,n,w,C0(C,!1,w.id),t);if(N[0]!==Wo)return tl(e,m),[p,N];m.context={...m.context,...C}}catch(C){return tl(e,m),[p,l0(e,n,w,C,t)]}finally{m.status=y,E0(e,m,!1,t[0])}}s()}function Lk(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function tl(e,n){var r;const t=n._flight;n._flight=void 0,(r=Lk(e,n,t))==null||r.abort()}function Ii(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(c=>c.id===a.id)))o[2]=0;else{const c=Lk(e,a,o);c&&s.push(c)}}for(const a of s)a.abort()}function Ik(e){for(const n of e){const t=n._flight;t&&t[2]++}}function E0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function UO(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:c=>e.navigate({...c,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function CE(e,n,t,r,s,i,a){const o=a[0],c=o.signal;if(c.aborted)return Ou;if(!s)return[Wo,void 0];let u=t._flight;E0(e,t,"loader",o);try{if(!u){const h=new AbortController;u=[Promise.resolve().then(()=>s(UO(e,n,t,r,h,i,!!a[3]))).then(_=>C0(_,!1,r.id),_=>C0(_,!0,r.id)).then(_=>{var p;return _[0]!==Wo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||h.abort()),_[0]===al&&u[2]?Dk(r,_[1]):_}),h,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],$k(e,n,r,await Sf(u[0],c),a)}catch(h){if(h!==c||!c.aborted)throw h;return tl(e,t),Ou}finally{E0(e,t,!1,o)}}function EE(e,n,t){n[0]!==sa&&(e.status="success",e.error=void 0,n[0]===Wo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function fW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&tl(e,r)}function NE(e,n){return n[0]===al||n[0]===Sb?{...e,status:n[0]===al?"error":"notFound",error:n[1],_flight:void 0}:e}function dW(e,n,t,r,s,i,a){var B,U;const o=n[1][t],c=Cf(e,o),u=!!i[3],h=e._cache.get(o.id);let _,p=!1,m;try{if(o.status==="success"&&(_=c.options.shouldReload,typeof _=="function"&&(_=_(UO(e,n,o,c,i[0],s,u))),i[0].signal.aborted&&(m=Ou)),!m)if(o.status!=="success")p=!0;else{const H=u||o.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||_||_===void 0&&Date.now()-o.updatedAt>=H&&(i[5]||o.cause==="enter"||i[2].some(Q=>Q.routeId===o.routeId&&Q.id!==o.id)))}}catch(H){o.invalid=!0,tl(e,o),m=l0(e,n,c,H,i)}const w=c.options.loader,k=typeof w=="function",v=k?w:w==null?void 0:w.handler,b=!u||c.options.preload!==!1;let x=b&&w?(B=e._flights)==null?void 0:B.get(o.id):void 0;x===o._flight||m?x=void 0:x&&!p&&!u&&_===void 0?p=!0:p||(x=void 0);const y=!!(w&&p&&o.status==="success"&&!u&&!i[4]&&((k?void 0:w.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,N=C&&!y&&(o.status!=="success"||!!w),z=t>=a?i[7]:void 0,A=c.lazyFn&&c._lazy!==!0?z:void 0;if(C&&!w&&(o.invalid=!1,o.updatedAt=Date.now()),x&&x[2]++,N){const H=o._flight;o._flight=x,(U=Lk(e,o,H))==null||U.abort(),t>=a&&(o.status="pending"),z==null||z()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):N?CE(e,n,o,c,v,s,i):Promise.resolve([Wo,o.loaderData])).then(H=>(N&&(EE(o,H,u),H[0]===Wo&&(w&&!i[0].signal.aborted&&fW(e,o,h),t>=a&&(o.status="pending"))),H)),M=Sf(Promise.resolve().then(()=>Bd(c,void 0,A)),i[0].signal).then(()=>{},H=>n[1].some((Q,V)=>V<=t&&(Q.status==="error"||Q.status==="notFound"||Q._notFound))?void 0:[t,l0(e,n,c,H,i)]).then(H=>j.then(Q=>(N&&!H&&Q[0]===Wo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",z==null||z()),H)));if(r.push([t,j,M]),!y)return j.then(H=>NE(o,H));const D={...o,status:"pending",preload:!1,_flight:x};o.invalid=!1,o.isFetching="loader";const I=CE(e,n,D,c,v,s,i).then(H=>(o.isFetching=!1,EE(D,H,!1),H));return(n[2]??(n[2]=[])).push([t,I,M,D]),I.then(H=>NE(D,H))}async function n3(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const c=Cf(e,n[o]);try{const u=Bd(c,!1);u&&await Sf(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(c.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function Y_(e,n){n[2]&&(Ii(e,n[2].map(t=>t[3])),n[2]=void 0)}async function zE(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=sa)throw[o,a];!s&&a[0]!==Wo&&(s=[o,a],await Promise.all((t??[]).map(c=>{if(!(c[0]<=o))return c[1].then(u=>{if(u[0]===sa)throw[c[0],u]})})))}})))}catch(i){return i}return n??s}function $k(e,n,t,r,s,i){for(;r[0]===sa;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[sa,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(c){r=i?[al,c]:Dk(t,c),i=!0}}return r}async function GO(e,n,t,r,s,i){const a=n[1];let o=await s,c=!1;const u=a.findIndex(m=>m._notFound),h=m=>m[1][0]===Sb?n3(e,a,m,r.signal):m[0];let _=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=sa)_=0;else if(o){_=o[2]??(o[2]=await h(o));for(const m of t){if(m[0]>=_)break;const w=await m[1];if(w[0]!==Wo&&w[0]=_)break;const w=await m[2];if(w){o=w;break}}if(((o==null?void 0:o[1][0])??0)>=sa){const m=o[1];if(m[0]!==sa||m[1].options.reloadDocument||m[2])return Y_(e,n),m;c=!0,o=[0,[al,new Error("Too many redirects")]]}const p=o?o[2]??await h(o):u;if(p>=0){const m=o==null?void 0:o[1],w=m==null?void 0:m[0],k=a[p],v=m==null?void 0:m[1],b=()=>{m&&(k._notFound=void 0,w===al?k.status="error":(v.routeId=k.routeId,k.routeId===e.routeTree.id?(k.status="success",k._notFound=!0):k.status="notFound"),k.error=v,k.isFetching=!1)};b(),m||i==null||i();const x=Cf(e,k);try{await Sf(m?Promise.resolve().then(()=>Bd(x,w===al?"errorComponent":"notFoundComponent")):Promise.all([Bd(x),Bd(x,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return Y_(e,n),Ou}m?c&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),Y_(e,n),Ii(e,a),b()):k.status="success"}return n}async function VO(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let c=r;cx._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const x=await n3(e,t,void 0,i,u);t[u]._notFound=void 0,t[x]._notFound=!0,u=x}let h=u<0?t.length:u+1,_=0;for(;_{for(let x=m;x=sa&&(h=0);k()}if(!i.aborted&&!r[3]){const x=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),x.push(C[1]));for(const y of x)y.abort()}const b=GO(e,s,p,r[0],zE(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=zE(s[2],void 0,void 0,b.then(x=>S0(x)?0:Ok(t).length,()=>0))),a=await b}catch(c){if(Y_(e,s),c===i&&i.aborted)return Ou;throw c}return S0(a)?a:VO(e,a,i,r[6]===t.length?r[6]:0)}function r3(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>r3(e,n),x);return}s[2]=0}const v=t.map(x=>({...x,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(x=>(x&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+w),x));return}}function $p(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function jE(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!Ok(n[3]).some(i=>i.id===t[1]))return;let s;try{await Sf(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function WO(e,n){e._committed=n,e.stores.setMatches(n)}function hW(e,n,t,r){const s=e._committed,i=e._cache;for(const c of t)c.preload=!1,r&&(c._assetEnd=void 0);const a=Ok(t).length,o=new Map;{const c=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((_,p)=>_.id===u.id&&(p=(u.preload?h.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:h.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,WO(e,t),Ii(e,[...i.values(),...s],[...t,...o.values()]),iW(e,s,t,n)}async function Kg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function QO(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function pW(e,n,t,r,s){const i=t.map(c=>({...c}));Ik(i);for(const c of r)tl(e,i[c[0]]),i[c[0]]=c[3];const a=[n[2],i];let o;try{o=await GO(e,a,r,n[0],s)}catch(c){throw Ii(e,i),c}if(S0(o)){Ii(e,i),o[0]===sa&&e._tx===n&&e._committed===t&&await QO(e,n,o);return}if(await VO(e,o,n[0].signal),e._tx!==n||e._committed!==t){Ii(e,i);return}for(const c of i){const u=e._cache.get(c.id);u!=null&&u._flight&&u._flight===c._flight&&(e._cache.delete(c.id),tl(e,u))}WO(e,i),Ii(e,t,i)}async function mW(e,n,t,r,s,i){const a=await KO(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(S0(a)){const _=a[0]===sa&&e._tx===n;if((!_||a[1].options.reloadDocument)&&$p(e,n),Ii(e,n[3]),n[3]=[],!_)return;if(e._tx!==n){$p(e,n);return}await QO(e,n,a);return}const o=a[1];if(e._tx===n&&await jE(e,n),e._tx!==n){$p(e,n),Ii(e,o),Y_(e,a);return}const c=n[2],u=kb(c,e.stores.resolvedLocation.get()),h=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await jE(e,n),e._tx!==n){$p(e,n),Ii(e,o),Y_(e,a);return}const _=()=>{$p(e,n),hW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(_,o);if(e._tx!==n){Y_(e,a);return}h!=null&&h.length&&pW(e,n,o,h,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function gW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,c=e._handoff,u=c==null?void 0:c[0](),h=new AbortController,_=e._preflight;if(e._preflight=h,u||c==null||c[1](),_==null||_.abort(),!h.signal.aborted){const N=kb(i,r);e.emit({type:"onBeforeNavigate",...N}),h.signal.aborted||e.emit({type:"onBeforeLoad",...N})}if(h.signal.aborted){await Kg(e,t);return}const p=s.href===i.href;let m=h;const w=e.matchRoutes(i,{_controller:h});Ik(w);const k=u?c[1](w):void 0;if(k?m=u:u==null||u.abort(),h.signal.aborted){Ii(e,w),await Kg(e,t);return}e._preflight=void 0;let v;const b=()=>mW(e,y,p,()=>r3(e,y),n==null?void 0:n.sync,k),x=n!=null&&n.sync?new Promise(N=>v=N):Promise.resolve().then(b).then(),y=[m,o,i,w,Date.now(),x];if(e._tx=y,t){for(const N of e.stores.matches.get()){if(e._tx!==y)break;N.isFetching&&E0(e,N,!1)}t[0].abort(),Ii(e,t[3],y[3],!0)}if(e._tx!==y){Ii(e,y[3]),y[3]=[],v==null||v(),await Kg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(k||!e._committed.length&&((C=w[0])==null?void 0:C.status)!=="success"&&!w.some(N=>N._notFound))&&r3(e,y),v==null||v(b()),await x,await Kg(e,y)}async function vW(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,c;try{try{a=e.matchRoutes(t,{_controller:i}),Ik(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),c=await KO(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),Ii(e,a)),i.abort()}if(!S0(c))return c[1];if(!o||c.length<3)return;t=c[2]}catch(u){ph(u)||console.error(u);return}}}const bW="Error preloading route! ☝️";var XO=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var c,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(c=this.options).getParentRoute)==null?void 0:u.call(c),r?this._path=$d:this.parentRoute||Tk();let s=r?$d:t==null?void 0:t.path;s&&s!=="/"&&(s=PO(s));const i=(t==null?void 0:t.id)||s;let a=r?$d:P1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=P1(["/",a]));const o=a==="__root__"?"/":P1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=el(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>ZK({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},yW=class extends XO{constructor(e){super(e)}},Bk=class extends T.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?T.createElement(this.props.errorComponent??xW,{error:e,reset:this.reset}):this.props.children}};function xW({error:e}){const[n,t]=T.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function wW({children:e,fallback:n=null}){return f.jsx(tt.Fragment,{children:YO()?e:n})}function YO(){return tt.useSyncExternalStore(kW,()=>!0,()=>!1)}function kW(){return()=>{}}var ZO=T.createContext(null);function vi(e){return T.useContext(ZO)}var Cb=T.createContext(void 0),SW=T.createContext(void 0),Er=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Er||{});function CW({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,h,_){const p=h.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:h.deps;if(m!==void 0&&m.dep===u){m.version=_,h.depsTail=m;return}const w=u.subsTail;if(w!==void 0&&w.version===_&&w.sub===h)return;const k=h.depsTail=u.subsTail={version:_,dep:u,sub:h,prevDep:p,nextDep:m,prevSub:w,nextSub:void 0};m!==void 0&&(m.prevDep=k),p!==void 0?p.nextDep=k:h.deps=k,w!==void 0?w.nextSub=k:u.subs=k}function s(u,h=u.sub){const _=u.dep,p=u.prevDep,m=u.nextDep,w=u.nextSub,k=u.prevSub;return m!==void 0?m.prevDep=p:h.depsTail=p,p!==void 0?p.nextDep=m:h.deps=m,w!==void 0?w.prevSub=k:_.subsTail=k,k!==void 0?k.nextSub=w:(_.subs=w)===void 0&&t(_),m}function i(u){let h=u.nextSub,_;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&c(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const w=p.subs;if(w!==void 0){const k=(u=w).nextSub;k!==void 0&&(_={value:h,prev:_},h=k);continue}}if((u=h)!==void 0){h=u.nextSub;continue}for(;_!==void 0;)if(u=_.value,_=_.prev,u!==void 0){h=u.nextSub;continue e}break}while(!0)}function a(u,h){let _,p=0,m=!1;e:do{const w=u.dep,k=w.flags;if(h.flags&16)m=!0;else if((k&17)===17){if(e(w)){const v=w.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((k&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(_={value:u,prev:_}),u=w.deps,h=w,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=h.subs,b=v.nextSub!==void 0;if(b?(u=_.value,_=_.prev):u=v,m){if(e(h)){b&&o(v),h=u.sub;continue}m=!1}else h.flags&=-33;h=u.sub;const x=u.nextDep;if(x!==void 0){u=x;continue e}}return m}while(!0)}function o(u){do{const h=u.sub,_=h.flags;(_&48)===32&&(h.flags=_|16,(_&6)===2&&n(h))}while((u=u.nextSub)!==void 0)}function c(u,h){let _=h.depsTail;for(;_!==void 0;){if(_===u)return!0;_=_.prevDep}return!1}}function EW(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const s3=[];let U1=0;const{link:AE,unlink:NW,propagate:zW,checkDirty:JO,shallowPropagate:TE}=CW({update(e){return e._update()},notify(e){s3[i3++]=e,e.flags&=~Er.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Er.Mutable|Er.Dirty,yv(e))}});let Wg=0,i3=0,Bo,a3=0;function jW(e){try{++a3,e()}finally{--a3||eD()}}function yv(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=NW(t,e)}function eD(){if(!(a3>0)){for(;Wg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(i){const a=Bo,o=(n==null?void 0:n.compare)??Object.is;if(t)Bo=s,++U1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=Er.Mutable|Er.RecursedCheck);try{const c=s._snapshot,u=typeof i=="function"?i(c):i===void 0&&t?r(c):i;return c===void 0||!o(c,u)?(s._snapshot=u,!0):!1}finally{Bo=a,t&&(s.flags&=~Er.RecursedCheck),yv(s)}}};return t?(s.flags=Er.Mutable|Er.Dirty,s.get=function(){const i=s.flags;if(i&Er.Dirty||i&Er.Pending&&JO(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&TE(a)}}else i&Er.Pending&&(s.flags=i&~Er.Pending);return Bo!==void 0&&AE(s,Bo,U1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(zW(a),TE(a),eD())}},s}function AW(e){const n=()=>{const r=Bo;Bo=t,++U1,t.depsTail=void 0,t.flags=Er.Watching|Er.RecursedCheck;try{return e()}finally{Bo=r,t.flags&=~Er.RecursedCheck,yv(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Er.Watching|Er.RecursedCheck,notify(){const r=this.flags;r&Er.Dirty||r&Er.Pending&&JO(this.deps,this)?n():this.flags=Er.Watching},stop(){this.flags=Er.None,this.depsTail=void 0,yv(this)}};return n(),t}var H2={exports:{}},q2={},U2={exports:{}},G2={};/** * @license React * use-sync-external-store-shim.production.js * @@ -93,7 +93,7 @@ ${e==null?void 0:e.path} El almacén se copia a la nueva ubicación y se activa allí. Si hay ejecuciones o chats activos, no se podrá mover.`,U_n=e=>`सारा orx डेटा यहाँ ले जाएं: ${e==null?void 0:e.path} -स्टोर की एक कॉपी नए स्थान पर बनाई जाएगी और वहीं सक्रिय की जाएगी। सक्रिय रन या चैट स्थानांतरण को रोक सकते हैं।`,G_n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?P_n(e):t==="fa"?F_n(e):t==="ar"?H_n(e):t==="es"?q_n(e):t==="hi"?U_n(e):B_n(e)}),V_n=()=>"Move data here",K_n=()=>"将数据移动到此处",W_n=()=>"انتقال داده به اینجا",Q_n=()=>"نقل البيانات إلى هنا",X_n=()=>"Mover los datos aquí",Y_n=()=>"डेटा यहाँ ले जाएं",Z_n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K_n():t==="fa"?W_n():t==="ar"?Q_n():t==="es"?X_n():t==="hi"?Y_n():V_n()}),J_n=()=>"Moving…",efn=()=>"正在移动…",tfn=()=>"در حال جابه‌جایی…",nfn=()=>"جارٍ النقل…",rfn=()=>"Moviendo…",sfn=()=>"स्थानांतरित हो रहा है…",ifn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?efn():t==="fa"?tfn():t==="ar"?nfn():t==="es"?rfn():t==="hi"?sfn():J_n()}),afn=()=>"Preparing…",ofn=()=>"正在准备…",cfn=()=>"در حال آماده‌سازی…",lfn=()=>"جارٍ التحضير…",ufn=()=>"Preparando…",_fn=()=>"तैयार हो रहा है…",ffn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ofn():t==="fa"?cfn():t==="ar"?lfn():t==="es"?ufn():t==="hi"?_fn():afn()}),dfn=()=>" (same disk, instant)",hfn=()=>"(同一磁盘,可立即完成)",pfn=()=>" (روی همان دیسک، فوری)",mfn=()=>" (القرص نفسه، فوري)",gfn=()=>" (mismo disco, instantáneo)",vfn=()=>" (उसी डिस्क पर, तुरंत)",bfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hfn():t==="fa"?pfn():t==="ar"?mfn():t==="es"?gfn():t==="hi"?vfn():dfn()}),yfn=()=>"default location",xfn=()=>"默认位置",wfn=()=>"محل پیش‌فرض",kfn=()=>"الموقع الافتراضي",Sfn=()=>"ubicación predeterminada",Cfn=()=>"डिफ़ॉल्ट स्थान",Efn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xfn():t==="fa"?wfn():t==="ar"?kfn():t==="es"?Sfn():t==="hi"?Cfn():yfn()}),Nfn=()=>"ORX_DATA_DIR environment variable",zfn=()=>"ORX_DATA_DIR 环境变量",jfn=()=>"متغیر محیطی ORX_DATA_DIR",Afn=()=>"متغيّر البيئة ORX_DATA_DIR",Tfn=()=>"variable de entorno ORX_DATA_DIR",Rfn=()=>"ORX_DATA_DIR एनवायरनमेंट वेरिएबल",Mfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zfn():t==="fa"?jfn():t==="ar"?Afn():t==="es"?Tfn():t==="hi"?Rfn():Nfn()}),Ofn=()=>"your saved setting",Dfn=()=>"已保存的设置",Lfn=()=>"تنظیم ذخیره‌شدهٔ شما",Ifn=()=>"إعدادك المحفوظ",$fn=()=>"tu ajuste guardado",Bfn=()=>"आपकी सेव की गई सेटिंग",Pfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dfn():t==="fa"?Lfn():t==="ar"?Ifn():t==="es"?$fn():t==="hi"?Bfn():Ofn()}),Ffn=()=>"XDG_DATA_HOME",Hfn=()=>"XDG_DATA_HOME",qfn=()=>"XDG_DATA_HOME",Ufn=()=>"XDG_DATA_HOME",Gfn=()=>"XDG_DATA_HOME",Vfn=()=>"XDG_DATA_HOME",Kfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hfn():t==="fa"?qfn():t==="ar"?Ufn():t==="es"?Gfn():t==="hi"?Vfn():Ffn()}),Wfn=()=>"Verifying…",Qfn=()=>"正在验证…",Xfn=()=>"در حال بررسی…",Yfn=()=>"جارٍ التحقق…",Zfn=()=>"Verificando…",Jfn=()=>"सत्यापित हो रहा है…",edn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qfn():t==="fa"?Xfn():t==="ar"?Yfn():t==="es"?Zfn():t==="hi"?Jfn():Wfn()}),tdn=()=>"Loading…",ndn=()=>"正在加载…",rdn=()=>"در حال بارگیری…",sdn=()=>"جارٍ التحميل…",idn=()=>"Cargando…",adn=()=>"लोड हो रहा है…",odn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ndn():t==="fa"?rdn():t==="ar"?sdn():t==="es"?idn():t==="hi"?adn():tdn()}),cdn=()=>"This sub-agent is no longer available.",ldn=()=>"此子智能体已不可用。",udn=()=>"این عامل فرعی دیگر در دسترس نیست.",_dn=()=>"لم يعد هذا الوكيل الفرعي متاحًا.",fdn=()=>"Este subagente ya no está disponible.",ddn=()=>"यह सब-एजेंट अब उपलब्ध नहीं है।",hdn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ldn():t==="fa"?udn():t==="ar"?_dn():t==="es"?fdn():t==="hi"?ddn():cdn()}),pdn=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,mdn=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,gdn=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,vdn=e=>`${e==null?void 0:e.label} (معاينة؛ انقر نقرًا مزدوجًا أو Command/Control K ثم Enter لإبقائه مفتوحًا)`,bdn=e=>`${e==null?void 0:e.label} (vista previa; doble clic o Comando/Control K y luego Intro para mantenerla abierta)`,ydn=e=>`${e==null?void 0:e.label} (प्रीव्यू; खुला रखने के लिए डबल-क्लिक करें या Command/Control K, फिर Enter दबाएं)`,xdn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?mdn(e):t==="fa"?gdn(e):t==="ar"?vdn(e):t==="es"?bdn(e):t==="hi"?ydn(e):pdn(e)}),wdn=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,kdn=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,Sdn=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,Cdn=e=>`${e==null?void 0:e.label} (انقر نقرًا مزدوجًا أو ⌘/Ctrl+K ثم Enter لإبقائه مفتوحًا)`,Edn=e=>`${e==null?void 0:e.label} (doble clic o ⌘/Ctrl+K Intro para mantenerla abierta)`,Ndn=e=>`${e==null?void 0:e.label} (खुला रखने के लिए डबल-क्लिक करें या ⌘/Ctrl+K फिर Enter दबाएं)`,zdn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?kdn(e):t==="fa"?Sdn(e):t==="ar"?Cdn(e):t==="es"?Edn(e):t==="hi"?Ndn(e):wdn(e)}),jdn=()=>"Alternatively, tell your agent to add a LaTeX template for you.",Adn=()=>"或者,请你的智能体为你添加 LaTeX 模板。",Tdn=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",Rdn=()=>"أو بدلًا من ذلك، اطلب من وكيلك إضافة قالب LaTeX لك.",Mdn=()=>"También puedes pedirle a tu agente que añada una plantilla de LaTeX por ti.",Odn=()=>"या अपने एजेंट से आपके लिए एक LaTeX टेम्पलेट जोड़ने को कहें।",Ddn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Adn():t==="fa"?Tdn():t==="ar"?Rdn():t==="es"?Mdn():t==="hi"?Odn():jdn()}),Ldn=()=>", a repo for training a mini-GPT from scratch.",Idn=()=>",一个从零训练迷你 GPT 的仓库。",$dn=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",Bdn=()=>" لأندريه كارباثي، المخصّص لتدريب نموذج mini-GPT من الصفر.",Pdn=()=>" de Andrej Karpathy, un repositorio para entrenar un mini-GPT desde cero.",Fdn=()=>", स्क्रैच से एक मिनी-GPT ट्रेन करने के लिए एक रिपॉज़िटरी।",Hdn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Idn():t==="fa"?$dn():t==="ar"?Bdn():t==="es"?Pdn():t==="hi"?Fdn():Ldn()}),qdn=()=>"Close",Udn=()=>"关闭",Gdn=()=>"بستن",Vdn=()=>"إغلاق",Kdn=()=>"Cerrar",Wdn=()=>"बंद करें",x3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Udn():t==="fa"?Gdn():t==="ar"?Vdn():t==="es"?Kdn():t==="hi"?Wdn():qdn()}),Qdn=()=>"Create a new project",Xdn=()=>"新建项目",Ydn=()=>"ایجاد پروژهٔ جدید",Zdn=()=>"إنشاء مشروع جديد",Jdn=()=>"Crear un proyecto nuevo",ehn=()=>"नया प्रोजेक्ट बनाएं",thn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xdn():t==="fa"?Ydn():t==="ar"?Zdn():t==="es"?Jdn():t==="hi"?ehn():Qdn()}),nhn=()=>"Demo project",rhn=()=>"演示项目",shn=()=>"پروژهٔ نمایشی",ihn=()=>"مشروع توضيحي",ahn=()=>"Proyecto de demostración",ohn=()=>"डेमो प्रोजेक्ट",chn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rhn():t==="fa"?shn():t==="ar"?ihn():t==="es"?ahn():t==="hi"?ohn():nhn()}),lhn=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",uhn=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",_hn=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",fhn=()=>"تصفّح محادثات الوكيل والتجارب وعمليات التشغيل والمُخرَجات لترى كيف يتشكّل مشروع على OpenResearch.",dhn=()=>"Explora las conversaciones con el agente, los experimentos, las ejecuciones y los artefactos para ver cómo se construye un proyecto en OpenResearch.",hhn=()=>"यह देखने के लिए एजेंट बातचीत, प्रयोग, रन और आर्टिफ़ैक्ट देखें कि OpenResearch पर एक प्रोजेक्ट कैसे आकार लेता है।",phn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uhn():t==="fa"?_hn():t==="ar"?fhn():t==="es"?dhn():t==="hi"?hhn():lhn()}),mhn=()=>"nanochat",ghn=()=>"nanochat",vhn=()=>"nanochat",bhn=()=>"nanochat",yhn=()=>"nanochat",xhn=()=>"nanochat",whn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ghn():t==="fa"?vhn():t==="ar"?bhn():t==="es"?yhn():t==="hi"?xhn():mhn()}),khn=()=>"Try the demo experiment",Shn=()=>"试试演示实验",Chn=()=>"آزمایش نمایشی را امتحان کنید",Ehn=()=>"جرّب التجربة التوضيحية",Nhn=()=>"Probar el experimento de demostración",zhn=()=>"डेमो प्रयोग आज़माएं",jhn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Shn():t==="fa"?Chn():t==="ar"?Ehn():t==="es"?Nhn():t==="hi"?zhn():khn()}),Ahn=()=>"Couldn’t save your progress. Try again.",Thn=()=>"无法保存进度。请重试。",Rhn=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",Mhn=()=>"تعذّر حفظ تقدّمك. حاول مجددًا.",Ohn=()=>"No se pudo guardar tu progreso. Inténtalo de nuevo.",Dhn=()=>"आपकी प्रगति सेव नहीं हो सकी। फिर से कोशिश करें।",Lhn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Thn():t==="fa"?Rhn():t==="ar"?Mhn():t==="es"?Ohn():t==="hi"?Dhn():Ahn()}),Ihn=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",$hn=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",Bhn=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",Phn=()=>"هذا مشروع توضيحي يبيّن كيف يعمل OpenResearch. يستخدم هذا العرض مستودع",Fhn=()=>"Este es un proyecto de demostración que muestra cómo funciona OpenResearch. Esta demo usa",Hhn=()=>"यह एक डेमो प्रोजेक्ट है जो दिखाता है कि OpenResearch कैसे काम करता है। यह डेमो Andrej Karpathy के",qhn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$hn():t==="fa"?Bhn():t==="ar"?Phn():t==="es"?Fhn():t==="hi"?Hhn():Ihn()}),Uhn=()=>"Welcome to OpenResearch",Ghn=()=>"欢迎使用 OpenResearch",Vhn=()=>"به OpenResearch خوش آمدید",Khn=()=>"مرحبًا بك في OpenResearch",Whn=()=>"Te damos la bienvenida a OpenResearch",Qhn=()=>"OpenResearch में आपका स्वागत है",Xhn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ghn():t==="fa"?Vhn():t==="ar"?Khn():t==="es"?Whn():t==="hi"?Qhn():Uhn()}),Yhn=()=>"All experiments are archived. Turn on Show archived to view them.",Zhn=()=>"所有实验均已归档。开启“显示已归档”即可查看。",Jhn=()=>"همه آزمایش‌ها بایگانی شده‌اند. برای دیدنشان نمایش بایگانی‌شده‌ها را فعال کنید.",epn=()=>"جميع التجارب مؤرشفة. فعّل إظهار المؤرشف لعرضها.",tpn=()=>"Todos los experimentos están archivados. Activa Mostrar archivados para verlos.",npn=()=>"सभी प्रयोग संग्रहीत हैं। उन्हें देखने के लिए संग्रहीत दिखाएँ चालू करें।",rpn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zhn():t==="fa"?Jhn():t==="ar"?epn():t==="es"?tpn():t==="hi"?npn():Yhn()}),spn=()=>"Archive ancestors",ipn=()=>"归档祖先节点",apn=()=>"بایگانی نیاکان",opn=()=>"أرشفة الأسلاف",cpn=()=>"Archivar antepasados",lpn=()=>"पूर्वजों को संग्रहीत करें",upn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ipn():t==="fa"?apn():t==="ar"?opn():t==="es"?cpn():t==="hi"?lpn():spn()}),_pn=()=>"Archive descendants",fpn=()=>"归档后代节点",dpn=()=>"بایگانی نوادگان",hpn=()=>"أرشفة الفروع التابعة",ppn=()=>"Archivar descendientes",mpn=()=>"वंशजों को संग्रहीत करें",gpn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fpn():t==="fa"?dpn():t==="ar"?hpn():t==="es"?ppn():t==="hi"?mpn():_pn()}),vpn=()=>"Manage",bpn=()=>"管理",ypn=()=>"مدیریت",xpn=()=>"إدارة",wpn=()=>"Gestionar",kpn=()=>"प्रबंधित करें",Spn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bpn():t==="fa"?ypn():t==="ar"?xpn():t==="es"?wpn():t==="hi"?kpn():vpn()}),Cpn=e=>`Manage ${e==null?void 0:e.name}`,Epn=e=>`管理 ${e==null?void 0:e.name}`,Npn=e=>`مدیریت ${e==null?void 0:e.name}`,zpn=e=>`إدارة ${e==null?void 0:e.name}`,jpn=e=>`Gestionar ${e==null?void 0:e.name}`,Apn=e=>`${e==null?void 0:e.name} प्रबंधित करें`,Fz=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Epn(e):t==="fa"?Npn(e):t==="ar"?zpn(e):t==="es"?jpn(e):t==="hi"?Apn(e):Cpn(e)}),Tpn=()=>"Archive this experiment",Rpn=()=>"归档此实验",Mpn=()=>"بایگانی این آزمایش",Opn=()=>"أرشفة هذه التجربة",Dpn=()=>"Archivar este experimento",Lpn=()=>"इस प्रयोग को संग्रहीत करें",Ipn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rpn():t==="fa"?Mpn():t==="ar"?Opn():t==="es"?Dpn():t==="hi"?Lpn():Tpn()}),$pn=()=>"Archived",Bpn=()=>"已归档",Ppn=()=>"بایگانی‌شده",Fpn=()=>"مؤرشف",Hpn=()=>"Archivado",qpn=()=>"संग्रहीत",OL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bpn():t==="fa"?Ppn():t==="ar"?Fpn():t==="es"?Hpn():t==="hi"?qpn():$pn()}),Upn=e=>`${e==null?void 0:e.count} archived`,Gpn=e=>`${e==null?void 0:e.count} 个已归档`,Vpn=e=>`${e==null?void 0:e.count} بایگانی‌شده`,Kpn=e=>`${e==null?void 0:e.count} مؤرشفة`,Wpn=e=>`${e==null?void 0:e.count} archivados`,Qpn=e=>`${e==null?void 0:e.count} संग्रहीत`,Xpn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Gpn(e):t==="fa"?Vpn(e):t==="ar"?Kpn(e):t==="es"?Wpn(e):t==="hi"?Qpn(e):Upn(e)}),Ypn=()=>"Baseline",Zpn=()=>"基线",Jpn=()=>"مبنا",e0n=()=>"الأساس",t0n=()=>"Base",n0n=()=>"बेसलाइन",r0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zpn():t==="fa"?Jpn():t==="ar"?e0n():t==="es"?t0n():t==="hi"?n0n():Ypn()}),s0n=()=>"Experiment",i0n=()=>"实验",a0n=()=>"آزمایش",o0n=()=>"تجربة",c0n=()=>"Experimento",l0n=()=>"प्रयोग",Wc=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?i0n():t==="fa"?a0n():t==="ar"?o0n():t==="es"?c0n():t==="hi"?l0n():s0n()}),u0n=e=>`${e==null?void 0:e.count} experiments`,_0n=e=>`${e==null?void 0:e.count} 个实验`,f0n=e=>`${e==null?void 0:e.count} آزمایش`,d0n=e=>`التجارب: ${e==null?void 0:e.count}`,h0n=e=>`${e==null?void 0:e.count} experimentos`,p0n=e=>`${e==null?void 0:e.count} प्रयोग`,m0n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_0n(e):t==="fa"?f0n(e):t==="ar"?d0n(e):t==="es"?h0n(e):t==="hi"?p0n(e):u0n(e)}),g0n=()=>"hidden",v0n=()=>"已隐藏",b0n=()=>"پنهان",y0n=()=>"مخفية",x0n=()=>"ocultos",w0n=()=>"छिपे हुए",k0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v0n():t==="fa"?b0n():t==="ar"?y0n():t==="es"?x0n():t==="hi"?w0n():g0n()}),S0n=()=>"1 experiment",C0n=()=>"1 个实验",E0n=()=>"۱ آزمایش",N0n=()=>"تجربة واحدة",z0n=()=>"1 experimento",j0n=()=>"1 प्रयोग",A0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C0n():t==="fa"?E0n():t==="ar"?N0n():t==="es"?z0n():t==="hi"?j0n():S0n()}),T0n=()=>"Restore archived ancestors",R0n=()=>"恢复已归档的祖先节点",M0n=()=>"بازیابی نیاکان بایگانی‌شده",O0n=()=>"استعادة الأسلاف المؤرشفين",D0n=()=>"Restaurar antepasados archivados",L0n=()=>"संग्रहीत पूर्वजों को पुनर्स्थापित करें",I0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?R0n():t==="fa"?M0n():t==="ar"?O0n():t==="es"?D0n():t==="hi"?L0n():T0n()}),$0n=e=>`Restore ${e==null?void 0:e.count} archived experiments`,B0n=e=>`恢复 ${e==null?void 0:e.count} 个已归档实验`,P0n=e=>`بازیابی ${e==null?void 0:e.count} آزمایش بایگانی‌شده`,F0n=e=>`استعادة ${e==null?void 0:e.count} تجارب مؤرشفة`,H0n=e=>`Restaurar ${e==null?void 0:e.count} experimentos archivados`,q0n=e=>`${e==null?void 0:e.count} संग्रहीत प्रयोग पुनर्स्थापित करें`,U0n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?B0n(e):t==="fa"?P0n(e):t==="ar"?F0n(e):t==="es"?H0n(e):t==="hi"?q0n(e):$0n(e)}),G0n=()=>"Restore descendants",V0n=()=>"恢复后代节点",K0n=()=>"بازیابی نوادگان",W0n=()=>"استعادة الفروع التابعة",Q0n=()=>"Restaurar descendientes",X0n=()=>"वंशजों को पुनर्स्थापित करें",Y0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?V0n():t==="fa"?K0n():t==="ar"?W0n():t==="es"?Q0n():t==="hi"?X0n():G0n()}),Z0n=()=>"Restore this experiment",J0n=()=>"恢复此实验",emn=()=>"بازیابی این آزمایش",tmn=()=>"استعادة هذه التجربة",nmn=()=>"Restaurar este experimento",rmn=()=>"इस प्रयोग को पुनर्स्थापित करें",DL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J0n():t==="fa"?emn():t==="ar"?tmn():t==="es"?nmn():t==="hi"?rmn():Z0n()}),smn=()=>"Running",imn=()=>"运行中",amn=()=>"در حال اجرا",omn=()=>"قيد التشغيل",cmn=()=>"En ejecución",lmn=()=>"चल रहा है",umn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?imn():t==="fa"?amn():t==="ar"?omn():t==="es"?cmn():t==="hi"?lmn():smn()}),_mn=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",fmn=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",dmn=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",hmn=()=>"اطلب في هذه المهمة إنشاء واحدة، أو بدّل إلى «المشروع بالكامل» لرؤية جميع التجارب.",pmn=()=>"Pide en esta tarea que se cree uno, o cambia a Todo el proyecto para ver todos los experimentos.",mmn=()=>"इस टास्क में एक बनाने को कहें, या सभी प्रयोग देखने के लिए पूरा प्रोजेक्ट पर स्विच करें।",gmn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fmn():t==="fa"?dmn():t==="ar"?hmn():t==="es"?pmn():t==="hi"?mmn():_mn()}),vmn=()=>"Ask the agent in chat to create and run your first experiment.",bmn=()=>"在聊天中让智能体创建并运行你的第一个实验。",ymn=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",xmn=()=>"اطلب من الوكيل في المحادثة إنشاء أول تجربة لك وتشغيلها.",wmn=()=>"Pídele al agente en el chat que cree y ejecute tu primer experimento.",kmn=()=>"एजेंट से चैट में अपना पहला प्रयोग बनाने और चलाने को कहें।",Smn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bmn():t==="fa"?ymn():t==="ar"?xmn():t==="es"?wmn():t==="hi"?kmn():vmn()}),Cmn=()=>"Code",Emn=()=>"代码",Nmn=()=>"کد",zmn=()=>"الشيفرة",jmn=()=>"Código",Amn=()=>"कोड",Tmn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Emn():t==="fa"?Nmn():t==="ar"?zmn():t==="es"?jmn():t==="hi"?Amn():Cmn()}),Rmn=()=>"Logs",Mmn=()=>"日志",Omn=()=>"گزارش‌ها",Dmn=()=>"السجلات",Lmn=()=>"Logs",Imn=()=>"लॉग",LL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mmn():t==="fa"?Omn():t==="ar"?Dmn():t==="es"?Lmn():t==="hi"?Imn():Rmn()}),$mn=()=>"No experiments from the current task yet",Bmn=()=>"当前任务尚无实验",Pmn=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",Fmn=()=>"لا توجد تجارب من المهمة الحالية بعد",Hmn=()=>"Aún no hay experimentos de la tarea actual",qmn=()=>"मौजूदा टास्क से अभी तक कोई प्रयोग नहीं",Umn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bmn():t==="fa"?Pmn():t==="ar"?Fmn():t==="es"?Hmn():t==="hi"?qmn():$mn()}),Gmn=()=>"No experiments yet",Vmn=()=>"尚无实验",Kmn=()=>"هنوز آزمایشی وجود ندارد",Wmn=()=>"لا توجد تجارب بعد",Qmn=()=>"Aún no hay experimentos",Xmn=()=>"अभी तक कोई प्रयोग नहीं",Ymn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vmn():t==="fa"?Kmn():t==="ar"?Wmn():t==="es"?Qmn():t==="hi"?Xmn():Gmn()}),Zmn=()=>"no runs",Jmn=()=>"无运行",egn=()=>"بدون اجرا",tgn=()=>"لا عمليات تشغيل",ngn=()=>"sin ejecuciones",rgn=()=>"कोई रन नहीं",sgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jmn():t==="fa"?egn():t==="ar"?tgn():t==="es"?ngn():t==="hi"?rgn():Zmn()}),ign=()=>"Open logs",agn=()=>"打开日志",ogn=()=>"باز کردن گزارش‌ها",cgn=()=>"فتح السجلات",lgn=()=>"Abrir logs",ugn=()=>"लॉग खोलें",_gn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?agn():t==="fa"?ogn():t==="ar"?cgn():t==="es"?lgn():t==="hi"?ugn():ign()}),fgn=()=>"Runs",dgn=()=>"运行",hgn=()=>"اجراها",pgn=()=>"عمليات التشغيل",mgn=()=>"Ejecuciones",ggn=()=>"रन",vgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dgn():t==="fa"?hgn():t==="ar"?pgn():t==="es"?mgn():t==="hi"?ggn():fgn()}),bgn=()=>"Switch to Entire project to see all experiments",ygn=()=>"切换到“整个项目”以查看所有实验",xgn=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",wgn=()=>"بدّل إلى «المشروع بالكامل» لرؤية جميع التجارب",kgn=()=>"Cambia a Todo el proyecto para ver todos los experimentos",Sgn=()=>"सभी प्रयोग देखने के लिए पूरा प्रोजेक्ट पर स्विच करें",Cgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ygn():t==="fa"?xgn():t==="ar"?wgn():t==="es"?kgn():t==="hi"?Sgn():bgn()}),Egn=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,Ngn=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,zgn=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,jgn=e=>`تم التحديث إلى ${e==null?void 0:e.version}. أعد التشغيل لاستخدامه.`,Agn=e=>`Actualizado a la versión ${e==null?void 0:e.version}. Reinicia para usarla.`,Tgn=e=>`${e==null?void 0:e.version} पर अपडेट हुआ। इस्तेमाल के लिए फिर से शुरू करें।`,Rgn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ngn(e):t==="fa"?zgn(e):t==="ar"?jgn(e):t==="es"?Agn(e):t==="hi"?Tgn(e):Egn(e)}),Mgn=()=>"Dismiss",Ogn=()=>"关闭",Dgn=()=>"بستن",Lgn=()=>"تجاهل",Ign=()=>"Descartar",$gn=()=>"खारिज करें",Bgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ogn():t==="fa"?Dgn():t==="ar"?Lgn():t==="es"?Ign():t==="hi"?$gn():Mgn()}),Pgn=()=>"Restart now",Fgn=()=>"立即重新启动",Hgn=()=>"هم‌اکنون دوباره راه‌اندازی کن",qgn=()=>"أعد التشغيل الآن",Ugn=()=>"Reiniciar ahora",Ggn=()=>"अभी फिर से शुरू करें",IL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fgn():t==="fa"?Hgn():t==="ar"?qgn():t==="es"?Ugn():t==="hi"?Ggn():Pgn()}),Vgn=e=>`Could not restart: ${e==null?void 0:e.error}`,Kgn=e=>`无法重新启动:${e==null?void 0:e.error}`,Wgn=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,Qgn=e=>`تعذّرت إعادة التشغيل: ${e==null?void 0:e.error}`,Xgn=e=>`No se pudo reiniciar: ${e==null?void 0:e.error}`,Ygn=e=>`फिर से शुरू नहीं हो सका: ${e==null?void 0:e.error}`,$L=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Kgn(e):t==="fa"?Wgn(e):t==="ar"?Qgn(e):t==="es"?Xgn(e):t==="hi"?Ygn(e):Vgn(e)}),Zgn=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",Jgn=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",e1n=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",t1n=()=>"لم يعد OpenResearch المحدَّث في الوقت المناسب. أعد تشغيله يدويًا.",n1n=()=>"La nueva versión de OpenResearch no se inició a tiempo. Reinícialo manualmente.",r1n=()=>"अपडेट किया गया OpenResearch समय पर वापस नहीं आया। इसे खुद फिर से शुरू करें।",s1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jgn():t==="fa"?e1n():t==="ar"?t1n():t==="es"?n1n():t==="hi"?r1n():Zgn()}),i1n=()=>"Restarting…",a1n=()=>"正在重新启动…",o1n=()=>"در حال راه‌اندازی مجدد…",c1n=()=>"جارٍ إعادة التشغيل…",l1n=()=>"Reiniciando…",u1n=()=>"फिर से शुरू हो रहा है…",BL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a1n():t==="fa"?o1n():t==="ar"?c1n():t==="es"?l1n():t==="hi"?u1n():i1n()}),_1n=()=>"macOS app",f1n=()=>"macOS 应用",d1n=()=>"برنامهٔ macOS",h1n=()=>"تطبيق macOS",p1n=()=>"App de macOS",m1n=()=>"macOS ऐप",g1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f1n():t==="fa"?d1n():t==="ar"?h1n():t==="es"?p1n():t==="hi"?m1n():_1n()}),v1n=()=>"Linux app (AppImage)",b1n=()=>"Linux 应用(AppImage)",y1n=()=>"برنامه لینوکس (AppImage)",x1n=()=>"تطبيق Linux ‏(AppImage)",w1n=()=>"Aplicación para Linux (AppImage)",k1n=()=>"Linux ऐप (AppImage)",S1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b1n():t==="fa"?y1n():t==="ar"?x1n():t==="es"?w1n():t==="hi"?k1n():v1n()}),C1n=()=>"Installed with cargo",E1n=()=>"通过 cargo 安装",N1n=()=>"نصب‌شده با cargo",z1n=()=>"مثبّت عبر cargo",j1n=()=>"Instalado con cargo",A1n=()=>"cargo से इंस्टॉल किया गया",T1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?E1n():t==="fa"?N1n():t==="ar"?z1n():t==="es"?j1n():t==="hi"?A1n():C1n()}),R1n=()=>"Installed with Homebrew",M1n=()=>"通过 Homebrew 安装",O1n=()=>"نصب‌شده با Homebrew",D1n=()=>"مثبّت عبر Homebrew",L1n=()=>"Instalado con Homebrew",I1n=()=>"Homebrew से इंस्टॉल किया गया",$1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M1n():t==="fa"?O1n():t==="ar"?D1n():t==="es"?L1n():t==="hi"?I1n():R1n()}),B1n=()=>"Installed with the orx installer",P1n=()=>"通过 orx 安装程序安装",F1n=()=>"نصب‌شده با نصب‌کنندهٔ orx",H1n=()=>"مثبّت عبر مُثبّت orx",q1n=()=>"Instalado con el instalador de orx",U1n=()=>"orx इंस्टॉलर से इंस्टॉल किया गया",G1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P1n():t==="fa"?F1n():t==="ar"?H1n():t==="es"?q1n():t==="hi"?U1n():B1n()}),V1n=()=>"Managed by Nix",K1n=()=>"由 Nix 管理",W1n=()=>"مدیریت‌شده با Nix",Q1n=()=>"مُدار بواسطة Nix",X1n=()=>"Gestionado por Nix",Y1n=()=>"Nix द्वारा प्रबंधित",Z1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K1n():t==="fa"?W1n():t==="ar"?Q1n():t==="es"?X1n():t==="hi"?Y1n():V1n()}),J1n=()=>"Portable orx.exe",evn=()=>"便携版 orx.exe",tvn=()=>"orx.exe قابل‌حمل",nvn=()=>"‏orx.exe المحمول",rvn=()=>"orx.exe portable",svn=()=>"पोर्टेबल orx.exe",ivn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?evn():t==="fa"?tvn():t==="ar"?nvn():t==="es"?rvn():t==="hi"?svn():J1n()}),avn=()=>"Unknown install",ovn=()=>"未知安装方式",cvn=()=>"روش نصب نامشخص",lvn=()=>"تثبيت غير معروف",uvn=()=>"Instalación desconocida",_vn=()=>"अज्ञात इंस्टॉल",fvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ovn():t==="fa"?cvn():t==="ar"?lvn():t==="es"?uvn():t==="hi"?_vn():avn()}),dvn=()=>"Re-run your cargo install to update.",hvn=()=>"重新运行 cargo 安装命令以更新。",pvn=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",mvn=()=>"أعِد تنفيذ أمر cargo install للتحديث.",gvn=()=>"Vuelve a ejecutar cargo install para actualizar.",vvn=()=>"अपडेट करने के लिए अपना cargo install फिर से चलाएं।",bvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hvn():t==="fa"?pvn():t==="ar"?mvn():t==="es"?gvn():t==="hi"?vvn():dvn()}),yvn=()=>"Run brew upgrade to update.",xvn=()=>"运行 brew upgrade 以更新。",wvn=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",kvn=()=>"نفّذ brew upgrade للتحديث.",Svn=()=>"Ejecuta brew upgrade para actualizar.",Cvn=()=>"अपडेट करने के लिए brew upgrade चलाएं।",Evn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xvn():t==="fa"?wvn():t==="ar"?kvn():t==="es"?Svn():t==="hi"?Cvn():yvn()}),Nvn=()=>"Update it through your Nix configuration.",zvn=()=>"通过 Nix 配置进行更新。",jvn=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Avn=()=>"حدّثه عبر إعداد Nix الخاص بك.",Tvn=()=>"Actualízalo desde tu configuración de Nix.",Rvn=()=>"इसे अपने Nix कॉन्फ़िगरेशन के ज़रिए अपडेट करें।",Mvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zvn():t==="fa"?jvn():t==="ar"?Avn():t==="es"?Tvn():t==="hi"?Rvn():Nvn()}),Ovn=()=>"Active Experiments",Dvn=()=>"活跃实验",Lvn=()=>"آزمایش‌های فعال",Ivn=()=>"التجارب النشطة",$vn=()=>"Experimentos activos",Bvn=()=>"सक्रिय प्रयोग",Pvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dvn():t==="fa"?Lvn():t==="ar"?Ivn():t==="es"?$vn():t==="hi"?Bvn():Ovn()}),Fvn=()=>"Default compute",Hvn=()=>"默认计算目标",qvn=()=>"محاسبات پیش‌فرض",Uvn=()=>"الحوسبة الافتراضية",Gvn=()=>"Cómputo predeterminado",Vvn=()=>"डिफ़ॉल्ट कंप्यूट",Kvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hvn():t==="fa"?qvn():t==="ar"?Uvn():t==="es"?Gvn():t==="hi"?Vvn():Fvn()}),Wvn=()=>"Terminal",Qvn=()=>"终端",Xvn=()=>"ترمینال",Yvn=()=>"الطرفية",Zvn=()=>"Terminal",Jvn=()=>"टर्मिनल",jv=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qvn():t==="fa"?Xvn():t==="ar"?Yvn():t==="es"?Zvn():t==="hi"?Jvn():Wvn()}),ebn=()=>"The terminal disconnected.",tbn=()=>"终端连接已断开。",nbn=()=>"ارتباط ترمینال قطع شد.",rbn=()=>"انقطعت الطرفية.",sbn=()=>"La terminal se desconectó.",ibn=()=>"टर्मिनल डिस्कनेक्ट हो गया।",Hz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tbn():t==="fa"?nbn():t==="ar"?rbn():t==="es"?sbn():t==="hi"?ibn():ebn()}),abn=e=>`Shell exited with code ${e==null?void 0:e.code}.`,obn=e=>`Shell 已退出,退出码 ${e==null?void 0:e.code}。`,cbn=e=>`پوسته با کد ${e==null?void 0:e.code} خارج شد.`,lbn=e=>`انتهى Shell برمز الخروج ${e==null?void 0:e.code}.`,ubn=e=>`El shell terminó con el código ${e==null?void 0:e.code}.`,_bn=e=>`शेल कोड ${e==null?void 0:e.code} के साथ बंद हो गया।`,fbn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?obn(e):t==="fa"?cbn(e):t==="ar"?lbn(e):t==="es"?ubn(e):t==="hi"?_bn(e):abn(e)}),dbn=()=>"Restart shell",hbn=()=>"重新启动 Shell",pbn=()=>"راه‌اندازی دوباره پوسته",mbn=()=>"إعادة تشغيل Shell",gbn=()=>"Reiniciar shell",vbn=()=>"शेल फिर से शुरू करें",bbn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hbn():t==="fa"?pbn():t==="ar"?mbn():t==="es"?gbn():t==="hi"?vbn():dbn()}),ybn=()=>"This worktree",xbn=()=>"当前工作树",wbn=()=>"این درخت کاری",kbn=()=>"شجرة العمل هذه",Sbn=()=>"Este árbol de trabajo",Cbn=()=>"यह वर्कट्री",Ebn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xbn():t==="fa"?wbn():t==="ar"?kbn():t==="es"?Sbn():t==="hi"?Cbn():ybn()}),Nbn=()=>"Workspace",zbn=()=>"工作区",jbn=()=>"فضای کاری",Abn=()=>"مساحة العمل",Tbn=()=>"Espacio de trabajo",Rbn=()=>"वर्कस्पेस",rw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zbn():t==="fa"?jbn():t==="ar"?Abn():t==="es"?Tbn():t==="hi"?Rbn():Nbn()}),Mbn=e=>`Current worktree · ${e==null?void 0:e.branch}`,Obn=e=>`当前工作树 · ${e==null?void 0:e.branch}`,Dbn=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,Lbn=e=>`شجرة العمل الحالية · ${e==null?void 0:e.branch}`,Ibn=e=>`Árbol de trabajo actual · ${e==null?void 0:e.branch}`,$bn=e=>`मौजूदा वर्कट्री · ${e==null?void 0:e.branch}`,Bbn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Obn(e):t==="fa"?Dbn(e):t==="ar"?Lbn(e):t==="es"?Ibn(e):t==="hi"?$bn(e):Mbn(e)}),Pbn=e=>`Default branch · ${e==null?void 0:e.branch}`,Fbn=e=>`默认分支 · ${e==null?void 0:e.branch}`,Hbn=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,qbn=e=>`الفرع الافتراضي · ${e==null?void 0:e.branch}`,Ubn=e=>`Rama predeterminada · ${e==null?void 0:e.branch}`,Gbn=e=>`डिफ़ॉल्ट ब्रांच · ${e==null?void 0:e.branch}`,Vbn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Fbn(e):t==="fa"?Hbn(e):t==="ar"?qbn(e):t==="es"?Ubn(e):t==="hi"?Gbn(e):Pbn(e)}),Kbn=e=>`detached at ${e==null?void 0:e.branch}`,Wbn=e=>`分离于 ${e==null?void 0:e.branch}`,Qbn=e=>`جدا در ${e==null?void 0:e.branch}`,Xbn=e=>`منفصل عند ${e==null?void 0:e.branch}`,Ybn=e=>`desacoplado en ${e==null?void 0:e.branch}`,Zbn=e=>`${e==null?void 0:e.branch} पर डिटैच्ड`,Jbn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Wbn(e):t==="fa"?Qbn(e):t==="ar"?Xbn(e):t==="es"?Ybn(e):t==="hi"?Zbn(e):Kbn(e)}),eyn=()=>"Listing truncated.",tyn=()=>"列表已截断。",nyn=()=>"فهرست کوتاه شده است.",ryn=()=>"القائمة مقتطعة.",syn=()=>"Listado truncado.",iyn=()=>"सूची छोटी की गई।",ayn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tyn():t==="fa"?nyn():t==="ar"?ryn():t==="es"?syn():t==="hi"?iyn():eyn()}),oyn=()=>"Loading…",cyn=()=>"正在加载…",lyn=()=>"در حال بارگیری…",uyn=()=>"جارٍ التحميل…",_yn=()=>"Cargando…",fyn=()=>"लोड हो रहा है…",dyn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cyn():t==="fa"?lyn():t==="ar"?uyn():t==="es"?_yn():t==="hi"?fyn():oyn()}),hyn=()=>"No changes yet.",pyn=()=>"尚无更改。",myn=()=>"هنوز تغییری وجود ندارد.",gyn=()=>"لا توجد تغييرات بعد.",vyn=()=>"Aún no hay cambios.",byn=()=>"अभी तक कोई बदलाव नहीं।",yyn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pyn():t==="fa"?myn():t==="ar"?gyn():t==="es"?vyn():t==="hi"?byn():hyn()}),xyn=()=>"No files.",wyn=()=>"没有文件。",kyn=()=>"فایلی وجود ندارد.",Syn=()=>"لا توجد ملفات.",Cyn=()=>"No hay archivos.",Eyn=()=>"कोई फ़ाइल नहीं।",Nyn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wyn():t==="fa"?kyn():t==="ar"?Syn():t==="es"?Cyn():t==="hi"?Eyn():xyn()}),zyn=()=>"Refresh failed:",jyn=()=>"刷新失败:",Ayn=()=>"تازه‌سازی ناموفق بود:",Tyn=()=>"فشل التحديث:",Ryn=()=>"Error al actualizar:",Myn=()=>"रीफ़्रेश विफल:",Oyn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jyn():t==="fa"?Ayn():t==="ar"?Tyn():t==="es"?Ryn():t==="hi"?Myn():zyn()}),Ce=e=>`⁦${e}⁩`,na=e=>`⁨${e}⁩`,Xt=e=>new Intl.NumberFormat(E()).format(e),Pp="demo_nanochat_v1",Vc=e=>e.startsWith("demo_"),Pd="chat_demo_nanochat_v1",Tb="chat_demo_nanochat_figures_v1",Rb="chat_demo_nanochat_literature_v1",Dyn={[Pd]:"cpu_end_to_end",[Tb]:"figures",[Rb]:"literature"},sw="cpu-apple-silicon-pipeline-results.md",Lyn={[Pd]:"msg_demo_nanochat_assistant_v1",[Tb]:"msg_demo_nanochat_figures_assistant_v1",[Rb]:"msg_demo_nanochat_literature_assistant_v1"},qz="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class w3 extends Error{constructor(t,r,s){super(t);Ws(this,"currentVersion");Ws(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function aa(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const PL=new WeakMap;async function bi(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new w3(s,a,i.exists)}}catch(i){if(i instanceof w3)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=PL.get(e);if(t&&!Un(t))throw new DOMException("Workspace changed","AbortError");return n}const Dt=(e,n)=>fetch(e,{signal:n}).then(t=>bi(t));async function ma(e,n){const t=Ha(),r=await fetch(e,n);if(!Un(t))throw new DOMException("Workspace changed","AbortError");return PL.set(r,t),r.ok&&mQ(e,t),r}const wt=(e,n,t=!1)=>ma(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>bi(r)),Uu=(e,n)=>ma(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>bi(t)),FL=(e,n)=>ma(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>bi(t)),Iyn=e=>Dt("/api/projects",e).then(n=>n.projects),$yn=e=>Dt("/api/projects/activity",e).then(n=>n.activity),Byn=e=>Dt("/api/settings/ui-state",e),Pyn=(e,n)=>Dt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),Fyn=(e,n,t=!1)=>wt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),Hyn=(e,n=!1)=>wt("/api/settings/ui-state",{workspace:e},n),qyn=e=>wt("/api/settings/ui-state",e),Uyn=(e,n)=>wt("/api/onboarding/complete",{...e,...n}),Gyn=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return Dt(`/api/project-path/status${t}`,n)},Vyn=()=>wt("/api/project-path/pick").then(e=>e.path),Kyn=e=>wt("/api/projects",e),Wyn=(e,n)=>Dt(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),Qyn=e=>Dt("/api/github/account",e),Xyn=(e,n)=>Dt(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),Yyn=(e,n,t)=>Dt(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),Zyn=(e,n)=>Dt(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),Jyn=e=>wt("/api/projects/starter-prompts/prewarm",e),exn=(e,n,t,r,s)=>Dt(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),txn=e=>wt(`/api/projects/${e}/open`).then(n=>n.project),nxn=e=>ma(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}hQ(e)}),rxn=(e,n)=>Dt(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),sxn=(e,n,t)=>Uu(`/api/experiments/${e}/archive`,{direction:n,archived:t}),ixn=(e,n)=>Dt(`/api/projects/${e}/runs`,n).then(t=>t.runs),HL=e=>wt(`/api/runs/${e}/cancel`).then(()=>{}),axn=(e,n)=>Dt(`/api/runs/${e}/log?offset=${n}`),oxn=(e,n)=>Dt(`/api/runs/${e}/diff`,n),cxn=(e,n)=>Dt(`/api/experiments/${e}/diff`,n),Gu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),lxn=(e,n,t={},r)=>Dt(`/api/projects/${e}/file?${Gu(t,new URLSearchParams({path:n}))}`,r),k3=(e,n,t={})=>`/api/projects/${e}/file/raw?${Gu(t,new URLSearchParams({path:n}))}`,uxn=(e,n)=>Dt(`/api/files/abs?path=${encodeURIComponent(e)}`,n),qL=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,_xn=(e,n,t,r)=>FL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),fxn=(e,n,t,r={})=>Uu(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),dxn=(e,n,t={})=>wt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),hxn=(e,n,t={})=>wt(`/api/projects/${e}/file/reveal`,{path:n,sessionId:t.sessionId}),pxn=e=>Dt("/api/latex/engine",e),mxn=(e,n,t={})=>wt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),gxn=e=>Dt("/api/overleaf/settings",e),UL=e=>wt("/api/overleaf/token",{token:e}),vxn=()=>ma("/api/overleaf/token",{method:"DELETE"}).then(e=>bi(e)),GL=(e,n={})=>wt("/api/overleaf/session",{session:e,host:n.host}),bxn=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>bi(e)),yxn=(e={})=>wt("/api/overleaf/session/import",{host:e.host}),xxn=(e,n,t={})=>wt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),wxn=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${Gu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>bi(r)),kxn=(e,n,t={},r)=>Dt(`/api/projects/${e}/file/overleaf?${Gu(t,new URLSearchParams({path:n}))}`,r),Sxn=(e,n,t)=>wt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),Cxn=(e,n,t={})=>ma(`/api/projects/${e}/file/overleaf?${Gu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>bi(r)),Exn=(e,n,t={})=>wt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),Nxn=(e,n,t={},r)=>Dt(`/api/projects/${e}/file/overleaf/status?${Gu(t,new URLSearchParams({path:n}))}`,r),zxn=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${Gu(t,new URLSearchParams({path:n}))}`,jxn=(e,n={},t)=>{const r=Gu(n).toString();return Dt(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Axn=(e,n)=>Dt(`/api/chat/sessions/${e}/worktree`,n),Mb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,Txn=e=>Dt("/api/settings/hf",e),Rxn=e=>wt("/api/settings/hf",{token:e}),Mxn=e=>Dt("/api/settings/tinker",e),Oxn=e=>wt("/api/settings/tinker",{key:e}),Dxn=e=>Dt("/api/update",e),Lxn=()=>wt("/api/update/apply"),Ixn=()=>wt("/api/update/restart"),$xn=e=>wt("/api/update/auto",{enabled:e}),Bxn=(e=!1)=>wt("/api/update/install-cli",{force:e}),Pxn=e=>Dt("/api/settings/k8s",e),Fxn=e=>wt("/api/settings/k8s",e),Hxn=e=>Dt("/api/settings/modal",e),qxn=(e,n)=>wt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Uxn=e=>Dt("/api/settings/env",e).then(n=>n.vars),VL=(e,n)=>wt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Gxn=e=>ma(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>bi(n)).then(n=>n.vars),Vxn=e=>Dt("/api/settings/data-dir",e),Kxn=e=>wt("/api/settings/data-dir/validate",{path:e}),Wxn=e=>wt("/api/settings/data-dir/move",{path:e}),Qxn=e=>Dt("/api/settings/ssh",e),Xxn=e=>wt("/api/settings/ssh",e),Yxn=e=>wt("/api/settings/ssh/default",{host:e}),Zxn=(e,n)=>wt("/api/settings/ssh/preflight",{host:e,container:n}),Jxn=e=>Dt("/api/settings/ssh/config",e),e2n=(e,n)=>FL("/api/settings/ssh/config",{content:e,previousContent:n}),t2n=(e,n)=>Dt(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),n2n=e=>Dt("/_orx/runtime",e),r2n=e=>Dt("/api/remote/sessions",e).then(n=>n.sessions),s2n=(e,n)=>wt("/api/remote/sessions",{host:e,uiPreferences:n}),i2n=e=>wt("/_orx/install",e),a2n=()=>wt("/_orx/reconnect"),KL=()=>wt("/_orx/disconnect"),o2n=()=>wt("/_orx/start-host"),WL=()=>Dt("/_orx/stop-host"),QL=e=>wt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),c2n=e=>Dt("/api/settings/slurm",e),l2n=e=>wt("/api/settings/slurm",e),u2n=e=>Dt("/api/settings/ray",e),_2n=e=>wt("/api/settings/ray",e),f2n=e=>wt("/api/settings/ray/preflight",{address:e??null}),d2n=(e,n)=>Dt(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),h2n=e=>wt("/api/settings/compute/default",e),p2n=e=>Dt("/api/settings/local",e),m2n=e=>Dt("/api/settings/openresearch",e),g2n=(e,n)=>Dt(`/api/projects/${e}/files`,n),v2n=(e,n)=>ma(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>bi(t)),b2n=(e,n,t)=>Uu(`/api/projects/${e}/files`,{path:n,...t}),lf=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,XL=512e3,y2n=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},x2n=(e,n,t)=>fetch(lf(e,n),{signal:t,headers:{Range:`bytes=0-${XL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>y2n(a,Number.isFinite(s)&&s>a.byteLength))}),w2n=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",k2n=(e,n,t)=>fetch(lf(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:w2n(s)?s:"download"}}),S2n=e=>Dt("/api/settings/profile",e),C2n=e=>Dt("/api/settings/lit-sources",e),E2n=e=>wt("/api/settings/lit-sources",e),N2n=e=>Dt("/api/settings/projects",e),YL=(e,n)=>wt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubDefaultPromptSeen:n}}),z2n=(e,n)=>Dt(`/api/projects/${e}/git`,n),j2n=e=>wt(`/api/projects/${e}/git/init`),A2n=e=>wt(`/api/projects/${e}/github`),T2n=e=>wt(`/api/projects/${e}/github/disable`),R2n=e=>Dt("/api/settings/telemetry",e),M2n=e=>wt("/api/settings/telemetry",{enabled:e}),pu=e=>{wt("/api/telemetry/event",e).catch(()=>{})},ZL=e=>{wt("/api/telemetry/locale",{locale:e}).catch(()=>{})};function V1(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??C3(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?Xk():n,r=C3(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const Av="default";function Ob(e,n){var a,o,c;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===Av)?Av:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((c=r[0])==null?void 0:c.id)??null;return{choices:r,defaultId:i}}const S3="default";function JL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:S3,label:UEt(),description:IEt()},...t]:[]}function Tv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=JL(e,n);return s.length===0?S3:t!=null&&s.some(a=>a.id===t)?t:S3}function eI(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=Ob(e,n);return r.length===0?Av:t&&r.some(i=>i.id===t)?t:s}const O2n=e=>Dt("/api/harnesses/setup/commands",e),tI=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return Dt(`/api/harnesses${s}`,t).then(i=>i.harnesses)},D2n=(e,n)=>Dt(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),L2n=(e,n,t,r)=>Dt(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),I2n=e=>Dt("/api/latex-templates",e).then(n=>n.templates),$2n=e=>wt("/api/latex-templates",e).then(n=>n.template),B2n=e=>ma(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>bi(n)),P2n=e=>Dt("/api/user-skills",e),F2n=e=>wt("/api/user-skills",e).then(n=>n.skill),H2n=e=>ma(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>bi(n));function C3(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const q2n=(e,n)=>Dt(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),U2n=e=>Dt("/api/chat/native-sessions",e).then(n=>n.chats),G2n=(e,n)=>wt("/api/chat/native-sessions/import",{projectId:e,harness:n.harness,nativeId:n.nativeId,title:n.title}).then(t=>t.session),V2n=e=>Dt("/api/chat/sessions?scope=all",e).then(n=>n.sessions),K2n=(e,n,t={})=>wt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),W2n=e=>ma(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>bi(n).then(t=>(jb(e),t))),Q2n=(e,n)=>Uu(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),X2n=(e,n)=>Uu(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),Y2n=(e,n)=>Uu(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),Z2n=(e,n)=>Uu(`/api/chat/sessions/${e}`,{goal:n}).then(t=>t.session),J2n=(e,n)=>Uu(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),ewn=(e,n)=>Dt(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),twn=(e,n)=>ma(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>bi(t)),nwn=(e,n)=>wt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),rwn=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,Uz=(e,n,t={},r,s,i,a)=>wt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),swn=e=>wt(`/api/chat/sessions/${e}/compact`,{}),iwn=(e,n)=>wt(`/api/chat/sessions/${e}/shell`,{command:n}),awn=(e,n,t,r={})=>wt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),own=(e,n,t)=>wt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),cwn=(e,n)=>wt(`/api/chat/sessions/${e}/branch`,{leafId:n}),lwn=e=>wt(`/api/chat/sessions/${e}/interrupt`),uwn=(e,n)=>wt(`/api/chat/sessions/${e}/respond`,n);function go(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(E(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function T0(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return NOe({value:Xt(n)});const t=Math.floor(n/60);if(t<60)return yOe({value:Xt(t)});const r=Math.floor(t/60);return r<24?dOe({hours:Xt(r),minutes:Xt(t%60)}):aOe({days:Xt(Math.floor(r/24)),hours:Xt(r%24)})}function nl(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rDt("/api/local-models",e),dwn=e=>wt("/api/local-models/discover",e),hwn=e=>wt("/api/local-models",e),pwn=e=>wt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),mwn=e=>ma(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>bi(n)),Gz=()=>({queryKey:At("getHfSettings"),queryFn:({signal:e})=>Txn(e),staleTime:3e5}),Vz=()=>({queryKey:At("getTinkerSettings"),queryFn:({signal:e})=>Mxn(e),staleTime:3e5}),Kz=()=>({queryKey:At("getK8sSettings"),queryFn:({signal:e})=>Pxn(e),staleTime:3e4}),Wz=()=>({queryKey:At("getModalSettings"),queryFn:({signal:e})=>Hxn(e),staleTime:3e5}),gwn=()=>({queryKey:At("getSlurmSettings"),queryFn:({signal:e})=>c2n(e),staleTime:3e5}),vwn=()=>({queryKey:At("getRaySettings"),queryFn:({signal:e})=>u2n(e),staleTime:3e5}),nI=e=>({queryKey:At("getComputeSettings",e??null),queryFn:({signal:n})=>d2n(e,n),staleTime:3e4}),bwn=()=>({queryKey:At("getLocalMachine"),queryFn:({signal:e})=>p2n(e),staleTime:3e5}),ywn=()=>({queryKey:At("getOpenResearchSettings"),queryFn:({signal:e})=>m2n(e),staleTime:3e4}),xwn=()=>({queryKey:At("getEnvVars"),queryFn:({signal:e})=>Uxn(e),staleTime:3e5}),wwn=()=>({queryKey:At("getDataDir"),queryFn:({signal:e})=>Vxn(e),staleTime:3e5}),rI=()=>({queryKey:At("getSshSettings"),queryFn:({signal:e})=>Qxn(e),staleTime:3e4}),kwn=()=>({queryKey:At("getSshConfig"),queryFn:({signal:e})=>Jxn(e),staleTime:3e5}),Qz=e=>({queryKey:At("getSshMasterStatus",e),queryFn:({signal:n})=>t2n(e,n),staleTime:5e3}),Swn=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>n2n(e),staleTime:2e3}),Cwn=()=>({queryKey:At("listRemoteSessions"),queryFn:({signal:e})=>r2n(e),staleTime:3e4}),Rv=()=>({queryKey:At("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>Ih(n,t,()=>Dxn(e)),staleTime:3e4}),Ewn=()=>({queryKey:At("getProfile"),queryFn:({signal:e})=>S2n(e),staleTime:3e5}),Nwn=()=>({queryKey:At("getLitSources"),queryFn:({signal:e})=>C2n(e),staleTime:3e5}),cS=()=>({queryKey:At("getProjectDefaults"),queryFn:({signal:e})=>N2n(e),staleTime:3e5}),zwn=e=>({queryKey:At("getProjectGitStatus",e),queryFn:({signal:n})=>z2n(e,n),staleTime:3e4}),jwn=()=>({queryKey:At("getTelemetry"),queryFn:({signal:e})=>R2n(e),staleTime:3e5}),sI=()=>({queryKey:At("getHarnessSetupCommands"),queryFn:({signal:e})=>O2n(e),staleTime:1/0}),Du=()=>({queryKey:At("getHarnesses"),queryFn:({signal:e})=>tI(!1,!1,e),staleTime:3e5,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.some(t=>t.accountLoading||t.catalogPending)?1e3:!1}}),Awn=e=>({queryKey:At("getSkills",e??null),queryFn:({signal:n})=>D2n(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),Twn=(e,n,t)=>({queryKey:At("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>L2n(e,n,r,t),staleTime:3e5}),Rwn=()=>({queryKey:At("listLatexTemplates"),queryFn:({signal:e})=>I2n(e),refetchInterval:3e4,staleTime:3e5}),Mwn=()=>({queryKey:At("listUserSkills"),queryFn:({signal:e})=>P2n(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function uf(e=!1,n=!1){const t=Du();if(!e&&!n)return et.fetchQuery(t);await et.cancelQueries(t);const r=await tI(e,n);return Un(t.queryKey)&&et.setQueryData(t.queryKey,r),r}const Own=()=>({queryKey:At("getLocalModels"),queryFn:({signal:e})=>fwn(e),staleTime:3e4}),Fa=e=>({queryKey:At("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>Ih(t,r,async()=>{const s=await q2n(e,n),i=t.getQueryData(r);return s.filter(a=>!_l.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(c=>c.id===a.id))==null?void 0:o.contextUsage)}})},xm),staleTime:3e4}),iI=()=>({queryKey:At("listNativeChats"),queryFn:({signal:e})=>U2n(e),staleTime:0}),Dwn=()=>({queryKey:At("listAllChatSessions"),queryFn:async({signal:e})=>(await V2n(e)).filter(n=>!_l.has(n.id)),staleTime:0}),ol=e=>({queryKey:At("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var h;const s=t.getQueryData(r),i=await Ih(t,r,()=>ewn(e,n),(_,p,m)=>{if(!p)return _;const w=new Set([...m].filter(k=>k.startsWith("message:")).map(k=>k.slice(8)));return{messages:xm(_.messages,p.messages,w,!1),queued:m.has("queued")?p.queued:_.queued,activeLeafId:m.has("branch")||w.size?p.activeLeafId:_.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),c=s!==void 0&&i.messages.some(_=>_.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===_.id)))?[]:(a==null?void 0:a.messages.filter(_=>_.id.startsWith("local-")))??[],u=c.some(_=>_.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...c.filter(_=>!i.messages.some(p=>p.id===_.id))],activeLeafId:a&&(u||!((h=a.activeLeafId)!=null&&h.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Z_="local-",aI="bash";function Xz(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Z_)),n]}function Lwn(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Z_),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:Xz(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Z_}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:aI,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?Xz(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${Z_}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let oI=0;function cI(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}et.getQueryCache().subscribe(e=>{cI(e)&&oI++});const Iwn=e=>et.getQueryCache().subscribe(n=>{cI(n)&&e()}),$wn=()=>oI;function Bwn(e,n){const t=et.getQueryData(Fa(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=et.getQueryData(ol(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function lI(e,n,t=!1){if(n.type==="busy"){ao(et,Fa(e).queryKey,n.sessionId),et.setQueryData(Fa(e).queryKey,c=>c==null?void 0:c.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=ol(n.sessionId);if(_l.has(n.sessionId))return;ao(et,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=et.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=Lwn(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};et.setQueryData(r.queryKey,o)}function Pwn(e,n){const t=!!n&&!_l.has(n??""),r=ut({...ol(n??""),enabled:t,subscribed:t}),s=T.useSyncExternalStore(Iwn,$wn),i=T.useMemo(()=>Bwn(e,n),[e,n,s]),a=Ha()[1],o=T.useCallback(c=>{Un(["workspace",a])&&lI(e,c)},[e,a]);return[i,o,r]}const K1=new Map;function Fwn(e,n){let t=K1.get(e);return t||(t=new Set,K1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&K1.delete(e)}}function Hwn(e){var n;(n=K1.get(e.runId))==null||n.forEach(t=>t(e))}const E3=new Set;function Mv(e){return E3.add(e),()=>{E3.delete(e)}}function Bc(e){E3.forEach(n=>n(e))}const N3=new Set;function qwn(e){return N3.add(e),()=>{N3.delete(e)}}function Pc(){N3.forEach(e=>e())}const z3=new Set;function Uwn(e){return z3.add(e),()=>{z3.delete(e)}}const j3=new Set;function Gwn(e){return j3.add(e),()=>{j3.delete(e)}}function Vwn(){j3.forEach(e=>e())}function Yz(e){z3.forEach(n=>n(e))}const A3=new Set;function uI(e){return A3.add(e),()=>{A3.delete(e)}}function iw(e){A3.forEach(n=>n(e))}const T3=new Set;function Kwn(e){return T3.add(e),()=>{T3.delete(e)}}function Zz(e){T3.forEach(n=>n(e))}const R3=new Set;function Wwn(e){return R3.add(e),()=>{R3.delete(e)}}function Qwn(e){R3.forEach(n=>n(e))}let M3=!0;const O3=new Set;function Xwn(e){return O3.add(e),()=>{O3.delete(e)}}function Jz(){return M3}function ej(e){e!==M3&&(M3=e,O3.forEach(n=>n()))}const Ywn=8e3,Zwn=3e3;function Jwn(e){const n=T.useRef(e);n.current=e,T.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const c=new EventSource("/api/events");t=c,c.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>ej(!1),Ywn)),c.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},Zwn)))},c.onopen=()=>{var h,_;r||(window.clearTimeout(s),s=void 0,ej(!0),a&&(Bc({type:"reconnected"}),Pc(),Yz({harness:"*",authState:"unknown"}),(_=(h=n.current).onReconnect)==null||_.call(h)),a=!0)};const u=h=>{try{return JSON.parse(h.data)}catch{return null}};c.addEventListener("resync.required",()=>{var h,_;Bc({type:"reconnected"}),Pc(),(_=(h=n.current).onReconnect)==null||_.call(h)}),c.addEventListener("run.updated",h=>{const _=u(h);_!=null&&_.run&&(Pc(),n.current.onRun(_.run))}),c.addEventListener("experiment.updated",h=>{var p,m;const _=u(h);_!=null&&_.experiment&&(Pc(),(m=(p=n.current).onExperiment)==null||m.call(p,_.experiment))}),c.addEventListener("project.updated",h=>{var p,m;const _=u(h);_!=null&&_.project&&(Pc(),(m=(p=n.current).onProject)==null||m.call(p,_.project))}),c.addEventListener("files.updated",h=>{var p,m;const _=u(h);_!=null&&_.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,_.projectId))}),c.addEventListener("run.log",h=>{const _=u(h);_!=null&&_.runId&&Hwn(_)}),c.addEventListener("chat.session",h=>{const _=u(h);_!=null&&_.session&&(Pc(),Bc({type:"session",session:_.session}))}),c.addEventListener("chat.session.deleted",h=>{const _=u(h);_!=null&&_.sessionId&&(Pc(),Bc({type:"sessionDeleted",sessionId:_.sessionId}))}),c.addEventListener("chat.message",h=>{const _=u(h);_!=null&&_.message&&(Pc(),Bc({type:"message",sessionId:_.sessionId,message:_.message}))}),c.addEventListener("chat.busy",h=>{const _=u(h);_!=null&&_.sessionId&&(Pc(),Bc({type:"busy",sessionId:_.sessionId,busy:_.busy}))}),c.addEventListener("chat.usage",h=>{const _=u(h);_!=null&&_.sessionId&&_.usage&&Bc({type:"usage",sessionId:_.sessionId,usage:_.usage})}),c.addEventListener("chat.queued",h=>{const _=u(h);_!=null&&_.sessionId&&Bc({type:"queued",sessionId:_.sessionId,items:_.items??[]})}),c.addEventListener("chat.branch",h=>{const _=u(h);_!=null&&_.sessionId&&Bc({type:"branch",sessionId:_.sessionId,activeLeafId:_.activeLeafId??null})}),c.addEventListener("harness.auth",h=>{const _=u(h);_!=null&&_.harness&&_.authState&&Yz(_)}),c.addEventListener("harness.catalog",()=>Vwn()),c.addEventListener("datadir.move.progress",h=>{const _=u(h);_&&iw({type:"progress",..._})}),c.addEventListener("datadir.move.done",h=>{const _=u(h);_&&iw({type:"done",path:_.path,oldPathLeft:_.oldPathLeft})}),c.addEventListener("datadir.move.error",h=>{const _=u(h);_&&iw({type:"error",error:_.error})}),c.addEventListener("update.status",h=>{const _=u(h);_&&Qwn(_)}),c.addEventListener("overleaf.live",h=>{const _=u(h);_!=null&&_.key&&_.status&&Zz({type:"live",key:_.key,status:_.status})}),c.addEventListener("overleaf.pulled",h=>{const _=u(h);_!=null&&_.key&&Array.isArray(_.paths)&&Zz({type:"pulled",key:_.key,paths:_.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const Ov=new Set;function e4n(e){const n=T.useRef(e);n.current=e,T.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return Ov.add(t),()=>{Ov.delete(t)}},[])}const tj={onRun:e=>Ov.forEach(n=>n.onRun(e)),onReconnect:()=>Ov.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},gh=()=>({queryKey:At("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>Ih(n,t,()=>Iyn(e),xm),staleTime:3e4}),t4n=()=>({queryKey:At("listProjectActivity"),queryFn:({signal:e})=>$yn(e),staleTime:3e4}),Cm=()=>({queryKey:At("getUiState"),queryFn:({signal:e})=>Byn(e),staleTime:3e5}),lS=e=>({queryKey:At("getProjectUiState",e),queryFn:({signal:n})=>Pyn(e,n),staleTime:3e5}),d0=(e="")=>({queryKey:At("getProjectPathStatus",e),queryFn:({signal:n})=>Gyn(e,n),staleTime:3e4}),_I=e=>({queryKey:At("searchPapers",e),queryFn:({signal:n})=>Wyn(e,n),staleTime:3e5}),n4n=()=>({queryKey:At("githubAccount"),queryFn:({signal:e})=>Qyn(e),staleTime:3e5}),r4n=e=>({queryKey:At("githubProjectRepoPreview",e),queryFn:({signal:n})=>Xyn(e,n),staleTime:3e4}),nj=(e,n)=>({queryKey:At("repoAccess",e,n),queryFn:({signal:t})=>Yyn(e,n,t),staleTime:3e4}),D3=e=>({queryKey:At("resolvePaper",e),queryFn:({signal:n})=>Zyn(e,n),staleTime:36e5}),s4n=(e,n,t,r)=>({queryKey:At("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>exn(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),Dv=e=>({queryKey:At("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>Ih(t,r,()=>rxn(e,n),xm),staleTime:3e4}),zu=e=>({queryKey:At("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>Ih(t,r,()=>ixn(e,n),xm),staleTime:3e4});function e1(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function rj(){const e=Ha();return Jwn({onRun(n){var r;if(!Un(e))return;const t=(r=et.getQueryData(zu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);ao(et,zu(n.projectId).queryKey,n.id),et.setQueryData(zu(n.projectId).queryKey,s=>e1(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(Da(["getRunDiff"],e,s=>s.queryKey[3]===n.id),Da(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),tj.onRun(n)},onExperiment(n){Un(e)&&(ao(et,Dv(n.projectId).queryKey,n.id),et.setQueryData(Dv(n.projectId).queryKey,t=>e1(t,n)),Da(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),Da(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),Da(["getRunDiff"],e,t=>{var r;return((r=et.getQueryData(zu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Un(e)&&(ao(et,gh().queryKey,n.id),et.setQueryData(gh().queryKey,t=>e1(t,n)))},onArtifacts(n){Un(e)&&(Da(Hk,e,t=>t.queryKey[3]===n),Da(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Un(e)&&(Da(fQ,e),tj.onReconnect())}}),T.useEffect(()=>{let n;const t=qwn(()=>{n??(n=setTimeout(()=>{n=void 0,Da(["listProjectActivity"],e)},100))}),r=uI(c=>{c.type==="done"&&Da(["getDataDir"],e)}),s=Mv(c=>{Un(e)&&(c.type==="session"?ao(et,Fa(c.session.projectId).queryKey,c.session.id):(c.type==="busy"||c.type==="usage")&&ao(et,[...e,"listChatSessions"],c.sessionId),(c.type==="message"||c.type==="queued"||c.type==="branch")&&lI("",c.type==="message"?{type:"upsertMessage",sessionId:c.sessionId,message:c.message}:c.type==="queued"?{type:"setQueued",sessionId:c.sessionId,items:c.items}:{type:"activeLeaf",sessionId:c.sessionId,leafId:c.activeLeafId},!0),c.type==="session"&&!_l.has(c.session.id)?et.setQueryData(Fa(c.session.projectId).queryKey,u=>{if(!u)return;const h=u.find(_=>_.id===c.session.id);return h?e1(u,{...c.session,contextUsage:c.session.contextUsage??h.contextUsage}):[c.session,...u]}):c.type==="sessionDeleted"?jb(c.sessionId):(c.type==="busy"||c.type==="usage")&&et.setQueriesData({queryKey:[...e,"listChatSessions"]},u=>u==null?void 0:u.map(h=>h.id!==c.sessionId?h:c.type==="busy"?{...h,busy:c.busy}:{...h,contextUsage:c.usage})))}),i=Uwn(()=>{Un(e)&&uf(!0).catch(()=>{})}),a=Gwn(()=>{Un(e)&&et.fetchQuery({...Du(),staleTime:0}).catch(()=>{})}),o=Wwn(c=>{Un(e)&&(ao(et,Rv().queryKey),et.setQueryData(Rv().queryKey,c))});return()=>{clearTimeout(n),t(),r(),s(),i(),a(),o()}},[e[1]]),null}const L3=new Set;function fI(e){if(e!==E()){hD(e,{reload:!1}),document.documentElement.lang=e,ZL(e);for(const n of L3)n()}}function i4n(e){return L3.add(e),()=>L3.delete(e)}function Vu(){return T.useSyncExternalStore(i4n,E,E)}const dI="orx:theme";function a4n(){try{const e=localStorage.getItem(dI);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let vh=a4n();const I3=new Set;function o4n(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function uS(){document.documentElement.dataset.theme=o4n(vh)}function hI(e){vh=e;try{localStorage.setItem(dI,e)}catch{}uS();for(const n of I3)n()}function c4n(){return vh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{vh==="system"&&uS()});uS();function l4n(e){return I3.add(e),()=>I3.delete(e)}function pI(){return[T.useSyncExternalStore(l4n,()=>vh,()=>vh),hI]}const u4n=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),mI=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),Lv="-",sj=[],f4n="arbitrary..",d4n=e=>{const n=p4n(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return h4n(a);const o=a.split(Lv),c=o[0]===""&&o.length>1?1:0;return gI(o,c,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const c=r[a],u=t[a];return c?u?u4n(u,c):c:u||sj}return t[a]||sj}}},gI=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=gI(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(Lv):e.slice(n).join(Lv),c=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?f4n+r:void 0})(),p4n=e=>{const{theme:n,classGroups:t}=e;return m4n(t,n)},m4n=(e,n)=>{const t=mI();for(const r in e){const s=e[r];_S(s,t,r,n)}return t},_S=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){v4n(e,n,t);return}if(typeof e=="function"){b4n(e,n,t,r);return}y4n(e,n,t,r)},v4n=(e,n,t)=>{const r=e===""?n:vI(n,e);r.classGroupId=t},b4n=(e,n,t,r)=>{if(x4n(e)){_S(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(_4n(t,e))},y4n=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(Lv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,w4n=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},$3="!",ij=":",k4n=[],aj=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),S4n=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,c=0,u;const h=s.length;for(let k=0;kc?u-c:void 0;return aj(i,m,p,w)};if(n){const s=n+ij,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):aj(k4n,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},C4n=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},E4n=e=>({cache:w4n(e.cacheSize),parseClassName:S4n(e),sortModifiers:C4n(e),postfixLookupClassGroupIds:N4n(e),...d4n(e)}),N4n=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],c=e.trim().split(z4n);let u="";for(let h=c.length-1;h>=0;h-=1){const _=c[h],{isExternal:p,modifiers:m,hasImportantModifier:w,baseClassName:k,maybePostfixModifierPosition:v}=t(_);if(p){u=_+(u.length>0?" "+u:u);continue}let b=!!v,x;if(b){const A=k.substring(0,v);x=r(A);const j=x&&a[x]?r(k):void 0;j&&j!==x&&(x=j,b=!1)}else x=r(k);if(!x){if(!b){u=_+(u.length>0?" "+u:u);continue}if(x=r(k),!x){u=_+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=w?y+$3:y,N=C+x;if(o.indexOf(N)>-1)continue;o.push(N);const z=s(x,b);for(let A=0;A0?" "+u:u)}return u},A4n=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=c=>{const u=n.reduce((h,_)=>_(h),e());return t=E4n(u),r=t.cache.get,s=t.cache.set,i=o,o(c)},o=c=>{const u=r(c);if(u)return u;const h=j4n(c,t);return s(c,h),h};return i=a,(...c)=>i(A4n(...c))},T4n=[],ws=e=>{const n=t=>t[e]||T4n;return n.isThemeGetter=!0,n},yI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,R4n=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,M4n=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,O4n=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,D4n=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,L4n=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,I4n=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ou=e=>R4n.test(e),gn=e=>!!e&&!Number.isNaN(Number(e)),Mo=e=>!!e&&Number.isInteger(Number(e)),aw=e=>e.endsWith("%")&&gn(e.slice(0,-1)),Fc=e=>M4n.test(e),wI=()=>!0,$4n=e=>O4n.test(e)&&!D4n.test(e),fS=()=>!1,B4n=e=>L4n.test(e),P4n=e=>I4n.test(e),F4n=e=>!vt(e)&&!xt(e),H4n=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),q4n=e=>Ku(e,CI,fS),vt=e=>yI.test(e),w_=e=>Ku(e,EI,$4n),cj=e=>Ku(e,Y4n,gn),U4n=e=>Ku(e,zI,wI),G4n=e=>Ku(e,NI,fS),lj=e=>Ku(e,kI,fS),V4n=e=>Ku(e,SI,P4n),t1=e=>Ku(e,jI,B4n),xt=e=>xI.test(e),Fp=e=>Nf(e,EI),K4n=e=>Nf(e,NI),uj=e=>Nf(e,kI),W4n=e=>Nf(e,CI),Q4n=e=>Nf(e,SI),n1=e=>Nf(e,jI,!0),X4n=e=>Nf(e,zI,!0),Ku=(e,n,t)=>{const r=yI.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Nf=(e,n,t=!1)=>{const r=xI.exec(e);return r?r[1]?n(r[1]):t:!1},kI=e=>e==="position"||e==="percentage",SI=e=>e==="image"||e==="url",CI=e=>e==="length"||e==="size"||e==="bg-size",EI=e=>e==="length",Y4n=e=>e==="number",NI=e=>e==="family-name",zI=e=>e==="number"||e==="weight",jI=e=>e==="shadow",_j=()=>{const e=ws("color"),n=ws("font"),t=ws("text"),r=ws("font-weight"),s=ws("tracking"),i=ws("leading"),a=ws("breakpoint"),o=ws("container"),c=ws("spacing"),u=ws("radius"),h=ws("shadow"),_=ws("inset-shadow"),p=ws("text-shadow"),m=ws("drop-shadow"),w=ws("blur"),k=ws("perspective"),v=ws("aspect"),b=ws("ease"),x=ws("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...C(),xt,vt],z=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],j=()=>[xt,vt,c],M=()=>[ou,"full","auto",...j()],D=()=>[Mo,"none","subgrid",xt,vt],I=()=>["auto",{span:["full",Mo,xt,vt]},Mo,xt,vt],B=()=>[Mo,"auto",xt,vt],U=()=>["auto","min","max","fr",xt,vt],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...j()],Z=()=>[ou,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],Y=()=>[ou,"screen","full","dvw","lvw","svw","min","max","fit",...j()],$=()=>[ou,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,xt,vt],F=()=>[...C(),uj,lj,{position:[xt,vt]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],K=()=>["auto","cover","contain",W4n,q4n,{size:[xt,vt]}],ne=()=>[aw,Fp,w_],ae=()=>["","none","full",u,xt,vt],ue=()=>["",gn,Fp,w_],se=()=>["solid","dashed","dotted","double"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[gn,aw,uj,lj],ce=()=>["","none",w,xt,vt],he=()=>["none",gn,xt,vt],be=()=>["none",gn,xt,vt],Re=()=>[gn,xt,vt],Le=()=>[ou,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fc],breakpoint:[Fc],color:[wI],container:[Fc],"drop-shadow":[Fc],ease:["in","out","in-out"],font:[F4n],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fc],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fc],shadow:[Fc],spacing:["px",gn],text:[Fc],"text-shadow":[Fc],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ou,vt,xt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",xt,vt]}],"container-named":[H4n],columns:[{columns:[gn,vt,xt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[Mo,"auto",xt,vt]}],basis:[{basis:[ou,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[gn,ou,"auto","initial","none",vt]}],grow:[{grow:["",gn,xt,vt]}],shrink:[{shrink:["",gn,xt,vt]}],order:[{order:[Mo,"first","last","none",xt,vt]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...$()]}],"min-block-size":[{"min-block":["auto",...$()]}],"max-block-size":[{"max-block":["none",...$()]}],w:[{w:[o,"screen",...Z()]}],"min-w":[{"min-w":[o,"screen","none",...Z()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",t,Fp,w_]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,X4n,U4n]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",aw,vt]}],"font-family":[{font:[K4n,G4n,n]}],"font-features":[{"font-features":[vt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,xt,vt]}],"line-clamp":[{"line-clamp":[gn,"none",xt,cj]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",xt,vt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xt,vt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[gn,"from-font","auto",xt,w_]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[gn,"auto",xt,vt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[Mo,xt,vt]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xt,vt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xt,vt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:K()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mo,xt,vt],radial:["",xt,vt],conic:[Mo,xt,vt]},Q4n,V4n]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[gn,xt,vt]}],"outline-w":[{outline:["",gn,Fp,w_]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",h,n1,t1]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",_,n1,t1]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[gn,w_]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,n1,t1]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[gn,xt,vt]}],"mix-blend":[{"mix-blend":[...G(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":G()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[gn]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[xt,vt]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[gn]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:K()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xt,vt]}],filter:[{filter:["","none",xt,vt]}],blur:[{blur:ce()}],brightness:[{brightness:[gn,xt,vt]}],contrast:[{contrast:[gn,xt,vt]}],"drop-shadow":[{"drop-shadow":["","none",m,n1,t1]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",gn,xt,vt]}],"hue-rotate":[{"hue-rotate":[gn,xt,vt]}],invert:[{invert:["",gn,xt,vt]}],saturate:[{saturate:[gn,xt,vt]}],sepia:[{sepia:["",gn,xt,vt]}],"backdrop-filter":[{"backdrop-filter":["","none",xt,vt]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[gn,xt,vt]}],"backdrop-contrast":[{"backdrop-contrast":[gn,xt,vt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",gn,xt,vt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[gn,xt,vt]}],"backdrop-invert":[{"backdrop-invert":["",gn,xt,vt]}],"backdrop-opacity":[{"backdrop-opacity":[gn,xt,vt]}],"backdrop-saturate":[{"backdrop-saturate":[gn,xt,vt]}],"backdrop-sepia":[{"backdrop-sepia":["",gn,xt,vt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xt,vt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[gn,"initial",xt,vt]}],ease:[{ease:["linear","initial",b,xt,vt]}],delay:[{delay:[gn,xt,vt]}],animate:[{animate:["none",x,xt,vt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,xt,vt]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:Re()}],"skew-x":[{"skew-x":Re()}],"skew-y":[{"skew-y":Re()}],transform:[{transform:[xt,vt,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],zoom:[{zoom:[Mo,xt,vt]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xt,vt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xt,vt]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[gn,Fp,w_,cj]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Z4n=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Cd(e,"cacheSize",n),Cd(e,"prefix",t),Cd(e,"experimentalParseClassName",r),r1(e.theme,i.theme),r1(e.classGroups,i.classGroups),r1(e.conflictingClassGroups,i.conflictingClassGroups),r1(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Cd(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Cd(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),s1(e.theme,s.theme),s1(e.classGroups,s.classGroups),s1(e.conflictingClassGroups,s.conflictingClassGroups),s1(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),B3(e,s,"postfixLookupClassGroups"),B3(e,s,"orderSensitiveModifiers"),e),Cd=(e,n,t)=>{t!==void 0&&(e[n]=t)},r1=(e,n)=>{if(n)for(const t in n)Cd(e,t,n[t])},s1=(e,n)=>{if(n)for(const t in n)B3(e,n,t)},B3=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},J4n=(e,...n)=>typeof e=="function"?oj(_j,e,...n):oj(()=>Z4n(_j(),e),...n),e3n=J4n({extend:{theme:{text:["menu"]}}});function Cs(...e){return e3n(...e)}const t3n={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Vt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:Cs("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",t3n[e],t),...r})}const n3n=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),r3n={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},s3n={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function AI(e,n,t,r){return Cs(n3n,r3n[e],s3n[n],t&&"active",r)}function De({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:AI(n,t,e,r),...s})}function bh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:AI(n,t,e,r),...s})}const i3n=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),a3n={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},o3n={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function TI(e,n,t,r,s){return Cs(i3n,a3n[e],o3n[n],r==="circle"&&"rounded-full",t&&"active",s)}const Pt=T.forwardRef(function({active:n=!1,shape:t="rounded",size:r="default",variant:s="default",className:i,...a},o){return f.jsx("button",{ref:o,className:TI(s,r,n,t,i),...a})});function Bh({active:e=!1,shape:n="rounded",size:t="default",variant:r="default",className:s,...i}){return f.jsx("a",{className:TI(r,t,e,n,s),...i})}const c3n={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Gr({variant:e="default",className:n,...t}){return f.jsx("input",{className:Cs("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",c3n[e],n),...t})}function Cn({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:Cs("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function jt({className:e,...n}){return f.jsx("span",{className:Cs("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function Kr({className:e,...n}){return f.jsx("div",{className:Cs("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const l3n={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function Fd({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:Cs("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:Cs("h-[7px] w-[7px] shrink-0 rounded-full bg-current",l3n[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const u3n=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function RI(e,n){return Cs(u3n,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function dS({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:RI(e,n),...r,children:t??f.jsx("span",{})})}function _3n({checked:e=!1,className:n,...t}){return f.jsx("span",{className:RI(e,n),...t,children:f.jsx("span",{})})}var ri=TO();const f3n=vm(ri);function d3n(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const h3n=e=>{switch(e){case"success":return g3n;case"info":return b3n;case"warning":return v3n;case"error":return y3n;default:return null}},p3n=Array(12).fill(0),m3n=({visible:e,className:n})=>tt.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},tt.createElement("div",{className:"sonner-spinner"},p3n.map((t,r)=>tt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),g3n=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},tt.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),v3n=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},tt.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),b3n=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),y3n=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),x3n=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},tt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),tt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),w3n=()=>{const[e,n]=tt.useState(document.hidden);return tt.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let k3n=1;const S3n=100,fj=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:k3n++};class C3n{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-S3n;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=fj(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],tt.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(N3n(u)&&!u.ok){i=!1;const _=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,w=typeof _=="object"&&!tt.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:p,...w})}else if(u instanceof Error){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,w=typeof _=="object"&&!tt.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:p,...w})}else if(t.success!==void 0){i=!1;const _=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,w=typeof _=="object"&&!tt.isValidElement(_)?_:{message:_};this.create({id:r,type:"success",description:p,...w})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const h=typeof t.error=="function"?await t.error(u):t.error,_=typeof t.description=="function"?await t.description(u):t.description,m=typeof h=="object"&&!tt.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:_,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((u,h)=>o.then(()=>a[0]==="reject"?h(a[1]):u(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(n,t)=>{const r=fj(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Di=new C3n,E3n=(e,n)=>Di.message(e,n),N3n=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",z3n=E3n,j3n=()=>Di.toasts,A3n=()=>Di.getActiveToasts(),T3n=Object.assign(z3n,{success:Di.success,info:Di.info,warning:Di.warning,error:Di.error,custom:Di.custom,message:Di.message,promise:Di.promise,dismiss:Di.dismiss,loading:Di.loading},{getHistory:j3n,getToasts:A3n});d3n("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function i1(e){return e.label!==void 0}const R3n=3,M3n="24px",O3n="16px",dj=4e3,D3n=356,L3n=14,I3n=45,$3n=200;function Oo(...e){return e.filter(Boolean).join(" ")}function B3n(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const P3n=e=>{var n,t,r,s,i,a,o,c,u;const{invert:h,toast:_,unstyled:p,interacting:m,setHeights:w,visibleToasts:k,heights:v,index:b,toasts:x,expanded:y,removeToast:C,defaultRichColors:N,closeButton:z,style:A,cancelButtonStyle:j,actionButtonStyle:M,className:D="",descriptionClassName:I="",duration:B,position:U,gap:H,expandByDefault:Q,classNames:V,icons:Z,closeButtonAriaLabel:Y="Close toast"}=e,[$,L]=tt.useState(null),[F,q]=tt.useState(null),[K,ne]=tt.useState(!1),[ae,ue]=tt.useState(!1),[se,G]=tt.useState(!1),[oe,ce]=tt.useState(!1),[he,be]=tt.useState(!1),[Re,Le]=tt.useState(0),[Ke,Ne]=tt.useState(0),xe=tt.useRef(_.duration||B||dj),rt=tt.useRef(null),Ze=tt.useRef(null),ot=b===0,kt=b+1<=k,qt=_.type,dt=qt??"default",pt=_.dismissible!==!1,Ie=_.className||"",pe=_.descriptionClassName||"",je=tt.useMemo(()=>v.findIndex(Nt=>Nt.toastId===_.id)||0,[v,_.id]),He=tt.useMemo(()=>{var Nt;return(Nt=_.closeButton)!=null?Nt:z},[_.closeButton,z]),st=tt.useMemo(()=>_.duration||B||dj,[_.duration,B]),_t=tt.useRef(0),Ct=tt.useRef(0),bt=tt.useRef(0),Yt=tt.useRef(null),[un,Tt]=U.split("-"),ht=tt.useMemo(()=>v.reduce((Nt,vn,fn)=>fn>=je?Nt:Nt+vn.height,0),[v,je]),mt=w3n(),_n=tt.useMemo(()=>{var Nt;return(Nt=e.swipeDirections)!=null?Nt:B3n(U)},[e.swipeDirections,U]),gs=_.invert||h,br=qt==="loading";Ct.current=tt.useMemo(()=>je*H+ht,[je,ht]),tt.useEffect(()=>{xe.current=st},[st]),tt.useEffect(()=>{ne(!0)},[]),tt.useEffect(()=>{const Nt=Ze.current;if(Nt){const vn=Nt.getBoundingClientRect().height;return Ne(vn),w(fn=>[{toastId:_.id,height:vn,position:_.position},...fn]),()=>w(fn=>fn.filter(hn=>hn.toastId!==_.id))}},[w,_.id]),tt.useLayoutEffect(()=>{if(!K)return;const Nt=Ze.current,vn=Nt.style.height;Nt.style.height="auto";const fn=Nt.getBoundingClientRect().height;Nt.style.height=vn,Ne(fn),w(hn=>hn.find(bn=>bn.toastId===_.id)?hn.map(bn=>bn.toastId===_.id?{...bn,height:fn}:bn):[{toastId:_.id,height:fn,position:_.position},...hn])},[K,_.title,_.description,w,_.id,_.jsx,_.action,_.cancel]);const Kt=tt.useCallback(()=>{ue(!0),Le(Ct.current),w(Nt=>Nt.filter(vn=>vn.toastId!==_.id)),setTimeout(()=>{C(_)},$3n)},[_,C,w,Ct]);tt.useEffect(()=>{if(_.promise&&qt==="loading"||_.duration===1/0||_.type==="loading")return;let Nt;return y||m||mt?(()=>{if(bt.current<_t.current){const hn=new Date().getTime()-_t.current;xe.current=xe.current-hn}bt.current=new Date().getTime()})():(()=>{xe.current!==1/0&&(_t.current=new Date().getTime(),Nt=setTimeout(()=>{_.onAutoClose==null||_.onAutoClose.call(_,_),Kt()},xe.current))})(),()=>clearTimeout(Nt)},[y,m,_,qt,mt,Kt]),tt.useEffect(()=>{_.delete&&(Kt(),_.onDismiss==null||_.onDismiss.call(_,_))},[Kt,_.delete]);function Bn(){var Nt;if(Z!=null&&Z.loading){var vn;return tt.createElement("div",{className:Oo(V==null?void 0:V.loader,_==null||(vn=_.classNames)==null?void 0:vn.loader,"sonner-loader"),"data-visible":qt==="loading"},Z.loading)}return tt.createElement(m3n,{className:Oo(V==null?void 0:V.loader,_==null||(Nt=_.classNames)==null?void 0:Nt.loader),visible:qt==="loading"})}const _r=_.icon||(Z==null?void 0:Z[qt])||h3n(qt);var yr,Wr;return tt.createElement("li",{tabIndex:0,ref:Ze,className:Oo(D,Ie,V==null?void 0:V.toast,_==null||(n=_.classNames)==null?void 0:n.toast,V==null?void 0:V[dt],_==null||(t=_.classNames)==null?void 0:t[dt]),"data-sonner-toast":"","data-rich-colors":(yr=_.richColors)!=null?yr:N,"data-styled":!(_.jsx||_.unstyled||p),"data-mounted":K,"data-promise":!!_.promise,"data-swiped":he,"data-removed":ae,"data-visible":kt,"data-y-position":un,"data-x-position":Tt,"data-index":b,"data-front":ot,"data-swiping":se,"data-dismissible":pt,"data-type":qt,"data-invert":gs,"data-swipe-out":oe,"data-swipe-direction":F,"data-expanded":!!(y||Q&&K),"data-testid":_.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${ae?Re:Ct.current}px`,"--initial-height":Q?"auto":`${Ke}px`,...A,..._.style},onDragEnd:()=>{G(!1),L(null),Yt.current=null},onPointerDown:Nt=>{Nt.button!==2&&(br||!pt||(rt.current=new Date,Le(Ct.current),Nt.target.setPointerCapture(Nt.pointerId),Nt.target.tagName!=="BUTTON"&&(G(!0),Yt.current={x:Nt.clientX,y:Nt.clientY})))},onPointerUp:()=>{var Nt,vn,fn;if(oe||!pt)return;Yt.current=null;const hn=Number(((Nt=Ze.current)==null?void 0:Nt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ir=Number(((vn=Ze.current)==null?void 0:vn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bn=new Date().getTime()-((fn=rt.current)==null?void 0:fn.getTime()),yn=$==="x"?hn:Ir,Pn=Math.abs(yn)/bn;if(($==="x"?_n.includes(hn>0?"right":"left"):_n.includes(Ir>0?"bottom":"top"))&&(Math.abs(yn)>=I3n||Pn>.11)){Le(Ct.current),_.onDismiss==null||_.onDismiss.call(_,_),q($==="x"?hn>0?"right":"left":Ir>0?"down":"up"),Kt(),ce(!0);return}else{var Bt,In;(Bt=Ze.current)==null||Bt.style.setProperty("--swipe-amount-x","0px"),(In=Ze.current)==null||In.style.setProperty("--swipe-amount-y","0px")}be(!1),G(!1),L(null)},onPointerMove:Nt=>{var vn,fn,hn;if(!Yt.current||!pt||((vn=window.getSelection())==null?void 0:vn.toString().length)>0)return;const bn=Nt.clientY-Yt.current.y,yn=Nt.clientX-Yt.current.x;!$&&(Math.abs(yn)>1||Math.abs(bn)>1)&&L(Math.abs(yn)>Math.abs(bn)?"x":"y");let Pn={x:0,y:0};const Et=Bt=>1/(1.5+Math.abs(Bt)/20);if($==="y"){if(_n.includes("top")||_n.includes("bottom"))if(_n.includes("top")&&bn<0||_n.includes("bottom")&&bn>0)Pn.y=bn;else{const Bt=bn*Et(bn);Pn.y=Math.abs(Bt)0)Pn.x=yn;else{const Bt=yn*Et(yn);Pn.x=Math.abs(Bt)0||Math.abs(Pn.y)>0)&&be(!0),(fn=Ze.current)==null||fn.style.setProperty("--swipe-amount-x",`${Pn.x}px`),(hn=Ze.current)==null||hn.style.setProperty("--swipe-amount-y",`${Pn.y}px`)}},He&&!_.jsx&&qt!=="loading"?tt.createElement("button",{"aria-label":Y,"data-disabled":br,"data-close-button":!0,onClick:br||!pt?()=>{}:()=>{Kt(),_.onDismiss==null||_.onDismiss.call(_,_)},className:Oo(V==null?void 0:V.closeButton,_==null||(r=_.classNames)==null?void 0:r.closeButton)},(Wr=Z==null?void 0:Z.close)!=null?Wr:x3n):null,(qt||_.icon||_.promise)&&_.icon!==null&&((Z==null?void 0:Z[qt])!==null||_.icon)?tt.createElement("div",{"data-icon":"",className:Oo(V==null?void 0:V.icon,_==null||(s=_.classNames)==null?void 0:s.icon)},qt==="loading"?_.icon||Bn():_.promise?Bn():null,qt!=="loading"?_r:null):null,tt.createElement("div",{"data-content":"",className:Oo(V==null?void 0:V.content,_==null||(i=_.classNames)==null?void 0:i.content)},tt.createElement("div",{"data-title":"",className:Oo(V==null?void 0:V.title,_==null||(a=_.classNames)==null?void 0:a.title)},_.jsx?_.jsx:typeof _.title=="function"?_.title():_.title),_.description?tt.createElement("div",{"data-description":"",className:Oo(I,pe,V==null?void 0:V.description,_==null||(o=_.classNames)==null?void 0:o.description)},typeof _.description=="function"?_.description():_.description):null),tt.isValidElement(_.cancel)?_.cancel:_.cancel&&i1(_.cancel)?tt.createElement("button",{"data-button":!0,"data-cancel":!0,style:_.cancelButtonStyle||j,onClick:Nt=>{i1(_.cancel)&&pt&&(_.cancel.onClick==null||_.cancel.onClick.call(_.cancel,Nt),Kt())},className:Oo(V==null?void 0:V.cancelButton,_==null||(c=_.classNames)==null?void 0:c.cancelButton)},_.cancel.label):null,tt.isValidElement(_.action)?_.action:_.action&&i1(_.action)?tt.createElement("button",{"data-button":!0,"data-action":!0,style:_.actionButtonStyle||M,onClick:Nt=>{i1(_.action)&&(_.action.onClick==null||_.action.onClick.call(_.action,Nt),!Nt.defaultPrevented&&Kt())},className:Oo(V==null?void 0:V.actionButton,_==null||(u=_.classNames)==null?void 0:u.actionButton)},_.action.label):null)};function hj(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function F3n(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?O3n:M3n;function c(u){["top","right","bottom","left"].forEach(h=>{t[`${a}-${h}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(o)}),t}const H3n=tt.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:h,mobileOffset:_,theme:p="light",richColors:m,duration:w,style:k,visibleToasts:v=R3n,toastOptions:b,dir:x=hj(),gap:y=L3n,icons:C,customAriaLabel:N,containerAriaLabel:z="Notifications"}=n,[A,j]=tt.useState([]),M=tt.useMemo(()=>r?A.filter(ne=>ne.toasterId===r):A.filter(ne=>!ne.toasterId),[A,r]),D=tt.useMemo(()=>Array.from(new Set([i].concat(M.filter(ne=>ne.position).map(ne=>ne.position)))),[M,i]),[I,B]=tt.useState([]),[U,H]=tt.useState(!1),[Q,V]=tt.useState(!1),[Z,Y]=tt.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=tt.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=tt.useRef(null),q=tt.useRef(!1),K=tt.useCallback(ne=>{j(ae=>{var ue;return(ue=ae.find(se=>se.id===ne.id))!=null&&ue.delete||Di.dismiss(ne.id),ae.filter(({id:se})=>se!==ne.id)})},[]);return tt.useEffect(()=>Di.subscribe(ne=>{if(ne.dismiss){requestAnimationFrame(()=>{j(ae=>ae.map(ue=>ue.id===ne.id?{...ue,delete:!0}:ue))});return}setTimeout(()=>{f3n.flushSync(()=>{j(ae=>{const ue=ae.findIndex(se=>se.id===ne.id);return ue!==-1?[...ae.slice(0,ue),{...ae[ue],...ne},...ae.slice(ue+1)]:[ne,...ae]})})})}),[]),tt.useEffect(()=>{if(p!=="system"){Y(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const ne=window.matchMedia("(prefers-color-scheme: dark)");try{ne.addEventListener("change",({matches:ae})=>{Y(ae?"dark":"light")})}catch{ne.addListener(({matches:ue})=>{try{Y(ue?"dark":"light")}catch(se){console.error(se)}})}},[p]),tt.useEffect(()=>{A.length<=1&&H(!1)},[A]),tt.useEffect(()=>{const ne=ae=>{var ue;if(a.length>0&&a.every(oe=>ae[oe]||ae.code===oe)){var G;H(!0),(G=$.current)==null||G.focus()}ae.code==="Escape"&&(document.activeElement===$.current||(ue=$.current)!=null&&ue.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[a]),tt.useEffect(()=>{if($.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,q.current=!1)}},[$.current]),tt.createElement("section",{ref:t,"aria-label":N??`${z} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},D.map((ne,ae)=>{var ue;const[se,G]=ne.split("-");return M.length?tt.createElement("ol",{key:ne,dir:x==="auto"?hj():x,tabIndex:-1,ref:$,className:u,"data-sonner-toaster":!0,"data-sonner-theme":Z,"data-y-position":se,"data-x-position":G,style:{"--front-toast-height":`${((ue=I[0])==null?void 0:ue.height)||0}px`,"--width":`${D3n}px`,"--gap":`${y}px`,...k,...F3n(h,_)},onBlur:oe=>{q.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(q.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||q.current||(q.current=!0,F.current=oe.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{Q||H(!1)},onDragEnd:()=>H(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},M.filter(oe=>!oe.position&&ae===0||oe.position===ne).map((oe,ce)=>{var he,be;return tt.createElement(P3n,{key:oe.id,icons:C,index:ce,toast:oe,defaultRichColors:m,duration:(he=b==null?void 0:b.duration)!=null?he:w,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(be=b==null?void 0:b.closeButton)!=null?be:c,interacting:Q,position:ne,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:K,toasts:M.filter(Re=>Re.position==oe.position),heights:I.filter(Re=>Re.position==oe.position),setHeights:B,expandByDefault:o,gap:y,expanded:U,swipeDirections:n.swipeDirections})})):null}))});function q3n(e){const[n]=pI();return f.jsx(H3n,{theme:n,...e})}function xn(e,n,t){T3n[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function hS({content:e,children:n,className:t}){const r=T.useRef(null),s=T.useRef(null);function i(){const o=r.current,c=s.current;if(!o||!c)return;c.matches(":popover-open")||c.showPopover();const u=o.getBoundingClientRect(),h=c.getBoundingClientRect(),_=Math.max(8,Math.min(u.left+u.width/2-h.width/2,window.innerWidth-h.width-8));c.style.left=`${_}px`,c.style.top=`${Math.max(8,u.top-h.height-6)}px`}function a(){var o,c;(o=r.current)!=null&&o.matches(":hover, :focus")||(c=s.current)==null||c.hidePopover()}return T.useEffect(()=>{const o=()=>{var c;return(c=s.current)==null?void 0:c.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:Cs("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var c;o.key==="Escape"&&((c=s.current)!=null&&c.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const U3n=["button:not([disabled])","input:not([disabled])","textarea:not([disabled])","[tabindex]"].map(e=>`${e}:not([tabindex="-1"])`).join(", ");function Em(e,n,t="[data-initial-focus]"){const r=T.useRef(n);r.current=n,T.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(U3n)];(s.querySelector(t)??a()[0]??s).focus();const o=c=>{if(c.key==="Escape"){if(s.querySelector(":popover-open"))return;c.preventDefault(),c.stopPropagation(),r.current();return}if(c.key!=="Tab")return;const u=a(),h=u[0],_=u.at(-1);!h||!_?(c.preventDefault(),s.focus()):c.shiftKey&&document.activeElement===h?(c.preventDefault(),_.focus()):!c.shiftKey&&document.activeElement===_&&(c.preventDefault(),h.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function MI({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=T.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),c=[];return n.activeTurnCount>0&&c.push(n.activeTurnCount===1?p7t():L7t({count:Xt(n.activeTurnCount)})),n.pendingPermissionCount>0&&c.push(n.pendingPermissionCount===1?FCt():eCt({count:Xt(n.pendingPermissionCount)})),o>0&&c.push(o===1?t7t():w7t({count:Xt(o)})),n.queuedMessageCount>0&&c.push(n.queuedMessageCount===1?c7t():j7t({count:Xt(n.queuedMessageCount)})),n.activeRunCount>0&&c.push(n.activeRunCount===1?WCt():xCt({count:Xt(n.activeRunCount)})),Em(a,s),ri.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":c.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:hCt({host:Ce(e)})}),c.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:OCt()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:c.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(De,{disabled:r,onClick:s,children:cf()}),f.jsx(De,{variant:"danger",disabled:r,onClick:i,children:r?q7t():oCt()})]})]})}),document.body)}/** +स्टोर की एक कॉपी नए स्थान पर बनाई जाएगी और वहीं सक्रिय की जाएगी। सक्रिय रन या चैट स्थानांतरण को रोक सकते हैं।`,G_n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?P_n(e):t==="fa"?F_n(e):t==="ar"?H_n(e):t==="es"?q_n(e):t==="hi"?U_n(e):B_n(e)}),V_n=()=>"Move data here",K_n=()=>"将数据移动到此处",W_n=()=>"انتقال داده به اینجا",Q_n=()=>"نقل البيانات إلى هنا",X_n=()=>"Mover los datos aquí",Y_n=()=>"डेटा यहाँ ले जाएं",Z_n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K_n():t==="fa"?W_n():t==="ar"?Q_n():t==="es"?X_n():t==="hi"?Y_n():V_n()}),J_n=()=>"Moving…",efn=()=>"正在移动…",tfn=()=>"در حال جابه‌جایی…",nfn=()=>"جارٍ النقل…",rfn=()=>"Moviendo…",sfn=()=>"स्थानांतरित हो रहा है…",ifn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?efn():t==="fa"?tfn():t==="ar"?nfn():t==="es"?rfn():t==="hi"?sfn():J_n()}),afn=()=>"Preparing…",ofn=()=>"正在准备…",cfn=()=>"در حال آماده‌سازی…",lfn=()=>"جارٍ التحضير…",ufn=()=>"Preparando…",_fn=()=>"तैयार हो रहा है…",ffn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ofn():t==="fa"?cfn():t==="ar"?lfn():t==="es"?ufn():t==="hi"?_fn():afn()}),dfn=()=>" (same disk, instant)",hfn=()=>"(同一磁盘,可立即完成)",pfn=()=>" (روی همان دیسک، فوری)",mfn=()=>" (القرص نفسه، فوري)",gfn=()=>" (mismo disco, instantáneo)",vfn=()=>" (उसी डिस्क पर, तुरंत)",bfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hfn():t==="fa"?pfn():t==="ar"?mfn():t==="es"?gfn():t==="hi"?vfn():dfn()}),yfn=()=>"default location",xfn=()=>"默认位置",wfn=()=>"محل پیش‌فرض",kfn=()=>"الموقع الافتراضي",Sfn=()=>"ubicación predeterminada",Cfn=()=>"डिफ़ॉल्ट स्थान",Efn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xfn():t==="fa"?wfn():t==="ar"?kfn():t==="es"?Sfn():t==="hi"?Cfn():yfn()}),Nfn=()=>"ORX_DATA_DIR environment variable",zfn=()=>"ORX_DATA_DIR 环境变量",jfn=()=>"متغیر محیطی ORX_DATA_DIR",Afn=()=>"متغيّر البيئة ORX_DATA_DIR",Tfn=()=>"variable de entorno ORX_DATA_DIR",Rfn=()=>"ORX_DATA_DIR एनवायरनमेंट वेरिएबल",Mfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zfn():t==="fa"?jfn():t==="ar"?Afn():t==="es"?Tfn():t==="hi"?Rfn():Nfn()}),Ofn=()=>"your saved setting",Dfn=()=>"已保存的设置",Lfn=()=>"تنظیم ذخیره‌شدهٔ شما",Ifn=()=>"إعدادك المحفوظ",$fn=()=>"tu ajuste guardado",Bfn=()=>"आपकी सेव की गई सेटिंग",Pfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dfn():t==="fa"?Lfn():t==="ar"?Ifn():t==="es"?$fn():t==="hi"?Bfn():Ofn()}),Ffn=()=>"XDG_DATA_HOME",Hfn=()=>"XDG_DATA_HOME",qfn=()=>"XDG_DATA_HOME",Ufn=()=>"XDG_DATA_HOME",Gfn=()=>"XDG_DATA_HOME",Vfn=()=>"XDG_DATA_HOME",Kfn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hfn():t==="fa"?qfn():t==="ar"?Ufn():t==="es"?Gfn():t==="hi"?Vfn():Ffn()}),Wfn=()=>"Verifying…",Qfn=()=>"正在验证…",Xfn=()=>"در حال بررسی…",Yfn=()=>"جارٍ التحقق…",Zfn=()=>"Verificando…",Jfn=()=>"सत्यापित हो रहा है…",edn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qfn():t==="fa"?Xfn():t==="ar"?Yfn():t==="es"?Zfn():t==="hi"?Jfn():Wfn()}),tdn=()=>"Loading…",ndn=()=>"正在加载…",rdn=()=>"در حال بارگیری…",sdn=()=>"جارٍ التحميل…",idn=()=>"Cargando…",adn=()=>"लोड हो रहा है…",odn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ndn():t==="fa"?rdn():t==="ar"?sdn():t==="es"?idn():t==="hi"?adn():tdn()}),cdn=()=>"This sub-agent is no longer available.",ldn=()=>"此子智能体已不可用。",udn=()=>"این عامل فرعی دیگر در دسترس نیست.",_dn=()=>"لم يعد هذا الوكيل الفرعي متاحًا.",fdn=()=>"Este subagente ya no está disponible.",ddn=()=>"यह सब-एजेंट अब उपलब्ध नहीं है।",hdn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ldn():t==="fa"?udn():t==="ar"?_dn():t==="es"?fdn():t==="hi"?ddn():cdn()}),pdn=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,mdn=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,gdn=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,vdn=e=>`${e==null?void 0:e.label} (معاينة؛ انقر نقرًا مزدوجًا أو Command/Control K ثم Enter لإبقائه مفتوحًا)`,bdn=e=>`${e==null?void 0:e.label} (vista previa; doble clic o Comando/Control K y luego Intro para mantenerla abierta)`,ydn=e=>`${e==null?void 0:e.label} (प्रीव्यू; खुला रखने के लिए डबल-क्लिक करें या Command/Control K, फिर Enter दबाएं)`,xdn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?mdn(e):t==="fa"?gdn(e):t==="ar"?vdn(e):t==="es"?bdn(e):t==="hi"?ydn(e):pdn(e)}),wdn=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,kdn=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,Sdn=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,Cdn=e=>`${e==null?void 0:e.label} (انقر نقرًا مزدوجًا أو ⌘/Ctrl+K ثم Enter لإبقائه مفتوحًا)`,Edn=e=>`${e==null?void 0:e.label} (doble clic o ⌘/Ctrl+K Intro para mantenerla abierta)`,Ndn=e=>`${e==null?void 0:e.label} (खुला रखने के लिए डबल-क्लिक करें या ⌘/Ctrl+K फिर Enter दबाएं)`,zdn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?kdn(e):t==="fa"?Sdn(e):t==="ar"?Cdn(e):t==="es"?Edn(e):t==="hi"?Ndn(e):wdn(e)}),jdn=()=>"Alternatively, tell your agent to add a LaTeX template for you.",Adn=()=>"或者,请你的智能体为你添加 LaTeX 模板。",Tdn=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",Rdn=()=>"أو بدلًا من ذلك، اطلب من وكيلك إضافة قالب LaTeX لك.",Mdn=()=>"También puedes pedirle a tu agente que añada una plantilla de LaTeX por ti.",Odn=()=>"या अपने एजेंट से आपके लिए एक LaTeX टेम्पलेट जोड़ने को कहें।",Ddn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Adn():t==="fa"?Tdn():t==="ar"?Rdn():t==="es"?Mdn():t==="hi"?Odn():jdn()}),Ldn=()=>", a repo for training a mini-GPT from scratch.",Idn=()=>",一个从零训练迷你 GPT 的仓库。",$dn=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",Bdn=()=>" لأندريه كارباثي، المخصّص لتدريب نموذج mini-GPT من الصفر.",Pdn=()=>" de Andrej Karpathy, un repositorio para entrenar un mini-GPT desde cero.",Fdn=()=>", स्क्रैच से एक मिनी-GPT ट्रेन करने के लिए एक रिपॉज़िटरी।",Hdn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Idn():t==="fa"?$dn():t==="ar"?Bdn():t==="es"?Pdn():t==="hi"?Fdn():Ldn()}),qdn=()=>"Close",Udn=()=>"关闭",Gdn=()=>"بستن",Vdn=()=>"إغلاق",Kdn=()=>"Cerrar",Wdn=()=>"बंद करें",x3=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Udn():t==="fa"?Gdn():t==="ar"?Vdn():t==="es"?Kdn():t==="hi"?Wdn():qdn()}),Qdn=()=>"Create a new project",Xdn=()=>"新建项目",Ydn=()=>"ایجاد پروژهٔ جدید",Zdn=()=>"إنشاء مشروع جديد",Jdn=()=>"Crear un proyecto nuevo",ehn=()=>"नया प्रोजेक्ट बनाएं",thn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xdn():t==="fa"?Ydn():t==="ar"?Zdn():t==="es"?Jdn():t==="hi"?ehn():Qdn()}),nhn=()=>"Demo project",rhn=()=>"演示项目",shn=()=>"پروژهٔ نمایشی",ihn=()=>"مشروع توضيحي",ahn=()=>"Proyecto de demostración",ohn=()=>"डेमो प्रोजेक्ट",chn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rhn():t==="fa"?shn():t==="ar"?ihn():t==="es"?ahn():t==="hi"?ohn():nhn()}),lhn=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",uhn=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",_hn=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",fhn=()=>"تصفّح محادثات الوكيل والتجارب وعمليات التشغيل والمُخرَجات لترى كيف يتشكّل مشروع على OpenResearch.",dhn=()=>"Explora las conversaciones con el agente, los experimentos, las ejecuciones y los artefactos para ver cómo se construye un proyecto en OpenResearch.",hhn=()=>"यह देखने के लिए एजेंट बातचीत, प्रयोग, रन और आर्टिफ़ैक्ट देखें कि OpenResearch पर एक प्रोजेक्ट कैसे आकार लेता है।",phn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uhn():t==="fa"?_hn():t==="ar"?fhn():t==="es"?dhn():t==="hi"?hhn():lhn()}),mhn=()=>"nanochat",ghn=()=>"nanochat",vhn=()=>"nanochat",bhn=()=>"nanochat",yhn=()=>"nanochat",xhn=()=>"nanochat",whn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ghn():t==="fa"?vhn():t==="ar"?bhn():t==="es"?yhn():t==="hi"?xhn():mhn()}),khn=()=>"Try the demo experiment",Shn=()=>"试试演示实验",Chn=()=>"آزمایش نمایشی را امتحان کنید",Ehn=()=>"جرّب التجربة التوضيحية",Nhn=()=>"Probar el experimento de demostración",zhn=()=>"डेमो प्रयोग आज़माएं",jhn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Shn():t==="fa"?Chn():t==="ar"?Ehn():t==="es"?Nhn():t==="hi"?zhn():khn()}),Ahn=()=>"Couldn’t save your progress. Try again.",Thn=()=>"无法保存进度。请重试。",Rhn=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",Mhn=()=>"تعذّر حفظ تقدّمك. حاول مجددًا.",Ohn=()=>"No se pudo guardar tu progreso. Inténtalo de nuevo.",Dhn=()=>"आपकी प्रगति सेव नहीं हो सकी। फिर से कोशिश करें।",Lhn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Thn():t==="fa"?Rhn():t==="ar"?Mhn():t==="es"?Ohn():t==="hi"?Dhn():Ahn()}),Ihn=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",$hn=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",Bhn=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",Phn=()=>"هذا مشروع توضيحي يبيّن كيف يعمل OpenResearch. يستخدم هذا العرض مستودع",Fhn=()=>"Este es un proyecto de demostración que muestra cómo funciona OpenResearch. Esta demo usa",Hhn=()=>"यह एक डेमो प्रोजेक्ट है जो दिखाता है कि OpenResearch कैसे काम करता है। यह डेमो Andrej Karpathy के",qhn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$hn():t==="fa"?Bhn():t==="ar"?Phn():t==="es"?Fhn():t==="hi"?Hhn():Ihn()}),Uhn=()=>"Welcome to OpenResearch",Ghn=()=>"欢迎使用 OpenResearch",Vhn=()=>"به OpenResearch خوش آمدید",Khn=()=>"مرحبًا بك في OpenResearch",Whn=()=>"Te damos la bienvenida a OpenResearch",Qhn=()=>"OpenResearch में आपका स्वागत है",Xhn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ghn():t==="fa"?Vhn():t==="ar"?Khn():t==="es"?Whn():t==="hi"?Qhn():Uhn()}),Yhn=()=>"All experiments are archived. Turn on Show archived to view them.",Zhn=()=>"所有实验均已归档。开启“显示已归档”即可查看。",Jhn=()=>"همه آزمایش‌ها بایگانی شده‌اند. برای دیدنشان نمایش بایگانی‌شده‌ها را فعال کنید.",epn=()=>"جميع التجارب مؤرشفة. فعّل إظهار المؤرشف لعرضها.",tpn=()=>"Todos los experimentos están archivados. Activa Mostrar archivados para verlos.",npn=()=>"सभी प्रयोग संग्रहीत हैं। उन्हें देखने के लिए संग्रहीत दिखाएँ चालू करें।",rpn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zhn():t==="fa"?Jhn():t==="ar"?epn():t==="es"?tpn():t==="hi"?npn():Yhn()}),spn=()=>"Archive ancestors",ipn=()=>"归档祖先节点",apn=()=>"بایگانی نیاکان",opn=()=>"أرشفة الأسلاف",cpn=()=>"Archivar antepasados",lpn=()=>"पूर्वजों को संग्रहीत करें",upn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ipn():t==="fa"?apn():t==="ar"?opn():t==="es"?cpn():t==="hi"?lpn():spn()}),_pn=()=>"Archive descendants",fpn=()=>"归档后代节点",dpn=()=>"بایگانی نوادگان",hpn=()=>"أرشفة الفروع التابعة",ppn=()=>"Archivar descendientes",mpn=()=>"वंशजों को संग्रहीत करें",gpn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fpn():t==="fa"?dpn():t==="ar"?hpn():t==="es"?ppn():t==="hi"?mpn():_pn()}),vpn=()=>"Manage",bpn=()=>"管理",ypn=()=>"مدیریت",xpn=()=>"إدارة",wpn=()=>"Gestionar",kpn=()=>"प्रबंधित करें",Spn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bpn():t==="fa"?ypn():t==="ar"?xpn():t==="es"?wpn():t==="hi"?kpn():vpn()}),Cpn=e=>`Manage ${e==null?void 0:e.name}`,Epn=e=>`管理 ${e==null?void 0:e.name}`,Npn=e=>`مدیریت ${e==null?void 0:e.name}`,zpn=e=>`إدارة ${e==null?void 0:e.name}`,jpn=e=>`Gestionar ${e==null?void 0:e.name}`,Apn=e=>`${e==null?void 0:e.name} प्रबंधित करें`,Fz=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Epn(e):t==="fa"?Npn(e):t==="ar"?zpn(e):t==="es"?jpn(e):t==="hi"?Apn(e):Cpn(e)}),Tpn=()=>"Archive this experiment",Rpn=()=>"归档此实验",Mpn=()=>"بایگانی این آزمایش",Opn=()=>"أرشفة هذه التجربة",Dpn=()=>"Archivar este experimento",Lpn=()=>"इस प्रयोग को संग्रहीत करें",Ipn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rpn():t==="fa"?Mpn():t==="ar"?Opn():t==="es"?Dpn():t==="hi"?Lpn():Tpn()}),$pn=()=>"Archived",Bpn=()=>"已归档",Ppn=()=>"بایگانی‌شده",Fpn=()=>"مؤرشف",Hpn=()=>"Archivado",qpn=()=>"संग्रहीत",OL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bpn():t==="fa"?Ppn():t==="ar"?Fpn():t==="es"?Hpn():t==="hi"?qpn():$pn()}),Upn=e=>`${e==null?void 0:e.count} archived`,Gpn=e=>`${e==null?void 0:e.count} 个已归档`,Vpn=e=>`${e==null?void 0:e.count} بایگانی‌شده`,Kpn=e=>`${e==null?void 0:e.count} مؤرشفة`,Wpn=e=>`${e==null?void 0:e.count} archivados`,Qpn=e=>`${e==null?void 0:e.count} संग्रहीत`,Xpn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Gpn(e):t==="fa"?Vpn(e):t==="ar"?Kpn(e):t==="es"?Wpn(e):t==="hi"?Qpn(e):Upn(e)}),Ypn=()=>"Baseline",Zpn=()=>"基线",Jpn=()=>"مبنا",e0n=()=>"الأساس",t0n=()=>"Base",n0n=()=>"बेसलाइन",r0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zpn():t==="fa"?Jpn():t==="ar"?e0n():t==="es"?t0n():t==="hi"?n0n():Ypn()}),s0n=()=>"Experiment",i0n=()=>"实验",a0n=()=>"آزمایش",o0n=()=>"تجربة",c0n=()=>"Experimento",l0n=()=>"प्रयोग",Wc=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?i0n():t==="fa"?a0n():t==="ar"?o0n():t==="es"?c0n():t==="hi"?l0n():s0n()}),u0n=e=>`${e==null?void 0:e.count} experiments`,_0n=e=>`${e==null?void 0:e.count} 个实验`,f0n=e=>`${e==null?void 0:e.count} آزمایش`,d0n=e=>`التجارب: ${e==null?void 0:e.count}`,h0n=e=>`${e==null?void 0:e.count} experimentos`,p0n=e=>`${e==null?void 0:e.count} प्रयोग`,m0n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_0n(e):t==="fa"?f0n(e):t==="ar"?d0n(e):t==="es"?h0n(e):t==="hi"?p0n(e):u0n(e)}),g0n=()=>"hidden",v0n=()=>"已隐藏",b0n=()=>"پنهان",y0n=()=>"مخفية",x0n=()=>"ocultos",w0n=()=>"छिपे हुए",k0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v0n():t==="fa"?b0n():t==="ar"?y0n():t==="es"?x0n():t==="hi"?w0n():g0n()}),S0n=()=>"1 experiment",C0n=()=>"1 个实验",E0n=()=>"۱ آزمایش",N0n=()=>"تجربة واحدة",z0n=()=>"1 experimento",j0n=()=>"1 प्रयोग",A0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C0n():t==="fa"?E0n():t==="ar"?N0n():t==="es"?z0n():t==="hi"?j0n():S0n()}),T0n=()=>"Restore archived ancestors",R0n=()=>"恢复已归档的祖先节点",M0n=()=>"بازیابی نیاکان بایگانی‌شده",O0n=()=>"استعادة الأسلاف المؤرشفين",D0n=()=>"Restaurar antepasados archivados",L0n=()=>"संग्रहीत पूर्वजों को पुनर्स्थापित करें",I0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?R0n():t==="fa"?M0n():t==="ar"?O0n():t==="es"?D0n():t==="hi"?L0n():T0n()}),$0n=e=>`Restore ${e==null?void 0:e.count} archived experiments`,B0n=e=>`恢复 ${e==null?void 0:e.count} 个已归档实验`,P0n=e=>`بازیابی ${e==null?void 0:e.count} آزمایش بایگانی‌شده`,F0n=e=>`استعادة ${e==null?void 0:e.count} تجارب مؤرشفة`,H0n=e=>`Restaurar ${e==null?void 0:e.count} experimentos archivados`,q0n=e=>`${e==null?void 0:e.count} संग्रहीत प्रयोग पुनर्स्थापित करें`,U0n=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?B0n(e):t==="fa"?P0n(e):t==="ar"?F0n(e):t==="es"?H0n(e):t==="hi"?q0n(e):$0n(e)}),G0n=()=>"Restore descendants",V0n=()=>"恢复后代节点",K0n=()=>"بازیابی نوادگان",W0n=()=>"استعادة الفروع التابعة",Q0n=()=>"Restaurar descendientes",X0n=()=>"वंशजों को पुनर्स्थापित करें",Y0n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?V0n():t==="fa"?K0n():t==="ar"?W0n():t==="es"?Q0n():t==="hi"?X0n():G0n()}),Z0n=()=>"Restore this experiment",J0n=()=>"恢复此实验",emn=()=>"بازیابی این آزمایش",tmn=()=>"استعادة هذه التجربة",nmn=()=>"Restaurar este experimento",rmn=()=>"इस प्रयोग को पुनर्स्थापित करें",DL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J0n():t==="fa"?emn():t==="ar"?tmn():t==="es"?nmn():t==="hi"?rmn():Z0n()}),smn=()=>"Running",imn=()=>"运行中",amn=()=>"در حال اجرا",omn=()=>"قيد التشغيل",cmn=()=>"En ejecución",lmn=()=>"चल रहा है",umn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?imn():t==="fa"?amn():t==="ar"?omn():t==="es"?cmn():t==="hi"?lmn():smn()}),_mn=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",fmn=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",dmn=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",hmn=()=>"اطلب في هذه المهمة إنشاء واحدة، أو بدّل إلى «المشروع بالكامل» لرؤية جميع التجارب.",pmn=()=>"Pide en esta tarea que se cree uno, o cambia a Todo el proyecto para ver todos los experimentos.",mmn=()=>"इस टास्क में एक बनाने को कहें, या सभी प्रयोग देखने के लिए पूरा प्रोजेक्ट पर स्विच करें।",gmn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fmn():t==="fa"?dmn():t==="ar"?hmn():t==="es"?pmn():t==="hi"?mmn():_mn()}),vmn=()=>"Ask the agent in chat to create and run your first experiment.",bmn=()=>"在聊天中让智能体创建并运行你的第一个实验。",ymn=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",xmn=()=>"اطلب من الوكيل في المحادثة إنشاء أول تجربة لك وتشغيلها.",wmn=()=>"Pídele al agente en el chat que cree y ejecute tu primer experimento.",kmn=()=>"एजेंट से चैट में अपना पहला प्रयोग बनाने और चलाने को कहें।",Smn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bmn():t==="fa"?ymn():t==="ar"?xmn():t==="es"?wmn():t==="hi"?kmn():vmn()}),Cmn=()=>"Code",Emn=()=>"代码",Nmn=()=>"کد",zmn=()=>"الشيفرة",jmn=()=>"Código",Amn=()=>"कोड",Tmn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Emn():t==="fa"?Nmn():t==="ar"?zmn():t==="es"?jmn():t==="hi"?Amn():Cmn()}),Rmn=()=>"Logs",Mmn=()=>"日志",Omn=()=>"گزارش‌ها",Dmn=()=>"السجلات",Lmn=()=>"Logs",Imn=()=>"लॉग",LL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mmn():t==="fa"?Omn():t==="ar"?Dmn():t==="es"?Lmn():t==="hi"?Imn():Rmn()}),$mn=()=>"No experiments from the current task yet",Bmn=()=>"当前任务尚无实验",Pmn=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",Fmn=()=>"لا توجد تجارب من المهمة الحالية بعد",Hmn=()=>"Aún no hay experimentos de la tarea actual",qmn=()=>"मौजूदा टास्क से अभी तक कोई प्रयोग नहीं",Umn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bmn():t==="fa"?Pmn():t==="ar"?Fmn():t==="es"?Hmn():t==="hi"?qmn():$mn()}),Gmn=()=>"No experiments yet",Vmn=()=>"尚无实验",Kmn=()=>"هنوز آزمایشی وجود ندارد",Wmn=()=>"لا توجد تجارب بعد",Qmn=()=>"Aún no hay experimentos",Xmn=()=>"अभी तक कोई प्रयोग नहीं",Ymn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vmn():t==="fa"?Kmn():t==="ar"?Wmn():t==="es"?Qmn():t==="hi"?Xmn():Gmn()}),Zmn=()=>"no runs",Jmn=()=>"无运行",egn=()=>"بدون اجرا",tgn=()=>"لا عمليات تشغيل",ngn=()=>"sin ejecuciones",rgn=()=>"कोई रन नहीं",sgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jmn():t==="fa"?egn():t==="ar"?tgn():t==="es"?ngn():t==="hi"?rgn():Zmn()}),ign=()=>"Open logs",agn=()=>"打开日志",ogn=()=>"باز کردن گزارش‌ها",cgn=()=>"فتح السجلات",lgn=()=>"Abrir logs",ugn=()=>"लॉग खोलें",_gn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?agn():t==="fa"?ogn():t==="ar"?cgn():t==="es"?lgn():t==="hi"?ugn():ign()}),fgn=()=>"Runs",dgn=()=>"运行",hgn=()=>"اجراها",pgn=()=>"عمليات التشغيل",mgn=()=>"Ejecuciones",ggn=()=>"रन",vgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dgn():t==="fa"?hgn():t==="ar"?pgn():t==="es"?mgn():t==="hi"?ggn():fgn()}),bgn=()=>"Switch to Entire project to see all experiments",ygn=()=>"切换到“整个项目”以查看所有实验",xgn=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",wgn=()=>"بدّل إلى «المشروع بالكامل» لرؤية جميع التجارب",kgn=()=>"Cambia a Todo el proyecto para ver todos los experimentos",Sgn=()=>"सभी प्रयोग देखने के लिए पूरा प्रोजेक्ट पर स्विच करें",Cgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ygn():t==="fa"?xgn():t==="ar"?wgn():t==="es"?kgn():t==="hi"?Sgn():bgn()}),Egn=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,Ngn=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,zgn=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,jgn=e=>`تم التحديث إلى ${e==null?void 0:e.version}. أعد التشغيل لاستخدامه.`,Agn=e=>`Actualizado a la versión ${e==null?void 0:e.version}. Reinicia para usarla.`,Tgn=e=>`${e==null?void 0:e.version} पर अपडेट हुआ। इस्तेमाल के लिए फिर से शुरू करें।`,Rgn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ngn(e):t==="fa"?zgn(e):t==="ar"?jgn(e):t==="es"?Agn(e):t==="hi"?Tgn(e):Egn(e)}),Mgn=()=>"Dismiss",Ogn=()=>"关闭",Dgn=()=>"بستن",Lgn=()=>"تجاهل",Ign=()=>"Descartar",$gn=()=>"खारिज करें",Bgn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ogn():t==="fa"?Dgn():t==="ar"?Lgn():t==="es"?Ign():t==="hi"?$gn():Mgn()}),Pgn=()=>"Restart now",Fgn=()=>"立即重新启动",Hgn=()=>"هم‌اکنون دوباره راه‌اندازی کن",qgn=()=>"أعد التشغيل الآن",Ugn=()=>"Reiniciar ahora",Ggn=()=>"अभी फिर से शुरू करें",IL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fgn():t==="fa"?Hgn():t==="ar"?qgn():t==="es"?Ugn():t==="hi"?Ggn():Pgn()}),Vgn=e=>`Could not restart: ${e==null?void 0:e.error}`,Kgn=e=>`无法重新启动:${e==null?void 0:e.error}`,Wgn=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,Qgn=e=>`تعذّرت إعادة التشغيل: ${e==null?void 0:e.error}`,Xgn=e=>`No se pudo reiniciar: ${e==null?void 0:e.error}`,Ygn=e=>`फिर से शुरू नहीं हो सका: ${e==null?void 0:e.error}`,$L=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Kgn(e):t==="fa"?Wgn(e):t==="ar"?Qgn(e):t==="es"?Xgn(e):t==="hi"?Ygn(e):Vgn(e)}),Zgn=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",Jgn=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",e1n=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",t1n=()=>"لم يعد OpenResearch المحدَّث في الوقت المناسب. أعد تشغيله يدويًا.",n1n=()=>"La nueva versión de OpenResearch no se inició a tiempo. Reinícialo manualmente.",r1n=()=>"अपडेट किया गया OpenResearch समय पर वापस नहीं आया। इसे खुद फिर से शुरू करें।",s1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jgn():t==="fa"?e1n():t==="ar"?t1n():t==="es"?n1n():t==="hi"?r1n():Zgn()}),i1n=()=>"Restarting…",a1n=()=>"正在重新启动…",o1n=()=>"در حال راه‌اندازی مجدد…",c1n=()=>"جارٍ إعادة التشغيل…",l1n=()=>"Reiniciando…",u1n=()=>"फिर से शुरू हो रहा है…",BL=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a1n():t==="fa"?o1n():t==="ar"?c1n():t==="es"?l1n():t==="hi"?u1n():i1n()}),_1n=()=>"macOS app",f1n=()=>"macOS 应用",d1n=()=>"برنامهٔ macOS",h1n=()=>"تطبيق macOS",p1n=()=>"App de macOS",m1n=()=>"macOS ऐप",g1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f1n():t==="fa"?d1n():t==="ar"?h1n():t==="es"?p1n():t==="hi"?m1n():_1n()}),v1n=()=>"Linux app (AppImage)",b1n=()=>"Linux 应用(AppImage)",y1n=()=>"برنامه لینوکس (AppImage)",x1n=()=>"تطبيق Linux ‏(AppImage)",w1n=()=>"Aplicación para Linux (AppImage)",k1n=()=>"Linux ऐप (AppImage)",S1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b1n():t==="fa"?y1n():t==="ar"?x1n():t==="es"?w1n():t==="hi"?k1n():v1n()}),C1n=()=>"Installed with cargo",E1n=()=>"通过 cargo 安装",N1n=()=>"نصب‌شده با cargo",z1n=()=>"مثبّت عبر cargo",j1n=()=>"Instalado con cargo",A1n=()=>"cargo से इंस्टॉल किया गया",T1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?E1n():t==="fa"?N1n():t==="ar"?z1n():t==="es"?j1n():t==="hi"?A1n():C1n()}),R1n=()=>"Installed with Homebrew",M1n=()=>"通过 Homebrew 安装",O1n=()=>"نصب‌شده با Homebrew",D1n=()=>"مثبّت عبر Homebrew",L1n=()=>"Instalado con Homebrew",I1n=()=>"Homebrew से इंस्टॉल किया गया",$1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M1n():t==="fa"?O1n():t==="ar"?D1n():t==="es"?L1n():t==="hi"?I1n():R1n()}),B1n=()=>"Installed with the orx installer",P1n=()=>"通过 orx 安装程序安装",F1n=()=>"نصب‌شده با نصب‌کنندهٔ orx",H1n=()=>"مثبّت عبر مُثبّت orx",q1n=()=>"Instalado con el instalador de orx",U1n=()=>"orx इंस्टॉलर से इंस्टॉल किया गया",G1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P1n():t==="fa"?F1n():t==="ar"?H1n():t==="es"?q1n():t==="hi"?U1n():B1n()}),V1n=()=>"Managed by Nix",K1n=()=>"由 Nix 管理",W1n=()=>"مدیریت‌شده با Nix",Q1n=()=>"مُدار بواسطة Nix",X1n=()=>"Gestionado por Nix",Y1n=()=>"Nix द्वारा प्रबंधित",Z1n=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K1n():t==="fa"?W1n():t==="ar"?Q1n():t==="es"?X1n():t==="hi"?Y1n():V1n()}),J1n=()=>"Portable orx.exe",evn=()=>"便携版 orx.exe",tvn=()=>"orx.exe قابل‌حمل",nvn=()=>"‏orx.exe المحمول",rvn=()=>"orx.exe portable",svn=()=>"पोर्टेबल orx.exe",ivn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?evn():t==="fa"?tvn():t==="ar"?nvn():t==="es"?rvn():t==="hi"?svn():J1n()}),avn=()=>"Unknown install",ovn=()=>"未知安装方式",cvn=()=>"روش نصب نامشخص",lvn=()=>"تثبيت غير معروف",uvn=()=>"Instalación desconocida",_vn=()=>"अज्ञात इंस्टॉल",fvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ovn():t==="fa"?cvn():t==="ar"?lvn():t==="es"?uvn():t==="hi"?_vn():avn()}),dvn=()=>"Re-run your cargo install to update.",hvn=()=>"重新运行 cargo 安装命令以更新。",pvn=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",mvn=()=>"أعِد تنفيذ أمر cargo install للتحديث.",gvn=()=>"Vuelve a ejecutar cargo install para actualizar.",vvn=()=>"अपडेट करने के लिए अपना cargo install फिर से चलाएं।",bvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hvn():t==="fa"?pvn():t==="ar"?mvn():t==="es"?gvn():t==="hi"?vvn():dvn()}),yvn=()=>"Run brew upgrade to update.",xvn=()=>"运行 brew upgrade 以更新。",wvn=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",kvn=()=>"نفّذ brew upgrade للتحديث.",Svn=()=>"Ejecuta brew upgrade para actualizar.",Cvn=()=>"अपडेट करने के लिए brew upgrade चलाएं।",Evn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xvn():t==="fa"?wvn():t==="ar"?kvn():t==="es"?Svn():t==="hi"?Cvn():yvn()}),Nvn=()=>"Update it through your Nix configuration.",zvn=()=>"通过 Nix 配置进行更新。",jvn=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Avn=()=>"حدّثه عبر إعداد Nix الخاص بك.",Tvn=()=>"Actualízalo desde tu configuración de Nix.",Rvn=()=>"इसे अपने Nix कॉन्फ़िगरेशन के ज़रिए अपडेट करें।",Mvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zvn():t==="fa"?jvn():t==="ar"?Avn():t==="es"?Tvn():t==="hi"?Rvn():Nvn()}),Ovn=()=>"Active Experiments",Dvn=()=>"活跃实验",Lvn=()=>"آزمایش‌های فعال",Ivn=()=>"التجارب النشطة",$vn=()=>"Experimentos activos",Bvn=()=>"सक्रिय प्रयोग",Pvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dvn():t==="fa"?Lvn():t==="ar"?Ivn():t==="es"?$vn():t==="hi"?Bvn():Ovn()}),Fvn=()=>"Default compute",Hvn=()=>"默认计算目标",qvn=()=>"محاسبات پیش‌فرض",Uvn=()=>"الحوسبة الافتراضية",Gvn=()=>"Cómputo predeterminado",Vvn=()=>"डिफ़ॉल्ट कंप्यूट",Kvn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hvn():t==="fa"?qvn():t==="ar"?Uvn():t==="es"?Gvn():t==="hi"?Vvn():Fvn()}),Wvn=()=>"Terminal",Qvn=()=>"终端",Xvn=()=>"ترمینال",Yvn=()=>"الطرفية",Zvn=()=>"Terminal",Jvn=()=>"टर्मिनल",jv=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qvn():t==="fa"?Xvn():t==="ar"?Yvn():t==="es"?Zvn():t==="hi"?Jvn():Wvn()}),ebn=()=>"The terminal disconnected.",tbn=()=>"终端连接已断开。",nbn=()=>"ارتباط ترمینال قطع شد.",rbn=()=>"انقطعت الطرفية.",sbn=()=>"La terminal se desconectó.",ibn=()=>"टर्मिनल डिस्कनेक्ट हो गया।",Hz=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tbn():t==="fa"?nbn():t==="ar"?rbn():t==="es"?sbn():t==="hi"?ibn():ebn()}),abn=e=>`Shell exited with code ${e==null?void 0:e.code}.`,obn=e=>`Shell 已退出,退出码 ${e==null?void 0:e.code}。`,cbn=e=>`پوسته با کد ${e==null?void 0:e.code} خارج شد.`,lbn=e=>`انتهى Shell برمز الخروج ${e==null?void 0:e.code}.`,ubn=e=>`El shell terminó con el código ${e==null?void 0:e.code}.`,_bn=e=>`शेल कोड ${e==null?void 0:e.code} के साथ बंद हो गया।`,fbn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?obn(e):t==="fa"?cbn(e):t==="ar"?lbn(e):t==="es"?ubn(e):t==="hi"?_bn(e):abn(e)}),dbn=()=>"Restart shell",hbn=()=>"重新启动 Shell",pbn=()=>"راه‌اندازی دوباره پوسته",mbn=()=>"إعادة تشغيل Shell",gbn=()=>"Reiniciar shell",vbn=()=>"शेल फिर से शुरू करें",bbn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hbn():t==="fa"?pbn():t==="ar"?mbn():t==="es"?gbn():t==="hi"?vbn():dbn()}),ybn=()=>"This worktree",xbn=()=>"当前工作树",wbn=()=>"این درخت کاری",kbn=()=>"شجرة العمل هذه",Sbn=()=>"Este árbol de trabajo",Cbn=()=>"यह वर्कट्री",Ebn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xbn():t==="fa"?wbn():t==="ar"?kbn():t==="es"?Sbn():t==="hi"?Cbn():ybn()}),Nbn=()=>"Workspace",zbn=()=>"工作区",jbn=()=>"فضای کاری",Abn=()=>"مساحة العمل",Tbn=()=>"Espacio de trabajo",Rbn=()=>"वर्कस्पेस",rw=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zbn():t==="fa"?jbn():t==="ar"?Abn():t==="es"?Tbn():t==="hi"?Rbn():Nbn()}),Mbn=e=>`Current worktree · ${e==null?void 0:e.branch}`,Obn=e=>`当前工作树 · ${e==null?void 0:e.branch}`,Dbn=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,Lbn=e=>`شجرة العمل الحالية · ${e==null?void 0:e.branch}`,Ibn=e=>`Árbol de trabajo actual · ${e==null?void 0:e.branch}`,$bn=e=>`मौजूदा वर्कट्री · ${e==null?void 0:e.branch}`,Bbn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Obn(e):t==="fa"?Dbn(e):t==="ar"?Lbn(e):t==="es"?Ibn(e):t==="hi"?$bn(e):Mbn(e)}),Pbn=e=>`Default branch · ${e==null?void 0:e.branch}`,Fbn=e=>`默认分支 · ${e==null?void 0:e.branch}`,Hbn=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,qbn=e=>`الفرع الافتراضي · ${e==null?void 0:e.branch}`,Ubn=e=>`Rama predeterminada · ${e==null?void 0:e.branch}`,Gbn=e=>`डिफ़ॉल्ट ब्रांच · ${e==null?void 0:e.branch}`,Vbn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Fbn(e):t==="fa"?Hbn(e):t==="ar"?qbn(e):t==="es"?Ubn(e):t==="hi"?Gbn(e):Pbn(e)}),Kbn=e=>`detached at ${e==null?void 0:e.branch}`,Wbn=e=>`分离于 ${e==null?void 0:e.branch}`,Qbn=e=>`جدا در ${e==null?void 0:e.branch}`,Xbn=e=>`منفصل عند ${e==null?void 0:e.branch}`,Ybn=e=>`desacoplado en ${e==null?void 0:e.branch}`,Zbn=e=>`${e==null?void 0:e.branch} पर डिटैच्ड`,Jbn=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Wbn(e):t==="fa"?Qbn(e):t==="ar"?Xbn(e):t==="es"?Ybn(e):t==="hi"?Zbn(e):Kbn(e)}),eyn=()=>"Listing truncated.",tyn=()=>"列表已截断。",nyn=()=>"فهرست کوتاه شده است.",ryn=()=>"القائمة مقتطعة.",syn=()=>"Listado truncado.",iyn=()=>"सूची छोटी की गई।",ayn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tyn():t==="fa"?nyn():t==="ar"?ryn():t==="es"?syn():t==="hi"?iyn():eyn()}),oyn=()=>"Loading…",cyn=()=>"正在加载…",lyn=()=>"در حال بارگیری…",uyn=()=>"جارٍ التحميل…",_yn=()=>"Cargando…",fyn=()=>"लोड हो रहा है…",dyn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cyn():t==="fa"?lyn():t==="ar"?uyn():t==="es"?_yn():t==="hi"?fyn():oyn()}),hyn=()=>"No changes yet.",pyn=()=>"尚无更改。",myn=()=>"هنوز تغییری وجود ندارد.",gyn=()=>"لا توجد تغييرات بعد.",vyn=()=>"Aún no hay cambios.",byn=()=>"अभी तक कोई बदलाव नहीं।",yyn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pyn():t==="fa"?myn():t==="ar"?gyn():t==="es"?vyn():t==="hi"?byn():hyn()}),xyn=()=>"No files.",wyn=()=>"没有文件。",kyn=()=>"فایلی وجود ندارد.",Syn=()=>"لا توجد ملفات.",Cyn=()=>"No hay archivos.",Eyn=()=>"कोई फ़ाइल नहीं।",Nyn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wyn():t==="fa"?kyn():t==="ar"?Syn():t==="es"?Cyn():t==="hi"?Eyn():xyn()}),zyn=()=>"Refresh failed:",jyn=()=>"刷新失败:",Ayn=()=>"تازه‌سازی ناموفق بود:",Tyn=()=>"فشل التحديث:",Ryn=()=>"Error al actualizar:",Myn=()=>"रीफ़्रेश विफल:",Oyn=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jyn():t==="fa"?Ayn():t==="ar"?Tyn():t==="es"?Ryn():t==="hi"?Myn():zyn()}),Ce=e=>`⁦${e}⁩`,na=e=>`⁨${e}⁩`,Xt=e=>new Intl.NumberFormat(E()).format(e),Pp="demo_nanochat_v1",Vc=e=>e.startsWith("demo_"),Pd="chat_demo_nanochat_v1",Tb="chat_demo_nanochat_figures_v1",Rb="chat_demo_nanochat_literature_v1",Dyn={[Pd]:"cpu_end_to_end",[Tb]:"figures",[Rb]:"literature"},sw="cpu-apple-silicon-pipeline-results.md",Lyn={[Pd]:"msg_demo_nanochat_assistant_v1",[Tb]:"msg_demo_nanochat_figures_assistant_v1",[Rb]:"msg_demo_nanochat_literature_assistant_v1"},qz="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class w3 extends Error{constructor(t,r,s){super(t);Ws(this,"currentVersion");Ws(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function aa(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const PL=new WeakMap;async function bi(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new w3(s,a,i.exists)}}catch(i){if(i instanceof w3)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=PL.get(e);if(t&&!Un(t))throw new DOMException("Workspace changed","AbortError");return n}const Dt=(e,n)=>fetch(e,{signal:n}).then(t=>bi(t));async function ma(e,n){const t=Ha(),r=await fetch(e,n);if(!Un(t))throw new DOMException("Workspace changed","AbortError");return PL.set(r,t),r.ok&&mQ(e,t),r}const wt=(e,n,t=!1)=>ma(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>bi(r)),Uu=(e,n)=>ma(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>bi(t)),FL=(e,n)=>ma(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>bi(t)),Iyn=e=>Dt("/api/projects",e).then(n=>n.projects),$yn=e=>Dt("/api/projects/activity",e).then(n=>n.activity),Byn=e=>Dt("/api/settings/ui-state",e),Pyn=(e,n)=>Dt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),Fyn=(e,n,t=!1)=>wt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),Hyn=(e,n=!1)=>wt("/api/settings/ui-state",{workspace:e},n),qyn=e=>wt("/api/settings/ui-state",e),Uyn=(e,n)=>wt("/api/onboarding/complete",{...e,...n}),Gyn=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return Dt(`/api/project-path/status${t}`,n)},Vyn=()=>wt("/api/project-path/pick").then(e=>e.path),Kyn=e=>wt("/api/projects",e),Wyn=(e,n)=>Dt(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),Qyn=e=>Dt("/api/github/account",e),Xyn=(e,n)=>Dt(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),Yyn=(e,n,t)=>Dt(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),Zyn=(e,n)=>Dt(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),Jyn=e=>wt("/api/projects/starter-prompts/prewarm",e),exn=(e,n,t,r,s)=>Dt(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),txn=e=>wt(`/api/projects/${e}/open`).then(n=>n.project),nxn=e=>ma(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}hQ(e)}),rxn=(e,n)=>Dt(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),sxn=(e,n,t)=>Uu(`/api/experiments/${e}/archive`,{direction:n,archived:t}),ixn=(e,n)=>Dt(`/api/projects/${e}/runs`,n).then(t=>t.runs),HL=e=>wt(`/api/runs/${e}/cancel`).then(()=>{}),axn=(e,n)=>Dt(`/api/runs/${e}/log?offset=${n}`),oxn=(e,n)=>Dt(`/api/runs/${e}/diff`,n),cxn=(e,n)=>Dt(`/api/experiments/${e}/diff`,n),Gu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),lxn=(e,n,t={},r)=>Dt(`/api/projects/${e}/file?${Gu(t,new URLSearchParams({path:n}))}`,r),k3=(e,n,t={})=>`/api/projects/${e}/file/raw?${Gu(t,new URLSearchParams({path:n}))}`,uxn=(e,n)=>Dt(`/api/files/abs?path=${encodeURIComponent(e)}`,n),qL=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,_xn=(e,n,t,r)=>FL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),fxn=(e,n,t,r={})=>Uu(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),dxn=(e,n,t={})=>wt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),hxn=(e,n,t={})=>wt(`/api/projects/${e}/file/reveal`,{path:n,sessionId:t.sessionId}),pxn=e=>Dt("/api/latex/engine",e),mxn=(e,n,t={})=>wt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),gxn=e=>Dt("/api/overleaf/settings",e),UL=e=>wt("/api/overleaf/token",{token:e}),vxn=()=>ma("/api/overleaf/token",{method:"DELETE"}).then(e=>bi(e)),GL=(e,n={})=>wt("/api/overleaf/session",{session:e,host:n.host}),bxn=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>bi(e)),yxn=(e={})=>wt("/api/overleaf/session/import",{host:e.host}),xxn=(e,n,t={})=>wt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),wxn=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${Gu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>bi(r)),kxn=(e,n,t={},r)=>Dt(`/api/projects/${e}/file/overleaf?${Gu(t,new URLSearchParams({path:n}))}`,r),Sxn=(e,n,t)=>wt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),Cxn=(e,n,t={})=>ma(`/api/projects/${e}/file/overleaf?${Gu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>bi(r)),Exn=(e,n,t={})=>wt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),Nxn=(e,n,t={},r)=>Dt(`/api/projects/${e}/file/overleaf/status?${Gu(t,new URLSearchParams({path:n}))}`,r),zxn=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${Gu(t,new URLSearchParams({path:n}))}`,jxn=(e,n={},t)=>{const r=Gu(n).toString();return Dt(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Axn=(e,n)=>Dt(`/api/chat/sessions/${e}/worktree`,n),Mb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,Txn=e=>Dt("/api/settings/hf",e),Rxn=e=>wt("/api/settings/hf",{token:e}),Mxn=e=>Dt("/api/settings/tinker",e),Oxn=e=>wt("/api/settings/tinker",{key:e}),Dxn=e=>Dt("/api/update",e),Lxn=()=>wt("/api/update/apply"),Ixn=()=>wt("/api/update/restart"),$xn=e=>wt("/api/update/auto",{enabled:e}),Bxn=(e=!1)=>wt("/api/update/install-cli",{force:e}),Pxn=e=>Dt("/api/settings/k8s",e),Fxn=e=>wt("/api/settings/k8s",e),Hxn=e=>Dt("/api/settings/modal",e),qxn=(e,n)=>wt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Uxn=e=>Dt("/api/settings/env",e).then(n=>n.vars),VL=(e,n)=>wt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Gxn=e=>ma(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>bi(n)).then(n=>n.vars),Vxn=e=>Dt("/api/settings/data-dir",e),Kxn=e=>wt("/api/settings/data-dir/validate",{path:e}),Wxn=e=>wt("/api/settings/data-dir/move",{path:e}),Qxn=e=>Dt("/api/settings/ssh",e),Xxn=e=>wt("/api/settings/ssh",e),Yxn=e=>wt("/api/settings/ssh/default",{host:e}),Zxn=(e,n)=>wt("/api/settings/ssh/preflight",{host:e,container:n}),Jxn=e=>Dt("/api/settings/ssh/config",e),e2n=(e,n)=>FL("/api/settings/ssh/config",{content:e,previousContent:n}),t2n=(e,n)=>Dt(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),n2n=e=>Dt("/_orx/runtime",e),r2n=e=>Dt("/api/remote/sessions",e).then(n=>n.sessions),s2n=(e,n)=>wt("/api/remote/sessions",{host:e,uiPreferences:n}),i2n=e=>wt("/_orx/install",e),a2n=()=>wt("/_orx/reconnect"),KL=()=>wt("/_orx/disconnect"),o2n=()=>wt("/_orx/start-host"),WL=()=>Dt("/_orx/stop-host"),QL=e=>wt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),c2n=e=>Dt("/api/settings/slurm",e),l2n=e=>wt("/api/settings/slurm",e),u2n=e=>Dt("/api/settings/ray",e),_2n=e=>wt("/api/settings/ray",e),f2n=e=>wt("/api/settings/ray/preflight",{address:e??null}),d2n=(e,n)=>Dt(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),h2n=e=>wt("/api/settings/compute/default",e),p2n=e=>Dt("/api/settings/local",e),m2n=e=>Dt("/api/settings/openresearch",e),g2n=(e,n)=>Dt(`/api/projects/${e}/files`,n),v2n=(e,n)=>ma(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>bi(t)),b2n=(e,n,t)=>Uu(`/api/projects/${e}/files`,{path:n,...t}),lf=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,XL=512e3,y2n=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},x2n=(e,n,t)=>fetch(lf(e,n),{signal:t,headers:{Range:`bytes=0-${XL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>y2n(a,Number.isFinite(s)&&s>a.byteLength))}),w2n=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",k2n=(e,n,t)=>fetch(lf(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:w2n(s)?s:"download"}}),S2n=e=>Dt("/api/settings/profile",e),C2n=e=>Dt("/api/settings/lit-sources",e),E2n=e=>wt("/api/settings/lit-sources",e),N2n=e=>Dt("/api/settings/projects",e),YL=(e,n)=>wt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubDefaultPromptSeen:n}}),z2n=(e,n)=>Dt(`/api/projects/${e}/git`,n),j2n=e=>wt(`/api/projects/${e}/git/init`),A2n=e=>wt(`/api/projects/${e}/github`),T2n=e=>wt(`/api/projects/${e}/github/disable`),R2n=e=>Dt("/api/settings/telemetry",e),M2n=e=>wt("/api/settings/telemetry",{enabled:e}),pu=e=>{wt("/api/telemetry/event",e).catch(()=>{})},ZL=e=>{wt("/api/telemetry/locale",{locale:e}).catch(()=>{})};function V1(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??C3(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?Xk():n,r=C3(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const Av="default";function Ob(e,n){var a,o,c;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===Av)?Av:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((c=r[0])==null?void 0:c.id)??null;return{choices:r,defaultId:i}}const S3="default";function JL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:S3,label:UEt(),description:IEt()},...t]:[]}function Tv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=JL(e,n);return s.length===0?S3:t!=null&&s.some(a=>a.id===t)?t:S3}function eI(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=Ob(e,n);return r.length===0?Av:t&&r.some(i=>i.id===t)?t:s}const O2n=e=>Dt("/api/harnesses/setup/commands",e),tI=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return Dt(`/api/harnesses${s}`,t).then(i=>i.harnesses)},D2n=(e,n)=>Dt(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),L2n=(e,n,t,r)=>Dt(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),I2n=e=>Dt("/api/latex-templates",e).then(n=>n.templates),$2n=e=>wt("/api/latex-templates",e).then(n=>n.template),B2n=e=>ma(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>bi(n)),P2n=e=>Dt("/api/user-skills",e),F2n=e=>wt("/api/user-skills",e).then(n=>n.skill),H2n=e=>ma(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>bi(n));function C3(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const q2n=(e,n)=>Dt(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),U2n=e=>Dt("/api/chat/native-sessions",e).then(n=>n.chats),G2n=(e,n)=>wt("/api/chat/native-sessions/import",{projectId:e,harness:n.harness,nativeId:n.nativeId,title:n.title}).then(t=>t.session),V2n=e=>Dt("/api/chat/sessions?scope=all",e).then(n=>n.sessions),K2n=(e,n,t={})=>wt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),W2n=e=>ma(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>bi(n).then(t=>(jb(e),t))),Q2n=(e,n)=>Uu(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),X2n=(e,n)=>Uu(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),Y2n=(e,n)=>Uu(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),Z2n=(e,n)=>Uu(`/api/chat/sessions/${e}`,{goal:n}).then(t=>t.session),J2n=(e,n)=>Uu(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),ewn=(e,n)=>Dt(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),twn=(e,n)=>ma(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>bi(t)),nwn=(e,n)=>wt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),rwn=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,Uz=(e,n,t={},r,s,i,a)=>wt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),swn=e=>wt(`/api/chat/sessions/${e}/compact`,{}),iwn=(e,n)=>wt(`/api/chat/sessions/${e}/shell`,{command:n}),awn=(e,n,t,r={})=>wt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),own=(e,n,t)=>wt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),cwn=(e,n)=>wt(`/api/chat/sessions/${e}/branch`,{leafId:n}),lwn=e=>wt(`/api/chat/sessions/${e}/interrupt`),uwn=(e,n)=>wt(`/api/chat/sessions/${e}/respond`,n);function go(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(E(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function T0(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return NOe({value:Xt(n)});const t=Math.floor(n/60);if(t<60)return yOe({value:Xt(t)});const r=Math.floor(t/60);return r<24?dOe({hours:Xt(r),minutes:Xt(t%60)}):aOe({days:Xt(Math.floor(r/24)),hours:Xt(r%24)})}function nl(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rDt("/api/local-models",e),dwn=e=>wt("/api/local-models/discover",e),hwn=e=>wt("/api/local-models",e),pwn=e=>wt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),mwn=e=>ma(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>bi(n)),Gz=()=>({queryKey:At("getHfSettings"),queryFn:({signal:e})=>Txn(e),staleTime:3e5}),Vz=()=>({queryKey:At("getTinkerSettings"),queryFn:({signal:e})=>Mxn(e),staleTime:3e5}),Kz=()=>({queryKey:At("getK8sSettings"),queryFn:({signal:e})=>Pxn(e),staleTime:3e4}),Wz=()=>({queryKey:At("getModalSettings"),queryFn:({signal:e})=>Hxn(e),staleTime:3e5}),gwn=()=>({queryKey:At("getSlurmSettings"),queryFn:({signal:e})=>c2n(e),staleTime:3e5}),vwn=()=>({queryKey:At("getRaySettings"),queryFn:({signal:e})=>u2n(e),staleTime:3e5}),nI=e=>({queryKey:At("getComputeSettings",e??null),queryFn:({signal:n})=>d2n(e,n),staleTime:3e4}),bwn=()=>({queryKey:At("getLocalMachine"),queryFn:({signal:e})=>p2n(e),staleTime:3e5}),ywn=()=>({queryKey:At("getOpenResearchSettings"),queryFn:({signal:e})=>m2n(e),staleTime:3e4}),xwn=()=>({queryKey:At("getEnvVars"),queryFn:({signal:e})=>Uxn(e),staleTime:3e5}),wwn=()=>({queryKey:At("getDataDir"),queryFn:({signal:e})=>Vxn(e),staleTime:3e5}),rI=()=>({queryKey:At("getSshSettings"),queryFn:({signal:e})=>Qxn(e),staleTime:3e4}),kwn=()=>({queryKey:At("getSshConfig"),queryFn:({signal:e})=>Jxn(e),staleTime:3e5}),Qz=e=>({queryKey:At("getSshMasterStatus",e),queryFn:({signal:n})=>t2n(e,n),staleTime:5e3}),Swn=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>n2n(e),staleTime:2e3}),Cwn=()=>({queryKey:At("listRemoteSessions"),queryFn:({signal:e})=>r2n(e),staleTime:3e4}),Rv=()=>({queryKey:At("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>Ih(n,t,()=>Dxn(e)),staleTime:3e4}),Ewn=()=>({queryKey:At("getProfile"),queryFn:({signal:e})=>S2n(e),staleTime:3e5}),Nwn=()=>({queryKey:At("getLitSources"),queryFn:({signal:e})=>C2n(e),staleTime:3e5}),cS=()=>({queryKey:At("getProjectDefaults"),queryFn:({signal:e})=>N2n(e),staleTime:3e5}),zwn=e=>({queryKey:At("getProjectGitStatus",e),queryFn:({signal:n})=>z2n(e,n),staleTime:3e4}),jwn=()=>({queryKey:At("getTelemetry"),queryFn:({signal:e})=>R2n(e),staleTime:3e5}),sI=()=>({queryKey:At("getHarnessSetupCommands"),queryFn:({signal:e})=>O2n(e),staleTime:1/0}),Du=()=>({queryKey:At("getHarnesses"),queryFn:({signal:e})=>tI(!1,!1,e),staleTime:3e5,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.some(t=>t.accountLoading||t.catalogPending)?1e3:!1}}),Awn=e=>({queryKey:At("getSkills",e??null),queryFn:({signal:n})=>D2n(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),Twn=(e,n,t)=>({queryKey:At("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>L2n(e,n,r,t),staleTime:3e5}),Rwn=()=>({queryKey:At("listLatexTemplates"),queryFn:({signal:e})=>I2n(e),refetchInterval:3e4,staleTime:3e5}),Mwn=()=>({queryKey:At("listUserSkills"),queryFn:({signal:e})=>P2n(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function uf(e=!1,n=!1){const t=Du();if(!e&&!n)return et.fetchQuery(t);await et.cancelQueries(t);const r=await tI(e,n);return Un(t.queryKey)&&et.setQueryData(t.queryKey,r),r}const Own=()=>({queryKey:At("getLocalModels"),queryFn:({signal:e})=>fwn(e),staleTime:3e4}),Fa=e=>({queryKey:At("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>Ih(t,r,async()=>{const s=await q2n(e,n),i=t.getQueryData(r);return s.filter(a=>!_l.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(c=>c.id===a.id))==null?void 0:o.contextUsage)}})},xm),staleTime:3e4}),iI=()=>({queryKey:At("listNativeChats"),queryFn:({signal:e})=>U2n(e),staleTime:0}),Dwn=()=>({queryKey:At("listAllChatSessions"),queryFn:async({signal:e})=>(await V2n(e)).filter(n=>!_l.has(n.id)),staleTime:0}),ol=e=>({queryKey:At("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var h;const s=t.getQueryData(r),i=await Ih(t,r,()=>ewn(e,n),(_,p,m)=>{if(!p)return _;const w=new Set([...m].filter(k=>k.startsWith("message:")).map(k=>k.slice(8)));return{messages:xm(_.messages,p.messages,w,!1),queued:m.has("queued")?p.queued:_.queued,activeLeafId:m.has("branch")||w.size?p.activeLeafId:_.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),c=s!==void 0&&i.messages.some(_=>_.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===_.id)))?[]:(a==null?void 0:a.messages.filter(_=>_.id.startsWith("local-")))??[],u=c.some(_=>_.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...c.filter(_=>!i.messages.some(p=>p.id===_.id))],activeLeafId:a&&(u||!((h=a.activeLeafId)!=null&&h.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Z_="local-",aI="bash";function Xz(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Z_)),n]}function Lwn(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Z_),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:Xz(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Z_}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:aI,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?Xz(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${Z_}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let oI=0;function cI(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}et.getQueryCache().subscribe(e=>{cI(e)&&oI++});const Iwn=e=>et.getQueryCache().subscribe(n=>{cI(n)&&e()}),$wn=()=>oI;function Bwn(e,n){const t=et.getQueryData(Fa(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=et.getQueryData(ol(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function lI(e,n,t=!1){if(n.type==="busy"){ao(et,Fa(e).queryKey,n.sessionId),et.setQueryData(Fa(e).queryKey,c=>c==null?void 0:c.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=ol(n.sessionId);if(_l.has(n.sessionId))return;ao(et,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=et.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=Lwn(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};et.setQueryData(r.queryKey,o)}function Pwn(e,n){const t=!!n&&!_l.has(n??""),r=ut({...ol(n??""),enabled:t,subscribed:t}),s=T.useSyncExternalStore(Iwn,$wn),i=T.useMemo(()=>Bwn(e,n),[e,n,s]),a=Ha()[1],o=T.useCallback(c=>{Un(["workspace",a])&&lI(e,c)},[e,a]);return[i,o,r]}const K1=new Map;function Fwn(e,n){let t=K1.get(e);return t||(t=new Set,K1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&K1.delete(e)}}function Hwn(e){var n;(n=K1.get(e.runId))==null||n.forEach(t=>t(e))}const E3=new Set;function Mv(e){return E3.add(e),()=>{E3.delete(e)}}function Bc(e){E3.forEach(n=>n(e))}const N3=new Set;function qwn(e){return N3.add(e),()=>{N3.delete(e)}}function Pc(){N3.forEach(e=>e())}const z3=new Set;function Uwn(e){return z3.add(e),()=>{z3.delete(e)}}const j3=new Set;function Gwn(e){return j3.add(e),()=>{j3.delete(e)}}function Vwn(){j3.forEach(e=>e())}function Yz(e){z3.forEach(n=>n(e))}const A3=new Set;function uI(e){return A3.add(e),()=>{A3.delete(e)}}function iw(e){A3.forEach(n=>n(e))}const T3=new Set;function Kwn(e){return T3.add(e),()=>{T3.delete(e)}}function Zz(e){T3.forEach(n=>n(e))}const R3=new Set;function Wwn(e){return R3.add(e),()=>{R3.delete(e)}}function Qwn(e){R3.forEach(n=>n(e))}let M3=!0;const O3=new Set;function Xwn(e){return O3.add(e),()=>{O3.delete(e)}}function Jz(){return M3}function ej(e){e!==M3&&(M3=e,O3.forEach(n=>n()))}const Ywn=8e3,Zwn=3e3;function Jwn(e){const n=T.useRef(e);n.current=e,T.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const c=new EventSource("/api/events");t=c,c.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>ej(!1),Ywn)),c.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},Zwn)))},c.onopen=()=>{var h,_;r||(window.clearTimeout(s),s=void 0,ej(!0),a&&(Bc({type:"reconnected"}),Pc(),Yz({harness:"*",authState:"unknown"}),(_=(h=n.current).onReconnect)==null||_.call(h)),a=!0)};const u=h=>{try{return JSON.parse(h.data)}catch{return null}};c.addEventListener("resync.required",()=>{var h,_;Bc({type:"reconnected"}),Pc(),(_=(h=n.current).onReconnect)==null||_.call(h)}),c.addEventListener("run.updated",h=>{const _=u(h);_!=null&&_.run&&(Pc(),n.current.onRun(_.run))}),c.addEventListener("experiment.updated",h=>{var p,m;const _=u(h);_!=null&&_.experiment&&(Pc(),(m=(p=n.current).onExperiment)==null||m.call(p,_.experiment))}),c.addEventListener("project.updated",h=>{var p,m;const _=u(h);_!=null&&_.project&&(Pc(),(m=(p=n.current).onProject)==null||m.call(p,_.project))}),c.addEventListener("files.updated",h=>{var p,m;const _=u(h);_!=null&&_.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,_.projectId))}),c.addEventListener("run.log",h=>{const _=u(h);_!=null&&_.runId&&Hwn(_)}),c.addEventListener("chat.session",h=>{const _=u(h);_!=null&&_.session&&(Pc(),Bc({type:"session",session:_.session}))}),c.addEventListener("chat.session.deleted",h=>{const _=u(h);_!=null&&_.sessionId&&(Pc(),Bc({type:"sessionDeleted",sessionId:_.sessionId}))}),c.addEventListener("chat.message",h=>{const _=u(h);_!=null&&_.message&&(Pc(),Bc({type:"message",sessionId:_.sessionId,message:_.message}))}),c.addEventListener("chat.busy",h=>{const _=u(h);_!=null&&_.sessionId&&(Pc(),Bc({type:"busy",sessionId:_.sessionId,busy:_.busy}))}),c.addEventListener("chat.usage",h=>{const _=u(h);_!=null&&_.sessionId&&_.usage&&Bc({type:"usage",sessionId:_.sessionId,usage:_.usage})}),c.addEventListener("chat.queued",h=>{const _=u(h);_!=null&&_.sessionId&&Bc({type:"queued",sessionId:_.sessionId,items:_.items??[]})}),c.addEventListener("chat.branch",h=>{const _=u(h);_!=null&&_.sessionId&&Bc({type:"branch",sessionId:_.sessionId,activeLeafId:_.activeLeafId??null})}),c.addEventListener("harness.auth",h=>{const _=u(h);_!=null&&_.harness&&_.authState&&Yz(_)}),c.addEventListener("harness.catalog",()=>Vwn()),c.addEventListener("datadir.move.progress",h=>{const _=u(h);_&&iw({type:"progress",..._})}),c.addEventListener("datadir.move.done",h=>{const _=u(h);_&&iw({type:"done",path:_.path,oldPathLeft:_.oldPathLeft})}),c.addEventListener("datadir.move.error",h=>{const _=u(h);_&&iw({type:"error",error:_.error})}),c.addEventListener("update.status",h=>{const _=u(h);_&&Qwn(_)}),c.addEventListener("overleaf.live",h=>{const _=u(h);_!=null&&_.key&&_.status&&Zz({type:"live",key:_.key,status:_.status})}),c.addEventListener("overleaf.pulled",h=>{const _=u(h);_!=null&&_.key&&Array.isArray(_.paths)&&Zz({type:"pulled",key:_.key,paths:_.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const Ov=new Set;function e4n(e){const n=T.useRef(e);n.current=e,T.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return Ov.add(t),()=>{Ov.delete(t)}},[])}const tj={onRun:e=>Ov.forEach(n=>n.onRun(e)),onReconnect:()=>Ov.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},gh=()=>({queryKey:At("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>Ih(n,t,()=>Iyn(e),xm),staleTime:3e4}),t4n=()=>({queryKey:At("listProjectActivity"),queryFn:({signal:e})=>$yn(e),staleTime:3e4}),Cm=()=>({queryKey:At("getUiState"),queryFn:({signal:e})=>Byn(e),staleTime:3e5}),lS=e=>({queryKey:At("getProjectUiState",e),queryFn:({signal:n})=>Pyn(e,n),staleTime:3e5}),d0=(e="")=>({queryKey:At("getProjectPathStatus",e),queryFn:({signal:n})=>Gyn(e,n),staleTime:3e4}),_I=e=>({queryKey:At("searchPapers",e),queryFn:({signal:n})=>Wyn(e,n),staleTime:3e5}),n4n=()=>({queryKey:At("githubAccount"),queryFn:({signal:e})=>Qyn(e),staleTime:3e5}),r4n=e=>({queryKey:At("githubProjectRepoPreview",e),queryFn:({signal:n})=>Xyn(e,n),staleTime:3e4}),nj=(e,n)=>({queryKey:At("repoAccess",e,n),queryFn:({signal:t})=>Yyn(e,n,t),staleTime:3e4}),D3=e=>({queryKey:At("resolvePaper",e),queryFn:({signal:n})=>Zyn(e,n),staleTime:36e5}),s4n=(e,n,t,r)=>({queryKey:At("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>exn(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),Dv=e=>({queryKey:At("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>Ih(t,r,()=>rxn(e,n),xm),staleTime:3e4}),zu=e=>({queryKey:At("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>Ih(t,r,()=>ixn(e,n),xm),staleTime:3e4});function e1(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function rj(){const e=Ha();return Jwn({onRun(n){var r;if(!Un(e))return;const t=(r=et.getQueryData(zu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);ao(et,zu(n.projectId).queryKey,n.id),et.setQueryData(zu(n.projectId).queryKey,s=>e1(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(Da(["getRunDiff"],e,s=>s.queryKey[3]===n.id),Da(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),tj.onRun(n)},onExperiment(n){Un(e)&&(ao(et,Dv(n.projectId).queryKey,n.id),et.setQueryData(Dv(n.projectId).queryKey,t=>e1(t,n)),Da(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),Da(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),Da(["getRunDiff"],e,t=>{var r;return((r=et.getQueryData(zu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Un(e)&&(ao(et,gh().queryKey,n.id),et.setQueryData(gh().queryKey,t=>e1(t,n)))},onArtifacts(n){Un(e)&&(Da(Hk,e,t=>t.queryKey[3]===n),Da(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Un(e)&&(Da(fQ,e),tj.onReconnect())}}),T.useEffect(()=>{let n;const t=qwn(()=>{n??(n=setTimeout(()=>{n=void 0,Da(["listProjectActivity"],e)},100))}),r=uI(c=>{c.type==="done"&&Da(["getDataDir"],e)}),s=Mv(c=>{Un(e)&&(c.type==="session"?ao(et,Fa(c.session.projectId).queryKey,c.session.id):(c.type==="busy"||c.type==="usage")&&ao(et,[...e,"listChatSessions"],c.sessionId),(c.type==="message"||c.type==="queued"||c.type==="branch")&&lI("",c.type==="message"?{type:"upsertMessage",sessionId:c.sessionId,message:c.message}:c.type==="queued"?{type:"setQueued",sessionId:c.sessionId,items:c.items}:{type:"activeLeaf",sessionId:c.sessionId,leafId:c.activeLeafId},!0),c.type==="session"&&!_l.has(c.session.id)?et.setQueryData(Fa(c.session.projectId).queryKey,u=>{if(!u)return;const h=u.find(_=>_.id===c.session.id);return h?e1(u,{...c.session,contextUsage:c.session.contextUsage??h.contextUsage}):[c.session,...u]}):c.type==="sessionDeleted"?jb(c.sessionId):(c.type==="busy"||c.type==="usage")&&et.setQueriesData({queryKey:[...e,"listChatSessions"]},u=>u==null?void 0:u.map(h=>h.id!==c.sessionId?h:c.type==="busy"?{...h,busy:c.busy}:{...h,contextUsage:c.usage})))}),i=Uwn(()=>{Un(e)&&uf(!0).catch(()=>{})}),a=Gwn(()=>{Un(e)&&et.fetchQuery({...Du(),staleTime:0}).catch(()=>{})}),o=Wwn(c=>{Un(e)&&(ao(et,Rv().queryKey),et.setQueryData(Rv().queryKey,c))});return()=>{clearTimeout(n),t(),r(),s(),i(),a(),o()}},[e[1]]),null}const L3=new Set;function fI(e){if(e!==E()){hD(e,{reload:!1}),document.documentElement.lang=e,ZL(e);for(const n of L3)n()}}function i4n(e){return L3.add(e),()=>L3.delete(e)}function Vu(){return T.useSyncExternalStore(i4n,E,E)}const dI="orx:theme";function a4n(){try{const e=localStorage.getItem(dI);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let vh=a4n();const I3=new Set;function o4n(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function uS(){document.documentElement.dataset.theme=o4n(vh)}function hI(e){vh=e;try{localStorage.setItem(dI,e)}catch{}uS();for(const n of I3)n()}function c4n(){return vh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{vh==="system"&&uS()});uS();function l4n(e){return I3.add(e),()=>I3.delete(e)}function pI(){return[T.useSyncExternalStore(l4n,()=>vh,()=>vh),hI]}const u4n=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),mI=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),Lv="-",sj=[],f4n="arbitrary..",d4n=e=>{const n=p4n(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return h4n(a);const o=a.split(Lv),c=o[0]===""&&o.length>1?1:0;return gI(o,c,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const c=r[a],u=t[a];return c?u?u4n(u,c):c:u||sj}return t[a]||sj}}},gI=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=gI(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(Lv):e.slice(n).join(Lv),c=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?f4n+r:void 0})(),p4n=e=>{const{theme:n,classGroups:t}=e;return m4n(t,n)},m4n=(e,n)=>{const t=mI();for(const r in e){const s=e[r];_S(s,t,r,n)}return t},_S=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){v4n(e,n,t);return}if(typeof e=="function"){b4n(e,n,t,r);return}y4n(e,n,t,r)},v4n=(e,n,t)=>{const r=e===""?n:vI(n,e);r.classGroupId=t},b4n=(e,n,t,r)=>{if(x4n(e)){_S(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(_4n(t,e))},y4n=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(Lv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,w4n=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},$3="!",ij=":",k4n=[],aj=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),S4n=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,c=0,u;const h=s.length;for(let k=0;kc?u-c:void 0;return aj(i,m,p,w)};if(n){const s=n+ij,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):aj(k4n,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},C4n=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},E4n=e=>({cache:w4n(e.cacheSize),parseClassName:S4n(e),sortModifiers:C4n(e),postfixLookupClassGroupIds:N4n(e),...d4n(e)}),N4n=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],c=e.trim().split(z4n);let u="";for(let h=c.length-1;h>=0;h-=1){const _=c[h],{isExternal:p,modifiers:m,hasImportantModifier:w,baseClassName:k,maybePostfixModifierPosition:v}=t(_);if(p){u=_+(u.length>0?" "+u:u);continue}let b=!!v,x;if(b){const A=k.substring(0,v);x=r(A);const j=x&&a[x]?r(k):void 0;j&&j!==x&&(x=j,b=!1)}else x=r(k);if(!x){if(!b){u=_+(u.length>0?" "+u:u);continue}if(x=r(k),!x){u=_+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=w?y+$3:y,N=C+x;if(o.indexOf(N)>-1)continue;o.push(N);const z=s(x,b);for(let A=0;A0?" "+u:u)}return u},A4n=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=c=>{const u=n.reduce((h,_)=>_(h),e());return t=E4n(u),r=t.cache.get,s=t.cache.set,i=o,o(c)},o=c=>{const u=r(c);if(u)return u;const h=j4n(c,t);return s(c,h),h};return i=a,(...c)=>i(A4n(...c))},T4n=[],ws=e=>{const n=t=>t[e]||T4n;return n.isThemeGetter=!0,n},yI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,R4n=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,M4n=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,O4n=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,D4n=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,L4n=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,I4n=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ou=e=>R4n.test(e),gn=e=>!!e&&!Number.isNaN(Number(e)),Mo=e=>!!e&&Number.isInteger(Number(e)),aw=e=>e.endsWith("%")&&gn(e.slice(0,-1)),Fc=e=>M4n.test(e),wI=()=>!0,$4n=e=>O4n.test(e)&&!D4n.test(e),fS=()=>!1,B4n=e=>L4n.test(e),P4n=e=>I4n.test(e),F4n=e=>!vt(e)&&!xt(e),H4n=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),q4n=e=>Ku(e,CI,fS),vt=e=>yI.test(e),w_=e=>Ku(e,EI,$4n),cj=e=>Ku(e,Y4n,gn),U4n=e=>Ku(e,zI,wI),G4n=e=>Ku(e,NI,fS),lj=e=>Ku(e,kI,fS),V4n=e=>Ku(e,SI,P4n),t1=e=>Ku(e,jI,B4n),xt=e=>xI.test(e),Fp=e=>Nf(e,EI),K4n=e=>Nf(e,NI),uj=e=>Nf(e,kI),W4n=e=>Nf(e,CI),Q4n=e=>Nf(e,SI),n1=e=>Nf(e,jI,!0),X4n=e=>Nf(e,zI,!0),Ku=(e,n,t)=>{const r=yI.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Nf=(e,n,t=!1)=>{const r=xI.exec(e);return r?r[1]?n(r[1]):t:!1},kI=e=>e==="position"||e==="percentage",SI=e=>e==="image"||e==="url",CI=e=>e==="length"||e==="size"||e==="bg-size",EI=e=>e==="length",Y4n=e=>e==="number",NI=e=>e==="family-name",zI=e=>e==="number"||e==="weight",jI=e=>e==="shadow",_j=()=>{const e=ws("color"),n=ws("font"),t=ws("text"),r=ws("font-weight"),s=ws("tracking"),i=ws("leading"),a=ws("breakpoint"),o=ws("container"),c=ws("spacing"),u=ws("radius"),h=ws("shadow"),_=ws("inset-shadow"),p=ws("text-shadow"),m=ws("drop-shadow"),w=ws("blur"),k=ws("perspective"),v=ws("aspect"),b=ws("ease"),x=ws("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...C(),xt,vt],z=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],j=()=>[xt,vt,c],M=()=>[ou,"full","auto",...j()],D=()=>[Mo,"none","subgrid",xt,vt],I=()=>["auto",{span:["full",Mo,xt,vt]},Mo,xt,vt],B=()=>[Mo,"auto",xt,vt],U=()=>["auto","min","max","fr",xt,vt],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...j()],Z=()=>[ou,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],Y=()=>[ou,"screen","full","dvw","lvw","svw","min","max","fit",...j()],$=()=>[ou,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,xt,vt],F=()=>[...C(),uj,lj,{position:[xt,vt]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],K=()=>["auto","cover","contain",W4n,q4n,{size:[xt,vt]}],ne=()=>[aw,Fp,w_],ae=()=>["","none","full",u,xt,vt],ue=()=>["",gn,Fp,w_],se=()=>["solid","dashed","dotted","double"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[gn,aw,uj,lj],ce=()=>["","none",w,xt,vt],he=()=>["none",gn,xt,vt],be=()=>["none",gn,xt,vt],Re=()=>[gn,xt,vt],Le=()=>[ou,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fc],breakpoint:[Fc],color:[wI],container:[Fc],"drop-shadow":[Fc],ease:["in","out","in-out"],font:[F4n],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fc],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fc],shadow:[Fc],spacing:["px",gn],text:[Fc],"text-shadow":[Fc],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ou,vt,xt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",xt,vt]}],"container-named":[H4n],columns:[{columns:[gn,vt,xt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[Mo,"auto",xt,vt]}],basis:[{basis:[ou,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[gn,ou,"auto","initial","none",vt]}],grow:[{grow:["",gn,xt,vt]}],shrink:[{shrink:["",gn,xt,vt]}],order:[{order:[Mo,"first","last","none",xt,vt]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...$()]}],"min-block-size":[{"min-block":["auto",...$()]}],"max-block-size":[{"max-block":["none",...$()]}],w:[{w:[o,"screen",...Z()]}],"min-w":[{"min-w":[o,"screen","none",...Z()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",t,Fp,w_]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,X4n,U4n]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",aw,vt]}],"font-family":[{font:[K4n,G4n,n]}],"font-features":[{"font-features":[vt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,xt,vt]}],"line-clamp":[{"line-clamp":[gn,"none",xt,cj]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",xt,vt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xt,vt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[gn,"from-font","auto",xt,w_]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[gn,"auto",xt,vt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[Mo,xt,vt]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xt,vt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xt,vt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:K()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mo,xt,vt],radial:["",xt,vt],conic:[Mo,xt,vt]},Q4n,V4n]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[gn,xt,vt]}],"outline-w":[{outline:["",gn,Fp,w_]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",h,n1,t1]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",_,n1,t1]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[gn,w_]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,n1,t1]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[gn,xt,vt]}],"mix-blend":[{"mix-blend":[...G(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":G()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[gn]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[xt,vt]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[gn]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:K()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xt,vt]}],filter:[{filter:["","none",xt,vt]}],blur:[{blur:ce()}],brightness:[{brightness:[gn,xt,vt]}],contrast:[{contrast:[gn,xt,vt]}],"drop-shadow":[{"drop-shadow":["","none",m,n1,t1]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",gn,xt,vt]}],"hue-rotate":[{"hue-rotate":[gn,xt,vt]}],invert:[{invert:["",gn,xt,vt]}],saturate:[{saturate:[gn,xt,vt]}],sepia:[{sepia:["",gn,xt,vt]}],"backdrop-filter":[{"backdrop-filter":["","none",xt,vt]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[gn,xt,vt]}],"backdrop-contrast":[{"backdrop-contrast":[gn,xt,vt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",gn,xt,vt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[gn,xt,vt]}],"backdrop-invert":[{"backdrop-invert":["",gn,xt,vt]}],"backdrop-opacity":[{"backdrop-opacity":[gn,xt,vt]}],"backdrop-saturate":[{"backdrop-saturate":[gn,xt,vt]}],"backdrop-sepia":[{"backdrop-sepia":["",gn,xt,vt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xt,vt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[gn,"initial",xt,vt]}],ease:[{ease:["linear","initial",b,xt,vt]}],delay:[{delay:[gn,xt,vt]}],animate:[{animate:["none",x,xt,vt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,xt,vt]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:Re()}],"skew-x":[{"skew-x":Re()}],"skew-y":[{"skew-y":Re()}],transform:[{transform:[xt,vt,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],zoom:[{zoom:[Mo,xt,vt]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xt,vt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xt,vt]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[gn,Fp,w_,cj]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Z4n=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Cd(e,"cacheSize",n),Cd(e,"prefix",t),Cd(e,"experimentalParseClassName",r),r1(e.theme,i.theme),r1(e.classGroups,i.classGroups),r1(e.conflictingClassGroups,i.conflictingClassGroups),r1(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Cd(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Cd(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),s1(e.theme,s.theme),s1(e.classGroups,s.classGroups),s1(e.conflictingClassGroups,s.conflictingClassGroups),s1(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),B3(e,s,"postfixLookupClassGroups"),B3(e,s,"orderSensitiveModifiers"),e),Cd=(e,n,t)=>{t!==void 0&&(e[n]=t)},r1=(e,n)=>{if(n)for(const t in n)Cd(e,t,n[t])},s1=(e,n)=>{if(n)for(const t in n)B3(e,n,t)},B3=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},J4n=(e,...n)=>typeof e=="function"?oj(_j,e,...n):oj(()=>Z4n(_j(),e),...n),e3n=J4n({extend:{theme:{text:["menu"]}}});function Cs(...e){return e3n(...e)}const t3n={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Kt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:Cs("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",t3n[e],t),...r})}const n3n=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),r3n={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},s3n={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function AI(e,n,t,r){return Cs(n3n,r3n[e],s3n[n],t&&"active",r)}function De({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:AI(n,t,e,r),...s})}function bh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:AI(n,t,e,r),...s})}const i3n=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),a3n={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},o3n={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function TI(e,n,t,r,s){return Cs(i3n,a3n[e],o3n[n],r==="circle"&&"rounded-full",t&&"active",s)}const Pt=T.forwardRef(function({active:n=!1,shape:t="rounded",size:r="default",variant:s="default",className:i,...a},o){return f.jsx("button",{ref:o,className:TI(s,r,n,t,i),...a})});function Bh({active:e=!1,shape:n="rounded",size:t="default",variant:r="default",className:s,...i}){return f.jsx("a",{className:TI(r,t,e,n,s),...i})}const c3n={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Gr({variant:e="default",className:n,...t}){return f.jsx("input",{className:Cs("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",c3n[e],n),...t})}function Cn({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:Cs("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function jt({className:e,...n}){return f.jsx("span",{className:Cs("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function Kr({className:e,...n}){return f.jsx("div",{className:Cs("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const l3n={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function Fd({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:Cs("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:Cs("h-[7px] w-[7px] shrink-0 rounded-full bg-current",l3n[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const u3n=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function RI(e,n){return Cs(u3n,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function dS({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:RI(e,n),...r,children:t??f.jsx("span",{})})}function _3n({checked:e=!1,className:n,...t}){return f.jsx("span",{className:RI(e,n),...t,children:f.jsx("span",{})})}var ri=TO();const f3n=vm(ri);function d3n(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const h3n=e=>{switch(e){case"success":return g3n;case"info":return b3n;case"warning":return v3n;case"error":return y3n;default:return null}},p3n=Array(12).fill(0),m3n=({visible:e,className:n})=>tt.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},tt.createElement("div",{className:"sonner-spinner"},p3n.map((t,r)=>tt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),g3n=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},tt.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),v3n=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},tt.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),b3n=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),y3n=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),x3n=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},tt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),tt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),w3n=()=>{const[e,n]=tt.useState(document.hidden);return tt.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let k3n=1;const S3n=100,fj=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:k3n++};class C3n{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-S3n;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=fj(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],tt.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(N3n(u)&&!u.ok){i=!1;const _=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,w=typeof _=="object"&&!tt.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:p,...w})}else if(u instanceof Error){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,w=typeof _=="object"&&!tt.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:p,...w})}else if(t.success!==void 0){i=!1;const _=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,w=typeof _=="object"&&!tt.isValidElement(_)?_:{message:_};this.create({id:r,type:"success",description:p,...w})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const h=typeof t.error=="function"?await t.error(u):t.error,_=typeof t.description=="function"?await t.description(u):t.description,m=typeof h=="object"&&!tt.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:_,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((u,h)=>o.then(()=>a[0]==="reject"?h(a[1]):u(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(n,t)=>{const r=fj(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Di=new C3n,E3n=(e,n)=>Di.message(e,n),N3n=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",z3n=E3n,j3n=()=>Di.toasts,A3n=()=>Di.getActiveToasts(),T3n=Object.assign(z3n,{success:Di.success,info:Di.info,warning:Di.warning,error:Di.error,custom:Di.custom,message:Di.message,promise:Di.promise,dismiss:Di.dismiss,loading:Di.loading},{getHistory:j3n,getToasts:A3n});d3n("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function i1(e){return e.label!==void 0}const R3n=3,M3n="24px",O3n="16px",dj=4e3,D3n=356,L3n=14,I3n=45,$3n=200;function Oo(...e){return e.filter(Boolean).join(" ")}function B3n(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const P3n=e=>{var n,t,r,s,i,a,o,c,u;const{invert:h,toast:_,unstyled:p,interacting:m,setHeights:w,visibleToasts:k,heights:v,index:b,toasts:x,expanded:y,removeToast:C,defaultRichColors:N,closeButton:z,style:A,cancelButtonStyle:j,actionButtonStyle:M,className:D="",descriptionClassName:I="",duration:B,position:U,gap:H,expandByDefault:Q,classNames:V,icons:Z,closeButtonAriaLabel:Y="Close toast"}=e,[$,L]=tt.useState(null),[F,q]=tt.useState(null),[K,ne]=tt.useState(!1),[ae,ue]=tt.useState(!1),[se,G]=tt.useState(!1),[oe,ce]=tt.useState(!1),[he,be]=tt.useState(!1),[Re,Le]=tt.useState(0),[Ke,Ne]=tt.useState(0),xe=tt.useRef(_.duration||B||dj),rt=tt.useRef(null),Ze=tt.useRef(null),ot=b===0,kt=b+1<=k,qt=_.type,dt=qt??"default",pt=_.dismissible!==!1,Ie=_.className||"",pe=_.descriptionClassName||"",je=tt.useMemo(()=>v.findIndex(Nt=>Nt.toastId===_.id)||0,[v,_.id]),He=tt.useMemo(()=>{var Nt;return(Nt=_.closeButton)!=null?Nt:z},[_.closeButton,z]),st=tt.useMemo(()=>_.duration||B||dj,[_.duration,B]),_t=tt.useRef(0),Ct=tt.useRef(0),bt=tt.useRef(0),Yt=tt.useRef(null),[un,Tt]=U.split("-"),ht=tt.useMemo(()=>v.reduce((Nt,vn,fn)=>fn>=je?Nt:Nt+vn.height,0),[v,je]),mt=w3n(),_n=tt.useMemo(()=>{var Nt;return(Nt=e.swipeDirections)!=null?Nt:B3n(U)},[e.swipeDirections,U]),gs=_.invert||h,br=qt==="loading";Ct.current=tt.useMemo(()=>je*H+ht,[je,ht]),tt.useEffect(()=>{xe.current=st},[st]),tt.useEffect(()=>{ne(!0)},[]),tt.useEffect(()=>{const Nt=Ze.current;if(Nt){const vn=Nt.getBoundingClientRect().height;return Ne(vn),w(fn=>[{toastId:_.id,height:vn,position:_.position},...fn]),()=>w(fn=>fn.filter(hn=>hn.toastId!==_.id))}},[w,_.id]),tt.useLayoutEffect(()=>{if(!K)return;const Nt=Ze.current,vn=Nt.style.height;Nt.style.height="auto";const fn=Nt.getBoundingClientRect().height;Nt.style.height=vn,Ne(fn),w(hn=>hn.find(bn=>bn.toastId===_.id)?hn.map(bn=>bn.toastId===_.id?{...bn,height:fn}:bn):[{toastId:_.id,height:fn,position:_.position},...hn])},[K,_.title,_.description,w,_.id,_.jsx,_.action,_.cancel]);const Gt=tt.useCallback(()=>{ue(!0),Le(Ct.current),w(Nt=>Nt.filter(vn=>vn.toastId!==_.id)),setTimeout(()=>{C(_)},$3n)},[_,C,w,Ct]);tt.useEffect(()=>{if(_.promise&&qt==="loading"||_.duration===1/0||_.type==="loading")return;let Nt;return y||m||mt?(()=>{if(bt.current<_t.current){const hn=new Date().getTime()-_t.current;xe.current=xe.current-hn}bt.current=new Date().getTime()})():(()=>{xe.current!==1/0&&(_t.current=new Date().getTime(),Nt=setTimeout(()=>{_.onAutoClose==null||_.onAutoClose.call(_,_),Gt()},xe.current))})(),()=>clearTimeout(Nt)},[y,m,_,qt,mt,Gt]),tt.useEffect(()=>{_.delete&&(Gt(),_.onDismiss==null||_.onDismiss.call(_,_))},[Gt,_.delete]);function Bn(){var Nt;if(Z!=null&&Z.loading){var vn;return tt.createElement("div",{className:Oo(V==null?void 0:V.loader,_==null||(vn=_.classNames)==null?void 0:vn.loader,"sonner-loader"),"data-visible":qt==="loading"},Z.loading)}return tt.createElement(m3n,{className:Oo(V==null?void 0:V.loader,_==null||(Nt=_.classNames)==null?void 0:Nt.loader),visible:qt==="loading"})}const _r=_.icon||(Z==null?void 0:Z[qt])||h3n(qt);var yr,Wr;return tt.createElement("li",{tabIndex:0,ref:Ze,className:Oo(D,Ie,V==null?void 0:V.toast,_==null||(n=_.classNames)==null?void 0:n.toast,V==null?void 0:V[dt],_==null||(t=_.classNames)==null?void 0:t[dt]),"data-sonner-toast":"","data-rich-colors":(yr=_.richColors)!=null?yr:N,"data-styled":!(_.jsx||_.unstyled||p),"data-mounted":K,"data-promise":!!_.promise,"data-swiped":he,"data-removed":ae,"data-visible":kt,"data-y-position":un,"data-x-position":Tt,"data-index":b,"data-front":ot,"data-swiping":se,"data-dismissible":pt,"data-type":qt,"data-invert":gs,"data-swipe-out":oe,"data-swipe-direction":F,"data-expanded":!!(y||Q&&K),"data-testid":_.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${ae?Re:Ct.current}px`,"--initial-height":Q?"auto":`${Ke}px`,...A,..._.style},onDragEnd:()=>{G(!1),L(null),Yt.current=null},onPointerDown:Nt=>{Nt.button!==2&&(br||!pt||(rt.current=new Date,Le(Ct.current),Nt.target.setPointerCapture(Nt.pointerId),Nt.target.tagName!=="BUTTON"&&(G(!0),Yt.current={x:Nt.clientX,y:Nt.clientY})))},onPointerUp:()=>{var Nt,vn,fn;if(oe||!pt)return;Yt.current=null;const hn=Number(((Nt=Ze.current)==null?void 0:Nt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ir=Number(((vn=Ze.current)==null?void 0:vn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bn=new Date().getTime()-((fn=rt.current)==null?void 0:fn.getTime()),yn=$==="x"?hn:Ir,Pn=Math.abs(yn)/bn;if(($==="x"?_n.includes(hn>0?"right":"left"):_n.includes(Ir>0?"bottom":"top"))&&(Math.abs(yn)>=I3n||Pn>.11)){Le(Ct.current),_.onDismiss==null||_.onDismiss.call(_,_),q($==="x"?hn>0?"right":"left":Ir>0?"down":"up"),Gt(),ce(!0);return}else{var Bt,In;(Bt=Ze.current)==null||Bt.style.setProperty("--swipe-amount-x","0px"),(In=Ze.current)==null||In.style.setProperty("--swipe-amount-y","0px")}be(!1),G(!1),L(null)},onPointerMove:Nt=>{var vn,fn,hn;if(!Yt.current||!pt||((vn=window.getSelection())==null?void 0:vn.toString().length)>0)return;const bn=Nt.clientY-Yt.current.y,yn=Nt.clientX-Yt.current.x;!$&&(Math.abs(yn)>1||Math.abs(bn)>1)&&L(Math.abs(yn)>Math.abs(bn)?"x":"y");let Pn={x:0,y:0};const Et=Bt=>1/(1.5+Math.abs(Bt)/20);if($==="y"){if(_n.includes("top")||_n.includes("bottom"))if(_n.includes("top")&&bn<0||_n.includes("bottom")&&bn>0)Pn.y=bn;else{const Bt=bn*Et(bn);Pn.y=Math.abs(Bt)0)Pn.x=yn;else{const Bt=yn*Et(yn);Pn.x=Math.abs(Bt)0||Math.abs(Pn.y)>0)&&be(!0),(fn=Ze.current)==null||fn.style.setProperty("--swipe-amount-x",`${Pn.x}px`),(hn=Ze.current)==null||hn.style.setProperty("--swipe-amount-y",`${Pn.y}px`)}},He&&!_.jsx&&qt!=="loading"?tt.createElement("button",{"aria-label":Y,"data-disabled":br,"data-close-button":!0,onClick:br||!pt?()=>{}:()=>{Gt(),_.onDismiss==null||_.onDismiss.call(_,_)},className:Oo(V==null?void 0:V.closeButton,_==null||(r=_.classNames)==null?void 0:r.closeButton)},(Wr=Z==null?void 0:Z.close)!=null?Wr:x3n):null,(qt||_.icon||_.promise)&&_.icon!==null&&((Z==null?void 0:Z[qt])!==null||_.icon)?tt.createElement("div",{"data-icon":"",className:Oo(V==null?void 0:V.icon,_==null||(s=_.classNames)==null?void 0:s.icon)},qt==="loading"?_.icon||Bn():_.promise?Bn():null,qt!=="loading"?_r:null):null,tt.createElement("div",{"data-content":"",className:Oo(V==null?void 0:V.content,_==null||(i=_.classNames)==null?void 0:i.content)},tt.createElement("div",{"data-title":"",className:Oo(V==null?void 0:V.title,_==null||(a=_.classNames)==null?void 0:a.title)},_.jsx?_.jsx:typeof _.title=="function"?_.title():_.title),_.description?tt.createElement("div",{"data-description":"",className:Oo(I,pe,V==null?void 0:V.description,_==null||(o=_.classNames)==null?void 0:o.description)},typeof _.description=="function"?_.description():_.description):null),tt.isValidElement(_.cancel)?_.cancel:_.cancel&&i1(_.cancel)?tt.createElement("button",{"data-button":!0,"data-cancel":!0,style:_.cancelButtonStyle||j,onClick:Nt=>{i1(_.cancel)&&pt&&(_.cancel.onClick==null||_.cancel.onClick.call(_.cancel,Nt),Gt())},className:Oo(V==null?void 0:V.cancelButton,_==null||(c=_.classNames)==null?void 0:c.cancelButton)},_.cancel.label):null,tt.isValidElement(_.action)?_.action:_.action&&i1(_.action)?tt.createElement("button",{"data-button":!0,"data-action":!0,style:_.actionButtonStyle||M,onClick:Nt=>{i1(_.action)&&(_.action.onClick==null||_.action.onClick.call(_.action,Nt),!Nt.defaultPrevented&&Gt())},className:Oo(V==null?void 0:V.actionButton,_==null||(u=_.classNames)==null?void 0:u.actionButton)},_.action.label):null)};function hj(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function F3n(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?O3n:M3n;function c(u){["top","right","bottom","left"].forEach(h=>{t[`${a}-${h}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(o)}),t}const H3n=tt.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:h,mobileOffset:_,theme:p="light",richColors:m,duration:w,style:k,visibleToasts:v=R3n,toastOptions:b,dir:x=hj(),gap:y=L3n,icons:C,customAriaLabel:N,containerAriaLabel:z="Notifications"}=n,[A,j]=tt.useState([]),M=tt.useMemo(()=>r?A.filter(ne=>ne.toasterId===r):A.filter(ne=>!ne.toasterId),[A,r]),D=tt.useMemo(()=>Array.from(new Set([i].concat(M.filter(ne=>ne.position).map(ne=>ne.position)))),[M,i]),[I,B]=tt.useState([]),[U,H]=tt.useState(!1),[Q,V]=tt.useState(!1),[Z,Y]=tt.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=tt.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=tt.useRef(null),q=tt.useRef(!1),K=tt.useCallback(ne=>{j(ae=>{var ue;return(ue=ae.find(se=>se.id===ne.id))!=null&&ue.delete||Di.dismiss(ne.id),ae.filter(({id:se})=>se!==ne.id)})},[]);return tt.useEffect(()=>Di.subscribe(ne=>{if(ne.dismiss){requestAnimationFrame(()=>{j(ae=>ae.map(ue=>ue.id===ne.id?{...ue,delete:!0}:ue))});return}setTimeout(()=>{f3n.flushSync(()=>{j(ae=>{const ue=ae.findIndex(se=>se.id===ne.id);return ue!==-1?[...ae.slice(0,ue),{...ae[ue],...ne},...ae.slice(ue+1)]:[ne,...ae]})})})}),[]),tt.useEffect(()=>{if(p!=="system"){Y(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const ne=window.matchMedia("(prefers-color-scheme: dark)");try{ne.addEventListener("change",({matches:ae})=>{Y(ae?"dark":"light")})}catch{ne.addListener(({matches:ue})=>{try{Y(ue?"dark":"light")}catch(se){console.error(se)}})}},[p]),tt.useEffect(()=>{A.length<=1&&H(!1)},[A]),tt.useEffect(()=>{const ne=ae=>{var ue;if(a.length>0&&a.every(oe=>ae[oe]||ae.code===oe)){var G;H(!0),(G=$.current)==null||G.focus()}ae.code==="Escape"&&(document.activeElement===$.current||(ue=$.current)!=null&&ue.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[a]),tt.useEffect(()=>{if($.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,q.current=!1)}},[$.current]),tt.createElement("section",{ref:t,"aria-label":N??`${z} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},D.map((ne,ae)=>{var ue;const[se,G]=ne.split("-");return M.length?tt.createElement("ol",{key:ne,dir:x==="auto"?hj():x,tabIndex:-1,ref:$,className:u,"data-sonner-toaster":!0,"data-sonner-theme":Z,"data-y-position":se,"data-x-position":G,style:{"--front-toast-height":`${((ue=I[0])==null?void 0:ue.height)||0}px`,"--width":`${D3n}px`,"--gap":`${y}px`,...k,...F3n(h,_)},onBlur:oe=>{q.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(q.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||q.current||(q.current=!0,F.current=oe.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{Q||H(!1)},onDragEnd:()=>H(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},M.filter(oe=>!oe.position&&ae===0||oe.position===ne).map((oe,ce)=>{var he,be;return tt.createElement(P3n,{key:oe.id,icons:C,index:ce,toast:oe,defaultRichColors:m,duration:(he=b==null?void 0:b.duration)!=null?he:w,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(be=b==null?void 0:b.closeButton)!=null?be:c,interacting:Q,position:ne,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:K,toasts:M.filter(Re=>Re.position==oe.position),heights:I.filter(Re=>Re.position==oe.position),setHeights:B,expandByDefault:o,gap:y,expanded:U,swipeDirections:n.swipeDirections})})):null}))});function q3n(e){const[n]=pI();return f.jsx(H3n,{theme:n,...e})}function xn(e,n,t){T3n[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function hS({content:e,children:n,className:t}){const r=T.useRef(null),s=T.useRef(null);function i(){const o=r.current,c=s.current;if(!o||!c)return;c.matches(":popover-open")||c.showPopover();const u=o.getBoundingClientRect(),h=c.getBoundingClientRect(),_=Math.max(8,Math.min(u.left+u.width/2-h.width/2,window.innerWidth-h.width-8));c.style.left=`${_}px`,c.style.top=`${Math.max(8,u.top-h.height-6)}px`}function a(){var o,c;(o=r.current)!=null&&o.matches(":hover, :focus")||(c=s.current)==null||c.hidePopover()}return T.useEffect(()=>{const o=()=>{var c;return(c=s.current)==null?void 0:c.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:Cs("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var c;o.key==="Escape"&&((c=s.current)!=null&&c.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const U3n=["button:not([disabled])","input:not([disabled])","textarea:not([disabled])","[tabindex]"].map(e=>`${e}:not([tabindex="-1"])`).join(", ");function Em(e,n,t="[data-initial-focus]"){const r=T.useRef(n);r.current=n,T.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(U3n)];(s.querySelector(t)??a()[0]??s).focus();const o=c=>{if(c.key==="Escape"){if(s.querySelector(":popover-open"))return;c.preventDefault(),c.stopPropagation(),r.current();return}if(c.key!=="Tab")return;const u=a(),h=u[0],_=u.at(-1);!h||!_?(c.preventDefault(),s.focus()):c.shiftKey&&document.activeElement===h?(c.preventDefault(),_.focus()):!c.shiftKey&&document.activeElement===_&&(c.preventDefault(),h.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function MI({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=T.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),c=[];return n.activeTurnCount>0&&c.push(n.activeTurnCount===1?p7t():L7t({count:Xt(n.activeTurnCount)})),n.pendingPermissionCount>0&&c.push(n.pendingPermissionCount===1?FCt():eCt({count:Xt(n.pendingPermissionCount)})),o>0&&c.push(o===1?t7t():w7t({count:Xt(o)})),n.queuedMessageCount>0&&c.push(n.queuedMessageCount===1?c7t():j7t({count:Xt(n.queuedMessageCount)})),n.activeRunCount>0&&c.push(n.activeRunCount===1?WCt():xCt({count:Xt(n.activeRunCount)})),Em(a,s),ri.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":c.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:hCt({host:Ce(e)})}),c.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:OCt()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:c.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(De,{disabled:r,onClick:s,children:cf()}),f.jsx(De,{variant:"danger",disabled:r,onClick:i,children:r?q7t():oCt()})]})]})}),document.body)}/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -549,7 +549,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) `,x)}paste(b){this._core.paste(b)}refresh(b,x){this._verifyIntegers(b,x),this._core.refresh(b,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const x of b)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const x of b)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}a.Terminal=k})(),i})()))})(uw)),uw.exports}var JI=_Sn();const fSn=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"];function wj(e,n){const t=document.documentElement,r=getComputedStyle(t),s=a=>r.getPropertyValue(n==="app"?`--term-app-${a}`:`--term-${a}`).trim(),i={};if(n==="app"&&t.dataset.theme!=="dark")for(const a of fSn){const o=r.getPropertyValue(`--term-app-ansi-${a.replace(/[A-Z]/g,c=>`-${c.toLowerCase()}`)}`).trim();o&&(i[a]=o)}return{...i,background:s("bg"),foreground:s("foreground"),cursor:s(e?"bg":"foreground"),cursorAccent:s("bg"),selectionBackground:s("selection")}}function Pb(e,n,t=!1,r="dark"){const s=getComputedStyle(document.documentElement),i=new JI.Terminal({convertEol:!0,disableStdin:n,cursorBlink:!n,cursorStyle:"bar",cursorWidth:2,fontSize:12,fontFamily:s.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:wj(n,r)}),a=r==="app"?new MutationObserver(()=>{i.options.theme=wj(i.options.disableStdin??n,r)}):null;a==null||a.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const o=new cSn.FitAddon;i.loadAddon(o),t&&i.loadAddon(new uSn.WebLinksAddon((x,y)=>{let C;try{C=new URL(y)}catch{return}(C.protocol==="http:"||C.protocol==="https:")&&window.open(C,"_blank","noopener,noreferrer")}));const c=e.style.overflowY;e.style.overflowY="auto",i.open(e);let u=!0,h=null;const _=()=>{if(h===e.scrollTop){h=null;return}h=null,u=e.scrollTop+e.clientHeight>=e.scrollHeight-1};e.addEventListener("scroll",_);const p=()=>{var j;const x=i.element,y=x==null?void 0:x.querySelector(".xterm-screen"),C=x==null?void 0:x.querySelector(".xterm-viewport");if(!x||!(y instanceof HTMLElement)||!(C instanceof HTMLElement))return;const N=i.buffer.active;let z=Math.max(0,N.baseY+N.cursorY-N.viewportY+1);for(let M=i.rows-1;M>=z;M--)if((j=N.getLine(N.viewportY+M))!=null&&j.translateToString(!0).trim()){z=M+1;break}const A=y.getBoundingClientRect().height;x.style.height=`${Math.max(e.clientHeight,Math.min(z,i.rows)*A/i.rows)}px`,x.style.overflow="hidden",C.style.height=`${A}px`},m=()=>{try{const x=o.proposeDimensions();x&&(i.resize(x.cols,Math.max(x.rows,n?1:40)),p())}catch{}};m();const w=new ResizeObserver(m);w.observe(e);const k=i.onWriteParsed(()=>{var y;const x=u&&i.buffer.active.viewportY===i.buffer.active.baseY;if(p(),x){const C=(y=i.element)==null?void 0:y.querySelector(".xterm-screen");if(C instanceof HTMLElement){const N=(i.buffer.active.cursorY+1)*C.getBoundingClientRect().height/i.rows;e.scrollTop=Math.max(0,N-e.clientHeight),h=e.scrollTop}}}),v=i.onScroll(p),b=x=>{(x.deltaY<0?e.scrollTop>0:e.scrollTop+e.clientHeighttypeof n=="string")}function dSn(e){return Tf(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||t$(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function hSn(e){return Tf(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&t$(e.partitions)&&(e.error===null||typeof e.error=="string")}function pSn(e){return!Tf(e)||e.type!=="complete"?null:e.backend==="ssh"&&dSn(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&hSn(e.result)?{backend:"slurm",result:e.result}:null}function n$(e){return Tf(e)&&e.type==="complete"}function mSn(e){return Tf(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function CS({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(Fb,{path:`${t}?${a}`,label:jL({host:Ce(e)}),active:r,onError:i,onComplete:o=>{const c=pSn(o);return c?(s(c),!0):!1}})}function gSn({login:e,onComplete:n,onError:t}){return f.jsx(Fb,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-96",onError:t,onComplete:r=>n$(r)?(n(),!0):!1})}function vSn({path:e,label:n,onComplete:t,onError:r,onClose:s}){const[i,a]=T.useState("running");return f.jsxs("div",{className:"mt-4 overflow-hidden rounded-lg border border-border",children:[f.jsxs("div",{className:"flex h-9 items-center gap-3 border-b border-b-border-variant bg-surface ps-3 pe-1.5",children:[f.jsx("code",{dir:"ltr",className:"min-w-0 flex-1 truncate font-mono text-xs text-subtext",children:n}),f.jsx("span",{role:"status",className:"flex shrink-0 items-center gap-1.5 text-xs text-subtext",children:i==="running"?f.jsxs(f.Fragment,{children:[f.jsx(jt,{className:"border-t-accent-amber"})," ",ajt()]}):i==="done"?f.jsxs(f.Fragment,{children:[f.jsx(gi,{size:13,strokeWidth:2.5,className:"text-accent-green"})," ",Vzt()]}):i==="failed"?f.jsxs(f.Fragment,{children:[f.jsx(cr,{size:13,strokeWidth:2.5,className:"text-accent-red"})," ",Jzt()]}):Bzt()}),f.jsx("button",{type:"button",onClick:s,"aria-label":jz(),title:jz(),className:"ms-1 inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted [&:hover]:bg-highlight [&:hover]:text-text",children:f.jsx(cr,{size:14})})]}),f.jsx(Fb,{path:e,label:n,heightClass:"h-80",frame:"bare",palette:"app",shellAfter:!0,onError:(o,c)=>{a("failed"),c&&r(o)},onComplete:o=>n$(o)?(a("done"),t(),!0):!1,onClosed:()=>a(o=>o==="running"?"closed":o)})]})}function Fb({path:e,label:n,command:t,heightClass:r="h-40",frame:s="card",palette:i="dark",shellAfter:a=!1,active:o=!0,awaitingApproval:c=!1,onComplete:u,onError:h,onClosed:_}){const p=T.useRef(null),m=T.useRef(null),w=T.useRef(u),k=T.useRef(h),v=T.useRef(_),[b,x]=T.useState(null);return w.current=u,k.current=h,v.current=_,T.useEffect(()=>{const y=p.current;if(!y)return;const{terminal:C,dispose:N}=Pb(y,c,!0,i);if(m.current=C,c)return t&&C.writeln(`$ ${t}`),()=>{m.current=null,N()};C.focus();const z=location.protocol==="https:"?"wss:":"ws:",A=new URL(e,`${z}//${location.host}`),j=new WebSocket(A);j.binaryType="arraybuffer";let M=!1,D=!1,I=!1;const B=(Q,V)=>{var Z;if(D){V||C.writeln(Q);return}D=!0,(!I||a)&&C.writeln(Q),(Z=k.current)==null||Z.call(k,Q,V),!(a&&!V)&&(C.options.disableStdin=!0,C.blur(),x(Q))},U=C.onData(Q=>{j.readyState===WebSocket.OPEN&&j.send(new TextEncoder().encode(Q))}),H=C.onResize(({cols:Q,rows:V})=>{j.readyState===WebSocket.OPEN&&j.send(JSON.stringify({type:"resize",cols:Q,rows:V}))});return j.onopen=()=>{t&&C.writeln(`$ ${t}`),j.send(JSON.stringify({type:"resize",cols:C.cols,rows:C.rows}))},j.onmessage=Q=>{if(Q.data instanceof ArrayBuffer){I=!0,C.write(new Uint8Array(Q.data));return}if(typeof Q.data!="string")return;let V;try{V=JSON.parse(Q.data)}catch{return}if(w.current(V)){M=!0,a||j.close();return}const Z=mSn(V);Z&&(M?C.writeln(Z):B(Z,!a))},j.onerror=()=>B(zv(),!0),j.onclose=()=>{var Q;if(!M&&!D){B(zv(),!0);return}a&&(C.options.disableStdin=!0,C.blur(),(Q=v.current)==null||Q.call(v))},()=>{j.onopen=null,j.onmessage=null,j.onerror=null,j.onclose=null,U.dispose(),H.dispose(),j.close(),m.current=null,N()}},[e,t,c,i,a]),T.useEffect(()=>{const y=m.current;y&&(y.options.disableStdin=c||!o||b!==null,!c&&o&&b===null?y.focus():y.blur())},[o,b,c]),f.jsxs("div",{className:s==="card"?"mt-3":void 0,children:[f.jsx("div",{className:`${r} ${s==="card"?e$:`overflow-hidden p-3 ${i==="app"?"bg-terminal-app":"bg-terminal"}`}`,role:"group","aria-label":n,children:f.jsx("div",{ref:p,className:"h-full overflow-hidden"})}),b?f.jsx("p",{role:"alert",className:"sr-only",children:b}):null]})}function bSn({host:e,transcript:n}){const t=T.useRef(null);return T.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=Pb(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${e$}`,role:"group","aria-label":jL({host:Ce(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}let Iv=null,r0=0;const ES=()=>Iv;function r$(){const e=r0;return YI(async(n,t)=>{if(e!==r0)return;const r=await Hyn(n,t);e===r0&&et.setQueryData(Cm().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===r0&&xn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:ti(),onClick:()=>void Hb.retry()}})})}let X1=r$();function ySn(){r0++,Iv=null,X1=r$()}const Hb={flush:(e=!1)=>X1.flush(e),retry:()=>X1.retry(),queue(e,n=0){const t=Iv;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||(Iv=e,X1.queue(e,n))}};window.addEventListener("pagehide",()=>void Hb.flush(!0));function rl(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function oo(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function s$(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.terminalTabOpen&&r.push("terminal"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[It(u),u])),a=e.contentTabOrder.flatMap(u=>{const h=i.get(u);return h?[h]:[]}),o=It(e.rightTab);return{tabs:[...r,...a].map(u=>rl(u,It(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?rl(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?It(e.previewTab):null,history:e.tabHistory.map(It),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[It(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function xSn(e,n){const t=zS();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>It(oo(a))===It(oo(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=oo(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0),a==="terminal"&&(t.terminalTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[It(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(It(a))}const s=new Map(r.map(i=>{const a=oo(i);return[It(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?oo(n):e!=null&&e.active?oo(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,a$(t,n)}const _w=(e,n)=>e.id===n.id&&e.view===n.view,k_=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,NS=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Fs=(e,n,t)=>`${e}:${n??""}:${NS(t)}`,i$=e=>({...e,lineScrollRequest:void 0});function o1(e){return typeof e=="object"&&"path"in e?i$(e):e}const md=(e,n)=>e.branch===n.branch;function It(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:${NS(e)}`:`experiment:${e.id}:${e.view}`}function Hp(e,n){const t=e.filter(r=>It(r)!==n);return t.length===e.length?e:t}function wSn(e){return e!==void 0}function zS(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,terminalTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===Pd&&n){const r="experiments";return{...t,rightTab:r,tabHistory:[r],experimentsTabOpen:!0,panelOpen:!0}}if(e===Tb){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{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(It),panelOpen:!0}}if(e===Rb){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(It),panelOpen:!0}}return t}function jS(e,n){const t=zS(e,n);return t.panelOpen?s$(t,{},{}):void 0}function a$(e,n){if(!n)return e;const t=oo(n),r=It(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(c=>It(c)===r),i=(c,u)=>{const h=c.findIndex(_=>It(_)===r);return h<0?[...c,u]:JSON.stringify(rl(c[h]))===JSON.stringify(rl(u))?c:c.map((_,p)=>p===h?{..._,...u}:_)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:t==="terminal"?a.terminalTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&It(o)===r&&JSON.stringify(rl(o))===JSON.stringify(rl(t))||(a.tabHistory=[...e.tabHistory.filter(c=>It(c)!==r),t]),a}let co=0;const M0=new Map,$v=new Map,F3=new Set,H3=()=>{for(const e of F3)e()},kSn=e=>(F3.add(e),()=>{F3.delete(e)}),O0=new Map,lo=new Map,o$=e=>lo.get(e);function SSn(){co++,lo.clear(),O0.clear(),M0.clear(),$v.clear(),H3()}function CSn(e,n){const t=lo.get(e);if(!(t!=null&&t.tasks.new)||Ru(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const c=oo(o);if(typeof c=="string"||!("path"in c))return[];const u=Fs(e,null,c);return u in a?[[Fs(e,n,c),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,O0.set(e,n),lo.set(e,{...t,tasks:i})}function ESn(e){let n=M0.get(e);if(!n){const t=co;n=YI(async(r,s)=>{if(t!==co)return;const i=await Fyn(e,r,s);t===co&&et.setQueryData(lS(e).queryKey,i),t===co&&$v.delete(e)&&H3()},r=>{t===co&&($v.set(e,r instanceof Error?r.message:String(r)),H3())}),M0.set(e,n)}return n}function fw(e,n,t,r){const s=lo.get(e);if(!s||t==="new"&&O0.has(e))return;const i=Bb(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?Ru(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const c={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});lo.set(e,c),ESn(e).queue(c,u?250:0)}function kj(e,n,t,r){const s=new Set(e.state.fileTabs.map(h=>Fs(t,r==="new"?null:r,h))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([h])=>s.has(h))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([h])=>s.has(h))),o=s$(e.state,i,a),c=e.pane??(n==null?void 0:n.active),u=c?It(oo(c)):null;return o.active=o.tabs.find(h=>It(oo(h))===u)??null,o}function NSn(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,firstDemoOpen:a,state:o,apply:c,getScroll:u,sourceModes:h,revision:_}=e,p=T.useRef(vj()),m=T.useSyncExternalStore(kSn,()=>n?$v.get(n)??null:null),[w,k]=T.useState(null),[v,b]=T.useState(0),[x,y]=T.useState(null),[C,N]=T.useState(null),z=T.useRef(null),A=T.useRef(null),j=T.useRef(null),M=T.useRef(e);M.current=e;const D=JSON.stringify([n,t,i]),I=JSON.stringify(s??null),B=T.useCallback(()=>{const H=j.current;if(!H)return;const Q=kj({...M.current,state:H.state,pane:H.pane},Ru(lo.get(H.projectId),H.taskKey),H.projectId,H.taskKey);fw(H.projectId,H.location,H.taskKey,Q)},[]);T.useEffect(()=>{let H=!0;const Q=co;if(k(null),y(null),!!n)return lo.has(n)?y(n):et.fetchQuery(lS(n)).then(V=>{!H||Q!==co||(lo.set(n,V??vj()),y(n))}).catch(V=>{H&&Q===co&&k(V instanceof Error?V.message:String(V))}),()=>{H=!1}},[n,v]),T.useLayoutEffect(()=>{if(j.current&&j.current.scope!==D){const V=j.current.projectId;B(),O0.get(V)===t&&O0.delete(V),j.current=null}if(!n||x!==n)return;const H=lo.get(n);if(!H)return;if(p.current=H,z.current!==D){if(z.current=D,A.current=I,i){const V=Ru(H,t)??(Vc(n)?jS(t,a):void 0);c(xSn(V,s),V,!0)}N(D);return}if(C!==D)return;let Q=o;A.current!==I&&(A.current=I,i&&s&&(Q=a$(o,s),c(Q,void 0,!1))),i?(fw(n,r,t,kj({state:Q,pane:s,getScroll:u,sourceModes:h},Ru(H,t),n,t)),j.current={projectId:n,taskKey:t,scope:D,location:r,pane:s,state:Q}):fw(n,r),p.current=lo.get(n)??H},[n,t,r,s,I,i,a,o,c,u,h,_,x,D,C,B]),T.useEffect(()=>{const H=co,Q=Z=>{if(H===co){B();for(const Y of M0.values())Y.flush(Z)}},V=()=>Q(!0);return window.addEventListener("pagehide",V),()=>{window.removeEventListener("pagehide",V),Q(!1)}},[B]);const U=T.useCallback(()=>{var H;n&&(w?b(Q=>Q+1):(H=M0.get(n))==null||H.retry())},[n,w]);return{ready:n===null||x===n&&C===D,loaded:n===null||x===n,error:w??m,retry:U,capture:B,workspace:p}}const zSn="data:image/svg+xml,"+encodeURIComponent(''),q3=T.createContext(null);function jSn(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function c$(){const e=T.useContext(q3);if(!e)throw new Error("Runtime is not connected");return e}function ASn(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?zSn:"/favicon.svg")}function Sj(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function TSn(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!Sj("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&hI(n),!Sj("orx:locale")&&t&&pD(t)&&fI(t)}function RSn(e){return e.includes("ssh ")&&e.includes("failed")}function Cj({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:iL({host:Ce(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:d3()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:Ckt()})]})})}function Ej({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,D,I;const{session:s}=e,[i,a]=T.useState(s.installPaths),[o,c]=T.useState(!1),[u,h]=T.useState(null);T.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(D=s.installPaths)==null?void 0:D.database,(I=s.installPaths)==null?void 0:I.cache]);async function _(){if(i){c(!0);try{await i2n(i)}catch(B){xn(B instanceof Error?B.message:String(B),"error")}finally{c(!1)}}}async function p(B=!1){r(B?s.error:null),c(!0);try{await a2n()}catch(U){xn(U instanceof Error?U.message:String(U),"error")}finally{c(!1)}}async function m(){c(!0);try{await KL()}catch(B){xn(B instanceof Error?B.message:String(B),"error")}finally{c(!1)}}async function w(){c(!0);try{h(await WL())}catch(B){xn(B instanceof Error?B.message:String(B),"error")}finally{c(!1)}}async function k(){if(u){c(!0);try{await QL(u),h(null)}catch(B){h(null),xn(B instanceof Error?B.message:String(B),"error")}finally{c(!1)}}}async function v(){c(!0);try{await o2n()}catch(B){xn(B instanceof Error?B.message:String(B),"error")}finally{c(!1)}}const b=s.status==="applying"||o,x=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&x,N=["connecting","applying","reconnecting"].includes(s.status),z=s.status==="disconnected"&&s.error!==null&&RSn(s.error)&&t!==s.error&&!s.canStartNewHost,A=x?dSt():y?l8t():s.status==="applying"?V3t({host:Ce(s.host)}):s.status==="reconnecting"?z6t({host:Ce(s.host)}):s.status==="disconnected"?s.error?vkt({host:Ce(s.host)}):s.canStartNewHost?Bkt({host:Ce(s.host)}):iL({host:Ce(s.host)}):E5t({host:Ce(s.host)}),j=s.error??(s.canStartNewHost?Rkt():x?OSt({user:Ce(s.user??""),host:Ce(s.host)}):y?n8t({host:Ce(s.host)}):s.status==="applying"?B3t():s.status==="reconnecting"?x6t():s.status==="disconnected"?ikt():b5t());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[N&&f.jsx(jt,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:A}),!z&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j})]})]}),z&&f.jsx(CS,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:aSt()}),[["binary",Vkt()],["database",Jkt()]].map(([B,U])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[U,f.jsx(Gr,{value:i[B],onChange:H=>a({...i,[B]:H.target.value}),disabled:b,dir:"ltr"})]},B)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(De,{variant:"primary",disabled:b,onClick:()=>void _(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",ySt()]}):y?Cz():gL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(De,{variant:"primary",disabled:b,onClick:()=>void _(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",m8t()]}):Cz()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(De,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(jt,{}):null,s.error?kz():K6t()]}):f.jsxs(De,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(jt,{}):null,kz()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(De,{disabled:o,onClick:()=>void m(),children:g3()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(De,{disabled:o,onClick:()=>void m(),children:g3()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(jt,{}):null,wz()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid w(),children:[o?f.jsx(jt,{}):null,aL()]})]}),x&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(De,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(jt,{}):null,wz()]})})]})}),u&&f.jsx(MI,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||h(null)},onConfirm:()=>void k()})]})}function MSn({children:e}){const n=T.useRef(null);return T.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function OSn(){T.useSyncExternalStore(nE,aK),T.useEffect(()=>nE(()=>{ySn(),SSn()}),[]);const e=_Q({select:w=>w.pathname==="/remote-launch"}),[n,t]=T.useState(null),[r,s]=T.useState(null),i=T.useRef(!1),a=T.useRef(!1),o=T.useRef(!1),c=T.useRef(null),[u,h]=T.useState(null),_=ut({...Swn(),enabled:!e,refetchInterval:w=>{var k;return w.state.status==="error"||((k=w.state.data)==null?void 0:k.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(T.useEffect(()=>{var v,b;if(e)return;const w=_.data;if(!w){s(((v=_.error)==null?void 0:v.message)??null);return}const k=jSn(w);oK(k),c.current!==null&&c.current!==k&&(i.current=!1,a.current=!1,o.current=!1),c.current=k,w.kind==="ssh"&&(o.current||(o.current=!0,TSn(w)),w.session.status==="connected"?(i.current=!0,a.current=!0,h(null)):w.session.status==="disconnected"&&w.session.error===null&&(a.current=!1)),t(w),s(((b=_.error)==null?void 0:b.message)??null)},[e,_.data,_.error]),T.useEffect(()=>{const w=(n==null?void 0:n.kind)==="ssh";ASn(w),w&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(jt,{})," ",c6t()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(De,{onClick:()=>location.reload(),children:ti()})]}):f.jsx(jt,{})});if(n.kind==="local")return f.jsxs(q3,{value:n,children:[f.jsx(rj,{}),f.jsx(N0,{})]},Ha()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(Cj,{host:n.session.host}):f.jsx(Ej,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:h});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(q3,{value:n,children:[f.jsx(rj,{}),f.jsx(N0,{})]},Ha()[1])}),m&&f.jsx(MSn,{children:r?f.jsx(Cj,{host:n.session.host,overlay:!0}):f.jsx(Ej,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:h})})]})}const qb=WW()({component:OSn}),AS="orx:demo-read-sessions";function l$(){try{const e=JSON.parse(sessionStorage.getItem(AS)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function DSn(e){try{const n=l$();n.add(e),sessionStorage.setItem(AS,JSON.stringify([...n]))}catch{}}function LSn(){try{sessionStorage.removeItem(AS)}catch{}}function u$(e,n){const t=ff(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function ISn(e=et){var i;const[n,t]=await Promise.all([e.fetchQuery(Cm()),e.fetchQuery(gh())]),r=Bb((i=ES()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=ff(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!u$(r,await e.fetchQuery(Fa(s.projectId)))?"/projects":r}async function $Sn(e,n=et){var h;const[t,r]=await Promise.all([n.fetchQuery(lS(e)),n.fetchQuery(Fa(e))]),s=o$(e)??t,i=Bb(s==null?void 0:s.lastLocation);if(i&&((h=ff(i.split("?")[0]))==null?void 0:h.projectId)===e&&u$(i,r))return i;const a=r.find(_=>!_.archived),o=Vc(e)?jS(a==null?void 0:a.id,!(await n.fetchQuery(Cm())).tourCompleted):void 0,c=Ru(s,(a==null?void 0:a.id)??"new"),u=c?c.active:o==null?void 0:o.active;return Q1(e,(a==null?void 0:a.id)??null,u)}const Bv=360,BSn=272,PSn=380,FSn=BSn+56;function s0(){return Math.max(Bv,window.innerWidth-FSn-PSn)}function _$(){const e=s0();return Math.max(Bv,Math.min(480,e,Math.round(window.innerWidth*.25)))}function TS(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.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 dw(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx(TS,{}),"OpenResearch"]})}const Nj="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";function HSn({cmd:e,onRun:n}){const[t,r]=T.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{dir:"ltr",className:"font-mono text-sm",children:e}),n&&f.jsx("button",{type:"button",className:`cmd-inline-run ${Nj}`,onClick:n,"aria-label":qE({value:Ce(e)}),title:qE({value:Ce(e)}),children:f.jsx(Tkn,{size:11})}),f.jsx("button",{type:"button",className:`cmd-inline-copy ${Nj}`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})},"aria-label":t?af():DX({value:Ce(e)}),title:t?af():Yk(),children:t?f.jsx(gi,{size:11,strokeWidth:3}):f.jsx(zf,{size:11})})]})}function df(e,n){return e?e.split(/`([^`]+)`/).map((t,r)=>r%2===1?f.jsx(HSn,{cmd:t,onRun:n!=null&&n.canRun(t)?()=>n.onRun(t):void 0},r):t):null}function xh({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.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"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):e==="antigravity"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"13 18 85 80",fill:"#3186FF","aria-hidden":"true",children:f.jsx("path",{d:"M89.6992 93.695C94.3659 97.195 101.366 94.8617 94.9492 88.445C75.6992 69.7783 79.7825 18.445 55.8659 18.445C31.9492 18.445 36.0325 69.7783 16.7825 88.445C9.78251 95.445 17.3658 97.195 22.0325 93.695C40.1159 81.445 38.9492 59.8617 55.8659 59.8617C72.7825 59.8617 71.6159 81.445 89.6992 93.695Z"})}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.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"})})}function U3(e){return!e.installed||e.installBroken?"install":e.authState==="unsupported"&&!e.needsConfigRepair?"update":"login"}function qSn(e,n){return e.needsConfigRepair?"error":n==="login"?"running":"preview"}function zj(e,n){return n||e==="preview"}function USn(e,n){if(!e||e.needsConfigRepair)return null;const t=U3(e);return t===n?null:t}function f$({harness:e,commands:n,onReady:t,onClose:r}){const s=T.useRef(null),i=T.useRef(!1),[a,o]=T.useState(()=>U3(e)),[c,u]=T.useState(0),[h,_]=T.useState(()=>qSn(e,U3(e))),[p,m]=T.useState(h==="running"),[w,k]=T.useState(e.needsConfigRepair),[v,b]=T.useState(e.needsConfigRepair?e.agentNote??null:null),x=h==="running"||h==="checking",y=n[a].includes(` `)?void 0:n[a];T.useEffect(()=>{i.current=!1;const N=s.current;return N==null||N.showModal(),()=>{i.current=!0,N==null||N.close()}},[]);const C=async()=>{_("checking"),b(null);try{const N=await uf(!0,!0);if(i.current)return;const z=N.find(A=>A.id===e.id);if(k((z==null?void 0:z.needsConfigRepair)??!1),z!=null&&z.agentReady&&(a!=="login"||z.authenticated))t==null||t(z),_("success"),e.id==="antigravity"&&a==="login"&&r();else if(a!=="login"&&(z!=null&&z.installed)&&!z.installBroken&&!z.needsConfigRepair&&z.authState==="needsLogin")o("login"),m(!0),_("running");else{const A=USn(z,a);A&&(o(A),m(!1)),b((z==null?void 0:z.agentNote)??UD()),_("error")}}catch(N){if(i.current)return;b(N instanceof Error?N.message:String(N)),_("error")}};return f.jsxs("dialog",{ref:s,className:"m-auto w-180 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"harness-setup-title",onKeyDown:N=>{N.key==="Escape"&&x&&N.preventDefault()},onCancel:N=>{N.preventDefault(),x||r()},children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(xh,{harness:e.id,size:26}),f.jsx("h2",{id:"harness-setup-title",className:"m-0 text-xl font-medium",children:VN({agent:e.name})})]}),h==="preview"?f.jsx("p",{className:"my-4 text-sm text-subtext",children:a==="install"?NWe({agent:e.name}):MQe({agent:e.name})}):y&&zj(h,p)?f.jsx("p",{className:"my-4 text-sm text-subtext [&_.cmd-inline]:mx-2 [&_.cmd-inline]:gap-2",children:df(dQe({command:y}))}):null,h!=="running"&&h!=="preview"&&f.jsxs("p",{className:"my-4 flex items-center gap-2 text-sm",role:"status",children:[h==="checking"&&f.jsx(jt,{}),h==="success"?oWe({agent:e.name}):h==="error"?HD():eWe()]}),a==="install"&&n.requiresNpm&&f.jsx("p",{className:"text-sm text-subtext",children:aQe()}),zj(h,p)&&f.jsx(Fb,{path:`/api/harnesses/setup?${new URLSearchParams({harness:e.id,action:a})}`,label:VN({agent:e.name}),command:y,heightClass:"h-96",active:h==="running",awaitingApproval:h==="preview",onComplete:N=>typeof N!="object"||N===null||!("type"in N)||N.type!=="complete"?!1:(C(),!0),onError:N=>{b(N),_("error")}},`${a}-${c}`),v&&f.jsx("p",{role:"alert",className:"text-sm text-accent-red",children:df(v)}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[h==="error"&&f.jsx(De,{variant:"ghost",onClick:()=>{b(null),C()},children:Ev()}),h==="error"&&!w&&f.jsx(De,{onClick:()=>{b(null),m(!0),_("running"),u(N=>N+1)},children:ti()}),f.jsx(De,{variant:h==="success"?"primary":"default",onClick:r,children:h==="success"?ML():x?KKe():A0()}),h==="preview"&&f.jsx(De,{variant:"primary",onClick:()=>{m(!0),_("running")},children:PKe()})]})]})}const GSn={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function D0({variant:e="list",className:n,...t}){return f.jsx("span",{className:Cs("title",GSn[e],n),...t})}const jj=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),J_=["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(" "),hw=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),d$=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),VSn=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),KSn=[{id:"AI/ML",label:iut},{id:"Biology",label:fut},{id:"Physics",label:Eut},{id:"Other",label:but}],WSn=["welcome","environment","profile"];function QSn({onDone:e,preferredAgent:n,remote:t}){var pt;const r=dn({mutationFn:Ie=>Uyn(...Ie)}),[s,i]=T.useState(0);T.useEffect(()=>{const Ie=WSn[s];Ie&&pu({name:"onboarding_step_viewed",step:Ie})},[s]);const a=ut(Du()),o=ut(d0()),c=ut(sI()),[u,h]=T.useState(null),[_,p]=T.useState(!1),m=T.useRef(null),w=T.useRef(""),k=T.useRef(null),v=T.useRef(!1);T.useEffect(()=>()=>{var Ie;return(Ie=m.current)==null?void 0:Ie.close()},[]);const b=a.data??null,x=(pt=o.data)==null?void 0:pt.gitVersion,[y,C]=T.useState(!1),[N,z]=T.useState(null),[A,j]=T.useState(""),[M,D]=T.useState(null),[I,B]=T.useState(!1),[U,H]=T.useState([]),[Q,V]=T.useState(""),[Z,Y]=T.useState(""),[$,L]=T.useState([]),[F,q]=T.useState(""),[K,ne]=T.useState([]),[ae,ue]=T.useState(!1),se=T.useRef(0),[G,oe]=T.useState(!1),[ce,he]=T.useState(!1),be=(b==null?void 0:b.some(Ie=>Ie.agentReady&&!Ie.catalogPending))??!1,Re=(b==null?void 0:b.some(Ie=>Ie.catalogPending))??!1,Le=x!=null,Ke=T.useRef(0),Ne=(Ie,pe=!1)=>{const je=++Ke.current;B(!0),oe(!1),he(!1);const He=()=>je===Ke.current;Promise.allSettled([uf(Ie,pe),et.fetchQuery({...d0(),staleTime:Ie?0:3e4})]).then(([st,_t])=>{He()&&(st.status==="rejected"&&oe(!0),_t.status==="rejected"&&he(!0))}).finally(()=>He()&&B(!1))};T.useEffect(()=>Ne(!1),[]),T.useEffect(()=>{if(b===null)return;const Ie=b.filter(pe=>pe.agentReady&&!pe.catalogPending);D(pe=>{var He;if(pe&&Ie.some(st=>st.id===pe))return pe;const je=n&&Ie.find(st=>st.id===n.harness);return(je==null?void 0:je.id)??((He=Ie[0])==null?void 0:He.id)??null})},[b,n]),T.useEffect(()=>oe(a.isError),[a.isError,a.dataUpdatedAt]),T.useEffect(()=>he(o.isError),[o.isError,o.dataUpdatedAt]),T.useEffect(()=>{et.fetchQuery(Ewn()).then(Ie=>{H(Ie.researchAreas),V(Ie.otherArea??""),Y(Ie.background??""),L(Ie.papers)}).catch(()=>{})},[]),T.useEffect(()=>{const Ie=F.trim();if(Ie.length<3){ne([]),ue(!1);return}const pe=++se.current;ue(!0);const je=setTimeout(()=>{et.fetchQuery(_I(Ie)).then(He=>pe===se.current&&ne(He)).catch(()=>pe===se.current&&ne([])).finally(()=>pe===se.current&&ue(!1))},350);return()=>clearTimeout(je)},[F]);const xe=Ie=>{const pe=$.some(je=>je.paperId===Ie.paperId);L(je=>je.some(He=>He.paperId===Ie.paperId)?je:[...je,{paperId:Ie.paperId,title:Aj(Ie.title)}]),q(""),ne([]),pe||et.fetchQuery(D3(Ie.paperId)).then(je=>{var st;const He=(st=je.title)==null?void 0:st.trim();He&&L(_t=>_t.map(Ct=>Ct.paperId===Ie.paperId?{...Ct,title:He}:Ct))}).catch(()=>{})},rt=Ie=>L(pe=>pe.filter(je=>je.paperId!==Ie)),Ze=Ie=>{H(pe=>pe.includes(Ie)?pe.filter(je=>je!==Ie):[...pe,Ie])},ot=U.length>0&&(!U.includes("Other")||Q.trim().length>0),kt=()=>{if(k.current)return k.current;w.current="",v.current=!0,p(!0);const Ie=(async()=>{await new Promise((He,st)=>{const _t=location.protocol==="https:"?"wss:":"ws:",Ct=new WebSocket(`${_t}//${location.host}/api/harnesses/setup?harness=opencode&action=install&trigger=automatic`);Ct.binaryType="arraybuffer";const bt=new TextDecoder,Yt=new JI.Terminal;Yt.onData(Tt=>{Ct.readyState===WebSocket.OPEN&&Ct.send(new TextEncoder().encode(Tt))}),m.current=Ct;let un=!1;Ct.onmessage=Tt=>{if(Tt.data instanceof ArrayBuffer){Yt.write(new Uint8Array(Tt.data)),w.current=(w.current+bt.decode(Tt.data,{stream:!0})).slice(-65536);return}if(typeof Tt.data!="string")return;let ht;try{ht=JSON.parse(Tt.data)}catch{return}typeof ht!="object"||ht===null||!("type"in ht)||(ht.type==="complete"?(un=!0,Ct.close(),He()):ht.type==="error"&&(Ct.close(),st(new Error("error"in ht&&typeof ht.error=="string"?ht.error:HD()))))},Ct.onerror=()=>{Ct.close(),st(new Error(zv()))},Ct.onclose=()=>{Yt.dispose(),m.current=null,un||st(new Error(zv()))}});const je=(await uf(!0,!0)).find(He=>He.id==="opencode"&&He.agentReady);if(!je)throw new Error(aht());return D("opencode"),je})();return k.current=Ie,Ie.catch(()=>{}),Ie};T.useEffect(()=>{t||v.current||!(b!=null&&b.length)||b.some(Ie=>Ie.catalogPending)||!b.every(Ie=>!Ie.installed&&!Ie.installBroken)||kt()},[b,t]),T.useEffect(()=>{s===1&&_&&i(2)},[s,_]);const qt=()=>{i(_?2:1)},dt=async(Ie="complete")=>{var pe;if(!(y||Ie==="complete"&&(!ot||!Le))){C(!0),z(null),j("");try{const je=_?await kt():b==null?void 0:b.find(_t=>_t.id===M&&_t.agentReady&&!_t.catalogPending);if(!je)throw new Error(UD());if(Ie==="setup")return;const He=YSn(je,((pe=je.models[0])==null?void 0:pe.id)??null),st=await r.mutateAsync([He,{researchAreas:U,otherArea:U.includes("Other")?Q:null,background:Z||null,papers:$}]);e(st.project,st.selection)}catch(je){_&&(k.current=null);const He=je instanceof Error?je.message:String(je);z(He),j([w.current,He].filter(Boolean).join(` -`))}finally{C(!1)}}};return f.jsxs("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${s===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:[!t&&u&&c.data&&f.jsx(f$,{harness:u,commands:c.data[u.id],onReady:Ie=>{D(Ie.id)},onClose:()=>{h(null)}}),f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${s===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:s===0?f.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:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(dw,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:Blt()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:K_t()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:F0t()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:edt()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:a0t()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:Oft()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:jmt()})]})})]})]}),f.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:f.jsxs(De,{variant:"primary",size:"large",onClick:qt,disabled:I&&b===null,children:[I&&b===null?f.jsx(jt,{}):null,fz()," ",f.jsx(W1,{size:20})]})})]}):s===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(dw,{}),f.jsx("span",{children:d0t()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:i_t()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:Jdt()}),b!==null&&!be&&!Re&&f.jsx("p",{className:jj,children:Vpt()}),b!==null&&be&&M===null&&f.jsx("p",{className:jj,children:f_t()}),(x===null||ce)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(Tj,{gitVersion:x,error:ce}),ce?f.jsx("p",{className:hw,children:tw()}):f.jsx("p",{className:hw,children:dz()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:b!==null?b.map(Ie=>{var pe;return f.jsx(JSn,{h:Ie,remote:t,selected:M===Ie.id,onSelect:()=>D(Ie.id),commands:(pe=c.data)==null?void 0:pe[Ie.id],onSetup:()=>h(Ie)},Ie.id)}):G?f.jsx("div",{className:J_,children:tw()}):f.jsxs(Kr,{className:"py-2",children:[f.jsx(jt,{})," ",dft()]})}),c.isError&&f.jsxs("p",{className:J_,children:[OWe()," ",f.jsx(De,{variant:"ghost",onClick:()=>void c.refetch(),children:ti()})]}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(De,{variant:"ghost",onClick:()=>i(0),children:[f.jsx(R0,{size:12})," ",_z()]}),f.jsxs(De,{variant:"ghost",onClick:()=>Ne(!0,!0),disabled:I,children:[f.jsx(Ga,{size:12,className:I?"animate-[spin_0.9s_linear_infinite]":""})," ",Ev()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(De,{variant:"primary",onClick:()=>i(2),disabled:I||!be||M===null||!Le,title:I||!be&&Re?pmt():be?M===null?P_t():ce?Rht():x===void 0?cmt():x===null?hdt():void 0:Bpt(),children:[fz()," ",f.jsx(W1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(dw,{}),!_&&f.jsx("span",{children:y0t()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:N0t()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:d$,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:wmt()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:M_t()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:KSn.map(Ie=>f.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:[f.jsx("input",{type:"checkbox",checked:U.includes(Ie.id),onChange:()=>Ze(Ie.id),disabled:y}),f.jsx("span",{children:Ie.label()})]},Ie.id))}),U.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:Q,onChange:Ie=>V(Ie.target.value),disabled:y,placeholder:O0t(),"aria-label":dht()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:Vht()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:Z,onChange:Ie=>Y(Ie.target.value),disabled:y,rows:4,placeholder:yft()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:Bht()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:Vlt()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:F,onChange:Ie=>q(Ie.target.value),disabled:y,placeholder:ipt()}),ae?f.jsx("div",{className:J_,children:fpt()}):K.length>0?f.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-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:K.map(Ie=>f.jsxs("button",{type:"button",onClick:()=>xe(Ie),disabled:y,children:[f.jsx(D0,{children:Aj(Ie.title)}),f.jsx("span",{className:"id",children:Ie.paperId})]},Ie.paperId))}):null]}),$.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:$.map(Ie=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-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]: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:[f.jsx(D0,{children:Ie.title||Ie.paperId}),f.jsx("span",{className:"id",children:Ie.paperId}),f.jsx("button",{type:"button","aria-label":QZ({name:Ce(Ie.paperId)}),onClick:()=>rt(Ie.paperId),disabled:y,children:f.jsx(cr,{size:12})})]},Ie.paperId))})]})}),!ot&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:U.length===0?E_t():aft()}),_&&!Le&&f.jsxs("div",{className:"mt-5",role:"status",children:[f.jsx(Tj,{gitVersion:x,error:ce}),f.jsx("p",{className:hw,children:ce?tw():dz()}),f.jsx(De,{onClick:()=>Ne(!0,!0),disabled:I,children:Ev()})]}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(De,{variant:"ghost",onClick:()=>i(_?0:1),disabled:y,children:[f.jsx(R0,{size:12})," ",_z()]}),f.jsx("div",{className:"flex-1"}),f.jsx(De,{variant:"primary",onClick:()=>void dt(),disabled:y||!Le||!_&&M===null||!ot,children:y?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",Rpt()]}):f.jsxs(f.Fragment,{children:[Fft()," ",f.jsx(W1,{size:13})]})})]}),M===null&&!_&&f.jsx("p",{className:VSn,children:Lmt()}),N&&f.jsxs("div",{role:"alert",className:"mt-8 grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2.5 rounded-md border border-danger-notice-border bg-accent-red-subtle px-3 py-2",children:[f.jsx(pS,{size:16,className:"shrink-0 text-accent-red"}),f.jsx("p",{className:"m-0 min-w-0 flex-1 text-sm text-text break-words",children:N}),_&&f.jsx(De,{size:"small",onClick:()=>void dt(ot&&Le?"complete":"setup"),disabled:y,children:ti()}),_&&f.jsx(De,{variant:"ghost",size:"small",className:"col-start-2 justify-self-start",disabled:y,onClick:()=>{p(!1),z(null),i(1)},children:b_t()}),f.jsxs("details",{className:"col-start-2 col-span-2 min-w-0 text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:Nft()}),f.jsx("pre",{className:"mt-2 mb-0 max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-md border border-danger-notice-border bg-background px-2 py-1.5 font-mono text-xs",children:A||N})]})]})]})})]})}function Aj(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function XSn(e){return e.catalogPending?{tone:"warning",label:of()}:e.agentReady?{tone:"success",label:e.authMethod==="local"||!e.authenticated?Jk():Jpt()}:e.installed?e.installBroken?{tone:"warning",label:odt()}:e.authMethod==="local"?{tone:"warning",label:YD()}:e.needsConfigRepair||e.authState==="unknown"?{tone:"warning",label:W0t()}:e.authState==="unsupported"?{tone:"warning",label:tmt()}:e.installed?{tone:"warning",label:XD()}:{tone:"neutral",label:hz()}:{tone:"neutral",label:hz()}}function YSn(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:Ob(e,n).defaultId}}function ZSn({harness:e}){return f.jsx(xh,{harness:e,size:26})}function JSn({h:e,remote:n,selected:t,onSelect:r,commands:s,onSetup:i}){var w;const a=!n&&!e.needsConfigRepair&&!e.catalogPending&&(!e.installed||e.installBroken||e.authState==="unsupported"||e.authMethod!=="local"&&e.authMethod!=="apiKey"&&(e.authState==="needsLogin"||e.authState==="unknown")),o=!e.agentReady&&a,c=a&&(!e.installed||!e.agentReady&&e.authState==="needsLogin"),u=XSn(e),h=t?{tone:"success",label:bpt()}:u,_=(w=e.version)==null?void 0:w.replace(/\s*\(.*\)$/,""),p=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan].filter(Boolean).join(" · "),m=f.jsxs("div",{className:"onb-card-head flex flex-wrap items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(ZSn,{harness:e.id}),f.jsxs("span",{className:"flex flex-col gap-1",children:[f.jsxs("span",{className:"onb-card-name flex flex-wrap items-center gap-2 text-base font-semibold tracking-[-0.01em]",children:[e.name,c&&f.jsx(Fd,{tone:u.tone,className:"font-normal",children:u.label})]}),o&&!c&&f.jsx(Fd,{tone:h.tone,children:h.label})]})]}),o?f.jsxs(De,{size:"small",onClick:i,disabled:!s,"aria-haspopup":"dialog",title:JWe(),children:[f.jsx(vo,{size:14}),!e.installed||e.installBroken?yWe():e.authState==="unsupported"?EQe():qD()]}):f.jsx(Fd,{tone:h.tone,children:h.label})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-4 px-4 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${t?" selected":""}`,"aria-pressed":t,onClick:r,children:[m,e.id!=="opencode"&&f.jsx("div",{className:"onb-card-detail flex items-center gap-1.5 text-sm",children:e.accountLoading?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",xdt()]}):f.jsxs(f.Fragment,{children:[e.account??(e.authMethod==="apiKey"?Zk():null),e.plan?` · ${e.plan}`:""]})}),p&&f.jsx("div",{className:J_,children:p})]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-4 px-4 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[m,e.authState==="unsupported"&&_&&f.jsx("div",{className:J_,children:_}),!o&&e.agentNote&&f.jsx("div",{className:`${J_} [&_code]:whitespace-pre-wrap break-words`,children:df(e.agentNote)})]})}function Tj({gitVersion:e,error:n}){return f.jsxs("div",{className:d$,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:zdt()}),f.jsx(Fd,{tone:e?"success":n||e===null?"danger":"warning",children:e?Jk():n?But():e===null?QD():of()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:J_,children:e??Zut()})]})}const e6n="/assets/slurm-logo-aGSXVZcE.svg",t6n="/assets/thinking-machines-BOdslTfm.png";function n6n(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 DD();case"tinker_job":return"Tinker";default:return e||"—"}}function r6n({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.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"}),f.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"}),f.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"}),f.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"}),f.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"}),f.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"}),f.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 s6n({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.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"}),f.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)"}),f.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)"}),f.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"}),f.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"}),f.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)"}),f.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)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function i6n({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.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 a6n({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.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 o6n({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.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 c6n({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:t6n,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function l6n({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:e6n,width:e,height:e,alt:"","aria-hidden":"true"})}function Ub({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.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 Fh({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(s6n,{size:n});case"hf_job":return f.jsx(r6n,{size:n});case"k8s_job":return f.jsx(i6n,{size:n});case"ssh_job":return f.jsx(gj,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(l6n,{size:n});case"ray_job":return f.jsx(a6n,{size:n});case"openresearch_job":return f.jsx(o6n,{size:n});case"tinker_job":return f.jsx(c6n,{size:n});case"local_job":return f.jsx(skn,{size:n,strokeWidth:1.5});default:return f.jsx(gj,{size:n})}}function RS({backend:e}){const n=oS(e),t=_wn(e);return n?f.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:[f.jsx(Fh,{kind:n}),f.jsx("span",{className:"backend-name",children:n6n(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.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 pw(e,n){const[t,r]=T.useState(e);return T.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function c1(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function u6n(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function _6n(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function f6n(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function d6n({onCreated:e,onCancel:n,remote:t=!1}){var Ir,bn,yn,Pn;const[r,s]=T.useState("blank"),[i,a]=T.useState(""),[o,c]=T.useState(!1),[u,h]=T.useState(""),[_,p]=T.useState(!1),[m,w]=T.useState(!1),[k,v]=T.useState(!1),[b,x]=T.useState(null),[y,C]=T.useState(!1),[N,z]=T.useState(!1),[A,j]=T.useState(""),[M,D]=T.useState(null),[I,B]=T.useState(!1),U=T.useRef(0),H=T.useRef(0),Q=T.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),V=r==="paper"?_6n(M==null?void 0:M.repoUrl):null,Z=i.trim()?`~/OpenResearch/${c1(i,48)}`:"",Y=`~/OpenResearch/${c1(i||(M==null?void 0:M.title)||(M==null?void 0:M.paperId)||"")}`,$=r==="blank"&&!_?Z:r==="paper"&&M&&!_?Y:u,L=pw($.trim(),200),F=ut({...d0(L),enabled:!!L&&L===$.trim()}),q=L===$.trim()?F.data??null:null,K=L===$.trim()?((Ir=F.error)==null?void 0:Ir.message)??null:null,ne=!!$.trim()&&(L!==$.trim()||F.isFetching),ae=V??(r==="folder"&&(q!=null&&q.githubOwner)&&q.githubRepo?{owner:q.githubOwner,repo:q.githubRepo}:null),ue=ut(n4n()),se=((bn=ue.data)==null?void 0:bn.login)??(ue.isPending?void 0:null),G=ut(cS()),oe=T.useRef(!1);T.useEffect(()=>{oe.current||!G.data||(oe.current=!0,z(G.data.githubForNewProjects))},[G.data]);const ce=pw(i.trim(),150),he=ut({...r4n(ce),enabled:ce===i.trim()}),be=ce===i.trim()?((yn=he.data)==null?void 0:yn.repo)??c1(i,48):c1(i,48),Re=ce!==i.trim()||he.isFetching,Le=ut({...nj((ae==null?void 0:ae.owner)??"",(ae==null?void 0:ae.repo)??""),enabled:!!ae,subscribed:!!ae}),Ke=!!ae&&Le.isFetching,Ne=ae&&((Pn=Le.data)!=null&&Pn.canPush)?`github.com/${ae.owner}/${ae.repo}`:null,xe=pw(A.trim(),350),rt=u6n(xe),Ze=r==="paper"&&!M&&xe===A.trim(),ot=ut({..._I(xe),enabled:Ze&&!rt&&xe.length>=3,subscribed:Ze&&!rt&&xe.length>=3}),kt=ut({...D3(rt??""),enabled:Ze&&!!rt,subscribed:Ze&&!!rt}),qt=Ze&&!rt?ot.data??[]:[],dt=Ze&&ot.isSuccess?xe:"",pt=I||r==="paper"&&!M&&(xe!==A.trim()||(rt?kt.isFetching:ot.isFetching));T.useEffect(()=>{var Et;!Ze||!rt||!kt.data||(D(kt.data),o||a(((Et=kt.data.title)==null?void 0:Et.trim())||kt.data.paperId))},[Ze,rt,kt.data,o]),T.useEffect(()=>{const Et=rt?kt.error:ot.error;Ze&&Et&&x(Et.message)},[Ze,rt,kt.error,ot.error]);const Ie=dn({mutationFn:Kyn});async function pe(Et){var In;const Bt=++U.current;B(!0),x(null);try{const xr=await et.fetchQuery(D3(Et));if(Bt!==U.current)return;D(xr),o||a(((In=xr.title)==null?void 0:In.trim())||xr.paperId)}catch(xr){Bt===U.current&&x(xr instanceof Error?xr.message:String(xr))}finally{Bt===U.current&&B(!1)}}function je(){U.current+=1,H.current+=1,D(null),j(""),B(!1),w(!1),h(""),p(!1),Q.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function He(Et){if(Et===r)return;U.current+=1,H.current+=1,Q.current[r]={name:i,nameTouched:o,path:u,pathTouched:_};const Bt=Q.current[Et];s(Et),x(null),B(!1),w(!1),a(Bt.name),c(Bt.nameTouched),h(Bt.path),p(Bt.pathTouched)}async function st(){if(m)return;const Et=++H.current;w(!0),x(null);try{const Bt=await Vyn();if(Et!==H.current||!Bt)return;if(p(!0),h(Bt),et.invalidateQueries(d0(Bt)),r==="folder"&&!o){const In=Bt.replace(/[\\/]+$/,"").split(/[\\/]/).pop();In&&a(In)}}catch(Bt){Et===H.current&&x(Bt instanceof Error?Bt.message:String(Bt))}finally{Et===H.current&&w(!1)}}async function _t(Et){if(Et.preventDefault(),!!Nt){v(!0),x(null);try{const Bt=await et.fetchQuery({...d0($.trim()),staleTime:0});if(Bt.exists&&Bt.directory===!1)throw new Error(J2());if(r==="blank"&&Bt.exists)throw new Error(iz());if(r==="paper"&&Bt.empty===!1)throw new Error(uz());N&&ae&&await et.fetchQuery({...nj(ae.owner,ae.repo),staleTime:0}).catch(()=>null);const In=await Ie.mutateAsync({name:i.trim(),path:$.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:N,locale:E(),...r==="paper"&&M?{paperId:M.paperId,cloneUrl:M.repoUrl??void 0}:{}});e(In.project,In.githubPublicationError)}catch(Bt){x(Bt instanceof Error?Bt.message:String(Bt))}finally{v(!1)}}}const Ct=i.trim(),bt=r==="paper"&&M&&!M.repoUrl?M.paperId:null,Yt=r==="folder"&&(q==null?void 0:q.gitState)==="ready"?q.resolvedPath??null:null,un=Ct!==""&&(bt!==null||Yt!==null);T.useEffect(()=>{if(!un)return;const Et=window.setTimeout(()=>{Jyn({name:Ct,paperId:bt??void 0,path:Yt??void 0,locale:E()}).catch(()=>{})},1200);return()=>window.clearTimeout(Et)},[un,Ct,bt,Yt]);const Tt=(q==null?void 0:q.gitVersion)===null,ht=r==="folder"&&!!$.trim()&&q!==null&&q.exists===!1,mt=r==="blank"&&(q==null?void 0:q.exists)===!0,_n=!!$.trim()&&(q==null?void 0:q.exists)===!0&&q.directory===!1,gs=r==="paper"&&!!(M!=null&&M.repoUrl)&&(q==null?void 0:q.empty)===!1,br=r==="paper"&&!!M&&!(M!=null&&M.repoUrl)&&(q==null?void 0:q.empty)===!1,Kt=r==="folder"&&((q==null?void 0:q.gitState)==="detached"||(q==null?void 0:q.gitState)==="invalid"),Bn=_&&!$.trim()||_n||gs||br,_r=_&&!$.trim()||_n||mt,yr=_&&!$.trim()?lz():_n?J2():mt?iz():null,Wr=_&&!$.trim()?lz():_n?J2():gs?uz():br?Est():null,Nt=!!(i.trim()&&$.trim())&&!k&&!m&&!ne&&q!==null&&!K&&!Tt&&!ht&&!mt&&!_n&&!gs&&!br&&!Kt&&(r!=="paper"||!!M)&&(!N||typeof se=="string"&&!Re&&!Ke),vn=Ne??`github.com/${se??"you"}/${be}`,fn=se===void 0||Re||Ke,hn=r==="paper"&&!M&&A.trim().length>=3&&dt===A.trim()&&!pt&&qt.length===0&&!b;return f.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-normal [&_.repo-hint]:text-sm [&_.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-start [&_.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-control-subtle [&_.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-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.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]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-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-danger-notice-border [&_.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-start [&_.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-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.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-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_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 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:_t,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>He("blank"),children:$it()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>He("folder"),children:Cat()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>He("paper"),children:Bat()})]}),r==="paper"&&!M&&f.jsxs("label",{className:"!font-normal",children:[Eot(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:A,onChange:Et=>{x(null),j(Et.target.value)},placeholder:Got()}),!hn&&f.jsx("span",{className:"repo-hint",children:pt?blt():ilt()}),hn&&f.jsx("span",{className:"project-path-notice block",children:iot()}),qt.length>0&&f.jsx("div",{className:"paper-results",children:qt.map(Et=>f.jsxs("button",{type:"button",onClick:()=>void pe(Et.paperId),children:[f.jsx(D0,{children:Et.title}),f.jsx("span",{className:"id",children:Et.paperId})]},Et.paperId))})]}),M&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(D0,{className:"block",children:M.title||M.paperId}),M.repoUrl&&f.jsx("div",{className:"id",children:f6n(M.repoUrl)})]}),f.jsx(De,{size:"small",type:"button","aria-label":iat(),onClick:je,children:Zit()})]}),!M.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(pS,{size:16})," ",fot()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:bot()})]})]}),(r!=="paper"||M)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:cz()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:Et=>{c(!0),a(Et.target.value)},placeholder:oz()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:M!=null&&M.repoUrl?Jst():ew()}),f.jsx("input",{className:"text-sm font-normal",value:$,onChange:Et=>{p(!0),h(Et.target.value)},"aria-describedby":Bn?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),ne&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:az()}),Bn&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Wr})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?Mst({path:Ce(u)}):rz(),disabled:m,title:u||void 0,onClick:()=>void st(),children:[f.jsx(Lu,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?Vst():u||rz()}),f.jsx(Ua,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:ew()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:Et=>{p(!0),h(Et.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:ew()}),f.jsx("input",{className:"text-sm font-normal",value:$,onChange:Et=>{p(!0),h(Et.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":_r?"blank-destination-description":void 0,spellCheck:!1}),ne&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:az()}),_r&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:yr})]}):null,r!=="blank"&&$&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:cz()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:Et=>{c(!0),a(Et.target.value)},placeholder:oz()})]}),Tt&&f.jsx("div",{className:"project-path-notice error",children:Vat()}),!Tt&&r==="folder"&&u.trim()&&!ne&&(q==null?void 0:q.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:ict()}),!Tt&&r==="folder"&&u.trim()&&!ne&&_n&&f.jsx("div",{className:"project-path-notice error",children:bct()}),!Tt&&r==="folder"&&!ne&&(q==null?void 0:q.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:fat()}),!Tt&&r==="folder"&&!ne&&(q==null?void 0:q.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:fct()}),K&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:K})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||M)&&$&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${N&&se===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(Et=>!Et),children:[N?se===null?fst():bst():WD(),f.jsx(sc,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:N,onChange:Et=>z(Et.target.checked),disabled:k}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:Zot()})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:fn?Ect({repository:Ce(vn)}):Ne?Pct({repository:Ce(vn)}):Mct({repository:Ce(vn)})}),f.jsx("span",{children:Rat()}),se===null&&f.jsx("span",{children:flt({command:Ce("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(De,{type:"button",onClick:n,children:Git()}),f.jsx(De,{variant:"primary",className:"ms-auto",disabled:!Nt,children:k?bit():r==="paper"?M!=null&&M.repoUrl?ait():sz():r==="folder"?Elt():sz()})]})]})}function h$({onClose:e,onCreated:n,remote:t=!1}){const r=T.useRef(null),s=T.useRef(e);return s.current=e,T.useEffect(()=>{const i=r.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"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const c=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.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 h=o();if(h.length===0){u.preventDefault(),i.focus();return}const _=h[0],p=h[h.length-1];u.shiftKey&&document.activeElement===_?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),_.focus())};return document.addEventListener("keydown",c,!0),()=>{document.removeEventListener("keydown",c,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:sL()}),f.jsx(d6n,{onCancel:e,onCreated:n,remote:t})]})})}function h6n({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=T.useRef(null),a=T.useRef(r),o=T.useRef(n);a.current=r,o.current=n,T.useEffect(()=>{const u=i.current;if(!u)return;const h=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(_()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const w=_();if(w.length===0){m.preventDefault(),u.focus();return}const k=w[0],v=w[w.length-1];m.shiftKey&&document.activeElement===k?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),k.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),h==null||h.focus()}},[]);const c=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:Pwt()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:awt({name:na(e.name)})}),f.jsx("p",{className:"m-0",children:c?d4t():y4t()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(De,{disabled:n,onClick:r,children:Ewt()}),f.jsx(De,{variant:"danger",disabled:n,onClick:s,children:n?e4t():Kwt()})]})]})})}function Rj(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function p6n({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=T.useState(!1),[o,c]=T.useState(null),[u,h]=T.useState(null),[_,p]=T.useState(null),m=ut(t4n()),w=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function k(v){c(v.id),h(null);try{await nxn(v.id),h(null),p(null),r(v.id)}catch(b){h(b instanceof Error?b.message:String(b))}finally{c(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:K4t()}),f.jsxs(De,{onClick:()=>a(!0),children:[f.jsx(Ph,{size:15})," ",sL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:P4t()}),f.jsx("span",{children:vz()}),f.jsx("span",{children:bz()}),f.jsx("span",{children:yz()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:M4t()}):[...e].sort((v,b)=>{var C,N;const x=((C=w[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((N=w[b.id])==null?void 0:N.lastMessageAt)??b.createdAt)-x||v.name.localeCompare(b.name)}).map(v=>{const b=w[v.id],x=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=x?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:x.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):Nv(),C=b?b.activeAgents>0?V2t({count:Xt(b.activeAgents)}):a3t():"—",N=b?b.totalAgents===1?b3t():J2t({count:Xt(b.totalAgents)}):"—",z=b?b.runningExperiments>0?E3t({count:Xt(b.runningExperiments)}):b.totalExperiments===0?nS():xz({count:Xt(b.totalExperiments)}):"—",A=b&&b.runningExperiments>0?xz({count:Xt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":tZ({name:na(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[Mwt()," ",go(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[bwt()," ",Ce(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":o3({name:na(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),h(null),p(v)},children:f.jsx(Af,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vz()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Rj,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:N})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:bz()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Rj,{}),z]}),A&&f.jsx("span",{className:"text-xs text-muted",children:A})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:yz()}),x?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:x,target:"_blank",rel:"noreferrer","aria-label":Sv({name:na(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(Ub,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ce(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(h$,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),_&&f.jsx(h6n,{project:_,deleting:o===_.id,error:u,onClose:()=>{h(null),p(null)},onConfirm:()=>void k(_)})]})}function p$(){const e=T.useSyncExternalStore(Xwn,Jz,Jz);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":d3()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(pS,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:d3()})]})]})}function m6n({onClose:e,onConfigureSsh:n}){var v,b,x;const t=dn({mutationFn:y=>s2n(...y)}),r=ut(rI()),s=ut(Cwn()),i=((v=r.data)==null?void 0:v.hosts)??null,a=s.data??[],[o,c]=T.useState(""),u=i?null:((b=r.error)==null?void 0:b.message)??((x=s.error)==null?void 0:x.message)??null,[h,_]=T.useState(null),p=T.useRef(null);Em(p,e);async function m(y){const C="__ORX_DESKTOP__"in window,N=C?null:window.open("/remote-launch","_blank");if(!C&&!N){xn(t6t(),"error");return}_(y);try{const z=await t.mutateAsync([y,{theme:c4n(),locale:E()}]);N?N.location.replace(z.gatewayUrl):window.open(z.gatewayUrl,"_blank"),e()}catch(z){N==null||N.close(),xn(z instanceof Error?z.message:String(z),"error")}finally{_(null)}}const w=i==null?void 0:i.filter(y=>y.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),k=new Map(a.map(y=>[y.host,y]));return ri.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Pt,{className:"absolute end-3.5 top-3.5","aria-label":M5t(),onClick:e,children:f.jsx(cr,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:m3()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:P5t()}),f.jsx(Gr,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:y=>c(y.target.value),placeholder:Sz(),"aria-label":Sz()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",wL()]}):(w==null?void 0:w.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:NSt()}):w==null?void 0:w.map(y=>{const C=k.get(y.host);return f.jsxs(De,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:h===y.host,onClick:()=>void m(y.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:y.host}),h===y.host?f.jsx(jt,{}):C?f.jsx("span",{className:"text-sm text-subtext",children:FSt()}):null]},y.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(De,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(XI,{size:15}),RL()]})})]})}),document.body)}function Pv({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}const g6n="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",v6n="/assets/ollama-logo-Bt9O-2K_.png",b6n="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",m$={id:"lmstudio",label:"LM Studio",icon:g6n,url:"http://127.0.0.1:1234/v1"},Y1=[m$,{id:"omlx",label:"oMLX",icon:b6n,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:v6n,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function g$({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var V,Z;const s=ut({...Own(),enabled:!t}),i=ut(Du()),a=(V=i.data)==null?void 0:V.find(Y=>Y.id==="opencode"),[o,c]=T.useState(t),u=()=>{c(!1),r==null||r()},[h,_]=T.useState("lmstudio"),p=Y1.find(Y=>Y.id===h)??m$,[m,w]=T.useState({}),k=m[p.id]??{baseUrl:p.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:v,models:b,model:x,contextWindow:y,error:C}=k,N=p.id==="ollama"?"":k.apiKey,z=Y=>{w($=>({...$,[p.id]:{...$[p.id]??k,...Y}}))},A=dn({mutationFn:dwn}),j=dn({mutationFn:async Y=>{var F;const $=await hwn(Y);if(!((F=(await uf(!0)).find(q=>q.id==="opencode"))!=null&&F.models.some(q=>q.id===$.model)))throw new Error(yJe());return $}}),M=dn({mutationFn:mwn}),D=Number(y),I=A.isPending||j.isPending,B=(Y={})=>z({models:[],model:null,error:null,...Y}),U=async()=>{B();try{const Y=await A.mutateAsync({baseUrl:v.trim(),apiKey:N});z({models:Y.models,model:Y.models[0]??null})}catch(Y){z({error:Y instanceof Error?Y.message:String(Y)})}},H=async()=>{if(x){z({error:null});try{const Y=await j.mutateAsync({name:p.label,baseUrl:v.trim(),apiKey:N,model:x,contextWindow:D});u(),n==null||n(Y.model)}catch(Y){z({error:Y instanceof Error?Y.message:String(Y)})}}},Q=async Y=>{try{await M.mutateAsync(Y)}catch($){xn($ instanceof Error?$.message:String($),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":JN(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:JN()}),f.jsxs(De,{disabled:I,onClick:()=>c(!0),"aria-haspopup":"dialog",children:[f.jsx(Ph,{size:14}),GD()]})]}),s.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:s.error.message}),f.jsx("div",{className:"space-y-3",children:(Z=s.data)==null?void 0:Z.map(Y=>f.jsx(y6n,{connection:Y,harnessReady:(a==null?void 0:a.agentReady)??!1,availableModels:(a==null?void 0:a.models.map($=>$.id))??[],checking:i.isFetching||((a==null?void 0:a.catalogPending)??!1),unknown:i.isError||!i.data,disabled:I||M.isPending,onRemove:()=>void Q(Y.id)},Y.id))})]}),o&&f.jsx(x6n,{busy:I,onClose:u,footer:f.jsxs(De,{variant:"primary",disabled:I||!e||b.length>0&&(!x||!Number.isSafeInteger(D)||D<4096),onClick:()=>void(b.length>0?H():U()),children:[I&&f.jsx(jt,{}),b.length>0?Aet():oJe()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:pet()}),f.jsx(bh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:oet()})]}),f.jsx(Yo,{choices:Y1,value:h,title:ZN(),header:ZN(),variant:"field",floating:!0,dropDown:!0,disabled:I,renderLabel:Y=>f.jsxs(f.Fragment,{children:[Y.id==="openai-compatible"?Xk():Y.label,Y.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:VD()})]}),renderIcon:Y=>{var L;const $=(L=Y1.find(F=>F.id===Y.id))==null?void 0:L.icon;return $?f.jsx("img",{src:$,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${Y.id==="ollama"?" dark:invert":""}`}):f.jsx(GI,{size:14,className:"shrink-0"})},onSelect:_}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:eJe()}),f.jsx(Gr,{value:v,disabled:I,onChange:Y=>{B({baseUrl:Y.target.value})}})]}),p.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:fL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:p.id==="lmstudio"?Qet():wet()}),f.jsx(Gr,{type:"password",autoComplete:"off",value:N,disabled:I,onChange:Y=>B({apiKey:Y.target.value})})]})]},p.id),b.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Yo,{choices:b.map(Y=>({id:Y,label:Y})),value:x,searchPlaceholder:ert(),title:f0(),header:f0(),variant:"field",floating:!0,dropDown:!0,disabled:I,onSelect:Y=>{z({model:Y})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:OJe()}),f.jsx(Gr,{type:"number",min:4096,step:1024,value:y,disabled:I,onChange:Y=>{z({contextWindow:Y.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:FJe()})]}),C&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:C})]})})]})}function y6n({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=dn({mutationFn:async()=>{try{await pwn(e.id)}finally{await uf(!0)}}}),c=Y1.find(w=>w.label===e.name||w.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),h=u.length>0&&n&&u.every(w=>t.includes(`${e.id}/${w}`)),_=o.isPending||r,p=s,m=h;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[c!=null&&c.icon?f.jsx("img",{src:c.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${c.id==="ollama"?" dark:invert":""}`}):f.jsx(GI,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(c==null?void 0:c.id)==="openai-compatible"?Xk():(c==null?void 0:c.label)??e.name,(c==null?void 0:c.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:VD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Vt,{variant:_||p?"default":m?"success":"warning",children:_?_a():p?SL():m?NJe():_o()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(De,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Ga,{size:14}),Ev()]}),f.jsx(Pt,{"aria-label":eet({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Af,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function x6n({busy:e,onClose:n,footer:t,children:r}){const s=T.useRef(null),i=()=>{e||n()};return Em(s,i,"input"),ri.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:GD()})}),f.jsx(Pt,{className:"absolute end-3.5 top-3.5","aria-label":cf(),onClick:i,disabled:e,children:f.jsx(cr,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(De,{onClick:i,disabled:e,children:cf()}),t]})]})}),document.body)}const v$=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),mw=["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-sm text-muted"].join(" "),mu={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor",antigravity:"Google Antigravity"};function w6n(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:Tv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:Ob(n,t).defaultId}}function ga(e){const[n,t]=T.useState(!1),r=T.useRef(null);return T.useEffect(()=>{if(!n)return;const s=a=>{var o,c;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((c=e==null?void 0:e.current)!=null&&c.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function k6n({value:e,onSelect:n,onOpenSettings:t,permissionChoices:r=[],defaultPermissionId:s,onSelectPermission:i,reasoningChoices:a=[],defaultReasoningId:o,onSelectReasoning:c,lockHarness:u=!1,openRequest:h=0,className:_}){var ce,he,be,Re,Le,Ke,Ne;const{data:p=S6n}=ut(Du()),m=ym(),[w,k]=T.useState(!1),v=T.useRef(null),b=T.useRef(null),{open:x,setOpen:y,ref:C}=ga(v),[N,z]=T.useState(""),[A,j]=T.useState("root"),M=()=>{y(!1),j("root"),z("")},D=T.useRef(h);T.useEffect(()=>{h!==D.current&&(D.current=h,j("models"),z(""),y(!0))},[h,y]),T.useEffect(()=>{var xe;x&&(A==="reasoning"||A==="speed"||A==="permissions")&&((xe=b.current)==null||xe.focus())},[x,A]);const I=T.useMemo(()=>{const xe=N.trim().toLowerCase();return(u&&e?p.filter(Ze=>Ze.id===e.harness):p).map(Ze=>{let ot=Ze.models;return xe?ot=ot.filter(kt=>`${kt.id} ${V1(kt)}`.toLowerCase().includes(xe)):(Ze.id==="opencode"||Ze.id==="cursor"||Ze.id==="antigravity")&&(ot=ot.slice(0,5)),{harness:Ze,models:ot,hidden:xe?0:Ze.models.length-ot.length}})},[p,N,u,e]),B=(xe,rt)=>{var ot;const Ze=(e==null?void 0:e.harness)===xe.id;n({harness:xe.id,model:rt,serviceTier:Tv(xe,rt,Ze?e==null?void 0:e.serviceTier:null),permissionMode:Ze?e.permissionMode:((ot=xe.options)==null?void 0:ot.defaultPermissionMode)??null,reasoningLevel:eI(xe,rt,Ze&&xe.models.some(kt=>kt.id===rt)?e.reasoningLevel:null)}),M()},U=(e==null?void 0:e.model)!=null?(ce=p.find(xe=>xe.id===e.harness))==null?void 0:ce.models.find(xe=>xe.id===e.model):void 0,H=e?e.model?U?V1(U):`${C3(e.model)} · ${nz()}`:f3():f0(),Q=(e==null?void 0:e.reasoningLevel)??o??((he=a[0])==null?void 0:he.id),V=(be=a.find(xe=>xe.id===Q))==null?void 0:be.label,Z=(e==null?void 0:e.permissionMode)??s??((Re=r[0])==null?void 0:Re.id),Y=(Le=r.find(xe=>xe.id===Z))==null?void 0:Le.label,$=(e==null?void 0:e.harness)==="opencode"?Vrt():hnt(),L=p.find(xe=>xe.id===(e==null?void 0:e.harness)),F=JL(L,e==null?void 0:e.model),q=Tv(L,e==null?void 0:e.model,e==null?void 0:e.serviceTier),K=(Ke=F.find(xe=>xe.id===q))==null?void 0:Ke.label,ne=xe=>{c==null||c(xe),M()},ae=xe=>{i==null||i(xe),M()},ue=xe=>{e&&n({...e,serviceTier:xe}),M()},se=(xe,rt,Ze)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>j(Ze),children:[f.jsx("span",{className:"flex-1",children:xe}),rt&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:rt}),f.jsx(Ua,{size:14,className:"shrink-0 text-muted"})]}),G=xe=>f.jsxs("div",{className:"flex shrink-0 items-center border-b border-border-variant px-1 py-1",children:[f.jsx(Pt,{ref:b,type:"button",size:"small",className:"model-submenu-header","aria-label":rL(),onClick:()=>{j("root"),z("")},children:f.jsx(II,{size:15})}),f.jsx("span",{className:"min-w-0 flex-1 text-sm font-medium text-text",children:xe}),A==="models"&&f.jsx(Pt,{type:"button",size:"small","aria-label":b3(),onClick:()=>{M(),t()},children:f.jsx(xS,{size:15,"aria-hidden":"true"})})]}),oe=(xe,rt,Ze,ot)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:xe.map(kt=>f.jsxs(Cn,{onClick:()=>ot(kt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[kt.label,kt.id===Ze&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",KD()]})]}),kt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:kt.description})]}),kt.id===rt&&f.jsx(gi,{size:13})]},kt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:C,children:[f.jsxs("button",{ref:v,type:"button",className:Cs("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",_),title:oX({label:`${H}${V?` · ${V}`:""}${K?` · ${K}`:""}`}),"aria-haspopup":"menu","aria-expanded":x,onClick:()=>{x?M():(j("root"),y(!0))},children:[q==="priority"?f.jsx(sSn,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(xh,{harness:e.harness,size:14}):null,q==="priority"&&f.jsxs("span",{className:"sr-only",children:[xnt()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[H,V&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:V})]}),f.jsx(sc,{size:14,className:"shrink-0 text-muted"})]}),x&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-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:[A==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[se(f0(),H,"models"),a.length>0&&se($,V,"reasoning"),F.length>0&&se(tz(),K,"speed"),r.length>0&&se(ez(),Y,"permissions")]}),A==="models"&&f.jsxs(f.Fragment,{children:[G(f0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:ort(),value:N,onChange:xe=>z(xe.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[I.map(({harness:xe,models:rt,hidden:Ze})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:v$,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(xh,{harness:xe.id,size:14}),xe.name]}),!xe.agentReady&&f.jsx("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:xe.catalogPending?of():f.jsxs(f.Fragment,{children:[f.jsx(mj,{size:10})," ",_o()]})})]}),xe.agentReady?f.jsxs(f.Fragment,{children:[!N.trim()&&f.jsxs(Cn,{onClick:()=>B(xe,null),children:[f.jsx("span",{children:f3()}),(e==null?void 0:e.harness)===xe.id&&(e==null?void 0:e.model)===null&&f.jsx(gi,{size:13})]}),xe.models.length===0&&xe.agentNote&&f.jsx("div",{className:mw,children:df(xe.agentNote)}),rt.map(ot=>f.jsxs(Cn,{title:ot.id,onClick:()=>B(xe,ot.id),children:[f.jsx("span",{children:V1(ot)}),(e==null?void 0:e.harness)===xe.id&&(e==null?void 0:e.model)===ot.id&&f.jsx(gi,{size:13})]},ot.id)),N.trim().length>0&&!xe.models.some(ot=>ot.id===N.trim())&&f.jsx(Cn,{onClick:()=>B(xe,N.trim()),children:f.jsxs("span",{children:[Brt({id:Ce(N.trim())})," · ",nz()]})})]}):f.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-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:xe.catalogPending?of():xe.agentNote?df(xe.agentNote):Knt()}),xe.id==="opencode"&&f.jsx(Cn,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var ot;M(),(ot=v.current)==null||ot.focus(),k(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[Dtt(),f.jsx(Ph,{size:14,"aria-hidden":"true"})]})}),xe.agentReady&&Ze>0&&f.jsx("div",{className:mw,children:Pnt({count:Xt(Ze)})})]},xe.id)),p.length===0&&f.jsx("div",{className:mw,children:ont()})]}),u&&e&&p.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(mj,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),hrt()]})]}),A==="reasoning"&&f.jsxs(f.Fragment,{children:[G($),oe(a,Q,o,ne)]}),A==="permissions"&&f.jsxs(f.Fragment,{children:[G(ez()),oe(r,Z,s,ae)]}),A==="speed"&&f.jsxs(f.Fragment,{children:[G(tz()),oe(F,q??void 0,"default",ue)]})]}),w&&f.jsx(g$,{dialogOnly:!0,installed:((Ne=p.find(xe=>xe.id==="opencode"))==null?void 0:Ne.installed)??!1,onClose:()=>k(!1),onConnected:xe=>{var Ze;const rt=(Ze=m.getQueryData(Du().queryKey))==null?void 0:Ze.find(ot=>ot.id==="opencode");rt&&(!u||(e==null?void 0:e.harness)==="opencode")&&B(rt,xe)}})]})}function Yo({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:c,numbered:u=!1,searchPlaceholder:h,renderIcon:_,renderLabel:p,floating:m=!1,onSelect:w,className:k}){var Q,V;const v=T.useRef(null),{open:b,setOpen:x,ref:y}=ga(v),C=T.useRef(null),[N,z]=T.useState("");if(T.useLayoutEffect(()=>{var L;const Z=C.current,Y=y.current;if(!b||!m||!Z||!Y)return;Z.matches(":popover-open")||(Z.showPopover(),(L=Z.querySelector("input"))==null||L.focus());const $=()=>{const F=Y.getBoundingClientRect(),q=window.innerHeight-F.bottom-12,K=F.top-12,ne=Math.min(380,Z.scrollHeight),ae=i?q>=ne||q>=K:KK;Z.style.width=`${F.width}px`,Z.style.minWidth="0",Z.style.maxHeight=`${Math.max(0,Math.min(380,ae?q:K))}px`,Z.style.left=`${F.left}px`,Z.style.top=`${ae?F.bottom+4:F.top-Z.getBoundingClientRect().height-4}px`};return $(),window.addEventListener("resize",$),window.addEventListener("scroll",$,!0),()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)}},[b,m,i,N,e.length,y]),e.length===0)return null;const A=n??t??((Q=e[0])==null?void 0:Q.id)??null,j=e.find(Z=>Z.id===A),M=e.find(Z=>Z.id===t),D=o==="bare"&&(M==null?void 0:M.id)===Av?M:void 0,B=(D?e.filter(Z=>Z.id!==D.id):e).filter(Z=>`${Z.label} ${Z.id}`.toLowerCase().includes(N.toLowerCase())),U=(j==null?void 0:j.label)??((V=e[0])==null?void 0:V.label)??"",H=Z=>{var Y;w(Z),x(!1),(Y=v.current)==null||Y.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Cs(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,k),title:c,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{z(""),x(Z=>!Z)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(_==null?void 0:_(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??U:U})]}),f.jsx(sc,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(Z=>Z.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:v$,children:r}),h&&f.jsx("input",{autoFocus:!0,"aria-label":h,placeholder:h,value:N,onChange:Z=>z(Z.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[D&&f.jsxs(f.Fragment,{children:[f.jsxs(Cn,{type:"button",onClick:()=>H(D.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[_==null?void 0:_(D),f.jsxs("span",{children:[(p==null?void 0:p(D))??D.label,f.jsx("span",{className:"option-default text-muted font-normal",children:Htt()})]})]}),A===D.id&&f.jsx(gi,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),B.map((Z,Y)=>f.jsxs(Cn,{type:"button",onClick:()=>H(Z.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[_==null?void 0:_(Z),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(Z))??Z.label,!D&&Z.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",KD()]})]}),Z.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:Z.description})]})]}),A===Z.id?f.jsx(gi,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:Y+1})]},Z.id))]})]})]})}const S6n=[];function G3({runtime:e,corner:n=!1}){const[t,r]=T.useState(!1),[s,i]=T.useState(!1),[a,o]=T.useState(!1),[c,u]=T.useState(null),h=ga();async function _(){if(c){o(!0);try{await QL(c),u(null)}catch(p){u(null),xn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:h.ref,children:[h.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:f5t({host:Ce(e.session.host),user:Ce(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ce(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(Cn,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await KL(),h.setOpen(!1)}catch(p){xn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?i5t():g3()}),f.jsx(hS,{content:WSt(),className:"me-2 shrink-0 text-subtext",children:f.jsx(gS,{size:15})})]}),f.jsx(Cn,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await WL()),h.setOpen(!1)}catch(p){xn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:aL()})]}),n?f.jsxs(De,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":h.open,onClick:()=>h.setOpen(p=>!p),children:[f.jsx(Pv,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:nw({host:Ce(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Pt,{size:"small","aria-label":nw({host:Ce(e.session.host)}),"aria-haspopup":"menu","aria-expanded":h.open,onClick:()=>h.setOpen(p=>!p),children:f.jsx(Pv,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:nw({host:Ce(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ce(e.session.version??"…")]})]})]})]}),c&&f.jsx(MI,{host:e.session.host,preview:c,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void _()})]})}const Fv="code-source-text",b$="code-source-wrap",y$="file-view-gutter text-right text-muted select-none";function x$(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}const C6n={cjs:"javascript",console:"bash",cts:"typescript",fish:"bash",html:"markup",js:"javascript",jsx:"javascript",md:"markdown",mjs:"javascript",mts:"typescript",py:"python",rb:"ruby",sh:"bash",shell:"bash",svg:"markup",terminal:"bash",ts:"typescript",tsx:"typescript",xml:"markup",yml:"yaml",zsh:"bash"},E6n={containerfile:"docker",dockerfile:"docker",justfile:"makefile",makefile:"makefile"};function V3(e){const n=e.trim().toLowerCase();return C6n[n]??n}function MS(e){var s;if(!e)return null;const n=((s=e.split("/").pop())==null?void 0:s.toLowerCase())??"",t=E6n[n];if(t)return V3(t);const r=n.lastIndexOf(".");return r===-1||r===n.length-1?null:V3(n.slice(r+1))}ic.displayName="clike";ic.aliases=[];function ic(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}zm.displayName="c";zm.aliases=[];function zm(e){e.register(ic),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}Gb.displayName="cpp";Gb.aliases=[];function Gb(e){e.register(zm),(function(n){var t=/\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 t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.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:t,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/}),n.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}}),n.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:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}OS.displayName="arduino";OS.aliases=["ino"];function OS(e){e.register(Gb),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}DS.displayName="bash";DS.aliases=["sh","shell"];function DS(e){(function(n){var t="\\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},s={bash:r,environment:{pattern:RegExp("\\$"+t),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("(\\{)"+t),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})/};n.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;|&]|[<>]\\()"+t),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:s},{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:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.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=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(q,K){return"(?:"+F[+K]+")"})}function r(L,F,q){return RegExp(t(L,F),"")}function s(L,F){for(var q=0;q>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={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 a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),c=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),h=a(i.type+" "+i.typeDeclaration+" "+i.other),_=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,w=t(/<<0>>(?:\s*<<1>>)?/.source,[m,_]),k=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,w]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[k,v]),x=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[_,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,k,v]),N={keyword:c,punctuation:/[<>()?,.:[\]]/},z=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,A=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[A]),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,[m,C]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,w]),lookbehind:!0,inside:N},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[k]),lookbehind:!0,inside:N},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:N},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,h,m]),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:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),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,[m,_]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(_),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,[o,w,m,C,c.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[w,p]),lookbehind:!0,greedy:!0,inside:n.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 M=A+"|"+z,D=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),I=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[D]),2),B=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,U=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[k,I]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[B,U]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[B]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[I]),inside:n.languages.csharp},"class-name":{pattern:RegExp(k),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var H=/:[^}\r\n]+/.source,Q=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[D]),2),V=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Q,H]),Z=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),Y=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Z,H]);function $(L,F){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[F,H]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[V]),lookbehind:!0,greedy:!0,inside:$(V,Q)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[Y]),lookbehind:!0,greedy:!0,inside:$(Y,Z)}],char:{pattern:RegExp(z),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}jm.displayName="markup";jm.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function jm(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(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\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:[t,"language-"+t],inside:e.languages[t]},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}Hh.displayName="css";Hh.aliases=[];function Hh(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.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\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,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:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}IS.displayName="diff";IS.aliases=[];function IS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r +`))}finally{C(!1)}}};return f.jsxs("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${s===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:[!t&&u&&c.data&&f.jsx(f$,{harness:u,commands:c.data[u.id],onReady:Ie=>{D(Ie.id)},onClose:()=>{h(null)}}),f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${s===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:s===0?f.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:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(dw,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:Blt()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:K_t()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:F0t()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:edt()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:a0t()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:Oft()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:jmt()})]})})]})]}),f.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:f.jsxs(De,{variant:"primary",size:"large",onClick:qt,disabled:I&&b===null,children:[I&&b===null?f.jsx(jt,{}):null,fz()," ",f.jsx(W1,{size:20})]})})]}):s===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(dw,{}),f.jsx("span",{children:d0t()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:i_t()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:Jdt()}),b!==null&&!be&&!Re&&f.jsx("p",{className:jj,children:Vpt()}),b!==null&&be&&M===null&&f.jsx("p",{className:jj,children:f_t()}),(x===null||ce)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(Tj,{gitVersion:x,error:ce}),ce?f.jsx("p",{className:hw,children:tw()}):f.jsx("p",{className:hw,children:dz()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:b!==null?b.map(Ie=>{var pe;return f.jsx(JSn,{h:Ie,remote:t,selected:M===Ie.id,onSelect:()=>D(Ie.id),commands:(pe=c.data)==null?void 0:pe[Ie.id],onSetup:()=>h(Ie)},Ie.id)}):G?f.jsx("div",{className:J_,children:tw()}):f.jsxs(Kr,{className:"py-2",children:[f.jsx(jt,{})," ",dft()]})}),c.isError&&f.jsxs("p",{className:J_,children:[OWe()," ",f.jsx(De,{variant:"ghost",onClick:()=>void c.refetch(),children:ti()})]}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(De,{variant:"ghost",onClick:()=>i(0),children:[f.jsx(R0,{size:12})," ",_z()]}),f.jsxs(De,{variant:"ghost",onClick:()=>Ne(!0,!0),disabled:I,children:[f.jsx(Ga,{size:12,className:I?"animate-[spin_0.9s_linear_infinite]":""})," ",Ev()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(De,{variant:"primary",onClick:()=>i(2),disabled:I||!be||M===null||!Le,title:I||!be&&Re?pmt():be?M===null?P_t():ce?Rht():x===void 0?cmt():x===null?hdt():void 0:Bpt(),children:[fz()," ",f.jsx(W1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(dw,{}),!_&&f.jsx("span",{children:y0t()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:N0t()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:d$,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:wmt()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:M_t()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:KSn.map(Ie=>f.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:[f.jsx("input",{type:"checkbox",checked:U.includes(Ie.id),onChange:()=>Ze(Ie.id),disabled:y}),f.jsx("span",{children:Ie.label()})]},Ie.id))}),U.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:Q,onChange:Ie=>V(Ie.target.value),disabled:y,placeholder:O0t(),"aria-label":dht()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:Vht()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:Z,onChange:Ie=>Y(Ie.target.value),disabled:y,rows:4,placeholder:yft()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:Bht()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:Vlt()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:F,onChange:Ie=>q(Ie.target.value),disabled:y,placeholder:ipt()}),ae?f.jsx("div",{className:J_,children:fpt()}):K.length>0?f.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-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:K.map(Ie=>f.jsxs("button",{type:"button",onClick:()=>xe(Ie),disabled:y,children:[f.jsx(D0,{children:Aj(Ie.title)}),f.jsx("span",{className:"id",children:Ie.paperId})]},Ie.paperId))}):null]}),$.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:$.map(Ie=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-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]: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:[f.jsx(D0,{children:Ie.title||Ie.paperId}),f.jsx("span",{className:"id",children:Ie.paperId}),f.jsx("button",{type:"button","aria-label":QZ({name:Ce(Ie.paperId)}),onClick:()=>rt(Ie.paperId),disabled:y,children:f.jsx(cr,{size:12})})]},Ie.paperId))})]})}),!ot&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:U.length===0?E_t():aft()}),_&&!Le&&f.jsxs("div",{className:"mt-5",role:"status",children:[f.jsx(Tj,{gitVersion:x,error:ce}),f.jsx("p",{className:hw,children:ce?tw():dz()}),f.jsx(De,{onClick:()=>Ne(!0,!0),disabled:I,children:Ev()})]}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(De,{variant:"ghost",onClick:()=>i(_?0:1),disabled:y,children:[f.jsx(R0,{size:12})," ",_z()]}),f.jsx("div",{className:"flex-1"}),f.jsx(De,{variant:"primary",onClick:()=>void dt(),disabled:y||!Le||!_&&M===null||!ot,children:y?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",Rpt()]}):f.jsxs(f.Fragment,{children:[Fft()," ",f.jsx(W1,{size:13})]})})]}),M===null&&!_&&f.jsx("p",{className:VSn,children:Lmt()}),N&&f.jsxs("div",{role:"alert",className:"mt-8 grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2.5 rounded-md border border-danger-notice-border bg-accent-red-subtle px-3 py-2",children:[f.jsx(pS,{size:16,className:"shrink-0 text-accent-red"}),f.jsx("p",{className:"m-0 min-w-0 flex-1 text-sm text-text break-words",children:N}),_&&f.jsx(De,{size:"small",onClick:()=>void dt(ot&&Le?"complete":"setup"),disabled:y,children:ti()}),_&&f.jsx(De,{variant:"ghost",size:"small",className:"col-start-2 justify-self-start",disabled:y,onClick:()=>{p(!1),z(null),i(1)},children:b_t()}),f.jsxs("details",{className:"col-start-2 col-span-2 min-w-0 text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:Nft()}),f.jsx("pre",{className:"mt-2 mb-0 max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-md border border-danger-notice-border bg-background px-2 py-1.5 font-mono text-xs",children:A||N})]})]})]})})]})}function Aj(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function XSn(e){return e.catalogPending?{tone:"warning",label:of()}:e.agentReady?{tone:"success",label:e.authMethod==="local"||!e.authenticated?Jk():Jpt()}:e.installed?e.installBroken?{tone:"warning",label:odt()}:e.authMethod==="local"?{tone:"warning",label:YD()}:e.needsConfigRepair||e.authState==="unknown"?{tone:"warning",label:W0t()}:e.authState==="unsupported"?{tone:"warning",label:tmt()}:e.installed?{tone:"warning",label:XD()}:{tone:"neutral",label:hz()}:{tone:"neutral",label:hz()}}function YSn(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:Ob(e,n).defaultId}}function ZSn({harness:e}){return f.jsx(xh,{harness:e,size:26})}function JSn({h:e,remote:n,selected:t,onSelect:r,commands:s,onSetup:i}){var w;const a=!n&&!e.needsConfigRepair&&!e.catalogPending&&(!e.installed||e.installBroken||e.authState==="unsupported"||e.authMethod!=="local"&&e.authMethod!=="apiKey"&&(e.authState==="needsLogin"||e.authState==="unknown")),o=!e.agentReady&&a,c=a&&(!e.installed||!e.agentReady&&e.authState==="needsLogin"),u=XSn(e),h=t?{tone:"success",label:bpt()}:u,_=(w=e.version)==null?void 0:w.replace(/\s*\(.*\)$/,""),p=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan].filter(Boolean).join(" · "),m=f.jsxs("div",{className:"onb-card-head flex flex-wrap items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(ZSn,{harness:e.id}),f.jsxs("span",{className:"flex flex-col gap-1",children:[f.jsxs("span",{className:"onb-card-name flex flex-wrap items-center gap-2 text-base font-semibold tracking-[-0.01em]",children:[e.name,c&&f.jsx(Fd,{tone:u.tone,className:"font-normal",children:u.label})]}),o&&!c&&f.jsx(Fd,{tone:h.tone,children:h.label})]})]}),o?f.jsxs(De,{size:"small",onClick:i,disabled:!s,"aria-haspopup":"dialog",title:JWe(),children:[f.jsx(vo,{size:14}),!e.installed||e.installBroken?yWe():e.authState==="unsupported"?EQe():qD()]}):f.jsx(Fd,{tone:h.tone,children:h.label})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-4 px-4 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${t?" selected":""}`,"aria-pressed":t,onClick:r,children:[m,e.id!=="opencode"&&f.jsx("div",{className:"onb-card-detail flex items-center gap-1.5 text-sm",children:e.accountLoading?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",xdt()]}):f.jsxs(f.Fragment,{children:[e.account??(e.authMethod==="apiKey"?Zk():null),e.plan?` · ${e.plan}`:""]})}),p&&f.jsx("div",{className:J_,children:p})]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-4 px-4 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[m,e.authState==="unsupported"&&_&&f.jsx("div",{className:J_,children:_}),!o&&e.agentNote&&f.jsx("div",{className:`${J_} [&_code]:whitespace-pre-wrap break-words`,children:df(e.agentNote)})]})}function Tj({gitVersion:e,error:n}){return f.jsxs("div",{className:d$,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:zdt()}),f.jsx(Fd,{tone:e?"success":n||e===null?"danger":"warning",children:e?Jk():n?But():e===null?QD():of()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:J_,children:e??Zut()})]})}const e6n="/assets/slurm-logo-aGSXVZcE.svg",t6n="/assets/thinking-machines-BOdslTfm.png";function n6n(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 DD();case"tinker_job":return"Tinker";default:return e||"—"}}function r6n({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.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"}),f.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"}),f.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"}),f.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"}),f.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"}),f.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"}),f.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 s6n({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.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"}),f.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)"}),f.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)"}),f.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"}),f.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"}),f.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)"}),f.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)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function i6n({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.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 a6n({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.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 o6n({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.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 c6n({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:t6n,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function l6n({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:e6n,width:e,height:e,alt:"","aria-hidden":"true"})}function Ub({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.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 Fh({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(s6n,{size:n});case"hf_job":return f.jsx(r6n,{size:n});case"k8s_job":return f.jsx(i6n,{size:n});case"ssh_job":return f.jsx(gj,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(l6n,{size:n});case"ray_job":return f.jsx(a6n,{size:n});case"openresearch_job":return f.jsx(o6n,{size:n});case"tinker_job":return f.jsx(c6n,{size:n});case"local_job":return f.jsx(skn,{size:n,strokeWidth:1.5});default:return f.jsx(gj,{size:n})}}function RS({backend:e}){const n=oS(e),t=_wn(e);return n?f.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:[f.jsx(Fh,{kind:n}),f.jsx("span",{className:"backend-name",children:n6n(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.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 pw(e,n){const[t,r]=T.useState(e);return T.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function c1(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function u6n(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function _6n(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function f6n(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function d6n({onCreated:e,onCancel:n,remote:t=!1}){var Ir,bn,yn,Pn;const[r,s]=T.useState("blank"),[i,a]=T.useState(""),[o,c]=T.useState(!1),[u,h]=T.useState(""),[_,p]=T.useState(!1),[m,w]=T.useState(!1),[k,v]=T.useState(!1),[b,x]=T.useState(null),[y,C]=T.useState(!1),[N,z]=T.useState(!1),[A,j]=T.useState(""),[M,D]=T.useState(null),[I,B]=T.useState(!1),U=T.useRef(0),H=T.useRef(0),Q=T.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),V=r==="paper"?_6n(M==null?void 0:M.repoUrl):null,Z=i.trim()?`~/OpenResearch/${c1(i,48)}`:"",Y=`~/OpenResearch/${c1(i||(M==null?void 0:M.title)||(M==null?void 0:M.paperId)||"")}`,$=r==="blank"&&!_?Z:r==="paper"&&M&&!_?Y:u,L=pw($.trim(),200),F=ut({...d0(L),enabled:!!L&&L===$.trim()}),q=L===$.trim()?F.data??null:null,K=L===$.trim()?((Ir=F.error)==null?void 0:Ir.message)??null:null,ne=!!$.trim()&&(L!==$.trim()||F.isFetching),ae=V??(r==="folder"&&(q!=null&&q.githubOwner)&&q.githubRepo?{owner:q.githubOwner,repo:q.githubRepo}:null),ue=ut(n4n()),se=((bn=ue.data)==null?void 0:bn.login)??(ue.isPending?void 0:null),G=ut(cS()),oe=T.useRef(!1);T.useEffect(()=>{oe.current||!G.data||(oe.current=!0,z(G.data.githubForNewProjects))},[G.data]);const ce=pw(i.trim(),150),he=ut({...r4n(ce),enabled:ce===i.trim()}),be=ce===i.trim()?((yn=he.data)==null?void 0:yn.repo)??c1(i,48):c1(i,48),Re=ce!==i.trim()||he.isFetching,Le=ut({...nj((ae==null?void 0:ae.owner)??"",(ae==null?void 0:ae.repo)??""),enabled:!!ae,subscribed:!!ae}),Ke=!!ae&&Le.isFetching,Ne=ae&&((Pn=Le.data)!=null&&Pn.canPush)?`github.com/${ae.owner}/${ae.repo}`:null,xe=pw(A.trim(),350),rt=u6n(xe),Ze=r==="paper"&&!M&&xe===A.trim(),ot=ut({..._I(xe),enabled:Ze&&!rt&&xe.length>=3,subscribed:Ze&&!rt&&xe.length>=3}),kt=ut({...D3(rt??""),enabled:Ze&&!!rt,subscribed:Ze&&!!rt}),qt=Ze&&!rt?ot.data??[]:[],dt=Ze&&ot.isSuccess?xe:"",pt=I||r==="paper"&&!M&&(xe!==A.trim()||(rt?kt.isFetching:ot.isFetching));T.useEffect(()=>{var Et;!Ze||!rt||!kt.data||(D(kt.data),o||a(((Et=kt.data.title)==null?void 0:Et.trim())||kt.data.paperId))},[Ze,rt,kt.data,o]),T.useEffect(()=>{const Et=rt?kt.error:ot.error;Ze&&Et&&x(Et.message)},[Ze,rt,kt.error,ot.error]);const Ie=dn({mutationFn:Kyn});async function pe(Et){var In;const Bt=++U.current;B(!0),x(null);try{const xr=await et.fetchQuery(D3(Et));if(Bt!==U.current)return;D(xr),o||a(((In=xr.title)==null?void 0:In.trim())||xr.paperId)}catch(xr){Bt===U.current&&x(xr instanceof Error?xr.message:String(xr))}finally{Bt===U.current&&B(!1)}}function je(){U.current+=1,H.current+=1,D(null),j(""),B(!1),w(!1),h(""),p(!1),Q.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function He(Et){if(Et===r)return;U.current+=1,H.current+=1,Q.current[r]={name:i,nameTouched:o,path:u,pathTouched:_};const Bt=Q.current[Et];s(Et),x(null),B(!1),w(!1),a(Bt.name),c(Bt.nameTouched),h(Bt.path),p(Bt.pathTouched)}async function st(){if(m)return;const Et=++H.current;w(!0),x(null);try{const Bt=await Vyn();if(Et!==H.current||!Bt)return;if(p(!0),h(Bt),et.invalidateQueries(d0(Bt)),r==="folder"&&!o){const In=Bt.replace(/[\\/]+$/,"").split(/[\\/]/).pop();In&&a(In)}}catch(Bt){Et===H.current&&x(Bt instanceof Error?Bt.message:String(Bt))}finally{Et===H.current&&w(!1)}}async function _t(Et){if(Et.preventDefault(),!!Nt){v(!0),x(null);try{const Bt=await et.fetchQuery({...d0($.trim()),staleTime:0});if(Bt.exists&&Bt.directory===!1)throw new Error(J2());if(r==="blank"&&Bt.exists)throw new Error(iz());if(r==="paper"&&Bt.empty===!1)throw new Error(uz());N&&ae&&await et.fetchQuery({...nj(ae.owner,ae.repo),staleTime:0}).catch(()=>null);const In=await Ie.mutateAsync({name:i.trim(),path:$.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:N,locale:E(),...r==="paper"&&M?{paperId:M.paperId,cloneUrl:M.repoUrl??void 0}:{}});e(In.project,In.githubPublicationError)}catch(Bt){x(Bt instanceof Error?Bt.message:String(Bt))}finally{v(!1)}}}const Ct=i.trim(),bt=r==="paper"&&M&&!M.repoUrl?M.paperId:null,Yt=r==="folder"&&(q==null?void 0:q.gitState)==="ready"?q.resolvedPath??null:null,un=Ct!==""&&(bt!==null||Yt!==null);T.useEffect(()=>{if(!un)return;const Et=window.setTimeout(()=>{Jyn({name:Ct,paperId:bt??void 0,path:Yt??void 0,locale:E()}).catch(()=>{})},1200);return()=>window.clearTimeout(Et)},[un,Ct,bt,Yt]);const Tt=(q==null?void 0:q.gitVersion)===null,ht=r==="folder"&&!!$.trim()&&q!==null&&q.exists===!1,mt=r==="blank"&&(q==null?void 0:q.exists)===!0,_n=!!$.trim()&&(q==null?void 0:q.exists)===!0&&q.directory===!1,gs=r==="paper"&&!!(M!=null&&M.repoUrl)&&(q==null?void 0:q.empty)===!1,br=r==="paper"&&!!M&&!(M!=null&&M.repoUrl)&&(q==null?void 0:q.empty)===!1,Gt=r==="folder"&&((q==null?void 0:q.gitState)==="detached"||(q==null?void 0:q.gitState)==="invalid"),Bn=_&&!$.trim()||_n||gs||br,_r=_&&!$.trim()||_n||mt,yr=_&&!$.trim()?lz():_n?J2():mt?iz():null,Wr=_&&!$.trim()?lz():_n?J2():gs?uz():br?Est():null,Nt=!!(i.trim()&&$.trim())&&!k&&!m&&!ne&&q!==null&&!K&&!Tt&&!ht&&!mt&&!_n&&!gs&&!br&&!Gt&&(r!=="paper"||!!M)&&(!N||typeof se=="string"&&!Re&&!Ke),vn=Ne??`github.com/${se??"you"}/${be}`,fn=se===void 0||Re||Ke,hn=r==="paper"&&!M&&A.trim().length>=3&&dt===A.trim()&&!pt&&qt.length===0&&!b;return f.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-normal [&_.repo-hint]:text-sm [&_.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-start [&_.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-control-subtle [&_.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-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.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]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-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-danger-notice-border [&_.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-start [&_.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-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.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-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_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 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:_t,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>He("blank"),children:$it()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>He("folder"),children:Cat()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>He("paper"),children:Bat()})]}),r==="paper"&&!M&&f.jsxs("label",{className:"!font-normal",children:[Eot(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:A,onChange:Et=>{x(null),j(Et.target.value)},placeholder:Got()}),!hn&&f.jsx("span",{className:"repo-hint",children:pt?blt():ilt()}),hn&&f.jsx("span",{className:"project-path-notice block",children:iot()}),qt.length>0&&f.jsx("div",{className:"paper-results",children:qt.map(Et=>f.jsxs("button",{type:"button",onClick:()=>void pe(Et.paperId),children:[f.jsx(D0,{children:Et.title}),f.jsx("span",{className:"id",children:Et.paperId})]},Et.paperId))})]}),M&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(D0,{className:"block",children:M.title||M.paperId}),M.repoUrl&&f.jsx("div",{className:"id",children:f6n(M.repoUrl)})]}),f.jsx(De,{size:"small",type:"button","aria-label":iat(),onClick:je,children:Zit()})]}),!M.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(pS,{size:16})," ",fot()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:bot()})]})]}),(r!=="paper"||M)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:cz()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:Et=>{c(!0),a(Et.target.value)},placeholder:oz()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:M!=null&&M.repoUrl?Jst():ew()}),f.jsx("input",{className:"text-sm font-normal",value:$,onChange:Et=>{p(!0),h(Et.target.value)},"aria-describedby":Bn?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),ne&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:az()}),Bn&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Wr})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?Mst({path:Ce(u)}):rz(),disabled:m,title:u||void 0,onClick:()=>void st(),children:[f.jsx(Lu,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?Vst():u||rz()}),f.jsx(Ua,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:ew()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:Et=>{p(!0),h(Et.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:ew()}),f.jsx("input",{className:"text-sm font-normal",value:$,onChange:Et=>{p(!0),h(Et.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":_r?"blank-destination-description":void 0,spellCheck:!1}),ne&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:az()}),_r&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:yr})]}):null,r!=="blank"&&$&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:cz()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:Et=>{c(!0),a(Et.target.value)},placeholder:oz()})]}),Tt&&f.jsx("div",{className:"project-path-notice error",children:Vat()}),!Tt&&r==="folder"&&u.trim()&&!ne&&(q==null?void 0:q.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:ict()}),!Tt&&r==="folder"&&u.trim()&&!ne&&_n&&f.jsx("div",{className:"project-path-notice error",children:bct()}),!Tt&&r==="folder"&&!ne&&(q==null?void 0:q.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:fat()}),!Tt&&r==="folder"&&!ne&&(q==null?void 0:q.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:fct()}),K&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:K})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||M)&&$&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${N&&se===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(Et=>!Et),children:[N?se===null?fst():bst():WD(),f.jsx(sc,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:N,onChange:Et=>z(Et.target.checked),disabled:k}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:Zot()})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:fn?Ect({repository:Ce(vn)}):Ne?Pct({repository:Ce(vn)}):Mct({repository:Ce(vn)})}),f.jsx("span",{children:Rat()}),se===null&&f.jsx("span",{children:flt({command:Ce("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(De,{type:"button",onClick:n,children:Git()}),f.jsx(De,{variant:"primary",className:"ms-auto",disabled:!Nt,children:k?bit():r==="paper"?M!=null&&M.repoUrl?ait():sz():r==="folder"?Elt():sz()})]})]})}function h$({onClose:e,onCreated:n,remote:t=!1}){const r=T.useRef(null),s=T.useRef(e);return s.current=e,T.useEffect(()=>{const i=r.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"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const c=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.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 h=o();if(h.length===0){u.preventDefault(),i.focus();return}const _=h[0],p=h[h.length-1];u.shiftKey&&document.activeElement===_?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),_.focus())};return document.addEventListener("keydown",c,!0),()=>{document.removeEventListener("keydown",c,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:sL()}),f.jsx(d6n,{onCancel:e,onCreated:n,remote:t})]})})}function h6n({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=T.useRef(null),a=T.useRef(r),o=T.useRef(n);a.current=r,o.current=n,T.useEffect(()=>{const u=i.current;if(!u)return;const h=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(_()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const w=_();if(w.length===0){m.preventDefault(),u.focus();return}const k=w[0],v=w[w.length-1];m.shiftKey&&document.activeElement===k?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),k.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),h==null||h.focus()}},[]);const c=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:Pwt()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:awt({name:na(e.name)})}),f.jsx("p",{className:"m-0",children:c?d4t():y4t()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(De,{disabled:n,onClick:r,children:Ewt()}),f.jsx(De,{variant:"danger",disabled:n,onClick:s,children:n?e4t():Kwt()})]})]})})}function Rj(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function p6n({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=T.useState(!1),[o,c]=T.useState(null),[u,h]=T.useState(null),[_,p]=T.useState(null),m=ut(t4n()),w=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function k(v){c(v.id),h(null);try{await nxn(v.id),h(null),p(null),r(v.id)}catch(b){h(b instanceof Error?b.message:String(b))}finally{c(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:K4t()}),f.jsxs(De,{onClick:()=>a(!0),children:[f.jsx(Ph,{size:15})," ",sL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:P4t()}),f.jsx("span",{children:vz()}),f.jsx("span",{children:bz()}),f.jsx("span",{children:yz()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:M4t()}):[...e].sort((v,b)=>{var C,N;const x=((C=w[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((N=w[b.id])==null?void 0:N.lastMessageAt)??b.createdAt)-x||v.name.localeCompare(b.name)}).map(v=>{const b=w[v.id],x=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=x?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:x.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):Nv(),C=b?b.activeAgents>0?V2t({count:Xt(b.activeAgents)}):a3t():"—",N=b?b.totalAgents===1?b3t():J2t({count:Xt(b.totalAgents)}):"—",z=b?b.runningExperiments>0?E3t({count:Xt(b.runningExperiments)}):b.totalExperiments===0?nS():xz({count:Xt(b.totalExperiments)}):"—",A=b&&b.runningExperiments>0?xz({count:Xt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":tZ({name:na(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[Mwt()," ",go(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[bwt()," ",Ce(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":o3({name:na(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),h(null),p(v)},children:f.jsx(Af,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vz()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Rj,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:N})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:bz()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Rj,{}),z]}),A&&f.jsx("span",{className:"text-xs text-muted",children:A})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:yz()}),x?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:x,target:"_blank",rel:"noreferrer","aria-label":Sv({name:na(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(Ub,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ce(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(h$,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),_&&f.jsx(h6n,{project:_,deleting:o===_.id,error:u,onClose:()=>{h(null),p(null)},onConfirm:()=>void k(_)})]})}function p$(){const e=T.useSyncExternalStore(Xwn,Jz,Jz);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":d3()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(pS,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:d3()})]})]})}function m6n({onClose:e,onConfigureSsh:n}){var v,b,x;const t=dn({mutationFn:y=>s2n(...y)}),r=ut(rI()),s=ut(Cwn()),i=((v=r.data)==null?void 0:v.hosts)??null,a=s.data??[],[o,c]=T.useState(""),u=i?null:((b=r.error)==null?void 0:b.message)??((x=s.error)==null?void 0:x.message)??null,[h,_]=T.useState(null),p=T.useRef(null);Em(p,e);async function m(y){const C="__ORX_DESKTOP__"in window,N=C?null:window.open("/remote-launch","_blank");if(!C&&!N){xn(t6t(),"error");return}_(y);try{const z=await t.mutateAsync([y,{theme:c4n(),locale:E()}]);N?N.location.replace(z.gatewayUrl):window.open(z.gatewayUrl,"_blank"),e()}catch(z){N==null||N.close(),xn(z instanceof Error?z.message:String(z),"error")}finally{_(null)}}const w=i==null?void 0:i.filter(y=>y.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),k=new Map(a.map(y=>[y.host,y]));return ri.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Pt,{className:"absolute end-3.5 top-3.5","aria-label":M5t(),onClick:e,children:f.jsx(cr,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:m3()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:P5t()}),f.jsx(Gr,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:y=>c(y.target.value),placeholder:Sz(),"aria-label":Sz()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",wL()]}):(w==null?void 0:w.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:NSt()}):w==null?void 0:w.map(y=>{const C=k.get(y.host);return f.jsxs(De,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:h===y.host,onClick:()=>void m(y.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:y.host}),h===y.host?f.jsx(jt,{}):C?f.jsx("span",{className:"text-sm text-subtext",children:FSt()}):null]},y.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(De,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(XI,{size:15}),RL()]})})]})}),document.body)}function Pv({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}const g6n="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",v6n="/assets/ollama-logo-Bt9O-2K_.png",b6n="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",m$={id:"lmstudio",label:"LM Studio",icon:g6n,url:"http://127.0.0.1:1234/v1"},Y1=[m$,{id:"omlx",label:"oMLX",icon:b6n,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:v6n,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function g$({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var V,Z;const s=ut({...Own(),enabled:!t}),i=ut(Du()),a=(V=i.data)==null?void 0:V.find(Y=>Y.id==="opencode"),[o,c]=T.useState(t),u=()=>{c(!1),r==null||r()},[h,_]=T.useState("lmstudio"),p=Y1.find(Y=>Y.id===h)??m$,[m,w]=T.useState({}),k=m[p.id]??{baseUrl:p.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:v,models:b,model:x,contextWindow:y,error:C}=k,N=p.id==="ollama"?"":k.apiKey,z=Y=>{w($=>({...$,[p.id]:{...$[p.id]??k,...Y}}))},A=dn({mutationFn:dwn}),j=dn({mutationFn:async Y=>{var F;const $=await hwn(Y);if(!((F=(await uf(!0)).find(q=>q.id==="opencode"))!=null&&F.models.some(q=>q.id===$.model)))throw new Error(yJe());return $}}),M=dn({mutationFn:mwn}),D=Number(y),I=A.isPending||j.isPending,B=(Y={})=>z({models:[],model:null,error:null,...Y}),U=async()=>{B();try{const Y=await A.mutateAsync({baseUrl:v.trim(),apiKey:N});z({models:Y.models,model:Y.models[0]??null})}catch(Y){z({error:Y instanceof Error?Y.message:String(Y)})}},H=async()=>{if(x){z({error:null});try{const Y=await j.mutateAsync({name:p.label,baseUrl:v.trim(),apiKey:N,model:x,contextWindow:D});u(),n==null||n(Y.model)}catch(Y){z({error:Y instanceof Error?Y.message:String(Y)})}}},Q=async Y=>{try{await M.mutateAsync(Y)}catch($){xn($ instanceof Error?$.message:String($),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":JN(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:JN()}),f.jsxs(De,{disabled:I,onClick:()=>c(!0),"aria-haspopup":"dialog",children:[f.jsx(Ph,{size:14}),GD()]})]}),s.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:s.error.message}),f.jsx("div",{className:"space-y-3",children:(Z=s.data)==null?void 0:Z.map(Y=>f.jsx(y6n,{connection:Y,harnessReady:(a==null?void 0:a.agentReady)??!1,availableModels:(a==null?void 0:a.models.map($=>$.id))??[],checking:i.isFetching||((a==null?void 0:a.catalogPending)??!1),unknown:i.isError||!i.data,disabled:I||M.isPending,onRemove:()=>void Q(Y.id)},Y.id))})]}),o&&f.jsx(x6n,{busy:I,onClose:u,footer:f.jsxs(De,{variant:"primary",disabled:I||!e||b.length>0&&(!x||!Number.isSafeInteger(D)||D<4096),onClick:()=>void(b.length>0?H():U()),children:[I&&f.jsx(jt,{}),b.length>0?Aet():oJe()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:pet()}),f.jsx(bh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:oet()})]}),f.jsx(Yo,{choices:Y1,value:h,title:ZN(),header:ZN(),variant:"field",floating:!0,dropDown:!0,disabled:I,renderLabel:Y=>f.jsxs(f.Fragment,{children:[Y.id==="openai-compatible"?Xk():Y.label,Y.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:VD()})]}),renderIcon:Y=>{var L;const $=(L=Y1.find(F=>F.id===Y.id))==null?void 0:L.icon;return $?f.jsx("img",{src:$,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${Y.id==="ollama"?" dark:invert":""}`}):f.jsx(GI,{size:14,className:"shrink-0"})},onSelect:_}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:eJe()}),f.jsx(Gr,{value:v,disabled:I,onChange:Y=>{B({baseUrl:Y.target.value})}})]}),p.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:fL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:p.id==="lmstudio"?Qet():wet()}),f.jsx(Gr,{type:"password",autoComplete:"off",value:N,disabled:I,onChange:Y=>B({apiKey:Y.target.value})})]})]},p.id),b.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Yo,{choices:b.map(Y=>({id:Y,label:Y})),value:x,searchPlaceholder:ert(),title:f0(),header:f0(),variant:"field",floating:!0,dropDown:!0,disabled:I,onSelect:Y=>{z({model:Y})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:OJe()}),f.jsx(Gr,{type:"number",min:4096,step:1024,value:y,disabled:I,onChange:Y=>{z({contextWindow:Y.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:FJe()})]}),C&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:C})]})})]})}function y6n({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=dn({mutationFn:async()=>{try{await pwn(e.id)}finally{await uf(!0)}}}),c=Y1.find(w=>w.label===e.name||w.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),h=u.length>0&&n&&u.every(w=>t.includes(`${e.id}/${w}`)),_=o.isPending||r,p=s,m=h;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[c!=null&&c.icon?f.jsx("img",{src:c.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${c.id==="ollama"?" dark:invert":""}`}):f.jsx(GI,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(c==null?void 0:c.id)==="openai-compatible"?Xk():(c==null?void 0:c.label)??e.name,(c==null?void 0:c.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:VD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Kt,{variant:_||p?"default":m?"success":"warning",children:_?_a():p?SL():m?NJe():_o()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(De,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Ga,{size:14}),Ev()]}),f.jsx(Pt,{"aria-label":eet({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Af,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function x6n({busy:e,onClose:n,footer:t,children:r}){const s=T.useRef(null),i=()=>{e||n()};return Em(s,i,"input"),ri.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:GD()})}),f.jsx(Pt,{className:"absolute end-3.5 top-3.5","aria-label":cf(),onClick:i,disabled:e,children:f.jsx(cr,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(De,{onClick:i,disabled:e,children:cf()}),t]})]})}),document.body)}const v$=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),mw=["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-sm text-muted"].join(" "),mu={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor",antigravity:"Google Antigravity"};function w6n(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:Tv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:Ob(n,t).defaultId}}function ga(e){const[n,t]=T.useState(!1),r=T.useRef(null);return T.useEffect(()=>{if(!n)return;const s=a=>{var o,c;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((c=e==null?void 0:e.current)!=null&&c.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function k6n({value:e,onSelect:n,onOpenSettings:t,permissionChoices:r=[],defaultPermissionId:s,onSelectPermission:i,reasoningChoices:a=[],defaultReasoningId:o,onSelectReasoning:c,lockHarness:u=!1,openRequest:h=0,className:_}){var ce,he,be,Re,Le,Ke,Ne;const{data:p=S6n}=ut(Du()),m=ym(),[w,k]=T.useState(!1),v=T.useRef(null),b=T.useRef(null),{open:x,setOpen:y,ref:C}=ga(v),[N,z]=T.useState(""),[A,j]=T.useState("root"),M=()=>{y(!1),j("root"),z("")},D=T.useRef(h);T.useEffect(()=>{h!==D.current&&(D.current=h,j("models"),z(""),y(!0))},[h,y]),T.useEffect(()=>{var xe;x&&(A==="reasoning"||A==="speed"||A==="permissions")&&((xe=b.current)==null||xe.focus())},[x,A]);const I=T.useMemo(()=>{const xe=N.trim().toLowerCase();return(u&&e?p.filter(Ze=>Ze.id===e.harness):p).map(Ze=>{let ot=Ze.models;return xe?ot=ot.filter(kt=>`${kt.id} ${V1(kt)}`.toLowerCase().includes(xe)):(Ze.id==="opencode"||Ze.id==="cursor"||Ze.id==="antigravity")&&(ot=ot.slice(0,5)),{harness:Ze,models:ot,hidden:xe?0:Ze.models.length-ot.length}})},[p,N,u,e]),B=(xe,rt)=>{var ot;const Ze=(e==null?void 0:e.harness)===xe.id;n({harness:xe.id,model:rt,serviceTier:Tv(xe,rt,Ze?e==null?void 0:e.serviceTier:null),permissionMode:Ze?e.permissionMode:((ot=xe.options)==null?void 0:ot.defaultPermissionMode)??null,reasoningLevel:eI(xe,rt,Ze&&xe.models.some(kt=>kt.id===rt)?e.reasoningLevel:null)}),M()},U=(e==null?void 0:e.model)!=null?(ce=p.find(xe=>xe.id===e.harness))==null?void 0:ce.models.find(xe=>xe.id===e.model):void 0,H=e?e.model?U?V1(U):`${C3(e.model)} · ${nz()}`:f3():f0(),Q=(e==null?void 0:e.reasoningLevel)??o??((he=a[0])==null?void 0:he.id),V=(be=a.find(xe=>xe.id===Q))==null?void 0:be.label,Z=(e==null?void 0:e.permissionMode)??s??((Re=r[0])==null?void 0:Re.id),Y=(Le=r.find(xe=>xe.id===Z))==null?void 0:Le.label,$=(e==null?void 0:e.harness)==="opencode"?Vrt():hnt(),L=p.find(xe=>xe.id===(e==null?void 0:e.harness)),F=JL(L,e==null?void 0:e.model),q=Tv(L,e==null?void 0:e.model,e==null?void 0:e.serviceTier),K=(Ke=F.find(xe=>xe.id===q))==null?void 0:Ke.label,ne=xe=>{c==null||c(xe),M()},ae=xe=>{i==null||i(xe),M()},ue=xe=>{e&&n({...e,serviceTier:xe}),M()},se=(xe,rt,Ze)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>j(Ze),children:[f.jsx("span",{className:"flex-1",children:xe}),rt&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:rt}),f.jsx(Ua,{size:14,className:"shrink-0 text-muted"})]}),G=xe=>f.jsxs("div",{className:"flex shrink-0 items-center border-b border-border-variant px-1 py-1",children:[f.jsx(Pt,{ref:b,type:"button",size:"small",className:"model-submenu-header","aria-label":rL(),onClick:()=>{j("root"),z("")},children:f.jsx(II,{size:15})}),f.jsx("span",{className:"min-w-0 flex-1 text-sm font-medium text-text",children:xe}),A==="models"&&f.jsx(Pt,{type:"button",size:"small","aria-label":b3(),onClick:()=>{M(),t()},children:f.jsx(xS,{size:15,"aria-hidden":"true"})})]}),oe=(xe,rt,Ze,ot)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:xe.map(kt=>f.jsxs(Cn,{onClick:()=>ot(kt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[kt.label,kt.id===Ze&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",KD()]})]}),kt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:kt.description})]}),kt.id===rt&&f.jsx(gi,{size:13})]},kt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:C,children:[f.jsxs("button",{ref:v,type:"button",className:Cs("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",_),title:oX({label:`${H}${V?` · ${V}`:""}${K?` · ${K}`:""}`}),"aria-haspopup":"menu","aria-expanded":x,onClick:()=>{x?M():(j("root"),y(!0))},children:[q==="priority"?f.jsx(sSn,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(xh,{harness:e.harness,size:14}):null,q==="priority"&&f.jsxs("span",{className:"sr-only",children:[xnt()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[H,V&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:V})]}),f.jsx(sc,{size:14,className:"shrink-0 text-muted"})]}),x&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-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:[A==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[se(f0(),H,"models"),a.length>0&&se($,V,"reasoning"),F.length>0&&se(tz(),K,"speed"),r.length>0&&se(ez(),Y,"permissions")]}),A==="models"&&f.jsxs(f.Fragment,{children:[G(f0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:ort(),value:N,onChange:xe=>z(xe.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[I.map(({harness:xe,models:rt,hidden:Ze})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:v$,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(xh,{harness:xe.id,size:14}),xe.name]}),!xe.agentReady&&f.jsx("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:xe.catalogPending?of():f.jsxs(f.Fragment,{children:[f.jsx(mj,{size:10})," ",_o()]})})]}),xe.agentReady?f.jsxs(f.Fragment,{children:[!N.trim()&&f.jsxs(Cn,{onClick:()=>B(xe,null),children:[f.jsx("span",{children:f3()}),(e==null?void 0:e.harness)===xe.id&&(e==null?void 0:e.model)===null&&f.jsx(gi,{size:13})]}),xe.models.length===0&&xe.agentNote&&f.jsx("div",{className:mw,children:df(xe.agentNote)}),rt.map(ot=>f.jsxs(Cn,{title:ot.id,onClick:()=>B(xe,ot.id),children:[f.jsx("span",{children:V1(ot)}),(e==null?void 0:e.harness)===xe.id&&(e==null?void 0:e.model)===ot.id&&f.jsx(gi,{size:13})]},ot.id)),N.trim().length>0&&!xe.models.some(ot=>ot.id===N.trim())&&f.jsx(Cn,{onClick:()=>B(xe,N.trim()),children:f.jsxs("span",{children:[Brt({id:Ce(N.trim())})," · ",nz()]})})]}):f.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-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:xe.catalogPending?of():xe.agentNote?df(xe.agentNote):Knt()}),xe.id==="opencode"&&f.jsx(Cn,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var ot;M(),(ot=v.current)==null||ot.focus(),k(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[Dtt(),f.jsx(Ph,{size:14,"aria-hidden":"true"})]})}),xe.agentReady&&Ze>0&&f.jsx("div",{className:mw,children:Pnt({count:Xt(Ze)})})]},xe.id)),p.length===0&&f.jsx("div",{className:mw,children:ont()})]}),u&&e&&p.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(mj,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),hrt()]})]}),A==="reasoning"&&f.jsxs(f.Fragment,{children:[G($),oe(a,Q,o,ne)]}),A==="permissions"&&f.jsxs(f.Fragment,{children:[G(ez()),oe(r,Z,s,ae)]}),A==="speed"&&f.jsxs(f.Fragment,{children:[G(tz()),oe(F,q??void 0,"default",ue)]})]}),w&&f.jsx(g$,{dialogOnly:!0,installed:((Ne=p.find(xe=>xe.id==="opencode"))==null?void 0:Ne.installed)??!1,onClose:()=>k(!1),onConnected:xe=>{var Ze;const rt=(Ze=m.getQueryData(Du().queryKey))==null?void 0:Ze.find(ot=>ot.id==="opencode");rt&&(!u||(e==null?void 0:e.harness)==="opencode")&&B(rt,xe)}})]})}function Yo({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:c,numbered:u=!1,searchPlaceholder:h,renderIcon:_,renderLabel:p,floating:m=!1,onSelect:w,className:k}){var Q,V;const v=T.useRef(null),{open:b,setOpen:x,ref:y}=ga(v),C=T.useRef(null),[N,z]=T.useState("");if(T.useLayoutEffect(()=>{var L;const Z=C.current,Y=y.current;if(!b||!m||!Z||!Y)return;Z.matches(":popover-open")||(Z.showPopover(),(L=Z.querySelector("input"))==null||L.focus());const $=()=>{const F=Y.getBoundingClientRect(),q=window.innerHeight-F.bottom-12,K=F.top-12,ne=Math.min(380,Z.scrollHeight),ae=i?q>=ne||q>=K:KK;Z.style.width=`${F.width}px`,Z.style.minWidth="0",Z.style.maxHeight=`${Math.max(0,Math.min(380,ae?q:K))}px`,Z.style.left=`${F.left}px`,Z.style.top=`${ae?F.bottom+4:F.top-Z.getBoundingClientRect().height-4}px`};return $(),window.addEventListener("resize",$),window.addEventListener("scroll",$,!0),()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)}},[b,m,i,N,e.length,y]),e.length===0)return null;const A=n??t??((Q=e[0])==null?void 0:Q.id)??null,j=e.find(Z=>Z.id===A),M=e.find(Z=>Z.id===t),D=o==="bare"&&(M==null?void 0:M.id)===Av?M:void 0,B=(D?e.filter(Z=>Z.id!==D.id):e).filter(Z=>`${Z.label} ${Z.id}`.toLowerCase().includes(N.toLowerCase())),U=(j==null?void 0:j.label)??((V=e[0])==null?void 0:V.label)??"",H=Z=>{var Y;w(Z),x(!1),(Y=v.current)==null||Y.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Cs(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,k),title:c,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{z(""),x(Z=>!Z)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(_==null?void 0:_(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??U:U})]}),f.jsx(sc,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(Z=>Z.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:v$,children:r}),h&&f.jsx("input",{autoFocus:!0,"aria-label":h,placeholder:h,value:N,onChange:Z=>z(Z.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[D&&f.jsxs(f.Fragment,{children:[f.jsxs(Cn,{type:"button",onClick:()=>H(D.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[_==null?void 0:_(D),f.jsxs("span",{children:[(p==null?void 0:p(D))??D.label,f.jsx("span",{className:"option-default text-muted font-normal",children:Htt()})]})]}),A===D.id&&f.jsx(gi,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),B.map((Z,Y)=>f.jsxs(Cn,{type:"button",onClick:()=>H(Z.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[_==null?void 0:_(Z),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(Z))??Z.label,!D&&Z.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",KD()]})]}),Z.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:Z.description})]})]}),A===Z.id?f.jsx(gi,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:Y+1})]},Z.id))]})]})]})}const S6n=[];function G3({runtime:e,corner:n=!1}){const[t,r]=T.useState(!1),[s,i]=T.useState(!1),[a,o]=T.useState(!1),[c,u]=T.useState(null),h=ga();async function _(){if(c){o(!0);try{await QL(c),u(null)}catch(p){u(null),xn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:h.ref,children:[h.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:f5t({host:Ce(e.session.host),user:Ce(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ce(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(Cn,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await KL(),h.setOpen(!1)}catch(p){xn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?i5t():g3()}),f.jsx(hS,{content:WSt(),className:"me-2 shrink-0 text-subtext",children:f.jsx(gS,{size:15})})]}),f.jsx(Cn,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await WL()),h.setOpen(!1)}catch(p){xn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:aL()})]}),n?f.jsxs(De,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":h.open,onClick:()=>h.setOpen(p=>!p),children:[f.jsx(Pv,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:nw({host:Ce(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Pt,{size:"small","aria-label":nw({host:Ce(e.session.host)}),"aria-haspopup":"menu","aria-expanded":h.open,onClick:()=>h.setOpen(p=>!p),children:f.jsx(Pv,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:nw({host:Ce(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ce(e.session.version??"…")]})]})]})]}),c&&f.jsx(MI,{host:e.session.host,preview:c,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void _()})]})}const Fv="code-source-text",b$="code-source-wrap",y$="file-view-gutter text-right text-muted select-none";function x$(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}const C6n={cjs:"javascript",console:"bash",cts:"typescript",fish:"bash",html:"markup",js:"javascript",jsx:"javascript",md:"markdown",mjs:"javascript",mts:"typescript",py:"python",rb:"ruby",sh:"bash",shell:"bash",svg:"markup",terminal:"bash",ts:"typescript",tsx:"typescript",xml:"markup",yml:"yaml",zsh:"bash"},E6n={containerfile:"docker",dockerfile:"docker",justfile:"makefile",makefile:"makefile"};function V3(e){const n=e.trim().toLowerCase();return C6n[n]??n}function MS(e){var s;if(!e)return null;const n=((s=e.split("/").pop())==null?void 0:s.toLowerCase())??"",t=E6n[n];if(t)return V3(t);const r=n.lastIndexOf(".");return r===-1||r===n.length-1?null:V3(n.slice(r+1))}ic.displayName="clike";ic.aliases=[];function ic(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}zm.displayName="c";zm.aliases=[];function zm(e){e.register(ic),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}Gb.displayName="cpp";Gb.aliases=[];function Gb(e){e.register(zm),(function(n){var t=/\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 t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.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:t,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/}),n.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}}),n.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:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}OS.displayName="arduino";OS.aliases=["ino"];function OS(e){e.register(Gb),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}DS.displayName="bash";DS.aliases=["sh","shell"];function DS(e){(function(n){var t="\\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},s={bash:r,environment:{pattern:RegExp("\\$"+t),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("(\\{)"+t),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})/};n.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;|&]|[<>]\\()"+t),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:s},{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:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.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=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(q,K){return"(?:"+F[+K]+")"})}function r(L,F,q){return RegExp(t(L,F),"")}function s(L,F){for(var q=0;q>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={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 a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),c=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),h=a(i.type+" "+i.typeDeclaration+" "+i.other),_=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,w=t(/<<0>>(?:\s*<<1>>)?/.source,[m,_]),k=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,w]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[k,v]),x=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[_,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,k,v]),N={keyword:c,punctuation:/[<>()?,.:[\]]/},z=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,A=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[A]),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,[m,C]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,w]),lookbehind:!0,inside:N},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[k]),lookbehind:!0,inside:N},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:N},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,h,m]),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:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),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,[m,_]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(_),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,[o,w,m,C,c.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[w,p]),lookbehind:!0,greedy:!0,inside:n.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 M=A+"|"+z,D=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),I=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[D]),2),B=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,U=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[k,I]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[B,U]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[B]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[I]),inside:n.languages.csharp},"class-name":{pattern:RegExp(k),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var H=/:[^}\r\n]+/.source,Q=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[D]),2),V=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Q,H]),Z=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),Y=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Z,H]);function $(L,F){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[F,H]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[V]),lookbehind:!0,greedy:!0,inside:$(V,Q)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[Y]),lookbehind:!0,greedy:!0,inside:$(Y,Z)}],char:{pattern:RegExp(z),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}jm.displayName="markup";jm.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function jm(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(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\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:[t,"language-"+t],inside:e.languages[t]},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}Hh.displayName="css";Hh.aliases=[];function Hh(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.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\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,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:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}IS.displayName="diff";IS.aliases=[];function IS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r ?| |(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:t})})(e)}$S.displayName="go";$S.aliases=[];function $S(e){e.register(ic),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"]}BS.displayName="ini";BS.aliases=[];function BS(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:/=/}}PS.displayName="java";PS.aliases=[];function PS(e){e.register(ic),(function(n){var t=/\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,s={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:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.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/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.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":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.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 t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}FS.displayName="regex";FS.aliases=[];function FS(e){(function(n){var t={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]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,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}HS.displayName="json";HS.aliases=["webmanifest"];function HS(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}qS.displayName="kotlin";qS.aliases=["kt","kts"];function qS(e){e.register(ic),(function(n){n.languages.kotlin=n.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 n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}US.displayName="less";US.aliases=[];function US(e){e.register(Hh),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"}})}GS.displayName="lua";GS.aliases=[];function GS(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:/[\[\](){},;]|\.+|:+/}}VS.displayName="makefile";VS.aliases=[];function VS(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:/[:;(){}]/}}KS.displayName="yaml";KS.aliases=["yml"];function KS(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\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}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,u){u=(u||"").replace(/m/g,"")+"m";var h=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return c});return RegExp(h,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}WS.displayName="markdown";WS.aliases=["md"];function WS(e){e.register(jm),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.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:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.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(o){["url","bold","italic","strike","code-snippet"].forEach(function(c){o!==c&&(n.languages.markdown[o].inside.content.inside[c]=n.languages.markdown[c])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function c(u){if(!(!u||typeof u=="string"))for(var h=0,_=u.length;h<_;h++){var p=u[h];if(p.type!=="code"){c(p.content);continue}var m=p.content[1],w=p.content[3];if(m&&w&&m.type==="code-language"&&w.type==="code-block"&&typeof m.content=="string"){var k=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");k=(/[a-z][\w-]*/i.exec(k)||[""])[0].toLowerCase();var v="language-"+k;w.alias?typeof w.alias=="string"?w.alias=[w.alias,v]:w.alias.push(v):w.alias=[v]}}}c(o.tokens)}),n.hooks.add("wrap",function(o){if(o.type==="code-block"){for(var c="",u=0,h=o.classes.length;u]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}XS.displayName="perl";XS.aliases=[];function XS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.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,t].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,t].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,t+/\s*/.source+t].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)}Kb.displayName="markup-templating";Kb.aliases=[];function Kb(e){e.register(jm),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(c){if(typeof a=="function"&&!a(c))return c;for(var u=o.length,h;r.code.indexOf(h=t(s,u))!==-1;)++u;return o[u]=c,h}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(c){for(var u=0;u=a.length);u++){var h=c[u];if(typeof h=="string"||h.content&&typeof h.content=="string"){var _=a[i],p=r.tokenStack[_],m=typeof h=="string"?h:h.content,w=t(s,_),k=m.indexOf(w);if(k>-1){++i;var v=m.substring(0,k),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),x=m.substring(k+w.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),x&&y.push.apply(y,o([x])),typeof h=="string"?c.splice.apply(c,[u,1].concat(y)):h.content=y}}else h.content&&o(h.content)}return c}o(r.tokens)}}})})(e)}YS.displayName="php";YS.aliases=[];function YS(e){e.register(Kb),(function(n){var t=/\/\*[\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*\()/],s=/\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,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,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:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.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:t,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:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var h=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",h)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}ZS.displayName="python";ZS.aliases=["py"];function ZS(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}JS.displayName="r";JS.aliases=[];function JS(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:/[(){}\[\],;]/}}e6.displayName="ruby";e6.aliases=["rb"];function e6(e){e.register(ic),(function(n){n.languages.ruby=n.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:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.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("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.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:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,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:t,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:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.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)/}),n.languages.rb=n.languages.ruby})(e)}t6.displayName="rust";t6.aliases=[];function t6(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}n6.displayName="sass";n6.aliases=[];function n6(e){e.register(Hh),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.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)}r6.displayName="scss";r6.aliases=[];function r6(e){e.register(Hh),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}s6.displayName="sql";s6.aliases=[];function s6(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:/[;[\]()`,.]/}}i6.displayName="swift";i6.aliases=[];function i6(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(n){n.inside.interpolation.inside=e.languages.swift})}a6.displayName="typescript";a6.aliases=["ts"];function a6(e){e.register(Vb),(function(n){n.languages.typescript=n.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/}),n.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 n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.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:t}}}}),n.languages.ts=n.languages.typescript})(e)}Wb.displayName="basic";Wb.aliases=[];function Wb(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:/[,;:()]/}}o6.displayName="vbnet";o6.aliases=[];function o6(e){e.register(Wb),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:/[,;:(){}]/})}class Am{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Am.prototype.normal={};Am.prototype.property={};Am.prototype.space=void 0;function w$(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new Am(t,r,n)}function L0(e){return e.toLowerCase()}class Bi{constructor(n,t){this.attribute=t,this.property=n}}Bi.prototype.attribute="";Bi.prototype.booleanish=!1;Bi.prototype.boolean=!1;Bi.prototype.commaOrSpaceSeparated=!1;Bi.prototype.commaSeparated=!1;Bi.prototype.defined=!1;Bi.prototype.mustUseProperty=!1;Bi.prototype.number=!1;Bi.prototype.overloadedBoolean=!1;Bi.prototype.property="";Bi.prototype.spaceSeparated=!1;Bi.prototype.space=void 0;let N6n=0;const en=Rf(),fs=Rf(),K3=Rf(),Qe=Rf(),or=Rf(),ef=Rf(),ea=Rf();function Rf(){return 2**++N6n}const W3=Object.freeze(Object.defineProperty({__proto__:null,boolean:en,booleanish:fs,commaOrSpaceSeparated:ea,commaSeparated:ef,number:Qe,overloadedBoolean:K3,spaceSeparated:or},Symbol.toStringTag,{value:"Module"})),gw=Object.keys(W3);class c6 extends Bi{constructor(n,t,r,s){let i=-1;if(super(n,t),Mj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&R6n.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(Oj,O6n);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!Oj.test(i)){let a=i.replace(T6n,M6n);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=c6}return new s(r,n)}function M6n(e){return"-"+e.toLowerCase()}function O6n(e){return e.charAt(1).toUpperCase()}const A$=w$([k$,z6n,E$,N$,z$],"html"),Qb=w$([k$,j6n,E$,N$,z$],"svg");function Dj(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function D6n(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Lj=/[#.]/g;function L6n(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function G6n(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function V6n(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function Pj(e){return V6n(e)||M$(e)}const Fj=document.createElement("i");function I0(e){const n="&"+e+";";Fj.innerHTML=n;const t=Fj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const K6n=["","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 W6n(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",c,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,c=t.position.start):c=t.position);let h=(c?c.line:0)||1,_=(c?c.column:0)||1,p=w(),m;for(i--;++i<=e.length;)if(m===10&&(_=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),_++;continue}const x=i+1;let y=x,C=x,N;if(b===35){C=++y;const U=e.charCodeAt(C);U===88||U===120?(N="hexadecimal",C=++y):N="decimal"}else N="named";let z="",A="",j="";const M=N==="named"?Pj:N==="decimal"?M$:G6n;for(C--;++C<=e.length;){const U=e.charCodeAt(C);if(!M(U))break;j+=String.fromCharCode(U),N==="named"&&U6n.includes(j)&&(z=j,A=I0(j))}let D=e.charCodeAt(C)===59;if(D){C++;const U=N==="named"?I0(j):!1;U&&(z=j,A=U)}let I=1+C-x,B="";if(!(!D&&t.nonTerminated===!1))if(!j)N!=="named"&&k(4,I);else if(N==="named"){if(D&&!A)k(5,1);else if(z!==j&&(C=y+z.length,I=1+C-y,D=!1),!D){const U=z?1:3;if(t.attribute){const H=e.charCodeAt(C);H===61?(k(U,I),A=""):Pj(H)?A="":k(U,I)}else k(U,I)}B=A}else{D||k(2,I);let U=Number.parseInt(j,N==="hexadecimal"?16:10);if(Q6n(U))k(7,I),B="�";else if(U in Bj)k(6,I),B=Bj[U];else{let H="";X6n(U)&&k(6,I),U>65535&&(U-=65536,H+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),B=H+String.fromCharCode(U)}}if(B){v(),p=w(),i=C-1,_+=C-x+1,s.push(B);const U=w();U.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,B,{start:p,end:U},e.slice(x-1,C)),p=U}else j=e.slice(x-1,C),o+=j,_+=j.length,i=C-1}else m===10&&(h++,a++,_=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),_++);return s.join("");function w(){return{line:h,column:_,offset:i+((c?c.offset:0)||0)}}function k(b,x){let y;t.warning&&(y=w(),y.column+=x,y.offset+=x,t.warning.call(t.warningContext||void 0,K6n[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:w()}),o="")}}function Q6n(e){return e>=55296&&e<=57343||e>1114111}function X6n(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 Y6n=0,l1={},Ts={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Y6n}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ts.util.type(n)){case"Object":if(s=Ts.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Ts.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:l1,plaintext:l1,text:l1,txt:l1,extend:function(e,n){var t=Ts.util.clone(Ts.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ts.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var c=r[e];return r[e]=i,Ts.languages.DFS(Ts.languages,function(u,h){h===c&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Ts.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],c=Ts.util.type(o);c==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):c==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ts.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ts.tokenize(r.code,r.grammar),Ts.hooks.run("after-tokenize",r),h0.stringify(Ts.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new Z6n;return Z1(s,s.head,e),O$(e,s,n,s.head,0),eCn(s)},hooks:{all:{},add:function(e,n){var t=Ts.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ts.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:h0};function h0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function Hj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function O$(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var c=0;c=i.reach);b+=v.value.length,v=v.next){var x=v.value;if(n.length>e.length)return;if(!(x instanceof h0)){var y=1,C;if(p){if(C=Hj(k,b,e,_),!C||C.index>=e.length)break;var j=C.index,N=C.index+C[0].length,z=b;for(z+=v.value.length;j>=z;)v=v.next,z+=v.value.length;if(z-=v.value.length,b=z,v.value instanceof h0)continue;for(var A=v;A!==n.tail&&(zi.reach&&(i.reach=B);var U=v.prev;D&&(U=Z1(n,U,D),b+=D.length),J6n(n,U,y);var H=new h0(a,h?Ts.tokenize(M,h):M,m,M);if(v=Z1(n,U,H),I&&Z1(n,v,I),y>1){var Q={cause:a+","+c,reach:B};O$(e,n,t,v.prev,b,Q),i&&Q.reach>i.reach&&(i.reach=Q.reach)}}}}}}function Z6n(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function Z1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function J6n(e,n,t){for(var r=n.next,s=0;st)return null;try{return $t.highlight(e,n).children}catch{return null}}function $$(e,n){var t;return e.type==="text"?e.value??"":e.type!=="element"?null:f.jsx("span",{className:(((t=e.properties)==null?void 0:t.className)??[]).join(" "),children:(e.children??[]).map($$)},n)}function cCn(e,n,t=3e5){var r;return((r=I$(e,n,t))==null?void 0:r.map($$))??e}function B$(e,n,t=3e5){const r=I$(e,n,t);if(!r)return e.split(` `);const s=[];let i=[];const a=[];let o=0;const c=h=>{let _=h;for(let p=a.length-1;p>=0;p--)_=f.jsx("span",{className:a[p],children:_},o++);i.push(_)},u=h=>{var _;if(h.type==="text"){(h.value??"").split(` @@ -1051,8 +1051,8 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, `,u-1)+1,_=e.indexOf(` `,u+3),p=_===-1?e.length:_;/^[ \t]*$/.test(e.slice(h,u))&&/^[ \t\r]*$/.test(e.slice(u+3,p))&&a.push(u)}for(let u=0;u+1`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),aLn(t,n)}function aH(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function lLn(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Vr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=lLn(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const oH=T.createContext(void 0);function cH({projectId:e,sessionId:n,children:t}){const r=T.useMemo(()=>(s,i=!1)=>{if(/^(https?:)?\/\//i.test(s))return s;const a=LB(s);return a?(a.source==="absolute"?qL(a.path):a.source==="artifact"&&!i?lf(e,a.path):k3(e,a.source==="artifact"?`artifacts/${a.path}`:a.path,{sessionId:n??void 0}))+a.hash:null},[e,n]);return f.jsx(oH,{value:r,children:t})}function uLn({src:e,alt:n,name:t,onClose:r}){const s=T.useRef(null),i=T.useRef(null),[a,o]=T.useState(1),[c,u]=T.useState({width:0,height:0}),[h,_]=T.useState({width:0,height:0});T.useEffect(()=>{const m=s.current;m==null||m.showModal(),m==null||m.focus();const w=i.current,k=new ResizeObserver(([v])=>{u({width:v.contentRect.width,height:v.contentRect.height})});return w&&k.observe(w),()=>{k.disconnect(),m==null||m.close()}},[]);const p=h.width&&c.width?Math.min(1,c.width*.9/h.width,c.height*.9/h.height):1;return ri.createPortal(f.jsxs("dialog",{ref:s,tabIndex:-1,"aria-label":n||jD(),onCancel:m=>{m.preventDefault(),r()},className:"fixed inset-0 m-0 max-w-none max-h-none w-full h-dvh border-0 outline-none bg-transparent p-0 text-text backdrop:bg-image-backdrop",onClick:m=>{m.stopPropagation(),m.target===m.currentTarget&&r()},children:[f.jsx("div",{ref:i,className:"absolute inset-x-4 sm:inset-x-12 top-16 bottom-32 overflow-auto overscroll-contain",onClick:m=>{m.target===m.currentTarget&&r()},children:f.jsx("div",{className:"flex min-h-full min-w-full w-max pointer-events-none",children:f.jsx("img",{src:e,alt:n,onLoad:m=>_({width:m.currentTarget.naturalWidth,height:m.currentTarget.naturalHeight}),style:h.width?{width:h.width*p*a,height:h.height*p*a}:void 0,className:`pointer-events-auto block m-auto shrink-0 max-w-none rounded-lg shadow-modal ${h.width&&c.width?"visible":"invisible"}`})})}),f.jsxs("div",{className:"absolute top-5 right-5 flex gap-2",children:[f.jsx(Bh,{shape:"circle",href:e,download:t||!0,"aria-label":_3(),title:_3(),className:"bg-background shadow-popover",children:f.jsx(Db,{size:16})}),f.jsx(Pt,{shape:"circle",onClick:r,"aria-label":x3(),title:x3(),className:"bg-background shadow-popover",children:f.jsx(cr,{size:16})})]}),f.jsxs("div",{className:"absolute bottom-6 inset-x-6 flex flex-col items-center gap-3 pointer-events-none",children:[n&&f.jsx("div",{className:"max-w-xl line-clamp-2 rounded-xl bg-background px-4 py-2 text-center text-sm leading-snug shadow-popover",children:n}),f.jsxs("div",{className:"pointer-events-auto flex items-center gap-1 rounded-full bg-background p-1.5 shadow-popover",children:[f.jsx(Pt,{shape:"circle",disabled:a<=.25,onClick:()=>o(m=>Math.max(.25,m-.25)),"aria-label":XN(),title:XN(),children:f.jsx(gkn,{size:16})}),f.jsxs(De,{variant:"ghost",className:"min-w-16 tabular-nums",onClick:()=>o(1),title:YN(),"aria-label":YN(),children:[Math.round(a*100),"%"]}),f.jsx(Pt,{shape:"circle",disabled:a>=4,onClick:()=>o(m=>Math.min(4,m+.25)),"aria-label":QN(),title:QN(),children:f.jsx(Ph,{size:16})})]})]})]}),document.body)}function _Ln({src:e,fallbackSrc:n,downloadName:t,alt:r="",...s}){const[i,a]=T.useState(!1),[o,c]=T.useState(!1),u=i&&n?n:e;return f.jsxs(f.Fragment,{children:[f.jsx("img",{...s,src:u,alt:r,role:"button",tabIndex:0,"aria-haspopup":"dialog",onClick:h=>{h.preventDefault(),h.stopPropagation(),c(!0)},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),h.stopPropagation(),c(!0))},onError:!i&&n&&n!==e?()=>a(!0):void 0}),o&&u&&f.jsx(uLn,{src:u,alt:r,name:t,onClose:()=>c(!1)})]})}const fLn=1e5;function dLn({code:e,lang:n}){const[t,r]=T.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Pt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:Yk(),"aria-label":ctt(),onClick:s,children:t?f.jsx(gi,{size:13}):f.jsx(zf,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:cCn(e,n,fLn)})})]})}function hLn(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function uR(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),c=hLn(a[2]??"");if(!c[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:a4(e,s,a.index)});const h=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:c},position:a4(e,a.index,h),type:o==="run"?"runMention":"fileMention"}),s=h}return i?(slH(e)}function mLn(){return e=>{const n=t=>{var r;for(const s of["href","src"])if(t.properties&&Object.hasOwn(t.properties,s)){const i=String(t.properties[s]||"");t.properties[s]=s==="src"&&t.tagName==="img"&&E6(i)?i:jP(i)}(r=t.children)==null||r.forEach(n)};n(e)}}function fR({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?WY({path:Ce(e)}):e,...Vr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(FI,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(WI,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function gLn({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?xZ({id:Ce(e)}):wJ({id:Ce(e)}),...Vr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(yS,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||LL()}),f.jsx(WI,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const uH={singleDollarTextMath:!0},vLn=hy().use(my).use(rH).use(sH,uH).use(JDn).use(pLn).use(Xv).use(mLn).use(RF);function bLn(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const _H={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` -`)))return f.jsx("code",{className:s,...r,children:t});const c=i?V3(i[1]):null;return f.jsx(dLn,{code:a,lang:c})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})};function yLn({children:e}){return f.jsx("figure",{className:"my-6 mx-auto max-w-full text-left [&_img]:mx-auto [&_img]:my-0 [&_img]:w-auto [&_img]:h-auto [&_img]:max-h-[min(480px,60vh)] [&_img]:object-contain [&_img]:border-0 [&_img]:rounded-none",children:e})}const Jo=T.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Vu();const o=T.useContext(oH),c=i??o,u=T.useMemo(()=>({"file-mention":h=>f.jsx(fR,{path:h.path,lines:h.lines,exp:h.exp,onOpenFile:t}),"run-mention":h=>f.jsx(gLn,{id:h.id,label:h.label,onOpenRun:r}),a:({node:h,href:_,children:p,"data-figure-src":m,...w})=>{const k=typeof m=="string"?LB(m):null;if(k&&t){const v=k.source==="artifact"?`artifacts/${k.path}`:k.path,b=s?s(v):v;if(b)return f.jsx("button",{type:"button",className:"text-primary underline cursor-pointer text-start",...Vr(x=>t(b,void 0,void 0,void 0,x)),children:p})}if(_&&bLn(_)&&t){let v;try{v=decodeURI(_)}catch{return f.jsx("span",{children:p})}const b=s?s(v):v;return b?f.jsx(fR,{path:b,onOpenFile:t}):f.jsx("span",{children:p})}return f.jsx("a",{href:_,target:"_blank",rel:"noopener noreferrer",...w,children:p})},figure:({children:h})=>f.jsx(yLn,{children:h}),figcaption:({children:h})=>f.jsx("figcaption",{className:"mt-3 text-sm italic leading-relaxed text-text",children:h}),th:({node:h,..._})=>f.jsx("th",{dir:"auto",..._}),td:({node:h,..._})=>f.jsx("td",{dir:"auto",..._}),img:({node:h,src:_,alt:p,className:m,...w})=>{var v;if(!_||typeof _!="string")return null;const k=c?c(_):_;return k?T.createElement(_Ln,{...w,key:k,downloadName:(v=_.split(/[\\/]/).pop())==null?void 0:v.split(/[?#]/)[0],src:k,fallbackSrc:i?null:o==null?void 0:o(_,!0),alt:p??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border cursor-zoom-in focus-visible:outline-2 focus-visible:outline-primary ${m??""}`}):null},..._H}),[t,r,s,i,o,c]);return f.jsx("div",{dir:"auto","data-streaming":a||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-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_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-prose-emphasis [&_.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-sm [&_.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-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_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-start [&_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-start [&_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]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-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:f.jsx(sTn,{content:aH(n,{predictMath:a}),processor:vLn,components:u,predict:a})})}),dR="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function xLn({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,c]=T.useState(!1),u=T.useRef(null),[h,_]=T.useState(!1),[p,m]=T.useState(""),w=T.useRef(null);T.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&c(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),T.useEffect(()=>{var v;h&&((v=w.current)==null||v.focus())},[h]);const k=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),_(!1)};return f.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-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(yS,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?Gxt({agent:Ce(n)}):$xt({agent:Ce(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Vr(t),children:_2t()})]}),h?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:w,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:B2t(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),_(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),k())}}),f.jsxs("div",{className:dR,children:[f.jsx(De,{size:"small",onClick:()=>{m(""),_(!1)},children:rL()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(De,{size:"small",variant:"primary",onClick:k,children:[C2t(),f.jsx(PI,{size:13})]})]})]}):f.jsxs("div",{className:dR,children:[f.jsx(De,{size:"small",onClick:i,children:v2t()}),f.jsx(De,{size:"small",onClick:()=>_(!0),children:R2t()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(De,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:gxt()}),f.jsx(De,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":s2t(),onClick:()=>c(v=>!v),children:f.jsx(sc,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(Cn,{onClick:()=>{c(!1),r("bypassPermissions")},children:Sxt()})})]}):f.jsx(De,{size:"small",variant:"primary",onClick:()=>r(),children:Txt()})]})]})}function hR({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=T.useState(""),[o,c]=T.useState(!1),[u,h]=T.useState(null);async function _(p){if(p.preventDefault(),!(o||!i.trim())){c(!0),h(null);try{n(await e(i.trim())),a("")}catch(m){h(m instanceof Error?m.message:String(m))}finally{c(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:_,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(De,{type:"submit",disabled:o||!i.trim(),children:o?pa():rc()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??EKe()}),u&&f.jsx("div",{className:"error",children:u})]})}function fH({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}function wLn({settings:e}){const[n,t]=T.useState(!1);return f.jsxs("label",{className:"inline-flex max-w-full flex-wrap items-center gap-2 text-sm text-subtext",children:[Qln(),f.jsx("span",{className:"inline-block w-max max-w-full",children:f.jsx(Yo,{variant:"field",dropDown:!0,value:e.defaultHost??"",disabled:n,choices:[{id:"",label:bL()},...e.defaultHost&&!e.hosts.some(r=>r.host===e.defaultHost)?[{id:e.defaultHost,label:e.defaultHost}]:[],...e.hosts.map(r=>({id:r.host,label:r.host}))],onSelect:r=>{t(!0),Yxn(r||null).catch(s=>{xn(s instanceof Error?s.message:String(s),"error")}).finally(()=>t(!1))}})})]})}function kLn({host:e,connecting:n,reference:t,onChange:r}){const s=T.useId(),i=dn({mutationFn:Xxn,scope:{id:`ssh-settings-${e.host}`}});function a(o){r(o),i.reset(),!(o!==null&&!o.trim())&&i.mutate({host:e.host,container:(o==null?void 0:o.trim())??null})}return f.jsxs("details",{className:"pb-3",children:[f.jsx("summary",{className:"w-fit cursor-pointer rounded-sm text-sm text-subtext focus-visible:outline-2 focus-visible:outline-text",children:WD()}),f.jsxs("div",{className:"mt-3 grid max-w-xl gap-3",children:[f.jsxs("label",{className:"text-sm text-subtext",children:[mun(),f.jsx(Yo,{variant:"field",dropDown:!0,value:t!==null?"container":"host",disabled:n,choices:[{id:"host",label:nun()},{id:"container",label:lun()}],onSelect:o=>a(o==="container"?"":null)})]}),t!==null&&f.jsxs("label",{className:"text-sm text-subtext",htmlFor:`${s}-container`,children:[Hln(),f.jsx(Gr,{id:`${s}-container`,value:t,disabled:n,required:!0,onChange:o=>a(o.target.value)})]}),i.error&&f.jsx("p",{className:"m-0 text-sm text-accent-red",role:"status",children:i.error.message})]})]})}const ec=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.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-base [&_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(" "),mf=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),SLn=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Ay="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Pa=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),cC=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.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-start","[&_.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-control-subtle","[&_.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-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.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]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-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-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.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-start [&_.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-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.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-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.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","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),sl=["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","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),H5=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.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-base","[&_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-base [&_.kv_.v]:break-normal","[@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(" "),y0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),yd=["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(" "),CLn=new Set(["gh auth login","hf auth login","claude auth status"]);function dH(e){return CLn.has(e)?`/api/settings/commands/run?command=${encodeURIComponent(e)}`:void 0}function Ty(){const[e,n]=T.useState(null);return{run:e,start:(r,s,i)=>n(a=>({command:r,path:s,owner:i,attempt:((a==null?void 0:a.attempt)??0)+1})),clear:()=>n(null)}}function lC({note:e,className:n,disabled:t,resolve:r=dH,onRun:s}){return e?f.jsx("p",{className:n,children:df(e,{canRun:i=>!t&&r(i)!==void 0,onRun:i=>{const a=r(i);a&&s(i,a)}})}):null}function Ry({run:e,onComplete:n,onClose:t}){return e?f.jsx(vSn,{path:e.path,label:e.command,onComplete:n,onError:r=>xn(r,"error"),onClose:t},`${e.command}-${e.attempt}`):null}function o4(e){return e.catalogPending?{cls:"warn",variant:"warning",label:of()}:e.agentReady&&!e.authenticated&&e.authMethod!=="local"?{cls:"warn",variant:"warning",label:XD()}:e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?Jk():PXt()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:qFt()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:YD()}:e.needsConfigRepair||e.authState==="unknown"?{cls:"warn",variant:"warning",label:y3()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:eJt()}:{cls:"warn",variant:"warning",label:yL()}:{cls:"warn",variant:"warning",label:hVt()}}function ELn({h:e}){return e.id==="opencode"&&e.agentReady&&!e.authenticated&&!e.authMethod?f.jsx(f.Fragment,{children:SAt()}):e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:Nv()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?TDt():Zk()}):f.jsx(f.Fragment,{children:"—"})}function NLn(e,n,t){if(!n)return;const r=n.installUrl!==void 0&&t.includes(n.installUrl),s=t===n.login?"login":t===n.install?"install":t===n.update?"update":r?"install":null;if(s&&!(s!=="install"&&(!e.installed||e.installBroken)))return`/api/harnesses/setup?${new URLSearchParams({harness:e.id,action:s,shell:"true"})}`}function zLn({remote:e}){const n=Du(),{data:t=null}=ut(n),[r,s]=T.useState(null),[i,a]=T.useState(!1),o=Ty(),[c,u]=T.useState(null),h=ut(sI()),_=(w,k=!1)=>{a(!0),uf(w,k).catch(()=>{}).finally(()=>a(!1))},p=[...t??[]].sort((w,k)=>Number(k.agentReady)-Number(w.agentReady)),m=p.find(w=>w.id===r)??p[0];return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:b3()}),!e&&c&&h.data&&f.jsx(f$,{harness:c,commands:h.data[c.id],onClose:()=>u(null)}),f.jsx("div",{className:"mt-3 mb-3.5 w-fit max-w-full [&_.option-menu]:w-max",children:f.jsx(Yo,{variant:"field",dropDown:!0,title:b3(),choices:p.map(w=>({id:w.id,label:w.name})),value:(m==null?void 0:m.id)??null,onSelect:w=>{const k=p.find(v=>v.id===w);k&&s(k.id)},renderIcon:w=>{const k=p.find(v=>v.id===w.id);return k&&f.jsx(xh,{harness:k.id})},renderLabel:w=>{const k=p.find(b=>b.id===w.id),v=k&&o4(k);return f.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[w.label,v&&f.jsxs(f.Fragment,{children:[f.jsx("span",{"aria-hidden":"true",className:`size-1.5 shrink-0 rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${v.cls}`}),f.jsx("span",{className:"sr-only",children:v.label})]})]})}})}),t?m?f.jsxs("div",{className:ec,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Vt,{variant:o4(m).variant,children:o4(m).label}),f.jsx("div",{className:"spacer flex-1"}),!e&&!m.catalogPending&&m.installed&&!m.installBroken&&!m.authenticated&&!m.needsConfigRepair&&m.authMethod!=="local"&&m.authMethod!=="apiKey"&&m.authState!=="unsupported"&&f.jsxs(De,{size:"small",onClick:()=>u(m),disabled:!h.data,"aria-haspopup":"dialog",children:[f.jsx(jf,{size:14})," ",qD()]}),f.jsxs(De,{size:"small",onClick:()=>_(!0,!0),disabled:i,children:[f.jsx(Ga,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Sm()]})]}),f.jsxs("div",{className:Cs(mf,"[&_.v]:text-sm"),children:[f.jsx("span",{className:"k",children:uIt()}),f.jsx("span",{className:"v",children:m.binPath??sDt()}),f.jsx("span",{className:"k",children:EL()}),f.jsx("span",{className:"v",children:m.version??"—"}),f.jsx("span",{className:"k",children:TLt()}),f.jsx("span",{className:"v",children:f.jsx(ELn,{h:m})}),m.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:m.id==="opencode"?aen():rS()}),f.jsx("span",{className:"v",children:m.account})]}),m.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:EKt()}),f.jsx("span",{className:"v",children:m.org})]}),m.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:NWt()}),f.jsx("span",{className:"v",children:m.plan})]}),f.jsx("span",{className:"k",children:vLt()}),f.jsx("span",{className:"v",children:m.catalogPending?of():m.models.length>0?YMt({count:Xt(m.models.length),models:new Intl.ListFormat(E()).format(m.models.slice(0,4).map(w=>Ce(V1(w))))}):m.agentReady?f3():nS()})]}),f.jsx(lC,{note:m.agentNote,className:Cs(Pa,"text-sm"),disabled:e,resolve:w=>{var k;return NLn(m,(k=h.data)==null?void 0:k[m.id],w)??dH(w)},onRun:(w,k)=>o.start(w,k,m.id)}),o.run&&f.jsx("div",{hidden:o.run.owner!==m.id,children:f.jsx(Ry,{run:o.run,onComplete:()=>_(!0,!0),onClose:o.clear})}),m.id==="opencode"&&f.jsx(g$,{installed:m.installed})]}):null:f.jsxs(Kr,{children:[f.jsx(jt,{})," ",sPt()]})]})}function jLn({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Vt,{variant:"success",children:L$t()}):f.jsx(Vt,{variant:"error",children:hGt()}):f.jsx(Vt,{variant:"error",children:m$t()}):f.jsx(Vt,{variant:"error",children:AHt()})}function ALn({onEditState:e}){var A;const n=dn({mutationFn:Fxn}),t=Kz(),r=ut(t),s=r.data??null,i=j=>{is(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((A=r.error)==null?void 0:A.message)??null,[o,c]=T.useState(""),[u,h]=T.useState(""),[_,p]=T.useState(!1),[m,w]=T.useState(!1),[k,v]=T.useState(null),b=j=>{i(j),c(j.context??""),h(j.namespace)},x=T.useRef(null);T.useEffect(()=>{const j=x.current;x.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(c(s.context??""),h(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;T.useEffect(()=>{e==null||e({dirty:C,saving:_})},[C,_,e]);async function N(){if(!(m||_||!y)){w(!0);try{await et.fetchQuery({...Kz(),staleTime:0})}catch(j){xn(j instanceof Error?j.message:String(j),"error")}finally{w(!1)}}}async function z(j){if(j.preventDefault(),!(_||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:$h()}),f.jsx("dd",{className:"m-0",children:m||_?f.jsx(Vt,{children:_a()}):C?f.jsx(Vt,{children:BD()}):f.jsx(jLn,{s})})]}),y&&!m&&!_&&s.preflight.error&&f.jsx("p",{className:`${Ay} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:z,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[q$t(),f.jsx(Yo,{choices:[{id:"",label:s.currentContext?DRt({context:Ce(s.currentContext)}):zRt()},...o&&!s.contexts.includes(o)?[{id:o,label:_Dt({context:Ce(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:_||m,onSelect:c})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[bUt(),f.jsx(Gr,{type:"text",value:u,disabled:_||m,onChange:j=>h(j.target.value),placeholder:TBt(),autoComplete:"off",spellCheck:!1})]}),k&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:k}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(De,{type:"button",onClick:()=>void N(),disabled:_||m||!y,children:[f.jsx(Ga,{size:13})," ",m?_a():wm()]}),f.jsx(De,{variant:"primary",type:"submit",disabled:_||m||y,children:_?pa():rc()})]})]})]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",IIt()]})})}function TLn(){var y;const e=dn({mutationFn:C=>qxn(...C)}),n=Wz(),t=ut(n),r=t.data??null,s=C=>{is(n.queryKey,N=>(typeof C=="function"?C(N??null):C)??void 0)},[i,a]=T.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[c,u]=T.useState(""),[h,_]=T.useState(""),[p,m]=T.useState(!1),w=t.isPending||p,[k,v]=T.useState(!1);async function b(){if(!(w||k)){m(!0),a(null);try{await et.fetchQuery({...Wz(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function x(C){if(C.preventDefault(),!(!c.trim()||!h.trim()||w||k||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([c.trim(),h.trim()])),u(""),_("")}catch(N){a(N instanceof Error?N.message:String(N))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&w?f.jsxs(Kr,{children:[f.jsx(jt,{})," ",UIt()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:$h()}),f.jsx("dd",{className:"m-0",children:f.jsx(Vt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?iS():Ab()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:lMt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:x,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?mMt():IMt(),f.jsx(Gr,{type:"password",value:c,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?kMt():UMt(),f.jsx(Gr,{type:"password",value:h,onChange:C=>_(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:AMt()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(De,{type:"button",disabled:w||k,onClick:()=>void b(),children:[f.jsx(Ga,{size:13})," ",Sm()]}),f.jsx(De,{variant:"primary",type:"submit",disabled:!c.trim()||!h.trim()||w||k||(r==null?void 0:r.processEnv),children:k?pa():rc()})]})]})]})}const hH="rounded-sm border-border-strong bg-surface text-subtext",pH="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",RLn=5e3;function mH(e){const n=Ha(),t=e.map(a=>Qz(a)),r=rK({queries:t.map(a=>({...a,refetchInterval:RLn}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Un(n)&&is(Qz(a).queryKey,{running:!0})}]}function MLn({test:e,connecting:n,masterRunning:t,containerFailed:r=!1}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Vt,{className:pH,children:lL()})});if(e===void 0)return f.jsx(Vt,{className:hH,children:vL()});const s=e.missingTools??[],i=e.reachable&&e.toolsFound&&t===!1,a=!e.reachable||r?f.jsx(Vt,{className:"rounded-sm",variant:"error",children:sS()}):e.toolsFound?i?f.jsx(Vt,{className:"rounded-sm",variant:"warning",children:uL()}):f.jsx(Vt,{className:"rounded-sm",variant:"success",children:km()}):f.jsx(Vt,{className:"rounded-sm",variant:"error",children:s.length===1?sOt({tool:Ce(s[0])}):_Ot()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[a,!i&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:go(e.testedAt)})]})}function OLn(){var D;const e=rI(),n=ut(e),t=((D=n.data)==null?void 0:D.hosts)??(n.isError?[]:null),[r,s]=T.useState(!1),[i,a]=T.useState({}),[o,c]=T.useState({}),u=T.useRef(0),[h,_]=T.useState(!1),[p,m]=T.useState({}),[w,k]=T.useState(null),[v,b]=T.useState(!1),[x,y]=T.useState(0),C=(t==null?void 0:t.filter(I=>{const B=i[I.host]??I.lastTest;return(B==null?void 0:B.reachable)&&B.toolsFound}).map(I=>I.host))??[],[N,z]=mH(C);function A(I){u.current+=1,_(!1),b(!1),y(B=>B+1),k(I),m(B=>({...B,[I]:!0}))}function j(){u.current+=1,_(!1),b(!1),k(null)}function M(I,B){m(U=>({...U,[I]:!B}))}return f.jsxs(f.Fragment,{children:[n.error&&f.jsx("p",{className:"text-sm text-accent-red",children:n.error.message}),f.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3",children:[n.data&&f.jsx(wLn,{settings:n.data}),f.jsxs(De,{variant:"ghost",className:"ms-auto",onClick:()=>s(!0),children:[f.jsx(xS,{size:14})," ",RL()]})]}),t===null?f.jsxs(Kr,{children:[f.jsx(jt,{})," ",wL()]}):t.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:oGt()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:t.map(I=>{var K,ne,ae;const B=o[I.host]===void 0?I.container??null:o[I.host],U=i[I.host],H=B!==null&&((K=U==null?void 0:U.container)==null?void 0:K.reference)===B.trim()?U:void 0,Q=B!==null?H:U!=null&&U.container?I.lastTest:U??I.lastTest,V=(ne=H==null?void 0:H.container)==null?void 0:ne.error,Z=((ae=H==null?void 0:H.container)==null?void 0:ae.ready)===!1,Y=(Q==null?void 0:Q.error)||V,$=w===I.host,L=p[I.host]??!1,F=$||!!Y,q=`${I.user?`${I.user}@`:""}${I.hostname??I.host}${I.port?`:${I.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3",children:[f.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:I.host,children:I.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:q,children:q})]})}),f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsxs("div",{className:"flex items-center gap-2 text-start",children:[f.jsx(MLn,{test:Q,connecting:$&&!v,masterRunning:N[I.host],containerFailed:Z}),F&&f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":L,"aria-label":L?hX({name:Ce(I.host)}):eY({name:Ce(I.host)}),onClick:ue=>{ue.stopPropagation(),M(I.host,L)},children:f.jsx(sc,{size:18,className:`text-muted transition-transform duration-120 ease-standard${L?" rotate-180":""}`})})]}),f.jsx(De,{size:"small",type:"button",className:"justify-self-end",onClick:ue=>{ue.stopPropagation(),$&&!v?j():A(I.host)},disabled:!$&&(w!==null&&!v||B!==null&&!B.trim()),children:$?v?ti():cf():(Q==null?void 0:Q.reachable)===!1||Z?ti():Q?NL():eS()})]})]}),f.jsx(kLn,{host:I,connecting:$&&!v,reference:B,onChange:ue=>{$&&j(),c(se=>({...se,[I.host]:ue})),a(se=>{const G={...se};return delete G[I.host],G})}}),F&&(L||$)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3${L?"":" hidden"}`,children:[!$&&Y&&f.jsx(bSn,{host:I.host,transcript:Y}),$&&!h&&f.jsx(CS,{host:I.host,backend:"ssh",active:L,onComplete:ue=>{if(ue.backend!=="ssh")return;z(I.host);const se=u.current;if(B===null){a(G=>({...G,[I.host]:{...ue.result,container:null}})),b(!1),k(null);return}_(!0),Zxn(I.host,B.trim()).then(G=>{u.current===se&&a(oe=>({...oe,[I.host]:{...G,container:G.container??{reference:B.trim(),ready:!1,error:G.error??null}}}))}).catch(G=>{u.current===se&&a(oe=>({...oe,[I.host]:{...ue.result,container:{reference:B.trim(),ready:!1,error:G instanceof Error?G.message:String(G)}}}))}).finally(()=>{u.current===se&&(_(!1),b(!1),k(null))})},onError:ue=>{b(!0),a(se=>({...se,[I.host]:{container:B===null?null:{reference:B.trim(),ready:!1,error:ue},reachable:!1,toolsFound:!1,missingTools:[],error:ue,testedAt:Date.now()}}))}},x)]})]},I.host)})}),r&&f.jsx(H$,{onClose:()=>s(!1)})]})}function DLn({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Vt,{className:pH,children:lL()}):e===null?f.jsx(Vt,{className:hH,children:vL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Vt,{className:"rounded-sm",variant:"warning",children:uL()}):f.jsx(Vt,{className:"rounded-sm",variant:"success",children:km()}):f.jsx(Vt,{className:"rounded-sm",variant:"error",children:Gqt()}):f.jsx(Vt,{className:"rounded-sm",variant:"error",children:HGt()}):f.jsx(Vt,{className:"rounded-sm",variant:"error",children:sS()})}function LLn(){var Y;const e=dn({mutationFn:l2n}),n=gwn(),t=ut(n),r=t.data??null,s=$=>{is(n.queryKey,L=>(typeof $=="function"?$(L??null):$)??void 0)},i=r?null:((Y=t.error)==null?void 0:Y.message)??null,[a,o]=T.useState(""),[c,u]=T.useState(""),[h,_]=T.useState(""),[p,m]=T.useState(""),[w,k]=T.useState(!1),[v,b]=T.useState(null),[x,y]=T.useState(null),[C,N]=T.useState(!1),[z,A]=T.useState(!1),[j,M]=T.useState(0),D=a&&(x!=null&&x.reachable)&&x.slurmFound&&x.toolsFound?[a]:[],[I,B]=mH(D);function U(){A(!1),M($=>$+1),N(!0)}const H=$=>{s($),o($.host??""),u($.partition??""),_($.account??""),m($.timeLimit??"")},Q=T.useRef(null);T.useEffect(()=>{const $=Q.current;Q.current=r,r&&(!$||a===($.host??"")&&c.trim()===($.partition??"")&&h.trim()===($.account??"")&&p.trim()===($.timeLimit??""))&&(o(r.host??""),u(r.partition??""),_(r.account??""),m(r.timeLimit??""))},[r,a,c,h,p]);const V=r!==null&&a===(r.host??"")&&c.trim()===(r.partition??"")&&h.trim()===(r.account??"")&&p.trim()===(r.timeLimit??"");async function Z($){if($.preventDefault(),!w){k(!0),b(null);try{H(await e.mutateAsync({host:a,partition:c.trim(),account:h.trim(),timeLimit:p.trim()}))}catch(L){b(L instanceof Error?L.message:String(L))}finally{k(!1)}}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[!C&&(x==null?void 0:x.error)&&f.jsx("p",{className:Ay,children:x.error}),f.jsxs("form",{className:cC,onSubmit:Z,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[Tqt(),f.jsx(Yo,{choices:[{id:"",label:bL()},...a&&!r.hosts.some($=>$.host===a)?[{id:a,label:`${a} (not in ~/.ssh/config)`}]:[],...r.hosts.map($=>({id:$.host,label:$.host}))],value:a,variant:"field",dropDown:!0,disabled:w||C,onSelect:$=>{o($),y(null),N(!1),A(!1)}})]})}),f.jsxs("div",{className:"actions",children:[f.jsx(De,{type:"button",onClick:()=>{C&&!z?(A(!1),N(!1)):U()},disabled:!a,title:a?void 0:JJt(),children:C?z?ti():cf():x?NL():eS()}),f.jsx("span",{role:"status",children:f.jsx(DLn,{test:x,connecting:C&&!z,masterRunning:I[a]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[dWt(),f.jsx(Gr,{type:"text",list:"slurm-partitions",value:c,onChange:$=>u($.target.value),placeholder:Rz(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:x==null?void 0:x.partitions.map($=>f.jsx("option",{value:$},$))})]}),f.jsxs("label",{children:[rS(),f.jsx(Gr,{type:"text",value:h,onChange:$=>_($.target.value),placeholder:Rz(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[DZt(),f.jsx(Gr,{type:"text",value:p,onChange:$=>m($.target.value),placeholder:l$t(),autoComplete:"off",spellCheck:!1})]})]}),v&&f.jsx("div",{className:"error",children:v}),f.jsx("div",{className:"actions",children:f.jsx(De,{variant:"primary",type:"submit",disabled:w||V||C,children:w?pa():rc()})})]}),C&&f.jsx(CS,{host:a,backend:"slurm",onComplete:$=>{$.backend==="slurm"&&(y($.result),B(a),A(!1),N(!1))},onError:$=>{A(!0),y({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:$})}},j)]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",rqt()]})})}function ILn(){var C;const e=dn({mutationFn:_2n}),n=vwn(),t=ut(n),r=t.data??null,s=N=>{is(n.queryKey,z=>(typeof N=="function"?N(z??null):N)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=T.useState(""),[c,u]=T.useState(!1),[h,_]=T.useState(null),[p,m]=T.useState(null),w=p!==null&&p!=="testing"?p:null,k=N=>{s(N),o(N.address??"")},v=T.useRef(null);T.useEffect(()=>{const N=v.current;v.current=r,r&&(!N||a===(N.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function x(N){if(N.preventDefault(),!c){u(!0),_(null);try{k(await e.mutateAsync({address:a}))}catch(z){_(z instanceof Error?z.message:String(z))}finally{u(!1)}}}async function y(){m("testing");try{m(await f2n(a.trim()||void 0))}catch(N){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:N instanceof Error?N.message:String(N)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(w==null?void 0:w.error)&&f.jsx("p",{className:Ay,children:w.error}),f.jsxs("form",{className:cC,onSubmit:x,children:[f.jsxs("label",{children:[kHt(),f.jsx(Gr,{type:"text",value:a,onChange:N=>{o(N.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[vPt(),": ",Ce(r.resolvedAddress)," · ",kL(),": ",r.source]}),h&&f.jsx("div",{className:"error",children:h}),f.jsxs("div",{className:"actions",children:[f.jsx(De,{variant:"primary",type:"submit",disabled:c||b,children:c?pa():rc()}),f.jsx(De,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:KYt()}),f.jsx($Ln,{test:p})]}),(w==null?void 0:w.reachable)&&w.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[FWt(),": ",w.rayVersion]})]})]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",XHt()]})})}function $Ln({test:e}){return e===null?null:e==="testing"?f.jsx(Vt,{children:eZt()}):e.reachable?f.jsx(Vt,{variant:"success",children:WWt()}):f.jsx(Vt,{variant:"error",children:sS()})}function BLn(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:nl(e.memBytes),r=e.gpus.length===0?null:iTt({count:e.gpus.length});return[n,e.cpuCount>0?Tjt({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function PLn({remote:e}){var p;const n=ut(ywn()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=T.useState(0),[o,c]=T.useState(!0),[u,h]=T.useState(!1),_=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:SLn,children:[f.jsx("span",{className:"k",children:$h()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Vt,{className:"gap-1.5",role:"status",children:[f.jsx(jt,{}),u?GDt():_a()]}):r?f.jsx(Vt,{variant:"warning",children:y3()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Vt,{variant:"success",children:km()}):t.sshKeyStatus==="unknown"?f.jsx(Vt,{variant:"warning",children:y3()}):f.jsx(Vt,{variant:"warning",children:Ab()}):f.jsx(Vt,{variant:"warning",children:yL()}):null}),f.jsx("span",{className:"k",children:MKt()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:JXt()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Vt,{variant:"success",children:KVt()}):t.sshKeyStatus==="no_local_match"?f.jsx(Vt,{variant:"warning",children:zVt()}):t.sshKeyStatus==="none_registered"?f.jsx(Vt,{variant:"error",children:QGt()}):f.jsx(Vt,{children:SL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:QRt({command:Ce("orx login")})}),!e&&i>0&&f.jsx(gSn,{login:o,onComplete:()=>{h(!1),a(0),_()},onError:m=>{h(!1),xn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Pa,children:[sLt()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Pa,children:[DGt()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),oZt()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Pa,children:ben({register:Ce(`orx ssh-key add ${t.sshKeyPath}`),load:Ce("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Pa,children:[zGt()," ",f.jsx("code",{children:"ssh-add"}),bKt()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(De,{onClick:()=>void _(),disabled:s||u,children:[f.jsx(Ga,{size:13})," ",s?_a():wm()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(De,{variant:"primary",disabled:s||u,onClick:()=>{c(!t.loggedIn),h(!0),a(m=>m+1)},children:[u?f.jsx(jt,{}):f.jsx(jf,{size:13})," ",t.loggedIn?onn():zL()]})]})]})}const FLn={local:zAe,ssh:lTe,tinker:mTe,hf:hAe,modal:DAe,k8s:xAe,slurm:nTe,ray:QAe,openresearch:HAe},My={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},pR=["hf","modal","slurm","ray","openresearch"],c4=["hf","modal","openresearch"],gH={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"]},q5=["tinker","hf","modal","ray","k8s"],HLn={tinker:ZRe,hf:TRe,modal:$Re,openresearch:GRe},mR="__custom__";function Qp(e,n){return!!(n&&!(gH[e]??[]).includes(n))}function qLn({settings:e,projectId:n,onSaved:t}){const r=dn({mutationFn:h2n}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=T.useState(s),[c,u]=T.useState(i),[h,_]=T.useState(Qp(s,i)),[p,m]=T.useState(!1),[w,k]=T.useState(null),v=e.targets.find(B=>B.id===a),b=e.targets.filter(B=>B.configured||B.id===s),x=pR.includes(a),y=c4.includes(a),C=gH[a]??[],N=a===s&&(!x||c.trim()===i),z=hf[a](),A=HLn[a],j=p?hsn():y&&!c.trim()?izt({destination:z}):a==="ssh"?COt():vOt({destination:z});T.useEffect(()=>{o(s),u(i),_(Qp(s,i))},[s,i]);async function M(B,U){const H=pR.includes(B);if(!(p||c4.includes(B)&&!U.trim())){m(!0),k(null);try{t(await r.mutateAsync({backend:B,flavor:H&&U.trim()||null,projectId:n}))}catch(Q){k(Q instanceof Error?Q.message:String(Q)),o(s),u(i),_(Qp(s,i))}finally{m(!1)}}}function D(B){const U=e.targets.find(Q=>Q.id===B);if(!U)return;o(U.id);const H=U.id===s?i:"";u(H),_(Qp(U.id,H)),c4.includes(U.id)||M(U.id,H)}function I(B){if(B===mR){_(!0);return}_(!1),u(B),(!y||B)&&M(a,B)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:UBt()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:B=>{B.preventDefault(),N||M(a,c)},children:[f.jsx(Yo,{choices:b.map(B=>({id:B.id,label:hf[B.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:B=>{const U=e.targets.find(H=>H.id===B.id);return U?f.jsx(Fh,{kind:My[U.id],size:16}):null},onSelect:D}),x&&f.jsx("div",{children:h?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:c,onChange:B=>u(B.target.value),onBlur:()=>{if(y&&!c.trim()){a===s&&(u(i),_(Qp(s,i)));return}N||M(a,c)},placeholder:uBt(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":Tz(),title:Tz(),onMouseDown:B=>B.preventDefault(),onClick:()=>_(!1),children:f.jsx(sc,{size:12})})]}):f.jsx(Yo,{choices:[{id:"",label:y?ZNt():BOt()},...c&&!C.includes(c)?[{id:c,label:Zjt({value:Ce(c)})}]:[],...C.map(B=>({id:B,label:B})),{id:mR,label:gBt()}],value:c,variant:"field",dropDown:!0,disabled:p,onSelect:I})})]}),w&&f.jsx("div",{className:"error mt-2.5",children:w}),v&&!v.configured&&f.jsx("p",{className:Pa,children:xZt()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),A&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:A()})]})}function ULn({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?$Nt():e.id==="openresearch"?zL():e.id==="ray"?eS():enn();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":hf[e.id](),"aria-describedby":i,"aria-haspopup":q5.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(Fh,{kind:My[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:hf[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:FLn[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?xRt():Prn()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:gAt()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?pL():e.configured?!r||q5.includes(e.id)?iS():Osn():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(W1,{size:16})})]})]})}function GLn({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(R0,{size:16})," ",dL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(Fh,{kind:My[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:hf[e.id]()})]}),n&&f.jsx(Vt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:pL()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(OLn,{}),e.id==="slurm"&&f.jsx(LLn,{}),e.id==="openresearch"&&f.jsx(PLn,{remote:r})]})]})}function VLn({target:e,remote:n,onClose:t}){const r=T.useRef(null),[s,i]=T.useState({dirty:!1,saving:!1});T.useEffect(()=>{const o=r.current;return o==null||o.showModal(),()=>o==null?void 0:o.close()},[]);const a=()=>{s.saving||s.dirty&&!window.confirm(hRt())||t()};return f.jsxs("dialog",{ref:r,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),a())},onCancel:o=>{o.preventDefault(),a()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(Fh,{kind:My[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:hf[e.id]()})]}),f.jsx(Pt,{title:A0(),"aria-label":A0(),onClick:a,disabled:s.saving,children:f.jsx(cr,{size:14})})]}),e.id==="tinker"&&f.jsx(WLn,{target:e}),e.id==="hf"&&f.jsx(XLn,{remote:n}),e.id==="modal"&&f.jsx(TLn,{}),e.id==="ray"&&f.jsx(ILn,{}),e.id==="k8s"&&f.jsx(ALn,{onEditState:i})]})}function KLn({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,D;const s=nI(e==null?void 0:e.id),i=ut(s),a=i.data??null,o=I=>{is(s.queryKey,B=>(typeof I=="function"?I(B??null):I)??void 0)},c=a?null:((M=i.error)==null?void 0:M.message)??null,[u,h]=T.useState(null),[_,p]=T.useState(null),m=bwn(),w=ut(m),k=w.data??null,v=((D=w.error)==null?void 0:D.message)??null;T.useEffect(()=>{h(null),p(null)},[e==null?void 0:e.id]);const b=I=>{o(I),p(null)},x=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=x?[...x].sort((I,B)=>+(B.id===y)-+(I.id===y)):null,N=(C==null?void 0:C.filter(I=>I.configured))??[],z=(C==null?void 0:C.filter(I=>!I.configured))??[],A=I=>f.jsx(ULn,{target:I,isDefault:y===I.id,summary:I.id==="local"?k?BLn(k):v??YBt():void 0,onOpen:I.id==="local"?void 0:()=>h(I.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${I.id}`),j=u?a==null?void 0:a.targets.find(I=>I.id===u):null;return j&&!q5.includes(j.id)?f.jsx(GLn,{target:j,isDefault:y===j.id,onBack:()=>h(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:j$t()}),f.jsx(dIn,{projectId:e==null?void 0:e.id,onViewHistory:n}),c?f.jsx("div",{className:"error",children:c}):a?f.jsxs(f.Fragment,{children:[_&&f.jsx("div",{className:"error",children:_}),f.jsx(qLn,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:iS()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(A)})]}),z.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:Zqt()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:z.map(A)})]}),j&&f.jsx(VLn,{target:j,remote:r,onClose:()=>h(null)})]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",AIt()]})]})}function WLn({target:e}){var x;const n=dn({mutationFn:Oxn}),[t,r]=T.useState(""),[s,i]=T.useState(!1),[a,o]=T.useState(null),c=Vz(),u=ut(c),h=u.data??null,_=a??((x=u.error)==null?void 0:x.message)??null,p=y=>{is(c.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,w]=T.useState(!1),k=u.isPending||m;async function v(){if(!(k||s)){w(!0),o(null);try{await et.fetchQuery({...Vz(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{w(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||k)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!h&&k?f.jsxs(Kr,{children:[f.jsx(jt,{})," ",_a()]}):h&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:$h()}),f.jsx("dd",{className:"m-0",children:f.jsx(Vt,{variant:h.validationStatus==="valid"?"success":h.validationStatus==="invalid"?"error":"warning",children:h.validationStatus==="valid"?km():h.validationStatus==="invalid"?Mrn():h.validationStatus==="billingRequired"?brn():Ab()})})]}),(h==null?void 0:h.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:frn()})}),(h==null?void 0:h.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:Ern()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||h!==null&&h.validationStatus!=="missing"?dtn():Zk(),f.jsx(Gr,{type:"password",value:t,placeholder:(h==null?void 0:h.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),_&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:_}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(De,{type:"button",disabled:s||k,onClick:()=>void v(),children:[f.jsx(Ga,{size:13})," ",k?_a():wm()]}),f.jsx(De,{variant:"primary",type:"submit",disabled:!t.trim()||s||k,children:s?AL():rc()})]})]})]})}function QLn({settings:e}){return e.validationStatus==="missing"?f.jsx(Vt,{variant:"warning",children:Ab()}):e.validationStatus==="invalid"?f.jsx(Vt,{variant:"error",children:mHt()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Vt,{variant:"success",children:km()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Vt,{variant:"warning",children:xGt()}),f.jsx(hS,{content:ETt(),className:"text-subtext",children:f.jsx(gS,{size:15})})]}):null}function XLn({remote:e}){var x;const n=dn({mutationFn:Rxn}),t=Gz(),r=ut(t),s=r.data??null,i=y=>{is(t.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},a=s?null:((x=r.error)==null?void 0:x.message)??null,[o,c]=T.useState(""),[u,h]=T.useState(!1),[_,p]=T.useState(!1),[m,w]=T.useState(null),k=Ty();async function v(){if(!(u||_||!s&&!a)){p(!0),w(null);try{await et.fetchQuery({...Gz(),staleTime:0})}catch(y){w(y instanceof Error?y.message:String(y))}finally{p(!1)}}}async function b(y){if(y.preventDefault(),!(!o.trim()||u||_||!s&&!a)){h(!0),w(null);try{const C=await n.mutateAsync(o.trim());i(C),w(null),c("")}catch(C){w(C instanceof Error?C.message:String(C))}finally{h(!1)}}}return f.jsxs(f.Fragment,{children:[a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[s.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:rS()}),f.jsx("dd",{className:"m-0 text-text",children:s.username})]}),(s.validationStatus==="missing"||s.validationStatus==="invalid"||s.validationStatus==="valid"&&s.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:$h()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(QLn,{settings:s})})]})]}),s.validationStatus==="unreachable"&&s.validationError&&f.jsx("p",{className:Ay,children:s.validationError}),s.source==="env"&&f.jsx("p",{className:Pa,children:kFt()}),s.validationStatus==="valid"&&s.jobsWrite===null&&f.jsx(lC,{note:bTt({login:"`hf auth login`",url:Ce("huggingface.co/settings/tokens")}),className:Pa,disabled:e,onRun:k.start}),f.jsx(Ry,{run:k.run,onComplete:()=>void r.refetch(),onClose:k.clear})]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",uqt()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[s!=null&&s.configured?ytn():ROt(),f.jsx(Gr,{type:"password",value:o,onChange:y=>c(y.target.value),placeholder:(s==null?void 0:s.maskedToken)??mFt(),autoComplete:"off"})]}),m&&f.jsx("div",{className:"error",children:m}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(De,{type:"button",disabled:u||_||!s&&!a,onClick:()=>void v(),children:[f.jsx(Ga,{size:13})," ",_?_a():wm()]}),f.jsx(De,{variant:"primary",type:"submit",disabled:!o.trim()||u||_||!s&&!a,children:u?AL():rc()})]})]})]})}const vH=/^hf_[A-Za-z0-9]{10,}$/;function bH(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Pa,children:[zZt()," ",f.jsx("code",{children:"HF_TOKEN"}),dXt()]})})})}const gR=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function U5(e,n){const t=n instanceof Error?n.message:String(n);xn(t.includes(e)?t:`${e}: ${t}`,"error")}function YLn({name:e,entry:n,onVars:t}){const r=dn({mutationFn:_=>VL(..._)}),s=dn({mutationFn:Gxn}),[i,a]=T.useState(""),[o,c]=T.useState(!1);async function u(){if(!(!i.trim()||o)){c(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(_){U5(e,_)}finally{c(!1)}}}async function h(){if(!o){c(!0);try{t(await s.mutateAsync(e))}catch(_){U5(e,_)}finally{c(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Vt,{children:aWt()})]}):f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:_=>a(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),u()),_.key==="Escape"&&!o&&a("")},placeholder:CL(),"aria-label":XJ({name:Ce(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Pt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:o3({name:Ce(e)}),"aria-label":o3({name:Ce(e)}),onClick:()=>void h(),disabled:o,children:f.jsx(Af,{size:13})}):i.trim()&&f.jsx(De,{size:"small",onClick:()=>void u(),disabled:o,children:o?pa():rc()})})]}),!n&&e!=="HF_TOKEN"&&vH.test(i.trim())&&f.jsx(bH,{})]})}function ZLn({onVars:e,onDone:n}){const t=dn({mutationFn:_=>VL(..._)}),[r,s]=T.useState(""),[i,a]=T.useState(""),[o,c]=T.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){c(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(_){U5(r.trim(),_)}finally{c(!1)}}}const h=_=>{_.key==="Enter"&&(_.preventDefault(),u()),_.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:_=>s(_.target.value),onKeyDown:h,placeholder:"MY_API_KEY","aria-label":PUt(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:_=>a(_.target.value),onKeyDown:h,placeholder:CL(),"aria-label":KUt(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(De,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?pa():rc()}),f.jsx(Pt,{title:cf(),"aria-label":kIt(),onClick:n,disabled:o,children:f.jsx(cr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&vH.test(i.trim())&&f.jsx(bH,{})]})}function JLn(){var u;const e=xwn(),n=ut(e),t=n.data??null,r=h=>{is(e.queryKey,_=>(typeof h=="function"?h(_??null):h)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=T.useState(!1),o=t===null?[]:t.map(h=>h.key).filter(h=>!gR.includes(h)),c=[...gR,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:EJt()}),f.jsxs(De,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(Ph,{size:12})," ",_Lt()]})]}),f.jsx("div",{className:ec,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-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-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[c.map(h=>f.jsx(YLn,{name:h,entry:t.find(_=>_.key===h),onVars:r},h)),i&&f.jsx(ZLn,{onVars:r,onDone:()=>a(!1)})]})})})]})}const Xp=[{value:"system",label:irn,icon:bkn},{value:"light",label:Znn,icon:Gkn},{value:"dark",label:Bnn,icon:xkn}],eIn=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"},{id:"ar",label:"العربية"},{id:"es",label:"Español"},{id:"hi",label:"हिन्दी"}];function tIn(){const e=Vu(),[n,t]=pI(),r=s=>{var h;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(_=>_===document.activeElement),u=((o===-1?Xp.findIndex(_=>_.value===n):o)+i+Xp.length)%Xp.length;t(Xp[u].value),(h=a[u])==null||h.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:sNt()}),f.jsxs("div",{className:`${ec} mt-3`,children:[f.jsxs("div",{className:`${sl} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Pz()}),f.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":Pz(),onKeyDown:r,children:Xp.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?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 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:sl,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:HRt()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Yo,{choices:eIn,value:e,variant:"field",dropDown:!0,onSelect:s=>{pD(s)&&fI(s)}})})]})]})]})}const nIn={installer:G1n,"app-bundle":g1n,appimage:S1n,portable:ivn,cargo:T1n,homebrew:$1n,nix:Z1n,unknown:fvn},l4={cargo:bvn,homebrew:Evn,nix:Mvn};function rIn(){var _;const e=dn({mutationFn:p=>$xn(...p)}),{status:n,error:t,apply:r}=u6(),[s,i]=T.useState(null),[a,o]=T.useState(null),c=U$(n),u=s!==null||c.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:Iz()}),t?f.jsx("div",{className:ec,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]})]});const h=async(p,m)=>{i(p),o(null);try{await m()}catch(w){o(w instanceof Error?w.message:String(w))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:Iz()}),f.jsxs("div",{className:`${ec} mt-3`,children:[f.jsxs("div",{className:`${mf} pb-3.5`,children:[f.jsx("div",{className:"k",children:EL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:IHt()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:gL()}),f.jsx("div",{className:"v",children:nIn[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:VQt()}),f.jsx("p",{children:c.error?$L({error:c.error}):Otn({installed:Ce(n.installedVersion??"—"),current:Ce(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(De,{size:"small",type:"button",disabled:u,onClick:c.restart,children:c.restarting?BL():IL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Oz()}),f.jsxs("p",{children:[MUt(),n.envDisabled&&osn()]})]}),f.jsx(dS,{type:"button",checked:n.autoUpdate,"aria-label":Oz(),disabled:u,onClick:()=>void h("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?esn({version:Ce(n.latest??"—")}):SNt()}),f.jsx("p",{children:n.updateAvailable?oRt():GNt()})]}),f.jsx(De,{size:"small",type:"button",disabled:u,onClick:()=>void h("apply",()=>Lxn().then(r)),children:s==="apply"?Kk():n.updateAvailable?Krn():TNt()})]})]}):f.jsx("div",{className:sl,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:PKt()}),f.jsx("p",{children:((_=l4[n.channel])==null?void 0:_.call(l4))??Een()})]})}),n.channel==="app-bundle"&&f.jsx(iIn,{busy:s,disabled:u,run:h}),a&&f.jsx("div",{className:"error",children:a})]})]})}function sIn(){var _;const e=dn({mutationFn:M2n}),n=jwn(),t=ut(n),r=t.data??null,s=p=>{is(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=T.useState(!1),[o,c]=T.useState(null),u=o??((_=t.error)==null?void 0:_.message)??null,h=()=>{!r||i||(a(!0),c(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>c(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:dJt()}),r?f.jsxs("div",{className:`${ec} mt-3`,children:[f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[Az(),r.locked&&r.reason&&f.jsx(hS,{content:`${rBt()} ${r.reason}.`,className:"text-subtext",children:f.jsx(gS,{size:15})})]}),f.jsx("p",{children:eGt()})]}),f.jsx(dS,{type:"button",checked:r.enabled,"aria-label":Az(),disabled:i||r.locked,onClick:h})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]})]})}function iIn({busy:e,disabled:n,run:t}){const r=dn({mutationFn:Bxn}),[s,i]=T.useState(null),[a,o]=T.useState(!1),c=u=>void t("cli",()=>r.mutateAsync(u).then(h=>{i(h),o(!1)}).catch(h=>{throw o(!u&&String((h==null?void 0:h.message)??h).includes("--force")),h}));return f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:KTt({command:Ce("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?bzt({link:Ce(s.link)}):Ezt({link:Ce(s.link)}),!s.onPath&&YEt({directory:Ce(s.dir)})]}):f.jsx("p",{children:PTt({command:Ce("orx")})})]}),f.jsx(De,{size:"small",type:"button",disabled:n,onClick:()=>c(a),children:e==="cli"?Kk():a?atn():s?Men():MTt()})]})}function aIn({remote:e}){var w;const n=dn({mutationFn:k=>YL(...k)}),t=cS(),r=ut(t),s=r.data??null,i=k=>{is(t.queryKey,v=>(typeof k=="function"?k(v??null):k)??void 0)},[a,o]=T.useState(!1),[c,u]=T.useState(null),h=c??((w=r.error)==null?void 0:w.message)??null,_=async()=>{await r.refetch({cancelRefetch:!1})},p=Ty(),m=()=>{if(!s||a)return;const k=!s.githubForNewProjects;o(!0),u(null),n.mutateAsync([k,!0]).then(i).catch(v=>u(v instanceof Error?v.message:String(v))).finally(()=>o(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qPt()}),s?f.jsxs("div",{className:`${ec} mt-3 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:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:XPt()}),f.jsx(Vt,{variant:s.githubAuthenticated?"success":s.ghInstalled?"warning":"error",children:s.githubAuthenticated?cL():_L()})]}),f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Mz()}),f.jsx("p",{children:BJt()})]}),f.jsx(dS,{type:"button",checked:s.githubForNewProjects,"aria-label":Mz(),disabled:a||!s.githubAuthenticated&&!s.githubForNewProjects,onClick:m})]}),!s.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(yH,{ghInstalled:s.ghInstalled,remote:e,onCheck:_,onRun:p.start})}),f.jsx(Ry,{run:p.run,onComplete:()=>void _(),onClose:p.clear}),h&&f.jsx("div",{className:"error",children:h})]}):h?f.jsx("div",{className:"error",children:h}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]})]})}function yH({ghInstalled:e,remote:n,onCheck:t,onRun:r}){const[s,i]=T.useState(!1),a=()=>{i(!0),t().finally(()=>i(!1))};return f.jsxs(f.Fragment,{children:[f.jsx(lC,{note:e?Ftn():eRt(),className:"git-card-helper m-0 text-sm leading-relaxed text-text",disabled:n||!e,onRun:r}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(bh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[XFt()," ",f.jsx(_f,{size:12})]}),f.jsx(De,{type:"button",variant:e?"warning":"default",disabled:s,onClick:a,children:s?_a():wm()})]})]})}function oIn(){var m,w,k;const e=dn({mutationFn:vxn}),n=dn({mutationFn:bxn}),t=wCn(),r=ut(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((w=r.data)==null?void 0:w.hasSession)??null,a=v=>is(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[c,u]=T.useState(!1),[h,_]=T.useState(null),p=h??((k=r.error)==null?void 0:k.message);return f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:xL()}),f.jsxs("div",{className:mf,children:[f.jsx("span",{className:"k",children:rFt()}),f.jsx("span",{className:"v",children:f.jsx(Vt,{variant:s?"success":"default",children:s===null?p?_o():_a():s?Bz():v3()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:VJt()}),s?f.jsx("div",{className:y0,children:f.jsx(De,{disabled:c,onClick:()=>{u(!0),_(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>_(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:c?$z():Ken()})}):f.jsx(hR,{save:UL,onSaved:v=>o(v.hasToken),placeholder:JKt(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:mf,children:[f.jsx("span",{className:"k",children:yXt()}),f.jsx("span",{className:"v",children:f.jsx(Vt,{variant:i?"success":"default",children:i===null?p?_o():_a():i?Bz():v3()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:NXt()}),i?f.jsx("div",{className:y0,children:f.jsx(De,{disabled:c,onClick:()=>{u(!0),_(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>_(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:c?$z():Pen()})}):f.jsx(hR,{save:v=>GL(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:h3(),createHref:"https://www.overleaf.com/project",createLabel:U1t()}),p&&f.jsx("div",{className:"error",children:p})]})}function cIn({project:e,onProjectUpdate:n,remote:t}){var M;const r=dn({mutationFn:D=>YL(...D)}),s={...zwn((e==null?void 0:e.id)??""),enabled:!!e},i=ut(s),a=Ty(),o=i.data??null,c=D=>{is(s.queryKey,I=>(typeof D=="function"?D(I??null):D)??void 0)},[u,h]=T.useState(!1),[_,p]=T.useState(null),m=_??((M=i.error)==null?void 0:M.message)??null,[w,k]=T.useState(!1),[v,b]=T.useState(!1),[x,y]=T.useState(null),C=!!(o!=null&&o.github.owner&&o.github.repo),N=async()=>{await i.refetch({cancelRefetch:!1})},z=D=>{const I=D instanceof Error?D.message:String(D);return I.toLowerCase().includes("archived")?$At():I.includes("(fetch first)")||I.includes("non-fast-forward")?GAt():I.includes("403")||I.toLowerCase().includes("permission denied")?ZAt():I},A=()=>{e&&(h(!0),p(null),A2n(e.id).then(D=>{c(D.git),n(D.project),et.fetchQuery(cS()).then(I=>{!I.githubForNewProjects&&!I.githubDefaultPromptSeen&&k(!0)}).catch(()=>{})}).catch(D=>p(z(D))).finally(()=>h(!1)))},j=D=>{b(!0),y(null),r.mutateAsync([D,!0]).then(()=>k(!1)).catch(I=>y(I instanceof Error?I.message:String(I))).finally(()=>b(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:BQt()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:Ntn({project:(e==null?void 0:e.name)??Gjt()})}),e?m&&!o?f.jsx("div",{className:"error",children:m}):o?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:Sqt()}),f.jsxs("div",{className:mf,children:[f.jsx("span",{className:"k",children:yWt()}),f.jsx("span",{className:"v",children:o.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:o.gitVersion??QD()}),f.jsx("span",{className:"k",children:dYt()}),f.jsx("span",{className:"v",children:o.initialized?TAt({branch:Ce(o.currentBranch??tS()),state:o.clean?fzt():fTt()}):vDt()}),f.jsx("span",{className:"k",children:rIt()}),f.jsx("span",{className:"v",children:o.baselineBranch}),f.jsx("span",{className:"k",children:RQt()}),f.jsx("span",{className:"v",children:o.remotes.length?o.remotes.map(D=>`${D.name}: ${D.url}`).join(" · "):nS()})]}),!o.initialized&&f.jsx("div",{className:y0,children:f.jsx(De,{variant:"primary",onClick:()=>void j2n(e.id).then(c).catch(D=>p(String(D))),children:AFt()})})]}),f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:mf,children:[f.jsx("span",{className:"k",children:fL()}),f.jsx("span",{className:"v",children:f.jsx(Vt,{variant:o.github.authenticated?"success":o.github.ghInstalled?"warning":"error",children:o.github.authenticated?cL():_L()})}),f.jsx("span",{className:"k",children:OWt()}),f.jsx("span",{className:"v",children:C?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[o.github.owner,"/",o.github.repo]}),!o.github.enabled&&f.jsx(Vt,{children:PYt()})]}):f.jsx(Vt,{children:gqt()})}),o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:MYt()}),f.jsx("span",{className:"v",children:o.github.syncStatus})]})]}),!o.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(yH,{ghInstalled:o.github.ghInstalled,remote:t,onCheck:()=>N(),onRun:a.start})}),f.jsx(Ry,{run:a.run,onComplete:()=>void N(),onClose:a.clear}),o.github.authenticated&&!o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:C?xsn():$jt()}),f.jsxs("div",{className:y0,children:[C&&o.github.url&&f.jsxs(bh,{href:o.github.url,target:"_blank",rel:"noreferrer",children:[Lz()," ",f.jsx(_f,{size:12})]}),f.jsx(De,{variant:"primary",disabled:u,onClick:A,children:u?I8t():A8t()})]})]}),o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:_Pt()}),f.jsxs("div",{className:y0,children:[o.github.url&&f.jsxs(bh,{href:o.github.url,target:"_blank",rel:"noreferrer",children:[Lz()," ",f.jsx(_f,{size:12})]}),f.jsx(De,{disabled:u,onClick:()=>{h(!0),T2n(e.id).then(D=>{c(D.git),n(D.project)}).catch(D=>p(D instanceof Error?D.message:String(D))).finally(()=>h(!1))},children:u?U8t():k8t()})]})]})]}),f.jsx(oIn,{}),m&&f.jsx("div",{className:"error",children:z(m)})]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]}):f.jsx("div",{className:ec,children:f.jsx("p",{className:Pa,children:eKt()})}),w&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>j(!1),children:f.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-modal 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-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:D=>D.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:$qt()}),f.jsx("p",{children:hZt()}),x&&f.jsx("div",{className:"error",children:x}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(De,{disabled:v,onClick:()=>j(!1),children:xVt()}),f.jsx(De,{variant:"primary",disabled:v,onClick:()=>j(!0),children:v?pa():nMt()})]})]})})]})}const lIn={env:Mfn,config:Pfn,xdg:Kfn,default:Efn},u4={preparing:ffn,copying:S_n,verifying:edn,finalizing:T_n},uIn=e=>{var n;return((n=u4[e])==null?void 0:n.call(u4))??e};function _In(){var y;const e=wwn(),n=ut(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=T.useState(""),[a,o]=T.useState(!1),[c,u]=T.useState(null),[h,_]=T.useState({kind:"idle"}),[p,m]=T.useState(null);T.useEffect(()=>{t&&i(C=>C||t.current)},[t]),T.useEffect(()=>uI(C=>{C.type==="progress"?_(N=>{const z=N.kind==="moving"?N.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||z}}):C.type==="done"?(_({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&_({kind:"error",message:C.error})}),[]);const w=(t==null?void 0:t.source)==="env",k=s.trim(),v=t!==null&&k===t.current;async function b(){if(!(a||!k)){o(!0),m(null),u(null);try{u(await Kxn(k))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function x(C){if(C.preventDefault(),!(h.kind==="moving"||!k||v)&&(m(null),!!window.confirm(G_n({path:Ce(k)})))){_({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await Wxn(k)}catch(N){_({kind:"idle"}),m(N instanceof Error?N.message:String(N))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:EYt()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Enn()}),r?f.jsx("div",{className:ec,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:ec,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:SBt()})}),f.jsxs("div",{className:mf,children:[f.jsx("span",{className:"k",children:X$t()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:lIn[t.source]()})]}),!w&&f.jsxs("form",{className:cC,onSubmit:x,children:[f.jsxs("label",{children:[EUt(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:h.kind==="moving"})]}),c&&!c.error&&c.ok&&f.jsxs("p",{className:Pa,children:[dQt()," ",nl(c.treeBytes??0),c.freeBytes!=null&&` — ${$_n({size:Ce(nl(c.freeBytes))})}`,c.sameFilesystem?bfn():"","."]}),c&&c.ok===!1&&c.error&&f.jsx("div",{className:"error",children:c.error}),p&&f.jsx("div",{className:"error",children:p}),h.kind==="moving"&&f.jsx(fH,{value:h.copied,max:h.total,label:uIn(h.phase),caption:h.total>0?f.jsxs("span",{className:"text-sm",children:[nl(h.copied)," / ",nl(h.total)]}):void 0}),h.kind==="done"&&f.jsxs("p",{className:Pa,children:[fUt(),h.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",$Dt({path:Ce(h.oldPathLeft)})]})]}),h.kind==="error"&&f.jsxs("div",{className:"error",children:[iUt()," ",h.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(De,{type:"button",onClick:b,disabled:a||!k||v||h.kind==="moving",children:a?_a():_Nt()}),f.jsx(De,{variant:"primary",type:"submit",disabled:!k||v||h.kind==="moving",children:h.kind==="moving"?ifn():Z_n()})]})]})]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]})]})}const G5=e=>e==="running"||e==="starting";function fIn(e){return G5(e.status)?T0(Date.now()-e.createdAt):e.endedAt?T0(e.endedAt-e.createdAt):"—"}function xH({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_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-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:XLt()}),f.jsx("th",{children:$h()}),f.jsx("th",{children:aYt()}),f.jsx("th",{children:aXt()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(RS,{backend:t.backend}),r&&f.jsx(Bh,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:Dz(),"aria-label":Dz(),onClick:i=>i.stopPropagation(),children:f.jsx(_f,{size:12})})]})}),f.jsx("td",{children:f.jsx(cl,{status:aa(t)})}),f.jsx("td",{children:go(t.createdAt)}),f.jsx("td",{children:fIn(t)})]},t.id)})})]})})}function dIn({projectId:e,onViewHistory:n}){var _;const t=ut({...zu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(_=t.error)==null?void 0:_.message,i=t.isFetching,[,a]=T.useState(0);T.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},c=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>G5(p.status)).sort(c),h=r==null?void 0:r.filter(p=>!G5(p.status)).sort(c);return f.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-8",children:[f.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 [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JQt(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(De,{size:"small",onClick:o,disabled:i,children:[f.jsx(Ga,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Sm()]}),f.jsx(De,{size:"small",onClick:n,children:h!=null&&h.length?NZe({count:Xt(h.length)}):yZe()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!h?f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]}):f.jsx(xH,{instances:u,emptyLabel:e?JYe():dZe()})]})}function hIn({projectId:e,onBack:n}){var c;const t=ut({...zu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(c=t.error)==null?void 0:c.message,i=t.isFetching,[,a]=T.useState(0);T.useEffect(()=>{const u=setInterval(()=>a(h=>h+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.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:n,children:[f.jsx(R0,{size:14})," ",dL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:lHt()}),f.jsxs(De,{size:"small",onClick:o,disabled:i,children:[f.jsx(Ga,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Sm()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(xH,{instances:[...r].sort((u,h)=>h.createdAt-u.createdAt),emptyLabel:e?VYe():aZe()}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]})]})}const wH=["projects","harnesses","storage"],pIn=[{id:"compute",label:hL,icon:f.jsx(mS,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:mL,icon:f.jsx(jf,{size:15}),activeTabs:["environment"]},{id:"settings",label:aS,icon:f.jsx(xS,{size:15}),activeTabs:["settings",...wH]}];function mIn(e){return wH.includes(e)}function gIn({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||mIn(e),a=T.useRef(null);return T.useLayoutEffect(()=>{const o=a.current,c=o==null?void 0:o.parentElement;if(!o||!c)return;const u=()=>o.scrollIntoView({block:"start"}),h=new ResizeObserver(u);h.observe(c),u();const _=()=>h.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,_,{passive:!0});return()=>{_();for(const m of p)window.removeEventListener(m,_)}},[e,n==null?void 0:n.id]),f.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-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:aS()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:yd,children:f.jsx(tIn,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:yd,children:f.jsx(aIn,{remote:s})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:yd,children:f.jsx(zLn,{remote:s})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:yd,children:f.jsx(_In,{})}),f.jsx("section",{className:yd,children:f.jsx(sIn,{})}),!s&&f.jsx("section",{className:yd,children:f.jsx(rIn,{})})]})]}),e==="compute"&&f.jsx(KLn,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(hIn,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:mL()}),f.jsx(JLn,{})]}),e==="git"&&f.jsx(cIn,{project:n,onProjectUpdate:t,remote:s})]})}function sb(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function V5(e){return`${e.plugin?`${sb(e.plugin)}: `:""}${sb(e.name)}`}const kH=["plan","goal","new","resume","model","compact","copy","export"],vIn={plan:()=>uxt(),goal:()=>MKe(),new:()=>Jrt(),resume:()=>Y8t(),model:()=>ztt(),compact:()=>oAe(),copy:()=>MMe(),export:()=>N$e()};function bIn(e){return{name:e,get description(){return vIn[e]()},source:"command"}}function Oy(e){return kH.some(n=>n===e)}const ib={clear:"new",summarize:"compact"};function K5(e){const n=e.toLowerCase();return Oy(n)?n:Object.hasOwn(ib,n)?ib[n]:null}function SH(e){return Object.keys(ib).filter(n=>ib[n]===e)}function yIn(e,n){return e.name.toLowerCase().startsWith(n)||e.plugin&&`${e.plugin}:${e.name}`.toLowerCase().startsWith(n)?!0:e.source==="command"&&Oy(e.name)&&SH(e.name).some(t=>t.startsWith(n))}function _4(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?h:s}${a.slice(h.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function vR(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function CH(e){return kH.filter(n=>n!=="plan"||e)}function kIn(e,n){const t=e.filter(r=>!K5(r.name));for(const r of CH(n))t.push(bIn(r));return t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||V5(r).localeCompare(V5(s),void 0,{sensitivity:"base"}))}function f4(e){return e==="plan"||e==="goal"}function SIn(e,n){for(const t of CH(n).sort((r,s)=>+(r==="plan")-+(s==="plan"))){const r=[t,...SH(t)].join("|");if(t==="plan"){const s=new RegExp(`(^|\\s)\\/(?:${r})(?=\\s|$)`,"gi");if(s.test(e))return{name:t,prompt:e.replace(s,"").trim()}}else if(t==="goal"){const s=new RegExp(`^\\/(?:${r})(?=\\s|$)`,"i");if(s.test(e.trim()))return{name:t,prompt:e.trim().replace(s,"").trim()}}else if(new RegExp(`^\\/(?:${r})$`,"i").test(e.trim()))return{name:t,prompt:""}}return null}function d4(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}const CIn=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let EIn=null;function W5(e,n){const t=EIn??(EIn=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(sb(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}const NIn={plan:lkn,goal:qI,new:Hkn,resume:UI,model:mS,compact:B5n,copy:zf,export:Db};function EH({name:e,className:n}){const t=Oy(e)?NIn[e]:tSn;return f.jsx(t,{size:16,strokeWidth:1.5,className:n,"aria-hidden":"true"})}function NH({name:e}){return f.jsxs(f.Fragment,{children:[f.jsx(EH,{name:e,className:"me-1 inline-block align-middle"}),sb(e)]})}function zH(e,n,t,r,s,i=!1){let a=0;return xIn(e,n).map((o,c,u)=>{var m,w;const h=a+o.text.length;a=h;const _=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,_,h,c);let p=o.text;return i||((m=u[c-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(w=u[c+1])!=null&&w.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(NH,{name:_})},c):i?f.jsx("span",{"aria-hidden":"true",children:o.text},c):f.jsx(T.Fragment,{children:p},c)})}function zIn({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=T.useRef(null),o=T.useRef(null),c=T.useRef(null),u=T.useId(),[h,_]=T.useState(!1),p=ut({...Twn(n,s,r.harness),enabled:h,subscribed:h}),m=p.data??null,w=p.isFetching,[k,v]=T.useState({}),b=()=>{c.current!==null&&window.clearTimeout(c.current),c.current=null},x=()=>{const N=a.current;if(!N)return;const z=N.getBoundingClientRect(),A=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(z.left-4,window.innerWidth-A-16));v(z.top>300?{bottom:window.innerHeight-z.top+12,left:j,width:A}:{left:j,top:z.bottom+12,width:A})},y=()=>{b(),x(),_(!0)},C=()=>{b(),c.current=window.setTimeout(()=>_(!1),120)};return T.useEffect(()=>()=>b(),[]),T.useEffect(()=>{if(!h)return;const N=()=>x();return window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[h]),f.jsxs(T.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":h,"aria-label":DZ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:N=>{var z,A;if(N.key==="Escape"){_(!1);return}if(N.key==="Enter"||N.key===" "){N.preventDefault(),y();return}h&&(N.key==="ArrowDown"||N.key==="PageDown")&&(N.preventDefault(),(z=o.current)==null||z.scrollBy({top:N.key==="PageDown"?240:48,behavior:"smooth"})),h&&(N.key==="ArrowUp"||N.key==="PageUp")&&(N.preventDefault(),(A=o.current)==null||A.scrollBy({top:N.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:N=>{var z,A;N.preventDefault(),(z=i.current)==null||z.focus(),(A=i.current)==null||A.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(NH,{name:n})})})]}),h&&ri.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":qJ({name:n}),style:{...k,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:N=>N.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Vt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Fsn()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:w&&m===null?f.jsx("span",{className:"text-muted",children:Wsn()}):f.jsx(Jo,{text:m??r.description})})]}),document.body)]})}function jIn({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:zH(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function AIn({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=T.useRef(null);return T.useLayoutEffect(()=>{const o=i.current,c=a.current;if(!o||!c)return;const u=()=>{const _=getComputedStyle(o);for(const p of CIn)c.style.setProperty(p,_.getPropertyValue(p));c.style.width=`${o.clientWidth+parseFloat(_.borderLeftWidth)+parseFloat(_.borderRightWidth)}px`};u();const h=new ResizeObserver(u);return h.observe(o),()=>h.disconnect()},[e,i]),T.useLayoutEffect(()=>{const o=i.current;if(!o)return;const c=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return c(),o.addEventListener("scroll",c),()=>o.removeEventListener("scroll",c)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[zH(e,t,"",void 0,(o,c,u,h)=>{var w;const _=e.slice(u),p=((w=/^[ \t]+/.exec(_))==null?void 0:w[0].length)??0;if(u===n||_&&!_.startsWith(` +`)))return f.jsx("code",{className:s,...r,children:t});const c=i?V3(i[1]):null;return f.jsx(dLn,{code:a,lang:c})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})};function yLn({children:e}){return f.jsx("figure",{className:"my-6 mx-auto max-w-full text-left [&_img]:mx-auto [&_img]:my-0 [&_img]:w-auto [&_img]:h-auto [&_img]:max-h-[min(480px,60vh)] [&_img]:object-contain [&_img]:border-0 [&_img]:rounded-none",children:e})}const Jo=T.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Vu();const o=T.useContext(oH),c=i??o,u=T.useMemo(()=>({"file-mention":h=>f.jsx(fR,{path:h.path,lines:h.lines,exp:h.exp,onOpenFile:t}),"run-mention":h=>f.jsx(gLn,{id:h.id,label:h.label,onOpenRun:r}),a:({node:h,href:_,children:p,"data-figure-src":m,...w})=>{const k=typeof m=="string"?LB(m):null;if(k&&t){const v=k.source==="artifact"?`artifacts/${k.path}`:k.path,b=s?s(v):v;if(b)return f.jsx("button",{type:"button",className:"text-primary underline cursor-pointer text-start",...Vr(x=>t(b,void 0,void 0,void 0,x)),children:p})}if(_&&bLn(_)&&t){let v;try{v=decodeURI(_)}catch{return f.jsx("span",{children:p})}const b=s?s(v):v;return b?f.jsx(fR,{path:b,onOpenFile:t}):f.jsx("span",{children:p})}return f.jsx("a",{href:_,target:"_blank",rel:"noopener noreferrer",...w,children:p})},figure:({children:h})=>f.jsx(yLn,{children:h}),figcaption:({children:h})=>f.jsx("figcaption",{className:"mt-3 text-sm italic leading-relaxed text-text",children:h}),th:({node:h,..._})=>f.jsx("th",{dir:"auto",..._}),td:({node:h,..._})=>f.jsx("td",{dir:"auto",..._}),img:({node:h,src:_,alt:p,className:m,...w})=>{var v;if(!_||typeof _!="string")return null;const k=c?c(_):_;return k?T.createElement(_Ln,{...w,key:k,downloadName:(v=_.split(/[\\/]/).pop())==null?void 0:v.split(/[?#]/)[0],src:k,fallbackSrc:i?null:o==null?void 0:o(_,!0),alt:p??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border cursor-zoom-in focus-visible:outline-2 focus-visible:outline-primary ${m??""}`}):null},..._H}),[t,r,s,i,o,c]);return f.jsx("div",{dir:"auto","data-streaming":a||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-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_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-prose-emphasis [&_.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-sm [&_.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-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_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-start [&_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-start [&_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]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-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:f.jsx(sTn,{content:aH(n,{predictMath:a}),processor:vLn,components:u,predict:a})})}),dR="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function xLn({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,c]=T.useState(!1),u=T.useRef(null),[h,_]=T.useState(!1),[p,m]=T.useState(""),w=T.useRef(null);T.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&c(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),T.useEffect(()=>{var v;h&&((v=w.current)==null||v.focus())},[h]);const k=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),_(!1)};return f.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-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(yS,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?Gxt({agent:Ce(n)}):$xt({agent:Ce(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Vr(t),children:_2t()})]}),h?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:w,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:B2t(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),_(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),k())}}),f.jsxs("div",{className:dR,children:[f.jsx(De,{size:"small",onClick:()=>{m(""),_(!1)},children:rL()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(De,{size:"small",variant:"primary",onClick:k,children:[C2t(),f.jsx(PI,{size:13})]})]})]}):f.jsxs("div",{className:dR,children:[f.jsx(De,{size:"small",onClick:i,children:v2t()}),f.jsx(De,{size:"small",onClick:()=>_(!0),children:R2t()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(De,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:gxt()}),f.jsx(De,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":s2t(),onClick:()=>c(v=>!v),children:f.jsx(sc,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(Cn,{onClick:()=>{c(!1),r("bypassPermissions")},children:Sxt()})})]}):f.jsx(De,{size:"small",variant:"primary",onClick:()=>r(),children:Txt()})]})]})}function hR({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=T.useState(""),[o,c]=T.useState(!1),[u,h]=T.useState(null);async function _(p){if(p.preventDefault(),!(o||!i.trim())){c(!0),h(null);try{n(await e(i.trim())),a("")}catch(m){h(m instanceof Error?m.message:String(m))}finally{c(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:_,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(De,{type:"submit",disabled:o||!i.trim(),children:o?pa():rc()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??EKe()}),u&&f.jsx("div",{className:"error",children:u})]})}function fH({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}function wLn({settings:e}){const[n,t]=T.useState(!1);return f.jsxs("label",{className:"inline-flex max-w-full flex-wrap items-center gap-2 text-sm text-subtext",children:[Qln(),f.jsx("span",{className:"inline-block w-max max-w-full",children:f.jsx(Yo,{variant:"field",dropDown:!0,value:e.defaultHost??"",disabled:n,choices:[{id:"",label:bL()},...e.defaultHost&&!e.hosts.some(r=>r.host===e.defaultHost)?[{id:e.defaultHost,label:e.defaultHost}]:[],...e.hosts.map(r=>({id:r.host,label:r.host}))],onSelect:r=>{t(!0),Yxn(r||null).catch(s=>{xn(s instanceof Error?s.message:String(s),"error")}).finally(()=>t(!1))}})})]})}function kLn({host:e,connecting:n,reference:t,onChange:r}){const s=T.useId(),i=dn({mutationFn:Xxn,scope:{id:`ssh-settings-${e.host}`}});function a(o){r(o),i.reset(),!(o!==null&&!o.trim())&&i.mutate({host:e.host,container:(o==null?void 0:o.trim())??null})}return f.jsxs("details",{className:"pb-3",children:[f.jsx("summary",{className:"w-fit cursor-pointer rounded-sm text-sm text-subtext focus-visible:outline-2 focus-visible:outline-text",children:WD()}),f.jsxs("div",{className:"mt-3 grid max-w-xl gap-3",children:[f.jsxs("label",{className:"text-sm text-subtext",children:[mun(),f.jsx(Yo,{variant:"field",dropDown:!0,value:t!==null?"container":"host",disabled:n,choices:[{id:"host",label:nun()},{id:"container",label:lun()}],onSelect:o=>a(o==="container"?"":null)})]}),t!==null&&f.jsxs("label",{className:"text-sm text-subtext",htmlFor:`${s}-container`,children:[Hln(),f.jsx(Gr,{id:`${s}-container`,value:t,disabled:n,required:!0,onChange:o=>a(o.target.value)})]}),i.error&&f.jsx("p",{className:"m-0 text-sm text-accent-red",role:"status",children:i.error.message})]})]})}const ec=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.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-base [&_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(" "),mf=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),SLn=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Ay="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Pa=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),cC=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.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-start","[&_.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-control-subtle","[&_.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-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.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]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-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-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.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-start [&_.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-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.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-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.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","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),sl=["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","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),H5=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.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-base","[&_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-base [&_.kv_.v]:break-normal","[@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(" "),y0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),yd=["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(" "),CLn=new Set(["gh auth login","hf auth login","claude auth status"]);function dH(e){return CLn.has(e)?`/api/settings/commands/run?command=${encodeURIComponent(e)}`:void 0}function Ty(){const[e,n]=T.useState(null);return{run:e,start:(r,s,i)=>n(a=>({command:r,path:s,owner:i,attempt:((a==null?void 0:a.attempt)??0)+1})),clear:()=>n(null)}}function lC({note:e,className:n,disabled:t,resolve:r=dH,onRun:s}){return e?f.jsx("p",{className:n,children:df(e,{canRun:i=>!t&&r(i)!==void 0,onRun:i=>{const a=r(i);a&&s(i,a)}})}):null}function Ry({run:e,onComplete:n,onClose:t}){return e?f.jsx(vSn,{path:e.path,label:e.command,onComplete:n,onError:r=>xn(r,"error"),onClose:t},`${e.command}-${e.attempt}`):null}function o4(e){return e.catalogPending?{cls:"warn",variant:"warning",label:of()}:e.agentReady&&!e.authenticated&&e.authMethod!=="local"?{cls:"warn",variant:"warning",label:XD()}:e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?Jk():PXt()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:qFt()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:YD()}:e.needsConfigRepair||e.authState==="unknown"?{cls:"warn",variant:"warning",label:y3()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:eJt()}:{cls:"warn",variant:"warning",label:yL()}:{cls:"warn",variant:"warning",label:hVt()}}function ELn({h:e}){return e.id==="opencode"&&e.agentReady&&!e.authenticated&&!e.authMethod?f.jsx(f.Fragment,{children:SAt()}):e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:Nv()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?TDt():Zk()}):f.jsx(f.Fragment,{children:"—"})}function NLn(e,n,t){if(!n)return;const r=n.installUrl!==void 0&&t.includes(n.installUrl),s=t===n.login?"login":t===n.install?"install":t===n.update?"update":r?"install":null;if(s&&!(s!=="install"&&(!e.installed||e.installBroken)))return`/api/harnesses/setup?${new URLSearchParams({harness:e.id,action:s,shell:"true"})}`}function zLn({remote:e}){const n=Du(),{data:t=null}=ut(n),[r,s]=T.useState(null),[i,a]=T.useState(!1),o=Ty(),[c,u]=T.useState(null),h=ut(sI()),_=(w,k=!1)=>{a(!0),uf(w,k).catch(()=>{}).finally(()=>a(!1))},p=[...t??[]].sort((w,k)=>Number(k.agentReady)-Number(w.agentReady)),m=p.find(w=>w.id===r)??p[0];return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:b3()}),!e&&c&&h.data&&f.jsx(f$,{harness:c,commands:h.data[c.id],onClose:()=>u(null)}),f.jsx("div",{className:"mt-3 mb-3.5 w-fit max-w-full [&_.option-menu]:w-max",children:f.jsx(Yo,{variant:"field",dropDown:!0,title:b3(),choices:p.map(w=>({id:w.id,label:w.name})),value:(m==null?void 0:m.id)??null,onSelect:w=>{const k=p.find(v=>v.id===w);k&&s(k.id)},renderIcon:w=>{const k=p.find(v=>v.id===w.id);return k&&f.jsx(xh,{harness:k.id})},renderLabel:w=>{const k=p.find(b=>b.id===w.id),v=k&&o4(k);return f.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[w.label,v&&f.jsxs(f.Fragment,{children:[f.jsx("span",{"aria-hidden":"true",className:`size-1.5 shrink-0 rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${v.cls}`}),f.jsx("span",{className:"sr-only",children:v.label})]})]})}})}),t?m?f.jsxs("div",{className:ec,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Kt,{variant:o4(m).variant,children:o4(m).label}),f.jsx("div",{className:"spacer flex-1"}),!e&&!m.catalogPending&&m.installed&&!m.installBroken&&!m.authenticated&&!m.needsConfigRepair&&m.authMethod!=="local"&&m.authMethod!=="apiKey"&&m.authState!=="unsupported"&&f.jsxs(De,{size:"small",onClick:()=>u(m),disabled:!h.data,"aria-haspopup":"dialog",children:[f.jsx(jf,{size:14})," ",qD()]}),f.jsxs(De,{size:"small",onClick:()=>_(!0,!0),disabled:i,children:[f.jsx(Ga,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Sm()]})]}),f.jsxs("div",{className:Cs(mf,"[&_.v]:text-sm"),children:[f.jsx("span",{className:"k",children:uIt()}),f.jsx("span",{className:"v",children:m.binPath??sDt()}),f.jsx("span",{className:"k",children:EL()}),f.jsx("span",{className:"v",children:m.version??"—"}),f.jsx("span",{className:"k",children:TLt()}),f.jsx("span",{className:"v",children:f.jsx(ELn,{h:m})}),m.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:m.id==="opencode"?aen():rS()}),f.jsx("span",{className:"v",children:m.account})]}),m.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:EKt()}),f.jsx("span",{className:"v",children:m.org})]}),m.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:NWt()}),f.jsx("span",{className:"v",children:m.plan})]}),f.jsx("span",{className:"k",children:vLt()}),f.jsx("span",{className:"v",children:m.catalogPending?of():m.models.length>0?YMt({count:Xt(m.models.length),models:new Intl.ListFormat(E()).format(m.models.slice(0,4).map(w=>Ce(V1(w))))}):m.agentReady?f3():nS()})]}),f.jsx(lC,{note:m.agentNote,className:Cs(Pa,"text-sm"),disabled:e,resolve:w=>{var k;return NLn(m,(k=h.data)==null?void 0:k[m.id],w)??dH(w)},onRun:(w,k)=>o.start(w,k,m.id)}),o.run&&f.jsx("div",{hidden:o.run.owner!==m.id,children:f.jsx(Ry,{run:o.run,onComplete:()=>_(!0,!0),onClose:o.clear})}),m.id==="opencode"&&f.jsx(g$,{installed:m.installed})]}):null:f.jsxs(Kr,{children:[f.jsx(jt,{})," ",sPt()]})]})}function jLn({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Kt,{variant:"success",children:L$t()}):f.jsx(Kt,{variant:"error",children:hGt()}):f.jsx(Kt,{variant:"error",children:m$t()}):f.jsx(Kt,{variant:"error",children:AHt()})}function ALn({onEditState:e}){var A;const n=dn({mutationFn:Fxn}),t=Kz(),r=ut(t),s=r.data??null,i=j=>{is(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((A=r.error)==null?void 0:A.message)??null,[o,c]=T.useState(""),[u,h]=T.useState(""),[_,p]=T.useState(!1),[m,w]=T.useState(!1),[k,v]=T.useState(null),b=j=>{i(j),c(j.context??""),h(j.namespace)},x=T.useRef(null);T.useEffect(()=>{const j=x.current;x.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(c(s.context??""),h(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;T.useEffect(()=>{e==null||e({dirty:C,saving:_})},[C,_,e]);async function N(){if(!(m||_||!y)){w(!0);try{await et.fetchQuery({...Kz(),staleTime:0})}catch(j){xn(j instanceof Error?j.message:String(j),"error")}finally{w(!1)}}}async function z(j){if(j.preventDefault(),!(_||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:$h()}),f.jsx("dd",{className:"m-0",children:m||_?f.jsx(Kt,{children:_a()}):C?f.jsx(Kt,{children:BD()}):f.jsx(jLn,{s})})]}),y&&!m&&!_&&s.preflight.error&&f.jsx("p",{className:`${Ay} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:z,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[q$t(),f.jsx(Yo,{choices:[{id:"",label:s.currentContext?DRt({context:Ce(s.currentContext)}):zRt()},...o&&!s.contexts.includes(o)?[{id:o,label:_Dt({context:Ce(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:_||m,onSelect:c})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[bUt(),f.jsx(Gr,{type:"text",value:u,disabled:_||m,onChange:j=>h(j.target.value),placeholder:TBt(),autoComplete:"off",spellCheck:!1})]}),k&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:k}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(De,{type:"button",onClick:()=>void N(),disabled:_||m||!y,children:[f.jsx(Ga,{size:13})," ",m?_a():wm()]}),f.jsx(De,{variant:"primary",type:"submit",disabled:_||m||y,children:_?pa():rc()})]})]})]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",IIt()]})})}function TLn(){var y;const e=dn({mutationFn:C=>qxn(...C)}),n=Wz(),t=ut(n),r=t.data??null,s=C=>{is(n.queryKey,N=>(typeof C=="function"?C(N??null):C)??void 0)},[i,a]=T.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[c,u]=T.useState(""),[h,_]=T.useState(""),[p,m]=T.useState(!1),w=t.isPending||p,[k,v]=T.useState(!1);async function b(){if(!(w||k)){m(!0),a(null);try{await et.fetchQuery({...Wz(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function x(C){if(C.preventDefault(),!(!c.trim()||!h.trim()||w||k||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([c.trim(),h.trim()])),u(""),_("")}catch(N){a(N instanceof Error?N.message:String(N))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&w?f.jsxs(Kr,{children:[f.jsx(jt,{})," ",UIt()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:$h()}),f.jsx("dd",{className:"m-0",children:f.jsx(Kt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?iS():Ab()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:lMt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:x,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?mMt():IMt(),f.jsx(Gr,{type:"password",value:c,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?kMt():UMt(),f.jsx(Gr,{type:"password",value:h,onChange:C=>_(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:AMt()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(De,{type:"button",disabled:w||k,onClick:()=>void b(),children:[f.jsx(Ga,{size:13})," ",Sm()]}),f.jsx(De,{variant:"primary",type:"submit",disabled:!c.trim()||!h.trim()||w||k||(r==null?void 0:r.processEnv),children:k?pa():rc()})]})]})]})}const hH="rounded-sm border-border-strong bg-surface text-subtext",pH="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",RLn=5e3;function mH(e){const n=Ha(),t=e.map(a=>Qz(a)),r=rK({queries:t.map(a=>({...a,refetchInterval:RLn}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Un(n)&&is(Qz(a).queryKey,{running:!0})}]}function MLn({test:e,connecting:n,masterRunning:t,containerFailed:r=!1}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Kt,{className:pH,children:lL()})});if(e===void 0)return f.jsx(Kt,{className:hH,children:vL()});const s=e.missingTools??[],i=e.reachable&&e.toolsFound&&t===!1,a=!e.reachable||r?f.jsx(Kt,{className:"rounded-sm",variant:"error",children:sS()}):e.toolsFound?i?f.jsx(Kt,{className:"rounded-sm",variant:"warning",children:uL()}):f.jsx(Kt,{className:"rounded-sm",variant:"success",children:km()}):f.jsx(Kt,{className:"rounded-sm",variant:"error",children:s.length===1?sOt({tool:Ce(s[0])}):_Ot()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[a,!i&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:go(e.testedAt)})]})}function OLn(){var D;const e=rI(),n=ut(e),t=((D=n.data)==null?void 0:D.hosts)??(n.isError?[]:null),[r,s]=T.useState(!1),[i,a]=T.useState({}),[o,c]=T.useState({}),u=T.useRef(0),[h,_]=T.useState(!1),[p,m]=T.useState({}),[w,k]=T.useState(null),[v,b]=T.useState(!1),[x,y]=T.useState(0),C=(t==null?void 0:t.filter(I=>{const B=i[I.host]??I.lastTest;return(B==null?void 0:B.reachable)&&B.toolsFound}).map(I=>I.host))??[],[N,z]=mH(C);function A(I){u.current+=1,_(!1),b(!1),y(B=>B+1),k(I),m(B=>({...B,[I]:!0}))}function j(){u.current+=1,_(!1),b(!1),k(null)}function M(I,B){m(U=>({...U,[I]:!B}))}return f.jsxs(f.Fragment,{children:[n.error&&f.jsx("p",{className:"text-sm text-accent-red",children:n.error.message}),f.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3",children:[n.data&&f.jsx(wLn,{settings:n.data}),f.jsxs(De,{variant:"ghost",className:"ms-auto",onClick:()=>s(!0),children:[f.jsx(xS,{size:14})," ",RL()]})]}),t===null?f.jsxs(Kr,{children:[f.jsx(jt,{})," ",wL()]}):t.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:oGt()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:t.map(I=>{var K,ne,ae;const B=o[I.host]===void 0?I.container??null:o[I.host],U=i[I.host],H=B!==null&&((K=U==null?void 0:U.container)==null?void 0:K.reference)===B.trim()?U:void 0,Q=B!==null?H:U!=null&&U.container?I.lastTest:U??I.lastTest,V=(ne=H==null?void 0:H.container)==null?void 0:ne.error,Z=((ae=H==null?void 0:H.container)==null?void 0:ae.ready)===!1,Y=(Q==null?void 0:Q.error)||V,$=w===I.host,L=p[I.host]??!1,F=$||!!Y,q=`${I.user?`${I.user}@`:""}${I.hostname??I.host}${I.port?`:${I.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3",children:[f.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:I.host,children:I.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:q,children:q})]})}),f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsxs("div",{className:"flex items-center gap-2 text-start",children:[f.jsx(MLn,{test:Q,connecting:$&&!v,masterRunning:N[I.host],containerFailed:Z}),F&&f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":L,"aria-label":L?hX({name:Ce(I.host)}):eY({name:Ce(I.host)}),onClick:ue=>{ue.stopPropagation(),M(I.host,L)},children:f.jsx(sc,{size:18,className:`text-muted transition-transform duration-120 ease-standard${L?" rotate-180":""}`})})]}),f.jsx(De,{size:"small",type:"button",className:"justify-self-end",onClick:ue=>{ue.stopPropagation(),$&&!v?j():A(I.host)},disabled:!$&&(w!==null&&!v||B!==null&&!B.trim()),children:$?v?ti():cf():(Q==null?void 0:Q.reachable)===!1||Z?ti():Q?NL():eS()})]})]}),f.jsx(kLn,{host:I,connecting:$&&!v,reference:B,onChange:ue=>{$&&j(),c(se=>({...se,[I.host]:ue})),a(se=>{const G={...se};return delete G[I.host],G})}}),F&&(L||$)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3${L?"":" hidden"}`,children:[!$&&Y&&f.jsx(bSn,{host:I.host,transcript:Y}),$&&!h&&f.jsx(CS,{host:I.host,backend:"ssh",active:L,onComplete:ue=>{if(ue.backend!=="ssh")return;z(I.host);const se=u.current;if(B===null){a(G=>({...G,[I.host]:{...ue.result,container:null}})),b(!1),k(null);return}_(!0),Zxn(I.host,B.trim()).then(G=>{u.current===se&&a(oe=>({...oe,[I.host]:{...G,container:G.container??{reference:B.trim(),ready:!1,error:G.error??null}}}))}).catch(G=>{u.current===se&&a(oe=>({...oe,[I.host]:{...ue.result,container:{reference:B.trim(),ready:!1,error:G instanceof Error?G.message:String(G)}}}))}).finally(()=>{u.current===se&&(_(!1),b(!1),k(null))})},onError:ue=>{b(!0),a(se=>({...se,[I.host]:{container:B===null?null:{reference:B.trim(),ready:!1,error:ue},reachable:!1,toolsFound:!1,missingTools:[],error:ue,testedAt:Date.now()}}))}},x)]})]},I.host)})}),r&&f.jsx(H$,{onClose:()=>s(!1)})]})}function DLn({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Kt,{className:pH,children:lL()}):e===null?f.jsx(Kt,{className:hH,children:vL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Kt,{className:"rounded-sm",variant:"warning",children:uL()}):f.jsx(Kt,{className:"rounded-sm",variant:"success",children:km()}):f.jsx(Kt,{className:"rounded-sm",variant:"error",children:Gqt()}):f.jsx(Kt,{className:"rounded-sm",variant:"error",children:HGt()}):f.jsx(Kt,{className:"rounded-sm",variant:"error",children:sS()})}function LLn(){var Y;const e=dn({mutationFn:l2n}),n=gwn(),t=ut(n),r=t.data??null,s=$=>{is(n.queryKey,L=>(typeof $=="function"?$(L??null):$)??void 0)},i=r?null:((Y=t.error)==null?void 0:Y.message)??null,[a,o]=T.useState(""),[c,u]=T.useState(""),[h,_]=T.useState(""),[p,m]=T.useState(""),[w,k]=T.useState(!1),[v,b]=T.useState(null),[x,y]=T.useState(null),[C,N]=T.useState(!1),[z,A]=T.useState(!1),[j,M]=T.useState(0),D=a&&(x!=null&&x.reachable)&&x.slurmFound&&x.toolsFound?[a]:[],[I,B]=mH(D);function U(){A(!1),M($=>$+1),N(!0)}const H=$=>{s($),o($.host??""),u($.partition??""),_($.account??""),m($.timeLimit??"")},Q=T.useRef(null);T.useEffect(()=>{const $=Q.current;Q.current=r,r&&(!$||a===($.host??"")&&c.trim()===($.partition??"")&&h.trim()===($.account??"")&&p.trim()===($.timeLimit??""))&&(o(r.host??""),u(r.partition??""),_(r.account??""),m(r.timeLimit??""))},[r,a,c,h,p]);const V=r!==null&&a===(r.host??"")&&c.trim()===(r.partition??"")&&h.trim()===(r.account??"")&&p.trim()===(r.timeLimit??"");async function Z($){if($.preventDefault(),!w){k(!0),b(null);try{H(await e.mutateAsync({host:a,partition:c.trim(),account:h.trim(),timeLimit:p.trim()}))}catch(L){b(L instanceof Error?L.message:String(L))}finally{k(!1)}}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[!C&&(x==null?void 0:x.error)&&f.jsx("p",{className:Ay,children:x.error}),f.jsxs("form",{className:cC,onSubmit:Z,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[Tqt(),f.jsx(Yo,{choices:[{id:"",label:bL()},...a&&!r.hosts.some($=>$.host===a)?[{id:a,label:`${a} (not in ~/.ssh/config)`}]:[],...r.hosts.map($=>({id:$.host,label:$.host}))],value:a,variant:"field",dropDown:!0,disabled:w||C,onSelect:$=>{o($),y(null),N(!1),A(!1)}})]})}),f.jsxs("div",{className:"actions",children:[f.jsx(De,{type:"button",onClick:()=>{C&&!z?(A(!1),N(!1)):U()},disabled:!a,title:a?void 0:JJt(),children:C?z?ti():cf():x?NL():eS()}),f.jsx("span",{role:"status",children:f.jsx(DLn,{test:x,connecting:C&&!z,masterRunning:I[a]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[dWt(),f.jsx(Gr,{type:"text",list:"slurm-partitions",value:c,onChange:$=>u($.target.value),placeholder:Rz(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:x==null?void 0:x.partitions.map($=>f.jsx("option",{value:$},$))})]}),f.jsxs("label",{children:[rS(),f.jsx(Gr,{type:"text",value:h,onChange:$=>_($.target.value),placeholder:Rz(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[DZt(),f.jsx(Gr,{type:"text",value:p,onChange:$=>m($.target.value),placeholder:l$t(),autoComplete:"off",spellCheck:!1})]})]}),v&&f.jsx("div",{className:"error",children:v}),f.jsx("div",{className:"actions",children:f.jsx(De,{variant:"primary",type:"submit",disabled:w||V||C,children:w?pa():rc()})})]}),C&&f.jsx(CS,{host:a,backend:"slurm",onComplete:$=>{$.backend==="slurm"&&(y($.result),B(a),A(!1),N(!1))},onError:$=>{A(!0),y({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:$})}},j)]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",rqt()]})})}function ILn(){var C;const e=dn({mutationFn:_2n}),n=vwn(),t=ut(n),r=t.data??null,s=N=>{is(n.queryKey,z=>(typeof N=="function"?N(z??null):N)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=T.useState(""),[c,u]=T.useState(!1),[h,_]=T.useState(null),[p,m]=T.useState(null),w=p!==null&&p!=="testing"?p:null,k=N=>{s(N),o(N.address??"")},v=T.useRef(null);T.useEffect(()=>{const N=v.current;v.current=r,r&&(!N||a===(N.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function x(N){if(N.preventDefault(),!c){u(!0),_(null);try{k(await e.mutateAsync({address:a}))}catch(z){_(z instanceof Error?z.message:String(z))}finally{u(!1)}}}async function y(){m("testing");try{m(await f2n(a.trim()||void 0))}catch(N){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:N instanceof Error?N.message:String(N)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(w==null?void 0:w.error)&&f.jsx("p",{className:Ay,children:w.error}),f.jsxs("form",{className:cC,onSubmit:x,children:[f.jsxs("label",{children:[kHt(),f.jsx(Gr,{type:"text",value:a,onChange:N=>{o(N.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[vPt(),": ",Ce(r.resolvedAddress)," · ",kL(),": ",r.source]}),h&&f.jsx("div",{className:"error",children:h}),f.jsxs("div",{className:"actions",children:[f.jsx(De,{variant:"primary",type:"submit",disabled:c||b,children:c?pa():rc()}),f.jsx(De,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:KYt()}),f.jsx($Ln,{test:p})]}),(w==null?void 0:w.reachable)&&w.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[FWt(),": ",w.rayVersion]})]})]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",XHt()]})})}function $Ln({test:e}){return e===null?null:e==="testing"?f.jsx(Kt,{children:eZt()}):e.reachable?f.jsx(Kt,{variant:"success",children:WWt()}):f.jsx(Kt,{variant:"error",children:sS()})}function BLn(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:nl(e.memBytes),r=e.gpus.length===0?null:iTt({count:e.gpus.length});return[n,e.cpuCount>0?Tjt({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function PLn({remote:e}){var p;const n=ut(ywn()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=T.useState(0),[o,c]=T.useState(!0),[u,h]=T.useState(!1),_=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:SLn,children:[f.jsx("span",{className:"k",children:$h()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Kt,{className:"gap-1.5",role:"status",children:[f.jsx(jt,{}),u?GDt():_a()]}):r?f.jsx(Kt,{variant:"warning",children:y3()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Kt,{variant:"success",children:km()}):t.sshKeyStatus==="unknown"?f.jsx(Kt,{variant:"warning",children:y3()}):f.jsx(Kt,{variant:"warning",children:Ab()}):f.jsx(Kt,{variant:"warning",children:yL()}):null}),f.jsx("span",{className:"k",children:MKt()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:JXt()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Kt,{variant:"success",children:KVt()}):t.sshKeyStatus==="no_local_match"?f.jsx(Kt,{variant:"warning",children:zVt()}):t.sshKeyStatus==="none_registered"?f.jsx(Kt,{variant:"error",children:QGt()}):f.jsx(Kt,{children:SL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:QRt({command:Ce("orx login")})}),!e&&i>0&&f.jsx(gSn,{login:o,onComplete:()=>{h(!1),a(0),_()},onError:m=>{h(!1),xn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Pa,children:[sLt()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Pa,children:[DGt()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),oZt()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Pa,children:ben({register:Ce(`orx ssh-key add ${t.sshKeyPath}`),load:Ce("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Pa,children:[zGt()," ",f.jsx("code",{children:"ssh-add"}),bKt()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(De,{onClick:()=>void _(),disabled:s||u,children:[f.jsx(Ga,{size:13})," ",s?_a():wm()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(De,{variant:"primary",disabled:s||u,onClick:()=>{c(!t.loggedIn),h(!0),a(m=>m+1)},children:[u?f.jsx(jt,{}):f.jsx(jf,{size:13})," ",t.loggedIn?onn():zL()]})]})]})}const FLn={local:zAe,ssh:lTe,tinker:mTe,hf:hAe,modal:DAe,k8s:xAe,slurm:nTe,ray:QAe,openresearch:HAe},My={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},pR=["hf","modal","slurm","ray","openresearch"],c4=["hf","modal","openresearch"],gH={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"]},q5=["tinker","hf","modal","ray","k8s"],HLn={tinker:ZRe,hf:TRe,modal:$Re,openresearch:GRe},mR="__custom__";function Qp(e,n){return!!(n&&!(gH[e]??[]).includes(n))}function qLn({settings:e,projectId:n,onSaved:t}){const r=dn({mutationFn:h2n}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=T.useState(s),[c,u]=T.useState(i),[h,_]=T.useState(Qp(s,i)),[p,m]=T.useState(!1),[w,k]=T.useState(null),v=e.targets.find(B=>B.id===a),b=e.targets.filter(B=>B.configured||B.id===s),x=pR.includes(a),y=c4.includes(a),C=gH[a]??[],N=a===s&&(!x||c.trim()===i),z=hf[a](),A=HLn[a],j=p?hsn():y&&!c.trim()?izt({destination:z}):a==="ssh"?COt():vOt({destination:z});T.useEffect(()=>{o(s),u(i),_(Qp(s,i))},[s,i]);async function M(B,U){const H=pR.includes(B);if(!(p||c4.includes(B)&&!U.trim())){m(!0),k(null);try{t(await r.mutateAsync({backend:B,flavor:H&&U.trim()||null,projectId:n}))}catch(Q){k(Q instanceof Error?Q.message:String(Q)),o(s),u(i),_(Qp(s,i))}finally{m(!1)}}}function D(B){const U=e.targets.find(Q=>Q.id===B);if(!U)return;o(U.id);const H=U.id===s?i:"";u(H),_(Qp(U.id,H)),c4.includes(U.id)||M(U.id,H)}function I(B){if(B===mR){_(!0);return}_(!1),u(B),(!y||B)&&M(a,B)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:UBt()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:B=>{B.preventDefault(),N||M(a,c)},children:[f.jsx(Yo,{choices:b.map(B=>({id:B.id,label:hf[B.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:B=>{const U=e.targets.find(H=>H.id===B.id);return U?f.jsx(Fh,{kind:My[U.id],size:16}):null},onSelect:D}),x&&f.jsx("div",{children:h?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:c,onChange:B=>u(B.target.value),onBlur:()=>{if(y&&!c.trim()){a===s&&(u(i),_(Qp(s,i)));return}N||M(a,c)},placeholder:uBt(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":Tz(),title:Tz(),onMouseDown:B=>B.preventDefault(),onClick:()=>_(!1),children:f.jsx(sc,{size:12})})]}):f.jsx(Yo,{choices:[{id:"",label:y?ZNt():BOt()},...c&&!C.includes(c)?[{id:c,label:Zjt({value:Ce(c)})}]:[],...C.map(B=>({id:B,label:B})),{id:mR,label:gBt()}],value:c,variant:"field",dropDown:!0,disabled:p,onSelect:I})})]}),w&&f.jsx("div",{className:"error mt-2.5",children:w}),v&&!v.configured&&f.jsx("p",{className:Pa,children:xZt()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),A&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:A()})]})}function ULn({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?$Nt():e.id==="openresearch"?zL():e.id==="ray"?eS():enn();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":hf[e.id](),"aria-describedby":i,"aria-haspopup":q5.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(Fh,{kind:My[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:hf[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:FLn[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?xRt():Prn()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:gAt()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?pL():e.configured?!r||q5.includes(e.id)?iS():Osn():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(W1,{size:16})})]})]})}function GLn({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(R0,{size:16})," ",dL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(Fh,{kind:My[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:hf[e.id]()})]}),n&&f.jsx(Kt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:pL()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(OLn,{}),e.id==="slurm"&&f.jsx(LLn,{}),e.id==="openresearch"&&f.jsx(PLn,{remote:r})]})]})}function VLn({target:e,remote:n,onClose:t}){const r=T.useRef(null),[s,i]=T.useState({dirty:!1,saving:!1});T.useEffect(()=>{const o=r.current;return o==null||o.showModal(),()=>o==null?void 0:o.close()},[]);const a=()=>{s.saving||s.dirty&&!window.confirm(hRt())||t()};return f.jsxs("dialog",{ref:r,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),a())},onCancel:o=>{o.preventDefault(),a()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(Fh,{kind:My[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:hf[e.id]()})]}),f.jsx(Pt,{title:A0(),"aria-label":A0(),onClick:a,disabled:s.saving,children:f.jsx(cr,{size:14})})]}),e.id==="tinker"&&f.jsx(WLn,{target:e}),e.id==="hf"&&f.jsx(XLn,{remote:n}),e.id==="modal"&&f.jsx(TLn,{}),e.id==="ray"&&f.jsx(ILn,{}),e.id==="k8s"&&f.jsx(ALn,{onEditState:i})]})}function KLn({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,D;const s=nI(e==null?void 0:e.id),i=ut(s),a=i.data??null,o=I=>{is(s.queryKey,B=>(typeof I=="function"?I(B??null):I)??void 0)},c=a?null:((M=i.error)==null?void 0:M.message)??null,[u,h]=T.useState(null),[_,p]=T.useState(null),m=bwn(),w=ut(m),k=w.data??null,v=((D=w.error)==null?void 0:D.message)??null;T.useEffect(()=>{h(null),p(null)},[e==null?void 0:e.id]);const b=I=>{o(I),p(null)},x=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=x?[...x].sort((I,B)=>+(B.id===y)-+(I.id===y)):null,N=(C==null?void 0:C.filter(I=>I.configured))??[],z=(C==null?void 0:C.filter(I=>!I.configured))??[],A=I=>f.jsx(ULn,{target:I,isDefault:y===I.id,summary:I.id==="local"?k?BLn(k):v??YBt():void 0,onOpen:I.id==="local"?void 0:()=>h(I.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${I.id}`),j=u?a==null?void 0:a.targets.find(I=>I.id===u):null;return j&&!q5.includes(j.id)?f.jsx(GLn,{target:j,isDefault:y===j.id,onBack:()=>h(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:j$t()}),f.jsx(dIn,{projectId:e==null?void 0:e.id,onViewHistory:n}),c?f.jsx("div",{className:"error",children:c}):a?f.jsxs(f.Fragment,{children:[_&&f.jsx("div",{className:"error",children:_}),f.jsx(qLn,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:iS()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(A)})]}),z.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:Zqt()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:z.map(A)})]}),j&&f.jsx(VLn,{target:j,remote:r,onClose:()=>h(null)})]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",AIt()]})]})}function WLn({target:e}){var x;const n=dn({mutationFn:Oxn}),[t,r]=T.useState(""),[s,i]=T.useState(!1),[a,o]=T.useState(null),c=Vz(),u=ut(c),h=u.data??null,_=a??((x=u.error)==null?void 0:x.message)??null,p=y=>{is(c.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,w]=T.useState(!1),k=u.isPending||m;async function v(){if(!(k||s)){w(!0),o(null);try{await et.fetchQuery({...Vz(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{w(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||k)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!h&&k?f.jsxs(Kr,{children:[f.jsx(jt,{})," ",_a()]}):h&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:$h()}),f.jsx("dd",{className:"m-0",children:f.jsx(Kt,{variant:h.validationStatus==="valid"?"success":h.validationStatus==="invalid"?"error":"warning",children:h.validationStatus==="valid"?km():h.validationStatus==="invalid"?Mrn():h.validationStatus==="billingRequired"?brn():Ab()})})]}),(h==null?void 0:h.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:frn()})}),(h==null?void 0:h.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:Ern()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||h!==null&&h.validationStatus!=="missing"?dtn():Zk(),f.jsx(Gr,{type:"password",value:t,placeholder:(h==null?void 0:h.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),_&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:_}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(De,{type:"button",disabled:s||k,onClick:()=>void v(),children:[f.jsx(Ga,{size:13})," ",k?_a():wm()]}),f.jsx(De,{variant:"primary",type:"submit",disabled:!t.trim()||s||k,children:s?AL():rc()})]})]})]})}function QLn({settings:e}){return e.validationStatus==="missing"?f.jsx(Kt,{variant:"warning",children:Ab()}):e.validationStatus==="invalid"?f.jsx(Kt,{variant:"error",children:mHt()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Kt,{variant:"success",children:km()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Kt,{variant:"warning",children:xGt()}),f.jsx(hS,{content:ETt(),className:"text-subtext",children:f.jsx(gS,{size:15})})]}):null}function XLn({remote:e}){var x;const n=dn({mutationFn:Rxn}),t=Gz(),r=ut(t),s=r.data??null,i=y=>{is(t.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},a=s?null:((x=r.error)==null?void 0:x.message)??null,[o,c]=T.useState(""),[u,h]=T.useState(!1),[_,p]=T.useState(!1),[m,w]=T.useState(null),k=Ty();async function v(){if(!(u||_||!s&&!a)){p(!0),w(null);try{await et.fetchQuery({...Gz(),staleTime:0})}catch(y){w(y instanceof Error?y.message:String(y))}finally{p(!1)}}}async function b(y){if(y.preventDefault(),!(!o.trim()||u||_||!s&&!a)){h(!0),w(null);try{const C=await n.mutateAsync(o.trim());i(C),w(null),c("")}catch(C){w(C instanceof Error?C.message:String(C))}finally{h(!1)}}}return f.jsxs(f.Fragment,{children:[a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[s.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:rS()}),f.jsx("dd",{className:"m-0 text-text",children:s.username})]}),(s.validationStatus==="missing"||s.validationStatus==="invalid"||s.validationStatus==="valid"&&s.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:$h()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(QLn,{settings:s})})]})]}),s.validationStatus==="unreachable"&&s.validationError&&f.jsx("p",{className:Ay,children:s.validationError}),s.source==="env"&&f.jsx("p",{className:Pa,children:kFt()}),s.validationStatus==="valid"&&s.jobsWrite===null&&f.jsx(lC,{note:bTt({login:"`hf auth login`",url:Ce("huggingface.co/settings/tokens")}),className:Pa,disabled:e,onRun:k.start}),f.jsx(Ry,{run:k.run,onComplete:()=>void r.refetch(),onClose:k.clear})]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",uqt()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[s!=null&&s.configured?ytn():ROt(),f.jsx(Gr,{type:"password",value:o,onChange:y=>c(y.target.value),placeholder:(s==null?void 0:s.maskedToken)??mFt(),autoComplete:"off"})]}),m&&f.jsx("div",{className:"error",children:m}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(De,{type:"button",disabled:u||_||!s&&!a,onClick:()=>void v(),children:[f.jsx(Ga,{size:13})," ",_?_a():wm()]}),f.jsx(De,{variant:"primary",type:"submit",disabled:!o.trim()||u||_||!s&&!a,children:u?AL():rc()})]})]})]})}const vH=/^hf_[A-Za-z0-9]{10,}$/;function bH(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Pa,children:[zZt()," ",f.jsx("code",{children:"HF_TOKEN"}),dXt()]})})})}const gR=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function U5(e,n){const t=n instanceof Error?n.message:String(n);xn(t.includes(e)?t:`${e}: ${t}`,"error")}function YLn({name:e,entry:n,onVars:t}){const r=dn({mutationFn:_=>VL(..._)}),s=dn({mutationFn:Gxn}),[i,a]=T.useState(""),[o,c]=T.useState(!1);async function u(){if(!(!i.trim()||o)){c(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(_){U5(e,_)}finally{c(!1)}}}async function h(){if(!o){c(!0);try{t(await s.mutateAsync(e))}catch(_){U5(e,_)}finally{c(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Kt,{children:aWt()})]}):f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:_=>a(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),u()),_.key==="Escape"&&!o&&a("")},placeholder:CL(),"aria-label":XJ({name:Ce(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Pt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:o3({name:Ce(e)}),"aria-label":o3({name:Ce(e)}),onClick:()=>void h(),disabled:o,children:f.jsx(Af,{size:13})}):i.trim()&&f.jsx(De,{size:"small",onClick:()=>void u(),disabled:o,children:o?pa():rc()})})]}),!n&&e!=="HF_TOKEN"&&vH.test(i.trim())&&f.jsx(bH,{})]})}function ZLn({onVars:e,onDone:n}){const t=dn({mutationFn:_=>VL(..._)}),[r,s]=T.useState(""),[i,a]=T.useState(""),[o,c]=T.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){c(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(_){U5(r.trim(),_)}finally{c(!1)}}}const h=_=>{_.key==="Enter"&&(_.preventDefault(),u()),_.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:_=>s(_.target.value),onKeyDown:h,placeholder:"MY_API_KEY","aria-label":PUt(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:_=>a(_.target.value),onKeyDown:h,placeholder:CL(),"aria-label":KUt(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(De,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?pa():rc()}),f.jsx(Pt,{title:cf(),"aria-label":kIt(),onClick:n,disabled:o,children:f.jsx(cr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&vH.test(i.trim())&&f.jsx(bH,{})]})}function JLn(){var u;const e=xwn(),n=ut(e),t=n.data??null,r=h=>{is(e.queryKey,_=>(typeof h=="function"?h(_??null):h)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=T.useState(!1),o=t===null?[]:t.map(h=>h.key).filter(h=>!gR.includes(h)),c=[...gR,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:EJt()}),f.jsxs(De,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(Ph,{size:12})," ",_Lt()]})]}),f.jsx("div",{className:ec,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-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-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[c.map(h=>f.jsx(YLn,{name:h,entry:t.find(_=>_.key===h),onVars:r},h)),i&&f.jsx(ZLn,{onVars:r,onDone:()=>a(!1)})]})})})]})}const Xp=[{value:"system",label:irn,icon:bkn},{value:"light",label:Znn,icon:Gkn},{value:"dark",label:Bnn,icon:xkn}],eIn=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"},{id:"ar",label:"العربية"},{id:"es",label:"Español"},{id:"hi",label:"हिन्दी"}];function tIn(){const e=Vu(),[n,t]=pI(),r=s=>{var h;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(_=>_===document.activeElement),u=((o===-1?Xp.findIndex(_=>_.value===n):o)+i+Xp.length)%Xp.length;t(Xp[u].value),(h=a[u])==null||h.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:sNt()}),f.jsxs("div",{className:`${ec} mt-3`,children:[f.jsxs("div",{className:`${sl} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Pz()}),f.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":Pz(),onKeyDown:r,children:Xp.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?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 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:sl,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:HRt()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Yo,{choices:eIn,value:e,variant:"field",dropDown:!0,onSelect:s=>{pD(s)&&fI(s)}})})]})]})]})}const nIn={installer:G1n,"app-bundle":g1n,appimage:S1n,portable:ivn,cargo:T1n,homebrew:$1n,nix:Z1n,unknown:fvn},l4={cargo:bvn,homebrew:Evn,nix:Mvn};function rIn(){var _;const e=dn({mutationFn:p=>$xn(...p)}),{status:n,error:t,apply:r}=u6(),[s,i]=T.useState(null),[a,o]=T.useState(null),c=U$(n),u=s!==null||c.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:Iz()}),t?f.jsx("div",{className:ec,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]})]});const h=async(p,m)=>{i(p),o(null);try{await m()}catch(w){o(w instanceof Error?w.message:String(w))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:Iz()}),f.jsxs("div",{className:`${ec} mt-3`,children:[f.jsxs("div",{className:`${mf} pb-3.5`,children:[f.jsx("div",{className:"k",children:EL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:IHt()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:gL()}),f.jsx("div",{className:"v",children:nIn[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:VQt()}),f.jsx("p",{children:c.error?$L({error:c.error}):Otn({installed:Ce(n.installedVersion??"—"),current:Ce(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(De,{size:"small",type:"button",disabled:u,onClick:c.restart,children:c.restarting?BL():IL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Oz()}),f.jsxs("p",{children:[MUt(),n.envDisabled&&osn()]})]}),f.jsx(dS,{type:"button",checked:n.autoUpdate,"aria-label":Oz(),disabled:u,onClick:()=>void h("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?esn({version:Ce(n.latest??"—")}):SNt()}),f.jsx("p",{children:n.updateAvailable?oRt():GNt()})]}),f.jsx(De,{size:"small",type:"button",disabled:u,onClick:()=>void h("apply",()=>Lxn().then(r)),children:s==="apply"?Kk():n.updateAvailable?Krn():TNt()})]})]}):f.jsx("div",{className:sl,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:PKt()}),f.jsx("p",{children:((_=l4[n.channel])==null?void 0:_.call(l4))??Een()})]})}),n.channel==="app-bundle"&&f.jsx(iIn,{busy:s,disabled:u,run:h}),a&&f.jsx("div",{className:"error",children:a})]})]})}function sIn(){var _;const e=dn({mutationFn:M2n}),n=jwn(),t=ut(n),r=t.data??null,s=p=>{is(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=T.useState(!1),[o,c]=T.useState(null),u=o??((_=t.error)==null?void 0:_.message)??null,h=()=>{!r||i||(a(!0),c(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>c(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:dJt()}),r?f.jsxs("div",{className:`${ec} mt-3`,children:[f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[Az(),r.locked&&r.reason&&f.jsx(hS,{content:`${rBt()} ${r.reason}.`,className:"text-subtext",children:f.jsx(gS,{size:15})})]}),f.jsx("p",{children:eGt()})]}),f.jsx(dS,{type:"button",checked:r.enabled,"aria-label":Az(),disabled:i||r.locked,onClick:h})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]})]})}function iIn({busy:e,disabled:n,run:t}){const r=dn({mutationFn:Bxn}),[s,i]=T.useState(null),[a,o]=T.useState(!1),c=u=>void t("cli",()=>r.mutateAsync(u).then(h=>{i(h),o(!1)}).catch(h=>{throw o(!u&&String((h==null?void 0:h.message)??h).includes("--force")),h}));return f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:KTt({command:Ce("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?bzt({link:Ce(s.link)}):Ezt({link:Ce(s.link)}),!s.onPath&&YEt({directory:Ce(s.dir)})]}):f.jsx("p",{children:PTt({command:Ce("orx")})})]}),f.jsx(De,{size:"small",type:"button",disabled:n,onClick:()=>c(a),children:e==="cli"?Kk():a?atn():s?Men():MTt()})]})}function aIn({remote:e}){var w;const n=dn({mutationFn:k=>YL(...k)}),t=cS(),r=ut(t),s=r.data??null,i=k=>{is(t.queryKey,v=>(typeof k=="function"?k(v??null):k)??void 0)},[a,o]=T.useState(!1),[c,u]=T.useState(null),h=c??((w=r.error)==null?void 0:w.message)??null,_=async()=>{await r.refetch({cancelRefetch:!1})},p=Ty(),m=()=>{if(!s||a)return;const k=!s.githubForNewProjects;o(!0),u(null),n.mutateAsync([k,!0]).then(i).catch(v=>u(v instanceof Error?v.message:String(v))).finally(()=>o(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qPt()}),s?f.jsxs("div",{className:`${ec} mt-3 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:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:XPt()}),f.jsx(Kt,{variant:s.githubAuthenticated?"success":s.ghInstalled?"warning":"error",children:s.githubAuthenticated?cL():_L()})]}),f.jsxs("div",{className:sl,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:Mz()}),f.jsx("p",{children:BJt()})]}),f.jsx(dS,{type:"button",checked:s.githubForNewProjects,"aria-label":Mz(),disabled:a||!s.githubAuthenticated&&!s.githubForNewProjects,onClick:m})]}),!s.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(yH,{ghInstalled:s.ghInstalled,remote:e,onCheck:_,onRun:p.start})}),f.jsx(Ry,{run:p.run,onComplete:()=>void _(),onClose:p.clear}),h&&f.jsx("div",{className:"error",children:h})]}):h?f.jsx("div",{className:"error",children:h}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]})]})}function yH({ghInstalled:e,remote:n,onCheck:t,onRun:r}){const[s,i]=T.useState(!1),a=()=>{i(!0),t().finally(()=>i(!1))};return f.jsxs(f.Fragment,{children:[f.jsx(lC,{note:e?Ftn():eRt(),className:"git-card-helper m-0 text-sm leading-relaxed text-text",disabled:n||!e,onRun:r}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(bh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[XFt()," ",f.jsx(_f,{size:12})]}),f.jsx(De,{type:"button",variant:e?"warning":"default",disabled:s,onClick:a,children:s?_a():wm()})]})]})}function oIn(){var m,w,k;const e=dn({mutationFn:vxn}),n=dn({mutationFn:bxn}),t=wCn(),r=ut(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((w=r.data)==null?void 0:w.hasSession)??null,a=v=>is(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[c,u]=T.useState(!1),[h,_]=T.useState(null),p=h??((k=r.error)==null?void 0:k.message);return f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:xL()}),f.jsxs("div",{className:mf,children:[f.jsx("span",{className:"k",children:rFt()}),f.jsx("span",{className:"v",children:f.jsx(Kt,{variant:s?"success":"default",children:s===null?p?_o():_a():s?Bz():v3()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:VJt()}),s?f.jsx("div",{className:y0,children:f.jsx(De,{disabled:c,onClick:()=>{u(!0),_(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>_(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:c?$z():Ken()})}):f.jsx(hR,{save:UL,onSaved:v=>o(v.hasToken),placeholder:JKt(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:mf,children:[f.jsx("span",{className:"k",children:yXt()}),f.jsx("span",{className:"v",children:f.jsx(Kt,{variant:i?"success":"default",children:i===null?p?_o():_a():i?Bz():v3()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:NXt()}),i?f.jsx("div",{className:y0,children:f.jsx(De,{disabled:c,onClick:()=>{u(!0),_(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>_(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:c?$z():Pen()})}):f.jsx(hR,{save:v=>GL(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:h3(),createHref:"https://www.overleaf.com/project",createLabel:U1t()}),p&&f.jsx("div",{className:"error",children:p})]})}function cIn({project:e,onProjectUpdate:n,remote:t}){var M;const r=dn({mutationFn:D=>YL(...D)}),s={...zwn((e==null?void 0:e.id)??""),enabled:!!e},i=ut(s),a=Ty(),o=i.data??null,c=D=>{is(s.queryKey,I=>(typeof D=="function"?D(I??null):D)??void 0)},[u,h]=T.useState(!1),[_,p]=T.useState(null),m=_??((M=i.error)==null?void 0:M.message)??null,[w,k]=T.useState(!1),[v,b]=T.useState(!1),[x,y]=T.useState(null),C=!!(o!=null&&o.github.owner&&o.github.repo),N=async()=>{await i.refetch({cancelRefetch:!1})},z=D=>{const I=D instanceof Error?D.message:String(D);return I.toLowerCase().includes("archived")?$At():I.includes("(fetch first)")||I.includes("non-fast-forward")?GAt():I.includes("403")||I.toLowerCase().includes("permission denied")?ZAt():I},A=()=>{e&&(h(!0),p(null),A2n(e.id).then(D=>{c(D.git),n(D.project),et.fetchQuery(cS()).then(I=>{!I.githubForNewProjects&&!I.githubDefaultPromptSeen&&k(!0)}).catch(()=>{})}).catch(D=>p(z(D))).finally(()=>h(!1)))},j=D=>{b(!0),y(null),r.mutateAsync([D,!0]).then(()=>k(!1)).catch(I=>y(I instanceof Error?I.message:String(I))).finally(()=>b(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:BQt()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:Ntn({project:(e==null?void 0:e.name)??Gjt()})}),e?m&&!o?f.jsx("div",{className:"error",children:m}):o?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:Sqt()}),f.jsxs("div",{className:mf,children:[f.jsx("span",{className:"k",children:yWt()}),f.jsx("span",{className:"v",children:o.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:o.gitVersion??QD()}),f.jsx("span",{className:"k",children:dYt()}),f.jsx("span",{className:"v",children:o.initialized?TAt({branch:Ce(o.currentBranch??tS()),state:o.clean?fzt():fTt()}):vDt()}),f.jsx("span",{className:"k",children:rIt()}),f.jsx("span",{className:"v",children:o.baselineBranch}),f.jsx("span",{className:"k",children:RQt()}),f.jsx("span",{className:"v",children:o.remotes.length?o.remotes.map(D=>`${D.name}: ${D.url}`).join(" · "):nS()})]}),!o.initialized&&f.jsx("div",{className:y0,children:f.jsx(De,{variant:"primary",onClick:()=>void j2n(e.id).then(c).catch(D=>p(String(D))),children:AFt()})})]}),f.jsxs("div",{className:H5,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:mf,children:[f.jsx("span",{className:"k",children:fL()}),f.jsx("span",{className:"v",children:f.jsx(Kt,{variant:o.github.authenticated?"success":o.github.ghInstalled?"warning":"error",children:o.github.authenticated?cL():_L()})}),f.jsx("span",{className:"k",children:OWt()}),f.jsx("span",{className:"v",children:C?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[o.github.owner,"/",o.github.repo]}),!o.github.enabled&&f.jsx(Kt,{children:PYt()})]}):f.jsx(Kt,{children:gqt()})}),o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:MYt()}),f.jsx("span",{className:"v",children:o.github.syncStatus})]})]}),!o.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(yH,{ghInstalled:o.github.ghInstalled,remote:t,onCheck:()=>N(),onRun:a.start})}),f.jsx(Ry,{run:a.run,onComplete:()=>void N(),onClose:a.clear}),o.github.authenticated&&!o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:C?xsn():$jt()}),f.jsxs("div",{className:y0,children:[C&&o.github.url&&f.jsxs(bh,{href:o.github.url,target:"_blank",rel:"noreferrer",children:[Lz()," ",f.jsx(_f,{size:12})]}),f.jsx(De,{variant:"primary",disabled:u,onClick:A,children:u?I8t():A8t()})]})]}),o.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:_Pt()}),f.jsxs("div",{className:y0,children:[o.github.url&&f.jsxs(bh,{href:o.github.url,target:"_blank",rel:"noreferrer",children:[Lz()," ",f.jsx(_f,{size:12})]}),f.jsx(De,{disabled:u,onClick:()=>{h(!0),T2n(e.id).then(D=>{c(D.git),n(D.project)}).catch(D=>p(D instanceof Error?D.message:String(D))).finally(()=>h(!1))},children:u?U8t():k8t()})]})]})]}),f.jsx(oIn,{}),m&&f.jsx("div",{className:"error",children:z(m)})]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]}):f.jsx("div",{className:ec,children:f.jsx("p",{className:Pa,children:eKt()})}),w&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>j(!1),children:f.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-modal 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-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:D=>D.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:$qt()}),f.jsx("p",{children:hZt()}),x&&f.jsx("div",{className:"error",children:x}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(De,{disabled:v,onClick:()=>j(!1),children:xVt()}),f.jsx(De,{variant:"primary",disabled:v,onClick:()=>j(!0),children:v?pa():nMt()})]})]})})]})}const lIn={env:Mfn,config:Pfn,xdg:Kfn,default:Efn},u4={preparing:ffn,copying:S_n,verifying:edn,finalizing:T_n},uIn=e=>{var n;return((n=u4[e])==null?void 0:n.call(u4))??e};function _In(){var y;const e=wwn(),n=ut(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=T.useState(""),[a,o]=T.useState(!1),[c,u]=T.useState(null),[h,_]=T.useState({kind:"idle"}),[p,m]=T.useState(null);T.useEffect(()=>{t&&i(C=>C||t.current)},[t]),T.useEffect(()=>uI(C=>{C.type==="progress"?_(N=>{const z=N.kind==="moving"?N.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||z}}):C.type==="done"?(_({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&_({kind:"error",message:C.error})}),[]);const w=(t==null?void 0:t.source)==="env",k=s.trim(),v=t!==null&&k===t.current;async function b(){if(!(a||!k)){o(!0),m(null),u(null);try{u(await Kxn(k))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function x(C){if(C.preventDefault(),!(h.kind==="moving"||!k||v)&&(m(null),!!window.confirm(G_n({path:Ce(k)})))){_({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await Wxn(k)}catch(N){_({kind:"idle"}),m(N instanceof Error?N.message:String(N))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:EYt()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Enn()}),r?f.jsx("div",{className:ec,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:ec,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:SBt()})}),f.jsxs("div",{className:mf,children:[f.jsx("span",{className:"k",children:X$t()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:lIn[t.source]()})]}),!w&&f.jsxs("form",{className:cC,onSubmit:x,children:[f.jsxs("label",{children:[EUt(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:h.kind==="moving"})]}),c&&!c.error&&c.ok&&f.jsxs("p",{className:Pa,children:[dQt()," ",nl(c.treeBytes??0),c.freeBytes!=null&&` — ${$_n({size:Ce(nl(c.freeBytes))})}`,c.sameFilesystem?bfn():"","."]}),c&&c.ok===!1&&c.error&&f.jsx("div",{className:"error",children:c.error}),p&&f.jsx("div",{className:"error",children:p}),h.kind==="moving"&&f.jsx(fH,{value:h.copied,max:h.total,label:uIn(h.phase),caption:h.total>0?f.jsxs("span",{className:"text-sm",children:[nl(h.copied)," / ",nl(h.total)]}):void 0}),h.kind==="done"&&f.jsxs("p",{className:Pa,children:[fUt(),h.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",$Dt({path:Ce(h.oldPathLeft)})]})]}),h.kind==="error"&&f.jsxs("div",{className:"error",children:[iUt()," ",h.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(De,{type:"button",onClick:b,disabled:a||!k||v||h.kind==="moving",children:a?_a():_Nt()}),f.jsx(De,{variant:"primary",type:"submit",disabled:!k||v||h.kind==="moving",children:h.kind==="moving"?ifn():Z_n()})]})]})]}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]})]})}const G5=e=>e==="running"||e==="starting";function fIn(e){return G5(e.status)?T0(Date.now()-e.createdAt):e.endedAt?T0(e.endedAt-e.createdAt):"—"}function xH({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_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-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:XLt()}),f.jsx("th",{children:$h()}),f.jsx("th",{children:aYt()}),f.jsx("th",{children:aXt()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(RS,{backend:t.backend}),r&&f.jsx(Bh,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:Dz(),"aria-label":Dz(),onClick:i=>i.stopPropagation(),children:f.jsx(_f,{size:12})})]})}),f.jsx("td",{children:f.jsx(cl,{status:aa(t)})}),f.jsx("td",{children:go(t.createdAt)}),f.jsx("td",{children:fIn(t)})]},t.id)})})]})})}function dIn({projectId:e,onViewHistory:n}){var _;const t=ut({...zu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(_=t.error)==null?void 0:_.message,i=t.isFetching,[,a]=T.useState(0);T.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},c=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>G5(p.status)).sort(c),h=r==null?void 0:r.filter(p=>!G5(p.status)).sort(c);return f.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-8",children:[f.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 [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JQt(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(De,{size:"small",onClick:o,disabled:i,children:[f.jsx(Ga,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Sm()]}),f.jsx(De,{size:"small",onClick:n,children:h!=null&&h.length?NZe({count:Xt(h.length)}):yZe()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!h?f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]}):f.jsx(xH,{instances:u,emptyLabel:e?JYe():dZe()})]})}function hIn({projectId:e,onBack:n}){var c;const t=ut({...zu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(c=t.error)==null?void 0:c.message,i=t.isFetching,[,a]=T.useState(0);T.useEffect(()=>{const u=setInterval(()=>a(h=>h+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.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:n,children:[f.jsx(R0,{size:14})," ",dL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:lHt()}),f.jsxs(De,{size:"small",onClick:o,disabled:i,children:[f.jsx(Ga,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Sm()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(xH,{instances:[...r].sort((u,h)=>h.createdAt-u.createdAt),emptyLabel:e?VYe():aZe()}):f.jsxs(Kr,{children:[f.jsx(jt,{})," ",qu()]})]})}const wH=["projects","harnesses","storage"],pIn=[{id:"compute",label:hL,icon:f.jsx(mS,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:mL,icon:f.jsx(jf,{size:15}),activeTabs:["environment"]},{id:"settings",label:aS,icon:f.jsx(xS,{size:15}),activeTabs:["settings",...wH]}];function mIn(e){return wH.includes(e)}function gIn({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||mIn(e),a=T.useRef(null);return T.useLayoutEffect(()=>{const o=a.current,c=o==null?void 0:o.parentElement;if(!o||!c)return;const u=()=>o.scrollIntoView({block:"start"}),h=new ResizeObserver(u);h.observe(c),u();const _=()=>h.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,_,{passive:!0});return()=>{_();for(const m of p)window.removeEventListener(m,_)}},[e,n==null?void 0:n.id]),f.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-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:aS()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:yd,children:f.jsx(tIn,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:yd,children:f.jsx(aIn,{remote:s})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:yd,children:f.jsx(zLn,{remote:s})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:yd,children:f.jsx(_In,{})}),f.jsx("section",{className:yd,children:f.jsx(sIn,{})}),!s&&f.jsx("section",{className:yd,children:f.jsx(rIn,{})})]})]}),e==="compute"&&f.jsx(KLn,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(hIn,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:mL()}),f.jsx(JLn,{})]}),e==="git"&&f.jsx(cIn,{project:n,onProjectUpdate:t,remote:s})]})}function sb(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function V5(e){return`${e.plugin?`${sb(e.plugin)}: `:""}${sb(e.name)}`}const kH=["plan","goal","new","resume","model","compact","copy","export"],vIn={plan:()=>uxt(),goal:()=>MKe(),new:()=>Jrt(),resume:()=>Y8t(),model:()=>ztt(),compact:()=>oAe(),copy:()=>MMe(),export:()=>N$e()};function bIn(e){return{name:e,get description(){return vIn[e]()},source:"command"}}function Oy(e){return kH.some(n=>n===e)}const ib={clear:"new",summarize:"compact"};function K5(e){const n=e.toLowerCase();return Oy(n)?n:Object.hasOwn(ib,n)?ib[n]:null}function SH(e){return Object.keys(ib).filter(n=>ib[n]===e)}function yIn(e,n){return e.name.toLowerCase().startsWith(n)||e.plugin&&`${e.plugin}:${e.name}`.toLowerCase().startsWith(n)?!0:e.source==="command"&&Oy(e.name)&&SH(e.name).some(t=>t.startsWith(n))}function _4(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?h:s}${a.slice(h.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function vR(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function CH(e){return kH.filter(n=>n!=="plan"||e)}function kIn(e,n){const t=e.filter(r=>!K5(r.name));for(const r of CH(n))t.push(bIn(r));return t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||V5(r).localeCompare(V5(s),void 0,{sensitivity:"base"}))}function f4(e){return e==="plan"||e==="goal"}function SIn(e,n){for(const t of CH(n).sort((r,s)=>+(r==="plan")-+(s==="plan"))){const r=[t,...SH(t)].join("|");if(t==="plan"){const s=new RegExp(`(^|\\s)\\/(?:${r})(?=\\s|$)`,"gi");if(s.test(e))return{name:t,prompt:e.replace(s,"").trim()}}else if(t==="goal"){const s=new RegExp(`^\\/(?:${r})(?=\\s|$)`,"i");if(s.test(e.trim()))return{name:t,prompt:e.trim().replace(s,"").trim()}}else if(new RegExp(`^\\/(?:${r})$`,"i").test(e.trim()))return{name:t,prompt:""}}return null}function d4(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}const CIn=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let EIn=null;function W5(e,n){const t=EIn??(EIn=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(sb(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}const NIn={plan:lkn,goal:qI,new:Hkn,resume:UI,model:mS,compact:B5n,copy:zf,export:Db};function EH({name:e,className:n}){const t=Oy(e)?NIn[e]:tSn;return f.jsx(t,{size:16,strokeWidth:1.5,className:n,"aria-hidden":"true"})}function NH({name:e}){return f.jsxs(f.Fragment,{children:[f.jsx(EH,{name:e,className:"me-1 inline-block align-middle"}),sb(e)]})}function zH(e,n,t,r,s,i=!1){let a=0;return xIn(e,n).map((o,c,u)=>{var m,w;const h=a+o.text.length;a=h;const _=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,_,h,c);let p=o.text;return i||((m=u[c-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(w=u[c+1])!=null&&w.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(NH,{name:_})},c):i?f.jsx("span",{"aria-hidden":"true",children:o.text},c):f.jsx(T.Fragment,{children:p},c)})}function zIn({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=T.useRef(null),o=T.useRef(null),c=T.useRef(null),u=T.useId(),[h,_]=T.useState(!1),p=ut({...Twn(n,s,r.harness),enabled:h,subscribed:h}),m=p.data??null,w=p.isFetching,[k,v]=T.useState({}),b=()=>{c.current!==null&&window.clearTimeout(c.current),c.current=null},x=()=>{const N=a.current;if(!N)return;const z=N.getBoundingClientRect(),A=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(z.left-4,window.innerWidth-A-16));v(z.top>300?{bottom:window.innerHeight-z.top+12,left:j,width:A}:{left:j,top:z.bottom+12,width:A})},y=()=>{b(),x(),_(!0)},C=()=>{b(),c.current=window.setTimeout(()=>_(!1),120)};return T.useEffect(()=>()=>b(),[]),T.useEffect(()=>{if(!h)return;const N=()=>x();return window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[h]),f.jsxs(T.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":h,"aria-label":DZ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:N=>{var z,A;if(N.key==="Escape"){_(!1);return}if(N.key==="Enter"||N.key===" "){N.preventDefault(),y();return}h&&(N.key==="ArrowDown"||N.key==="PageDown")&&(N.preventDefault(),(z=o.current)==null||z.scrollBy({top:N.key==="PageDown"?240:48,behavior:"smooth"})),h&&(N.key==="ArrowUp"||N.key==="PageUp")&&(N.preventDefault(),(A=o.current)==null||A.scrollBy({top:N.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:N=>{var z,A;N.preventDefault(),(z=i.current)==null||z.focus(),(A=i.current)==null||A.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(NH,{name:n})})})]}),h&&ri.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":qJ({name:n}),style:{...k,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:N=>N.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Kt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Fsn()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:w&&m===null?f.jsx("span",{className:"text-muted",children:Wsn()}):f.jsx(Jo,{text:m??r.description})})]}),document.body)]})}function jIn({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:zH(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function AIn({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=T.useRef(null);return T.useLayoutEffect(()=>{const o=i.current,c=a.current;if(!o||!c)return;const u=()=>{const _=getComputedStyle(o);for(const p of CIn)c.style.setProperty(p,_.getPropertyValue(p));c.style.width=`${o.clientWidth+parseFloat(_.borderLeftWidth)+parseFloat(_.borderRightWidth)}px`};u();const h=new ResizeObserver(u);return h.observe(o),()=>h.disconnect()},[e,i]),T.useLayoutEffect(()=>{const o=i.current;if(!o)return;const c=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return c(),o.addEventListener("scroll",c),()=>o.removeEventListener("scroll",c)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[zH(e,t,"",void 0,(o,c,u,h)=>{var w;const _=e.slice(u),p=((w=/^[ \t]+/.exec(_))==null?void 0:w[0].length)??0;if(u===n||_&&!_.startsWith(` `)&&pk.name===c);return m&&m.source!=="command"?f.jsx(zIn,{label:o,name:c,end:u,skill:m,projectId:s,textareaRef:i},`${h}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${h}:${u}`)},!0),"​"]})}function TIn({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=T.useRef(null);return T.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[f.jsx(EH,{name:i.name,className:"shrink-0"}),f.jsx("span",{className:"skill-name shrink-0",children:V5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:tin()})]},i.name))})}function RIn(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const Q5=6.5,bR=2*Math.PI*Q5;function MIn({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(OIn,{usage:e})}function OIn({usage:e}){const{open:n,setOpen:t,ref:r}=ga(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":RIn(a),c=a===null?"":new Intl.NumberFormat(E(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:fMe(),onClick:()=>t(u=>!u),children:a===null?Jg(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:Q5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:Q5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${bR*Math.max(a,2)/100} ${bR}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-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:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:iMe()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?bMe({value:Ce(Jg(s))}):EMe({used:Ce(Jg(s)),total:Ce(Jg(i)),percent:Ce(c)})})]}),a!==null&&f.jsx(fH,{value:s,max:i,fillColor:o})]})]})}function DIn(e,n,t){const r=e.map(t);return n<0?r:[...r.slice(0,n),f.jsxs("div",{role:"group","aria-label":Ez(),children:[f.jsx("div",{className:"px-2.5 pb-1 pt-2.5 text-sm font-medium text-subtext",children:Ez()}),r.slice(n)]},"from-terminal")]}function LIn({activeSessionId:e,onClose:n,onResume:t,onImport:r}){const s=T.useRef(null),i=T.useRef(null),{data:a,isPending:o,error:c}=ut(Dwn()),{data:u=[]}=ut(gh()),{data:h=[]}=ut(iI()),[_,p]=T.useState(""),[m,w]=T.useState(0);Em(s,n);const k=T.useMemo(()=>new Map(u.map(N=>[N.id,N.name])),[u]),v=T.useMemo(()=>{const N=_.trim().toLowerCase(),z=M=>!N||M.toLowerCase().includes(N),A=(a??[]).filter(M=>M.id!==e).filter(M=>z(`${M.title??""} ${k.get(M.projectId)??""} ${mu[M.harness]}`)).map(M=>({kind:"session",key:M.id,session:M})),j=h.filter(M=>z(`${M.title??""} ${M.cwd??""} ${mu[M.harness]}`)).map(M=>({kind:"native",key:`${M.harness}:${M.nativeId}`,chat:M}));return[...A,...j]},[a,h,_,e,k]),b=T.useMemo(()=>v.findIndex(N=>N.kind==="native"),[v]),x=Math.min(m,Math.max(0,v.length-1));T.useLayoutEffect(()=>{var N;(N=i.current)==null||N.scrollIntoView({block:"nearest"})},[x,v]);const y=N=>(N==null?void 0:N.split("/").filter(Boolean).at(-1))??"",C=N=>N.kind==="native"?r(N.chat):t(N.session);return ri.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-start justify-center bg-modal-backdrop p-5 pt-[var(--modal-top)]",onClick:N=>{N.target===N.currentTarget&&n()},children:f.jsxs("div",{ref:s,className:"flex max-h-[calc(100vh_-_var(--modal-top)_-_1.25rem)] w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-label":zz(),tabIndex:-1,children:[f.jsx("div",{className:"border-b border-border p-3",children:f.jsx(Gr,{"data-initial-focus":!0,value:_,placeholder:Nz(),"aria-label":Nz(),role:"combobox","aria-autocomplete":"list","aria-expanded":v.length>0,"aria-controls":"resume-options","aria-activedescendant":v[x]?`resume-option-${v[x].key}`:void 0,onChange:N=>{p(N.target.value),w(0)},onKeyDown:N=>{if(!N.nativeEvent.isComposing)if(N.key==="ArrowDown"||N.key==="ArrowUp"){if(N.preventDefault(),v.length===0)return;const z=N.key==="ArrowDown"?1:-1;w((x+z+v.length)%v.length)}else N.key==="Enter"&&v[x]&&(N.preventDefault(),C(v[x]))}})}),f.jsx("div",{id:"resume-options",className:"min-h-0 flex-1 overflow-y-auto p-1.5",role:v.length>0?"listbox":void 0,"aria-label":v.length>0?zz():void 0,children:o?f.jsxs(Kr,{className:"px-2.5 py-2",role:"status",children:[f.jsx(jt,{})," ",Qk()]}):c&&!a?f.jsx("div",{className:"px-2.5 py-2 text-sm text-accent-red",role:"alert",children:Wk({error:Ce(c instanceof Error?c.message:String(c))})}):v.length===0?f.jsx("div",{className:"px-2.5 py-2 text-sm text-muted",role:"status",children:s9t()}):DIn(v,b,(N,z)=>{var D;const A=N.kind==="native"?N.chat:null,j=N.kind==="session"?N.session:null;return f.jsxs(Cn,{id:`resume-option-${N.key}`,ref:z===x?i:void 0,type:"button",role:"option","aria-selected":z===x,active:z===x,tabIndex:-1,className:"gap-2.5 text-text",onMouseEnter:()=>w(z),onClick:()=>C(N),children:[f.jsx(xh,{harness:(A==null?void 0:A.harness)??(j==null?void 0:j.harness)??"claude-code"}),f.jsx("span",{dir:"auto",className:"min-w-0 flex-1 truncate",children:((D=(A==null?void 0:A.title)??(j==null?void 0:j.title))==null?void 0:D.trim())||Sd()}),f.jsx("span",{dir:"auto",className:"max-w-40 shrink-0 truncate text-muted",title:(A==null?void 0:A.cwd)??void 0,children:A?y(A.cwd):k.get((j==null?void 0:j.projectId)??"")??""}),f.jsx("span",{className:"shrink-0 text-muted tabular-nums",children:go((A==null?void 0:A.updatedAt)??(j==null?void 0:j.updatedAt)??0)})]},N.key)})})]})}),document.body)}const ab="!";function yR(e){return e.startsWith(ab)?e.slice(ab.length).trim():null}function IIn(e){return e.startsWith(ab)?e.slice(ab.length):e}function $In(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 BIn(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function PIn(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` ${t} @@ -1111,20 +1111,20 @@ ${n.trim()} `)}function OH(e){const n=e==null?void 0:e.replace(/[)'\"]+$/,"");return!n||n==="-"||/^\d+$/.test(n)||/[$`]/.test(n)||kEn(n)?null:n}function DH(e){const n=OH(e);if(!n)return null;const t=A_(n);return n.includes("/")||n.startsWith(".")||/\.[A-Za-z0-9][A-Za-z0-9_-]*$/.test(t)||/^(?:Dockerfile|Makefile|README|LICENSE|NOTICE|CHANGELOG)$/i.test(t)?n:null}function LH(e){var s,i;const n=N6(e);let t=0;for(;["do","then","else","if","while","until"].includes(n[t]);)t++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(n[t]??"");)t++;if(n[t]==="command")for(t++;(s=n[t])!=null&&s.startsWith("-");)t++;if(n[t]==="env")for(t++;(i=n[t])!=null&&i.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(n[t]??"");)t++;const r=n[t];return r?{name:r.split("/").pop()??r,args:n.slice(t+1)}:null}function p$n(e){const{name:n,args:t}=e;if(n==="sed"){let s=0,i=!1;for(;s!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&DH(s)?{ref:r,path:s}:null}function g$n(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function ER(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function v$n(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!u.startsWith("-"));if(!o)return null;const c=ER(s,o);if(!c)return null;s=c}return s?ER(s,e):e}const $o="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",b$n=new RegExp(`\\bchat_(${$o})\\b`,"gi"),tf=`(?:${$o}|[0-9a-f]{8})`;function Gd(e){const n=[];let t="",r="",s=null,i=!1;const a=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=u=>{let h=1,_=null,p=!1;for(let m=u;m{let h=!1;for(let _=u;_zEn(t.raw,n))}function Oa(e,n){return Ly(e,n).length>0}function y$n(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,TH).matchAll(b$n))if(n.add(t[0].toLowerCase()),n.size>=Hu)break;return[...n]}function Z5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,TH),s=n==="runs"?[new RegExp(`/runs/(${$o})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${$o})`,"gi"),new RegExp(`^\\s*RUN\\s+(${$o})\\b`,"gim"),new RegExp(`={3,}\\s*(${$o})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${$o})`,"gi"),new RegExp(`^\\s*id:\\s*(${$o})`,"gim"),new RegExp(`={3,}\\s*(${$o})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=Hu)return[...t];const i=new RegExp(`^\\s*(${$o})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=Hu)break;return[...t]}function IH(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function $H(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function BH(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const c=o+a[0].length;c<=t&&/\bdone\b/.test(e.slice(c,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function x$n(e,n,t=[],r=[]){const s=Ly(e,"logs"),i=new Set;if(s.length===0){if(!Oa(e,"logs"))return[];const o=t.length>0?[]:Z5(n,"runs");for(const c of t.length>0?t:o.length>0?o:r)if(i.add(c),i.size>=Hu)break;return Ud([...i])}let a=!1;for(const{invocation:o,offset:c}of IH(e,s)){const u=Sh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const h=u.slice(1);let _=null;for(let v=0;v0?[]:Z5(n,"runs"),c=t.length>0?t:o.length>0?o:r;for(const u of c)if(i.add(u),i.size>=Hu)break}return Ud([...i])}function xd(e,n,t=[],r=[]){const s=Ly(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:c}of IH(e,s)){const u=Sh(o.raw),h=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let _=!1;h&&new RegExp(`^${tf}$`,"i").test(h)&&(i.add(h),_=!0);const p=h?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(h):null;if(p){const m=p[1],w=$H(e,m,c,tf);if(w.length>0){for(const v of w)i.add(v);_=!0}const k=BH(e,m,c,tf);for(const v of k)i.add(v);k.length>0&&(_=!0)}_||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:Z5(n,"experiments"),c=t.length>0?t:o.length>0?o:r;for(const u of c)if(i.add(u),i.size>=Hu)break}return Ud([...i])}const NR=new WeakMap;function gf(e){const n=E(),t=NR.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=w$n(e);return NR.set(e,{locale:n,activity:r}),r}function w$n(e){var b,x,y,C,N,z;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Zs(i,"command","cmd"),o=u$n(i,"commandArgv"),c=((x=e.state)==null?void 0:x.output)||((y=e.state)==null?void 0:y.error),u=Ud(v4(i,"targetIds")),h=Ud(v4(i,"runTargetIds")),_=Ud(v4(i,"experimentTargetIds")),p=Zs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Zs(i,"description"),w=n.toLowerCase().split(/(?::|\.|__)+/),k=w.at(-1)??n.toLowerCase();if(k==="run"&&w.includes("web")){const A=g4(i,"search_query","q"),j=g4(i,"image_query","q"),M=g4(i,"find","pattern");return A?{kind:"web",label:VE({query:A})}:j?{kind:"web",label:Qie({query:j})}:M?{kind:"web",label:Dae({pattern:M})}:Array.isArray(i.open)?{kind:"web",label:o3e()}:Array.isArray(i.weather)?{kind:"web",label:zxe()}:Array.isArray(i.finance)?{kind:"web",label:hxe()}:Array.isArray(i.sports)?{kind:"web",label:xxe()}:Array.isArray(i.time)?{kind:"web",label:oxe()}:{kind:"web",label:cN()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["compacted","contextcompaction"],["imported","importedchat"],["subagentactivity","subagent"]]).get(k)??k){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:t5e()};const A=f$n(a??(o==null?void 0:o.join(" "))??""),j=Gd(A);let M=j.map(G=>G.raw);if(o!=null&&o.length){const G=NEn(o);M=G===null?[o]:Gd(MH(G)).map(oe=>oe.raw)}let D=null;for(const G of M)if(D=jEn(G),D)break;const I=M.some(G=>{const oe=Sh(G);return oe!==null&&oe[0]!=="discover"&&oe[0]!=="paper"});if(D&&!I){const G=D.kind==="discover"?{keyword:mie(),embedding:kie(),openalex:pae(),biorxiv:Aie(),pubmed:wae()}[D.strategy]:null,oe=D.kind==="discover"?D.query?Jte({activity:G??GE(),query:D.query}):G??GE():D.id?Bp({target:Ce(D.id)}):jre();return{kind:D.kind==="paper"?"read":"search",label:oe,litCall:D}}if(Oa(A,"agent\\s+spawn"))return{kind:"agent",label:d2e(),spawnedSessionIds:y$n(c),litCall:D??void 0};const B=j.map(G=>LH(G.raw)),U=Oa(A,"exp\\s+status"),H=Oa(A,"exp\\s+desc"),Q=Ly(A,"exp\\s+desc").some(G=>(Sh(G.raw)??[]).some(ce=>ce==="--set"||ce.startsWith("--set=")||ce==="--stdin")),V=Q?Aoe():wre(),Z=Q?See():Lse();if(Oa(A,"logs")){const G=x$n(A,c,h,u);return{kind:"project",label:G.length===1?wse():jse(),runIds:G,litCall:D??void 0}}if(Oa(A,"exp\\s+run"))return{kind:"project",label:CSe(),litCall:D??void 0};if(Oa(A,"exp\\s+wait"))return{kind:"project",label:NCe(),litCall:D??void 0};if(Oa(A,"exp\\s+cancel"))return{kind:"project",label:Nye(),litCall:D??void 0};const Y=Oa(A,"project\\s+view");if(Y&&U&&H)return{kind:"project",label:Z,experimentIds:xd(A,c,_,u),litCall:D??void 0};if(Y&&H)return{kind:"project",label:V,experimentIds:xd(A,c,_,u),litCall:D??void 0};if(Y&&U)return{kind:"project",label:lN(),experimentIds:xd(A,c,_,u),litCall:D??void 0};if(Y)return{kind:"project",label:j5e(),litCall:D??void 0};if(U&&H)return{kind:"project",label:Z,experimentIds:xd(A,c,_,u),litCall:D??void 0};if(U)return{kind:"project",label:lN(),experimentIds:xd(A,c,_,u),litCall:D??void 0};if(H)return{kind:"project",label:V,experimentIds:xd(A,c,_,u),litCall:D??void 0};if(Oa(A,"runs?"))return{kind:"project",label:y4e(),litCall:D??void 0};if(Oa(A,"projects"))return{kind:"project",label:N4e(),litCall:D??void 0};if(Oa(A,"compute"))return{kind:"project",label:Fye(),litCall:D??void 0};const $=B.map(m$n).find(G=>G!=null);if($){const G=m4($.path);return{kind:G?"skill":"read",label:G?Q2({name:Ce(G)}):Bp({target:Ce(A_($.path))}),filePath:$.path,fileRef:$.ref,labelTarget:G?`${G} skill`:A_($.path)}}const L=B.findIndex(G=>G!=null&&["sed","cat","head","tail"].includes(G.name)),F=L>=0?B[L]:null,q=F?p$n(F):null,K=q?v$n(q,j,L,Zs(i,"cwd","workdir")):null;if(q&&K){const G=m4(K);return{kind:G?"skill":"read",label:G?Q2({name:Ce(G)}):Bp({target:Ce(A_(q))}),filePath:K,labelTarget:G?`${G} skill`:A_(q)}}if(B.some(G=>(G==null?void 0:G.name)==="find"||(G==null?void 0:G.name)==="ls"||(G==null?void 0:G.name)==="rg"&&G.args.includes("--files")))return{kind:"search",label:bN()};const ne=B.findIndex(G=>(G==null?void 0:G.name)==="rg"||(G==null?void 0:G.name)==="grep");if(ne>=0){const G=g$n(j[ne].raw);return{kind:"search",label:G?Y2({pattern:Ce(G)}):X2(),searchPattern:G??void 0}}const ae=B.find(G=>(G==null?void 0:G.name)==="git"),ue=ae==null?void 0:ae.args[0];if(ue==="grep"){const G=ae==null?void 0:ae.args.slice(1).find(oe=>!oe.startsWith("-"));return{kind:"search",label:G?Y2({pattern:Ce(G)}):X2(),searchPattern:G}}if(ue==="status")return{kind:"command",label:exe()};if(ue==="diff")return{kind:"command",label:Nke()};if(ue==="log")return{kind:"command",label:w5e()};const se=G=>B.some(oe=>!oe||!["cargo","pnpm","npm","yarn"].includes(oe.name)?!1:oe.args[0]===G||oe.args[0]==="run"&&oe.args[1]===G);return se("test")?{kind:"command",label:c5e()}:B.some(G=>(G==null?void 0:G.name)==="tsc")||se("typecheck")?{kind:"command",label:Dxe()}:se("lint")?{kind:"command",label:Oye()}:se("build")?{kind:"command",label:dye()}:{kind:"command",label:tre({command:Ce(A)})}}case"skill":{const A=Zs(i,"skill","name"),j=A?l$n(n,A):null;return{kind:"skill",label:A?One({name:Ce(A)}):Nne(),filePath:j??void 0,labelTarget:j&&A?`${A} skill`:void 0}}case"read":{const A=p?A_(p):null,j=p?m4(p):null;return j?{kind:"skill",label:Q2({name:Ce(j)}),filePath:p??void 0,labelTarget:`${j} skill`}:A?{kind:"read",label:Bp({target:Ce(A)}),filePath:p??void 0,labelTarget:A}:{kind:"read",label:p5e()}}case"edit":case"write":case"notebookedit":{const A=_$n(i),j=p??(A==null?void 0:A.path)??null,M=j?A_(j):null,D=M?(A==null?void 0:A.type)==="add"?ste({target:Ce(M)}):(A==null?void 0:A.type)==="delete"?Cte({target:Ce(M)}):Bte({target:Ce(M)}):null;return M?{kind:"edit",label:D??pN(),filePath:j??void 0,labelTarget:M}:{kind:"edit",label:pN()}}case"grep":{const A=Zs(i,"pattern");return{kind:"search",label:A?Y2({pattern:Ce(A)}):X2(),searchPattern:A??void 0}}case"glob":{const A=Zs(i,"pattern");return{kind:"search",label:A?dne({pattern:Ce(A)}):bN()}}case"websearch":{const A=Zs(i,"query"),j=Zs(i,"url"),M=Zs(i,"pattern");return A?{kind:"web",label:VE({query:A})}:M&&j?{kind:"web",label:cae({pattern:M})}:j?{kind:"web",label:Wne({target:Ce(j)})}:{kind:"web",label:m??cN()}}case"webfetch":{const A=Zs(i,"url");return{kind:"web",label:A?Bp({target:Ce(A)}):m??Wre()}}case"task":return{kind:"agent",label:m??cre()};case"subagent":return{kind:"agent",label:k$n(i)};case"error":return{kind:"command",label:oCe()};case"importedchat":return{kind:"project",label:ane()};case"contextcompaction":return{kind:"command",label:((C=e.state)==null?void 0:C.status)==="error"?Yee():((N=e.state)==null?void 0:N.status)==="running"?UE():$ee(),progressLabel:UE()};default:{const A=m??p??a??((z=e.state)==null?void 0:z.title)??"";return{kind:"command",label:A?`${n}: ${A}`:n}}}}function k$n(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return noe();case"sendInput":return Qae();case"resumeAgent":return cse();case"wait":return Ioe();case"closeAgent":return Tee()}switch(typeof e.kind=="string"?e.kind:""){case"started":return koe();case"interacted":return ree();case"interrupted":return moe()}return loe()}function ob({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(jf,{...t});if(e.litCall)r=f.jsx(KB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx(DI,{...t});break;case"read":case"project":r=f.jsx(LI,{...t});break;case"search":r=f.jsx(QI,{...t});break;case"edit":r=f.jsx(bS,{...t});break;case"web":r=f.jsx(ekn,{...t});break;case"agent":r=f.jsx(kS,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function b4({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=T.useState(!1),a=T.useRef(null),o=T.useRef(!1);return T.useEffect(()=>{var c,u;!s||!o.current||(o.current=!1,(u=(c=a.current)==null?void 0:c.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((c,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Vr(h=>n(c.id,h),{stopPropagation:!0}):{onClick:h=>{h.stopPropagation(),t==null||t(c.id)}},children:c.label}):f.jsx("span",{children:c.label})]},c.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?oY({target:r}):LJ({count:Xt(e.length),target:r}),onClick:c=>{c.preventDefault(),c.stopPropagation(),o.current=!s&&c.detail===0,i(u=>!u)},children:s?MD():sje({count:Xt(e.length)})})]})}function J5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,c,u,h;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:LEn(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(s5n,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const _=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Vr(p=>n(_,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((c=e.spawnedSessionIds)!=null&&c.length&&r){const _=e.spawnedSessionIds,p=_.slice(0,3),m=_.slice(p.length).map((w,k)=>({id:w,label:eN({number:Xt(p.length+k+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((w,k)=>f.jsxs("span",{children:[k>0&&", ",f.jsx("button",{className:"tool-target",title:e3e(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(w)},children:eN({number:Xt(k+1)})})]},w)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(b4,{items:m,onSelect:r,targetType:mpe()})]})]})}if((u=e.runIds)!=null&&u.length){const _=s?e.runIds.filter(w=>!!s(w)):e.runIds;if(_.length===0)return e.label;const p=_.slice(0,3),m=_.slice(p.length).map(w=>({id:w,label:(s==null?void 0:s(w))||Wc()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((w,k)=>f.jsxs("span",{children:[k>0&&", ",t?f.jsx("button",{className:"tool-target",title:cZ({run:Ce(w)}),...Vr(v=>t(w,v),{stopPropagation:!0}),children:(s==null?void 0:s(w))||Wc()}):f.jsx("span",{children:(s==null?void 0:s(w))||Wc()})]},w)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(b4,{items:m,onOpen:t,targetType:O8e()})]})]})}if((h=e.experimentIds)!=null&&h.length){const _=a?e.experimentIds.filter(w=>!!a(w)):e.experimentIds;if(_.length===0)return e.label;const p=_.slice(0,3),m=_.slice(p.length).map(w=>({id:w,label:(a==null?void 0:a(w))||Wc()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((w,k)=>f.jsxs("span",{children:[k>0&&", ",i?f.jsx("button",{className:"tool-target",title:FY({name:(a==null?void 0:a(w))||Ce(w)}),...Vr(v=>i(w,v),{stopPropagation:!0}),children:(a==null?void 0:a(w))||Wc()}):f.jsx("span",{children:(a==null?void 0:a(w))||Wc()})]},w)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(b4,{items:m,onOpen:i,targetType:Zme()})]})]})}return e.label}function fC(e){const n=e.progressLabel??{skill:Fne(),read:tse(),search:Hae(),edit:Vte(),project:qse(),web:gee(),agent:vte(),command:yD()}[e.kind];return{...e,label:n}}function PH(e,n){const t=gf({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:yne(),read:pre(),search:lie(),edit:Rte(),project:pse(),web:uee(),agent:_te(),command:Xse()}[t.kind]}function S$n(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const C$n=250;function E$n(e,n){const[t,r]=T.useState(e),s=T.useRef(Date.now()),i=T.useRef(e);return T.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=C$n-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const N$n=160;function FH(e){const[n,t]=T.useState(!1);return T.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),N$n);return()=>window.clearTimeout(r)},[e]),e&&n}function z$n(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:zD()}}function j$n(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function A$n(e){const n=[];let t=null;for(const r of e){const s=gf(r),i=j$n(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function HH({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var w,k;const i=(w=e.state)==null?void 0:w.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,c]=T.useState(Date.now());if(T.useEffect(()=>{if(typeof a!="number"||(c(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();c(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=bEn(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(jt,{}),f.jsx("span",{children:v})]})}const u=GB(i==null?void 0:i.recoveryAction),h=i==null?void 0:i.turnId,_=UB(e)?y1e():s?J8e():RN(),p=s?W5n:wS,m=Dy(((k=e.state)==null?void 0:k.error)||RN());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:_}),f.jsx(Ua,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&h&&(u==="retry"||u==="continue")&&f.jsx(De,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(h,u),children:t?N9e():u==="retry"?ti():_me()})]})}function zR({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:c}){const u=e.state,h=(u==null?void 0:u.status)==="error",_=Dy((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=h&&!!_,[m,w]=T.useState(!1),k=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(HH,{part:e,busy:!1,recovering:!1,usageLimited:u5(e)});const v=f.jsxs(f.Fragment,{children:[h&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),h?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(BI,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(ob,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${jH} ${h?"text-accent-red":"text-subtext"}`,children:[f.jsx(J5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:c}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:xY({count:Xt(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":k,"aria-label":m?hY({activity:n.label}):jJ({activity:n.label}),onClick:()=>w(b=>!b),children:f.jsx(Ua,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:k,children:f.jsx("div",{className:uC,children:_.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function T$n({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,D,I;const[c,u]=T.useState(!1),[h,_]=T.useState(!1),p=()=>{_(!0),u(B=>!B)},m=A$n(e),w=m.map(({activity:B})=>B),k=n?m.at(-1):void 0,v=k==null?void 0:k.part,b=k==null?void 0:k.activity,x=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&fC(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(x!=null&&x.progressLabel)&&(S$n((D=v.state)==null?void 0:D.input)||(x==null?void 0:x.kind)==="command"&&!Zs(((I=v.state)==null?void 0:I.input)??{},"command","cmd")),C=E$n(x,y),N=FH(C!=null),z=C??z$n(w),A=C?C.label:zD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(ob,{activity:C,className:N?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${N?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:A,children:f.jsx(J5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(zR,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(ob,{activity:z,className:N?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${N?"tool-running-shimmer":""}`,title:A,children:f.jsx(J5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":c,children:A}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":c,"aria-label":c?U0e():Gme(),children:f.jsx(Ua,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${c?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${c?"open":""}`,"aria-hidden":!c,inert:!c,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:h&&m.map(({part:B,count:U,activity:H})=>f.jsx(zR,{part:B,repeatCount:U,activity:H,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},B.id))})})})]})}function R$n({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var h;const s=e.prompt,[i,a]=T.useState([]),o=!n,c=_=>n==null?void 0:n({promptId:e.id,..._});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:x3e(),icon:gi,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:H3e(),icon:bS,iconClass:"text-accent-amber"}:s.approved===!1?{label:z3e(),icon:cr,iconClass:"text-accent-red"}:{label:D3e(),icon:Ib,iconClass:"text-muted"},w=m.icon;return f.jsxs("details",{className:a$n,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?AD():jN()}),f.jsx(w,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Ua,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${SR} ms-6`,children:[f.jsx(Jo,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const _=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,w)=>({id:`${e.id}-annotation-${w}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(_C,{annotations:p,variant:"sent"}),f.jsxs("details",{className:i$n,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||E7e()}),f.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 ${_?"chosen":""}`,children:_||y8e()})]}),f.jsxs("div",{className:SR,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var w;return f.jsx("li",{className:(w=s.answers)!=null&&w.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==_&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const _=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?d7e():jN()}),f.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 ${_?"clamped":""}`,children:f.jsx(Jo,{text:s.plan??"",onOpenFile:t})}),_&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Vr(p=>r(s.plan??"",e.id,p)),children:yCe()}),!o&&!_&&f.jsxs("div",{className:Y5,children:[f.jsx(De,{size:"small",variant:"primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:Wve()}),f.jsx(De,{size:"small",onClick:()=>c({approve:!0,resumeMode:"bypassPermissions"}),children:tbe()}),f.jsx(De,{size:"small",onClick:()=>c({approve:!1}),children:L5e()})]})]})}if(s.kind==="permission"){const _=s.toolInput??{},p=Zs(_,"command","cmd","filePath","file_path","path")||"",m=typeof((h=s.toolInput)==null?void 0:h.reason)=="string"&&s.toolInput.reason||"",w=Zs(_,"description")||"",k=m||w||PH(s.tool,_),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(wS,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:jbe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:k}),p&&f.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:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(De,{size:"small",variant:"ghost",onClick:()=>c({approve:!1}),children:G2e()}),f.jsx(De,{size:"small",variant:"primary",onClick:()=>c({approve:!0}),children:wbe()})]})]})]})}const u=_=>a(p=>s.multiSelect?p.includes(_)?p.filter(m=>m!==_):[...p,_]:[_]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:o$n,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(_=>{const p=i.includes(_.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start 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 ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(_.label):c({answers:[_.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:_.label}),_.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:_.description})]},_.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:Y5,children:f.jsx(De,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>c({answers:i}),children:eCe()})})]})}function M$n(e,n){return e.role==="user"?!0:e.parts.some(t=>kh(t,n))}function O$n(e){const n=e.text??"",t=n.startsWith("data:")?n:rwn(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}async function dC(e){try{if(!navigator.clipboard)throw new Error(LD());await navigator.clipboard.writeText(e),xn(af(),"success")}catch(n){xn(n instanceof Error?n.message:String(n),"error")}}function D$n(e,n){const t=URL.createObjectURL(new Blob([n],{type:"text/markdown;charset=utf-8"})),r=document.createElement("a");r.href=t,r.download=e,document.body.append(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(t),1e3)}function L$n({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:c,editDisabled:u}){const h=t>1,_=new Date(n),p=()=>dC(e);return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${h?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[h&&f.jsxs(f.Fragment,{children:[f.jsx(Pt,{size:"small",title:xN(),"aria-label":xN(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(II,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Pt,{size:"small",title:yN(),"aria-label":yN(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Ua,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:_.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:_.toLocaleTimeString(E(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Pt,{size:"small","aria-label":Yk(),disabled:!e,onClick:p,children:f.jsx(zf,{size:13})})]}),f.jsx(Pt,{size:"small",title:hN(),"aria-label":hN(),disabled:u,onClick:c,children:f.jsx(bS,{size:13})})]})}const I$n=T.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,busy:m=!1,recoveringTurnId:w,onRecover:k,skills:v,predictTextTail:b=!1,forkCount:x,forkIndex:y=0,forkPrevId:C,forkNextId:N,forkDisabled:z,branchDisabled:A,onFork:j,onSelectFork:M}){var Z,Y;Vu();const[D,I]=T.useState(null),B=B$n(n);if(B)return f.jsx(P$n,{part:B});if(n.role==="user"){const $=n.parts.filter(ae=>ae.type==="text").map(ae=>ae.text??"").join(` `),L=ae=>!!(v!=null&&v.some(ue=>ue.name===ae)),F=n.parts.filter(ae=>ae.type==="image"&&ae.text).map(O$n),q=F.filter(ae=>!ae.isPdf),K=F.filter(ae=>ae.isPdf),ne=n.parts.filter(ae=>ae.type==="annotation"&&ae.text).map(ae=>({id:ae.id,text:ae.text??""}));if(D!==null){const ae=()=>{const ue=D.trim();!ue||z||(I(null),j(n.id,ue))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":uwe(),value:D,autoFocus:!0,onChange:ue=>I(ue.target.value),onKeyDown:ue=>{ue.key==="Escape"?(ue.preventDefault(),I(null)):ue.key==="Enter"&&!ue.shiftKey&&!ue.nativeEvent.isComposing&&(ue.preventDefault(),ae())}}),f.jsxs("div",{className:`${Y5} justify-end`,children:[f.jsx(De,{size:"small",onClick:()=>I(null),children:yye()}),f.jsx(De,{size:"small",variant:"primary",onClick:ae,disabled:z||!D.trim(),children:l3()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[ne.length>0&&f.jsx(_C,{annotations:ne,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(jIn,{text:$,isCommand:L}),q.length>0&&f.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:q.map((ae,ue)=>f.jsx("a",{href:ae.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:ae.src,alt:r0e()})},ue))}),K.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:K.map((ae,ue)=>f.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:ae.src,target:"_blank",rel:"noreferrer",children:[f.jsx(Ib,{size:15}),f.jsx("span",{children:ae.name})]},ue))})]}),x!==void 0&&f.jsx(L$n,{text:$,createdAt:n.createdAt,count:x,index:y,prevId:C,nextId:N,onSelect:M,pagerDisabled:A,onEdit:()=>I($),editDisabled:z})]})}const U=n.parts.find($=>$.type==="tool"&&u5($)),H=n.parts.find(Rm)??U,Q=dEn(n.parts.filter($=>$!==H&&!(U&&u5($))),H),V=b&&!n.completedAt?"":qB(n);return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx($$n,{message:n,parts:Q,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,predictTextTail:b}}),H&&f.jsx(HH,{part:H,usageLimited:!!U,busy:m,recovering:w===((Y=(Z=H.state)==null?void 0:Z.input)==null?void 0:Y.turnId),onRecover:k}),V&&f.jsx("div",{className:"flex opacity-0 transition-opacity duration-80 ease-standard group-hover/turn:opacity-100 group-focus-within/turn:opacity-100",children:f.jsx(Pt,{size:"small",title:nN(),"aria-label":nN(),onClick:()=>void dC(V),children:f.jsx(zf,{size:13})})})]})});function $$n({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=FB(n,r),[a,o]=T.useState(!1),[,c]=T.useState(0);if(T.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>c(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:sv(i,t)});const u=e.completedAt??(r?Date.now():null),h=u===null?null:u-e.createdAt,_=h===null?null:h<6e4||h>=36e5?T0(h):oNe({minutes:Xt(Math.floor(h/6e4)),seconds:Xt(Math.floor(h/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:_===null?eNe():hNe({duration:_})}),f.jsx(Ua,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:sv(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:sv(i,t)})]})}function B$n(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===aI?n:null}function P$n({part:e}){var c;const n=e.state,t=Zs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((c=n==null?void 0:n.input)==null?void 0:c.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` -`),o=r?yD():s&&i!==null?T0e({code:Xt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[CD()," "]}),f.jsx(jf,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${uC} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function sv(e,n){var x,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,predictTextTail:m=!1}=n,w=e.filter(C=>C.type!=="steer"&&kh(C,t)).at(-1),k=[];let v=[];const b=()=>{v.length!==0&&(k.push(f.jsx(T$n,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(kh(C,t)){if(C.type==="tool"&&(H$n(C.tool)||(((x=C.children)==null?void 0:x.length)??0)>0)){b(),k.push(f.jsx(U$n,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?k.push(f.jsx(Jo,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(w==null?void 0:w.id)},C.id)):C.type==="steer"?k.push(f.jsx("div",{dir:"auto",role:"note","aria-label":WCe(),className:"msg-steer my-2 ms-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&&k.push(f.jsx(R$n,{part:C,onRespond:h,onOpenFile:s,onOpenPlan:_},C.id))}return b(),k}function F$n(e){return gf(e).label}function H$n(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function qH(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function cb(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&cb(t.children,n);if(r)return r}return null}function q$n({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var w,k,v,b;const o=e.children??[],c=((w=e.state)==null?void 0:w.status)==="running",u=((k=e.state)==null?void 0:k.status)==="error",h=u?Dy(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",_=sv(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:c,pendingTailToolId:c?BB(o):null}),m=o.some(x=>x.type==="text"&&!!x.text)?"":qH(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),h&&f.jsx("div",{className:uC,children:h.slice(0,2e4)}),_.length===0&&!m&&!h?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:c?Kk():P1e()}):f.jsxs(f.Fragment,{children:[_,m&&f.jsx(Jo,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function U$n({part:e,pendingTail:n,onOpenSubagent:t}){var u,h,_,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=Dy(((h=e.state)==null?void 0:h.error)||((_=e.state)==null?void 0:_.output)||""),i=n&&!r?fC(gf(e)):gf(e),a=FH(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!qH(e),c=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(BI,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(ob,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${jH} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:c}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:Dve(),...Vr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[c,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ua,{size:12})})]})}function G$n(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const c of s){const u=`${i}/${c.id}`;c.type==="tool"&&((a=c.state)!=null&&a.status)&&n.set(u,{status:c.state.status,part:c}),(o=c.children)!=null&&o.length&&r(c.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function hC(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Zs(o,"reason","description")||PH(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function V$n(e){const[n,t]=T.useState({text:"",sequence:0}),r=T.useRef(null);return T.useEffect(()=>{var w,k,v,b,x;const s=((w=e[0])==null?void 0:w.id)??"",{messageId:i,states:a}=G$n(e),o=hC(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?KE({label:na(o.label)}):"",sequence:y.sequence+1}));return}const c=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,h=[...a].filter(([y,C])=>{var N;return((N=c.get(y))==null?void 0:N.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:KE({label:na(o.label)}),sequence:y.sequence+1}));return}const _=(k=h.find(([,y])=>Rm(y.part)))==null?void 0:k[1].part;if((_==null?void 0:_.id)==="turn-recovery"){const y=GB((b=(v=_.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${Gce()}${y?` ${y==="retry"?uce():rce()}`:""}`,sequence:C.sequence+1}));return}if((_==null?void 0:_.id)==="turn-retry"){t(y=>({text:Xoe(),sequence:y.sequence+1}));return}const p=h.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>gf(C.part).label).join(", ");t(C=>({text:p.length===1?Tce({labels:y}):$ce({count:Xt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=h.filter(([,y])=>y.status==="running");if(m.length>0){const y=(x=m.at(-1))==null?void 0:x[1].part;t(C=>({text:y?fC(gf(y)).label:gce(),sequence:C.sequence+1}));return}h.some(([,y])=>y.status==="completed")&&t(y=>({text:Sce(),sequence:y.sequence+1}))},[e]),n}const K$n=T.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:c,onSelectFork:u,busy:h,onOpenFile:_,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:w,onOpenExperiment:k,experimentName:v,onRespond:b,onOpenPlan:x,onOpenSubagent:y,recoveringTurnId:C,onRecover:N,skills:z}){var $,L,F;Vu();const A=(($=hC(n))==null?void 0:$.id)??null,j=T.useMemo(()=>n.filter(q=>M$n(q,A)),[n,A]),M=T.useMemo(()=>{const q=j.filter(K=>K.role==="user"&&!K.id.startsWith(Z_));return _En(a,n,q,K=>K.startsWith(Z_))},[n,j,a]),D=T.useRef(new Set),[I,B]=T.useState(!1),U=T.useCallback(q=>j[q].id,[j]),H=T.useCallback(q=>{if(I)return j.map((ne,ae)=>ae);const K=new Set(IB(q));return j.forEach((ne,ae)=>{D.current.has(ne.id)&&K.add(ae)}),[...K].sort((ne,ae)=>ne-ae)},[j,I]),Q=cEn({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:U,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var q;return Math.max(0,j.length*400-(((q=t.current)==null?void 0:q.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:H});T.useLayoutEffect(()=>{const q=()=>Q.scrollToEnd();return r.current=q,i(),()=>{r.current=null}},[Q,r,i]),T.useEffect(()=>{const q=()=>{var ae;const K=window.getSelection();if(!K||K.isCollapsed||!K.rangeCount)return;const ne=K.getRangeAt(0);for(const ue of((ae=t.current)==null?void 0:ae.querySelectorAll("[data-message-id]"))??[])ne.intersectsNode(ue)&&ue.dataset.messageId&&D.current.add(ue.dataset.messageId)};return document.addEventListener("selectionchange",q),()=>document.removeEventListener("selectionchange",q)},[t]);const V=j.at(-1),Z=V$n(n),Y=h?PB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:Z.text},Z.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":I,onClick:()=>B(q=>!q),children:d9e()}),f.jsx("div",{className:"relative",style:{height:Q.getTotalSize()},children:Q.getVirtualItems().map(q=>{var se,G,oe,ce,he,be;const K=j[q.index],ne=K.parts.find(Rm),ae=(G=(se=ne==null?void 0:ne.state)==null?void 0:se.input)==null?void 0:G.turnId,ue=ne?h||C!==null:!1;return f.jsx("div",{"data-index":q.index,"data-message-id":K.id,ref:Q.measureElement,className:"absolute left-0 w-full pb-4",style:{top:q.start},onClickCapture:Re=>{!(Re.target instanceof Element)||!Re.target.closest("[data-work-toggle]")||(s.current=!1,Q.setOptions({...Q.options,anchorTo:"start"}))},onPointerDownCapture:()=>D.current.add(K.id),onFocusCapture:()=>D.current.add(K.id),children:f.jsx(I$n,{message:K,forkCount:(oe=M.get(K.id))==null?void 0:oe.count,forkIndex:(ce=M.get(K.id))==null?void 0:ce.index,forkPrevId:(he=M.get(K.id))==null?void 0:he.prevId,forkNextId:(be=M.get(K.id))==null?void 0:be.nextId,forkDisabled:!o,branchDisabled:h,onFork:c,onSelectFork:u,activePermissionId:A,pendingTailToolId:(Y==null?void 0:Y.messageId)===K.id?Y.toolId:null,onOpenFile:_,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:w,onOpenExperiment:k,experimentName:v,onRespond:b,onOpenPlan:x,onOpenSubagent:y,busy:ue,recoveringTurnId:ae===C?C:null,onRecover:N,skills:z,predictTextTail:h&&K===V&&K.role==="assistant"})},K.id)})})]})}),W$n=(e,n)=>e==="all"?!0:e==="archived"?n:!n,UH=[{id:"active",label:cbe,railLabel:TD},{id:"archived",label:aN,railLabel:aN},{id:"all",label:pbe,railLabel:SD}];function Q$n({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=ga();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Pt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:vN(),"aria-label":vN(),onClick:()=>r(i=>!i),children:f.jsx(XI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:UH.map(i=>f.jsxs(Cn,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(gi,{size:13})]},i.id))})]})}const X$n=14,Y$n=500,Z$n=1200;function GH({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.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*X$n,Y$n)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function J$n({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:c,onDelete:u}){var N;const{open:h,setOpen:_,ref:p}=ga(),m=((N=e.title)==null?void 0:N.trim())||"Untitled",[w,k]=T.useState(!1),[v,b]=T.useState(""),x=T.useRef(null);function y(){var z;b(((z=e.title)==null?void 0:z.trim())||""),k(!0)}function C(){var A;const z=v.trim();k(!1),z&&z!==(((A=e.title)==null?void 0:A.trim())||"")&&o(z)}return T.useEffect(()=>{var z,A;w&&((z=x.current)==null||z.focus(),(A=x.current)==null||A.select())},[w]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.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]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.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-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]: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-dot]:hidden ${n?"active":""} ${t?"unread":""} ${h?"menu-open":""} ${w?"editing":""}`,title:`${mu[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?y9e():""}`,onClick:()=>{w||(h?_(!1):a())},onKeyDown:z=>{z.target===z.currentTarget&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),h?_(!1):a())},children:[e.parentSessionId&&!w&&f.jsx(kS,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),w?f.jsx("input",{ref:x,className:"session-title-input","aria-label":fSe(),value:v,onChange:z=>b(z.target.value),onClick:z=>z.stopPropagation(),onBlur:C,onKeyDown:z=>{z.stopPropagation(),z.key==="Enter"?(z.preventDefault(),C()):z.key==="Escape"&&(z.preventDefault(),k(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(GH,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:EN(),"aria-label":EN(),onClick:z=>{z.stopPropagation(),_(A=>!A)},children:f.jsx(Lb,{size:14})}),h&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(Cn,{onClick:z=>{z.stopPropagation(),_(!1),y()},children:f.jsx("span",{children:ND()})}),f.jsx(Cn,{onClick:z=>{z.stopPropagation(),_(!1),c(!e.archived)},children:f.jsx("span",{children:e.archived?OEe():Lpe()})}),f.jsx(Cn,{danger:!0,onClick:z=>{z.stopPropagation(),_(!1),u()},children:f.jsx("span",{children:ED()})})]})]})}const jR=[LI,QI,jf,yh],eBn=()=>[{title:BSe(),prompt:RSe()},{title:JSe(),prompt:VSe()},{title:d6e(),prompt:a6e()},{title:N6e(),prompt:y6e()}],y4=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],AR="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function tBn(e,n){if(!e)return null;const t=e.model??null;return{...e,model:t,serviceTier:Tv(n,t,e.serviceTier),reasoningLevel:eI(n,t,e.reasoningLevel)}}function nBn({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:c,runExperimentName:u,onOpenExperiment:h,experimentName:_,onOpenPlan:p,onOpenSubagent:m,runtime:w,onOpenDemoWelcome:k,composerFocusNonce:v=0,demoRunningRunId:b=null,activeSessionId:x,onActiveSessionChange:y,preferredAgent:C,onPreferredAgentChange:N,children:z}){var xc,Eo,Ds,Il,zs,o_,qf;const A=dn({mutationFn:te=>J2n(...te)}),j=dn({mutationFn:te=>Y2n(...te)}),M=dn({mutationFn:te=>Z2n(...te)}),D=dn({mutationFn:te=>G2n(...te)}),I=dn({mutationFn:te=>K2n(...te)}),B=dn({mutationFn:te=>Q2n(...te)}),U=dn({mutationFn:te=>X2n(...te)}),H=dn({mutationFn:W2n}),Q=T.useMemo(()=>Fa(e),[e]),{data:V=c$n}=ut(Q),Z=T.useCallback(te=>{is(Q.queryKey,me=>{if(!me)return;const Ee=typeof te=="function"?te(me):te,Oe=new Map(me.map(Pe=>[Pe.id,Pe]));for(const Pe of Ee)Oe.get(Pe.id)!==Pe&&ao(et,Q.queryKey,Pe.id),Oe.delete(Pe.id);for(const Pe of Oe.keys())ao(et,Q.queryKey,Pe);return Ee})},[Q]),Y=x,$=T.useRef(y);$.current=y;const L=T.useRef({projectId:e});L.current.projectId!==e&&(L.current={projectId:e});const[F,q]=T.useState(new Set),[K,ne]=T.useState("active"),[ae,ue]=T.useState(""),[se,G]=T.useState(!1),[oe,ce]=T.useState(!1),[he,be]=T.useState([]),Re=T.useRef(0),Le=T.useRef({projectId:e,activeId:Y,mainView:i});(Le.current.projectId!==e||Le.current.activeId!==Y||Le.current.mainView!==i)&&(Le.current={projectId:e,activeId:Y,mainView:i});const[Ke,Ne]=T.useState([]),[xe,rt]=T.useState(null),Ze=Y??"new",ot=T.useRef(new Map),kt=T.useRef(kw);kt.current={draft:ae,attachments:Ke,annotations:he};const qt=e===Pp&&V.length>0&&V.every(te=>Lyn[te.id]===te.activeLeafId)?qz:null,dt=T.useRef(null);qt!==null&&dt.current===null&&Y!==null&&(dt.current=Ze);const pt=Ze===dt.current?qt:null;T.useLayoutEffect(()=>{const te=ot.current.get(Ze)??kw;return kt.current=te,ue(te.draft),Ne(te.attachments),be(te.annotations),()=>{const me=wEn(kt.current,pt);me?ot.current.set(Ze,me):ot.current.delete(Ze)}},[Ze,pt]);const[Ie,pe]=T.useState(null),je=T.useRef(Promise.resolve()),He=T.useRef(0),st=T.useRef(0),[_t,Ct]=T.useState(null),bt=T.useRef(null),Yt=T.useRef(!1),un=T.useRef(null),[Tt,ht,mt]=Pwn(e,i==="chat"?Y:null),{data:_n=sBn}=ut(Du()),[gs,br]=T.useState(C);T.useEffect(()=>br(C),[C]);const[Kt,Bn]=T.useState({}),[_r,yr]=T.useState(Yp),[Wr,Nt]=T.useState(null),vn=T.useRef(!1),fn=T.useRef(null),[hn,Ir]=T.useState(null),bn=T.useRef(!1),yn=T.useRef(null),[Pn,Et]=T.useState(new Map),Bt=T.useRef(new Map),In=T.useRef(null),xr=T.useRef(null),fr=T.useRef(null),Fn=T.useRef(!0),[sr,Qr]=T.useState(!0),On=T.useRef(null),[We,yt]=T.useState(!1),Jn=ga(),pr=T.useCallback(te=>{var me;Re.current+=1,be(Ee=>[...Ee,{id:`annotation-${Re.current}`,...te}]),(me=On.current)==null||me.focus()},[]),pn=e$n(xr,pr);t$n(he),T.useEffect(()=>{yt(!1),pn.dismiss()},[Y,e,pn.dismiss]);const[Tr,An]=T.useState(0),[ii,wr]=T.useState(!1),[er,Va]=T.useState(0),[_c,$r]=T.useState(0),ai=T.useRef(!1);function xo(te){if(!Yr)return;if(!Ci&&te.source==="command"&&Oy(te.name)&&te.name!=="goal"){ci(te.name,ae,Yr);return}const me=te.source==="command"?1:W5(te.name,On.current),Ee=wIn(ae,Yr,te.name,me);ue(Ee.text),window.requestAnimationFrame(()=>{var Oe,Pe;(Oe=On.current)==null||Oe.focus(),(Pe=On.current)==null||Pe.setSelectionRange(Ee.cursor,Ee.cursor),$r(Ee.cursor)})}function Ka(te){if(wi)return!1;const me=te.selectionStart;if(ai.current||me!==te.selectionEnd)return!1;const Ee=ae.slice(0,me).replace(/[ \t]+$/,"").length,Oe=_4(ae,Ee);if(!Oe||Oe.end!==Ee||!Ju(Oe.query)||me>Ee&&me-Ee!==W5(Oe.query,te))return!1;const Pe=vR(ae,{...Oe,end:me});return ue(Pe.text),$r(Pe.cursor),window.requestAnimationFrame(()=>te.setSelectionRange(Pe.cursor,Pe.cursor)),!0}function Pi(te){rt(null);let Oe=Ke.reduce((Pe,Jt)=>Pe+Jt.size,0);for(const Pe of te){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Pe.type))continue;if(Pe.size>31457280){rt(u0e({name:Ce(Pe.name)}));continue}if(Oe+Pe.size>41943040){rt(g0e());continue}Oe+=Pe.size;const Jt=Y,mn=new FileReader;mn.onload=()=>{const Dn={dataUrl:mn.result,mediaType:Pe.type,name:Pe.name,size:Pe.size};if(Le.current.activeId===Jt){Ne(Sr=>[...Sr,Dn]);return}const rn=ot.current.get(Jt??"new")??kw;ot.current.set(Jt??"new",{...rn,attachments:[...rn.attachments,Dn]})},mn.readAsDataURL(Pe)}}function xl(te){const me=Array.from(te.clipboardData.items).filter(Ee=>Ee.kind==="file"&&(Ee.type.startsWith("image/")||Ee.type==="application/pdf")).map(Ee=>Ee.getAsFile()).filter(Ee=>Ee!==null);me.length>0&&(te.preventDefault(),Pi(me))}const Lt=V.find(te=>te.id===Y),Rs=gs??w6n(_n),Br=Lt?{harness:Lt.harness,model:Kt.model!==void 0?Kt.model:Lt.model,serviceTier:Kt.serviceTier!==void 0?Kt.serviceTier:Lt.serviceTier,permissionMode:Kt.permissionMode??Lt.permissionMode,reasoningLevel:Kt.reasoningLevel??Lt.reasoningLevel}:Rs?{...Rs,...Kt}:null,{data:Xr=rBn}=ut(Awn(Br==null?void 0:Br.harness)),ct=Br?_n.find(te=>te.id===Br.harness):void 0,Wt=ct==null?void 0:ct.options,xi=T.useMemo(()=>kIn(Xr,Wt==null?void 0:Wt.planActivation),[Xr,Wt==null?void 0:Wt.planActivation]),Fi=yR(ae),Hi=Fi!==null,Yr=_4(ae,_c),Rr=(Yr==null?void 0:Yr.query)??null,wo=Rr===null?[]:xi.filter(te=>yIn(te,Rr)),wi=!Hi&&Rr!==null&&(Yr==null?void 0:Yr.end)===_c&&wo.length>0,Hs=wi&&!ii?wo:[],oi=Hs.length>0,Zr=Math.min(Tr,Math.max(0,Hs.length-1));T.useEffect(()=>An(0),[Rr]);const Zt=tBn(Br,ct),Ms=Ob(ct,Zt==null?void 0:Zt.model),ya=te=>{if(!Zt)return;const me={...Zt,...te},Ee={};te.model!==void 0&&te.model!==Zt.model&&(Ee.model=te.model),te.serviceTier!==void 0&&te.serviceTier!==Zt.serviceTier&&(Ee.serviceTier=te.serviceTier),te.permissionMode!==void 0&&te.permissionMode!==Zt.permissionMode&&(Ee.permissionMode=te.permissionMode),te.reasoningLevel!==void 0&&te.reasoningLevel!==Zt.reasoningLevel&&(Ee.reasoningLevel=te.reasoningLevel),yr(Oe=>({...Oe,...Ee})),br(me),N(me).catch(()=>{}),Lt?Bn(Oe=>({...Oe,...te})):te.harness&&te.harness!==Zt.harness&&Bn({})},kr=T.useCallback(te=>{const me=je.current.catch(()=>{}).then(()=>{if(!Un(Q.queryKey))throw new DOMException("Workspace changed","AbortError");return te()});return je.current=me.then(()=>{},()=>{}),me},[Q]),Wa=te=>{if(te==="plan"&&(ct==null?void 0:ct.id)==="claude-code"?(yr(Oe=>({...Oe,permissionMode:te})),Bn(Oe=>({...Oe,permissionMode:te}))):(Bn(Oe=>{const Pe={...Oe};return delete Pe.permissionMode,Pe}),ya({permissionMode:te})),!Lt)return;const me=Lt.id,Ee=++He.current;pe(null),kr(()=>A.mutateAsync([me,te])).then(Oe=>{Z(Pe=>Pe.map(Jt=>Jt.id===Oe.id?Oe:Jt)),He.current===Ee&&Bn(Pe=>{const Jt={...Pe};return delete Jt.permissionMode,Jt})}).catch(()=>{He.current===Ee&&(Bn(Oe=>{const Pe={...Oe};return delete Pe.permissionMode,Pe}),pe(KEe()))})},Jr=te=>ya({reasoningLevel:te}),qs=((xc=Lt==null?void 0:Lt.goal)==null?void 0:xc.trim())||"",Us=(Zt==null?void 0:Zt.harness)==="claude-code"?Zt.permissionMode==="plan":(Wt==null?void 0:Wt.planActivation)==="command"?_t??(Lt==null?void 0:Lt.planMode)??!1:!1;T.useEffect(()=>{_t===null||(Lt==null?void 0:Lt.planMode)!==_t||(bt.current=null,Ct(null))},[Lt==null?void 0:Lt.planMode,_t]);async function es(te){if(yr(Oe=>({...Oe,planMode:te})),bt.current=te,Ct(te),!Lt)return;const me=Lt.id,Ee=++st.current;pe(null);try{const Oe=await kr(()=>j.mutateAsync([me,te]));Z(Pe=>Pe.map(Jt=>Jt.id===Oe.id?Oe:Jt)),st.current===Ee&&(bt.current=null,Ct(null),pe(null))}catch(Oe){throw st.current===Ee&&(bt.current=null,Ct(null)),Oe}}async function Gs(){if((Zt==null?void 0:Zt.harness)==="claude-code"){Wa("auto");return}if(Lt)try{await es(!1)}catch{pe($me())}}async function wl(){const te=!Us;try{if((Zt==null?void 0:Zt.harness)==="claude-code")Wa(te?"plan":"auto");else if((Wt==null?void 0:Wt.planActivation)==="command")await es(te);else throw new Error(Xg())}catch{pe(TN())}}function kl(te,me=""){var Ee;switch(te){case"plan":return wl(),!1;case"new":return yc(),!1;case"resume":return yt(!0),!0;case"model":return Va(Oe=>Oe+1),!0;case"compact":return If(),!1;case"goal":return Qa(me),!1;case"copy":{const Oe=ir.at(-1),Pe=dr&&(Oe==null?void 0:Oe.role)==="assistant"&&!Oe.completedAt,Jt=mEn(Pe?ir.slice(0,-1):ir);return Jt?dC(Jt):xn(hve(),"info"),!1}case"export":{const Oe=((Ee=Lt==null?void 0:Lt.title)==null?void 0:Ee.trim())||Sd(),Pe=Lt?gEn(Oe,ir,{user:ige(),assistant:mu[Lt.harness]}):null;return Pe?D$n(vEn(Oe),Pe):xn(xve(),"info"),!1}}}async function xa(te){pe(null);const me=L.current;try{const Ee=await D.mutateAsync([e,te]);if(et.invalidateQueries({queryKey:iI().queryKey}),L.current!==me)return;Z(Oe=>[Ee,...Oe.filter(Pe=>Pe.id!==Ee.id)]),ne("all"),y(Ee.id,{projectId:Ee.projectId})}catch(Ee){if(L.current!==me)return;pe(Jge({error:Ce(Ee instanceof Error?Ee.message:String(Ee))}))}}async function Qa(te){var mn;const me=te.trim();if(!me){const Dn=(mn=Lt==null?void 0:Lt.goal)==null?void 0:mn.trim();xn(Dn?bge({goal:na(Dn)}):Rge(),"info");return}const Ee=Le.current,Oe=()=>Le.current.activeId===Ee.activeId;pe(null);let Pe=Y;if(!Pe){if(!(ct!=null&&ct.agentReady)||!Zt){pe(Xg());return}try{Pe=(await vc(Zt,d4(Wt==null?void 0:Wt.planActivation,void 0,bt.current))).id}catch(Dn){pe(rN({error:Ce(Dn instanceof Error?Dn.message:String(Dn))}));return}}const Jt=/^(clear|none|off)$/i.test(me);try{const Dn=await kr(()=>M.mutateAsync([Pe,Jt?null:me]));Z(rn=>rn.map(Sr=>Sr.id===Dn.id?Dn:Sr)),xn(Jt?fge():Bge(),"success")}catch(Dn){if(!Oe())return;pe(rN({error:Ce(Dn instanceof Error?Dn.message:String(Dn))}))}}async function If(){const te=Y;if(!te){xn(ove(),"info");return}if(dr){pe(Y0e());return}pe(null),K==="archived"&&ne("active");const me=Le.current;try{const{message:Ee}=await swn(te);ht({type:"upsertMessage",sessionId:te,message:Ee})}catch(Ee){if(Le.current.activeId!==me.activeId)return;pe(sme({error:Ce(Ee instanceof Error?Ee.message:String(Ee))}))}}function ci(te,me,Ee){const Oe=vR(me,Ee);ue(Oe.text),wr(!0),!kl(te)&&window.requestAnimationFrame(()=>{var Pe,Jt;(Pe=On.current)==null||Pe.focus(),(Jt=On.current)==null||Jt.setSelectionRange(Oe.cursor,Oe.cursor),$r(Oe.cursor)})}const wa=T.useCallback(async(te=!1)=>{const me=L.current;if(me.projectId!==e||!Un(Q.queryKey))return null;const Ee=(et.getQueryData(Q.queryKey)??[]).map(Oe=>Oe.id);try{const Oe=await et.fetchQuery({...Q,...te?{staleTime:0}:{}});if(L.current!==me||!Un(Q.queryKey))return null;const Pe=Oe.filter(mn=>!_l.has(mn.id)),Jt=new Set(Pe.map(mn=>mn.id));for(const mn of Ee)Jt.has(mn)||Ol(mn);return Bt.current=new Map(Pe.map(mn=>[mn.id,mn.title])),Pe}catch{return null}},[e]),Os=T.useCallback(async te=>{L.current.projectId!==e||!Un(Q.queryKey)||await Promise.all([et.fetchQuery({...ol(te),staleTime:0}),wa(!0)]).catch(()=>{})},[e,wa]);T.useEffect(()=>{const te=l$();q(e===Pp?new Set([Tb,Rb].filter(Ee=>!te.has(Ee))):new Set),G(!1),ce(!1),Et(new Map),Bt.current=new Map,wa();const me=L.current;return()=>{L.current===me&&(L.current={projectId:e})}},[e,wa]),T.useEffect(()=>{yr(Yp),yn.current=null},[Y]),T.useEffect(()=>Mv(te=>{switch(te.type){case"session":{if(te.session.projectId!==e||_l.has(te.session.id))return;const me=Bt.current.has(te.session.id),Ee=Bt.current.get(te.session.id)!==te.session.title;Bt.current.set(te.session.id,te.session.title),me&&Ee&&te.session.titleSource==="generated"&&(Et(Oe=>{const Pe=new Map(Oe);return Pe.set(te.session.id,(Oe.get(te.session.id)??0)+1),Pe}),window.setTimeout(()=>{Et(Oe=>{if(!Oe.has(te.session.id))return Oe;const Pe=new Map(Oe);return Pe.delete(te.session.id),Pe})},Z$n));break}case"sessionDeleted":Ol(te.sessionId);break}}),[e]),T.useEffect(()=>Mv(te=>{te.type==="reconnected"&&wa(!0)}),[wa]);const Vs=Y?Tt.messagesBySession[Y]??CR:CR,ko=Y?Tt.activeLeafBySession[Y]??null:null;fn.current=ko;const ir=T.useMemo(()=>lEn(Vs,ko),[Vs,ko]),ki=T.useRef({projectId:e,ids:Tt.busySessions});T.useEffect(()=>{const te=ki.current;ki.current={projectId:e,ids:Tt.busySessions},te.projectId===e&&q(me=>pEn(me,te.ids,Tt.busySessions,V,i==="chat"?Y:null))},[e,Tt.busySessions,V,Y,i]);const dr=Y?Tt.busySessions.has(Y):!1,fc=!dr&&!!(ct!=null&&ct.agentReady),Yu=dr&&PB(ir)!=null,Sl=dr&&hEn(ir),Ks=Y?Tt.queuedBySession[Y]??[]:[],Zu=Ks.some(te=>te.dispatchState==="retrying"),vs=Ks.findIndex(te=>te.dispatchState==="blocked"),Si=Ks.reduce((te,me)=>me.dispatchState!=="retrying"||typeof me.nextRetryAt!="number"?te:te===null?me.nextRetryAt:Math.min(te,me.nextRetryAt),null),[Cl,ka]=T.useState(()=>Date.now());T.useEffect(()=>{if(!Zu||Si===null||(ka(Date.now()),Si<=Date.now()))return;const te=window.setInterval(()=>{const me=Date.now();ka(me),me>=Si&&window.clearInterval(te)},1e3);return()=>window.clearInterval(te)},[Zu,Si]),T.useEffect(()=>{const te=Ks.reduce((me,Ee)=>Ee.planMode??me,void 0);te!==void 0?(Yt.current=!0,bt.current=te,Ct(te)):Yt.current&&(Yt.current=!1,bt.current=null,Ct(null))},[Ks]);const El=!!Y&&!(Y in Tt.messagesBySession)&&mt.isPending,Nl=T.useMemo(()=>{const te=new Set;for(const me of Tt.busySessions)(Tt.messagesBySession[me]??[]).some(Ee=>Ee.parts.some(Oe=>Oe.type==="prompt"&&Oe.prompt&&!Oe.prompt.resolved&&Oe.prompt.nativeId))&&te.add(me);return te},[Tt.busySessions,Tt.messagesBySession]),sn=Y?Nl.has(Y):!1,$n=Lt,qi=$n?Pn.get($n.id):void 0,ts=T.useMemo(()=>{var te;for(let me=ir.length-1;me>=0;me--)for(const Ee of ir[me].parts)if(Ee.type==="prompt"&&((te=Ee.prompt)==null?void 0:te.kind)==="plan"&&!Ee.prompt.resolved)return{promptId:Ee.id,plan:Ee.prompt.plan??"",synthesized:!!Ee.prompt.synthesized};return null},[ir]),Ci=T.useMemo(()=>Y?fEn(ir,$n==null?void 0:$n.harness,Tt.busySessions.has(Y)):null,[ir,$n==null?void 0:$n.harness,Y,Tt.busySessions]),Ui=Hi&&!Ci,Ju=te=>{if(Ci||Hi)return!1;const me=K5(te),Ee=xi.find(Oe=>Oe.name===(me??te));return!Ee||Ee.source!=="command"?!!Ee:me&&f4(me)?me==="plan"||ae.trim().toLowerCase().startsWith(`/${te}`):ae.trim().toLowerCase()===`/${te}`},dc=T.useMemo(()=>xi.filter(te=>te.source!=="command"),[xi]),[Sa,zl]=T.useState(null),$f=Sa&&Sa.sessionId===Y?Sa:null;T.useEffect(()=>{if(!Sa)return;const te=Tt.busySessions.has(Sa.sessionId),me=Sa.sessionId===Y&&ts&&ts.promptId!==Sa.promptId;(!te||me)&&zl(null)},[Sa,ts,Tt.busySessions,Y]);const Yh=T.useMemo(()=>hC(ir),[ir]),So=dr&&!!(ct!=null&&ct.supportsSteering)&&!!(ct!=null&&ct.agentReady)&&!ts&&!Ci&&!Yh&&Ke.length===0&&he.length===0,hc=T.useMemo(()=>p&&Y?(te,me,Ee)=>p(te,Y,me,Ee):void 0,[p,Y]),Gi=T.useMemo(()=>m&&Y?(te,me,Ee)=>m(Y,te,me,Ee):void 0,[m,Y]),Bf=T.useMemo(()=>o&&((te,me,Ee,Oe,Pe)=>o(te,Y??void 0,me,Ee,Oe,Pe)),[o,Y]);T.useEffect(()=>{He.current+=1,st.current+=1;const te=(Y?Tt.queuedBySession[Y]??[]:[]).reduce((me,Ee)=>Ee.planMode??me,void 0);Yt.current=te!==void 0,bt.current=te??null,Ct(te??null),Bn({}),pe(null)},[Y]);const jl=i==="chat"&&(ir.length>0||dr),Ca=(Zt==null?void 0:Zt.harness)??null,e_=(Zt==null?void 0:Zt.model)??null,pc=mt.data?null:mt.error,t_=i==="chat"&&!jl&&!El&&!pc,Al=ut({...s4n(e,Ca??"claude-code",e_,E()),enabled:t_&&Ca!==null,subscribed:t_&&Ca!==null}),mc=(Eo=Al.data)!=null&&Eo.blank?eBn():((Ds=Al.data)==null?void 0:Ds.prompts)??null,Zh=Ca!==null&&Al.isPending,Xa=e===Pp?"demo":"project",Tl=te=>{ue(te),wr(!1),window.requestAnimationFrame(()=>{const me=On.current;me&&(me.focus(),me.setSelectionRange(te.length,te.length),$r(te.length))})};T.useEffect(()=>{pt&&(ue(te=>te||pt),wr(!1),$r(pt.length))},[pt]),T.useEffect(()=>{if(v===0)return;const te=window.requestAnimationFrame(()=>{const me=On.current;me&&(me.focus(),me.setSelectionRange(me.value.length,me.value.length),me.scrollIntoView({block:"nearest"}))});return()=>window.cancelAnimationFrame(te)},[v]);const gc=T.useId(),n_=e===Pp&&ae===qz&&!se,Pf=T.useCallback(te=>{const me=te.scrollHeight-te.scrollTop-te.clientHeight<60;Fn.current=me,Qr(me)},[]),bs=T.useCallback(()=>{var te;Fn.current=!0,Qr(!0),(te=fr.current)==null||te.call(fr)},[]);T.useEffect(()=>{const te=In.current,me=xr.current;if(!te||!me)return;const Ee=new ResizeObserver(()=>{var Oe;Fn.current?(Oe=fr.current)==null||Oe.call(fr):Qr(te.scrollHeight-te.scrollTop-te.clientHeight<60)});return Ee.observe(te),Ee.observe(me),()=>Ee.disconnect()},[jl]);const Jh=T.useCallback(te=>{te.currentTarget.blur(),bs()},[bs]);async function Ff({queue:te=!1}={}){var $l,Ja,wc,No,Ei,c_;const me=ae.trim(),Ee=Ci?null:SIn(me,Wt==null?void 0:Wt.planActivation);if(Ee&&Ee.name!=="plan"){ue(f4(Ee.name)?"":Ee.prompt),wr(!1),kl(Ee.name,Ee.prompt);return}if(pu({name:"first_action",surface:Xa,action:"typed_prompt"}),bn.current)return;const Oe=!!Ee,Pe=!Us,Jt=d4(Wt==null?void 0:Wt.planActivation,Oe?Pe:void 0,bt.current),mn=Oe&&(ct==null?void 0:ct.id)==="claude-code"?Pe?"plan":"auto":void 0,Dn=Ee?Ee.prompt:me,rn=Ke,Sr=he,J=Sr.map(on=>({text:on.text})),ge=e,Ae=i;let $e=Y;const Te=()=>{const on=Le.current;return Un(Q.queryKey)&&on.projectId===ge&&on.activeId===$e&&on.mainView===Ae},at=()=>{Te()&&(ue(on=>on||me),Ne(on=>on.length?on:rn),be(on=>on.length?on:Sr))};if(Oe&&!Dn&&rn.length===0&&Sr.length===0){ue(""),wr(!1);try{if((ct==null?void 0:ct.id)==="claude-code")Wa(Pe?"plan":"auto");else if((Wt==null?void 0:Wt.planActivation)==="command")await es(Pe);else throw new Error(Xg())}catch{pe(TN()),at()}return}const Je=Zt?{...Zt,...mn?{permissionMode:mn}:{}}:null;mn&&Wa(mn);let Mt=null;const Xn=bt.current;Oe&&(Wt==null?void 0:Wt.planActivation)==="command"&&(Mt=++st.current,bt.current=Pe,Ct(Pe));const as=()=>{!Te()||Mt===null||st.current!==Mt||(bt.current=Xn,Ct(Xn))};if(!Dn&&rn.length===0&&Sr.length===0)return;if((Dn||Sr.length>0)&&Ci&&rn.length===0){ue(""),be([]),ns({promptId:Ci,answers:[],note:Dn||void 0,annotations:J}).then(on=>{on||at()});return}const Ls=JSON.stringify({text:Dn,images:rn.map(on=>({mediaType:on.mediaType,name:on.name,dataUrl:on.dataUrl})),annotations:J,settings:Je?{model:Je.model,serviceTier:Je.serviceTier,permissionMode:Je.permissionMode,planMode:Jt,reasoningLevel:Je.reasoningLevel}:null}),js=(($l=yn.current)==null?void 0:$l.signature)===Ls?yn.current.id:`ct_${crypto.randomUUID()}`;if(yn.current={signature:Ls,id:js},dr){if(!Y||!(ct!=null&&ct.agentReady)){as();return}const on=Y;ue(""),Ne([]),be([]),rt(null);const Ni=Je?{model:Je.model,serviceTier:Je.serviceTier,permissionMode:Je.permissionMode,planMode:(Wt==null?void 0:Wt.planActivation)==="command"?Jt??(Lt==null?void 0:Lt.planMode):Jt,reasoningLevel:Je.reasoningLevel}:{};Te()&&Bn({});const eo=rn.map(Pr=>({mediaType:Pr.mediaType,dataBase64:Pr.dataUrl.slice(Pr.dataUrl.indexOf(",")+1),name:Pr.name}));try{(Ja=(await kr(()=>Uz(on,Dn,Ni,eo.length?eo:void 0,J,js,So&&!te&&!Oe?"steer":void 0))).turn)!=null&&Ja.existing&&await Os(on),Te()&&yr(Yp),((wc=yn.current)==null?void 0:wc.id)===js&&(yn.current=null)}catch{as(),at()}return}if(!(ct!=null&&ct.agentReady)){as();return}if(!Je){as();return}let os=Y;try{ue(hr=>hr===ae?"":hr),Ne(hr=>hr===rn?[]:hr),be(hr=>hr===Sr?[]:hr),rt(null),bn.current=!0;try{if(!os){const zo=await vc(Je,Jt);os=zo.id,$e=zo.id}if(!Un(Q.queryKey))return;const hr=ol(os);await et.fetchQuery({...hr,...((No=et.getQueryState(hr.queryKey))==null?void 0:No.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{bn.current=!1}if(!Un(Q.queryKey))return;ht({type:"optimisticUser",sessionId:os,text:Dn||Xpe(),attachments:rn.map(hr=>({url:hr.dataUrl,mediaType:hr.mediaType,name:hr.name})),annotations:Sr}),ht({type:"busy",sessionId:os,busy:!0}),Te()&&bs(),Te()&&K==="archived"&&ne("active");const on=Je?{model:Je.model,serviceTier:Je.serviceTier,permissionMode:Je.permissionMode,planMode:Jt,reasoningLevel:Je.reasoningLevel}:{};Te()&&Bn({});const Ni=rn.map(hr=>({mediaType:hr.mediaType,dataBase64:hr.dataUrl.slice(hr.dataUrl.indexOf(",")+1),name:hr.name})),eo=os;if(!eo)throw new Error(a9e());(Ei=(await kr(()=>Uz(eo,Dn,on,Ni.length?Ni:void 0,J,js))).turn)!=null&&Ei.existing&&await Os(eo),Te()&&yr(Yp),((c_=yn.current)==null?void 0:c_.id)===js&&(yn.current=null)}catch(on){if(!Un(Q.queryKey)||(at(),as(),!os))return;const Ni=on instanceof Error?on.message:String(on);if(!/session is busy/i.test(Ni)&&await et.fetchQuery({...Fa(e),staleTime:0}).then(Pr=>{var kc;return!!((kc=Pr.find(hr=>hr.id===os))!=null&&kc.busy)}).catch(()=>!1)){Te()&&(ue(Pr=>Pr===Dn?"":Pr),Ne(Pr=>Pr===rn?[]:Pr),be(Pr=>Pr===Sr?[]:Pr));return}ht({type:"busy",sessionId:os,busy:!1}),ht({type:"localError",sessionId:os,text:d1e({error:Ce(Ni)})})}}async function vc(te,me){const Ee=Le.current,Oe=L.current,Pe=await I.mutateAsync([e,te.harness,{model:te.model,serviceTier:te.serviceTier,permissionMode:te.permissionMode,planMode:me,reasoningLevel:te.reasoningLevel}]);return L.current===Oe&&(Z(Jt=>[Pe,...Jt.filter(mn=>mn.id!==Pe.id)]),et.getQueryData(Q.queryKey)||wa(!0)),L.current===Oe&&Le.current===Ee&&($.current(Pe.id,{replace:!0}),Le.current={...Ee,activeId:Pe.id}),Pe}function bc(){const te=IIn(ae);ue(te),window.requestAnimationFrame(()=>{var me,Ee;(me=On.current)==null||me.focus(),(Ee=On.current)==null||Ee.setSelectionRange(te.length,te.length),$r(te.length)})}async function r_(){const te=Fi;if(!te)return;if(pe(null),dr){pe(S0e());return}const me=ae,Ee=Le.current;let Oe=Y;const Pe=()=>{const rn=Le.current;return rn.projectId===Ee.projectId&&rn.activeId===Oe&&rn.mainView===Ee.mainView},Jt=()=>{Pe()&&ue(rn=>rn||me)};ue(""),wr(!1);let mn=Y;if(!mn){if(!(ct!=null&&ct.agentReady)||!Zt){Jt(),pe(Xg());return}try{const rn=d4(Wt==null?void 0:Wt.planActivation,void 0,bt.current);mn=(await vc(Zt,rn)).id,Oe=mn,Pe()&&Bn({})}catch(rn){Jt();const Sr=rn instanceof Error?rn.message:String(rn);Pe()&&pe(tN({error:Ce(Sr)}));return}}Pe()&&K==="archived"&&ne("active");const Dn=`${Z_}shell-${Date.now()}`;ht({type:"localShell",sessionId:mn,id:Dn,command:te}),Pe()&&bs();try{const{message:rn}=await iwn(mn,te);ht({type:"upsertMessage",sessionId:mn,message:rn})}catch(rn){const Sr=rn instanceof Error?rn.message:String(rn);ht({type:"localShell",sessionId:mn,id:Dn,command:te,error:tN({error:Ce(Sr)})})}}function s_(){Y&&lwn(Y).catch(()=>{pe(F9e())})}const i_=T.useCallback(async(te,me)=>{if(!(!Y||vn.current)){vn.current=!0,pe(null),Nt(te);try{const Ee=xEn({model:_r.model,serviceTier:_r.serviceTier,permissionMode:_r.permissionMode,planMode:_r.planMode,reasoningLevel:_r.reasoningLevel}),Oe=Y;(await awn(Oe,te,me,Ee)).turn.existing&&await Os(Oe),yr(Yp)}catch{pe(J7e())}finally{vn.current=!1,Nt(null)}}},[Y,_r,Os]),a_=T.useCallback((te,me)=>{if(!Y||dr||!(ct!=null&&ct.agentReady))return;const Ee=Y;ht({type:"busy",sessionId:Ee,busy:!0}),bs(),kr(()=>own(Ee,te,me)).catch(Oe=>{ht({type:"busy",sessionId:Ee,busy:!1});const Pe=Oe instanceof Error?Oe.message:String(Oe);ht({type:"localError",sessionId:Ee,text:d8e({error:Ce(Pe)})})})},[Y,dr,ct==null?void 0:ct.agentReady,bs,kr]),Rl=T.useCallback(te=>{if(!Y||dr)return;const me=Y,Ee=fn.current;ht({type:"activeLeaf",sessionId:me,leafId:te}),kr(()=>cwn(me,te)).catch(Oe=>{ht({type:"activeLeaf",sessionId:me,leafId:Ee});const Pe=Oe instanceof Error?Oe.message:String(Oe);ht({type:"localError",sessionId:me,text:W9e({error:Ce(Pe)})})})},[Y,dr,kr]);function Ml(te){if(!Y)return;const me=Y;twn(me,te).then(({removed:Ee})=>{if(Ee)return Os(me)}).catch(()=>pe(a8e()))}async function Co(te){if(!Y||hn)return;const me=Y;pe(null),Ir(te);try{await nwn(me,te),await Os(me)}catch{pe(N8e())}finally{Ir(null)}}T.useEffect(()=>{if(!dr||i!=="chat")return;function te(me){var Ee;me.key!=="Escape"||me.defaultPrevented||(me.preventDefault(),s_(),(Ee=On.current)==null||Ee.focus())}return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[dr,Y,i]);function Ol(te){jb(te),ot.current.delete(te),dt.current===te&&(dt.current=null),Le.current.projectId===e&&Le.current.activeId===te&&Le.current.mainView==="chat"&&(ue(""),Ne([]),be([]),$.current(null,{replace:!0})),q(me=>{if(!me.has(te))return me;const Ee=new Set(me);return Ee.delete(te),Ee}),Bt.current.delete(te)}function Dl(te,me){const Ee=te.archived;Z(Oe=>Oe.map(Pe=>Pe.id===te.id?{...Pe,archived:me}:Pe)),B.mutateAsync([te.id,me]).catch(()=>{Z(Oe=>Oe.map(Pe=>Pe.id===te.id?{...Pe,archived:Ee}:Pe))})}function ep(te,me){const Ee=te.title;Z(Oe=>Oe.map(Pe=>Pe.id===te.id?{...Pe,title:me}:Pe)),U.mutateAsync([te.id,me]).catch(()=>{Z(Oe=>Oe.map(Pe=>Pe.id===te.id?{...Pe,title:Ee}:Pe))})}async function Hf(te){var Ee;const me=((Ee=te.title)==null?void 0:Ee.trim())||Sd();if(window.confirm(Sme({title:na(me)}))){try{await H.mutateAsync(te.id)}catch(Oe){xn(Tme({title:na(me),error:Ce(Oe instanceof Error?Oe.message:String(Oe))}),"error");return}Ol(te.id)}}const ns=T.useCallback(te=>{if(!Y)return Promise.resolve(!1);const me=Y;return ht({type:"busy",sessionId:me,busy:!0}),kr(()=>uwn(me,te)).then(()=>!0).catch(()=>!1).finally(()=>{Un(Q.queryKey)&&(et.fetchQuery({...ol(me),staleTime:0}).catch(()=>{}),et.fetchQuery({...Fa(e),staleTime:0}).catch(()=>{}))})},[Y,e,kr,Q]),Nn=V.filter(te=>W$n(K,te.archived)),Ea=/Mac|iPhone|iPad/.test(navigator.platform),tp=Ea?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",Ya=Ea?"⌘ Enter":"Ctrl + Enter",yc=T.useCallback(()=>{ne("active"),y(null)},[y]),ys=T.useCallback(te=>{ne("all"),y(te)},[y]);T.useEffect(()=>{const te=me=>{me.repeat||me.key!=="Enter"||!me.metaKey&&!me.ctrlKey||me.altKey||!me.shiftKey||(me.preventDefault(),yc())};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[yc]);const Vi=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":tp,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:yc,children:[f.jsx(Ph,{size:15}),F4e()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx(DI,{size:15}),e2e()]}),pIn.map(te=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&te.activeTabs.includes(i)?"active":""}`,"data-onboarding":te.id==="compute"?"nav-compute":void 0,onClick:()=>a(te.id),children:[te.icon,te.label()]},te.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((Il=UH.find(te=>te.id===K))==null?void 0:Il.railLabel())??TD()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(Q$n,{value:K,onChange:ne})})]}),f.jsxs("div",{className:"rail-body",children:[Nn.map(te=>f.jsx(J$n,{session:te,active:te.id===Y&&i==="chat",unread:F.has(te.id),busy:Tt.busySessions.has(te.id),waiting:Nl.has(te.id),revealTitle:Pn.get(te.id),onOpen:()=>{if(y(te.id),e===Pp){DSn(te.id);const me=Dyn[te.id];me&&(pu({name:"demo_experiment_started",kind:"curated",experiment:me}),pu({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:me=>ep(te,me),onSetArchived:me=>Dl(te,me),onDelete:()=>void Hf(te)},te.id)),Nn.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:K==="archived"?K1e():V.length>0?M1e():eve()})]}),f.jsx(q$,{runtime:w})]}),Za="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 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",Ll=!r&&f.jsx(Pt,{title:NN(),"aria-label":NN(),onClick:s,children:f.jsx(KI,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&Vi,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:Ll}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:z})]})]}):f.jsxs(f.Fragment,{children:[r&&Vi,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[Ll,f.jsxs("div",{className:Za,children:[f.jsx(D0,{variant:"header",title:$n?((zs=$n.title)==null?void 0:zs.trim())||Sd():sN(),children:$n?f.jsx(GH,{title:((o_=$n.title)==null?void 0:o_.trim())||Sd(),animate:qi!==void 0},qi??"static"):sN()}),k&&f.jsx(Pt,{"data-tip":iN(),"aria-label":iN(),onClick:k,children:f.jsx(g5n,{size:15})})]})]}),pc?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:pc.message}),f.jsx(De,{onClick:()=>void mt.refetch(),children:ti()})]}):El?f.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:[f.jsx(jt,{}),f.jsx("span",{children:O4e()})]}):jl?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:In,tabIndex:0,role:"region","aria-label":((qf=$n==null?void 0:$n.title)==null?void 0:qf.trim())||Sd(),onScroll:te=>{Pf(te.currentTarget),pn.dismiss()},children:f.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:xr,children:[f.jsx(cH,{projectId:e,sessionId:Y,children:f.jsx(K$n,{scrollRef:In,scrollToEndRef:fr,stickToBottom:Fn,onPinToBottom:bs,messages:ir,allMessages:Vs,canFork:fc,onFork:a_,onSelectFork:Rl,busy:dr,onOpenFile:Bf,onOpenRun:c,onOpenSpawnedSession:ys,runExperimentName:u,onOpenExperiment:h,experimentName:_,onRespond:ns,onOpenPlan:hc,onOpenSubagent:Gi,recoveringTurnId:Wr,onRecover:i_,skills:dc},Y)}),dr&&sn&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:OCe()}),dr&&!sn&&!Yu&&!Sl&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:cEe()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx(TS,{})}),f.jsx("h2",{children:FCe()}),f.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-medium",children:[f.jsx(Lu,{size:19}),f.jsx("span",{children:n})]}),Zh&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:AR,"aria-hidden":"true",children:jR.map((te,me)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${y4[me].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${y4[me].icon}`,children:[f.jsx(te,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},me))}),f.jsxs(Kr,{className:"mt-3",role:"status",children:[f.jsx(jt,{}),f.jsx("span",{children:O6e()})]})]}),mc&&mc.length>0&&f.jsx("div",{className:AR,role:"group","aria-label":F6e(),children:mc.map((te,me)=>{const Ee=jR[me],Oe=y4[me];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Oe.box}`,onClick:()=>{pu({name:"project_starter_clicked",slot:me+1}),pu({name:"first_action",surface:Xa,action:"starter_click"}),Tl(te.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ee,{size:17,className:Oe.icon}),te.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:te.prompt})]},me)})})]}),pn.action&&f.jsxs(De,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:pn.action.x,top:pn.action.top,transform:"translateX(-50%)"},onMouseDown:te=>te.preventDefault(),onClick:pn.add,children:[f.jsx(VI,{size:14}),Hbe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_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:[jl&&f.jsx(Pt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${sr?"opacity-0":"opacity-100"}`,title:AN(),"aria-label":AN(),inert:sr,onClick:Jh,children:dr&&!sn?f.jsx(Lb,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(e5n,{size:16})}),ts&&!($f&&ts.promptId===$f.promptId)&&f.jsx(xLn,{synthesized:ts.synthesized,agentLabel:$n?mu[$n.harness]:tEe(),showResumeModes:($n==null?void 0:$n.harness)==="claude-code",onView:te=>hc==null?void 0:hc(ts.plan,ts.promptId,te),onApprove:te=>ns({promptId:ts.promptId,approve:!0,...te?{resumeMode:te}:{}}),onReject:()=>ns({promptId:ts.promptId,approve:!1}),onRevise:te=>{Y&&zl({sessionId:Y,promptId:ts.promptId}),ns({promptId:ts.promptId,approve:!1,note:te})}}),Ks.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Ks.map((te,me)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:te.error?`${te.text} +`),o=r?yD():s&&i!==null?T0e({code:Xt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[CD()," "]}),f.jsx(jf,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${uC} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function sv(e,n){var x,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:h,onOpenPlan:_,onOpenSubagent:p,predictTextTail:m=!1}=n,w=e.filter(C=>C.type!=="steer"&&kh(C,t)).at(-1),k=[];let v=[];const b=()=>{v.length!==0&&(k.push(f.jsx(T$n,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(kh(C,t)){if(C.type==="tool"&&(H$n(C.tool)||(((x=C.children)==null?void 0:x.length)??0)>0)){b(),k.push(f.jsx(U$n,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?k.push(f.jsx(Jo,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(w==null?void 0:w.id)},C.id)):C.type==="steer"?k.push(f.jsx("div",{dir:"auto",role:"note","aria-label":WCe(),className:"msg-steer my-2 ms-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&&k.push(f.jsx(R$n,{part:C,onRespond:h,onOpenFile:s,onOpenPlan:_},C.id))}return b(),k}function F$n(e){return gf(e).label}function H$n(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function qH(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function cb(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&cb(t.children,n);if(r)return r}return null}function q$n({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var w,k,v,b;const o=e.children??[],c=((w=e.state)==null?void 0:w.status)==="running",u=((k=e.state)==null?void 0:k.status)==="error",h=u?Dy(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",_=sv(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:c,pendingTailToolId:c?BB(o):null}),m=o.some(x=>x.type==="text"&&!!x.text)?"":qH(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),h&&f.jsx("div",{className:uC,children:h.slice(0,2e4)}),_.length===0&&!m&&!h?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:c?Kk():P1e()}):f.jsxs(f.Fragment,{children:[_,m&&f.jsx(Jo,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function U$n({part:e,pendingTail:n,onOpenSubagent:t}){var u,h,_,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=Dy(((h=e.state)==null?void 0:h.error)||((_=e.state)==null?void 0:_.output)||""),i=n&&!r?fC(gf(e)):gf(e),a=FH(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!qH(e),c=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[Vk()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(BI,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(ob,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${jH} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:c}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:Dve(),...Vr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[c,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ua,{size:12})})]})}function G$n(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const c of s){const u=`${i}/${c.id}`;c.type==="tool"&&((a=c.state)!=null&&a.status)&&n.set(u,{status:c.state.status,part:c}),(o=c.children)!=null&&o.length&&r(c.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function hC(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Zs(o,"reason","description")||PH(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function V$n(e){const[n,t]=T.useState({text:"",sequence:0}),r=T.useRef(null);return T.useEffect(()=>{var w,k,v,b,x;const s=((w=e[0])==null?void 0:w.id)??"",{messageId:i,states:a}=G$n(e),o=hC(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?KE({label:na(o.label)}):"",sequence:y.sequence+1}));return}const c=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,h=[...a].filter(([y,C])=>{var N;return((N=c.get(y))==null?void 0:N.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:KE({label:na(o.label)}),sequence:y.sequence+1}));return}const _=(k=h.find(([,y])=>Rm(y.part)))==null?void 0:k[1].part;if((_==null?void 0:_.id)==="turn-recovery"){const y=GB((b=(v=_.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${Gce()}${y?` ${y==="retry"?uce():rce()}`:""}`,sequence:C.sequence+1}));return}if((_==null?void 0:_.id)==="turn-retry"){t(y=>({text:Xoe(),sequence:y.sequence+1}));return}const p=h.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>gf(C.part).label).join(", ");t(C=>({text:p.length===1?Tce({labels:y}):$ce({count:Xt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=h.filter(([,y])=>y.status==="running");if(m.length>0){const y=(x=m.at(-1))==null?void 0:x[1].part;t(C=>({text:y?fC(gf(y)).label:gce(),sequence:C.sequence+1}));return}h.some(([,y])=>y.status==="completed")&&t(y=>({text:Sce(),sequence:y.sequence+1}))},[e]),n}const K$n=T.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:c,onSelectFork:u,busy:h,onOpenFile:_,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:w,onOpenExperiment:k,experimentName:v,onRespond:b,onOpenPlan:x,onOpenSubagent:y,recoveringTurnId:C,onRecover:N,skills:z}){var $,L,F;Vu();const A=(($=hC(n))==null?void 0:$.id)??null,j=T.useMemo(()=>n.filter(q=>M$n(q,A)),[n,A]),M=T.useMemo(()=>{const q=j.filter(K=>K.role==="user"&&!K.id.startsWith(Z_));return _En(a,n,q,K=>K.startsWith(Z_))},[n,j,a]),D=T.useRef(new Set),[I,B]=T.useState(!1),U=T.useCallback(q=>j[q].id,[j]),H=T.useCallback(q=>{if(I)return j.map((ne,ae)=>ae);const K=new Set(IB(q));return j.forEach((ne,ae)=>{D.current.has(ne.id)&&K.add(ae)}),[...K].sort((ne,ae)=>ne-ae)},[j,I]),Q=cEn({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:U,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var q;return Math.max(0,j.length*400-(((q=t.current)==null?void 0:q.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:H});T.useLayoutEffect(()=>{const q=()=>Q.scrollToEnd();return r.current=q,i(),()=>{r.current=null}},[Q,r,i]),T.useEffect(()=>{const q=()=>{var ae;const K=window.getSelection();if(!K||K.isCollapsed||!K.rangeCount)return;const ne=K.getRangeAt(0);for(const ue of((ae=t.current)==null?void 0:ae.querySelectorAll("[data-message-id]"))??[])ne.intersectsNode(ue)&&ue.dataset.messageId&&D.current.add(ue.dataset.messageId)};return document.addEventListener("selectionchange",q),()=>document.removeEventListener("selectionchange",q)},[t]);const V=j.at(-1),Z=V$n(n),Y=h?PB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:Z.text},Z.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":I,onClick:()=>B(q=>!q),children:d9e()}),f.jsx("div",{className:"relative",style:{height:Q.getTotalSize()},children:Q.getVirtualItems().map(q=>{var se,G,oe,ce,he,be;const K=j[q.index],ne=K.parts.find(Rm),ae=(G=(se=ne==null?void 0:ne.state)==null?void 0:se.input)==null?void 0:G.turnId,ue=ne?h||C!==null:!1;return f.jsx("div",{"data-index":q.index,"data-message-id":K.id,ref:Q.measureElement,className:"absolute left-0 w-full pb-4",style:{top:q.start},onClickCapture:Re=>{!(Re.target instanceof Element)||!Re.target.closest("[data-work-toggle]")||(s.current=!1,Q.setOptions({...Q.options,anchorTo:"start"}))},onPointerDownCapture:()=>D.current.add(K.id),onFocusCapture:()=>D.current.add(K.id),children:f.jsx(I$n,{message:K,forkCount:(oe=M.get(K.id))==null?void 0:oe.count,forkIndex:(ce=M.get(K.id))==null?void 0:ce.index,forkPrevId:(he=M.get(K.id))==null?void 0:he.prevId,forkNextId:(be=M.get(K.id))==null?void 0:be.nextId,forkDisabled:!o,branchDisabled:h,onFork:c,onSelectFork:u,activePermissionId:A,pendingTailToolId:(Y==null?void 0:Y.messageId)===K.id?Y.toolId:null,onOpenFile:_,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:w,onOpenExperiment:k,experimentName:v,onRespond:b,onOpenPlan:x,onOpenSubagent:y,busy:ue,recoveringTurnId:ae===C?C:null,onRecover:N,skills:z,predictTextTail:h&&K===V&&K.role==="assistant"})},K.id)})})]})}),W$n=(e,n)=>e==="all"?!0:e==="archived"?n:!n,UH=[{id:"active",label:cbe,railLabel:TD},{id:"archived",label:aN,railLabel:aN},{id:"all",label:pbe,railLabel:SD}];function Q$n({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=ga();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Pt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:vN(),"aria-label":vN(),onClick:()=>r(i=>!i),children:f.jsx(XI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:UH.map(i=>f.jsxs(Cn,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(gi,{size:13})]},i.id))})]})}const X$n=14,Y$n=500,Z$n=1200;function GH({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.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*X$n,Y$n)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function J$n({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:c,onDelete:u}){var N;const{open:h,setOpen:_,ref:p}=ga(),m=((N=e.title)==null?void 0:N.trim())||"Untitled",[w,k]=T.useState(!1),[v,b]=T.useState(""),x=T.useRef(null);function y(){var z;b(((z=e.title)==null?void 0:z.trim())||""),k(!0)}function C(){var A;const z=v.trim();k(!1),z&&z!==(((A=e.title)==null?void 0:A.trim())||"")&&o(z)}return T.useEffect(()=>{var z,A;w&&((z=x.current)==null||z.focus(),(A=x.current)==null||A.select())},[w]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.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]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.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-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]: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-dot]:hidden ${n?"active":""} ${t?"unread":""} ${h?"menu-open":""} ${w?"editing":""}`,title:`${mu[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?y9e():""}`,onClick:()=>{w||(h?_(!1):a())},onKeyDown:z=>{z.target===z.currentTarget&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),h?_(!1):a())},children:[e.parentSessionId&&!w&&f.jsx(kS,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),w?f.jsx("input",{ref:x,className:"session-title-input","aria-label":fSe(),value:v,onChange:z=>b(z.target.value),onClick:z=>z.stopPropagation(),onBlur:C,onKeyDown:z=>{z.stopPropagation(),z.key==="Enter"?(z.preventDefault(),C()):z.key==="Escape"&&(z.preventDefault(),k(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(GH,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:EN(),"aria-label":EN(),onClick:z=>{z.stopPropagation(),_(A=>!A)},children:f.jsx(Lb,{size:14})}),h&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(Cn,{onClick:z=>{z.stopPropagation(),_(!1),y()},children:f.jsx("span",{children:ND()})}),f.jsx(Cn,{onClick:z=>{z.stopPropagation(),_(!1),c(!e.archived)},children:f.jsx("span",{children:e.archived?OEe():Lpe()})}),f.jsx(Cn,{danger:!0,onClick:z=>{z.stopPropagation(),_(!1),u()},children:f.jsx("span",{children:ED()})})]})]})}const jR=[LI,QI,jf,yh],eBn=()=>[{title:BSe(),prompt:RSe()},{title:JSe(),prompt:VSe()},{title:d6e(),prompt:a6e()},{title:N6e(),prompt:y6e()}],y4=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],AR="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function tBn(e,n){if(!e)return null;const t=e.model??null;return{...e,model:t,serviceTier:Tv(n,t,e.serviceTier),reasoningLevel:eI(n,t,e.reasoningLevel)}}function nBn({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:c,runExperimentName:u,onOpenExperiment:h,experimentName:_,onOpenPlan:p,onOpenSubagent:m,runtime:w,onOpenDemoWelcome:k,composerFocusNonce:v=0,demoRunningRunId:b=null,activeSessionId:x,onActiveSessionChange:y,preferredAgent:C,onPreferredAgentChange:N,children:z}){var xc,Eo,Ds,Il,zs,o_,qf;const A=dn({mutationFn:te=>J2n(...te)}),j=dn({mutationFn:te=>Y2n(...te)}),M=dn({mutationFn:te=>Z2n(...te)}),D=dn({mutationFn:te=>G2n(...te)}),I=dn({mutationFn:te=>K2n(...te)}),B=dn({mutationFn:te=>Q2n(...te)}),U=dn({mutationFn:te=>X2n(...te)}),H=dn({mutationFn:W2n}),Q=T.useMemo(()=>Fa(e),[e]),{data:V=c$n}=ut(Q),Z=T.useCallback(te=>{is(Q.queryKey,me=>{if(!me)return;const Ee=typeof te=="function"?te(me):te,Oe=new Map(me.map(Pe=>[Pe.id,Pe]));for(const Pe of Ee)Oe.get(Pe.id)!==Pe&&ao(et,Q.queryKey,Pe.id),Oe.delete(Pe.id);for(const Pe of Oe.keys())ao(et,Q.queryKey,Pe);return Ee})},[Q]),Y=x,$=T.useRef(y);$.current=y;const L=T.useRef({projectId:e});L.current.projectId!==e&&(L.current={projectId:e});const[F,q]=T.useState(new Set),[K,ne]=T.useState("active"),[ae,ue]=T.useState(""),[se,G]=T.useState(!1),[oe,ce]=T.useState(!1),[he,be]=T.useState([]),Re=T.useRef(0),Le=T.useRef({projectId:e,activeId:Y,mainView:i});(Le.current.projectId!==e||Le.current.activeId!==Y||Le.current.mainView!==i)&&(Le.current={projectId:e,activeId:Y,mainView:i});const[Ke,Ne]=T.useState([]),[xe,rt]=T.useState(null),Ze=Y??"new",ot=T.useRef(new Map),kt=T.useRef(kw);kt.current={draft:ae,attachments:Ke,annotations:he};const qt=e===Pp&&V.length>0&&V.every(te=>Lyn[te.id]===te.activeLeafId)?qz:null,dt=T.useRef(null);qt!==null&&dt.current===null&&Y!==null&&(dt.current=Ze);const pt=Ze===dt.current?qt:null;T.useLayoutEffect(()=>{const te=ot.current.get(Ze)??kw;return kt.current=te,ue(te.draft),Ne(te.attachments),be(te.annotations),()=>{const me=wEn(kt.current,pt);me?ot.current.set(Ze,me):ot.current.delete(Ze)}},[Ze,pt]);const[Ie,pe]=T.useState(null),je=T.useRef(Promise.resolve()),He=T.useRef(0),st=T.useRef(0),[_t,Ct]=T.useState(null),bt=T.useRef(null),Yt=T.useRef(!1),un=T.useRef(null),[Tt,ht,mt]=Pwn(e,i==="chat"?Y:null),{data:_n=sBn}=ut(Du()),[gs,br]=T.useState(C);T.useEffect(()=>br(C),[C]);const[Gt,Bn]=T.useState({}),[_r,yr]=T.useState(Yp),[Wr,Nt]=T.useState(null),vn=T.useRef(!1),fn=T.useRef(null),[hn,Ir]=T.useState(null),bn=T.useRef(!1),yn=T.useRef(null),[Pn,Et]=T.useState(new Map),Bt=T.useRef(new Map),In=T.useRef(null),xr=T.useRef(null),fr=T.useRef(null),Fn=T.useRef(!0),[sr,Qr]=T.useState(!0),On=T.useRef(null),[We,yt]=T.useState(!1),Jn=ga(),pr=T.useCallback(te=>{var me;Re.current+=1,be(Ee=>[...Ee,{id:`annotation-${Re.current}`,...te}]),(me=On.current)==null||me.focus()},[]),pn=e$n(xr,pr);t$n(he),T.useEffect(()=>{yt(!1),pn.dismiss()},[Y,e,pn.dismiss]);const[Tr,An]=T.useState(0),[ii,wr]=T.useState(!1),[er,Va]=T.useState(0),[_c,$r]=T.useState(0),ai=T.useRef(!1);function xo(te){if(!Yr)return;if(!Ci&&te.source==="command"&&Oy(te.name)&&te.name!=="goal"){ci(te.name,ae,Yr);return}const me=te.source==="command"?1:W5(te.name,On.current),Ee=wIn(ae,Yr,te.name,me);ue(Ee.text),window.requestAnimationFrame(()=>{var Oe,Pe;(Oe=On.current)==null||Oe.focus(),(Pe=On.current)==null||Pe.setSelectionRange(Ee.cursor,Ee.cursor),$r(Ee.cursor)})}function Ka(te){if(wi)return!1;const me=te.selectionStart;if(ai.current||me!==te.selectionEnd)return!1;const Ee=ae.slice(0,me).replace(/[ \t]+$/,"").length,Oe=_4(ae,Ee);if(!Oe||Oe.end!==Ee||!Ju(Oe.query)||me>Ee&&me-Ee!==W5(Oe.query,te))return!1;const Pe=vR(ae,{...Oe,end:me});return ue(Pe.text),$r(Pe.cursor),window.requestAnimationFrame(()=>te.setSelectionRange(Pe.cursor,Pe.cursor)),!0}function Pi(te){rt(null);let Oe=Ke.reduce((Pe,Jt)=>Pe+Jt.size,0);for(const Pe of te){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Pe.type))continue;if(Pe.size>31457280){rt(u0e({name:Ce(Pe.name)}));continue}if(Oe+Pe.size>41943040){rt(g0e());continue}Oe+=Pe.size;const Jt=Y,mn=new FileReader;mn.onload=()=>{const Dn={dataUrl:mn.result,mediaType:Pe.type,name:Pe.name,size:Pe.size};if(Le.current.activeId===Jt){Ne(Sr=>[...Sr,Dn]);return}const rn=ot.current.get(Jt??"new")??kw;ot.current.set(Jt??"new",{...rn,attachments:[...rn.attachments,Dn]})},mn.readAsDataURL(Pe)}}function xl(te){const me=Array.from(te.clipboardData.items).filter(Ee=>Ee.kind==="file"&&(Ee.type.startsWith("image/")||Ee.type==="application/pdf")).map(Ee=>Ee.getAsFile()).filter(Ee=>Ee!==null);me.length>0&&(te.preventDefault(),Pi(me))}const Lt=V.find(te=>te.id===Y),Rs=gs??w6n(_n),Br=Lt?{harness:Lt.harness,model:Gt.model!==void 0?Gt.model:Lt.model,serviceTier:Gt.serviceTier!==void 0?Gt.serviceTier:Lt.serviceTier,permissionMode:Gt.permissionMode??Lt.permissionMode,reasoningLevel:Gt.reasoningLevel??Lt.reasoningLevel}:Rs?{...Rs,...Gt}:null,{data:Xr=rBn}=ut(Awn(Br==null?void 0:Br.harness)),ct=Br?_n.find(te=>te.id===Br.harness):void 0,Wt=ct==null?void 0:ct.options,xi=T.useMemo(()=>kIn(Xr,Wt==null?void 0:Wt.planActivation),[Xr,Wt==null?void 0:Wt.planActivation]),Fi=yR(ae),Hi=Fi!==null,Yr=_4(ae,_c),Rr=(Yr==null?void 0:Yr.query)??null,wo=Rr===null?[]:xi.filter(te=>yIn(te,Rr)),wi=!Hi&&Rr!==null&&(Yr==null?void 0:Yr.end)===_c&&wo.length>0,Hs=wi&&!ii?wo:[],oi=Hs.length>0,Zr=Math.min(Tr,Math.max(0,Hs.length-1));T.useEffect(()=>An(0),[Rr]);const Zt=tBn(Br,ct),Ms=Ob(ct,Zt==null?void 0:Zt.model),ya=te=>{if(!Zt)return;const me={...Zt,...te},Ee={};te.model!==void 0&&te.model!==Zt.model&&(Ee.model=te.model),te.serviceTier!==void 0&&te.serviceTier!==Zt.serviceTier&&(Ee.serviceTier=te.serviceTier),te.permissionMode!==void 0&&te.permissionMode!==Zt.permissionMode&&(Ee.permissionMode=te.permissionMode),te.reasoningLevel!==void 0&&te.reasoningLevel!==Zt.reasoningLevel&&(Ee.reasoningLevel=te.reasoningLevel),yr(Oe=>({...Oe,...Ee})),br(me),N(me).catch(()=>{}),Lt?Bn(Oe=>({...Oe,...te})):te.harness&&te.harness!==Zt.harness&&Bn({})},kr=T.useCallback(te=>{const me=je.current.catch(()=>{}).then(()=>{if(!Un(Q.queryKey))throw new DOMException("Workspace changed","AbortError");return te()});return je.current=me.then(()=>{},()=>{}),me},[Q]),Wa=te=>{if(te==="plan"&&(ct==null?void 0:ct.id)==="claude-code"?(yr(Oe=>({...Oe,permissionMode:te})),Bn(Oe=>({...Oe,permissionMode:te}))):(Bn(Oe=>{const Pe={...Oe};return delete Pe.permissionMode,Pe}),ya({permissionMode:te})),!Lt)return;const me=Lt.id,Ee=++He.current;pe(null),kr(()=>A.mutateAsync([me,te])).then(Oe=>{Z(Pe=>Pe.map(Jt=>Jt.id===Oe.id?Oe:Jt)),He.current===Ee&&Bn(Pe=>{const Jt={...Pe};return delete Jt.permissionMode,Jt})}).catch(()=>{He.current===Ee&&(Bn(Oe=>{const Pe={...Oe};return delete Pe.permissionMode,Pe}),pe(KEe()))})},Jr=te=>ya({reasoningLevel:te}),qs=((xc=Lt==null?void 0:Lt.goal)==null?void 0:xc.trim())||"",Us=(Zt==null?void 0:Zt.harness)==="claude-code"?Zt.permissionMode==="plan":(Wt==null?void 0:Wt.planActivation)==="command"?_t??(Lt==null?void 0:Lt.planMode)??!1:!1;T.useEffect(()=>{_t===null||(Lt==null?void 0:Lt.planMode)!==_t||(bt.current=null,Ct(null))},[Lt==null?void 0:Lt.planMode,_t]);async function es(te){if(yr(Oe=>({...Oe,planMode:te})),bt.current=te,Ct(te),!Lt)return;const me=Lt.id,Ee=++st.current;pe(null);try{const Oe=await kr(()=>j.mutateAsync([me,te]));Z(Pe=>Pe.map(Jt=>Jt.id===Oe.id?Oe:Jt)),st.current===Ee&&(bt.current=null,Ct(null),pe(null))}catch(Oe){throw st.current===Ee&&(bt.current=null,Ct(null)),Oe}}async function Gs(){if((Zt==null?void 0:Zt.harness)==="claude-code"){Wa("auto");return}if(Lt)try{await es(!1)}catch{pe($me())}}async function wl(){const te=!Us;try{if((Zt==null?void 0:Zt.harness)==="claude-code")Wa(te?"plan":"auto");else if((Wt==null?void 0:Wt.planActivation)==="command")await es(te);else throw new Error(Xg())}catch{pe(TN())}}function kl(te,me=""){var Ee;switch(te){case"plan":return wl(),!1;case"new":return yc(),!1;case"resume":return yt(!0),!0;case"model":return Va(Oe=>Oe+1),!0;case"compact":return If(),!1;case"goal":return Qa(me),!1;case"copy":{const Oe=ir.at(-1),Pe=dr&&(Oe==null?void 0:Oe.role)==="assistant"&&!Oe.completedAt,Jt=mEn(Pe?ir.slice(0,-1):ir);return Jt?dC(Jt):xn(hve(),"info"),!1}case"export":{const Oe=((Ee=Lt==null?void 0:Lt.title)==null?void 0:Ee.trim())||Sd(),Pe=Lt?gEn(Oe,ir,{user:ige(),assistant:mu[Lt.harness]}):null;return Pe?D$n(vEn(Oe),Pe):xn(xve(),"info"),!1}}}async function xa(te){pe(null);const me=L.current;try{const Ee=await D.mutateAsync([e,te]);if(et.invalidateQueries({queryKey:iI().queryKey}),L.current!==me)return;Z(Oe=>[Ee,...Oe.filter(Pe=>Pe.id!==Ee.id)]),ne("all"),y(Ee.id,{projectId:Ee.projectId})}catch(Ee){if(L.current!==me)return;pe(Jge({error:Ce(Ee instanceof Error?Ee.message:String(Ee))}))}}async function Qa(te){var mn;const me=te.trim();if(!me){const Dn=(mn=Lt==null?void 0:Lt.goal)==null?void 0:mn.trim();xn(Dn?bge({goal:na(Dn)}):Rge(),"info");return}const Ee=Le.current,Oe=()=>Le.current.activeId===Ee.activeId;pe(null);let Pe=Y;if(!Pe){if(!(ct!=null&&ct.agentReady)||!Zt){pe(Xg());return}try{Pe=(await vc(Zt,d4(Wt==null?void 0:Wt.planActivation,void 0,bt.current))).id}catch(Dn){pe(rN({error:Ce(Dn instanceof Error?Dn.message:String(Dn))}));return}}const Jt=/^(clear|none|off)$/i.test(me);try{const Dn=await kr(()=>M.mutateAsync([Pe,Jt?null:me]));Z(rn=>rn.map(Sr=>Sr.id===Dn.id?Dn:Sr)),xn(Jt?fge():Bge(),"success")}catch(Dn){if(!Oe())return;pe(rN({error:Ce(Dn instanceof Error?Dn.message:String(Dn))}))}}async function If(){const te=Y;if(!te){xn(ove(),"info");return}if(dr){pe(Y0e());return}pe(null),K==="archived"&&ne("active");const me=Le.current;try{const{message:Ee}=await swn(te);ht({type:"upsertMessage",sessionId:te,message:Ee})}catch(Ee){if(Le.current.activeId!==me.activeId)return;pe(sme({error:Ce(Ee instanceof Error?Ee.message:String(Ee))}))}}function ci(te,me,Ee){const Oe=vR(me,Ee);ue(Oe.text),wr(!0),!kl(te)&&window.requestAnimationFrame(()=>{var Pe,Jt;(Pe=On.current)==null||Pe.focus(),(Jt=On.current)==null||Jt.setSelectionRange(Oe.cursor,Oe.cursor),$r(Oe.cursor)})}const wa=T.useCallback(async(te=!1)=>{const me=L.current;if(me.projectId!==e||!Un(Q.queryKey))return null;const Ee=(et.getQueryData(Q.queryKey)??[]).map(Oe=>Oe.id);try{const Oe=await et.fetchQuery({...Q,...te?{staleTime:0}:{}});if(L.current!==me||!Un(Q.queryKey))return null;const Pe=Oe.filter(mn=>!_l.has(mn.id)),Jt=new Set(Pe.map(mn=>mn.id));for(const mn of Ee)Jt.has(mn)||Ol(mn);return Bt.current=new Map(Pe.map(mn=>[mn.id,mn.title])),Pe}catch{return null}},[e]),Os=T.useCallback(async te=>{L.current.projectId!==e||!Un(Q.queryKey)||await Promise.all([et.fetchQuery({...ol(te),staleTime:0}),wa(!0)]).catch(()=>{})},[e,wa]);T.useEffect(()=>{const te=l$();q(e===Pp?new Set([Tb,Rb].filter(Ee=>!te.has(Ee))):new Set),G(!1),ce(!1),Et(new Map),Bt.current=new Map,wa();const me=L.current;return()=>{L.current===me&&(L.current={projectId:e})}},[e,wa]),T.useEffect(()=>{yr(Yp),yn.current=null},[Y]),T.useEffect(()=>Mv(te=>{switch(te.type){case"session":{if(te.session.projectId!==e||_l.has(te.session.id))return;const me=Bt.current.has(te.session.id),Ee=Bt.current.get(te.session.id)!==te.session.title;Bt.current.set(te.session.id,te.session.title),me&&Ee&&te.session.titleSource==="generated"&&(Et(Oe=>{const Pe=new Map(Oe);return Pe.set(te.session.id,(Oe.get(te.session.id)??0)+1),Pe}),window.setTimeout(()=>{Et(Oe=>{if(!Oe.has(te.session.id))return Oe;const Pe=new Map(Oe);return Pe.delete(te.session.id),Pe})},Z$n));break}case"sessionDeleted":Ol(te.sessionId);break}}),[e]),T.useEffect(()=>Mv(te=>{te.type==="reconnected"&&wa(!0)}),[wa]);const Vs=Y?Tt.messagesBySession[Y]??CR:CR,ko=Y?Tt.activeLeafBySession[Y]??null:null;fn.current=ko;const ir=T.useMemo(()=>lEn(Vs,ko),[Vs,ko]),ki=T.useRef({projectId:e,ids:Tt.busySessions});T.useEffect(()=>{const te=ki.current;ki.current={projectId:e,ids:Tt.busySessions},te.projectId===e&&q(me=>pEn(me,te.ids,Tt.busySessions,V,i==="chat"?Y:null))},[e,Tt.busySessions,V,Y,i]);const dr=Y?Tt.busySessions.has(Y):!1,fc=!dr&&!!(ct!=null&&ct.agentReady),Yu=dr&&PB(ir)!=null,Sl=dr&&hEn(ir),Ks=Y?Tt.queuedBySession[Y]??[]:[],Zu=Ks.some(te=>te.dispatchState==="retrying"),vs=Ks.findIndex(te=>te.dispatchState==="blocked"),Si=Ks.reduce((te,me)=>me.dispatchState!=="retrying"||typeof me.nextRetryAt!="number"?te:te===null?me.nextRetryAt:Math.min(te,me.nextRetryAt),null),[Cl,ka]=T.useState(()=>Date.now());T.useEffect(()=>{if(!Zu||Si===null||(ka(Date.now()),Si<=Date.now()))return;const te=window.setInterval(()=>{const me=Date.now();ka(me),me>=Si&&window.clearInterval(te)},1e3);return()=>window.clearInterval(te)},[Zu,Si]),T.useEffect(()=>{const te=Ks.reduce((me,Ee)=>Ee.planMode??me,void 0);te!==void 0?(Yt.current=!0,bt.current=te,Ct(te)):Yt.current&&(Yt.current=!1,bt.current=null,Ct(null))},[Ks]);const El=!!Y&&!(Y in Tt.messagesBySession)&&mt.isPending,Nl=T.useMemo(()=>{const te=new Set;for(const me of Tt.busySessions)(Tt.messagesBySession[me]??[]).some(Ee=>Ee.parts.some(Oe=>Oe.type==="prompt"&&Oe.prompt&&!Oe.prompt.resolved&&Oe.prompt.nativeId))&&te.add(me);return te},[Tt.busySessions,Tt.messagesBySession]),sn=Y?Nl.has(Y):!1,$n=Lt,qi=$n?Pn.get($n.id):void 0,ts=T.useMemo(()=>{var te;for(let me=ir.length-1;me>=0;me--)for(const Ee of ir[me].parts)if(Ee.type==="prompt"&&((te=Ee.prompt)==null?void 0:te.kind)==="plan"&&!Ee.prompt.resolved)return{promptId:Ee.id,plan:Ee.prompt.plan??"",synthesized:!!Ee.prompt.synthesized};return null},[ir]),Ci=T.useMemo(()=>Y?fEn(ir,$n==null?void 0:$n.harness,Tt.busySessions.has(Y)):null,[ir,$n==null?void 0:$n.harness,Y,Tt.busySessions]),Ui=Hi&&!Ci,Ju=te=>{if(Ci||Hi)return!1;const me=K5(te),Ee=xi.find(Oe=>Oe.name===(me??te));return!Ee||Ee.source!=="command"?!!Ee:me&&f4(me)?me==="plan"||ae.trim().toLowerCase().startsWith(`/${te}`):ae.trim().toLowerCase()===`/${te}`},dc=T.useMemo(()=>xi.filter(te=>te.source!=="command"),[xi]),[Sa,zl]=T.useState(null),$f=Sa&&Sa.sessionId===Y?Sa:null;T.useEffect(()=>{if(!Sa)return;const te=Tt.busySessions.has(Sa.sessionId),me=Sa.sessionId===Y&&ts&&ts.promptId!==Sa.promptId;(!te||me)&&zl(null)},[Sa,ts,Tt.busySessions,Y]);const Yh=T.useMemo(()=>hC(ir),[ir]),So=dr&&!!(ct!=null&&ct.supportsSteering)&&!!(ct!=null&&ct.agentReady)&&!ts&&!Ci&&!Yh&&Ke.length===0&&he.length===0,hc=T.useMemo(()=>p&&Y?(te,me,Ee)=>p(te,Y,me,Ee):void 0,[p,Y]),Gi=T.useMemo(()=>m&&Y?(te,me,Ee)=>m(Y,te,me,Ee):void 0,[m,Y]),Bf=T.useMemo(()=>o&&((te,me,Ee,Oe,Pe)=>o(te,Y??void 0,me,Ee,Oe,Pe)),[o,Y]);T.useEffect(()=>{He.current+=1,st.current+=1;const te=(Y?Tt.queuedBySession[Y]??[]:[]).reduce((me,Ee)=>Ee.planMode??me,void 0);Yt.current=te!==void 0,bt.current=te??null,Ct(te??null),Bn({}),pe(null)},[Y]);const jl=i==="chat"&&(ir.length>0||dr),Ca=(Zt==null?void 0:Zt.harness)??null,e_=(Zt==null?void 0:Zt.model)??null,pc=mt.data?null:mt.error,t_=i==="chat"&&!jl&&!El&&!pc,Al=ut({...s4n(e,Ca??"claude-code",e_,E()),enabled:t_&&Ca!==null,subscribed:t_&&Ca!==null}),mc=(Eo=Al.data)!=null&&Eo.blank?eBn():((Ds=Al.data)==null?void 0:Ds.prompts)??null,Zh=Ca!==null&&Al.isPending,Xa=e===Pp?"demo":"project",Tl=te=>{ue(te),wr(!1),window.requestAnimationFrame(()=>{const me=On.current;me&&(me.focus(),me.setSelectionRange(te.length,te.length),$r(te.length))})};T.useEffect(()=>{pt&&(ue(te=>te||pt),wr(!1),$r(pt.length))},[pt]),T.useEffect(()=>{if(v===0)return;const te=window.requestAnimationFrame(()=>{const me=On.current;me&&(me.focus(),me.setSelectionRange(me.value.length,me.value.length),me.scrollIntoView({block:"nearest"}))});return()=>window.cancelAnimationFrame(te)},[v]);const gc=T.useId(),n_=e===Pp&&ae===qz&&!se,Pf=T.useCallback(te=>{const me=te.scrollHeight-te.scrollTop-te.clientHeight<60;Fn.current=me,Qr(me)},[]),bs=T.useCallback(()=>{var te;Fn.current=!0,Qr(!0),(te=fr.current)==null||te.call(fr)},[]);T.useEffect(()=>{const te=In.current,me=xr.current;if(!te||!me)return;const Ee=new ResizeObserver(()=>{var Oe;Fn.current?(Oe=fr.current)==null||Oe.call(fr):Qr(te.scrollHeight-te.scrollTop-te.clientHeight<60)});return Ee.observe(te),Ee.observe(me),()=>Ee.disconnect()},[jl]);const Jh=T.useCallback(te=>{te.currentTarget.blur(),bs()},[bs]);async function Ff({queue:te=!1}={}){var $l,Ja,wc,No,Ei,c_;const me=ae.trim(),Ee=Ci?null:SIn(me,Wt==null?void 0:Wt.planActivation);if(Ee&&Ee.name!=="plan"){ue(f4(Ee.name)?"":Ee.prompt),wr(!1),kl(Ee.name,Ee.prompt);return}if(pu({name:"first_action",surface:Xa,action:"typed_prompt"}),bn.current)return;const Oe=!!Ee,Pe=!Us,Jt=d4(Wt==null?void 0:Wt.planActivation,Oe?Pe:void 0,bt.current),mn=Oe&&(ct==null?void 0:ct.id)==="claude-code"?Pe?"plan":"auto":void 0,Dn=Ee?Ee.prompt:me,rn=Ke,Sr=he,J=Sr.map(on=>({text:on.text})),ge=e,Ae=i;let $e=Y;const Te=()=>{const on=Le.current;return Un(Q.queryKey)&&on.projectId===ge&&on.activeId===$e&&on.mainView===Ae},at=()=>{Te()&&(ue(on=>on||me),Ne(on=>on.length?on:rn),be(on=>on.length?on:Sr))};if(Oe&&!Dn&&rn.length===0&&Sr.length===0){ue(""),wr(!1);try{if((ct==null?void 0:ct.id)==="claude-code")Wa(Pe?"plan":"auto");else if((Wt==null?void 0:Wt.planActivation)==="command")await es(Pe);else throw new Error(Xg())}catch{pe(TN()),at()}return}const Je=Zt?{...Zt,...mn?{permissionMode:mn}:{}}:null;mn&&Wa(mn);let Mt=null;const Xn=bt.current;Oe&&(Wt==null?void 0:Wt.planActivation)==="command"&&(Mt=++st.current,bt.current=Pe,Ct(Pe));const as=()=>{!Te()||Mt===null||st.current!==Mt||(bt.current=Xn,Ct(Xn))};if(!Dn&&rn.length===0&&Sr.length===0)return;if((Dn||Sr.length>0)&&Ci&&rn.length===0){ue(""),be([]),ns({promptId:Ci,answers:[],note:Dn||void 0,annotations:J}).then(on=>{on||at()});return}const Ls=JSON.stringify({text:Dn,images:rn.map(on=>({mediaType:on.mediaType,name:on.name,dataUrl:on.dataUrl})),annotations:J,settings:Je?{model:Je.model,serviceTier:Je.serviceTier,permissionMode:Je.permissionMode,planMode:Jt,reasoningLevel:Je.reasoningLevel}:null}),js=(($l=yn.current)==null?void 0:$l.signature)===Ls?yn.current.id:`ct_${crypto.randomUUID()}`;if(yn.current={signature:Ls,id:js},dr){if(!Y||!(ct!=null&&ct.agentReady)){as();return}const on=Y;ue(""),Ne([]),be([]),rt(null);const Ni=Je?{model:Je.model,serviceTier:Je.serviceTier,permissionMode:Je.permissionMode,planMode:(Wt==null?void 0:Wt.planActivation)==="command"?Jt??(Lt==null?void 0:Lt.planMode):Jt,reasoningLevel:Je.reasoningLevel}:{};Te()&&Bn({});const eo=rn.map(Pr=>({mediaType:Pr.mediaType,dataBase64:Pr.dataUrl.slice(Pr.dataUrl.indexOf(",")+1),name:Pr.name}));try{(Ja=(await kr(()=>Uz(on,Dn,Ni,eo.length?eo:void 0,J,js,So&&!te&&!Oe?"steer":void 0))).turn)!=null&&Ja.existing&&await Os(on),Te()&&yr(Yp),((wc=yn.current)==null?void 0:wc.id)===js&&(yn.current=null)}catch{as(),at()}return}if(!(ct!=null&&ct.agentReady)){as();return}if(!Je){as();return}let os=Y;try{ue(hr=>hr===ae?"":hr),Ne(hr=>hr===rn?[]:hr),be(hr=>hr===Sr?[]:hr),rt(null),bn.current=!0;try{if(!os){const zo=await vc(Je,Jt);os=zo.id,$e=zo.id}if(!Un(Q.queryKey))return;const hr=ol(os);await et.fetchQuery({...hr,...((No=et.getQueryState(hr.queryKey))==null?void 0:No.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{bn.current=!1}if(!Un(Q.queryKey))return;ht({type:"optimisticUser",sessionId:os,text:Dn||Xpe(),attachments:rn.map(hr=>({url:hr.dataUrl,mediaType:hr.mediaType,name:hr.name})),annotations:Sr}),ht({type:"busy",sessionId:os,busy:!0}),Te()&&bs(),Te()&&K==="archived"&&ne("active");const on=Je?{model:Je.model,serviceTier:Je.serviceTier,permissionMode:Je.permissionMode,planMode:Jt,reasoningLevel:Je.reasoningLevel}:{};Te()&&Bn({});const Ni=rn.map(hr=>({mediaType:hr.mediaType,dataBase64:hr.dataUrl.slice(hr.dataUrl.indexOf(",")+1),name:hr.name})),eo=os;if(!eo)throw new Error(a9e());(Ei=(await kr(()=>Uz(eo,Dn,on,Ni.length?Ni:void 0,J,js))).turn)!=null&&Ei.existing&&await Os(eo),Te()&&yr(Yp),((c_=yn.current)==null?void 0:c_.id)===js&&(yn.current=null)}catch(on){if(!Un(Q.queryKey)||(at(),as(),!os))return;const Ni=on instanceof Error?on.message:String(on);if(!/session is busy/i.test(Ni)&&await et.fetchQuery({...Fa(e),staleTime:0}).then(Pr=>{var kc;return!!((kc=Pr.find(hr=>hr.id===os))!=null&&kc.busy)}).catch(()=>!1)){Te()&&(ue(Pr=>Pr===Dn?"":Pr),Ne(Pr=>Pr===rn?[]:Pr),be(Pr=>Pr===Sr?[]:Pr));return}ht({type:"busy",sessionId:os,busy:!1}),ht({type:"localError",sessionId:os,text:d1e({error:Ce(Ni)})})}}async function vc(te,me){const Ee=Le.current,Oe=L.current,Pe=await I.mutateAsync([e,te.harness,{model:te.model,serviceTier:te.serviceTier,permissionMode:te.permissionMode,planMode:me,reasoningLevel:te.reasoningLevel}]);return L.current===Oe&&(Z(Jt=>[Pe,...Jt.filter(mn=>mn.id!==Pe.id)]),et.getQueryData(Q.queryKey)||wa(!0)),L.current===Oe&&Le.current===Ee&&($.current(Pe.id,{replace:!0}),Le.current={...Ee,activeId:Pe.id}),Pe}function bc(){const te=IIn(ae);ue(te),window.requestAnimationFrame(()=>{var me,Ee;(me=On.current)==null||me.focus(),(Ee=On.current)==null||Ee.setSelectionRange(te.length,te.length),$r(te.length)})}async function r_(){const te=Fi;if(!te)return;if(pe(null),dr){pe(S0e());return}const me=ae,Ee=Le.current;let Oe=Y;const Pe=()=>{const rn=Le.current;return rn.projectId===Ee.projectId&&rn.activeId===Oe&&rn.mainView===Ee.mainView},Jt=()=>{Pe()&&ue(rn=>rn||me)};ue(""),wr(!1);let mn=Y;if(!mn){if(!(ct!=null&&ct.agentReady)||!Zt){Jt(),pe(Xg());return}try{const rn=d4(Wt==null?void 0:Wt.planActivation,void 0,bt.current);mn=(await vc(Zt,rn)).id,Oe=mn,Pe()&&Bn({})}catch(rn){Jt();const Sr=rn instanceof Error?rn.message:String(rn);Pe()&&pe(tN({error:Ce(Sr)}));return}}Pe()&&K==="archived"&&ne("active");const Dn=`${Z_}shell-${Date.now()}`;ht({type:"localShell",sessionId:mn,id:Dn,command:te}),Pe()&&bs();try{const{message:rn}=await iwn(mn,te);ht({type:"upsertMessage",sessionId:mn,message:rn})}catch(rn){const Sr=rn instanceof Error?rn.message:String(rn);ht({type:"localShell",sessionId:mn,id:Dn,command:te,error:tN({error:Ce(Sr)})})}}function s_(){Y&&lwn(Y).catch(()=>{pe(F9e())})}const i_=T.useCallback(async(te,me)=>{if(!(!Y||vn.current)){vn.current=!0,pe(null),Nt(te);try{const Ee=xEn({model:_r.model,serviceTier:_r.serviceTier,permissionMode:_r.permissionMode,planMode:_r.planMode,reasoningLevel:_r.reasoningLevel}),Oe=Y;(await awn(Oe,te,me,Ee)).turn.existing&&await Os(Oe),yr(Yp)}catch{pe(J7e())}finally{vn.current=!1,Nt(null)}}},[Y,_r,Os]),a_=T.useCallback((te,me)=>{if(!Y||dr||!(ct!=null&&ct.agentReady))return;const Ee=Y;ht({type:"busy",sessionId:Ee,busy:!0}),bs(),kr(()=>own(Ee,te,me)).catch(Oe=>{ht({type:"busy",sessionId:Ee,busy:!1});const Pe=Oe instanceof Error?Oe.message:String(Oe);ht({type:"localError",sessionId:Ee,text:d8e({error:Ce(Pe)})})})},[Y,dr,ct==null?void 0:ct.agentReady,bs,kr]),Rl=T.useCallback(te=>{if(!Y||dr)return;const me=Y,Ee=fn.current;ht({type:"activeLeaf",sessionId:me,leafId:te}),kr(()=>cwn(me,te)).catch(Oe=>{ht({type:"activeLeaf",sessionId:me,leafId:Ee});const Pe=Oe instanceof Error?Oe.message:String(Oe);ht({type:"localError",sessionId:me,text:W9e({error:Ce(Pe)})})})},[Y,dr,kr]);function Ml(te){if(!Y)return;const me=Y;twn(me,te).then(({removed:Ee})=>{if(Ee)return Os(me)}).catch(()=>pe(a8e()))}async function Co(te){if(!Y||hn)return;const me=Y;pe(null),Ir(te);try{await nwn(me,te),await Os(me)}catch{pe(N8e())}finally{Ir(null)}}T.useEffect(()=>{if(!dr||i!=="chat")return;function te(me){var Ee;me.key!=="Escape"||me.defaultPrevented||(me.preventDefault(),s_(),(Ee=On.current)==null||Ee.focus())}return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[dr,Y,i]);function Ol(te){jb(te),ot.current.delete(te),dt.current===te&&(dt.current=null),Le.current.projectId===e&&Le.current.activeId===te&&Le.current.mainView==="chat"&&(ue(""),Ne([]),be([]),$.current(null,{replace:!0})),q(me=>{if(!me.has(te))return me;const Ee=new Set(me);return Ee.delete(te),Ee}),Bt.current.delete(te)}function Dl(te,me){const Ee=te.archived;Z(Oe=>Oe.map(Pe=>Pe.id===te.id?{...Pe,archived:me}:Pe)),B.mutateAsync([te.id,me]).catch(()=>{Z(Oe=>Oe.map(Pe=>Pe.id===te.id?{...Pe,archived:Ee}:Pe))})}function ep(te,me){const Ee=te.title;Z(Oe=>Oe.map(Pe=>Pe.id===te.id?{...Pe,title:me}:Pe)),U.mutateAsync([te.id,me]).catch(()=>{Z(Oe=>Oe.map(Pe=>Pe.id===te.id?{...Pe,title:Ee}:Pe))})}async function Hf(te){var Ee;const me=((Ee=te.title)==null?void 0:Ee.trim())||Sd();if(window.confirm(Sme({title:na(me)}))){try{await H.mutateAsync(te.id)}catch(Oe){xn(Tme({title:na(me),error:Ce(Oe instanceof Error?Oe.message:String(Oe))}),"error");return}Ol(te.id)}}const ns=T.useCallback(te=>{if(!Y)return Promise.resolve(!1);const me=Y;return ht({type:"busy",sessionId:me,busy:!0}),kr(()=>uwn(me,te)).then(()=>!0).catch(()=>!1).finally(()=>{Un(Q.queryKey)&&(et.fetchQuery({...ol(me),staleTime:0}).catch(()=>{}),et.fetchQuery({...Fa(e),staleTime:0}).catch(()=>{}))})},[Y,e,kr,Q]),Nn=V.filter(te=>W$n(K,te.archived)),Ea=/Mac|iPhone|iPad/.test(navigator.platform),tp=Ea?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",Ya=Ea?"⌘ Enter":"Ctrl + Enter",yc=T.useCallback(()=>{ne("active"),y(null)},[y]),ys=T.useCallback(te=>{ne("all"),y(te)},[y]);T.useEffect(()=>{const te=me=>{me.repeat||me.key!=="Enter"||!me.metaKey&&!me.ctrlKey||me.altKey||!me.shiftKey||(me.preventDefault(),yc())};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[yc]);const Vi=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":tp,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:yc,children:[f.jsx(Ph,{size:15}),F4e()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx(DI,{size:15}),e2e()]}),pIn.map(te=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&te.activeTabs.includes(i)?"active":""}`,"data-onboarding":te.id==="compute"?"nav-compute":void 0,onClick:()=>a(te.id),children:[te.icon,te.label()]},te.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((Il=UH.find(te=>te.id===K))==null?void 0:Il.railLabel())??TD()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(Q$n,{value:K,onChange:ne})})]}),f.jsxs("div",{className:"rail-body",children:[Nn.map(te=>f.jsx(J$n,{session:te,active:te.id===Y&&i==="chat",unread:F.has(te.id),busy:Tt.busySessions.has(te.id),waiting:Nl.has(te.id),revealTitle:Pn.get(te.id),onOpen:()=>{if(y(te.id),e===Pp){DSn(te.id);const me=Dyn[te.id];me&&(pu({name:"demo_experiment_started",kind:"curated",experiment:me}),pu({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:me=>ep(te,me),onSetArchived:me=>Dl(te,me),onDelete:()=>void Hf(te)},te.id)),Nn.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:K==="archived"?K1e():V.length>0?M1e():eve()})]}),f.jsx(q$,{runtime:w})]}),Za="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 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",Ll=!r&&f.jsx(Pt,{title:NN(),"aria-label":NN(),onClick:s,children:f.jsx(KI,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&Vi,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:Ll}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:z})]})]}):f.jsxs(f.Fragment,{children:[r&&Vi,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[Ll,f.jsxs("div",{className:Za,children:[f.jsx(D0,{variant:"header",title:$n?((zs=$n.title)==null?void 0:zs.trim())||Sd():sN(),children:$n?f.jsx(GH,{title:((o_=$n.title)==null?void 0:o_.trim())||Sd(),animate:qi!==void 0},qi??"static"):sN()}),k&&f.jsx(Pt,{"data-tip":iN(),"aria-label":iN(),onClick:k,children:f.jsx(g5n,{size:15})})]})]}),pc?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:pc.message}),f.jsx(De,{onClick:()=>void mt.refetch(),children:ti()})]}):El?f.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:[f.jsx(jt,{}),f.jsx("span",{children:O4e()})]}):jl?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:In,tabIndex:0,role:"region","aria-label":((qf=$n==null?void 0:$n.title)==null?void 0:qf.trim())||Sd(),onScroll:te=>{Pf(te.currentTarget),pn.dismiss()},children:f.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:xr,children:[f.jsx(cH,{projectId:e,sessionId:Y,children:f.jsx(K$n,{scrollRef:In,scrollToEndRef:fr,stickToBottom:Fn,onPinToBottom:bs,messages:ir,allMessages:Vs,canFork:fc,onFork:a_,onSelectFork:Rl,busy:dr,onOpenFile:Bf,onOpenRun:c,onOpenSpawnedSession:ys,runExperimentName:u,onOpenExperiment:h,experimentName:_,onRespond:ns,onOpenPlan:hc,onOpenSubagent:Gi,recoveringTurnId:Wr,onRecover:i_,skills:dc},Y)}),dr&&sn&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:OCe()}),dr&&!sn&&!Yu&&!Sl&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:cEe()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx(TS,{})}),f.jsx("h2",{children:FCe()}),f.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-medium",children:[f.jsx(Lu,{size:19}),f.jsx("span",{children:n})]}),Zh&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:AR,"aria-hidden":"true",children:jR.map((te,me)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${y4[me].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${y4[me].icon}`,children:[f.jsx(te,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},me))}),f.jsxs(Kr,{className:"mt-3",role:"status",children:[f.jsx(jt,{}),f.jsx("span",{children:O6e()})]})]}),mc&&mc.length>0&&f.jsx("div",{className:AR,role:"group","aria-label":F6e(),children:mc.map((te,me)=>{const Ee=jR[me],Oe=y4[me];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Oe.box}`,onClick:()=>{pu({name:"project_starter_clicked",slot:me+1}),pu({name:"first_action",surface:Xa,action:"starter_click"}),Tl(te.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ee,{size:17,className:Oe.icon}),te.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:te.prompt})]},me)})})]}),pn.action&&f.jsxs(De,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:pn.action.x,top:pn.action.top,transform:"translateX(-50%)"},onMouseDown:te=>te.preventDefault(),onClick:pn.add,children:[f.jsx(VI,{size:14}),Hbe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_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:[jl&&f.jsx(Pt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${sr?"opacity-0":"opacity-100"}`,title:AN(),"aria-label":AN(),inert:sr,onClick:Jh,children:dr&&!sn?f.jsx(Lb,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(e5n,{size:16})}),ts&&!($f&&ts.promptId===$f.promptId)&&f.jsx(xLn,{synthesized:ts.synthesized,agentLabel:$n?mu[$n.harness]:tEe(),showResumeModes:($n==null?void 0:$n.harness)==="claude-code",onView:te=>hc==null?void 0:hc(ts.plan,ts.promptId,te),onApprove:te=>ns({promptId:ts.promptId,approve:!0,...te?{resumeMode:te}:{}}),onReject:()=>ns({promptId:ts.promptId,approve:!1}),onRevise:te=>{Y&&zl({sessionId:Y,promptId:ts.promptId}),ns({promptId:ts.promptId,approve:!1,note:te})}}),Ks.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Ks.map((te,me)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:te.error?`${te.text} ${te.error}`:te.text,children:[te.dispatchState==="blocked"?f.jsx(wS,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(k5n,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:te.text}),te.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:te.dispatchState==="retrying"?yEn(te.nextRetryAt,Cl):M7e()}),te.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void Co(te.id),"aria-label":lJ({text:te.text}),disabled:hn!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:hn===te.id?oL():ti()}),f.jsx("button",{onClick:()=>Ml(te.id),"aria-label":nJ({text:te.text}),disabled:hn!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:q5e()}),me===vs&&meMl(te.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:f.jsx(cr,{size:11})})]},te.id))}),n_&&f.jsxs("div",{id:gc,role:"note",className:`composer-demo-hint ${TR}`,children:[f.jsx(yh,{size:16,className:"shrink-0 text-primary"}),f.jsx("span",{className:"flex-1",dir:"auto",children:E2e()}),f.jsx(Pt,{size:"small","aria-label":Qg(),title:Qg(),onClick:()=>{var te;G(!0),(te=On.current)==null||te.focus()},children:f.jsx(cr,{size:14})})]}),b&&!oe&&c&&f.jsxs("div",{role:"note",className:`composer-demo-run-hint ${TR}`,children:[f.jsx(yh,{size:16,className:"shrink-0 text-primary"}),f.jsxs("span",{className:"flex flex-1 flex-wrap items-center gap-x-1.5 gap-y-1",dir:"auto",children:[f.jsx("span",{children:dN()}),f.jsxs(De,{size:"small",onClick:()=>c(b,"keepOpen"),children:[f.jsx(vo,{size:14}),u3()]}),f.jsx("span",{children:fN()})]}),f.jsx(Pt,{size:"small","aria-label":Qg(),title:Qg(),onClick:()=>{var te;ce(!0),(te=On.current)==null||te.focus()},children:f.jsx(cr,{size:14})})]}),f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:b?`${dN()} ${u3()} ${fN()}`:""}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${Ui?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[ct&&!ct.agentReady&&f.jsx("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:ct.catalogPending?f.jsxs("span",{children:[ct.name," — ",of()]}):f.jsxs(f.Fragment,{children:[f.jsxs("strong",{children:[ct.name," ",e4e()]})," ",ct.agentNote?df(ct.agentNote):V7e()]})}),oi&&f.jsx(TIn,{skills:Hs,activeIndex:Zr,onPick:xo,onHover:An}),We&&f.jsx(LIn,{activeSessionId:Y,onClose:()=>yt(!1),onResume:te=>{yt(!1),ne("all"),y(te.id,{projectId:te.projectId})},onImport:te=>{yt(!1),xa(te)}}),he.length>0&&f.jsx(s$n,{annotations:he,onClear:()=>{be([]),window.requestAnimationFrame(()=>{var te;return(te=On.current)==null?void 0:te.focus()})},onRemove:te=>{const me=he.filter(Ee=>Ee.id!==te);be(me),me.length===0&&window.requestAnimationFrame(()=>{var Ee;return(Ee=On.current)==null?void 0:Ee.focus()})}}),Ke.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:Ke.map((te,me)=>{const Ee=()=>Ne(Oe=>Oe.filter((Pe,Jt)=>Jt!==me));return te.mediaType==="application/pdf"?f.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:te.name,children:[f.jsx(Ib,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:te.name??"document.pdf"}),f.jsx("button",{title:wN(),"aria-label":wN(),onClick:Ee,children:f.jsx(cr,{size:11})})]},me):f.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:[f.jsx("img",{src:te.dataUrl,alt:jD()}),f.jsx("button",{title:kN(),"aria-label":kN(),onClick:Ee,children:f.jsx(cr,{size:11})})]},me)})}),xe&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:xe}),Ie&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${Ui?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:On,"aria-describedby":n_?gc:void 0,className:"relative z-1 bg-transparent",value:ae,placeholder:Ci?NEe():So&&ct?O9e({harness:Ce(mu[ct.id]),shortcut:Ce(Ya)}):Zt?ct!=null&&ct.agentReady?a1e({harness:Ce(mu[Zt.harness])}):Vge({harness:Ce(mu[Zt.harness])}):qpe(),rows:2,onPaste:xl,onDragOver:te=>{te.dataTransfer.types.includes("Files")&&te.preventDefault()},onDrop:te=>{te.dataTransfer.files.length!==0&&(te.preventDefault(),Pi(Array.from(te.dataTransfer.files)))},onChange:te=>{const me=te.target.value,Ee=te.target.selectionStart;$r(Ee);const Oe=Ee>0&&/\s/.test(me[Ee-1])&&!Ci&&!ai.current&&yR(me)===null?_4(me,Ee-1):null,Pe=Oe&&K5(Oe.query),Jt=Oe?(me.slice(0,Oe.start)+me.slice(Oe.end)).trim():"";if(Oe&&Pe&&(Pe==="plan"||!f4(Pe)&&!Jt)&&xi.some(mn=>mn.name===Pe)){ci(Pe,me,Oe);return}ue(me),wr(!1)},onSelect:te=>$r(te.currentTarget.selectionStart),onCompositionStart:()=>{ai.current=!0},onCompositionEnd:()=>{ai.current=!1},onKeyDown:te=>{if(oi){if(te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();const me=te.key==="ArrowDown"?1:-1;An((Zr+me+Hs.length)%Hs.length);return}if(te.key==="Tab"||te.key==="Enter"){te.preventDefault(),xo(Hs[Zr]);return}if(te.key==="Escape"){te.preventDefault(),wr(!0);return}}if(te.key==="Backspace"&&Ka(te.currentTarget)){te.preventDefault();return}if(te.key==="Enter"&&!te.shiftKey&&!te.nativeEvent.isComposing){if(te.preventDefault(),Ui){r_();return}Ff({queue:te.metaKey||te.ctrlKey})}}}),f.jsx(AIn,{text:ae,editingTokenEnd:Yr==null?void 0:Yr.end,isCommand:Ju,skills:xi,projectId:e,textareaRef:On})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:Jn.ref,children:[f.jsx(Pt,{type:"button",className:"composer-bare",title:Z2(),"aria-label":Z2(),"aria-haspopup":"dialog","aria-expanded":Jn.open,onClick:()=>Jn.setOpen(te=>!te),children:f.jsx(Wkn,{size:16})}),Jn.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:Z2()}),f.jsx($En,{})]})]}),f.jsx("input",{ref:un,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:te=>{Pi(Array.from(te.target.files??[])),te.target.value=""}}),f.jsx(Pt,{type:"button",className:"composer-attach",title:oN(),"aria-label":oN(),onClick:()=>{var te;return(te=un.current)==null?void 0:te.click()},children:f.jsx(zkn,{size:16})}),qs&&f.jsxs(De,{type:"button",variant:"ghost",active:!0,className:"group max-w-60",title:_N({goal:na(qs)}),"aria-label":_N({goal:na(qs)}),onClick:()=>void Qa("clear"),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(qI,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(cr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{className:"truncate",children:Kwe()})]}),Us&&f.jsxs(De,{type:"button",variant:"ghost",active:!0,className:"group",title:gN(),"aria-label":gN(),onClick:()=>void Gs(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(akn,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(cr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:h3e()})]}),Ui&&f.jsxs(De,{type:"button",variant:"ghost",active:!0,className:"group",title:mN(),"aria-label":mN(),onClick:bc,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(jf,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(cr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:CD()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx(k6n,{value:Zt,onSelect:ya,onOpenSettings:()=>a("harnesses"),permissionChoices:ct!=null&&ct.agentReady?(Wt==null?void 0:Wt.permissionModes)??[]:[],defaultPermissionId:(Wt==null?void 0:Wt.defaultPermissionMode)??null,onSelectPermission:Wa,reasoningChoices:ct!=null&&ct.agentReady?Ms.choices:[],defaultReasoningId:Ms.defaultId,onSelectReasoning:Jr,lockHarness:!!Lt,openRequest:er}),f.jsx(MIn,{usage:Lt==null?void 0:Lt.contextUsage})]}),dr&&!Ci?f.jsx(Pt,{className:"send-btn",variant:"stop",title:zN(),"aria-label":zN(),onClick:s_,children:f.jsx(cr,{size:16})}):f.jsx(Pt,{className:`send-btn ${n_&&(ct!=null&&ct.agentReady)?"ring-2 ring-primary ring-offset-2 ring-offset-background":""}`,variant:"primary",title:Ui?CN():l3(),"aria-label":Ui?CN():l3(),onClick:()=>void(Ui?r_():Ff()),disabled:Ui?!Fi||!Y&&!(ct!=null&&ct.agentReady):!(ct!=null&&ct.agentReady)||!ae.trim()&&Ke.length===0&&he.length===0,children:f.jsx(PI,{size:16})})]})]})]})]})]})}const TR="flex items-center gap-2.5 mb-2.5 py-2 ps-3.5 pe-2 rounded-lg border border-border bg-surface text-text text-sm leading-normal",rBn=[],sBn=[];function La({className:e,...n}){return f.jsx("div",{className:Cs("relative flex min-h-0 flex-1 flex-col",e),...n})}function Vd({className:e,...n}){return f.jsx("div",{className:Cs("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Vo({className:e,...n}){return f.jsx("div",{className:Cs("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const RR=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function iBn({projectId:e,sessionId:n,spawnPartId:t,onOpenFile:r,onOpenRun:s,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:c}){var k;const u=ut(ol(n)),h=((k=u.data)==null?void 0:k.messages)??(u.isError?[]:null),_=T.useRef(null),p=T.useRef(null),m=T.useRef(!0);if(T.useLayoutEffect(()=>{m.current=!0;const v=_.current;v&&(v.scrollTop=v.scrollHeight)},[n,t]),T.useLayoutEffect(()=>{const v=_.current;v&&m.current&&(v.scrollTop=v.scrollHeight)},[h]),T.useEffect(()=>{const v=_.current,b=p.current;if(!v||!b)return;const x=new ResizeObserver(()=>{m.current&&(v.scrollTop=v.scrollHeight)});return x.observe(b),x.observe(v),()=>x.disconnect()},[h===null]),h===null)return f.jsx(La,{children:f.jsx("div",{className:RR,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:odn()})})});let w=null;for(const v of h)if(w=cb(v.parts,t),w)break;return f.jsx(La,{children:f.jsx("div",{className:RR,ref:_,onScroll:v=>{const b=v.currentTarget;m.current=b.scrollHeight-b.scrollTop-b.clientHeight<60},children:f.jsx("div",{ref:p,children:w?f.jsx(cH,{projectId:e,sessionId:n,children:f.jsx(q$n,{spawn:w,onOpenFile:r,onOpenRun:s,runExperimentName:i,onOpenExperiment:a,experimentName:o,onOpenSubagent:c})}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:hdn()})})})})}function aBn({experiment:e}){var s;const n=ut(K$(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(Vd,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Vo,{children:[qhe()," ",Ce(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(MB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(DB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?rpe():Lhe()}):f.jsx(Vo,{children:Xhe()})})}function VH({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:c}){return f.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:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":PNe(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:KNe()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:RD()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(Nm,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(Bh,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(Ub,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Pt,{title:MN(),"aria-label":MN(),onClick:c,children:o?f.jsx(jt,{}):f.jsx(Dkn,{size:13})})]})}const oBn=/\.(md|mdx|markdown)$/i,cBn=/\.tex$/i,lBn=/\.html?$/i,uBn=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,_Bn=/\.(csv|tsv|xlsx?|ods)$/i,fBn=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,dBn=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,hBn=/\.pdf$/i,pBn=/\.(docx?|log|rtf|txt)$/i;function mBn(e){return uBn.test(e)}function pC(e){return oBn.test(e)}function KH(e){return cBn.test(e)}function gBn(e){return lBn.test(e)}function Ah({name:e}){const n=pC(e)?"markdown":mBn(e)?"image":_Bn.test(e)?"spreadsheet":fBn.test(e)?"code":dBn.test(e)?"archive":hBn.test(e)?"pdf":pBn.test(e)||KH(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.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"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.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"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.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 ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function WH(e,n){const t=navigator.clipboard;if(!t){xn(LD(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>xn(af(),"success")).catch(r=>xn(r instanceof Error?r.message:String(r),"error"))}function QH({name:e,onCommit:n,onCancel:t}){const[r,s]=T.useState(e),i=T.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":hBe({path:Ce(e)}),onFocus:o=>{const c=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,c>0?c:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function XH(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function YH({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=T.useRef(null),c=T.useRef(a);c.current=a;const[u,h]=T.useState({x:e.x,y:e.y});T.useLayoutEffect(()=>{var k;const m=o.current;if(!m)return;const w=document.activeElement instanceof HTMLElement?document.activeElement:null;return h({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(k=m.querySelector("button"))==null||k.focus(),()=>{m.contains(document.activeElement)&&(w==null||w.focus())}},[e]),T.useEffect(()=>{const m=()=>c.current(),w=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||c.current()},k=v=>{if(v.key==="Tab"){v.preventDefault(),c.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),c.current())};return document.addEventListener("pointerdown",w),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",k,!0),()=>{document.removeEventListener("pointerdown",w),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",k,!0)}},[]);const _=m=>{c.current(),m()},p=(m,w,k=!1)=>f.jsx(Cn,{size:"compact",role:"menuitem",danger:k,onClick:()=>_(w),children:f.jsx("span",{children:m})});return ri.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":eBe({path:Ce(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,x;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const w=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],k=w.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:w[0]),v=m.key==="ArrowDown"?1:-1;(x=w[(k+v+w.length)%w.length])==null||x.focus()},children:[p(oBe(),n),t&&p(ND(),t),r&&p(K$e(),r),p(Dfe(),s),i&&p(ED(),i,!0)]}),document.body)}const ek=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),MR=["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 OR(){return{dirs:new Map,files:[]}}function ZH(e){const n=OR();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(sc,{size:13,className:MR}):f.jsx(Ua,{size:13,className:MR}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(mC,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:c,onRename:u,onCancelRename:h})]})}function mC({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:c,onCancelRename:u}){const h=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),_=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[h.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(vBn,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:c,onCancelRename:u},`d:${m}`)}),_.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&c&&u)return f.jsxs("div",{className:ek,style:{paddingInlineStart:8+t*14},children:[f.jsx(Ah,{name:p}),f.jsx(QH,{name:p,onCommit:k=>c(m,k),onCancel:u})]},`f:${m}`);const w=Vr(k=>i(m,k));return f.jsxs("button",{type:"button",className:ek,style:{paddingInlineStart:8+t*14},...w,onContextMenu:k=>{o&&(k.preventDefault(),o(k,m))},onKeyDown:k=>{if(o&&(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10")){k.preventDefault(),o(k,m);return}w.onKeyDown(k)},title:zY({name:Ce(m)}),children:[f.jsx(Ah,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function bBn({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var N,z;const c=t.branchName,u=ut({...Q$(e,{ref:c}),enabled:r==="files",subscribed:r==="files"}),h=ut({...qv(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),_=u.data,p=(N=u.error)==null?void 0:N.message,m=u.isFetching,w=K$(t.id),k=iK({queryKey:w.queryKey})>0,v=(z=h.data)!=null&&z.exists&&h.data.branch===c?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},x=T.useMemo(()=>_?ZH(_.entries):null,[_]),y=r==="files"?m:k,C=T.useCallback(A=>{const j=new Set(s);j.has(A)?j.delete(A):j.add(A),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(VH,{view:r,onViewChange:i,branchLabel:c,branchTitle:`Committed branch ${c}`,githubHref:n.githubEnabled?Mb(n.githubOwner,n.githubRepo,c):void 0,githubTitle:bD({branch:Ce(c)}),refreshing:y,onRefresh:()=>r==="files"?b():void et.invalidateQueries(w)}),r==="changes"?f.jsx(aBn,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(_==null?void 0:_.truncated)&&f.jsx(Vo,{children:aze()}),p&&x&&f.jsxs(Vo,{children:[yze()," ",Ce(p)]}),f.jsx(Vd,{children:x?x.dirs.size===0&&x.files.length===0?f.jsx(Vo,{children:dze()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(mC,{node:x,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(A,j)=>v?o(A,v,void 0,j):o(A,void 0,c,j)})}):f.jsx(Vo,{children:p?Wk({error:Ce(p)}):Qk()})})]})]})}function gC({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function yBn({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var $,L,F;const c=n.id,h=(($=ut(Fa(c)).data)==null?void 0:$.some(q=>q.id===e&&q.busy))??!1,_=ut({...qv(e??""),enabled:!!e,refetchInterval:h?5e3:!1}),p=_.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},w=ut({...Q$(c,m),enabled:!e||_.isSuccess,refetchInterval:h?5e3:!1}),k=w.data,v=(L=_.error??w.error)==null?void 0:L.message,b=_.isFetching||w.isFetching,[x,y]=T.useState(null),[C,N]=T.useState(null),z=T.useCallback(()=>{e&&et.invalidateQueries(qv(e)),et.invalidateQueries({queryKey:At("getCodeTree",c),predicate:q=>!_D(q)})},[e,c]),A=T.useRef(h);T.useEffect(()=>{A.current&&!h&&z(),A.current=h},[h,z]);const j=T.useMemo(()=>k?ZH(k.entries):null,[k]),M=T.useCallback(q=>{const K=new Set(r);K.has(q)?K.delete(q):K.add(q),i(K)},[r,i]),D=e&&(p!=null&&p.exists)?p:null,I=(D==null?void 0:D.branch)??(D!=null&&D.baselineBranch?Jbn({branch:Ce(D.baselineBranch)}):tS()),B=((F=D==null?void 0:D.files)==null?void 0:F.length)??0,U=D?Bbn({branch:Ce(`${I}${B>0?"*":""}`)}):Vbn({branch:Ce(n.baselineBranch)}),H=D?D.branch:n.baselineBranch,Q=(q,K)=>D?a(q,e,void 0,K):a(q,void 0,n.baselineBranch,K),V=(k==null?void 0:k.root)==="worktree",Z=async(q,K)=>{try{await fxn(c,q,K,{sessionId:e}),z()}catch(ne){xn(ne instanceof Error?ne.message:String(ne),"error")}},Y=q=>{const K=(k==null?void 0:k.path)??n.repoPath;WH(K,q)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(VH,{view:D?t:"files",onViewChange:s,showViewToggle:!!D,branchLabel:U,branchTitle:U,githubHref:n.githubEnabled&&H?Mb(n.githubOwner,n.githubRepo,H):void 0,githubTitle:H?bD({branch:Ce(H)}):void 0,refreshing:b,onRefresh:z}),v&&(p||k)&&f.jsxs(Vo,{children:[Oyn()," ",Ce(v)]}),!k||e&&!p?f.jsx(Vd,{children:f.jsx(Vo,{children:v?Wk({error:Ce(v)}):Qk()})}):D&&t==="changes"?f.jsx(Vd,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:B===0||!D.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:yyn()}):f.jsxs(f.Fragment,{children:[D.diff.truncated&&f.jsx(MB,{bytesRead:D.diff.bytesRead,byteLimit:D.diff.byteLimit}),f.jsx(DB,{diff:D.diff.diff,partial:D.diff.truncated})]})}):f.jsxs(Vd,{children:[k.truncated&&f.jsx(Vo,{children:ayn()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(gC,{icon:Lu,title:Nyn(),description:$Ge()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(mC,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Q,renamingPath:C,onContextMenu:(q,K)=>{y(XH(q,K))},onRename:(q,K)=>{N(null),Z(q,{action:"rename",newName:K})},onCancelRename:()=>N(null)})}):f.jsx(Vo,{children:dyn()})]}),x&&f.jsx(YH,{target:x,onOpen:()=>Q(x.path,"keepOpen"),onRename:V&&o(x.path)?()=>N(x.path):void 0,onDuplicate:V?()=>void Z(x.path,{action:"duplicate"}):void 0,onCopyPath:()=>Y(x.path),onDelete:V?()=>{window.confirm(P$e({path:Ce(x.path)}))&&Z(x.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function JH({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=T.useMemo(()=>{if(!e)return[];const h=e.replace(/\r\n?/g,` `),_=B$(h,MS(n));return h.endsWith(` -`)?_.slice(0,-1):_},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=T.useRef(null);T.useEffect(()=>{var h;r!==void 0&&(a?((h=o.current)==null||h.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:c}=x$(i.length),u=T.useMemo(()=>i.map((h,_)=>f.jsxs("div",{ref:_+1===a?o:void 0,className:`file-view-line flex items-stretch ${_+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":_+1,className:`${y$} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${c}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${Fv} ${b$}`,children:P$(h)?f.jsx("br",{}):h})]},_)),[i,c,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${Fv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${c}ch`},"aria-hidden":"true"}),u]})}const xBn="modulepreload",wBn=function(e){return"/"+e},DR={},kBn=function(n,t,r){let s=Promise.resolve();if(t&&t.length>0){let a=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=a(t.map(u=>{if(u=wBn(u),u in DR)return;DR[u]=!0;const h=u.endsWith(".css"),_=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${_}`))return;const p=document.createElement("link");if(p.rel=h?"stylesheet":xBn,h||(p.as="script"),p.crossOrigin="",p.href=u,c&&p.setAttribute("nonce",c),document.head.appendChild(p),h)return new Promise((m,w)=>{p.addEventListener("load",m),p.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return n().catch(i)})},lb=T.createContext(null);function SBn({url:e,name:n}){return f.jsx(Bh,{size:"small",href:e,download:n,"aria-label":kv({name:Ce(n)}),"data-tip":kv({name:Ce(n)}),"data-tip-align":"end",children:f.jsx(Db,{size:13})})}const CBn=T.lazy(()=>kBn(()=>import("./PdfPreview-iShJCj-I.js"),__vite__mapDeps([0,1])).catch(e=>(console.error("PDF viewer failed to load",e),{default:tq})));function eq(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function tq({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[xtt()," ",f.jsxs("a",{href:e,download:n,children:[_3()," ",Ce(n)]})]})}function tk({kind:e,url:n,name:t,download:r=!0}){const[s,i]=T.useState(!1),a=T.useContext(lb);if(T.useEffect(()=>i(!1),[e,n]),s)return f.jsx(tq,{url:n,name:t});let o;return e==="image"?o=f.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:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?o=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?o=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):o=f.jsx(T.Suspense,{fallback:f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center",children:f.jsx(jt,{})}),children:f.jsx(CBn,{url:n,name:t,download:r,onError:()=>i(!0)},n)}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[o,r&&e!=="pdf"&&a&&ri.createPortal(f.jsx(SBn,{url:n,name:t}),a)]})}const EBn=e=>({queryKey:At("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function nq(e,n=!0){return ut({...EBn(e),enabled:n,subscribed:n}).data??null}function NBn(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function zBn(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),c=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const h=u.join("/");if(!h)return null;const _=new URLSearchParams(c);_.delete("path");const p=_.toString();return{path:h,url:`${lf(e,h)}${p?`&${p}`:""}${i}`}}function jBn(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` ----`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const rq="orx:files-tree-width",sq="orx:artifacts-collapsed:",iq=180,aq=320,ABn=8,TBn=280;function RBn(){try{const e=Number(localStorage.getItem(rq));if(Number.isFinite(e)&&e>=iq&&e<=aq)return e}catch{}return TBn}function MBn(e){try{const n=localStorage.getItem(`${sq}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function W0(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=W0(t.children??[],n);if(r)return r}}return null}function oq({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(NBn(i))return i;const a=zBn(e,n,i);if(!a)return null;const o=W0(r,a.path);if(!o)return a.url;const c=a.url.indexOf("#"),u=c===-1?a.url:a.url.slice(0,c),h=c===-1?"":a.url.slice(c);return`${u}&v=${o.modifiedAt}:${o.size}${h}`};return f.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-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_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-prose-emphasis [&_.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-sm [&_.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]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_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-start [&_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-start [&_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]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-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-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_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:f.jsx(_Tn,{remarkPlugins:[rH,[sH,uH]],rehypePlugins:[RF],components:{a:({href:i,children:a,...o})=>{const c=!i||i.startsWith("#"),u=c?i:s(i);return u?f.jsx("a",{...o,href:u,...c?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},..._H},children:aH(jBn(t))})})}function OBn(e){return e.presentation==="text"&&pC(e.name)?"markdown":eq(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function DBn(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=XL,i=d6(e,n.path),a=ut({...i,enabled:s,subscribed:s}),o=T.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});T.useEffect(()=>{const h=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&h.projectId===e&&h.path===n.path&&(h.modifiedAt!==n.modifiedAt||h.size!==n.size||h.version!==null&&h.version!==r)&&et.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const c=a.data;return{text:c&&!c.binary?c.content:null,binary:(c==null?void 0:c.binary)??!1,truncated:(c==null?void 0:c.truncated)??!1,error:c?null:((u=a.error)==null?void 0:u.message)??(c===null?Hfe():null),wantsText:s}}function LBn({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=OBn(n),i=nq(lf(e,n.path)),{text:a,binary:o,truncated:c,error:u,wantsText:h}=DBn(e,n,s,i),[_,p]=T.useState(!1),[m,w]=T.useState(null),k=s==="markdown",v=n.path.split("/").slice(0,-1).join("/"),b=`${lf(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let x;return s==="image"||s==="audio"||s==="video"||s==="pdf"?x=f.jsx(lb.Provider,{value:m,children:f.jsx(tk,{kind:s,url:b,name:n.name})}):s==="download"||!h||o?x=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?zfe():jhe()," ",f.jsx("a",{href:b,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?ID():Qfe()})]}):u?x=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[wde()," ",Ce(u)]}):a===null?x=f.jsxs(Kr,{children:[f.jsx(jt,{})," ",kD()]}):k&&!_?x=f.jsx(oq,{projectId:e,folder:v,markdown:a,entries:r}):x=f.jsx(JH,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head @container flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Ah,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ce(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0 @max-xl:hidden",children:[nhe()," ",new Date(n.modifiedAt).toLocaleString(E(),{dateStyle:"medium",timeStyle:"short"})]}),f.jsx("div",{ref:w,className:"contents"}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:nl(n.size)}),k&&f.jsx(Pt,{size:"small",active:_,"data-tip":_?Cv():Td(),"data-tip-align":"end","aria-label":_?Cv():Td(),onClick:()=>p(y=>!y),children:f.jsx(P3,{size:13})}),f.jsx(Bh,{size:"small",href:b,target:"_blank",rel:"noopener noreferrer","data-tip":JE(),"data-tip-align":"end","aria-label":JE(),children:f.jsx(_f,{size:13})}),f.jsx(Pt,{size:"small","data-tip":ZE(),"data-tip-align":"end","aria-label":ZE(),onClick:()=>{window.confirm(Gk({path:Ce(n.path)}))&&t(n.path)},children:f.jsx(Af,{size:13})})]}),f.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 ${k&&!_?"doc":""}`,children:[x,c&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:jde()})]})]})}function cq({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:h,onCancelRename:_}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var w;const m={paddingInlineStart:8+Math.min(n,ABn)*14};if(p.isDir){const k=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.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-start cursor-pointer font-[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:m,onClick:()=>s(p.path),children:[f.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":k?tfe({name:Ce(p.name)}):xfe({name:Ce(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ua,{size:13,className:k?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Pt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":pde(),"data-tip-align":"end","aria-label":hfe({name:Ce(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(Gk({path:Ce(p.path)}))&&o(p.path)},children:f.jsx(Af,{size:12})})]}),k&&(((w=p.children)==null?void 0:w.length)??0)>0&&f.jsx(cq,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:h,onCancelRename:_})]},p.path)}return c===p.path?f.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-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Ah,{name:p.name}),f.jsx(QH,{name:p.name,onCommit:k=>h(p.path,k),onCancel:_})]},p.path):f.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-start cursor-pointer font-[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===p.path?"selected":""}`,style:m,title:FQ({path:Ce(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:k=>{k.preventDefault(),i(p.path),u(k,p.path)},onAuxClick:k=>{k.button===1&&(k.preventDefault(),i(p.path),a(p.path))},onKeyDown:k=>{if(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10"){k.preventDefault(),i(p.path),u(k,p.path);return}if(k.key===" "){k.preventDefault(),k.stopPropagation(),i(p.path);return}k.key==="Enter"&&(k.preventDefault(),k.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Ah,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function IBn({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=T.useState(null),[a,o]=T.useState(()=>MBn(e.id)),[c,u]=T.useState(RBn),[h,_]=T.useState(null),[p,m]=T.useState(null),w=T.useRef(null);T.useEffect(()=>{try{localStorage.setItem(`${sq}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const k=z=>{var I;z.preventDefault(),z.currentTarget.setPointerCapture(z.pointerId);const A=(I=w.current)==null?void 0:I.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=B=>{const U=Math.round(B.clientX-((A==null?void 0:A.left)??0)),H=Math.min(Math.max(U,iq),aq);u(H);try{localStorage.setItem(rq,String(H))}catch{}},D=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",D),window.removeEventListener("pointercancel",D),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",D),window.addEventListener("pointercancel",D)};T.useEffect(()=>{if(!s||!n)return;const z=W0(n.entries,s);(!z||z.isDir)&&i(null)},[s,n]);const v=z=>o(A=>{const j=new Set(A);return j.has(z)?j.delete(z):j.add(z),j}),b=z=>{(s===z||s!=null&&s.startsWith(z+"/"))&&i(null),v2n(e.id,z).catch(()=>{})},x=async(z,A)=>{try{await b2n(e.id,z,A),A.action==="rename"&&s===z&&i(null)}catch(j){xn(j instanceof Error?j.message:String(j),"error")}},y=z=>{n&&WH(n.dir,z)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(Kr,{className:"p-5",children:[f.jsx(jt,{})," ",Qde()]})});const C=z=>f.jsx(cq,{entries:z,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(A,j)=>{_(XH(A,j))},onRename:(A,j)=>{m(null),x(A,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),N=s?W0(n.entries,s):null;return n.entries.length===0?f.jsx(gC,{icon:vS,title:lhe(),description:whe()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:w,style:{width:c},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:k}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:Lde()})]})]}),N?f.jsx(LBn,{projectId:e.id,entry:N,onDelete:b,artifactEntries:n.entries},N.path):f.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-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(kkn,{size:22,strokeWidth:1.5}),f.jsx("span",{children:nde()})]}),h&&f.jsx(YH,{target:h,onOpen:()=>t(h.path),onRename:r(h.path)?()=>m(h.path):void 0,onDuplicate:()=>void x(h.path,{action:"duplicate"}),onCopyPath:()=>y(h.path),onDelete:()=>{window.confirm(Gk({path:Ce(h.path)}))&&b(h.path)},onClose:()=>_(null)})]})}const lq=20*1024*1024,uq="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-base [&_h3]:font-semibold [&_h3]:text-text",_q="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",$Bn="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",BBn="text-sm font-normal text-text",PBn="mt-1 mb-0 text-sm leading-relaxed text-text";function fq(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function FBn(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function dq({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=T.useState(!1),a=T.useRef(null);return f.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 text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const c=(u=o.dataTransfer.files)==null?void 0:u[0];c&&r(c)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var c;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(c=a.current)==null||c.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const c=(u=o.target.files)==null?void 0:u[0];c&&r(c),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(jt,{}),f.jsx("span",{children:Ncn()})]}):f.jsxs(f.Fragment,{children:[f.jsx(Zkn,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function hq({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[nl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",go(n)]})]})}function HBn({skill:e,onError:n}){const t=dn({mutationFn:H2n}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:BBn,children:e.name}),e.origin&&f.jsx(Vt,{size:"small",children:e.origin})]}),f.jsx(hq,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Pt,{size:"small","data-tip":e.origin?Aan():Con(),"data-tip-align":"end","aria-label":e.origin?Uan({name:Ce(e.name)}):win({name:Ce(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?Ian({name:Ce(e.name)}):pin({name:Ce(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Af,{size:13})})]})}function qBn({template:e,onError:n}){const t=dn({mutationFn:B2n}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:$Bn,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:PBn,children:[e.entry,s>0&&(s===1?man():Yan({count:Xt(s)}))]})]}),f.jsx(hq,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Pt,{"data-tip":Ron(),"data-tip-align":"end","aria-label":Lin({name:Ce(e.name)}),disabled:r,onClick:()=>{window.confirm(jin({name:Ce(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Af,{size:13})})]})}function UBn(){var x;const e=dn({mutationFn:F2n}),n=ut(Mwn()),t=n.data,r=T.useRef(null),[s,i]=T.useState(!1),[a,o]=T.useState(!1),c=T.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);T.useLayoutEffect(()=>{c();const y=r.current;if(!y)return;const C=new ResizeObserver(c);return C.observe(y),()=>C.disconnect()},[t,c]);const u=n.isFetching,h=(x=n.error)==null?void 0:x.message,[_,p]=T.useState(!1),[m,w]=T.useState(null),k=()=>{n.refetch()},v=T.useRef(!1),b=T.useCallback(async y=>{if(!v.current){if(w(null),!FBn(y.name)){w(Fcn());return}if(y.size>lq){w(TL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await fq(y)})}catch(C){w(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:uq,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:ycn()}),f.jsxs(De,{className:"ms-auto",size:"small",onClick:k,disabled:u,children:[f.jsx(Ga,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Sm()]})]}),f.jsx("p",{className:_q,children:qin()}),f.jsx(dq,{accept:".md,.markdown,.zip",busy:_,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Xin()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:cin()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),h&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[son()," ",h]}),t===void 0?h?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",Von()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:acn()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:c,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(HBn,{skill:y,onError:w},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function GBn(){var h;const e=dn({mutationFn:$2n}),n=ut(Rwn()),t=n.data,r=(h=n.error)==null?void 0:h.message,[s,i]=T.useState(!1),[a,o]=T.useState(null),c=T.useRef(!1),u=T.useCallback(async _=>{if(c.current)return;o(null);const p=_.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(Wcn());return}if(_.size>lq){o(TL());return}c.current=!0,i(!0);try{await e.mutateAsync({filename:_.name,contentBase64:await fq(_)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{c.current=!1,i(!1)}},[]);return f.jsxs("section",{className:uq,children:[f.jsx("h3",{children:Bon()}),f.jsx("p",{className:_q,children:Ocn()}),f.jsx(dq,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:ran()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Ddn()})]}),onFile:_=>void u(_)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[_on()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",Jon()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:dcn()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(_=>f.jsx(qBn,{template:_,onError:o},_.name))})]})}function VBn(){return f.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:[f.jsx("h1",{children:von()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:kan()}),f.jsx(UBn,{}),f.jsx(GBn,{})]})}const KBn="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function qc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-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-hover-strong [&_.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-0 [&: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]:-start-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]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?KBn:""}`,onClick:i,onDoubleClick:a,title:s?zdn({label:n}):n,"aria-label":s?xdn({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:NNe(),onPointerDown:c=>c.preventDefault(),onClick:c=>{c.stopPropagation(),o()},children:f.jsx(cr,{size:12})})]})}const LR=["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 WBn({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:LR,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:LR,href:Mb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:Sv({name:Ce(t)}),children:[f.jsx("code",{children:t}),f.jsx(Ub,{size:12})]})}const x4=["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-sm","[&_h2]:font-semibold"].join(" "),IR=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function $R(e){return new Date(e).toLocaleString(E(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function BR(e,n){return T0((e.endedAt??n)-e.createdAt)}function QBn({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(h=>h.status==="running"||h.status==="starting"),[c,u]=T.useState(()=>Date.now());return T.useEffect(()=>{if(!o)return;u(Date.now());const h=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(h)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.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:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx(cl,{status:a?aa(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(De,{...Vr(h=>s(a.id,h)),children:[f.jsx(vo,{size:15}),uLe()]}),f.jsxs(De,{...Vr(i),children:[f.jsx($b,{size:15}),pDe()]})]}),e.description&&f.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-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:LDe()}),f.jsx(Jo,{text:e.description})]}),f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:a?cDe():$Le()}),a&&f.jsxs(f.Fragment,{children:[f.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:[f.jsx(cl,{status:aa(a)}),f.jsx(RS,{backend:a.backend}),f.jsxs("span",{title:TLe(),children:[f.jsx(c5n,{size:13}),$R(a.createdAt)]}),f.jsxs("span",{title:qDe(),children:[f.jsx(x5n,{size:13}),BR(a,c)]}),a.commitSha&&f.jsxs("span",{title:wDe(),children:[f.jsx(Y5n,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[XDe()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:IR,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(Jo,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:"Git"}),f.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:[f.jsx(WBn,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[rLe()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:$R(e.createdAt),children:[jDe()," ",go(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:IR,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:SLe()}),f.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-start [&_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((h,_)=>f.jsxs("button",{...Vr(p=>s(h.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[gLe()," ",r.length-_]}),f.jsx(cl,{status:aa(h)}),f.jsx("span",{children:go(h.createdAt)}),f.jsx("span",{children:BR(h,c)}),f.jsx(vo,{size:13})]},h.id))})]})]})})}function PR(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=Pb(t,!0);let i=!1,a=0,o=!1,c=!1;async function u(){if(o){c=!0;return}o=!0;try{for(;;){const _=await axn(e,a);if(i)return;if(_.dataBase64&&r.write(PR(_.dataBase64)),a=_.nextOffset,_.eof)break}}catch{}finally{o=!1,c&&!i&&(c=!1,u())}}const h=Fwn(e,_=>{if(i)return;const p=PR(_.dataBase64);!o&&_.offset===a?(r.write(p),a+=p.length):_.offset+p.length>a&&u()});return u(),()=>{i=!0,h(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function YBn({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:c}){const u=r.filter(h=>h.experimentId===e.id).sort((h,_)=>_.createdAt-h.createdAt);return t==="overview"?f.jsx(QBn,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(h,_)=>o("terminal",h,_),onOpenCode:h=>c("files",h)}):f.jsx(ZBn,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function ZBn({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=T.useState(null),[a,o]=T.useState(null),[c,u]=T.useState(!1),h=T.useRef(null),_=t?n.find(v=>v.id===t)??null:n[0]??null,p=(_==null?void 0:_.status)==="running"||(_==null?void 0:_.status)==="starting",m=!!(_&&p&&(_.cancelRequested||a===_.id)),w=v=>{const b=n.findIndex(x=>x.id===v);return b===-1?n.length:n.length-b};T.useEffect(()=>{if(!c)return;const v=b=>{var x;(x=h.current)!=null&&x.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c]);async function k(){if(_){i(null),o(_.id);try{await HL(_.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.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:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(De,{size:"small",variant:"ghost",disabled:m,onClick:()=>void k(),children:[f.jsx($I,{size:13}),m?Nze():OD()]}),n.length>0&&_&&f.jsxs("div",{className:"run-history relative shrink-0",ref:h,children:[f.jsxs(De,{title:JMe(),"aria-expanded":c,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[ON()," ",w(_.id)]}),f.jsx(cl,{status:m?"cancelling":aa(_)}),f.jsx(sc,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),c&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(Cn,{className:"justify-start",active:v.id===(_==null?void 0:_.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[ON()," ",w(v.id)]}),f.jsx(cl,{status:aa(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:go(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:_?f.jsx(XBn,{runId:_.id},_.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?_o():PMe()})})]})}let nk=!1;function FR(e){nk=!0;try{return window.confirm(e)}finally{nk=!1}}const rk=e=>e.replace(/\r\n/g,` +`)?_.slice(0,-1):_},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=T.useRef(null);T.useEffect(()=>{var h;r!==void 0&&(a?((h=o.current)==null||h.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:c}=x$(i.length),u=T.useMemo(()=>i.map((h,_)=>f.jsxs("div",{ref:_+1===a?o:void 0,className:`file-view-line flex items-stretch ${_+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":_+1,className:`${y$} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${c}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${Fv} ${b$}`,children:P$(h)?f.jsx("br",{}):h})]},_)),[i,c,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${Fv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${c}ch`},"aria-hidden":"true"}),u]})}const xBn="modulepreload",wBn=function(e){return"/"+e},DR={},kBn=function(n,t,r){let s=Promise.resolve();if(t&&t.length>0){let a=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=a(t.map(u=>{if(u=wBn(u),u in DR)return;DR[u]=!0;const h=u.endsWith(".css"),_=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${_}`))return;const p=document.createElement("link");if(p.rel=h?"stylesheet":xBn,h||(p.as="script"),p.crossOrigin="",p.href=u,c&&p.setAttribute("nonce",c),document.head.appendChild(p),h)return new Promise((m,w)=>{p.addEventListener("load",m),p.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return n().catch(i)})},lb=T.createContext(null);function SBn({url:e,name:n}){return f.jsx(Bh,{size:"small",href:e,download:n,"aria-label":kv({name:Ce(n)}),"data-tip":kv({name:Ce(n)}),"data-tip-align":"end",children:f.jsx(Db,{size:13})})}const CBn=T.lazy(()=>kBn(()=>import("./PdfPreview-BpcsGwOT.js"),__vite__mapDeps([0,1])).catch(e=>(console.error("PDF viewer failed to load",e),{default:tq})));function eq(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function tq({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[xtt()," ",f.jsxs("a",{href:e,download:n,children:[_3()," ",Ce(n)]})]})}function tk({kind:e,url:n,name:t,download:r=!0}){const[s,i]=T.useState(!1),a=T.useContext(lb);if(T.useEffect(()=>i(!1),[e,n]),s)return f.jsx(tq,{url:n,name:t});let o;return e==="image"?o=f.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:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?o=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?o=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):o=f.jsx(T.Suspense,{fallback:f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center",children:f.jsx(jt,{})}),children:f.jsx(CBn,{url:n,name:t,download:r,onError:()=>i(!0)},n)}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[o,r&&e!=="pdf"&&a&&ri.createPortal(f.jsx(SBn,{url:n,name:t}),a)]})}const EBn=e=>({queryKey:At("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function nq(e,n=!0){return ut({...EBn(e),enabled:n,subscribed:n}).data??null}function NBn(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function zBn(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),c=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const h=u.join("/");if(!h)return null;const _=new URLSearchParams(c);_.delete("path");const p=_.toString();return{path:h,url:`${lf(e,h)}${p?`&${p}`:""}${i}`}}function jBn(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` +---`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const rq="orx:files-tree-width",sq="orx:artifacts-collapsed:",iq=180,aq=320,ABn=8,TBn=280;function RBn(){try{const e=Number(localStorage.getItem(rq));if(Number.isFinite(e)&&e>=iq&&e<=aq)return e}catch{}return TBn}function MBn(e){try{const n=localStorage.getItem(`${sq}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function W0(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=W0(t.children??[],n);if(r)return r}}return null}function oq({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(NBn(i))return i;const a=zBn(e,n,i);if(!a)return null;const o=W0(r,a.path);if(!o)return a.url;const c=a.url.indexOf("#"),u=c===-1?a.url:a.url.slice(0,c),h=c===-1?"":a.url.slice(c);return`${u}&v=${o.modifiedAt}:${o.size}${h}`};return f.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-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_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-prose-emphasis [&_.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-sm [&_.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]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_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-start [&_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-start [&_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]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-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-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_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:f.jsx(_Tn,{remarkPlugins:[rH,[sH,uH]],rehypePlugins:[RF],components:{a:({href:i,children:a,...o})=>{const c=!i||i.startsWith("#"),u=c?i:s(i);return u?f.jsx("a",{...o,href:u,...c?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},..._H},children:aH(jBn(t))})})}function OBn(e){return e.presentation==="text"&&pC(e.name)?"markdown":eq(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function DBn(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=XL,i=d6(e,n.path),a=ut({...i,enabled:s,subscribed:s}),o=T.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});T.useEffect(()=>{const h=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&h.projectId===e&&h.path===n.path&&(h.modifiedAt!==n.modifiedAt||h.size!==n.size||h.version!==null&&h.version!==r)&&et.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const c=a.data;return{text:c&&!c.binary?c.content:null,binary:(c==null?void 0:c.binary)??!1,truncated:(c==null?void 0:c.truncated)??!1,error:c?null:((u=a.error)==null?void 0:u.message)??(c===null?Hfe():null),wantsText:s}}function LBn({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=OBn(n),i=nq(lf(e,n.path)),{text:a,binary:o,truncated:c,error:u,wantsText:h}=DBn(e,n,s,i),[_,p]=T.useState(!1),[m,w]=T.useState(null),k=s==="markdown",v=n.path.split("/").slice(0,-1).join("/"),b=`${lf(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let x;return s==="image"||s==="audio"||s==="video"||s==="pdf"?x=f.jsx(lb.Provider,{value:m,children:f.jsx(tk,{kind:s,url:b,name:n.name})}):s==="download"||!h||o?x=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?zfe():jhe()," ",f.jsx("a",{href:b,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?ID():Qfe()})]}):u?x=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[wde()," ",Ce(u)]}):a===null?x=f.jsxs(Kr,{children:[f.jsx(jt,{})," ",kD()]}):k&&!_?x=f.jsx(oq,{projectId:e,folder:v,markdown:a,entries:r}):x=f.jsx(JH,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head @container flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Ah,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ce(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0 @max-xl:hidden",children:[nhe()," ",new Date(n.modifiedAt).toLocaleString(E(),{dateStyle:"medium",timeStyle:"short"})]}),f.jsx("div",{ref:w,className:"contents"}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:nl(n.size)}),k&&f.jsx(Pt,{size:"small",active:_,"data-tip":_?Cv():Td(),"data-tip-align":"end","aria-label":_?Cv():Td(),onClick:()=>p(y=>!y),children:f.jsx(P3,{size:13})}),f.jsx(Bh,{size:"small",href:b,target:"_blank",rel:"noopener noreferrer","data-tip":JE(),"data-tip-align":"end","aria-label":JE(),children:f.jsx(_f,{size:13})}),f.jsx(Pt,{size:"small","data-tip":ZE(),"data-tip-align":"end","aria-label":ZE(),onClick:()=>{window.confirm(Gk({path:Ce(n.path)}))&&t(n.path)},children:f.jsx(Af,{size:13})})]}),f.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 ${k&&!_?"doc":""}`,children:[x,c&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:jde()})]})]})}function cq({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:h,onCancelRename:_}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var w;const m={paddingInlineStart:8+Math.min(n,ABn)*14};if(p.isDir){const k=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.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-start cursor-pointer font-[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:m,onClick:()=>s(p.path),children:[f.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":k?tfe({name:Ce(p.name)}):xfe({name:Ce(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ua,{size:13,className:k?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Pt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":pde(),"data-tip-align":"end","aria-label":hfe({name:Ce(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(Gk({path:Ce(p.path)}))&&o(p.path)},children:f.jsx(Af,{size:12})})]}),k&&(((w=p.children)==null?void 0:w.length)??0)>0&&f.jsx(cq,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:h,onCancelRename:_})]},p.path)}return c===p.path?f.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-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Ah,{name:p.name}),f.jsx(QH,{name:p.name,onCommit:k=>h(p.path,k),onCancel:_})]},p.path):f.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-start cursor-pointer font-[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===p.path?"selected":""}`,style:m,title:FQ({path:Ce(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:k=>{k.preventDefault(),i(p.path),u(k,p.path)},onAuxClick:k=>{k.button===1&&(k.preventDefault(),i(p.path),a(p.path))},onKeyDown:k=>{if(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10"){k.preventDefault(),i(p.path),u(k,p.path);return}if(k.key===" "){k.preventDefault(),k.stopPropagation(),i(p.path);return}k.key==="Enter"&&(k.preventDefault(),k.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Ah,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function IBn({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=T.useState(null),[a,o]=T.useState(()=>MBn(e.id)),[c,u]=T.useState(RBn),[h,_]=T.useState(null),[p,m]=T.useState(null),w=T.useRef(null);T.useEffect(()=>{try{localStorage.setItem(`${sq}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const k=z=>{var I;z.preventDefault(),z.currentTarget.setPointerCapture(z.pointerId);const A=(I=w.current)==null?void 0:I.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=B=>{const U=Math.round(B.clientX-((A==null?void 0:A.left)??0)),H=Math.min(Math.max(U,iq),aq);u(H);try{localStorage.setItem(rq,String(H))}catch{}},D=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",D),window.removeEventListener("pointercancel",D),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",D),window.addEventListener("pointercancel",D)};T.useEffect(()=>{if(!s||!n)return;const z=W0(n.entries,s);(!z||z.isDir)&&i(null)},[s,n]);const v=z=>o(A=>{const j=new Set(A);return j.has(z)?j.delete(z):j.add(z),j}),b=z=>{(s===z||s!=null&&s.startsWith(z+"/"))&&i(null),v2n(e.id,z).catch(()=>{})},x=async(z,A)=>{try{await b2n(e.id,z,A),A.action==="rename"&&s===z&&i(null)}catch(j){xn(j instanceof Error?j.message:String(j),"error")}},y=z=>{n&&WH(n.dir,z)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(Kr,{className:"p-5",children:[f.jsx(jt,{})," ",Qde()]})});const C=z=>f.jsx(cq,{entries:z,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(A,j)=>{_(XH(A,j))},onRename:(A,j)=>{m(null),x(A,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),N=s?W0(n.entries,s):null;return n.entries.length===0?f.jsx(gC,{icon:vS,title:lhe(),description:whe()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:w,style:{width:c},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:k}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:Lde()})]})]}),N?f.jsx(LBn,{projectId:e.id,entry:N,onDelete:b,artifactEntries:n.entries},N.path):f.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-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(kkn,{size:22,strokeWidth:1.5}),f.jsx("span",{children:nde()})]}),h&&f.jsx(YH,{target:h,onOpen:()=>t(h.path),onRename:r(h.path)?()=>m(h.path):void 0,onDuplicate:()=>void x(h.path,{action:"duplicate"}),onCopyPath:()=>y(h.path),onDelete:()=>{window.confirm(Gk({path:Ce(h.path)}))&&b(h.path)},onClose:()=>_(null)})]})}const lq=20*1024*1024,uq="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-base [&_h3]:font-semibold [&_h3]:text-text",_q="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",$Bn="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",BBn="text-sm font-normal text-text",PBn="mt-1 mb-0 text-sm leading-relaxed text-text";function fq(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function FBn(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function dq({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=T.useState(!1),a=T.useRef(null);return f.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 text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const c=(u=o.dataTransfer.files)==null?void 0:u[0];c&&r(c)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var c;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(c=a.current)==null||c.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const c=(u=o.target.files)==null?void 0:u[0];c&&r(c),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(jt,{}),f.jsx("span",{children:Ncn()})]}):f.jsxs(f.Fragment,{children:[f.jsx(Zkn,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function hq({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[nl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",go(n)]})]})}function HBn({skill:e,onError:n}){const t=dn({mutationFn:H2n}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:BBn,children:e.name}),e.origin&&f.jsx(Kt,{size:"small",children:e.origin})]}),f.jsx(hq,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Pt,{size:"small","data-tip":e.origin?Aan():Con(),"data-tip-align":"end","aria-label":e.origin?Uan({name:Ce(e.name)}):win({name:Ce(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?Ian({name:Ce(e.name)}):pin({name:Ce(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Af,{size:13})})]})}function qBn({template:e,onError:n}){const t=dn({mutationFn:B2n}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:$Bn,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:PBn,children:[e.entry,s>0&&(s===1?man():Yan({count:Xt(s)}))]})]}),f.jsx(hq,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Pt,{"data-tip":Ron(),"data-tip-align":"end","aria-label":Lin({name:Ce(e.name)}),disabled:r,onClick:()=>{window.confirm(jin({name:Ce(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Af,{size:13})})]})}function UBn(){var x;const e=dn({mutationFn:F2n}),n=ut(Mwn()),t=n.data,r=T.useRef(null),[s,i]=T.useState(!1),[a,o]=T.useState(!1),c=T.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);T.useLayoutEffect(()=>{c();const y=r.current;if(!y)return;const C=new ResizeObserver(c);return C.observe(y),()=>C.disconnect()},[t,c]);const u=n.isFetching,h=(x=n.error)==null?void 0:x.message,[_,p]=T.useState(!1),[m,w]=T.useState(null),k=()=>{n.refetch()},v=T.useRef(!1),b=T.useCallback(async y=>{if(!v.current){if(w(null),!FBn(y.name)){w(Fcn());return}if(y.size>lq){w(TL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await fq(y)})}catch(C){w(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:uq,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:ycn()}),f.jsxs(De,{className:"ms-auto",size:"small",onClick:k,disabled:u,children:[f.jsx(Ga,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Sm()]})]}),f.jsx("p",{className:_q,children:qin()}),f.jsx(dq,{accept:".md,.markdown,.zip",busy:_,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Xin()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:cin()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),h&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[son()," ",h]}),t===void 0?h?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",Von()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:acn()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:c,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(HBn,{skill:y,onError:w},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function GBn(){var h;const e=dn({mutationFn:$2n}),n=ut(Rwn()),t=n.data,r=(h=n.error)==null?void 0:h.message,[s,i]=T.useState(!1),[a,o]=T.useState(null),c=T.useRef(!1),u=T.useCallback(async _=>{if(c.current)return;o(null);const p=_.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(Wcn());return}if(_.size>lq){o(TL());return}c.current=!0,i(!0);try{await e.mutateAsync({filename:_.name,contentBase64:await fq(_)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{c.current=!1,i(!1)}},[]);return f.jsxs("section",{className:uq,children:[f.jsx("h3",{children:Bon()}),f.jsx("p",{className:_q,children:Ocn()}),f.jsx(dq,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:ran()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Ddn()})]}),onFile:_=>void u(_)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[_on()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(jt,{})," ",Jon()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:dcn()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(_=>f.jsx(qBn,{template:_,onError:o},_.name))})]})}function VBn(){return f.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:[f.jsx("h1",{children:von()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:kan()}),f.jsx(UBn,{}),f.jsx(GBn,{})]})}const KBn="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function qc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-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-hover-strong [&_.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-0 [&: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]:-start-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]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?KBn:""}`,onClick:i,onDoubleClick:a,title:s?zdn({label:n}):n,"aria-label":s?xdn({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:NNe(),onPointerDown:c=>c.preventDefault(),onClick:c=>{c.stopPropagation(),o()},children:f.jsx(cr,{size:12})})]})}const LR=["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 WBn({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:LR,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:LR,href:Mb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:Sv({name:Ce(t)}),children:[f.jsx("code",{children:t}),f.jsx(Ub,{size:12})]})}const x4=["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-sm","[&_h2]:font-semibold"].join(" "),IR=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function $R(e){return new Date(e).toLocaleString(E(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function BR(e,n){return T0((e.endedAt??n)-e.createdAt)}function QBn({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(h=>h.status==="running"||h.status==="starting"),[c,u]=T.useState(()=>Date.now());return T.useEffect(()=>{if(!o)return;u(Date.now());const h=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(h)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.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:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx(cl,{status:a?aa(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(De,{...Vr(h=>s(a.id,h)),children:[f.jsx(vo,{size:15}),uLe()]}),f.jsxs(De,{...Vr(i),children:[f.jsx($b,{size:15}),pDe()]})]}),e.description&&f.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-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:LDe()}),f.jsx(Jo,{text:e.description})]}),f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:a?cDe():$Le()}),a&&f.jsxs(f.Fragment,{children:[f.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:[f.jsx(cl,{status:aa(a)}),f.jsx(RS,{backend:a.backend}),f.jsxs("span",{title:TLe(),children:[f.jsx(c5n,{size:13}),$R(a.createdAt)]}),f.jsxs("span",{title:qDe(),children:[f.jsx(x5n,{size:13}),BR(a,c)]}),a.commitSha&&f.jsxs("span",{title:wDe(),children:[f.jsx(Y5n,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[XDe()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:IR,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(Jo,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:"Git"}),f.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:[f.jsx(WBn,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[rLe()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:$R(e.createdAt),children:[jDe()," ",go(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:IR,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:x4,children:[f.jsx("h2",{children:SLe()}),f.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-start [&_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((h,_)=>f.jsxs("button",{...Vr(p=>s(h.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[gLe()," ",r.length-_]}),f.jsx(cl,{status:aa(h)}),f.jsx("span",{children:go(h.createdAt)}),f.jsx("span",{children:BR(h,c)}),f.jsx(vo,{size:13})]},h.id))})]})]})})}function PR(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=Pb(t,!0);let i=!1,a=0,o=!1,c=!1;async function u(){if(o){c=!0;return}o=!0;try{for(;;){const _=await axn(e,a);if(i)return;if(_.dataBase64&&r.write(PR(_.dataBase64)),a=_.nextOffset,_.eof)break}}catch{}finally{o=!1,c&&!i&&(c=!1,u())}}const h=Fwn(e,_=>{if(i)return;const p=PR(_.dataBase64);!o&&_.offset===a?(r.write(p),a+=p.length):_.offset+p.length>a&&u()});return u(),()=>{i=!0,h(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function YBn({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:c}){const u=r.filter(h=>h.experimentId===e.id).sort((h,_)=>_.createdAt-h.createdAt);return t==="overview"?f.jsx(QBn,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(h,_)=>o("terminal",h,_),onOpenCode:h=>c("files",h)}):f.jsx(ZBn,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function ZBn({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=T.useState(null),[a,o]=T.useState(null),[c,u]=T.useState(!1),h=T.useRef(null),_=t?n.find(v=>v.id===t)??null:n[0]??null,p=(_==null?void 0:_.status)==="running"||(_==null?void 0:_.status)==="starting",m=!!(_&&p&&(_.cancelRequested||a===_.id)),w=v=>{const b=n.findIndex(x=>x.id===v);return b===-1?n.length:n.length-b};T.useEffect(()=>{if(!c)return;const v=b=>{var x;(x=h.current)!=null&&x.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c]);async function k(){if(_){i(null),o(_.id);try{await HL(_.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.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:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(De,{size:"small",variant:"ghost",disabled:m,onClick:()=>void k(),children:[f.jsx($I,{size:13}),m?Nze():OD()]}),n.length>0&&_&&f.jsxs("div",{className:"run-history relative shrink-0",ref:h,children:[f.jsxs(De,{title:JMe(),"aria-expanded":c,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[ON()," ",w(_.id)]}),f.jsx(cl,{status:m?"cancelling":aa(_)}),f.jsx(sc,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),c&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(Cn,{className:"justify-start",active:v.id===(_==null?void 0:_.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[ON()," ",w(v.id)]}),f.jsx(cl,{status:aa(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:go(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:_?f.jsx(XBn,{runId:_.id},_.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?_o():PMe()})})]})}let nk=!1;function FR(e){nk=!0;try{return window.confirm(e)}finally{nk=!1}}const rk=e=>e.replace(/\r\n/g,` `),HR=(e,n,t)=>{const r=rk(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r `),conflict:null}},Kc=e=>e.draft!==e.baseline,JBn=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),ePn=e=>e.crlf?e.draft.replace(/\n/g,`\r -`):e.draft;function tPn(e,n,t){return!Kc(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class nPn{constructor(){Ws(this,"buffer",null);Ws(this,"listeners",new Set);Ws(this,"saving",!1);Ws(this,"saveError",null);Ws(this,"revision",0);Ws(this,"saveRevision",0);Ws(this,"getSnapshot",()=>this.buffer);Ws(this,"getRevision",()=>this.revision);Ws(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Ws(this,"set",n=>{this.buffer=n,this.notify()});Ws(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Ws(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Ws(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Kc(this.buffer)||this.buffer.conflict!==null)}}function rPn({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var Z,Y,$;const c=ut({...xCn(),enabled:r,subscribed:r}),u=((Z=c.data)==null?void 0:Z.engine)??(c.isPending?void 0:null),h=((Y=c.data)==null?void 0:Y.hint)??null,_=(($=c.data)==null?void 0:$.installCommand)??null,[p,m]=T.useState(!1),[w,k]=T.useState(null),[v,b]=T.useState(null),[x,y]=T.useState(!1),[C,N]=T.useState(null),[z,A]=T.useState(null),[j,M]=T.useState(!1),[D,I]=T.useState(0),B=T.useCallback(L=>{M(L),L&&I(F=>F+1)},[]),U=T.useRef(o);U.current=o;const H=T.useRef(!1),Q=T.useRef(null),V=T.useCallback(()=>{if(H.current)return;Q.current=n,H.current=!0,m(!0);const L=U.current;A(null),b(null),N(null),mxn(e,n,{sessionId:t}).then(F=>{var K,ne;const q=F.pdfPath;if(F.ok&&q){k(ae=>({path:q,version:((ae==null?void 0:ae.version)??0)+1,source:L})),y(F.hadErrors),N(F.note),F.hadErrors&&b(((K=F.log)==null?void 0:K.trim())||null),B(!0);return}k(null),y(!1),N(F.note),M(!1),b(((ne=F.log)==null?void 0:ne.trim())||OZe())}).catch(F=>{k(null),y(!1),N(null),M(!1),A(F instanceof Error?F.message:String(F))}).finally(()=>{H.current=!1,m(!1)})},[e,n,t,B]);return T.useEffect(()=>{!r||!s||!a||!u||Q.current!==n&&V()},[r,s,a,u,n,V]),{engine:u,installHint:h,installCommand:_,compiling:p,compiled:w,stale:w!==null&&w.source!==o,log:v,builtWithErrors:x,note:C,error:z,showPdf:j,setShowPdf:B,viewNonce:D,compile:()=>{i==null||i(),V()},dismiss:()=>{A(null),b(null)}}}const sPn=3e4,iPn=3e4,aPn=5*6e4;function oPn({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:c}){var ue,se,G,oe;const u=T.useMemo(()=>kCn(e,n,{sessionId:t}),[e,n,t]),h=ut({...u,enabled:r,subscribed:r}),_=((ue=h.data)==null?void 0:ue.hasToken)??!1,p=((se=h.data)==null?void 0:se.hasSession)??!1,m=((G=h.data)==null?void 0:G.link)??null,w=!h.isPending,[k,v]=T.useState(null),[b,x]=T.useState(0),[y,C]=T.useState(!1),[N,z]=T.useState(null),[A,j]=T.useState(null),[M,D]=T.useState(!1),I=T.useCallback(ce=>{Un(u.queryKey)&&et.setQueryData(u.queryKey,he=>he&&{...he,hasSession:ce})},[u]),B=T.useCallback(ce=>{Un(u.queryKey)&&et.setQueryData(u.queryKey,ce)},[u]);T.useEffect(()=>{z(null),x(0),L.current=!1,j(null),D(!1),V.current=!1},[r,e,n,t]),T.useEffect(()=>{D(!1)},[a]);const U=T.useRef(!1),H=T.useRef(c);H.current=c;const Q=T.useRef(o);Q.current=o;const V=T.useRef(!1),Z=T.useCallback(ce=>!_||!m||U.current||Q.current?!1:(U.current=!0,C(!0),j(null),Exn(e,n,{sessionId:t,resolve:ce}).then(he=>{V.current=!1,z(he),he.pulled.includes(n)&&(Q.current?D(!0):H.current(he.pulled))}).catch(he=>{V.current=!0,z(null),j(he instanceof Error?he.message:String(he))}).finally(()=>{U.current=!1,C(!1)}),!0),[e,n,t,_,m]),Y=T.useRef(null),$=(k==null?void 0:k.state)==="live";T.useEffect(()=>{if(!r||!s||!w||!_||!m||o||$)return;const ce=`${n}:${m.projectId}:${a}`;Y.current!==ce&&Z()&&(Y.current=ce)},[r,s,w,_,m,n,a,o,y,Z,$]);const L=T.useRef(!1);!y&&N&&N.conflicts.length===0&&!A&&(L.current=!0);const F=r&&w&&!!m&&_&&p&&L.current,q=T.useRef(null),K=T.useRef(Promise.resolve()),ne=T.useRef(!1);ne.current=(k==null?void 0:k.state)==="stopped"&&k.error!=null;const ae=T.useRef(!1);return T.useEffect(()=>{if(!F)return;let ce=!1;const he=()=>{const Re=ae.current;ae.current=!1,!(!Re&&ne.current)&&(K.current=K.current.then(()=>{if(!ce)return xxn(e,n,{sessionId:t,retry:Re}).then(Le=>{var Ke;ce||((q.current===null||((Ke=Le.status)==null?void 0:Ke.state)==="stopped")&&v(Le.status),q.current=Le.key)}).catch(Le=>{ce||v({state:"stopped",error:Le instanceof Error?Le.message:String(Le),needsSession:!1,note:null})})}))};he();const be=setInterval(he,iPn);return()=>{ce=!0,clearInterval(be),q.current=null,v(null),K.current=K.current.then(()=>wxn(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),T.useEffect(()=>Kwn(ce=>{if(ce.key===q.current){if(ce.type==="live"){v(ce.status);return}ce.paths.includes(n)&&(Q.current?D(!0):H.current(ce.paths))}}),[n]),T.useEffect(()=>{if(!r||!s||!w||!_||!m||o||$)return;const ce=setInterval(()=>{U.current||V.current||et.fetchQuery({...SCn(e,n,{sessionId:t}),staleTime:0}).then(he=>{he.remoteChanged&&Z()}).catch(he=>{V.current=!0,j(he instanceof Error?he.message:String(he))})},sPn);return()=>clearInterval(ce)},[r,s,w,_,m,o,e,n,t,Z,$]),T.useEffect(()=>{if(!r||!s||!w||!_||!m||!$)return;const ce=setInterval(Z,aPn);return()=>clearInterval(ce)},[r,s,w,_,m,$,Z]),{hasToken:_,hasSession:p,live:k,retryLive:()=>{ae.current=!0,x(ce=>ce+1)},link:m,loaded:w,syncing:y,last:N,error:A??((oe=h.error)==null?void 0:oe.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>D(!1),uploadUrl:zxn(e,n,{sessionId:t}),saveToken:async ce=>{const he=await UL(ce);Y.current=null,V.current=!1,j(null),Un(u.queryKey)&&et.setQueryData(u.queryKey,be=>be&&{...be,hasToken:he.hasToken})},saveSession:async ce=>{const he=await GL(ce,{host:m==null?void 0:m.host});I(he.hasSession),ae.current=!0,x(be=>be+1)},importSession:async()=>{const ce=await yxn({host:m==null?void 0:m.host});return I(ce.hasSession),ae.current=!0,x(he=>he+1),ce.source},linkProject:async ce=>{z(null),v(null),L.current=!1,Y.current=null,B(await Sxn(e,n,{project:ce,sessionId:t})),i==null||i()},unlink:async()=>{B(await Cxn(e,n,{sessionId:t})),Y.current=null,V.current=!1,z(null),j(null)},sync:ce=>{V.current=!1,Z(ce)&&(Y.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}const qR=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],cPn=4e6,lPn=200,UR=16e6,uPn=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),GR=e=>e.startsWith("//")?`https:${e}`:e;async function _Pn(e,n){var s;let t=cPn;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:c}of e){if(r.has(o)){const w=r.get(o);w&&i.setAttribute(a,w);continue}if(n.aborted)return;if(r.size>=lPn)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const h=u.headers.get("content-type")??"",_=Number(u.headers.get("content-length"));if(!c.some(w=>h.startsWith(w))||!(Number.isFinite(_)&&_>0&&_<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await uPn(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function fPn(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll(qR.map(c=>c.selector).join(", ")))for(const{selector:c,attribute:u,typePrefixes:h}of qR){if(!o.matches(c))continue;const _=o.getAttribute(u);if(!_)continue;const p=n(_);p&&(p===_?o.setAttribute(u,GR(_)):s.push({element:o,attribute:u,url:p,typePrefixes:h}))}await _Pn(s,t);for(const o of r.querySelectorAll("a[href]")){const c=o.getAttribute("href");!c||!C6(c)||(o.setAttribute("href",GR(c)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function dPn(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${UR-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>UR}}function hPn({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=T.useState(null);return T.useEffect(()=>{let o=!1;const c=new AbortController;return a(null),dPn(e,n,t,c.signal).then(async({text:u,partial:h})=>({source:await fPn(u,s,c.signal),partial:h})).then(u=>{o||a(u)}),()=>{o=!0,c.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(jt,{})," ",$D()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:VFe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:JFe({name:Ce(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function pPn({overleaf:e}){var _;const n=T.useRef(null),{open:t,setOpen:r,ref:s}=ga(n),i=T.useId(),[a,o]=T.useState({top:0,left:0,maxHeight:0}),c=((_=e.last)==null?void 0:_.conflicts.length)??0,u=e.hasToken&&!!e.error,h=u?p3():c?Xmt():!e.hasToken||!e.link?_yt():e.syncing?nL():e.blocked?tL():ZD();return T.useEffect(()=>{c&&r(!0)},[c,r]),T.useEffect(()=>{u&&xn(p3(),"error",{id:i,duration:5e3})},[u,e.error,i]),T.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),w=Math.min(p.bottom+6,window.innerHeight-80);o({top:w,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-w-8}),(s.current.querySelector("input")??s.current).focus();const k=()=>r(!1),v=b=>{var x;b.target instanceof Node&&!((x=s.current)!=null&&x.contains(b.target))&&k()};return window.addEventListener("resize",k),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Pt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":h,"data-tip-align":"end","aria-label":zZ({status:h}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(jt,{}):f.jsx(C5n,{size:13,className:u||c?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&ri.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":xL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Pt,{size:"small","aria-label":dFe(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(cr,{size:13})})}),f.jsx(yPn,{overleaf:e})]}),document.body)]})}const z1=e=>na(new Intl.ListFormat(E()).format(e.map(Ce)));function mPn(e){if(e.error)return Lgt();if(e.syncing)return nL();if(e.blocked)return tL();const n=e.last;return n?n.pulled.length&&n.pushed.length?Sbt({pulled:z1(n.pulled),pushed:z1(n.pushed)}):n.pulled.length?gbt({paths:z1(n.pulled)}):n.pushed.length?Tbt({paths:z1(n.pushed)}):n.conflicts.length?I1t():ZD():rbt()}function gPn({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:eL()})}function vPn(e){return e.state==="live"?r1t():e.state==="connecting"?Xgt():e.error??g1t()}function VR({overleaf:e,replacing:n}){const[t,r]=T.useState(""),[s,i]=T.useState(!1),[a,o]=T.useState(!1),[c,u]=T.useState(null),h=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},_=a?Syt():n?$bt():mgt();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:_}),a&&f.jsx(Gr,{className:"basis-full min-w-0","aria-label":h3(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:h3(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(jt,{}),a?f.jsx(De,{type:"button",disabled:s||!t.trim(),onClick:()=>h(()=>e.saveSession(t.trim())),children:s?pa():qmt()}):f.jsx(De,{type:"button",disabled:s,onClick:()=>h(e.importSession),children:kgt()}),f.jsx(De,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?JD():ubt()})]}),c&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:c})]})}function bPn({overleaf:e}){if(!e.hasSession)return f.jsx(VR,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:S1t()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:vPn(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(De,{onClick:e.retryLive,children:u1t()})}),t&&f.jsx(VR,{overleaf:e,replacing:!0})]})}function yPn({overleaf:e}){var p,m,w;const[n,t]=T.useState(""),[r,s]=T.useState(!1),[i,a]=T.useState(null),[o,c]=T.useState(!1),u=()=>{t(""),a(null),c(!0)},h=!e.hasToken||o;async function _(k){k.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{h?(await e.saveToken(v),c(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!h){const k=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(jt,{}),e.error?p3():mPn(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(bPn,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(De,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?Gbt():((m=e.live)==null?void 0:m.state)==="live"?Iyt():void 0,onClick:()=>e.sync(),children:e.error?ti():Avt()}),f.jsxs(bh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[gvt()," ",f.jsx(_f,{size:12})]})]}),k.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",rvt()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(De,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:uvt()}),f.jsx(De,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Xvt()})]})]},v)),((w=e.last)==null?void 0:w.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:aS()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(De,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:gz()}),f.jsx(bh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:eL()}),f.jsx(De,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Ivt()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:_,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:h?Xyt():rxt()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Gr,{className:"basis-full min-w-0","aria-label":h?pz():mz(),"aria-invalid":!!i,type:h?"password":"text",value:n,onChange:k=>t(k.target.value),placeholder:h?pz():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(De,{type:"submit",disabled:r||!n.trim(),children:r?h?pa():_a():h?syt():qgt()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:h?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:h?rgt():mz()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(gPn,{href:e.uploadUrl}),o?f.jsx(De,{variant:"ghost",type:"button",onClick:()=>c(!1),children:JD()}):e.hasToken&&f.jsx(De,{variant:"ghost",type:"button",onClick:u,children:gz()})]})]})}function xPn({command:e}){const[n,t]=T.useState("idle"),r=T.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Pt,{"data-tip":n==="copied"?af():n==="select"?RUe():oPe(),"aria-label":NPe(),onClick:()=>void s(),children:n==="copied"?f.jsx(gi,{size:13}):f.jsx(zf,{size:13})})]})}function KR(e){const[n,t]=T.useState(!1),[r,s]=T.useState(null);return{busy:n,error:r,trigger:async()=>{t(!0),s(null);try{await e()}catch(a){s(a instanceof Error?a.message:String(a))}finally{t(!1)}}}}function wPn({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:c,onScrollPositionChange:u,lineScrollRequest:h,onLineScrollRequestHandled:_,onEdit:p,artifactVersion:m,artifactEntries:w=[],bufferSession:k,remote:v=!1,restored:b=!1,onRestoreActivated:x,showSource:y=!1,onShowSourceChange:C}){var Qr,On;const N=Y$(e,n,t??"repo",r,s),z=ut({...N,enabled:!k.saving}),A=z.data??null,j=((Qr=z.error)==null?void 0:Qr.message)??null,M=We=>{is(N.queryKey,yt=>(typeof We=="function"?We(yt??null):We)??void 0)},[D,I]=T.useState(0),B=t==="artifacts",U=t==="abs",H=pC(n),Q=KH(n),V=gBn(n),Z=H||V,[Y,$]=T.useState(!1),L=!b||Y,F=()=>{$(!0),x==null||x()};T.useSyncExternalStore(k.subscribe,k.getRevision);const q=k.getSnapshot(),K=k.set,ne=k.saving,ae=k.setSaving,ue=k.saveRevision,se=k.saveError,G=k.setSaveError,oe=T.useRef(null),ce=T.useRef(null),[he,be]=T.useState(!1),[Re,Le]=T.useState(null),Ke=T.useRef(c),Ne=(A==null?void 0:A.file)??null,xe=q&&Kc(q)?q.path:(A==null?void 0:A.source)==="checkout"?A.file.path:n,rt=xe.split("/").slice(0,-1).join("/"),Ze=(A==null?void 0:A.source)==="artifact",ot=T.useCallback(We=>{var yt;return((yt=l5(rt,We,U))==null?void 0:yt.path)??null},[U,rt]),kt=T.useCallback(We=>U?qL(We):Ze?lf(e,We):k3(e,We,{sessionId:r,ref:s}),[Ze,s,U,e,r]),qt=T.useCallback(We=>{if(C6(We))return We;const yt=l5(rt,We,U);return yt?V9n(kt(yt.path),yt):null},[U,rt,kt]),dt=eq(Ne==null?void 0:Ne.presentation),pt=(A==null?void 0:A.source)==="artifact"&&!B,Ie=B&&(A==null?void 0:A.source)==="checkout",pe=!s&&(A==null?void 0:A.source)==="checkout"&&Ne!=null&&!Ne.notFound,je=r!=null&&(A==null?void 0:A.source)==="checkout"&&A.file.root==="clone",He=pe&&Ne!=null&&!Ne.binary&&!Ne.truncated&&!dt&&!je,st=He&&Ne.version===void 0,_t=q!==null&&Kc(q),Ct=!st&&(He&&typeof Ne.version=="string"||_t),bt=(q==null?void 0:q.draft)??rk((Ne==null?void 0:Ne.content)??""),Yt=(q==null?void 0:q.baseline)??rk((Ne==null?void 0:Ne.content)??""),un=Ct&&q!==null&&Kc(q),Tt=async We=>{const yt=k.getSnapshot();if(!Ct||!yt||!Kc(yt))return!0;if(k.saving)return!1;if(yt.conflict&&We===void 0)return G(yt.conflict.exists?DN():$N()),!1;const Jn=yt.draft,pr=ePn(yt);ae(!0),G(null);try{await et.cancelQueries(N);const pn=await _xn(e,xe,pr,{sessionId:r,expectedVersion:We??yt.version});return k.getSnapshot()?(k.saved(Jn,pn.version),M(An=>An&&An.source==="checkout"?{source:"checkout",file:{...An.file,content:pr,version:pn.version}}:An),!0):!1}catch(pn){if(pn instanceof w3){const Tr=k.getSnapshot();return!Tr||!Kc(Tr)||K({...Tr,conflict:{currentVersion:pn.currentVersion,exists:pn.exists}}),!1}return G(pn instanceof Error?pn.message:String(pn)),!1}finally{ae(!1)}},ht=Q&&pe&&!je,mt=rPn({projectId:e,filePath:xe,sessionId:r,enabled:ht,autoRun:L,onManualAction:F,ready:Ne!=null&&!Ne.notFound,source:Ct?bt:(Ne==null?void 0:Ne.content)??""}),_n=oPn({projectId:e,filePath:xe,sessionId:r,enabled:ht,autoRun:L,onManualAction:F,savedSource:Yt,dirty:un,onPulled:T.useCallback(We=>{We.includes(xe)&&I(yt=>yt+1)},[xe])}),gs=Q&&mt.showPdf&&mt.compiled!=null,br=st&&_t,Kt=(Ct||br)&&!(Z&&!y)&&!gs,Bn=Ne!==null&&!Ne.notFound&&!Ne.binary&&!dt&&!gs,_r=Bn&&!Kt&&(!V||y),yr=async()=>{if(Ne)try{if(Ne.truncated&&!Kt){const We=fetch(kt(xe)).then(async yt=>{if(!yt.ok)throw new Error;return new Blob([await yt.text()],{type:"text/plain"})});await navigator.clipboard.write([new ClipboardItem({"text/plain":We})])}else await navigator.clipboard.writeText(Kt?bt:Ne.content);be(!0),window.setTimeout(()=>be(!1),1500)}catch{xn(yPe(),"error")}},Wr=We=>{if(!We.metaKey&&!We.ctrlKey||We.altKey||We.shiftKey||We.key.toLowerCase()!=="a"||!(We.target instanceof Node)||!We.currentTarget.contains(We.target))return;const yt=ce.current;if(!yt)return;We.preventDefault();const Jn=document.createRange();Jn.selectNodeContents(yt);const pr=window.getSelection();pr==null||pr.removeAllRanges(),pr==null||pr.addRange(Jn)},Nt=mt.compiled?`${k3(e,mt.compiled.path,{sessionId:r})}&v=${mt.compiled.version}`:null,vn=Nt?`${Nt}&view=${mt.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,fn=mt.compiled?mt.compiled.path.split("/").pop()??mt.compiled.path:null,hn=async()=>{un&&!await Tt()||Q&&mt.engine&&mt.compile()},Ir=async()=>{un&&(L?await hn():await Tt())},bn=KR(()=>dxn(e,xe,{sessionId:r})),yn=KR(()=>hxn(e,xe,{sessionId:r})),Pn=v?fqe():Ne!=null&&Ne.notFound?FN():s?iqe({branch:Ce(s)}):pe?null:bqe(),Et=T.useCallback(()=>{k.saving||I(We=>We+1)},[k]),Bt=()=>{K(null),G(null),Et()},In=nq(kt(xe),!s&&!ne);T.useEffect(()=>{if(!j||s)return;const We=window.setInterval(()=>{document.visibilityState!=="hidden"&&Et()},2e3);return()=>window.clearInterval(We)},[j,s,Et]);const xr=`${kt(xe)}&v=${encodeURIComponent(In??m??"")}&reload=${D}`;T.useEffect(()=>{var Jn,pr;if(!A||k.saving)return;const We=A,yt=k.getSnapshot();if(yt&&Kc(yt)){const pn=We.source==="checkout"?We.file:null,Tr=pn!==null&&pn.path===yt.path&&(!r||pn.root==="worktree"),An=tPn(yt,Tr&&typeof pn.version=="string"?pn.version:null,Tr&&!pn.notFound);An&&(An.currentVersion!==((Jn=yt.conflict)==null?void 0:Jn.currentVersion)||An.exists!==((pr=yt.conflict)==null?void 0:pr.exists))?K({...yt,conflict:An}):!An&&yt.conflict&&K({...yt,conflict:null})}(!yt||!Kc(yt))&&We.source==="checkout"&&!We.file.notFound&&!We.file.binary&&!We.file.truncated&&typeof We.file.version=="string"&&(K(HR(We.file.path,We.file.content,We.file.version)),G(null))},[A,k,r,ne,ue]);const fr=JSON.stringify(N.queryKey),Fn=T.useRef({sourceKey:fr,nonce:D,artifactVersion:m,diskVersion:In});T.useEffect(()=>{const We=Fn.current;Fn.current={sourceKey:fr,nonce:D,artifactVersion:m,diskVersion:In},We.sourceKey===fr&&(We.nonce!==D||We.diskVersion!==null&&We.diskVersion!==In||We.artifactVersion!=null&&We.artifactVersion!==m)&&CCn(e,n,t??"repo",r,s)},[fr,D,m,In,e,n,t,r,s]),T.useLayoutEffect(()=>{const We=oe.current,yt=Ke.current;!We||!Ne||!yt||(We.scrollTop=yt.top,We.scrollLeft=yt.left)},[Ne]);const sr=We=>{if(We.source==="absolute")return RHe();if(B)return vHe({root:r?Zg():Yg()});if(s)return CHe({branch:Ce(s)});if(r&&We.source==="checkout"&&We.file.root==="clone")return TGe();const yt=We.source==="checkout"?We.file.root:We.checkoutRoot;return BHe({root:yt==="worktree"?Zg():Yg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",onKeyDown:Wr,children:[f.jsxs("div",{className:"file-view-header @container flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Ah,{name:xe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ce(xe),children:xe.split("/").pop()||xe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap [&_svg]:flex-none",title:WQ({branch:Ce(a)}),children:[f.jsx(Nm,{size:11}),a]}),Kt&&(ne||un||se)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${se?"text-accent-red":"text-muted"}`,title:se??(ne?pa():gGe()),children:ne?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",CUe()]}):se?vUe():BD()}),f.jsx("div",{ref:Le,className:"contents"}),Q&&mt.compiled&&f.jsx(Pt,{size:"small",active:!mt.showPdf,"data-tip":mt.stale&&mt.showPdf?Pqe():mt.showPdf?Td():GN(),"data-tip-align":"end","aria-label":mt.showPdf?Td():GN(),onClick:()=>mt.setShowPdf(!mt.showPdf),children:mt.showPdf?f.jsx(P3,{size:13}):f.jsx(Ib,{size:13,className:mt.stale?"text-accent-amber":void 0})}),Q&&Nt&&fn&&f.jsx(Bh,{size:"small","data-tip":mt.stale?EFe({name:Ce(fn)}):kv({name:Ce(fn)}),"data-tip-align":"end","aria-label":kv({name:Ce(fn)}),href:Nt,download:fn,children:f.jsx(Db,{size:13,className:mt.stale?"text-accent-amber":void 0})}),ht&&f.jsx(pPn,{overleaf:_n}),Q&&pe&&f.jsx(Pt,{size:"small","data-tip":mt.compiled?qN():LN(),"data-tip-align":"end","aria-label":mt.compiled?qN():LN(),disabled:mt.compiling||!mt.engine,onClick:()=>void hn(),children:mt.compiling?f.jsx(jt,{}):f.jsx(D5n,{size:13})}),Z&&f.jsx(Pt,{size:"small",active:y,"data-tip":y?Cv():Td(),"data-tip-align":"end","aria-label":y?Cv():Td(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(P3,{size:13})}),Bn&&f.jsx(Pt,{size:"small","data-tip":he?af():IN(),"data-tip-align":"end","aria-label":he?af():IN(),onClick:()=>void yr(),children:he?f.jsx(gi,{size:13}):f.jsx(zf,{size:13})}),Ne!=null&&f.jsxs(f.Fragment,{children:[f.jsx(Pt,{size:"small","data-tip":Pn??bn.error??HN(),"data-tip-align":"end","aria-label":HN(),"aria-description":Pn??void 0,disabled:bn.busy||Pn!=null,onClick:()=>void bn.trigger(),children:bn.busy?f.jsx(jt,{}):f.jsx(_f,{size:13})}),f.jsx(Pt,{size:"small","data-tip":Pn??yn.error??UN(),"data-tip-align":"end","aria-label":UN(),"aria-description":Pn??void 0,disabled:yn.busy||Pn!=null,onClick:()=>void yn.trigger(),children:yn.busy?f.jsx(jt,{}):f.jsx(Lu,{size:13})})]})]}),!j&&Ie&&(A==null?void 0:A.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:VHe({root:A.file.root==="worktree"?Zg():Yg()})}),st&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:SGe()}),j&&Ne!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[PN()," ",Ce(j)]}),(q==null?void 0:q.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:q.conflict.exists?DN():$N()}),((On=q==null?void 0:q.conflict)==null?void 0:On.exists)&&q.conflict.currentVersion&&f.jsx(De,{disabled:ne,onPointerDown:We=>We.preventDefault(),onClick:()=>{var We;return void Tt(((We=q.conflict)==null?void 0:We.currentVersion)??void 0)},children:Mqe()}),f.jsx(De,{disabled:ne,onPointerDown:We=>We.preventDefault(),onClick:Bt,children:iUe()})]}),(mt.error||mt.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${mt.builtWithErrors?"text-subtext":"text-accent-red"}`,children:mt.error??(mt.builtWithErrors?ePe():FBe())}),f.jsx(Pt,{"data-tip":JPe(),"data-tip-align":"end","aria-label":aFe(),onClick:mt.dismiss,children:f.jsx(cr,{size:13})})]}),mt.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:mt.log})]}),ht&&_n.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:Eqe()}),f.jsx(De,{onClick:()=>{_n.reloaded(),I(We=>We+1)},children:PPe()})]}),Q&&pe&&mt.engine===null&&mt.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[mt.installHint,mt.installCommand&&f.jsx(xPn,{command:mt.installCommand})]}),mt.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:mt.note}),gs&&mt.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:YUe()}),f.jsxs("div",{ref:oe,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",tabIndex:_r?0:void 0,onScroll:We=>{const yt={top:Math.max(0,We.currentTarget.scrollTop),left:Math.max(0,We.currentTarget.scrollLeft)};Ke.current=yt,u==null||u(yt)},children:[!Kt&&!j&&!B&&(A==null?void 0:A.source)==="checkout"&&!A.file.notFound&&!s&&r&&A.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:sGe()}),!Kt&&!j&&(A==null?void 0:A.source)==="artifact"&&!A.file.notFound&&pt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:xBe({root:A.checkoutRoot==="worktree"?Zg():Yg()})}),j&&Ne===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[PN()," ",Ce(j)]}):Ne===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:$D()}):Kt?f.jsx(F$,{value:bt,onChange:We=>{const yt=k.getSnapshot()??(Ne&&typeof Ne.version=="string"?HR(Ne.path,Ne.content,Ne.version):null);yt&&K(JBn(yt,We)),p==null||p(),se&&G(null)},onSave:()=>void Ir(),onBlur:()=>{nk||Ir()},readOnly:br,path:n,highlightLine:i,scrollRequest:h,onScrollRequestHandled:_,scrollPosition:Ke.current,onScrollPositionChange:We=>{Ke.current=We,u==null||u(We)}}):Ne.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:A?sr(A):FN()}):dt?f.jsx(lb.Provider,{value:Re,children:f.jsx(tk,{kind:dt,url:xr,name:n.split("/").pop()??n})}):Ne.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[zBe()," ",f.jsx("a",{href:xr,download:n.split("/").pop()??n,children:ID()})]}):gs&&vn&&fn?f.jsx(lb.Provider,{value:Re,children:f.jsx(tk,{kind:"pdf",url:vn,name:fn,download:!1},vn)}):H&&!y?f.jsx("div",{ref:ce,className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:Ze?f.jsx(oq,{projectId:e,folder:rt,markdown:Ne.content,entries:w}):f.jsx(Jo,{text:Ne.content,resolveFilePath:ot,resolveImageSrc:qt,onOpenFile:o&&((We,yt,Jn,pr,pn)=>o(We,r,s,pn))})}):V&&!y?f.jsx(hPn,{html:Ne.content,truncated:Ne.truncated,url:xr,name:xe,resolveSrc:qt}):f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:ce,children:f.jsx(JH,{text:Ne.content,path:n,highlightLine:i,scrollRequest:h,onScrollRequestHandled:_})}),Ne.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:BFe()})]})]})]})}const w4=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function kPn({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=ga(),c=T.useRef(null);return T.useEffect(()=>{if(!i)return;const u=h=>{var _;h.key==="Escape"&&((_=c.current)==null||_.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Pt,{size:"small",className:"project-back text-text","aria-label":KN(),onClick:n,children:f.jsx(R0,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:fXe()}),s&&f.jsx(Pt,{size:"small","data-tip":WN(),"data-tip-align":"end","aria-label":WN(),onClick:s,children:f.jsx(KI,{size:18})})]}),f.jsxs("button",{ref:c,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(sc,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(Cn,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:w4,children:[f.jsx(HI,{size:14}),VQe()]})}),f.jsx(Cn,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:w4,children:[f.jsx(UI,{size:14}),KN()]})}),f.jsx(Cn,{onClick:()=>{var u;(u=c.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:w4,children:[f.jsx(q5n,{size:14}),JQe()]})})]})]})})}function SPn(e){const n=new Map,t=new Map(e.map(c=>[c.id,c]));for(const c of e){if(!c.parentExperimentId)continue;const u=n.get(c.parentExperimentId)??[];u.push(c),n.set(c.parentExperimentId,u)}const r=new Map,s=new Map;function i(c){const u=r.get(c);if(u!==void 0)return u;const h=(n.get(c)??[]).some(_=>_.archived||i(_.id));return r.set(c,h),h}function a(c){const u=s.get(c);if(u!==void 0)return u;const h=(n.get(c)??[]).some(_=>!_.archived||a(_.id));return s.set(c,h),h}const o=new Map;for(const c of e){let u=!1,h=!1,_=c.parentExperimentId?t.get(c.parentExperimentId):void 0;for(;_;)_.archived?h=!0:u=!0,_=_.parentExperimentId?t.get(_.parentExperimentId):void 0;o.set(c.id,{archiveOnly:!c.archived,archiveAbove:!c.archived&&u,archiveDown:!c.archived&&a(c.id),restoreOnly:c.archived,restoreAbove:!c.archived&&h,restoreDown:i(c.id)})}return o}function pq({id:e,name:n,actions:t,onArchive:r,compact:s=!1}){const i=T.useRef(null),a=ga(i),[o,c]=T.useState({top:0,left:0}),u=()=>{if(!a.open&&i.current){const _=i.current.getBoundingClientRect(),p=Object.values(t).filter(Boolean).length*32+12,m=window.innerHeight-_.bottom>=p;c({top:m?_.bottom+4:Math.max(4,_.top-p),left:Math.max(4,Math.min(_.right-176,window.innerWidth-180))})}a.setOpen(_=>!_)},h=(_,p)=>{a.setOpen(!1),r(e,_,p)};return f.jsxs("div",{className:"nodrag ms-auto shrink-0",children:[s?f.jsx(Pt,{type:"button",ref:i,size:"small",className:"node-action","aria-label":Fz({name:n}),"aria-expanded":a.open,onClick:u,children:f.jsx(Lb,{size:15,"aria-hidden":"true"})}):f.jsx("button",{type:"button",className:"btn inline-flex h-7 items-center justify-center rounded-sm border border-border bg-background px-2.5 text-sm text-text hover:bg-surface",ref:i,"aria-label":Fz({name:n}),"aria-expanded":a.open,onClick:u,children:Spn()}),a.open&&ri.createPortal(f.jsxs("div",{ref:a.ref,className:"option-menu fixed z-70 min-w-44 rounded-lg border border-border bg-background p-1.5 shadow-menu",style:o,children:[t.archiveAbove&&f.jsx(Cn,{onClick:()=>h("ancestors",!0),children:upn()}),t.archiveOnly&&f.jsx(Cn,{onClick:()=>h("only",!0),children:Ipn()}),t.archiveDown&&f.jsx(Cn,{onClick:()=>h("descendants",!0),children:gpn()}),t.restoreOnly&&f.jsx(Cn,{onClick:()=>h("only",!1),children:DL()}),t.restoreAbove&&f.jsx(Cn,{onClick:()=>h("ancestors",!1),children:I0n()}),t.restoreDown&&f.jsx(Cn,{onClick:()=>h("descendants",!1),children:Y0n()})]}),document.body)]})}function CPn({runs:e,experiments:n,archiveActions:t,emptyHint:r,onOpen:s,onOpenLogs:i,onOpenCode:a,onArchive:o,onCancel:c}){const[u,h]=T.useState(new Set),[_,p]=T.useState(null),m=new Map;for(const v of e){const b=m.get(v.experimentId);b?b.push(v):m.set(v.experimentId,[v])}for(const v of m.values())v.sort((b,x)=>x.createdAt-b.createdAt);const w=[...n].sort((v,b)=>{var C,N,z,A;const x=((N=(C=m.get(v.id))==null?void 0:C[0])==null?void 0:N.createdAt)??v.createdAt;return(((A=(z=m.get(b.id))==null?void 0:z[0])==null?void 0:A.createdAt)??b.createdAt)-x});if(w.length===0)return f.jsx(gC,{icon:yh,title:r??iIe(),description:r?void 0:GLe()});async function k(v){p(null),h(b=>new Set(b).add(v));try{await c(v)}catch(b){h(x=>{const y=new Set(x);return y.delete(v),y}),p(b instanceof Error?b.message:String(b))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[_&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[y$e()," ",_]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":o$e(),children:w.map(v=>{const b=m.get(v.id)??[],x=b[0]??null,y=b.find(A=>A.status==="running"||A.status==="starting"),C=y??x,N=!!(y&&(y.cancelRequested||u.has(y.id))),z=y?N?"cancelling":aa(y):x?aa(x):"idle";return f.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-divider-subtle 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:()=>s(v,"preview"),onDoubleClick:()=>s(v,"keepOpen"),onAuxClick:A=>{A.button===1&&(A.preventDefault(),s(v,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Vr(A=>s(v,A),{stopPropagation:!0}),children:v.title||v.slug}),v.archived&&f.jsx("span",{className:"text-muted text-xs",children:OL()}),f.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:v.branchName,children:[f.jsx(Nm,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:v.branchName})]})]}),f.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:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx(cl,{status:z})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:b.length===1?bIe():MIe({count:Xt(b.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:x?go(x.createdAt):fIe()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":OQ({name:v.title||v.slug}),onClick:A=>A.stopPropagation(),onDoubleClick:A=>A.stopPropagation(),onAuxClick:A=>A.stopPropagation(),children:[f.jsxs(De,{size:"small",disabled:!C,title:C?EIe():ZLe(),...Vr(A=>{C&&i(v.id,C.id,A)},{stopPropagation:!0}),children:[f.jsx(vo,{size:15}),u3()]}),f.jsxs(De,{size:"small",title:vD({branch:Ce(v.branchName)}),...Vr(A=>a(v.id,A),{stopPropagation:!0}),children:[f.jsx($b,{size:15}),e$e()]}),y&&f.jsxs(De,{size:"small",variant:"danger",disabled:N,title:N?PIe():KIe(),onClick:()=>void k(y.id),children:[f.jsx($I,{size:15}),N?Wje():OD()]}),f.jsx(pq,{id:v.id,name:v.title||v.slug,actions:t.get(v.id),onArchive:o})]})]},v.id)})})]})}function EPn({onClose:e,onCreateProject:n}){const[t,r]=T.useState(!1),[s,i]=T.useState(null),a=T.useRef(null),o=T.useCallback(c=>{t||(r(!0),i(null),c().catch(()=>i(Lhn())).finally(()=>r(!1)))},[t]);return T.useEffect(()=>{const c=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e,o]),T.useEffect(()=>{const c=a.current;if(!c)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,h=()=>[...c.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(h()[0]??c).focus();const _=p=>{if(p.key!=="Tab")return;const m=h();if(m.length===0){p.preventDefault(),c.focus();return}const w=m[0],k=m[m.length-1];p.shiftKey&&document.activeElement===w?(p.preventDefault(),k.focus()):!p.shiftKey&&document.activeElement===k&&(p.preventDefault(),w.focus())};return document.addEventListener("keydown",_,!0),()=>{document.removeEventListener("keydown",_,!0),u==null||u.focus()}},[]),ri.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Pt,{className:"absolute end-3.5 top-3.5","aria-label":x3(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(cr,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx(TS,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:chn()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:Xhn()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[qhn()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:whn()}),Hdn()]}),f.jsx("p",{dir:"auto",children:phn()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(De,{onClick:()=>o(n),disabled:t,children:thn()}),f.jsx(De,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?pa():jhn()})]})]})}),document.body)}function ms(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function Iy(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}iv.prototype=Iy.prototype={constructor:iv,on:function(e,n){var t=this._,r=zPn(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),QR.hasOwnProperty(n)?{space:QR[n],local:e}:e}function APn(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===sk&&n.documentElement.namespaceURI===sk?n.createElement(e):n.createElementNS(t,e)}}function TPn(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mq(e){var n=$y(e);return(n.local?TPn:APn)(n)}function RPn(){}function vC(e){return e==null?RPn:function(){return this.querySelector(e)}}function MPn(e){typeof e!="function"&&(e=vC(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=x+1);!(N=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function sFn(e){e||(e=iFn);function n(_,p){return _&&p?e(_.__data__,p.__data__):!_-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function aFn(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function oFn(){return Array.from(this)}function cFn(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?bFn:typeof n=="function"?xFn:yFn)(e,n,t??"")):Th(this.node(),e)}function Th(e,n){return e.style.getPropertyValue(n)||xq(e).getComputedStyle(e,null).getPropertyValue(n)}function kFn(e){return function(){delete this[e]}}function SFn(e,n){return function(){this[e]=n}}function CFn(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function EFn(e,n){return arguments.length>1?this.each((n==null?kFn:typeof n=="function"?CFn:SFn)(e,n)):this.node()[e]}function wq(e){return e.trim().split(/^|\s+/)}function bC(e){return e.classList||new kq(e)}function kq(e){this._node=e,this._names=wq(e.getAttribute("class")||"")}kq.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Sq(e,n){for(var t=bC(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function eHn(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function ik(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:c,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:h}})}ik.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function uHn(e){return!e.ctrlKey&&!e.button}function _Hn(){return this.parentNode}function fHn(e,n){return n??{x:e.x,y:e.y}}function dHn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Aq(){var e=uHn,n=_Hn,t=fHn,r=dHn,s={},i=Iy("start","drag","end"),a=0,o,c,u,h,_=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,lHn).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,N){if(!(h||!e.call(this,C,N))){var z=y(this,n.call(this,C,N),C,N,"mouse");z&&(ra(C.view).on("mousemove.drag",w,Q0).on("mouseup.drag",k,Q0),zq(C.view),k4(C),u=!1,o=C.clientX,c=C.clientY,z("start",C))}}function w(C){if(Kd(C),!u){var N=C.clientX-o,z=C.clientY-c;u=N*N+z*z>_}s.mouse("drag",C)}function k(C){ra(C.view).on("mousemove.drag mouseup.drag",null),jq(C.view,u),Kd(C),s.mouse("end",C)}function v(C,N){if(e.call(this,C,N)){var z=C.changedTouches,A=n.call(this,C,N),j=z.length,M,D;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?A1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?A1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=pHn.exec(e))?new $i(n[1],n[2],n[3],1):(n=mHn.exec(e))?new $i(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=gHn.exec(e))?A1(n[1],n[2],n[3],n[4]):(n=vHn.exec(e))?A1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=bHn.exec(e))?nM(n[1],n[2]/100,n[3]/100,1):(n=yHn.exec(e))?nM(n[1],n[2]/100,n[3]/100,n[4]):XR.hasOwnProperty(e)?JR(XR[e]):e==="transparent"?new $i(NaN,NaN,NaN,0):null}function JR(e){return new $i(e>>16&255,e>>8&255,e&255,1)}function A1(e,n,t,r){return r<=0&&(e=n=t=NaN),new $i(e,n,t,r)}function kHn(e){return e instanceof Bm||(e=vf(e)),e?(e=e.rgb(),new $i(e.r,e.g,e.b,e.opacity)):new $i}function ak(e,n,t,r){return arguments.length===1?kHn(e):new $i(e,n,t,r??1)}function $i(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}yC($i,ak,Tq(Bm,{brighter(e){return e=e==null?_b:Math.pow(_b,e),new $i(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?X0:Math.pow(X0,e),new $i(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $i(nf(this.r),nf(this.g),nf(this.b),fb(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:eM,formatHex:eM,formatHex8:SHn,formatRgb:tM,toString:tM}));function eM(){return`#${L_(this.r)}${L_(this.g)}${L_(this.b)}`}function SHn(){return`#${L_(this.r)}${L_(this.g)}${L_(this.b)}${L_((isNaN(this.opacity)?1:this.opacity)*255)}`}function tM(){const e=fb(this.opacity);return`${e===1?"rgb(":"rgba("}${nf(this.r)}, ${nf(this.g)}, ${nf(this.b)}${e===1?")":`, ${e})`}`}function fb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nf(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function L_(e){return e=nf(e),(e<16?"0":"")+e.toString(16)}function nM(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new uo(e,n,t,r)}function Rq(e){if(e instanceof uo)return new uo(e.h,e.s,e.l,e.opacity);if(e instanceof Bm||(e=vf(e)),!e)return new uo;if(e instanceof uo)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,c=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&c<1?0:a,new uo(a,o,c,e.opacity)}function CHn(e,n,t,r){return arguments.length===1?Rq(e):new uo(e,n,t,r??1)}function uo(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}yC(uo,CHn,Tq(Bm,{brighter(e){return e=e==null?_b:Math.pow(_b,e),new uo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?X0:Math.pow(X0,e),new uo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new $i(S4(e>=240?e-240:e+120,s,r),S4(e,s,r),S4(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new uo(rM(this.h),T1(this.s),T1(this.l),fb(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=fb(this.opacity);return`${e===1?"hsl(":"hsla("}${rM(this.h)}, ${T1(this.s)*100}%, ${T1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rM(e){return e=(e||0)%360,e<0?e+360:e}function T1(e){return Math.max(0,Math.min(1,e||0))}function S4(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const xC=e=>()=>e;function EHn(e,n){return function(t){return e+t*n}}function NHn(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function zHn(e){return(e=+e)==1?Mq:function(n,t){return t-n?NHn(n,t,e):xC(isNaN(n)?t:n)}}function Mq(e,n){var t=n-e;return t?EHn(e,t):xC(isNaN(e)?n:e)}const db=(function e(n){var t=zHn(n);function r(s,i){var a=t((s=ak(s)).r,(i=ak(i)).r),o=t(s.g,i.g),c=t(s.b,i.b),u=Mq(s.opacity,i.opacity);return function(h){return s.r=a(h),s.g=o(h),s.b=c(h),s.opacity=u(h),s+""}}return r.gamma=e,r})(1);function jHn(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,c.push({i:a,x:Uo(r,s)})),t=C4.lastIndex;return t180?h+=360:h-u>180&&(u+=360),p.push({i:_.push(s(_)+"rotate(",null,r)-2,x:Uo(u,h)})):h&&_.push(s(_)+"rotate("+h+r)}function o(u,h,_,p){u!==h?p.push({i:_.push(s(_)+"skewX(",null,r)-2,x:Uo(u,h)}):h&&_.push(s(_)+"skewX("+h+r)}function c(u,h,_,p,m,w){if(u!==_||h!==p){var k=m.push(s(m)+"scale(",null,",",null,")");w.push({i:k-4,x:Uo(u,_)},{i:k-2,x:Uo(h,p)})}else(_!==1||p!==1)&&m.push(s(m)+"scale("+_+","+p+")")}return function(u,h){var _=[],p=[];return u=e(u),h=e(h),i(u.translateX,u.translateY,h.translateX,h.translateY,_,p),a(u.rotate,h.rotate,_,p),o(u.skewX,h.skewX,_,p),c(u.scaleX,u.scaleY,h.scaleX,h.scaleY,_,p),u=h=null,function(m){for(var w=-1,k=p.length,v;++w=0&&e._call.call(void 0,n),e=e._next;--Rh}function aM(){bf=(pb=Z0.now())+By,Rh=a0=0;try{UHn()}finally{Rh=0,VHn(),bf=0}}function GHn(){var e=Z0.now(),n=e-pb;n>Iq&&(By-=n,pb=e)}function VHn(){for(var e,n=hb,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:hb=t);o0=e,lk(r)}function lk(e){if(!Rh){a0&&(a0=clearTimeout(a0));var n=e-bf;n>24?(e<1/0&&(a0=setTimeout(aM,e-Z0.now()-By)),Zp&&(Zp=clearInterval(Zp))):(Zp||(pb=Z0.now(),Zp=setInterval(GHn,Iq)),Rh=1,$q(aM))}}function oM(e,n,t){var r=new mb;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var KHn=Iy("start","end","cancel","interrupt"),WHn=[],Pq=0,cM=1,uk=2,ov=3,lM=4,_k=5,cv=6;function Py(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;QHn(e,t,{name:n,index:r,group:s,on:KHn,tween:WHn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Pq})}function kC(e,n){var t=yo(e,n);if(t.state>Pq)throw new Error("too late; already scheduled");return t}function uc(e,n){var t=yo(e,n);if(t.state>ov)throw new Error("too late; already running");return t}function yo(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function QHn(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=Bq(i,0,t.time);function i(u){t.state=cM,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var h,_,p,m;if(t.state!==cM)return c();for(h in r)if(m=r[h],m.name===t.name){if(m.state===ov)return oM(a);m.state===lM?(m.state=cv,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[h]):+huk&&r.state<_k,r.state=cv,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete t[a]}i&&delete e.__transition}}function XHn(e){return this.each(function(){lv(this,e)})}function YHn(e,n){var t,r;return function(){var s=uc(this,e),i=s.tween;if(i!==t){r=t=i;for(var a=0,o=r.length;a=0&&(n=n.slice(0,t)),!n||n==="start"})}function Cqn(e,n,t){var r,s,i=Sqn(n)?kC:uc;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function Eqn(e,n){var t=this._id;return arguments.length<2?yo(this.node(),t).on.on(e):this.each(Cqn(t,e,n))}function Nqn(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function zqn(){return this.on("end.remove",Nqn(this._id))}function jqn(e){var n=this._name,t=this._id;typeof e!="function"&&(e=vC(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function eUn(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function il(e,n,t){this.k=e,this.x=n,this.y=t}il.prototype={constructor:il,scale:function(e){return e===1?this:new il(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new il(this.k,this.x+this.k*e,this.y+this.k*n)},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 Fy=new il(1,0,0);Uq.prototype=il.prototype;function Uq(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fy;return e.__zoom}function E4(e){e.stopImmediatePropagation()}function Jp(e){e.preventDefault(),e.stopImmediatePropagation()}function tUn(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function nUn(){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 uM(){return this.__zoom||Fy}function rUn(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sUn(){return navigator.maxTouchPoints||"ontouchstart"in this}function iUn(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Gq(){var e=tUn,n=nUn,t=iUn,r=rUn,s=sUn,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,c=av,u=Iy("start","zoom","end"),h,_,p,m=500,w=150,k=0,v=10;function b(H){H.property("__zoom",uM).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",D).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(H,Q,V,Z){var Y=H.selection?H.selection():H;Y.property("__zoom",uM),H!==Y?N(H,Q,V,Z):Y.interrupt().each(function(){z(this,arguments).event(Z).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},b.scaleBy=function(H,Q,V,Z){b.scaleTo(H,function(){var Y=this.__zoom.k,$=typeof Q=="function"?Q.apply(this,arguments):Q;return Y*$},V,Z)},b.scaleTo=function(H,Q,V,Z){b.transform(H,function(){var Y=n.apply(this,arguments),$=this.__zoom,L=V==null?C(Y):typeof V=="function"?V.apply(this,arguments):V,F=$.invert(L),q=typeof Q=="function"?Q.apply(this,arguments):Q;return t(y(x($,q),L,F),Y,a)},V,Z)},b.translateBy=function(H,Q,V,Z){b.transform(H,function(){return t(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof V=="function"?V.apply(this,arguments):V),n.apply(this,arguments),a)},null,Z)},b.translateTo=function(H,Q,V,Z,Y){b.transform(H,function(){var $=n.apply(this,arguments),L=this.__zoom,F=Z==null?C($):typeof Z=="function"?Z.apply(this,arguments):Z;return t(Fy.translate(F[0],F[1]).scale(L.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof V=="function"?-V.apply(this,arguments):-V),$,a)},Z,Y)};function x(H,Q){return Q=Math.max(i[0],Math.min(i[1],Q)),Q===H.k?H:new il(Q,H.x,H.y)}function y(H,Q,V){var Z=Q[0]-V[0]*H.k,Y=Q[1]-V[1]*H.k;return Z===H.x&&Y===H.y?H:new il(H.k,Z,Y)}function C(H){return[(+H[0][0]+ +H[1][0])/2,(+H[0][1]+ +H[1][1])/2]}function N(H,Q,V,Z){H.on("start.zoom",function(){z(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(Z).end()}).tween("zoom",function(){var Y=this,$=arguments,L=z(Y,$).event(Z),F=n.apply(Y,$),q=V==null?C(F):typeof V=="function"?V.apply(Y,$):V,K=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),ne=Y.__zoom,ae=typeof Q=="function"?Q.apply(Y,$):Q,ue=c(ne.invert(q).concat(K/ne.k),ae.invert(q).concat(K/ae.k));return function(se){if(se===1)se=ae;else{var G=ue(se),oe=K/G[2];se=new il(oe,q[0]-G[0]*oe,q[1]-G[1]*oe)}L.zoom(null,se)}})}function z(H,Q,V){return!V&&H.__zooming||new A(H,Q)}function A(H,Q){this.that=H,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=n.apply(H,Q),this.taps=0}A.prototype={event:function(H){return H&&(this.sourceEvent=H),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(H,Q){return this.mouse&&H!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&H!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&H!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(H){var Q=ra(this.that).datum();u.call(H,this.that,new eUn(H,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Q)}};function j(H,...Q){if(!e.apply(this,arguments))return;var V=z(this,Q).event(H),Z=this.__zoom,Y=Math.max(i[0],Math.min(i[1],Z.k*Math.pow(2,r.apply(this,arguments)))),$=io(H);if(V.wheel)(V.mouse[0][0]!==$[0]||V.mouse[0][1]!==$[1])&&(V.mouse[1]=Z.invert(V.mouse[0]=$)),clearTimeout(V.wheel);else{if(Z.k===Y)return;V.mouse=[$,Z.invert($)],lv(this),V.start()}Jp(H),V.wheel=setTimeout(L,w),V.zoom("mouse",t(y(x(Z,Y),V.mouse[0],V.mouse[1]),V.extent,a));function L(){V.wheel=null,V.end()}}function M(H,...Q){if(p||!e.apply(this,arguments))return;var V=H.currentTarget,Z=z(this,Q,!0).event(H),Y=ra(H.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",K,!0),$=io(H,V),L=H.clientX,F=H.clientY;zq(H.view),E4(H),Z.mouse=[$,this.__zoom.invert($)],lv(this),Z.start();function q(ne){if(Jp(ne),!Z.moved){var ae=ne.clientX-L,ue=ne.clientY-F;Z.moved=ae*ae+ue*ue>k}Z.event(ne).zoom("mouse",t(y(Z.that.__zoom,Z.mouse[0]=io(ne,V),Z.mouse[1]),Z.extent,a))}function K(ne){Y.on("mousemove.zoom mouseup.zoom",null),jq(ne.view,Z.moved),Jp(ne),Z.event(ne).end()}}function D(H,...Q){if(e.apply(this,arguments)){var V=this.__zoom,Z=io(H.changedTouches?H.changedTouches[0]:H,this),Y=V.invert(Z),$=V.k*(H.shiftKey?.5:2),L=t(y(x(V,$),Z,Y),n.apply(this,Q),a);Jp(H),o>0?ra(this).transition().duration(o).call(N,L,Z,H):ra(this).call(b.transform,L,Z,H)}}function I(H,...Q){if(e.apply(this,arguments)){var V=H.touches,Z=V.length,Y=z(this,Q,H.changedTouches.length===Z).event(H),$,L,F,q;for(E4(H),L=0;L`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:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,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.`},J0=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Vq=["Enter"," ","Escape"],Kq={"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:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"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 Mh;(function(e){e.Strict="strict",e.Loose="loose"})(Mh||(Mh={}));var rf;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(rf||(rf={}));var em;(function(e){e.Partial="partial",e.Full="full"})(em||(em={}));const Wq={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var gu;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(gu||(gu={}));var gb;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(gb||(gb={}));var Rt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Rt||(Rt={}));const _M={[Rt.Left]:Rt.Right,[Rt.Right]:Rt.Left,[Rt.Top]:Rt.Bottom,[Rt.Bottom]:Rt.Top};function Qq(e){return e===null?null:e?"valid":"invalid"}const Xq=e=>"id"in e&&"source"in e&&"target"in e,aUn=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),CC=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Pm=(e,n=[0,0])=>{const{width:t,height:r}=yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},oUn=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):CC(s)?s:n.nodeLookup.get(s.id));const o=a?vb(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Hy(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return qy(t)},Fm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=Hy(t,vb(s)),r=!0)}),r?qy(t):{x:0,y:0,width:0,height:0}},EC=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,c=(n.y-r)/s,u=n.width/s,h=n.height/s,_=[];for(const p of e.values()){const{measured:m,selectable:w=!0,hidden:k=!1}=p;if(a&&!w||k)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x,y}=p.internals.positionAbsolute,C=eU(o,c,u,h,x,y,v,b),N=v*b,z=i&&C>0;(!p.internals.handleBounds||z||C>=N||p.dragging)&&_.push(p)}return _},cUn=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function lUn(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function uUn({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=lUn(e,a),c=Fm(o),u=zC(c,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function Yq({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:c,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},h=a.origin??r;let _=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",bo.error005());else{const m=o.measured.width,w=o.measured.height;m&&w&&(_=[[c,u],[c+m,u+w]])}else o&&xf(a.extent)&&(_=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const p=xf(_)?yf(n,_,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",bo.error015())),{position:{x:p.x-c+(a.measured.width??0)*h[0],y:p.y-u+(a.measured.height??0)*h[1]},positionAbsolute:p}}async function _Un({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),w=!m&&p.parentId&&a.find(k=>k.id===p.parentId);(m||w)&&a.push(p)}const o=new Set(n.map(p=>p.id)),c=r.filter(p=>p.deletable!==!1),h=cUn(a,c);for(const p of c)o.has(p.id)&&!h.find(w=>w.id===p.id)&&h.push(p);if(!s)return{edges:h,nodes:a};const _=await s({nodes:a,edges:h});return typeof _=="boolean"?_?{edges:h,nodes:a}:{edges:[],nodes:[]}:_}const Oh=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),yf=(e={x:0,y:0},n,t)=>({x:Oh(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:Oh(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function Zq(e,n,t){const{width:r,height:s}=yl(t),{x:i,y:a}=t.internals.positionAbsolute;return yf(e,[[i,a],[i+r,a+s]],n)}const fM=(e,n,t)=>et?-Oh(Math.abs(e-t),1,n)/n:0,NC=(e,n,t=15,r=40)=>{const s=fM(e.x,r,n.width-r)*t,i=fM(e.y,r,n.height-r)*t;return[s,i]},Hy=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),fk=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),qy=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),tm=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=CC(e)?e.internals.positionAbsolute:Pm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},vb=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=CC(e)?e.internals.positionAbsolute:Pm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Jq=(e,n)=>qy(Hy(fk(e),fk(n))),eU=(e,n,t,r,s,i,a,o)=>{const c=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(c*u)},bb=(e,n)=>eU(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),dM=e=>fo(e.width)&&fo(e.height)&&fo(e.x)&&fo(e.y),fo=e=>!isNaN(e)&&isFinite(e),tU=(e,n)=>(t,r)=>{},Hm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),qm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?Hm(o,a):o},Dh=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function wd(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.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 fUn(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=wd(e,t),s=wd(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=wd(e.top??e.y??0,t),s=wd(e.bottom??e.y??0,t),i=wd(e.left??e.x??0,n),a=wd(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function dUn(e,n,t,r,s,i){const{x:a,y:o}=Dh(e,[n,t,r]),{x:c,y:u}=Dh({x:e.x+e.width,y:e.y+e.height},[n,t,r]),h=s-c,_=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(h),bottom:Math.floor(_)}}const zC=(e,n,t,r,s,i)=>{const a=fUn(i,n,t),o=(n-a.x)/e.width,c=(t-a.y)/e.height,u=Math.min(o,c),h=Oh(u,r,s),_=e.x+e.width/2,p=e.y+e.height/2,m=n/2-_*h,w=t/2-p*h,k=dUn(e,m,w,h,n,t),v={left:Math.min(k.left-a.left,0),top:Math.min(k.top-a.top,0),right:Math.min(k.right-a.right,0),bottom:Math.min(k.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:w-v.top+v.bottom,zoom:h}},nm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function xf(e){return e!=null&&e!=="parent"}function yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function nU(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function rU(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function hM(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function hUn(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function pUn(e){return{...Kq,...e||{}}}function w0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=ho(e),o=qm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=t?Hm(o,n):o;return{xSnapped:c,ySnapped:u,...o}}const jC=e=>({width:e.offsetWidth,height:e.offsetHeight}),sU=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},mUn=["INPUT","SELECT","TEXTAREA"];function iU(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:mUn.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const aU=e=>"clientX"in e,ho=(e,n)=>{var i,a;const t=aU(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},pM=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...jC(a)}})};function oU({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const c=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,h=Math.abs(c-e),_=Math.abs(u-n);return[c,u,h,_]}function O1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function mM({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Rt.Left:return[n-O1(n-r,i),t];case Rt.Right:return[n+O1(r-n,i),t];case Rt.Top:return[n,t-O1(t-s,i)];case Rt.Bottom:return[n,t+O1(s-t,i)]}}function cU({sourceX:e,sourceY:n,sourcePosition:t=Rt.Bottom,targetX:r,targetY:s,targetPosition:i=Rt.Top,curvature:a=.25}){const[o,c]=mM({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,h]=mM({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[_,p,m,w]=oU({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:h});return[`M${e},${n} C${o},${c} ${u},${h} ${r},${s}`,_,p,m,w]}function lU({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const bUn=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,yUn=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),xUn=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",bo.error006()),n;const r=t.getEdgeId||bUn;let s;return Xq(e)?s={...e}:s={...e,id:r(e)},yUn(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function uU({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=lU({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const gM={[Rt.Left]:{x:-1,y:0},[Rt.Right]:{x:1,y:0},[Rt.Top]:{x:0,y:-1},[Rt.Bottom]:{x:0,y:1}},wUn=({source:e,sourcePosition:n=Rt.Bottom,target:t})=>n===Rt.Left||n===Rt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function kUn({source:e,sourcePosition:n=Rt.Bottom,target:t,targetPosition:r=Rt.Top,center:s,offset:i,stepPosition:a}){const o=gM[n],c=gM[r],u={x:e.x+o.x*i,y:e.y+o.y*i},h={x:t.x+c.x*i,y:t.y+c.y*i},_=wUn({source:u,sourcePosition:n,target:h}),p=_.x!==0?"x":"y",m=_[p];let w=[],k,v;const b={x:0,y:0},x={x:0,y:0},[,,y,C]=lU({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*c[p]===-1){p==="x"?(k=s.x??u.x+(h.x-u.x)*a,v=s.y??(u.y+h.y)/2):(k=s.x??(u.x+h.x)/2,v=s.y??u.y+(h.y-u.y)*a);const j=[{x:k,y:u.y},{x:k,y:h.y}],M=[{x:u.x,y:v},{x:h.x,y:v}];o[p]===m?w=p==="x"?j:M:w=p==="x"?M:j}else{const j=[{x:u.x,y:h.y}],M=[{x:h.x,y:u.y}];if(p==="x"?w=o.x===m?M:j:w=o.y===m?j:M,n===r){const H=Math.abs(e[p]-t[p]);if(H<=i){const Q=Math.min(i-1,i-H);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Q:x[p]=(h[p]>t[p]?-1:1)*Q}}if(n!==r){const H=p==="x"?"y":"x",Q=o[p]===c[H],V=u[H]>h[H],Z=u[H]=U?(k=(D.x+I.x)/2,v=w[0].y):(k=w[0].x,v=(D.y+I.y)/2)}const N={x:u.x+b.x,y:u.y+b.y},z={x:h.x+x.x,y:h.y+x.y};return[[e,...N.x!==w[0].x||N.y!==w[0].y?[N]:[],...w,...z.x!==w[w.length-1].x||z.y!==w[w.length-1].y?[z]:[],t],k,v,y,C]}function SUn(e,n,t,r){const s=Math.min(vM(e,n)/2,vM(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function hk(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function EUn(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=hk(c,n);i.has(u)||(a.push({id:u,color:c.color||t,...c}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const _U=1e3,NUn=10,AC={nodeOrigin:[0,0],nodeExtent:J0,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},zUn={...AC,checkEquality:!0};function TC(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function jUn(e,n,t){const r=TC(AC,t);for(const s of e.values())if(s.parentId)MC(s,e,n,r);else{const i=Pm(s,r.nodeOrigin),a=xf(s.extent)?s.extent:r.nodeExtent,o=yf(i,a,yl(s));s.internals.positionAbsolute=o}}function AUn(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function RC(e){return e==="manual"}function pk(e,n,t,r={}){var h,_;const s=TC(zUn,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!RC(s.zIndexMode)?_U:0;let c=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const w=Pm(p,s.nodeOrigin),k=xf(p.extent)?p.extent:s.nodeExtent,v=yf(w,k,yl(p));m={...s.defaults,...p,measured:{width:(h=p.measured)==null?void 0:h.width,height:(_=p.measured)==null?void 0:_.height},internals:{positionAbsolute:v,handleBounds:AUn(p,m),z:fU(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),p.parentId&&MC(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function TUn(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function MC(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:c}=TC(AC,r),u=e.parentId,h=n.get(u);if(!h){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}TUn(e,t),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&c==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*NUn),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const _=i&&!RC(c)?_U:0,{x:p,y:m,z:w}=RUn(e,h,a,o,_,c),{positionAbsolute:k}=e.internals,v=p!==k.x||m!==k.y;(v||w!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:k,z:w}})}function fU(e,n,t){const r=fo(e.zIndex)?e.zIndex:0;return RC(t)?r:r+(e.selected?n:0)}function RUn(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,c=yl(e),u=Pm(e,t),h=xf(e.extent)?yf(u,e.extent,c):u;let _=yf({x:a+h.x,y:o+h.y},r,c);e.extent==="parent"&&(_=Zq(_,c,n));const p=fU(e,s,i),m=n.internals.z??0;return{x:_.x,y:_.y,z:m>=p?m+1:p}}function OC(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const c=n.get(o.parentId);if(!c)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??tm(c),h=Jq(u,o.rect);i.set(o.parentId,{expandedRect:h,parent:c})}return i.size>0&&i.forEach(({expandedRect:o,parent:c},u)=>{var y;const h=c.internals.positionAbsolute,_=yl(c),p=c.origin??r,m=o.x0||w>0||b||x)&&(s.push({id:u,type:"position",position:{x:c.position.x-m+b,y:c.position.y-w+x}}),(y=t.get(u))==null||y.forEach(C=>{e.some(N=>N.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+w}})})),(_.width0){const m=OC(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:c}}async function OUn({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function wM(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const c=r.get(a)||new Map;if(r.set(a,c.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function dU(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,h=`${i}-${o}--${s}-${a}`;wM("source",c,h,e,s,a),wM("target",c,u,e,i,o),n.set(r.id,r)}}function hU(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:hU(t,n):!1}function kM(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function DUn(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!hU(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function N4({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,c;const s=[];for(const[u,h]of n){const _=(a=t.get(u))==null?void 0:a.internals.userNode;_&&s.push({..._,position:h.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((c=n.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function LUn({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=Hm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function IUn({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,c=!1,u={x:0,y:0},h=null,_=!1,p=null,m=!1,w=!1,k=null;function v({noDragClassName:x,handleSelector:y,domNode:C,isSelectable:N,nodeId:z,nodeClickDistance:A=0}){p=ra(C);function j({x:B,y:U}){const{nodeLookup:H,nodeExtent:Q,snapGrid:V,snapToGrid:Z,nodeOrigin:Y,onNodeDrag:$,onSelectionDrag:L,onError:F,updateNodePositions:q}=n();i={x:B,y:U};let K=!1;const ne=o.size>1,ae=ne&&Q?fk(Fm(o)):null,ue=ne&&Z?LUn({dragItems:o,snapGrid:V,x:B,y:U}):null;for(const[se,G]of o){if(!H.has(se))continue;let oe={x:B-G.distance.x,y:U-G.distance.y};Z&&(oe=ue?{x:Math.round(oe.x+ue.x),y:Math.round(oe.y+ue.y)}:Hm(oe,V));let ce=null;if(ne&&Q&&!G.extent&&ae){const{positionAbsolute:Re}=G.internals,Le=Re.x-ae.x+Q[0][0],Ke=Re.x+G.measured.width-ae.x2+Q[1][0],Ne=Re.y-ae.y+Q[0][1],xe=Re.y+G.measured.height-ae.y2+Q[1][1];ce=[[Le,Ne],[Ke,xe]]}const{position:he,positionAbsolute:be}=Yq({nodeId:se,nextPosition:oe,nodeLookup:H,nodeExtent:ce||Q,nodeOrigin:Y,onError:F});K=K||G.position.x!==he.x||G.position.y!==he.y,G.position=he,G.internals.positionAbsolute=be}if(w=w||K,!!K&&(q(o,!0),k&&(r||$||!z&&L))){const[se,G]=N4({nodeId:z,dragItems:o,nodeLookup:H});r==null||r(k,o,se,G),$==null||$(k,se,G),z||L==null||L(k,G)}}async function M(){if(!h)return;const{transform:B,panBy:U,autoPanSpeed:H,autoPanOnNodeDrag:Q}=n();if(!Q){c=!1,cancelAnimationFrame(a);return}const[V,Z]=NC(u,h,H);(V!==0||Z!==0)&&(i.x=(i.x??0)-V/B[2],i.y=(i.y??0)-Z/B[2],await U({x:V,y:Z})&&j(i)),a=requestAnimationFrame(M)}function D(B){var ne;const{nodeLookup:U,multiSelectionActive:H,nodesDraggable:Q,transform:V,snapGrid:Z,snapToGrid:Y,selectNodesOnDrag:$,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:q}=n();_=!0,(!$||!N)&&!H&&z&&((ne=U.get(z))!=null&&ne.selected||q()),N&&$&&z&&(e==null||e(z));const K=w0(B.sourceEvent,{transform:V,snapGrid:Z,snapToGrid:Y,containerBounds:h});if(i=K,o=DUn(U,Q,K,z),o.size>0&&(t||L||!z&&F)){const[ae,ue]=N4({nodeId:z,dragItems:o,nodeLookup:U});t==null||t(B.sourceEvent,o,ae,ue),L==null||L(B.sourceEvent,ae,ue),z||F==null||F(B.sourceEvent,ue)}}const I=Aq().clickDistance(A).on("start",B=>{const{domNode:U,nodeDragThreshold:H,transform:Q,snapGrid:V,snapToGrid:Z}=n();h=(U==null?void 0:U.getBoundingClientRect())||null,m=!1,w=!1,k=B.sourceEvent,H===0&&D(B),i=w0(B.sourceEvent,{transform:Q,snapGrid:V,snapToGrid:Z,containerBounds:h}),u=ho(B.sourceEvent,h)}).on("drag",B=>{const{autoPanOnNodeDrag:U,transform:H,snapGrid:Q,snapToGrid:V,nodeDragThreshold:Z,nodeLookup:Y}=n(),$=w0(B.sourceEvent,{transform:H,snapGrid:Q,snapToGrid:V,containerBounds:h});if(k=B.sourceEvent,(B.sourceEvent.type==="touchmove"&&B.sourceEvent.touches.length>1||z&&!Y.has(z))&&(m=!0),!m){if(!c&&U&&_&&(c=!0,M()),!_){const L=ho(B.sourceEvent,h),F=L.x-u.x,q=L.y-u.y;Math.sqrt(F*F+q*q)>Z&&D(B)}(i.x!==$.xSnapped||i.y!==$.ySnapped)&&o&&_&&(u=ho(B.sourceEvent,h),j($))}}).on("end",B=>{if(!_||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(c=!1,_=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:U,updateNodePositions:H,onNodeDragStop:Q,onSelectionDragStop:V}=n();if(w&&(H(o,!1),w=!1),s||Q||!z&&V){const[Z,Y]=N4({nodeId:z,dragItems:o,nodeLookup:U,dragging:!1});s==null||s(B.sourceEvent,o,Z,Y),Q==null||Q(B.sourceEvent,Z,Y),z||V==null||V(B.sourceEvent,Y)}}}).filter(B=>{const U=B.target;return!B.button&&(!x||!kM(U,`.${x}`,C))&&(!y||kM(U,y,C))});p.call(I)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function $Un(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())bb(s,tm(i))>0&&r.push(i);return r}const BUn=250;function PUn(e,n,t,r){var o,c;let s=[],i=1/0;const a=$Un(e,t,n+BUn);for(const u of a){const h=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const _ of h){if(r.nodeId===_.nodeId&&r.type===_.type&&r.id===_.id)continue;const{x:p,y:m}=wf(u,_,_.position,!0),w=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));w>n||(w1){const u=r.type==="source"?"target":"source";return s.find(h=>h.type===u)??s[0]}return s[0]}function pU(e,n,t,r,s,i=!1){var u,h,_;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((h=a.internals.handleBounds)==null?void 0:h.source)??[],...((_=a.internals.handleBounds)==null?void 0:_.target)??[]],c=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return c&&i?{...c,...wf(a,c,c.position,!0)}:c}function mU(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function FUn(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const gU=()=>!0;function HUn(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:c,lib:u,autoPanOnConnect:h,flowId:_,panBy:p,cancelConnection:m,onConnectStart:w,onConnect:k,onConnectEnd:v,isValidConnection:b=gU,onReconnectEnd:x,updateConnection:y,getTransform:C,getFromHandle:N,autoPanSpeed:z,dragThreshold:A=1,handleDomNode:j}){const M=sU(e.target);let D=0,I;const{x:B,y:U}=ho(e),H=mU(i,j),Q=o==null?void 0:o.getBoundingClientRect();let V=!1;if(!Q||!H)return;const Z=pU(s,H,r,c,n);if(!Z)return;let Y=ho(e,Q),$=!1,L=null,F=!1,q=null;function K(){if(!h||!Q)return;const[he,be]=NC(Y,Q,z);p({x:he,y:be}),D=requestAnimationFrame(K)}const ne={...Z,nodeId:s,type:H,position:Z.position},ae=c.get(s);let se={inProgress:!0,isValid:null,from:wf(ae,ne,Rt.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:ae,to:Y,toHandle:null,toPosition:_M[ne.position],toNode:null,pointer:Y};function G(){V=!0,y(se),w==null||w(e,{nodeId:s,handleId:r,handleType:H})}A===0&&G();function oe(he){if(!V){const{x:xe,y:rt}=ho(he),Ze=xe-B,ot=rt-U;if(!(Ze*Ze+ot*ot>A*A))return;G()}if(!N()||!ne){ce(he);return}const be=C();Y=ho(he,Q),I=PUn(qm(Y,be,!1,[1,1]),t,c,ne),$||(K(),$=!0);const Re=vU(he,{handle:I,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:_,nodeLookup:c});q=Re.handleDomNode,L=Re.connection,F=FUn(!!I,Re.isValid);const Le=c.get(s),Ke=Le?wf(Le,ne,Rt.Left,!0):se.from,Ne={...se,from:Ke,isValid:F,to:Re.toHandle&&F?Dh({x:Re.toHandle.x,y:Re.toHandle.y},be):Y,toHandle:Re.toHandle,toPosition:F&&Re.toHandle?Re.toHandle.position:_M[ne.position],toNode:Re.toHandle?c.get(Re.toHandle.nodeId):null,pointer:Y};y(Ne),se=Ne}function ce(he){if(!("touches"in he&&he.touches.length>0)){if(V){(I||q)&&L&&F&&(k==null||k(L));const{inProgress:be,...Re}=se,Le={...Re,toPosition:se.toHandle?se.toPosition:null};v==null||v(he,Le),i&&(x==null||x(he,Le))}m(),cancelAnimationFrame(D),$=!1,F=!1,L=null,q=null,M.removeEventListener("mousemove",oe),M.removeEventListener("mouseup",ce),M.removeEventListener("touchmove",oe),M.removeEventListener("touchend",ce)}}M.addEventListener("mousemove",oe),M.addEventListener("mouseup",ce),M.addEventListener("touchmove",oe),M.addEventListener("touchend",ce)}function vU(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:c,isValidConnection:u=gU,nodeLookup:h}){const _=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${c}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:w}=ho(e),k=a.elementFromPoint(m,w),v=k!=null&&k.classList.contains(`${o}-flow__handle`)?k:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const x=mU(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),N=v.classList.contains("connectable"),z=v.classList.contains("connectableend");if(!y||!x)return b;const A={source:_?y:r,sourceHandle:_?C:s,target:_?r:y,targetHandle:_?s:C};b.connection=A;const M=N&&z&&(t===Mh.Strict?_&&x==="source"||!_&&x==="target":y!==r||C!==s);b.isValid=M&&u(A),b.toHandle=pU(y,x,C,h,t,!0)}return b}const mk={onPointerDown:HUn,isValid:vU};function qUn({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=ra(e);function i({translateExtent:o,width:c,height:u,zoomStep:h=1,pannable:_=!0,zoomable:p=!0,inversePan:m=!1}){const w=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),N=y.sourceEvent.ctrlKey&&nm()?10:1,z=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*h,A=C[2]*Math.pow(2,z*N);n.scaleTo(A)};let k=[0,0];const v=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])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const N=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],z=[N[0]-k[0],N[1]-k[1]];k=N;const A=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-z[0]*A,y:C[1]-z[1]*A},M=[[0,0],[c,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},x=Gq().on("start",v).on("zoom",_?b:null).on("zoom.wheel",p?w:null);s.call(x,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:io}}const Uy=e=>({x:e.x,y:e.y,zoom:e.k}),z4=({x:e,y:n,zoom:t})=>Fy.translate(e,n).scale(t),Od=(e,n)=>e.target.closest(`.${n}`),bU=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),UUn=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,j4=(e,n=0,t=UUn,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},yU=e=>{const n=e.ctrlKey&&nm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function GUn({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:u}){return h=>{if(Od(h,n))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const _=t.property("__zoom").k||1;if(h.ctrlKey&&a){const v=io(h),b=yU(h),x=_*Math.pow(2,b);r.scaleTo(t,x,v,h);return}const p=h.deltaMode===1?20:1;let m=s===rf.Vertical?0:h.deltaX*p,w=s===rf.Horizontal?0:h.deltaY*p;!nm()&&h.shiftKey&&s!==rf.Vertical&&(m=h.deltaY*p,w=0),r.translateBy(t,-(m/_)*i,-(w/_)*i,{internal:!0});const k=Uy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(h,k),e.panScrollTimeout=setTimeout(()=>{u==null||u(h,k),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(h,k))}}function VUn({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=Od(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function KUn({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=Uy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function WUn({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&bU(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,Uy(i.transform)))}}function QUn({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&bU(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=Uy(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},t?150:0)}}}function XUn({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:c,lib:u,connectionInProgress:h}){return _=>{var v;const p=e||n,m=t&&_.ctrlKey,w=_.type==="wheel";if(_.button===1&&_.type==="mousedown"&&(Od(_,`${u}-flow__node`)||Od(_,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||h&&!w||Od(_,o)&&w||Od(_,c)&&(!w||s&&w&&!e)||!t&&_.ctrlKey&&w)return!1;if(!t&&_.type==="touchstart"&&((v=_.touches)==null?void 0:v.length)>1)return _.preventDefault(),!1;if(!p&&!s&&!m&&w||!r&&(_.type==="mousedown"||_.type==="touchstart")||Array.isArray(r)&&!r.includes(_.button)&&_.type==="mousedown")return!1;const k=Array.isArray(r)&&r.includes(_.button)||!_.button||_.button<=1;return(!_.ctrlKey||w)&&k}}function YUn({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),_=Gq().scaleExtent([n,t]).translateExtent(r),p=ra(e).call(_);x({x:s.x,y:s.y,zoom:Oh(s.zoom,n,t)},[[0,0],[h.width,h.height]],r);const m=p.on("wheel.zoom"),w=p.on("dblclick.zoom");_.wheelDelta(yU);async function k(I,B){return p?new Promise(U=>{_==null||_.interpolate((B==null?void 0:B.interpolate)==="linear"?x0:av).transform(j4(p,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>U(!0)),I)}):!1}function v({noWheelClassName:I,noPanClassName:B,onPaneContextMenu:U,userSelectionActive:H,panOnScroll:Q,panOnDrag:V,panOnScrollMode:Z,panOnScrollSpeed:Y,preventScrolling:$,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:q,zoomActivationKeyPressed:K,lib:ne,onTransformChange:ae,connectionInProgress:ue,paneClickDistance:se,selectionOnDrag:G}){H&&!u.isZoomingOrPanning&&b();const oe=Q&&!K&&!H;_.clickDistance(G?1/0:!fo(se)||se<0?0:se);const ce=oe?GUn({zoomPanValues:u,noWheelClassName:I,d3Selection:p,d3Zoom:_,panOnScrollMode:Z,panOnScrollSpeed:Y,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):VUn({noWheelClassName:I,preventScrolling:$,d3ZoomHandler:m});p.on("wheel.zoom",ce,{passive:!1});const he=KUn({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});_.on("start",he);const be=WUn({zoomPanValues:u,panOnDrag:V,onPaneContextMenu:!!U,onPanZoom:i,onTransformChange:ae});_.on("zoom",be);const Re=QUn({zoomPanValues:u,panOnDrag:V,panOnScroll:Q,onPaneContextMenu:U,onPanZoomEnd:o,onDraggingChange:c});_.on("end",Re);const Le=XUn({zoomActivationKeyPressed:K,panOnDrag:V,zoomOnScroll:F,panOnScroll:Q,zoomOnDoubleClick:q,zoomOnPinch:L,userSelectionActive:H,noPanClassName:B,noWheelClassName:I,lib:ne,connectionInProgress:ue});_.filter(Le),q?p.on("dblclick.zoom",w):p.on("dblclick.zoom",null)}function b(){_.on("zoom",null)}async function x(I,B,U){const H=z4(I),Q=_==null?void 0:_.constrain()(H,B,U);return Q&&await k(Q),Q}async function y(I,B){const U=z4(I);return await k(U,B),U}function C(I){if(p){const B=z4(I),U=p.property("__zoom");(U.k!==I.zoom||U.x!==I.x||U.y!==I.y)&&(_==null||_.transform(p,B,null,{sync:!0}))}}function N(){const I=p?Uq(p.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}async function z(I,B){return p?new Promise(U=>{_==null||_.interpolate((B==null?void 0:B.interpolate)==="linear"?x0:av).scaleTo(j4(p,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>U(!0)),I)}):!1}async function A(I,B){return p?new Promise(U=>{_==null||_.interpolate((B==null?void 0:B.interpolate)==="linear"?x0:av).scaleBy(j4(p,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>U(!0)),I)}):!1}function j(I){_==null||_.scaleExtent(I)}function M(I){_==null||_.translateExtent(I)}function D(I){const B=!fo(I)||I<0?0:I;_==null||_.clickDistance(B)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:x,getViewport:N,scaleTo:z,scaleBy:A,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:D}}var Lh;(function(e){e.Line="line",e.Handle="handle"})(Lh||(Lh={}));function ZUn({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,c=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(c[0]=c[0]*-1),o&&i&&(c[1]=c[1]*-1),c}function SM(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function _u(e,n){return Math.max(0,n-e)}function fu(e,n){return Math.max(0,e-n)}function D1(e,n,t){return Math.max(0,n-e,e-t)}function CM(e,n){return e?!n:n}function JUn(e,n,t,r,s,i,a,o){let{affectsX:c,affectsY:u}=n;const{isHorizontal:h,isVertical:_}=n,p=h&&_,{xSnapped:m,ySnapped:w}=t,{minWidth:k,maxWidth:v,minHeight:b,maxHeight:x}=r,{x:y,y:C,width:N,height:z,aspectRatio:A}=e;let j=Math.floor(h?m-e.pointerX:0),M=Math.floor(_?w-e.pointerY:0);const D=N+(c?-j:j),I=z+(u?-M:M),B=-i[0]*N,U=-i[1]*z;let H=D1(D,k,v),Q=D1(I,b,x);if(a){let Y=0,$=0;c&&j<0?Y=_u(y+j+B,a[0][0]):!c&&j>0&&(Y=fu(y+D+B,a[1][0])),u&&M<0?$=_u(C+M+U,a[0][1]):!u&&M>0&&($=fu(C+I+U,a[1][1])),H=Math.max(H,Y),Q=Math.max(Q,$)}if(o){let Y=0,$=0;c&&j>0?Y=fu(y+j,o[0][0]):!c&&j<0&&(Y=_u(y+D,o[1][0])),u&&M>0?$=fu(C+M,o[0][1]):!u&&M<0&&($=_u(C+I,o[1][1])),H=Math.max(H,Y),Q=Math.max(Q,$)}if(s){if(h){const Y=D1(D/A,b,x)*A;if(H=Math.max(H,Y),a){let $=0;!c&&!u||c&&!u&&p?$=fu(C+U+D/A,a[1][1])*A:$=_u(C+U+(c?j:-j)/A,a[0][1])*A,H=Math.max(H,$)}if(o){let $=0;!c&&!u||c&&!u&&p?$=_u(C+D/A,o[1][1])*A:$=fu(C+(c?j:-j)/A,o[0][1])*A,H=Math.max(H,$)}}if(_){const Y=D1(I*A,k,v)/A;if(Q=Math.max(Q,Y),a){let $=0;!c&&!u||u&&!c&&p?$=fu(y+I*A+B,a[1][0])/A:$=_u(y+(u?M:-M)*A+B,a[0][0])/A,Q=Math.max(Q,$)}if(o){let $=0;!c&&!u||u&&!c&&p?$=_u(y+I*A,o[1][0])/A:$=fu(y+(u?M:-M)*A,o[0][0])/A,Q=Math.max(Q,$)}}}M=M+(M<0?Q:-Q),j=j+(j<0?H:-H),s&&(p?D>I*A?M=(CM(c,u)?-j:j)/A:j=(CM(c,u)?-M:M)*A:h?(M=j/A,u=c):(j=M*A,c=u));const V=c?y+j:y,Z=u?C+M:C;return{width:N+(c?-j:j),height:z+(u?-M:M),x:i[0]*j*(c?-1:1)+V,y:i[1]*M*(u?-1:1)+Z}}const xU={width:0,height:0,x:0,y:0},eGn={...xU,pointerX:0,pointerY:0,aspectRatio:1};function tGn(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,c=t[1]*a;return[[r-o,s-c],[r+i-o,s+a-c]]}function nGn({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=ra(e);let a={controlDirection:SM("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:h,keepAspectRatio:_,resizeDirection:p,onResizeStart:m,onResize:w,onResizeEnd:k,shouldResize:v}){let b={...xU},x={...eGn};a={boundaries:h,resizeDirection:p,keepAspectRatio:_,controlDirection:SM(u)};let y,C=null,N=[],z,A,j,M=!1;const D=Aq().on("start",I=>{const{nodeLookup:B,transform:U,snapGrid:H,snapToGrid:Q,nodeOrigin:V,paneDomNode:Z}=t();if(y=B.get(n),!y)return;C=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:Y,ySnapped:$}=w0(I.sourceEvent,{transform:U,snapGrid:H,snapToGrid:Q,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},x={...b,pointerX:Y,pointerY:$,aspectRatio:b.width/b.height},z=void 0,A=xf(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(z=B.get(y.parentId)),z&&y.extent==="parent"&&(A=[[0,0],[z.measured.width,z.measured.height]]),N=[],j=void 0;for(const[L,F]of B)if(F.parentId===n&&(N.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const q=tGn(F,y,F.origin??V);j?j=[[Math.min(q[0][0],j[0][0]),Math.min(q[0][1],j[0][1])],[Math.max(q[1][0],j[1][0]),Math.max(q[1][1],j[1][1])]]:j=q}m==null||m(I,{...b})}).on("drag",I=>{const{transform:B,snapGrid:U,snapToGrid:H,nodeOrigin:Q}=t(),V=w0(I.sourceEvent,{transform:B,snapGrid:U,snapToGrid:H,containerBounds:C}),Z=[];if(!y)return;const{x:Y,y:$,width:L,height:F}=b,q={},K=y.origin??Q,{width:ne,height:ae,x:ue,y:se}=JUn(x,a.controlDirection,V,a.boundaries,a.keepAspectRatio,K,A,j),G=ne!==L,oe=ae!==F,ce=ue!==Y&&G,he=se!==$&&oe;if(!ce&&!he&&!G&&!oe)return;if((ce||he||K[0]===1||K[1]===1)&&(q.x=ce?ue:b.x,q.y=he?se:b.y,b.x=q.x,b.y=q.y,N.length>0)){const Ke=ue-Y,Ne=se-$;for(const xe of N)xe.position={x:xe.position.x-Ke+K[0]*(ne-L),y:xe.position.y-Ne+K[1]*(ae-F)},Z.push(xe)}if((G||oe)&&(q.width=G&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ne:b.width,q.height=oe&&(!a.resizeDirection||a.resizeDirection==="vertical")?ae:b.height,b.width=q.width,b.height=q.height),z&&y.expandParent){const Ke=K[0]*(q.width??0);q.x&&q.x{M&&(k==null||k(I,{...b}),s==null||s({...b}),M=!1)});i.call(D)}function c(){i.on(".drag",null)}return{update:o,destroy:c}}const rGn={},EM=e=>{let n;const t=new Set,r=(h,_)=>{const p=typeof h=="function"?h(n):h;if(!Object.is(p,n)){const m=n;n=_??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(w=>w(n,m))}},s=()=>n,c={setState:r,getState:s,getInitialState:()=>u,subscribe:h=>(t.add(h),()=>t.delete(h)),destroy:()=>{(rGn?"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."),t.clear()}},u=n=e(r,s,c);return c},sGn=e=>e?EM(e):EM,{useDebugValue:iGn}=tt,{useSyncExternalStoreWithSelector:aGn}=DW,oGn=e=>e;function wU(e,n=oGn,t){const r=aGn(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return iGn(r),r}const NM=(e,n)=>{const t=sGn(e),r=(s,i=n)=>wU(t,s,i);return Object.assign(r,t),r},cGn=(e,n)=>e?NM(e,n):NM;function zr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const Gy=T.createContext(null),lGn=Gy.Provider,kU=bo.error001("react");function Ln(e,n){const t=T.useContext(Gy);if(t===null)throw new Error(kU);return wU(t,e,n)}function Ar(){const e=T.useContext(Gy);if(e===null)throw new Error(kU);return T.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const zM={display:"none"},uGn={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},SU="react-flow__node-desc",CU="react-flow__edge-desc",_Gn="react-flow__aria-live",fGn=e=>e.ariaLiveMessage,dGn=e=>e.ariaLabelConfig;function hGn({rfId:e}){const n=Ln(fGn);return f.jsx("div",{id:`${_Gn}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:uGn,children:n})}function pGn({rfId:e,disableKeyboardA11y:n}){const t=Ln(dGn);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${SU}-${e}`,style:zM,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${CU}-${e}`,style:zM,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(hGn,{rfId:e})]})}const Vy=T.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:ms(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});Vy.displayName="Panel";const jM="https://reactflow.dev?utm_source=attribution";function mGn({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(Vy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${jM}`,children:f.jsx("a",{href:jM,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const gGn=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},L1=e=>e.id;function vGn(e,n){return zr(e.selectedNodes.map(L1),n.selectedNodes.map(L1))&&zr(e.selectedEdges.map(L1),n.selectedEdges.map(L1))}function bGn({onSelectionChange:e}){const n=Ar(),{selectedNodes:t,selectedEdges:r}=Ln(gGn,vGn);return T.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const yGn=e=>!!e.onSelectionChangeHandlers;function xGn({onSelectionChange:e}){const n=Ln(yGn);return e||n?f.jsx(bGn,{onSelectionChange:e}):null}const EU=[0,0],wGn={x:0,y:0,zoom:1},kGn=["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"],AM=[...kGn,"rfId"],SGn=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}),TM={translateExtent:J0,nodeOrigin:EU,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function CGn(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:c}=Ln(SGn,zr),u=Ar();T.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=TM,o()}),[]);const h=T.useRef(TM);return T.useEffect(()=>{for(const _ of AM){const p=e[_],m=h.current[_];p!==m&&(typeof e[_]>"u"||(_==="nodes"?n(p):_==="edges"?t(p):_==="minZoom"?r(p):_==="maxZoom"?s(p):_==="translateExtent"?i(p):_==="nodeExtent"?a(p):_==="ariaLabelConfig"?u.setState({ariaLabelConfig:pUn(p)}):_==="fitView"?u.setState({fitViewQueued:p}):_==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[_]:p})))}h.current=e},AM.map(_=>e[_])),null}function RM(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function EGn(e){var r;const[n,t]=T.useState(e==="system"?null:e);return T.useEffect(()=>{if(e!=="system"){t(e);return}const s=RM(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=RM())!=null&&r.matches?"dark":"light"}const MM=typeof document<"u"?document:null;function rm(e=null,n={target:MM,actInsideInputWithModifier:!0}){const[t,r]=T.useState(!1),s=T.useRef(!1),i=T.useRef(new Set([])),[a,o]=T.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(_=>typeof _=="string").map(_=>_.replace("+",` +`):e.draft;function tPn(e,n,t){return!Kc(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class nPn{constructor(){Ws(this,"buffer",null);Ws(this,"listeners",new Set);Ws(this,"saving",!1);Ws(this,"saveError",null);Ws(this,"revision",0);Ws(this,"saveRevision",0);Ws(this,"getSnapshot",()=>this.buffer);Ws(this,"getRevision",()=>this.revision);Ws(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Ws(this,"set",n=>{this.buffer=n,this.notify()});Ws(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Ws(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Ws(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Kc(this.buffer)||this.buffer.conflict!==null)}}function rPn({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var Z,Y,$;const c=ut({...xCn(),enabled:r,subscribed:r}),u=((Z=c.data)==null?void 0:Z.engine)??(c.isPending?void 0:null),h=((Y=c.data)==null?void 0:Y.hint)??null,_=(($=c.data)==null?void 0:$.installCommand)??null,[p,m]=T.useState(!1),[w,k]=T.useState(null),[v,b]=T.useState(null),[x,y]=T.useState(!1),[C,N]=T.useState(null),[z,A]=T.useState(null),[j,M]=T.useState(!1),[D,I]=T.useState(0),B=T.useCallback(L=>{M(L),L&&I(F=>F+1)},[]),U=T.useRef(o);U.current=o;const H=T.useRef(!1),Q=T.useRef(null),V=T.useCallback(()=>{if(H.current)return;Q.current=n,H.current=!0,m(!0);const L=U.current;A(null),b(null),N(null),mxn(e,n,{sessionId:t}).then(F=>{var K,ne;const q=F.pdfPath;if(F.ok&&q){k(ae=>({path:q,version:((ae==null?void 0:ae.version)??0)+1,source:L})),y(F.hadErrors),N(F.note),F.hadErrors&&b(((K=F.log)==null?void 0:K.trim())||null),B(!0);return}k(null),y(!1),N(F.note),M(!1),b(((ne=F.log)==null?void 0:ne.trim())||OZe())}).catch(F=>{k(null),y(!1),N(null),M(!1),A(F instanceof Error?F.message:String(F))}).finally(()=>{H.current=!1,m(!1)})},[e,n,t,B]);return T.useEffect(()=>{!r||!s||!a||!u||Q.current!==n&&V()},[r,s,a,u,n,V]),{engine:u,installHint:h,installCommand:_,compiling:p,compiled:w,stale:w!==null&&w.source!==o,log:v,builtWithErrors:x,note:C,error:z,showPdf:j,setShowPdf:B,viewNonce:D,compile:()=>{i==null||i(),V()},dismiss:()=>{A(null),b(null)}}}const sPn=3e4,iPn=3e4,aPn=5*6e4;function oPn({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:c}){var ue,se,G,oe;const u=T.useMemo(()=>kCn(e,n,{sessionId:t}),[e,n,t]),h=ut({...u,enabled:r,subscribed:r}),_=((ue=h.data)==null?void 0:ue.hasToken)??!1,p=((se=h.data)==null?void 0:se.hasSession)??!1,m=((G=h.data)==null?void 0:G.link)??null,w=!h.isPending,[k,v]=T.useState(null),[b,x]=T.useState(0),[y,C]=T.useState(!1),[N,z]=T.useState(null),[A,j]=T.useState(null),[M,D]=T.useState(!1),I=T.useCallback(ce=>{Un(u.queryKey)&&et.setQueryData(u.queryKey,he=>he&&{...he,hasSession:ce})},[u]),B=T.useCallback(ce=>{Un(u.queryKey)&&et.setQueryData(u.queryKey,ce)},[u]);T.useEffect(()=>{z(null),x(0),L.current=!1,j(null),D(!1),V.current=!1},[r,e,n,t]),T.useEffect(()=>{D(!1)},[a]);const U=T.useRef(!1),H=T.useRef(c);H.current=c;const Q=T.useRef(o);Q.current=o;const V=T.useRef(!1),Z=T.useCallback(ce=>!_||!m||U.current||Q.current?!1:(U.current=!0,C(!0),j(null),Exn(e,n,{sessionId:t,resolve:ce}).then(he=>{V.current=!1,z(he),he.pulled.includes(n)&&(Q.current?D(!0):H.current(he.pulled))}).catch(he=>{V.current=!0,z(null),j(he instanceof Error?he.message:String(he))}).finally(()=>{U.current=!1,C(!1)}),!0),[e,n,t,_,m]),Y=T.useRef(null),$=(k==null?void 0:k.state)==="live";T.useEffect(()=>{if(!r||!s||!w||!_||!m||o||$)return;const ce=`${n}:${m.projectId}:${a}`;Y.current!==ce&&Z()&&(Y.current=ce)},[r,s,w,_,m,n,a,o,y,Z,$]);const L=T.useRef(!1);!y&&N&&N.conflicts.length===0&&!A&&(L.current=!0);const F=r&&w&&!!m&&_&&p&&L.current,q=T.useRef(null),K=T.useRef(Promise.resolve()),ne=T.useRef(!1);ne.current=(k==null?void 0:k.state)==="stopped"&&k.error!=null;const ae=T.useRef(!1);return T.useEffect(()=>{if(!F)return;let ce=!1;const he=()=>{const Re=ae.current;ae.current=!1,!(!Re&&ne.current)&&(K.current=K.current.then(()=>{if(!ce)return xxn(e,n,{sessionId:t,retry:Re}).then(Le=>{var Ke;ce||((q.current===null||((Ke=Le.status)==null?void 0:Ke.state)==="stopped")&&v(Le.status),q.current=Le.key)}).catch(Le=>{ce||v({state:"stopped",error:Le instanceof Error?Le.message:String(Le),needsSession:!1,note:null})})}))};he();const be=setInterval(he,iPn);return()=>{ce=!0,clearInterval(be),q.current=null,v(null),K.current=K.current.then(()=>wxn(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),T.useEffect(()=>Kwn(ce=>{if(ce.key===q.current){if(ce.type==="live"){v(ce.status);return}ce.paths.includes(n)&&(Q.current?D(!0):H.current(ce.paths))}}),[n]),T.useEffect(()=>{if(!r||!s||!w||!_||!m||o||$)return;const ce=setInterval(()=>{U.current||V.current||et.fetchQuery({...SCn(e,n,{sessionId:t}),staleTime:0}).then(he=>{he.remoteChanged&&Z()}).catch(he=>{V.current=!0,j(he instanceof Error?he.message:String(he))})},sPn);return()=>clearInterval(ce)},[r,s,w,_,m,o,e,n,t,Z,$]),T.useEffect(()=>{if(!r||!s||!w||!_||!m||!$)return;const ce=setInterval(Z,aPn);return()=>clearInterval(ce)},[r,s,w,_,m,$,Z]),{hasToken:_,hasSession:p,live:k,retryLive:()=>{ae.current=!0,x(ce=>ce+1)},link:m,loaded:w,syncing:y,last:N,error:A??((oe=h.error)==null?void 0:oe.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>D(!1),uploadUrl:zxn(e,n,{sessionId:t}),saveToken:async ce=>{const he=await UL(ce);Y.current=null,V.current=!1,j(null),Un(u.queryKey)&&et.setQueryData(u.queryKey,be=>be&&{...be,hasToken:he.hasToken})},saveSession:async ce=>{const he=await GL(ce,{host:m==null?void 0:m.host});I(he.hasSession),ae.current=!0,x(be=>be+1)},importSession:async()=>{const ce=await yxn({host:m==null?void 0:m.host});return I(ce.hasSession),ae.current=!0,x(he=>he+1),ce.source},linkProject:async ce=>{z(null),v(null),L.current=!1,Y.current=null,B(await Sxn(e,n,{project:ce,sessionId:t})),i==null||i()},unlink:async()=>{B(await Cxn(e,n,{sessionId:t})),Y.current=null,V.current=!1,z(null),j(null)},sync:ce=>{V.current=!1,Z(ce)&&(Y.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}const qR=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],cPn=4e6,lPn=200,UR=16e6,uPn=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),GR=e=>e.startsWith("//")?`https:${e}`:e;async function _Pn(e,n){var s;let t=cPn;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:c}of e){if(r.has(o)){const w=r.get(o);w&&i.setAttribute(a,w);continue}if(n.aborted)return;if(r.size>=lPn)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const h=u.headers.get("content-type")??"",_=Number(u.headers.get("content-length"));if(!c.some(w=>h.startsWith(w))||!(Number.isFinite(_)&&_>0&&_<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await uPn(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function fPn(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll(qR.map(c=>c.selector).join(", ")))for(const{selector:c,attribute:u,typePrefixes:h}of qR){if(!o.matches(c))continue;const _=o.getAttribute(u);if(!_)continue;const p=n(_);p&&(p===_?o.setAttribute(u,GR(_)):s.push({element:o,attribute:u,url:p,typePrefixes:h}))}await _Pn(s,t);for(const o of r.querySelectorAll("a[href]")){const c=o.getAttribute("href");!c||!C6(c)||(o.setAttribute("href",GR(c)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function dPn(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${UR-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>UR}}function hPn({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=T.useState(null);return T.useEffect(()=>{let o=!1;const c=new AbortController;return a(null),dPn(e,n,t,c.signal).then(async({text:u,partial:h})=>({source:await fPn(u,s,c.signal),partial:h})).then(u=>{o||a(u)}),()=>{o=!0,c.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(jt,{})," ",$D()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:VFe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:JFe({name:Ce(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function pPn({overleaf:e}){var _;const n=T.useRef(null),{open:t,setOpen:r,ref:s}=ga(n),i=T.useId(),[a,o]=T.useState({top:0,left:0,maxHeight:0}),c=((_=e.last)==null?void 0:_.conflicts.length)??0,u=e.hasToken&&!!e.error,h=u?p3():c?Xmt():!e.hasToken||!e.link?_yt():e.syncing?nL():e.blocked?tL():ZD();return T.useEffect(()=>{c&&r(!0)},[c,r]),T.useEffect(()=>{u&&xn(p3(),"error",{id:i,duration:5e3})},[u,e.error,i]),T.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),w=Math.min(p.bottom+6,window.innerHeight-80);o({top:w,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-w-8}),(s.current.querySelector("input")??s.current).focus();const k=()=>r(!1),v=b=>{var x;b.target instanceof Node&&!((x=s.current)!=null&&x.contains(b.target))&&k()};return window.addEventListener("resize",k),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Pt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":h,"data-tip-align":"end","aria-label":zZ({status:h}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(jt,{}):f.jsx(C5n,{size:13,className:u||c?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&ri.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":xL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Pt,{size:"small","aria-label":dFe(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(cr,{size:13})})}),f.jsx(yPn,{overleaf:e})]}),document.body)]})}const z1=e=>na(new Intl.ListFormat(E()).format(e.map(Ce)));function mPn(e){if(e.error)return Lgt();if(e.syncing)return nL();if(e.blocked)return tL();const n=e.last;return n?n.pulled.length&&n.pushed.length?Sbt({pulled:z1(n.pulled),pushed:z1(n.pushed)}):n.pulled.length?gbt({paths:z1(n.pulled)}):n.pushed.length?Tbt({paths:z1(n.pushed)}):n.conflicts.length?I1t():ZD():rbt()}function gPn({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:eL()})}function vPn(e){return e.state==="live"?r1t():e.state==="connecting"?Xgt():e.error??g1t()}function VR({overleaf:e,replacing:n}){const[t,r]=T.useState(""),[s,i]=T.useState(!1),[a,o]=T.useState(!1),[c,u]=T.useState(null),h=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},_=a?Syt():n?$bt():mgt();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:_}),a&&f.jsx(Gr,{className:"basis-full min-w-0","aria-label":h3(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:h3(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(jt,{}),a?f.jsx(De,{type:"button",disabled:s||!t.trim(),onClick:()=>h(()=>e.saveSession(t.trim())),children:s?pa():qmt()}):f.jsx(De,{type:"button",disabled:s,onClick:()=>h(e.importSession),children:kgt()}),f.jsx(De,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?JD():ubt()})]}),c&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:c})]})}function bPn({overleaf:e}){if(!e.hasSession)return f.jsx(VR,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:S1t()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:vPn(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(De,{onClick:e.retryLive,children:u1t()})}),t&&f.jsx(VR,{overleaf:e,replacing:!0})]})}function yPn({overleaf:e}){var p,m,w;const[n,t]=T.useState(""),[r,s]=T.useState(!1),[i,a]=T.useState(null),[o,c]=T.useState(!1),u=()=>{t(""),a(null),c(!0)},h=!e.hasToken||o;async function _(k){k.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{h?(await e.saveToken(v),c(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!h){const k=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(jt,{}),e.error?p3():mPn(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(bPn,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(De,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?Gbt():((m=e.live)==null?void 0:m.state)==="live"?Iyt():void 0,onClick:()=>e.sync(),children:e.error?ti():Avt()}),f.jsxs(bh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[gvt()," ",f.jsx(_f,{size:12})]})]}),k.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",rvt()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(De,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:uvt()}),f.jsx(De,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Xvt()})]})]},v)),((w=e.last)==null?void 0:w.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:aS()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(De,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:gz()}),f.jsx(bh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:eL()}),f.jsx(De,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Ivt()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:_,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:h?Xyt():rxt()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Gr,{className:"basis-full min-w-0","aria-label":h?pz():mz(),"aria-invalid":!!i,type:h?"password":"text",value:n,onChange:k=>t(k.target.value),placeholder:h?pz():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(De,{type:"submit",disabled:r||!n.trim(),children:r?h?pa():_a():h?syt():qgt()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:h?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:h?rgt():mz()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(gPn,{href:e.uploadUrl}),o?f.jsx(De,{variant:"ghost",type:"button",onClick:()=>c(!1),children:JD()}):e.hasToken&&f.jsx(De,{variant:"ghost",type:"button",onClick:u,children:gz()})]})]})}function xPn({command:e}){const[n,t]=T.useState("idle"),r=T.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Pt,{"data-tip":n==="copied"?af():n==="select"?RUe():oPe(),"aria-label":NPe(),onClick:()=>void s(),children:n==="copied"?f.jsx(gi,{size:13}):f.jsx(zf,{size:13})})]})}function KR(e){const[n,t]=T.useState(!1),[r,s]=T.useState(null);return{busy:n,error:r,trigger:async()=>{t(!0),s(null);try{await e()}catch(a){s(a instanceof Error?a.message:String(a))}finally{t(!1)}}}}function wPn({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:c,onScrollPositionChange:u,lineScrollRequest:h,onLineScrollRequestHandled:_,onEdit:p,artifactVersion:m,artifactEntries:w=[],bufferSession:k,remote:v=!1,restored:b=!1,onRestoreActivated:x,showSource:y=!1,onShowSourceChange:C}){var Qr,On;const N=Y$(e,n,t??"repo",r,s),z=ut({...N,enabled:!k.saving}),A=z.data??null,j=((Qr=z.error)==null?void 0:Qr.message)??null,M=We=>{is(N.queryKey,yt=>(typeof We=="function"?We(yt??null):We)??void 0)},[D,I]=T.useState(0),B=t==="artifacts",U=t==="abs",H=pC(n),Q=KH(n),V=gBn(n),Z=H||V,[Y,$]=T.useState(!1),L=!b||Y,F=()=>{$(!0),x==null||x()};T.useSyncExternalStore(k.subscribe,k.getRevision);const q=k.getSnapshot(),K=k.set,ne=k.saving,ae=k.setSaving,ue=k.saveRevision,se=k.saveError,G=k.setSaveError,oe=T.useRef(null),ce=T.useRef(null),[he,be]=T.useState(!1),[Re,Le]=T.useState(null),Ke=T.useRef(c),Ne=(A==null?void 0:A.file)??null,xe=q&&Kc(q)?q.path:(A==null?void 0:A.source)==="checkout"?A.file.path:n,rt=xe.split("/").slice(0,-1).join("/"),Ze=(A==null?void 0:A.source)==="artifact",ot=T.useCallback(We=>{var yt;return((yt=l5(rt,We,U))==null?void 0:yt.path)??null},[U,rt]),kt=T.useCallback(We=>U?qL(We):Ze?lf(e,We):k3(e,We,{sessionId:r,ref:s}),[Ze,s,U,e,r]),qt=T.useCallback(We=>{if(C6(We))return We;const yt=l5(rt,We,U);return yt?V9n(kt(yt.path),yt):null},[U,rt,kt]),dt=eq(Ne==null?void 0:Ne.presentation),pt=(A==null?void 0:A.source)==="artifact"&&!B,Ie=B&&(A==null?void 0:A.source)==="checkout",pe=!s&&(A==null?void 0:A.source)==="checkout"&&Ne!=null&&!Ne.notFound,je=r!=null&&(A==null?void 0:A.source)==="checkout"&&A.file.root==="clone",He=pe&&Ne!=null&&!Ne.binary&&!Ne.truncated&&!dt&&!je,st=He&&Ne.version===void 0,_t=q!==null&&Kc(q),Ct=!st&&(He&&typeof Ne.version=="string"||_t),bt=(q==null?void 0:q.draft)??rk((Ne==null?void 0:Ne.content)??""),Yt=(q==null?void 0:q.baseline)??rk((Ne==null?void 0:Ne.content)??""),un=Ct&&q!==null&&Kc(q),Tt=async We=>{const yt=k.getSnapshot();if(!Ct||!yt||!Kc(yt))return!0;if(k.saving)return!1;if(yt.conflict&&We===void 0)return G(yt.conflict.exists?DN():$N()),!1;const Jn=yt.draft,pr=ePn(yt);ae(!0),G(null);try{await et.cancelQueries(N);const pn=await _xn(e,xe,pr,{sessionId:r,expectedVersion:We??yt.version});return k.getSnapshot()?(k.saved(Jn,pn.version),M(An=>An&&An.source==="checkout"?{source:"checkout",file:{...An.file,content:pr,version:pn.version}}:An),!0):!1}catch(pn){if(pn instanceof w3){const Tr=k.getSnapshot();return!Tr||!Kc(Tr)||K({...Tr,conflict:{currentVersion:pn.currentVersion,exists:pn.exists}}),!1}return G(pn instanceof Error?pn.message:String(pn)),!1}finally{ae(!1)}},ht=Q&&pe&&!je,mt=rPn({projectId:e,filePath:xe,sessionId:r,enabled:ht,autoRun:L,onManualAction:F,ready:Ne!=null&&!Ne.notFound,source:Ct?bt:(Ne==null?void 0:Ne.content)??""}),_n=oPn({projectId:e,filePath:xe,sessionId:r,enabled:ht,autoRun:L,onManualAction:F,savedSource:Yt,dirty:un,onPulled:T.useCallback(We=>{We.includes(xe)&&I(yt=>yt+1)},[xe])}),gs=Q&&mt.showPdf&&mt.compiled!=null,br=st&&_t,Gt=(Ct||br)&&!(Z&&!y)&&!gs,Bn=Ne!==null&&!Ne.notFound&&!Ne.binary&&!dt&&!gs,_r=Bn&&!Gt&&(!V||y),yr=async()=>{if(Ne)try{if(Ne.truncated&&!Gt){const We=fetch(kt(xe)).then(async yt=>{if(!yt.ok)throw new Error;return new Blob([await yt.text()],{type:"text/plain"})});await navigator.clipboard.write([new ClipboardItem({"text/plain":We})])}else await navigator.clipboard.writeText(Gt?bt:Ne.content);be(!0),window.setTimeout(()=>be(!1),1500)}catch{xn(yPe(),"error")}},Wr=We=>{if(!We.metaKey&&!We.ctrlKey||We.altKey||We.shiftKey||We.key.toLowerCase()!=="a"||!(We.target instanceof Node)||!We.currentTarget.contains(We.target))return;const yt=ce.current;if(!yt)return;We.preventDefault();const Jn=document.createRange();Jn.selectNodeContents(yt);const pr=window.getSelection();pr==null||pr.removeAllRanges(),pr==null||pr.addRange(Jn)},Nt=mt.compiled?`${k3(e,mt.compiled.path,{sessionId:r})}&v=${mt.compiled.version}`:null,vn=Nt?`${Nt}&view=${mt.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,fn=mt.compiled?mt.compiled.path.split("/").pop()??mt.compiled.path:null,hn=async()=>{un&&!await Tt()||Q&&mt.engine&&mt.compile()},Ir=async()=>{un&&(L?await hn():await Tt())},bn=KR(()=>dxn(e,xe,{sessionId:r})),yn=KR(()=>hxn(e,xe,{sessionId:r})),Pn=v?fqe():Ne!=null&&Ne.notFound?FN():s?iqe({branch:Ce(s)}):pe?null:bqe(),Et=T.useCallback(()=>{k.saving||I(We=>We+1)},[k]),Bt=()=>{K(null),G(null),Et()},In=nq(kt(xe),!s&&!ne);T.useEffect(()=>{if(!j||s)return;const We=window.setInterval(()=>{document.visibilityState!=="hidden"&&Et()},2e3);return()=>window.clearInterval(We)},[j,s,Et]);const xr=`${kt(xe)}&v=${encodeURIComponent(In??m??"")}&reload=${D}`;T.useEffect(()=>{var Jn,pr;if(!A||k.saving)return;const We=A,yt=k.getSnapshot();if(yt&&Kc(yt)){const pn=We.source==="checkout"?We.file:null,Tr=pn!==null&&pn.path===yt.path&&(!r||pn.root==="worktree"),An=tPn(yt,Tr&&typeof pn.version=="string"?pn.version:null,Tr&&!pn.notFound);An&&(An.currentVersion!==((Jn=yt.conflict)==null?void 0:Jn.currentVersion)||An.exists!==((pr=yt.conflict)==null?void 0:pr.exists))?K({...yt,conflict:An}):!An&&yt.conflict&&K({...yt,conflict:null})}(!yt||!Kc(yt))&&We.source==="checkout"&&!We.file.notFound&&!We.file.binary&&!We.file.truncated&&typeof We.file.version=="string"&&(K(HR(We.file.path,We.file.content,We.file.version)),G(null))},[A,k,r,ne,ue]);const fr=JSON.stringify(N.queryKey),Fn=T.useRef({sourceKey:fr,nonce:D,artifactVersion:m,diskVersion:In});T.useEffect(()=>{const We=Fn.current;Fn.current={sourceKey:fr,nonce:D,artifactVersion:m,diskVersion:In},We.sourceKey===fr&&(We.nonce!==D||We.diskVersion!==null&&We.diskVersion!==In||We.artifactVersion!=null&&We.artifactVersion!==m)&&CCn(e,n,t??"repo",r,s)},[fr,D,m,In,e,n,t,r,s]),T.useLayoutEffect(()=>{const We=oe.current,yt=Ke.current;!We||!Ne||!yt||(We.scrollTop=yt.top,We.scrollLeft=yt.left)},[Ne]);const sr=We=>{if(We.source==="absolute")return RHe();if(B)return vHe({root:r?Zg():Yg()});if(s)return CHe({branch:Ce(s)});if(r&&We.source==="checkout"&&We.file.root==="clone")return TGe();const yt=We.source==="checkout"?We.file.root:We.checkoutRoot;return BHe({root:yt==="worktree"?Zg():Yg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",onKeyDown:Wr,children:[f.jsxs("div",{className:"file-view-header @container flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Ah,{name:xe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ce(xe),children:xe.split("/").pop()||xe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap [&_svg]:flex-none",title:WQ({branch:Ce(a)}),children:[f.jsx(Nm,{size:11}),a]}),Gt&&(ne||un||se)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${se?"text-accent-red":"text-muted"}`,title:se??(ne?pa():gGe()),children:ne?f.jsxs(f.Fragment,{children:[f.jsx(jt,{})," ",CUe()]}):se?vUe():BD()}),f.jsx("div",{ref:Le,className:"contents"}),Q&&mt.compiled&&f.jsx(Pt,{size:"small",active:!mt.showPdf,"data-tip":mt.stale&&mt.showPdf?Pqe():mt.showPdf?Td():GN(),"data-tip-align":"end","aria-label":mt.showPdf?Td():GN(),onClick:()=>mt.setShowPdf(!mt.showPdf),children:mt.showPdf?f.jsx(P3,{size:13}):f.jsx(Ib,{size:13,className:mt.stale?"text-accent-amber":void 0})}),Q&&Nt&&fn&&f.jsx(Bh,{size:"small","data-tip":mt.stale?EFe({name:Ce(fn)}):kv({name:Ce(fn)}),"data-tip-align":"end","aria-label":kv({name:Ce(fn)}),href:Nt,download:fn,children:f.jsx(Db,{size:13,className:mt.stale?"text-accent-amber":void 0})}),ht&&f.jsx(pPn,{overleaf:_n}),Q&&pe&&f.jsx(Pt,{size:"small","data-tip":mt.compiled?qN():LN(),"data-tip-align":"end","aria-label":mt.compiled?qN():LN(),disabled:mt.compiling||!mt.engine,onClick:()=>void hn(),children:mt.compiling?f.jsx(jt,{}):f.jsx(D5n,{size:13})}),Z&&f.jsx(Pt,{size:"small",active:y,"data-tip":y?Cv():Td(),"data-tip-align":"end","aria-label":y?Cv():Td(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(P3,{size:13})}),Bn&&f.jsx(Pt,{size:"small","data-tip":he?af():IN(),"data-tip-align":"end","aria-label":he?af():IN(),onClick:()=>void yr(),children:he?f.jsx(gi,{size:13}):f.jsx(zf,{size:13})}),Ne!=null&&f.jsxs(f.Fragment,{children:[f.jsx(Pt,{size:"small","data-tip":Pn??bn.error??HN(),"data-tip-align":"end","aria-label":HN(),"aria-description":Pn??void 0,disabled:bn.busy||Pn!=null,onClick:()=>void bn.trigger(),children:bn.busy?f.jsx(jt,{}):f.jsx(_f,{size:13})}),f.jsx(Pt,{size:"small","data-tip":Pn??yn.error??UN(),"data-tip-align":"end","aria-label":UN(),"aria-description":Pn??void 0,disabled:yn.busy||Pn!=null,onClick:()=>void yn.trigger(),children:yn.busy?f.jsx(jt,{}):f.jsx(Lu,{size:13})})]})]}),!j&&Ie&&(A==null?void 0:A.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:VHe({root:A.file.root==="worktree"?Zg():Yg()})}),st&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:SGe()}),j&&Ne!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[PN()," ",Ce(j)]}),(q==null?void 0:q.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:q.conflict.exists?DN():$N()}),((On=q==null?void 0:q.conflict)==null?void 0:On.exists)&&q.conflict.currentVersion&&f.jsx(De,{disabled:ne,onPointerDown:We=>We.preventDefault(),onClick:()=>{var We;return void Tt(((We=q.conflict)==null?void 0:We.currentVersion)??void 0)},children:Mqe()}),f.jsx(De,{disabled:ne,onPointerDown:We=>We.preventDefault(),onClick:Bt,children:iUe()})]}),(mt.error||mt.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${mt.builtWithErrors?"text-subtext":"text-accent-red"}`,children:mt.error??(mt.builtWithErrors?ePe():FBe())}),f.jsx(Pt,{"data-tip":JPe(),"data-tip-align":"end","aria-label":aFe(),onClick:mt.dismiss,children:f.jsx(cr,{size:13})})]}),mt.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:mt.log})]}),ht&&_n.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:Eqe()}),f.jsx(De,{onClick:()=>{_n.reloaded(),I(We=>We+1)},children:PPe()})]}),Q&&pe&&mt.engine===null&&mt.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[mt.installHint,mt.installCommand&&f.jsx(xPn,{command:mt.installCommand})]}),mt.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:mt.note}),gs&&mt.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:YUe()}),f.jsxs("div",{ref:oe,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",tabIndex:_r?0:void 0,onScroll:We=>{const yt={top:Math.max(0,We.currentTarget.scrollTop),left:Math.max(0,We.currentTarget.scrollLeft)};Ke.current=yt,u==null||u(yt)},children:[!Gt&&!j&&!B&&(A==null?void 0:A.source)==="checkout"&&!A.file.notFound&&!s&&r&&A.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:sGe()}),!Gt&&!j&&(A==null?void 0:A.source)==="artifact"&&!A.file.notFound&&pt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:xBe({root:A.checkoutRoot==="worktree"?Zg():Yg()})}),j&&Ne===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[PN()," ",Ce(j)]}):Ne===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:$D()}):Gt?f.jsx(F$,{value:bt,onChange:We=>{const yt=k.getSnapshot()??(Ne&&typeof Ne.version=="string"?HR(Ne.path,Ne.content,Ne.version):null);yt&&K(JBn(yt,We)),p==null||p(),se&&G(null)},onSave:()=>void Ir(),onBlur:()=>{nk||Ir()},readOnly:br,path:n,highlightLine:i,scrollRequest:h,onScrollRequestHandled:_,scrollPosition:Ke.current,onScrollPositionChange:We=>{Ke.current=We,u==null||u(We)}}):Ne.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:A?sr(A):FN()}):dt?f.jsx(lb.Provider,{value:Re,children:f.jsx(tk,{kind:dt,url:xr,name:n.split("/").pop()??n})}):Ne.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[zBe()," ",f.jsx("a",{href:xr,download:n.split("/").pop()??n,children:ID()})]}):gs&&vn&&fn?f.jsx(lb.Provider,{value:Re,children:f.jsx(tk,{kind:"pdf",url:vn,name:fn,download:!1},vn)}):H&&!y?f.jsx("div",{ref:ce,className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:Ze?f.jsx(oq,{projectId:e,folder:rt,markdown:Ne.content,entries:w}):f.jsx(Jo,{text:Ne.content,resolveFilePath:ot,resolveImageSrc:qt,onOpenFile:o&&((We,yt,Jn,pr,pn)=>o(We,r,s,pn))})}):V&&!y?f.jsx(hPn,{html:Ne.content,truncated:Ne.truncated,url:xr,name:xe,resolveSrc:qt}):f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:ce,children:f.jsx(JH,{text:Ne.content,path:n,highlightLine:i,scrollRequest:h,onScrollRequestHandled:_})}),Ne.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:BFe()})]})]})]})}const w4=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function kPn({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=ga(),c=T.useRef(null);return T.useEffect(()=>{if(!i)return;const u=h=>{var _;h.key==="Escape"&&((_=c.current)==null||_.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Pt,{size:"small",className:"project-back text-text","aria-label":KN(),onClick:n,children:f.jsx(R0,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:fXe()}),s&&f.jsx(Pt,{size:"small","data-tip":WN(),"data-tip-align":"end","aria-label":WN(),onClick:s,children:f.jsx(KI,{size:18})})]}),f.jsxs("button",{ref:c,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(sc,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(Cn,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:w4,children:[f.jsx(HI,{size:14}),VQe()]})}),f.jsx(Cn,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:w4,children:[f.jsx(UI,{size:14}),KN()]})}),f.jsx(Cn,{onClick:()=>{var u;(u=c.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:w4,children:[f.jsx(q5n,{size:14}),JQe()]})})]})]})})}function SPn(e){const n=new Map,t=new Map(e.map(c=>[c.id,c]));for(const c of e){if(!c.parentExperimentId)continue;const u=n.get(c.parentExperimentId)??[];u.push(c),n.set(c.parentExperimentId,u)}const r=new Map,s=new Map;function i(c){const u=r.get(c);if(u!==void 0)return u;const h=(n.get(c)??[]).some(_=>_.archived||i(_.id));return r.set(c,h),h}function a(c){const u=s.get(c);if(u!==void 0)return u;const h=(n.get(c)??[]).some(_=>!_.archived||a(_.id));return s.set(c,h),h}const o=new Map;for(const c of e){let u=!1,h=!1,_=c.parentExperimentId?t.get(c.parentExperimentId):void 0;for(;_;)_.archived?h=!0:u=!0,_=_.parentExperimentId?t.get(_.parentExperimentId):void 0;o.set(c.id,{archiveOnly:!c.archived,archiveAbove:!c.archived&&u,archiveDown:!c.archived&&a(c.id),restoreOnly:c.archived,restoreAbove:!c.archived&&h,restoreDown:i(c.id)})}return o}function pq({id:e,name:n,actions:t,onArchive:r,compact:s=!1}){const i=T.useRef(null),a=ga(i),[o,c]=T.useState({top:0,left:0}),u=()=>{if(!a.open&&i.current){const _=i.current.getBoundingClientRect(),p=Object.values(t).filter(Boolean).length*32+12,m=window.innerHeight-_.bottom>=p;c({top:m?_.bottom+4:Math.max(4,_.top-p),left:Math.max(4,Math.min(_.right-176,window.innerWidth-180))})}a.setOpen(_=>!_)},h=(_,p)=>{a.setOpen(!1),r(e,_,p)};return f.jsxs("div",{className:"nodrag ms-auto shrink-0",children:[s?f.jsx(Pt,{type:"button",ref:i,size:"small",className:"node-action","aria-label":Fz({name:n}),"aria-expanded":a.open,onClick:u,children:f.jsx(Lb,{size:15,"aria-hidden":"true"})}):f.jsx("button",{type:"button",className:"btn inline-flex h-7 items-center justify-center rounded-sm border border-border bg-background px-2.5 text-sm text-text hover:bg-surface",ref:i,"aria-label":Fz({name:n}),"aria-expanded":a.open,onClick:u,children:Spn()}),a.open&&ri.createPortal(f.jsxs("div",{ref:a.ref,className:"option-menu fixed z-70 min-w-44 rounded-lg border border-border bg-background p-1.5 shadow-menu",style:o,children:[t.archiveAbove&&f.jsx(Cn,{onClick:()=>h("ancestors",!0),children:upn()}),t.archiveOnly&&f.jsx(Cn,{onClick:()=>h("only",!0),children:Ipn()}),t.archiveDown&&f.jsx(Cn,{onClick:()=>h("descendants",!0),children:gpn()}),t.restoreOnly&&f.jsx(Cn,{onClick:()=>h("only",!1),children:DL()}),t.restoreAbove&&f.jsx(Cn,{onClick:()=>h("ancestors",!1),children:I0n()}),t.restoreDown&&f.jsx(Cn,{onClick:()=>h("descendants",!1),children:Y0n()})]}),document.body)]})}function CPn({runs:e,experiments:n,archiveActions:t,emptyHint:r,onOpen:s,onOpenLogs:i,onOpenCode:a,onArchive:o,onCancel:c}){const[u,h]=T.useState(new Set),[_,p]=T.useState(null),m=new Map;for(const v of e){const b=m.get(v.experimentId);b?b.push(v):m.set(v.experimentId,[v])}for(const v of m.values())v.sort((b,x)=>x.createdAt-b.createdAt);const w=[...n].sort((v,b)=>{var C,N,z,A;const x=((N=(C=m.get(v.id))==null?void 0:C[0])==null?void 0:N.createdAt)??v.createdAt;return(((A=(z=m.get(b.id))==null?void 0:z[0])==null?void 0:A.createdAt)??b.createdAt)-x});if(w.length===0)return f.jsx(gC,{icon:yh,title:r??iIe(),description:r?void 0:GLe()});async function k(v){p(null),h(b=>new Set(b).add(v));try{await c(v)}catch(b){h(x=>{const y=new Set(x);return y.delete(v),y}),p(b instanceof Error?b.message:String(b))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[_&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[y$e()," ",_]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":o$e(),children:w.map(v=>{const b=m.get(v.id)??[],x=b[0]??null,y=b.find(A=>A.status==="running"||A.status==="starting"),C=y??x,N=!!(y&&(y.cancelRequested||u.has(y.id))),z=y?N?"cancelling":aa(y):x?aa(x):"idle";return f.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-divider-subtle 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:()=>s(v,"preview"),onDoubleClick:()=>s(v,"keepOpen"),onAuxClick:A=>{A.button===1&&(A.preventDefault(),s(v,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Vr(A=>s(v,A),{stopPropagation:!0}),children:v.title||v.slug}),v.archived&&f.jsx("span",{className:"text-muted text-xs",children:OL()}),f.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:v.branchName,children:[f.jsx(Nm,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:v.branchName})]})]}),f.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:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx(cl,{status:z})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:b.length===1?bIe():MIe({count:Xt(b.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:x?go(x.createdAt):fIe()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":OQ({name:v.title||v.slug}),onClick:A=>A.stopPropagation(),onDoubleClick:A=>A.stopPropagation(),onAuxClick:A=>A.stopPropagation(),children:[f.jsxs(De,{size:"small",disabled:!C,title:C?EIe():ZLe(),...Vr(A=>{C&&i(v.id,C.id,A)},{stopPropagation:!0}),children:[f.jsx(vo,{size:15}),u3()]}),f.jsxs(De,{size:"small",title:vD({branch:Ce(v.branchName)}),...Vr(A=>a(v.id,A),{stopPropagation:!0}),children:[f.jsx($b,{size:15}),e$e()]}),y&&f.jsxs(De,{size:"small",variant:"danger",disabled:N,title:N?PIe():KIe(),onClick:()=>void k(y.id),children:[f.jsx($I,{size:15}),N?Wje():OD()]}),f.jsx(pq,{id:v.id,name:v.title||v.slug,actions:t.get(v.id),onArchive:o})]})]},v.id)})})]})}function EPn({onClose:e,onCreateProject:n}){const[t,r]=T.useState(!1),[s,i]=T.useState(null),a=T.useRef(null),o=T.useCallback(c=>{t||(r(!0),i(null),c().catch(()=>i(Lhn())).finally(()=>r(!1)))},[t]);return T.useEffect(()=>{const c=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e,o]),T.useEffect(()=>{const c=a.current;if(!c)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,h=()=>[...c.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(h()[0]??c).focus();const _=p=>{if(p.key!=="Tab")return;const m=h();if(m.length===0){p.preventDefault(),c.focus();return}const w=m[0],k=m[m.length-1];p.shiftKey&&document.activeElement===w?(p.preventDefault(),k.focus()):!p.shiftKey&&document.activeElement===k&&(p.preventDefault(),w.focus())};return document.addEventListener("keydown",_,!0),()=>{document.removeEventListener("keydown",_,!0),u==null||u.focus()}},[]),ri.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Pt,{className:"absolute end-3.5 top-3.5","aria-label":x3(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(cr,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx(TS,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:chn()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:Xhn()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[qhn()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:whn()}),Hdn()]}),f.jsx("p",{dir:"auto",children:phn()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(De,{onClick:()=>o(n),disabled:t,children:thn()}),f.jsx(De,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?pa():jhn()})]})]})}),document.body)}function ms(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function Iy(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}iv.prototype=Iy.prototype={constructor:iv,on:function(e,n){var t=this._,r=zPn(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),QR.hasOwnProperty(n)?{space:QR[n],local:e}:e}function APn(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===sk&&n.documentElement.namespaceURI===sk?n.createElement(e):n.createElementNS(t,e)}}function TPn(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mq(e){var n=$y(e);return(n.local?TPn:APn)(n)}function RPn(){}function vC(e){return e==null?RPn:function(){return this.querySelector(e)}}function MPn(e){typeof e!="function"&&(e=vC(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=x+1);!(N=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function sFn(e){e||(e=iFn);function n(_,p){return _&&p?e(_.__data__,p.__data__):!_-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function aFn(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function oFn(){return Array.from(this)}function cFn(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?bFn:typeof n=="function"?xFn:yFn)(e,n,t??"")):Th(this.node(),e)}function Th(e,n){return e.style.getPropertyValue(n)||xq(e).getComputedStyle(e,null).getPropertyValue(n)}function kFn(e){return function(){delete this[e]}}function SFn(e,n){return function(){this[e]=n}}function CFn(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function EFn(e,n){return arguments.length>1?this.each((n==null?kFn:typeof n=="function"?CFn:SFn)(e,n)):this.node()[e]}function wq(e){return e.trim().split(/^|\s+/)}function bC(e){return e.classList||new kq(e)}function kq(e){this._node=e,this._names=wq(e.getAttribute("class")||"")}kq.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Sq(e,n){for(var t=bC(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function eHn(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function ik(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:c,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:h}})}ik.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function uHn(e){return!e.ctrlKey&&!e.button}function _Hn(){return this.parentNode}function fHn(e,n){return n??{x:e.x,y:e.y}}function dHn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Aq(){var e=uHn,n=_Hn,t=fHn,r=dHn,s={},i=Iy("start","drag","end"),a=0,o,c,u,h,_=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,lHn).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,N){if(!(h||!e.call(this,C,N))){var z=y(this,n.call(this,C,N),C,N,"mouse");z&&(ra(C.view).on("mousemove.drag",w,Q0).on("mouseup.drag",k,Q0),zq(C.view),k4(C),u=!1,o=C.clientX,c=C.clientY,z("start",C))}}function w(C){if(Kd(C),!u){var N=C.clientX-o,z=C.clientY-c;u=N*N+z*z>_}s.mouse("drag",C)}function k(C){ra(C.view).on("mousemove.drag mouseup.drag",null),jq(C.view,u),Kd(C),s.mouse("end",C)}function v(C,N){if(e.call(this,C,N)){var z=C.changedTouches,A=n.call(this,C,N),j=z.length,M,D;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?A1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?A1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=pHn.exec(e))?new $i(n[1],n[2],n[3],1):(n=mHn.exec(e))?new $i(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=gHn.exec(e))?A1(n[1],n[2],n[3],n[4]):(n=vHn.exec(e))?A1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=bHn.exec(e))?nM(n[1],n[2]/100,n[3]/100,1):(n=yHn.exec(e))?nM(n[1],n[2]/100,n[3]/100,n[4]):XR.hasOwnProperty(e)?JR(XR[e]):e==="transparent"?new $i(NaN,NaN,NaN,0):null}function JR(e){return new $i(e>>16&255,e>>8&255,e&255,1)}function A1(e,n,t,r){return r<=0&&(e=n=t=NaN),new $i(e,n,t,r)}function kHn(e){return e instanceof Bm||(e=vf(e)),e?(e=e.rgb(),new $i(e.r,e.g,e.b,e.opacity)):new $i}function ak(e,n,t,r){return arguments.length===1?kHn(e):new $i(e,n,t,r??1)}function $i(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}yC($i,ak,Tq(Bm,{brighter(e){return e=e==null?_b:Math.pow(_b,e),new $i(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?X0:Math.pow(X0,e),new $i(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $i(nf(this.r),nf(this.g),nf(this.b),fb(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:eM,formatHex:eM,formatHex8:SHn,formatRgb:tM,toString:tM}));function eM(){return`#${L_(this.r)}${L_(this.g)}${L_(this.b)}`}function SHn(){return`#${L_(this.r)}${L_(this.g)}${L_(this.b)}${L_((isNaN(this.opacity)?1:this.opacity)*255)}`}function tM(){const e=fb(this.opacity);return`${e===1?"rgb(":"rgba("}${nf(this.r)}, ${nf(this.g)}, ${nf(this.b)}${e===1?")":`, ${e})`}`}function fb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nf(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function L_(e){return e=nf(e),(e<16?"0":"")+e.toString(16)}function nM(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new uo(e,n,t,r)}function Rq(e){if(e instanceof uo)return new uo(e.h,e.s,e.l,e.opacity);if(e instanceof Bm||(e=vf(e)),!e)return new uo;if(e instanceof uo)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,c=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&c<1?0:a,new uo(a,o,c,e.opacity)}function CHn(e,n,t,r){return arguments.length===1?Rq(e):new uo(e,n,t,r??1)}function uo(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}yC(uo,CHn,Tq(Bm,{brighter(e){return e=e==null?_b:Math.pow(_b,e),new uo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?X0:Math.pow(X0,e),new uo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new $i(S4(e>=240?e-240:e+120,s,r),S4(e,s,r),S4(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new uo(rM(this.h),T1(this.s),T1(this.l),fb(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=fb(this.opacity);return`${e===1?"hsl(":"hsla("}${rM(this.h)}, ${T1(this.s)*100}%, ${T1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rM(e){return e=(e||0)%360,e<0?e+360:e}function T1(e){return Math.max(0,Math.min(1,e||0))}function S4(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const xC=e=>()=>e;function EHn(e,n){return function(t){return e+t*n}}function NHn(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function zHn(e){return(e=+e)==1?Mq:function(n,t){return t-n?NHn(n,t,e):xC(isNaN(n)?t:n)}}function Mq(e,n){var t=n-e;return t?EHn(e,t):xC(isNaN(e)?n:e)}const db=(function e(n){var t=zHn(n);function r(s,i){var a=t((s=ak(s)).r,(i=ak(i)).r),o=t(s.g,i.g),c=t(s.b,i.b),u=Mq(s.opacity,i.opacity);return function(h){return s.r=a(h),s.g=o(h),s.b=c(h),s.opacity=u(h),s+""}}return r.gamma=e,r})(1);function jHn(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,c.push({i:a,x:Uo(r,s)})),t=C4.lastIndex;return t180?h+=360:h-u>180&&(u+=360),p.push({i:_.push(s(_)+"rotate(",null,r)-2,x:Uo(u,h)})):h&&_.push(s(_)+"rotate("+h+r)}function o(u,h,_,p){u!==h?p.push({i:_.push(s(_)+"skewX(",null,r)-2,x:Uo(u,h)}):h&&_.push(s(_)+"skewX("+h+r)}function c(u,h,_,p,m,w){if(u!==_||h!==p){var k=m.push(s(m)+"scale(",null,",",null,")");w.push({i:k-4,x:Uo(u,_)},{i:k-2,x:Uo(h,p)})}else(_!==1||p!==1)&&m.push(s(m)+"scale("+_+","+p+")")}return function(u,h){var _=[],p=[];return u=e(u),h=e(h),i(u.translateX,u.translateY,h.translateX,h.translateY,_,p),a(u.rotate,h.rotate,_,p),o(u.skewX,h.skewX,_,p),c(u.scaleX,u.scaleY,h.scaleX,h.scaleY,_,p),u=h=null,function(m){for(var w=-1,k=p.length,v;++w=0&&e._call.call(void 0,n),e=e._next;--Rh}function aM(){bf=(pb=Z0.now())+By,Rh=a0=0;try{UHn()}finally{Rh=0,VHn(),bf=0}}function GHn(){var e=Z0.now(),n=e-pb;n>Iq&&(By-=n,pb=e)}function VHn(){for(var e,n=hb,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:hb=t);o0=e,lk(r)}function lk(e){if(!Rh){a0&&(a0=clearTimeout(a0));var n=e-bf;n>24?(e<1/0&&(a0=setTimeout(aM,e-Z0.now()-By)),Zp&&(Zp=clearInterval(Zp))):(Zp||(pb=Z0.now(),Zp=setInterval(GHn,Iq)),Rh=1,$q(aM))}}function oM(e,n,t){var r=new mb;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var KHn=Iy("start","end","cancel","interrupt"),WHn=[],Pq=0,cM=1,uk=2,ov=3,lM=4,_k=5,cv=6;function Py(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;QHn(e,t,{name:n,index:r,group:s,on:KHn,tween:WHn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Pq})}function kC(e,n){var t=yo(e,n);if(t.state>Pq)throw new Error("too late; already scheduled");return t}function uc(e,n){var t=yo(e,n);if(t.state>ov)throw new Error("too late; already running");return t}function yo(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function QHn(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=Bq(i,0,t.time);function i(u){t.state=cM,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var h,_,p,m;if(t.state!==cM)return c();for(h in r)if(m=r[h],m.name===t.name){if(m.state===ov)return oM(a);m.state===lM?(m.state=cv,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[h]):+huk&&r.state<_k,r.state=cv,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete t[a]}i&&delete e.__transition}}function XHn(e){return this.each(function(){lv(this,e)})}function YHn(e,n){var t,r;return function(){var s=uc(this,e),i=s.tween;if(i!==t){r=t=i;for(var a=0,o=r.length;a=0&&(n=n.slice(0,t)),!n||n==="start"})}function Cqn(e,n,t){var r,s,i=Sqn(n)?kC:uc;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function Eqn(e,n){var t=this._id;return arguments.length<2?yo(this.node(),t).on.on(e):this.each(Cqn(t,e,n))}function Nqn(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function zqn(){return this.on("end.remove",Nqn(this._id))}function jqn(e){var n=this._name,t=this._id;typeof e!="function"&&(e=vC(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function eUn(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function il(e,n,t){this.k=e,this.x=n,this.y=t}il.prototype={constructor:il,scale:function(e){return e===1?this:new il(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new il(this.k,this.x+this.k*e,this.y+this.k*n)},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 Fy=new il(1,0,0);Uq.prototype=il.prototype;function Uq(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fy;return e.__zoom}function E4(e){e.stopImmediatePropagation()}function Jp(e){e.preventDefault(),e.stopImmediatePropagation()}function tUn(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function nUn(){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 uM(){return this.__zoom||Fy}function rUn(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sUn(){return navigator.maxTouchPoints||"ontouchstart"in this}function iUn(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Gq(){var e=tUn,n=nUn,t=iUn,r=rUn,s=sUn,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,c=av,u=Iy("start","zoom","end"),h,_,p,m=500,w=150,k=0,v=10;function b(H){H.property("__zoom",uM).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",D).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(H,Q,V,Z){var Y=H.selection?H.selection():H;Y.property("__zoom",uM),H!==Y?N(H,Q,V,Z):Y.interrupt().each(function(){z(this,arguments).event(Z).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},b.scaleBy=function(H,Q,V,Z){b.scaleTo(H,function(){var Y=this.__zoom.k,$=typeof Q=="function"?Q.apply(this,arguments):Q;return Y*$},V,Z)},b.scaleTo=function(H,Q,V,Z){b.transform(H,function(){var Y=n.apply(this,arguments),$=this.__zoom,L=V==null?C(Y):typeof V=="function"?V.apply(this,arguments):V,F=$.invert(L),q=typeof Q=="function"?Q.apply(this,arguments):Q;return t(y(x($,q),L,F),Y,a)},V,Z)},b.translateBy=function(H,Q,V,Z){b.transform(H,function(){return t(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof V=="function"?V.apply(this,arguments):V),n.apply(this,arguments),a)},null,Z)},b.translateTo=function(H,Q,V,Z,Y){b.transform(H,function(){var $=n.apply(this,arguments),L=this.__zoom,F=Z==null?C($):typeof Z=="function"?Z.apply(this,arguments):Z;return t(Fy.translate(F[0],F[1]).scale(L.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof V=="function"?-V.apply(this,arguments):-V),$,a)},Z,Y)};function x(H,Q){return Q=Math.max(i[0],Math.min(i[1],Q)),Q===H.k?H:new il(Q,H.x,H.y)}function y(H,Q,V){var Z=Q[0]-V[0]*H.k,Y=Q[1]-V[1]*H.k;return Z===H.x&&Y===H.y?H:new il(H.k,Z,Y)}function C(H){return[(+H[0][0]+ +H[1][0])/2,(+H[0][1]+ +H[1][1])/2]}function N(H,Q,V,Z){H.on("start.zoom",function(){z(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(Z).end()}).tween("zoom",function(){var Y=this,$=arguments,L=z(Y,$).event(Z),F=n.apply(Y,$),q=V==null?C(F):typeof V=="function"?V.apply(Y,$):V,K=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),ne=Y.__zoom,ae=typeof Q=="function"?Q.apply(Y,$):Q,ue=c(ne.invert(q).concat(K/ne.k),ae.invert(q).concat(K/ae.k));return function(se){if(se===1)se=ae;else{var G=ue(se),oe=K/G[2];se=new il(oe,q[0]-G[0]*oe,q[1]-G[1]*oe)}L.zoom(null,se)}})}function z(H,Q,V){return!V&&H.__zooming||new A(H,Q)}function A(H,Q){this.that=H,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=n.apply(H,Q),this.taps=0}A.prototype={event:function(H){return H&&(this.sourceEvent=H),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(H,Q){return this.mouse&&H!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&H!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&H!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(H){var Q=ra(this.that).datum();u.call(H,this.that,new eUn(H,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Q)}};function j(H,...Q){if(!e.apply(this,arguments))return;var V=z(this,Q).event(H),Z=this.__zoom,Y=Math.max(i[0],Math.min(i[1],Z.k*Math.pow(2,r.apply(this,arguments)))),$=io(H);if(V.wheel)(V.mouse[0][0]!==$[0]||V.mouse[0][1]!==$[1])&&(V.mouse[1]=Z.invert(V.mouse[0]=$)),clearTimeout(V.wheel);else{if(Z.k===Y)return;V.mouse=[$,Z.invert($)],lv(this),V.start()}Jp(H),V.wheel=setTimeout(L,w),V.zoom("mouse",t(y(x(Z,Y),V.mouse[0],V.mouse[1]),V.extent,a));function L(){V.wheel=null,V.end()}}function M(H,...Q){if(p||!e.apply(this,arguments))return;var V=H.currentTarget,Z=z(this,Q,!0).event(H),Y=ra(H.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",K,!0),$=io(H,V),L=H.clientX,F=H.clientY;zq(H.view),E4(H),Z.mouse=[$,this.__zoom.invert($)],lv(this),Z.start();function q(ne){if(Jp(ne),!Z.moved){var ae=ne.clientX-L,ue=ne.clientY-F;Z.moved=ae*ae+ue*ue>k}Z.event(ne).zoom("mouse",t(y(Z.that.__zoom,Z.mouse[0]=io(ne,V),Z.mouse[1]),Z.extent,a))}function K(ne){Y.on("mousemove.zoom mouseup.zoom",null),jq(ne.view,Z.moved),Jp(ne),Z.event(ne).end()}}function D(H,...Q){if(e.apply(this,arguments)){var V=this.__zoom,Z=io(H.changedTouches?H.changedTouches[0]:H,this),Y=V.invert(Z),$=V.k*(H.shiftKey?.5:2),L=t(y(x(V,$),Z,Y),n.apply(this,Q),a);Jp(H),o>0?ra(this).transition().duration(o).call(N,L,Z,H):ra(this).call(b.transform,L,Z,H)}}function I(H,...Q){if(e.apply(this,arguments)){var V=H.touches,Z=V.length,Y=z(this,Q,H.changedTouches.length===Z).event(H),$,L,F,q;for(E4(H),L=0;L`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:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,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.`},J0=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Vq=["Enter"," ","Escape"],Kq={"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:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"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 Mh;(function(e){e.Strict="strict",e.Loose="loose"})(Mh||(Mh={}));var rf;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(rf||(rf={}));var em;(function(e){e.Partial="partial",e.Full="full"})(em||(em={}));const Wq={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var gu;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(gu||(gu={}));var gb;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(gb||(gb={}));var Rt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Rt||(Rt={}));const _M={[Rt.Left]:Rt.Right,[Rt.Right]:Rt.Left,[Rt.Top]:Rt.Bottom,[Rt.Bottom]:Rt.Top};function Qq(e){return e===null?null:e?"valid":"invalid"}const Xq=e=>"id"in e&&"source"in e&&"target"in e,aUn=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),CC=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Pm=(e,n=[0,0])=>{const{width:t,height:r}=yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},oUn=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):CC(s)?s:n.nodeLookup.get(s.id));const o=a?vb(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Hy(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return qy(t)},Fm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=Hy(t,vb(s)),r=!0)}),r?qy(t):{x:0,y:0,width:0,height:0}},EC=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,c=(n.y-r)/s,u=n.width/s,h=n.height/s,_=[];for(const p of e.values()){const{measured:m,selectable:w=!0,hidden:k=!1}=p;if(a&&!w||k)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x,y}=p.internals.positionAbsolute,C=eU(o,c,u,h,x,y,v,b),N=v*b,z=i&&C>0;(!p.internals.handleBounds||z||C>=N||p.dragging)&&_.push(p)}return _},cUn=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function lUn(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function uUn({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=lUn(e,a),c=Fm(o),u=zC(c,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function Yq({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:c,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},h=a.origin??r;let _=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",bo.error005());else{const m=o.measured.width,w=o.measured.height;m&&w&&(_=[[c,u],[c+m,u+w]])}else o&&xf(a.extent)&&(_=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const p=xf(_)?yf(n,_,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",bo.error015())),{position:{x:p.x-c+(a.measured.width??0)*h[0],y:p.y-u+(a.measured.height??0)*h[1]},positionAbsolute:p}}async function _Un({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),w=!m&&p.parentId&&a.find(k=>k.id===p.parentId);(m||w)&&a.push(p)}const o=new Set(n.map(p=>p.id)),c=r.filter(p=>p.deletable!==!1),h=cUn(a,c);for(const p of c)o.has(p.id)&&!h.find(w=>w.id===p.id)&&h.push(p);if(!s)return{edges:h,nodes:a};const _=await s({nodes:a,edges:h});return typeof _=="boolean"?_?{edges:h,nodes:a}:{edges:[],nodes:[]}:_}const Oh=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),yf=(e={x:0,y:0},n,t)=>({x:Oh(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:Oh(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function Zq(e,n,t){const{width:r,height:s}=yl(t),{x:i,y:a}=t.internals.positionAbsolute;return yf(e,[[i,a],[i+r,a+s]],n)}const fM=(e,n,t)=>et?-Oh(Math.abs(e-t),1,n)/n:0,NC=(e,n,t=15,r=40)=>{const s=fM(e.x,r,n.width-r)*t,i=fM(e.y,r,n.height-r)*t;return[s,i]},Hy=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),fk=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),qy=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),tm=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=CC(e)?e.internals.positionAbsolute:Pm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},vb=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=CC(e)?e.internals.positionAbsolute:Pm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Jq=(e,n)=>qy(Hy(fk(e),fk(n))),eU=(e,n,t,r,s,i,a,o)=>{const c=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(c*u)},bb=(e,n)=>eU(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),dM=e=>fo(e.width)&&fo(e.height)&&fo(e.x)&&fo(e.y),fo=e=>!isNaN(e)&&isFinite(e),tU=(e,n)=>(t,r)=>{},Hm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),qm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?Hm(o,a):o},Dh=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function wd(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.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 fUn(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=wd(e,t),s=wd(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=wd(e.top??e.y??0,t),s=wd(e.bottom??e.y??0,t),i=wd(e.left??e.x??0,n),a=wd(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function dUn(e,n,t,r,s,i){const{x:a,y:o}=Dh(e,[n,t,r]),{x:c,y:u}=Dh({x:e.x+e.width,y:e.y+e.height},[n,t,r]),h=s-c,_=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(h),bottom:Math.floor(_)}}const zC=(e,n,t,r,s,i)=>{const a=fUn(i,n,t),o=(n-a.x)/e.width,c=(t-a.y)/e.height,u=Math.min(o,c),h=Oh(u,r,s),_=e.x+e.width/2,p=e.y+e.height/2,m=n/2-_*h,w=t/2-p*h,k=dUn(e,m,w,h,n,t),v={left:Math.min(k.left-a.left,0),top:Math.min(k.top-a.top,0),right:Math.min(k.right-a.right,0),bottom:Math.min(k.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:w-v.top+v.bottom,zoom:h}},nm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function xf(e){return e!=null&&e!=="parent"}function yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function nU(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function rU(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function hM(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function hUn(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function pUn(e){return{...Kq,...e||{}}}function w0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=ho(e),o=qm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=t?Hm(o,n):o;return{xSnapped:c,ySnapped:u,...o}}const jC=e=>({width:e.offsetWidth,height:e.offsetHeight}),sU=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},mUn=["INPUT","SELECT","TEXTAREA"];function iU(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:mUn.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const aU=e=>"clientX"in e,ho=(e,n)=>{var i,a;const t=aU(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},pM=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...jC(a)}})};function oU({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const c=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,h=Math.abs(c-e),_=Math.abs(u-n);return[c,u,h,_]}function O1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function mM({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Rt.Left:return[n-O1(n-r,i),t];case Rt.Right:return[n+O1(r-n,i),t];case Rt.Top:return[n,t-O1(t-s,i)];case Rt.Bottom:return[n,t+O1(s-t,i)]}}function cU({sourceX:e,sourceY:n,sourcePosition:t=Rt.Bottom,targetX:r,targetY:s,targetPosition:i=Rt.Top,curvature:a=.25}){const[o,c]=mM({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,h]=mM({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[_,p,m,w]=oU({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:h});return[`M${e},${n} C${o},${c} ${u},${h} ${r},${s}`,_,p,m,w]}function lU({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const bUn=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,yUn=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),xUn=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",bo.error006()),n;const r=t.getEdgeId||bUn;let s;return Xq(e)?s={...e}:s={...e,id:r(e)},yUn(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function uU({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=lU({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const gM={[Rt.Left]:{x:-1,y:0},[Rt.Right]:{x:1,y:0},[Rt.Top]:{x:0,y:-1},[Rt.Bottom]:{x:0,y:1}},wUn=({source:e,sourcePosition:n=Rt.Bottom,target:t})=>n===Rt.Left||n===Rt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function kUn({source:e,sourcePosition:n=Rt.Bottom,target:t,targetPosition:r=Rt.Top,center:s,offset:i,stepPosition:a}){const o=gM[n],c=gM[r],u={x:e.x+o.x*i,y:e.y+o.y*i},h={x:t.x+c.x*i,y:t.y+c.y*i},_=wUn({source:u,sourcePosition:n,target:h}),p=_.x!==0?"x":"y",m=_[p];let w=[],k,v;const b={x:0,y:0},x={x:0,y:0},[,,y,C]=lU({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*c[p]===-1){p==="x"?(k=s.x??u.x+(h.x-u.x)*a,v=s.y??(u.y+h.y)/2):(k=s.x??(u.x+h.x)/2,v=s.y??u.y+(h.y-u.y)*a);const j=[{x:k,y:u.y},{x:k,y:h.y}],M=[{x:u.x,y:v},{x:h.x,y:v}];o[p]===m?w=p==="x"?j:M:w=p==="x"?M:j}else{const j=[{x:u.x,y:h.y}],M=[{x:h.x,y:u.y}];if(p==="x"?w=o.x===m?M:j:w=o.y===m?j:M,n===r){const H=Math.abs(e[p]-t[p]);if(H<=i){const Q=Math.min(i-1,i-H);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Q:x[p]=(h[p]>t[p]?-1:1)*Q}}if(n!==r){const H=p==="x"?"y":"x",Q=o[p]===c[H],V=u[H]>h[H],Z=u[H]=U?(k=(D.x+I.x)/2,v=w[0].y):(k=w[0].x,v=(D.y+I.y)/2)}const N={x:u.x+b.x,y:u.y+b.y},z={x:h.x+x.x,y:h.y+x.y};return[[e,...N.x!==w[0].x||N.y!==w[0].y?[N]:[],...w,...z.x!==w[w.length-1].x||z.y!==w[w.length-1].y?[z]:[],t],k,v,y,C]}function SUn(e,n,t,r){const s=Math.min(vM(e,n)/2,vM(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function hk(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function EUn(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=hk(c,n);i.has(u)||(a.push({id:u,color:c.color||t,...c}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const _U=1e3,NUn=10,AC={nodeOrigin:[0,0],nodeExtent:J0,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},zUn={...AC,checkEquality:!0};function TC(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function jUn(e,n,t){const r=TC(AC,t);for(const s of e.values())if(s.parentId)MC(s,e,n,r);else{const i=Pm(s,r.nodeOrigin),a=xf(s.extent)?s.extent:r.nodeExtent,o=yf(i,a,yl(s));s.internals.positionAbsolute=o}}function AUn(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function RC(e){return e==="manual"}function pk(e,n,t,r={}){var h,_;const s=TC(zUn,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!RC(s.zIndexMode)?_U:0;let c=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const w=Pm(p,s.nodeOrigin),k=xf(p.extent)?p.extent:s.nodeExtent,v=yf(w,k,yl(p));m={...s.defaults,...p,measured:{width:(h=p.measured)==null?void 0:h.width,height:(_=p.measured)==null?void 0:_.height},internals:{positionAbsolute:v,handleBounds:AUn(p,m),z:fU(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),p.parentId&&MC(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function TUn(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function MC(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:c}=TC(AC,r),u=e.parentId,h=n.get(u);if(!h){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}TUn(e,t),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&c==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*NUn),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const _=i&&!RC(c)?_U:0,{x:p,y:m,z:w}=RUn(e,h,a,o,_,c),{positionAbsolute:k}=e.internals,v=p!==k.x||m!==k.y;(v||w!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:k,z:w}})}function fU(e,n,t){const r=fo(e.zIndex)?e.zIndex:0;return RC(t)?r:r+(e.selected?n:0)}function RUn(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,c=yl(e),u=Pm(e,t),h=xf(e.extent)?yf(u,e.extent,c):u;let _=yf({x:a+h.x,y:o+h.y},r,c);e.extent==="parent"&&(_=Zq(_,c,n));const p=fU(e,s,i),m=n.internals.z??0;return{x:_.x,y:_.y,z:m>=p?m+1:p}}function OC(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const c=n.get(o.parentId);if(!c)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??tm(c),h=Jq(u,o.rect);i.set(o.parentId,{expandedRect:h,parent:c})}return i.size>0&&i.forEach(({expandedRect:o,parent:c},u)=>{var y;const h=c.internals.positionAbsolute,_=yl(c),p=c.origin??r,m=o.x0||w>0||b||x)&&(s.push({id:u,type:"position",position:{x:c.position.x-m+b,y:c.position.y-w+x}}),(y=t.get(u))==null||y.forEach(C=>{e.some(N=>N.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+w}})})),(_.width0){const m=OC(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:c}}async function OUn({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function wM(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const c=r.get(a)||new Map;if(r.set(a,c.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function dU(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,h=`${i}-${o}--${s}-${a}`;wM("source",c,h,e,s,a),wM("target",c,u,e,i,o),n.set(r.id,r)}}function hU(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:hU(t,n):!1}function kM(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function DUn(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!hU(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function N4({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,c;const s=[];for(const[u,h]of n){const _=(a=t.get(u))==null?void 0:a.internals.userNode;_&&s.push({..._,position:h.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((c=n.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function LUn({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=Hm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function IUn({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,c=!1,u={x:0,y:0},h=null,_=!1,p=null,m=!1,w=!1,k=null;function v({noDragClassName:x,handleSelector:y,domNode:C,isSelectable:N,nodeId:z,nodeClickDistance:A=0}){p=ra(C);function j({x:B,y:U}){const{nodeLookup:H,nodeExtent:Q,snapGrid:V,snapToGrid:Z,nodeOrigin:Y,onNodeDrag:$,onSelectionDrag:L,onError:F,updateNodePositions:q}=n();i={x:B,y:U};let K=!1;const ne=o.size>1,ae=ne&&Q?fk(Fm(o)):null,ue=ne&&Z?LUn({dragItems:o,snapGrid:V,x:B,y:U}):null;for(const[se,G]of o){if(!H.has(se))continue;let oe={x:B-G.distance.x,y:U-G.distance.y};Z&&(oe=ue?{x:Math.round(oe.x+ue.x),y:Math.round(oe.y+ue.y)}:Hm(oe,V));let ce=null;if(ne&&Q&&!G.extent&&ae){const{positionAbsolute:Re}=G.internals,Le=Re.x-ae.x+Q[0][0],Ke=Re.x+G.measured.width-ae.x2+Q[1][0],Ne=Re.y-ae.y+Q[0][1],xe=Re.y+G.measured.height-ae.y2+Q[1][1];ce=[[Le,Ne],[Ke,xe]]}const{position:he,positionAbsolute:be}=Yq({nodeId:se,nextPosition:oe,nodeLookup:H,nodeExtent:ce||Q,nodeOrigin:Y,onError:F});K=K||G.position.x!==he.x||G.position.y!==he.y,G.position=he,G.internals.positionAbsolute=be}if(w=w||K,!!K&&(q(o,!0),k&&(r||$||!z&&L))){const[se,G]=N4({nodeId:z,dragItems:o,nodeLookup:H});r==null||r(k,o,se,G),$==null||$(k,se,G),z||L==null||L(k,G)}}async function M(){if(!h)return;const{transform:B,panBy:U,autoPanSpeed:H,autoPanOnNodeDrag:Q}=n();if(!Q){c=!1,cancelAnimationFrame(a);return}const[V,Z]=NC(u,h,H);(V!==0||Z!==0)&&(i.x=(i.x??0)-V/B[2],i.y=(i.y??0)-Z/B[2],await U({x:V,y:Z})&&j(i)),a=requestAnimationFrame(M)}function D(B){var ne;const{nodeLookup:U,multiSelectionActive:H,nodesDraggable:Q,transform:V,snapGrid:Z,snapToGrid:Y,selectNodesOnDrag:$,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:q}=n();_=!0,(!$||!N)&&!H&&z&&((ne=U.get(z))!=null&&ne.selected||q()),N&&$&&z&&(e==null||e(z));const K=w0(B.sourceEvent,{transform:V,snapGrid:Z,snapToGrid:Y,containerBounds:h});if(i=K,o=DUn(U,Q,K,z),o.size>0&&(t||L||!z&&F)){const[ae,ue]=N4({nodeId:z,dragItems:o,nodeLookup:U});t==null||t(B.sourceEvent,o,ae,ue),L==null||L(B.sourceEvent,ae,ue),z||F==null||F(B.sourceEvent,ue)}}const I=Aq().clickDistance(A).on("start",B=>{const{domNode:U,nodeDragThreshold:H,transform:Q,snapGrid:V,snapToGrid:Z}=n();h=(U==null?void 0:U.getBoundingClientRect())||null,m=!1,w=!1,k=B.sourceEvent,H===0&&D(B),i=w0(B.sourceEvent,{transform:Q,snapGrid:V,snapToGrid:Z,containerBounds:h}),u=ho(B.sourceEvent,h)}).on("drag",B=>{const{autoPanOnNodeDrag:U,transform:H,snapGrid:Q,snapToGrid:V,nodeDragThreshold:Z,nodeLookup:Y}=n(),$=w0(B.sourceEvent,{transform:H,snapGrid:Q,snapToGrid:V,containerBounds:h});if(k=B.sourceEvent,(B.sourceEvent.type==="touchmove"&&B.sourceEvent.touches.length>1||z&&!Y.has(z))&&(m=!0),!m){if(!c&&U&&_&&(c=!0,M()),!_){const L=ho(B.sourceEvent,h),F=L.x-u.x,q=L.y-u.y;Math.sqrt(F*F+q*q)>Z&&D(B)}(i.x!==$.xSnapped||i.y!==$.ySnapped)&&o&&_&&(u=ho(B.sourceEvent,h),j($))}}).on("end",B=>{if(!_||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(c=!1,_=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:U,updateNodePositions:H,onNodeDragStop:Q,onSelectionDragStop:V}=n();if(w&&(H(o,!1),w=!1),s||Q||!z&&V){const[Z,Y]=N4({nodeId:z,dragItems:o,nodeLookup:U,dragging:!1});s==null||s(B.sourceEvent,o,Z,Y),Q==null||Q(B.sourceEvent,Z,Y),z||V==null||V(B.sourceEvent,Y)}}}).filter(B=>{const U=B.target;return!B.button&&(!x||!kM(U,`.${x}`,C))&&(!y||kM(U,y,C))});p.call(I)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function $Un(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())bb(s,tm(i))>0&&r.push(i);return r}const BUn=250;function PUn(e,n,t,r){var o,c;let s=[],i=1/0;const a=$Un(e,t,n+BUn);for(const u of a){const h=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const _ of h){if(r.nodeId===_.nodeId&&r.type===_.type&&r.id===_.id)continue;const{x:p,y:m}=wf(u,_,_.position,!0),w=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));w>n||(w1){const u=r.type==="source"?"target":"source";return s.find(h=>h.type===u)??s[0]}return s[0]}function pU(e,n,t,r,s,i=!1){var u,h,_;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((h=a.internals.handleBounds)==null?void 0:h.source)??[],...((_=a.internals.handleBounds)==null?void 0:_.target)??[]],c=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return c&&i?{...c,...wf(a,c,c.position,!0)}:c}function mU(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function FUn(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const gU=()=>!0;function HUn(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:c,lib:u,autoPanOnConnect:h,flowId:_,panBy:p,cancelConnection:m,onConnectStart:w,onConnect:k,onConnectEnd:v,isValidConnection:b=gU,onReconnectEnd:x,updateConnection:y,getTransform:C,getFromHandle:N,autoPanSpeed:z,dragThreshold:A=1,handleDomNode:j}){const M=sU(e.target);let D=0,I;const{x:B,y:U}=ho(e),H=mU(i,j),Q=o==null?void 0:o.getBoundingClientRect();let V=!1;if(!Q||!H)return;const Z=pU(s,H,r,c,n);if(!Z)return;let Y=ho(e,Q),$=!1,L=null,F=!1,q=null;function K(){if(!h||!Q)return;const[he,be]=NC(Y,Q,z);p({x:he,y:be}),D=requestAnimationFrame(K)}const ne={...Z,nodeId:s,type:H,position:Z.position},ae=c.get(s);let se={inProgress:!0,isValid:null,from:wf(ae,ne,Rt.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:ae,to:Y,toHandle:null,toPosition:_M[ne.position],toNode:null,pointer:Y};function G(){V=!0,y(se),w==null||w(e,{nodeId:s,handleId:r,handleType:H})}A===0&&G();function oe(he){if(!V){const{x:xe,y:rt}=ho(he),Ze=xe-B,ot=rt-U;if(!(Ze*Ze+ot*ot>A*A))return;G()}if(!N()||!ne){ce(he);return}const be=C();Y=ho(he,Q),I=PUn(qm(Y,be,!1,[1,1]),t,c,ne),$||(K(),$=!0);const Re=vU(he,{handle:I,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:_,nodeLookup:c});q=Re.handleDomNode,L=Re.connection,F=FUn(!!I,Re.isValid);const Le=c.get(s),Ke=Le?wf(Le,ne,Rt.Left,!0):se.from,Ne={...se,from:Ke,isValid:F,to:Re.toHandle&&F?Dh({x:Re.toHandle.x,y:Re.toHandle.y},be):Y,toHandle:Re.toHandle,toPosition:F&&Re.toHandle?Re.toHandle.position:_M[ne.position],toNode:Re.toHandle?c.get(Re.toHandle.nodeId):null,pointer:Y};y(Ne),se=Ne}function ce(he){if(!("touches"in he&&he.touches.length>0)){if(V){(I||q)&&L&&F&&(k==null||k(L));const{inProgress:be,...Re}=se,Le={...Re,toPosition:se.toHandle?se.toPosition:null};v==null||v(he,Le),i&&(x==null||x(he,Le))}m(),cancelAnimationFrame(D),$=!1,F=!1,L=null,q=null,M.removeEventListener("mousemove",oe),M.removeEventListener("mouseup",ce),M.removeEventListener("touchmove",oe),M.removeEventListener("touchend",ce)}}M.addEventListener("mousemove",oe),M.addEventListener("mouseup",ce),M.addEventListener("touchmove",oe),M.addEventListener("touchend",ce)}function vU(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:c,isValidConnection:u=gU,nodeLookup:h}){const _=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${c}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:w}=ho(e),k=a.elementFromPoint(m,w),v=k!=null&&k.classList.contains(`${o}-flow__handle`)?k:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const x=mU(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),N=v.classList.contains("connectable"),z=v.classList.contains("connectableend");if(!y||!x)return b;const A={source:_?y:r,sourceHandle:_?C:s,target:_?r:y,targetHandle:_?s:C};b.connection=A;const M=N&&z&&(t===Mh.Strict?_&&x==="source"||!_&&x==="target":y!==r||C!==s);b.isValid=M&&u(A),b.toHandle=pU(y,x,C,h,t,!0)}return b}const mk={onPointerDown:HUn,isValid:vU};function qUn({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=ra(e);function i({translateExtent:o,width:c,height:u,zoomStep:h=1,pannable:_=!0,zoomable:p=!0,inversePan:m=!1}){const w=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),N=y.sourceEvent.ctrlKey&&nm()?10:1,z=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*h,A=C[2]*Math.pow(2,z*N);n.scaleTo(A)};let k=[0,0];const v=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])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const N=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],z=[N[0]-k[0],N[1]-k[1]];k=N;const A=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-z[0]*A,y:C[1]-z[1]*A},M=[[0,0],[c,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},x=Gq().on("start",v).on("zoom",_?b:null).on("zoom.wheel",p?w:null);s.call(x,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:io}}const Uy=e=>({x:e.x,y:e.y,zoom:e.k}),z4=({x:e,y:n,zoom:t})=>Fy.translate(e,n).scale(t),Od=(e,n)=>e.target.closest(`.${n}`),bU=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),UUn=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,j4=(e,n=0,t=UUn,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},yU=e=>{const n=e.ctrlKey&&nm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function GUn({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:u}){return h=>{if(Od(h,n))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const _=t.property("__zoom").k||1;if(h.ctrlKey&&a){const v=io(h),b=yU(h),x=_*Math.pow(2,b);r.scaleTo(t,x,v,h);return}const p=h.deltaMode===1?20:1;let m=s===rf.Vertical?0:h.deltaX*p,w=s===rf.Horizontal?0:h.deltaY*p;!nm()&&h.shiftKey&&s!==rf.Vertical&&(m=h.deltaY*p,w=0),r.translateBy(t,-(m/_)*i,-(w/_)*i,{internal:!0});const k=Uy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(h,k),e.panScrollTimeout=setTimeout(()=>{u==null||u(h,k),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(h,k))}}function VUn({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=Od(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function KUn({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=Uy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function WUn({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&bU(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,Uy(i.transform)))}}function QUn({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&bU(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=Uy(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},t?150:0)}}}function XUn({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:c,lib:u,connectionInProgress:h}){return _=>{var v;const p=e||n,m=t&&_.ctrlKey,w=_.type==="wheel";if(_.button===1&&_.type==="mousedown"&&(Od(_,`${u}-flow__node`)||Od(_,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||h&&!w||Od(_,o)&&w||Od(_,c)&&(!w||s&&w&&!e)||!t&&_.ctrlKey&&w)return!1;if(!t&&_.type==="touchstart"&&((v=_.touches)==null?void 0:v.length)>1)return _.preventDefault(),!1;if(!p&&!s&&!m&&w||!r&&(_.type==="mousedown"||_.type==="touchstart")||Array.isArray(r)&&!r.includes(_.button)&&_.type==="mousedown")return!1;const k=Array.isArray(r)&&r.includes(_.button)||!_.button||_.button<=1;return(!_.ctrlKey||w)&&k}}function YUn({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),_=Gq().scaleExtent([n,t]).translateExtent(r),p=ra(e).call(_);x({x:s.x,y:s.y,zoom:Oh(s.zoom,n,t)},[[0,0],[h.width,h.height]],r);const m=p.on("wheel.zoom"),w=p.on("dblclick.zoom");_.wheelDelta(yU);async function k(I,B){return p?new Promise(U=>{_==null||_.interpolate((B==null?void 0:B.interpolate)==="linear"?x0:av).transform(j4(p,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>U(!0)),I)}):!1}function v({noWheelClassName:I,noPanClassName:B,onPaneContextMenu:U,userSelectionActive:H,panOnScroll:Q,panOnDrag:V,panOnScrollMode:Z,panOnScrollSpeed:Y,preventScrolling:$,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:q,zoomActivationKeyPressed:K,lib:ne,onTransformChange:ae,connectionInProgress:ue,paneClickDistance:se,selectionOnDrag:G}){H&&!u.isZoomingOrPanning&&b();const oe=Q&&!K&&!H;_.clickDistance(G?1/0:!fo(se)||se<0?0:se);const ce=oe?GUn({zoomPanValues:u,noWheelClassName:I,d3Selection:p,d3Zoom:_,panOnScrollMode:Z,panOnScrollSpeed:Y,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):VUn({noWheelClassName:I,preventScrolling:$,d3ZoomHandler:m});p.on("wheel.zoom",ce,{passive:!1});const he=KUn({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});_.on("start",he);const be=WUn({zoomPanValues:u,panOnDrag:V,onPaneContextMenu:!!U,onPanZoom:i,onTransformChange:ae});_.on("zoom",be);const Re=QUn({zoomPanValues:u,panOnDrag:V,panOnScroll:Q,onPaneContextMenu:U,onPanZoomEnd:o,onDraggingChange:c});_.on("end",Re);const Le=XUn({zoomActivationKeyPressed:K,panOnDrag:V,zoomOnScroll:F,panOnScroll:Q,zoomOnDoubleClick:q,zoomOnPinch:L,userSelectionActive:H,noPanClassName:B,noWheelClassName:I,lib:ne,connectionInProgress:ue});_.filter(Le),q?p.on("dblclick.zoom",w):p.on("dblclick.zoom",null)}function b(){_.on("zoom",null)}async function x(I,B,U){const H=z4(I),Q=_==null?void 0:_.constrain()(H,B,U);return Q&&await k(Q),Q}async function y(I,B){const U=z4(I);return await k(U,B),U}function C(I){if(p){const B=z4(I),U=p.property("__zoom");(U.k!==I.zoom||U.x!==I.x||U.y!==I.y)&&(_==null||_.transform(p,B,null,{sync:!0}))}}function N(){const I=p?Uq(p.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}async function z(I,B){return p?new Promise(U=>{_==null||_.interpolate((B==null?void 0:B.interpolate)==="linear"?x0:av).scaleTo(j4(p,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>U(!0)),I)}):!1}async function A(I,B){return p?new Promise(U=>{_==null||_.interpolate((B==null?void 0:B.interpolate)==="linear"?x0:av).scaleBy(j4(p,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>U(!0)),I)}):!1}function j(I){_==null||_.scaleExtent(I)}function M(I){_==null||_.translateExtent(I)}function D(I){const B=!fo(I)||I<0?0:I;_==null||_.clickDistance(B)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:x,getViewport:N,scaleTo:z,scaleBy:A,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:D}}var Lh;(function(e){e.Line="line",e.Handle="handle"})(Lh||(Lh={}));function ZUn({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,c=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(c[0]=c[0]*-1),o&&i&&(c[1]=c[1]*-1),c}function SM(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function _u(e,n){return Math.max(0,n-e)}function fu(e,n){return Math.max(0,e-n)}function D1(e,n,t){return Math.max(0,n-e,e-t)}function CM(e,n){return e?!n:n}function JUn(e,n,t,r,s,i,a,o){let{affectsX:c,affectsY:u}=n;const{isHorizontal:h,isVertical:_}=n,p=h&&_,{xSnapped:m,ySnapped:w}=t,{minWidth:k,maxWidth:v,minHeight:b,maxHeight:x}=r,{x:y,y:C,width:N,height:z,aspectRatio:A}=e;let j=Math.floor(h?m-e.pointerX:0),M=Math.floor(_?w-e.pointerY:0);const D=N+(c?-j:j),I=z+(u?-M:M),B=-i[0]*N,U=-i[1]*z;let H=D1(D,k,v),Q=D1(I,b,x);if(a){let Y=0,$=0;c&&j<0?Y=_u(y+j+B,a[0][0]):!c&&j>0&&(Y=fu(y+D+B,a[1][0])),u&&M<0?$=_u(C+M+U,a[0][1]):!u&&M>0&&($=fu(C+I+U,a[1][1])),H=Math.max(H,Y),Q=Math.max(Q,$)}if(o){let Y=0,$=0;c&&j>0?Y=fu(y+j,o[0][0]):!c&&j<0&&(Y=_u(y+D,o[1][0])),u&&M>0?$=fu(C+M,o[0][1]):!u&&M<0&&($=_u(C+I,o[1][1])),H=Math.max(H,Y),Q=Math.max(Q,$)}if(s){if(h){const Y=D1(D/A,b,x)*A;if(H=Math.max(H,Y),a){let $=0;!c&&!u||c&&!u&&p?$=fu(C+U+D/A,a[1][1])*A:$=_u(C+U+(c?j:-j)/A,a[0][1])*A,H=Math.max(H,$)}if(o){let $=0;!c&&!u||c&&!u&&p?$=_u(C+D/A,o[1][1])*A:$=fu(C+(c?j:-j)/A,o[0][1])*A,H=Math.max(H,$)}}if(_){const Y=D1(I*A,k,v)/A;if(Q=Math.max(Q,Y),a){let $=0;!c&&!u||u&&!c&&p?$=fu(y+I*A+B,a[1][0])/A:$=_u(y+(u?M:-M)*A+B,a[0][0])/A,Q=Math.max(Q,$)}if(o){let $=0;!c&&!u||u&&!c&&p?$=_u(y+I*A,o[1][0])/A:$=fu(y+(u?M:-M)*A,o[0][0])/A,Q=Math.max(Q,$)}}}M=M+(M<0?Q:-Q),j=j+(j<0?H:-H),s&&(p?D>I*A?M=(CM(c,u)?-j:j)/A:j=(CM(c,u)?-M:M)*A:h?(M=j/A,u=c):(j=M*A,c=u));const V=c?y+j:y,Z=u?C+M:C;return{width:N+(c?-j:j),height:z+(u?-M:M),x:i[0]*j*(c?-1:1)+V,y:i[1]*M*(u?-1:1)+Z}}const xU={width:0,height:0,x:0,y:0},eGn={...xU,pointerX:0,pointerY:0,aspectRatio:1};function tGn(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,c=t[1]*a;return[[r-o,s-c],[r+i-o,s+a-c]]}function nGn({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=ra(e);let a={controlDirection:SM("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:h,keepAspectRatio:_,resizeDirection:p,onResizeStart:m,onResize:w,onResizeEnd:k,shouldResize:v}){let b={...xU},x={...eGn};a={boundaries:h,resizeDirection:p,keepAspectRatio:_,controlDirection:SM(u)};let y,C=null,N=[],z,A,j,M=!1;const D=Aq().on("start",I=>{const{nodeLookup:B,transform:U,snapGrid:H,snapToGrid:Q,nodeOrigin:V,paneDomNode:Z}=t();if(y=B.get(n),!y)return;C=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:Y,ySnapped:$}=w0(I.sourceEvent,{transform:U,snapGrid:H,snapToGrid:Q,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},x={...b,pointerX:Y,pointerY:$,aspectRatio:b.width/b.height},z=void 0,A=xf(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(z=B.get(y.parentId)),z&&y.extent==="parent"&&(A=[[0,0],[z.measured.width,z.measured.height]]),N=[],j=void 0;for(const[L,F]of B)if(F.parentId===n&&(N.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const q=tGn(F,y,F.origin??V);j?j=[[Math.min(q[0][0],j[0][0]),Math.min(q[0][1],j[0][1])],[Math.max(q[1][0],j[1][0]),Math.max(q[1][1],j[1][1])]]:j=q}m==null||m(I,{...b})}).on("drag",I=>{const{transform:B,snapGrid:U,snapToGrid:H,nodeOrigin:Q}=t(),V=w0(I.sourceEvent,{transform:B,snapGrid:U,snapToGrid:H,containerBounds:C}),Z=[];if(!y)return;const{x:Y,y:$,width:L,height:F}=b,q={},K=y.origin??Q,{width:ne,height:ae,x:ue,y:se}=JUn(x,a.controlDirection,V,a.boundaries,a.keepAspectRatio,K,A,j),G=ne!==L,oe=ae!==F,ce=ue!==Y&&G,he=se!==$&&oe;if(!ce&&!he&&!G&&!oe)return;if((ce||he||K[0]===1||K[1]===1)&&(q.x=ce?ue:b.x,q.y=he?se:b.y,b.x=q.x,b.y=q.y,N.length>0)){const Ke=ue-Y,Ne=se-$;for(const xe of N)xe.position={x:xe.position.x-Ke+K[0]*(ne-L),y:xe.position.y-Ne+K[1]*(ae-F)},Z.push(xe)}if((G||oe)&&(q.width=G&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ne:b.width,q.height=oe&&(!a.resizeDirection||a.resizeDirection==="vertical")?ae:b.height,b.width=q.width,b.height=q.height),z&&y.expandParent){const Ke=K[0]*(q.width??0);q.x&&q.x{M&&(k==null||k(I,{...b}),s==null||s({...b}),M=!1)});i.call(D)}function c(){i.on(".drag",null)}return{update:o,destroy:c}}const rGn={},EM=e=>{let n;const t=new Set,r=(h,_)=>{const p=typeof h=="function"?h(n):h;if(!Object.is(p,n)){const m=n;n=_??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(w=>w(n,m))}},s=()=>n,c={setState:r,getState:s,getInitialState:()=>u,subscribe:h=>(t.add(h),()=>t.delete(h)),destroy:()=>{(rGn?"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."),t.clear()}},u=n=e(r,s,c);return c},sGn=e=>e?EM(e):EM,{useDebugValue:iGn}=tt,{useSyncExternalStoreWithSelector:aGn}=DW,oGn=e=>e;function wU(e,n=oGn,t){const r=aGn(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return iGn(r),r}const NM=(e,n)=>{const t=sGn(e),r=(s,i=n)=>wU(t,s,i);return Object.assign(r,t),r},cGn=(e,n)=>e?NM(e,n):NM;function zr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const Gy=T.createContext(null),lGn=Gy.Provider,kU=bo.error001("react");function Ln(e,n){const t=T.useContext(Gy);if(t===null)throw new Error(kU);return wU(t,e,n)}function Ar(){const e=T.useContext(Gy);if(e===null)throw new Error(kU);return T.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const zM={display:"none"},uGn={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},SU="react-flow__node-desc",CU="react-flow__edge-desc",_Gn="react-flow__aria-live",fGn=e=>e.ariaLiveMessage,dGn=e=>e.ariaLabelConfig;function hGn({rfId:e}){const n=Ln(fGn);return f.jsx("div",{id:`${_Gn}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:uGn,children:n})}function pGn({rfId:e,disableKeyboardA11y:n}){const t=Ln(dGn);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${SU}-${e}`,style:zM,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${CU}-${e}`,style:zM,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(hGn,{rfId:e})]})}const Vy=T.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:ms(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});Vy.displayName="Panel";const jM="https://reactflow.dev?utm_source=attribution";function mGn({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(Vy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${jM}`,children:f.jsx("a",{href:jM,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const gGn=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},L1=e=>e.id;function vGn(e,n){return zr(e.selectedNodes.map(L1),n.selectedNodes.map(L1))&&zr(e.selectedEdges.map(L1),n.selectedEdges.map(L1))}function bGn({onSelectionChange:e}){const n=Ar(),{selectedNodes:t,selectedEdges:r}=Ln(gGn,vGn);return T.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const yGn=e=>!!e.onSelectionChangeHandlers;function xGn({onSelectionChange:e}){const n=Ln(yGn);return e||n?f.jsx(bGn,{onSelectionChange:e}):null}const EU=[0,0],wGn={x:0,y:0,zoom:1},kGn=["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"],AM=[...kGn,"rfId"],SGn=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}),TM={translateExtent:J0,nodeOrigin:EU,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function CGn(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:c}=Ln(SGn,zr),u=Ar();T.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=TM,o()}),[]);const h=T.useRef(TM);return T.useEffect(()=>{for(const _ of AM){const p=e[_],m=h.current[_];p!==m&&(typeof e[_]>"u"||(_==="nodes"?n(p):_==="edges"?t(p):_==="minZoom"?r(p):_==="maxZoom"?s(p):_==="translateExtent"?i(p):_==="nodeExtent"?a(p):_==="ariaLabelConfig"?u.setState({ariaLabelConfig:pUn(p)}):_==="fitView"?u.setState({fitViewQueued:p}):_==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[_]:p})))}h.current=e},AM.map(_=>e[_])),null}function RM(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function EGn(e){var r;const[n,t]=T.useState(e==="system"?null:e);return T.useEffect(()=>{if(e!=="system"){t(e);return}const s=RM(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=RM())!=null&&r.matches?"dark":"light"}const MM=typeof document<"u"?document:null;function rm(e=null,n={target:MM,actInsideInputWithModifier:!0}){const[t,r]=T.useState(!1),s=T.useRef(!1),i=T.useRef(new Set([])),[a,o]=T.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(_=>typeof _=="string").map(_=>_.replace("+",` `).replace(` `,` +`).split(` -`)),h=u.reduce((_,p)=>_.concat(...p),[]);return[u,h]}return[[],[]]},[e]);return T.useEffect(()=>{const c=(n==null?void 0:n.target)??MM,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const h=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&iU(m))return!1;const k=DM(m.code,o);if(i.current.add(m[k]),OM(a,i.current,!1)){const x=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},_=m=>{const w=DM(m.code,o);OM(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[w]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",_),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",_),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function OM(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function DM(e,n){return n.includes(e)?"code":"key"}const NGn=()=>{const e=Ar();return T.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),c=zC(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(c,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:c}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-c},h=t.snapGrid??s,_=t.snapToGrid??i;return qm(u,r,_,h)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=Dh(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function NU(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const c of a)zGn(c,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function zGn(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function jGn(e,n){return NU(e,n)}function AGn(e,n){return NU(e,n)}function T_(e,n){return{id:e,type:"select",selected:n}}function Dd(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(T_(i.id,a)))}return r}function LM({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),c=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;c!==void 0&&c!==a&&t.push({id:a.id,item:a,type:"replace"}),c===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function IM(e){return{id:e.id,type:"remove"}}const TGn=tU();function RGn(e,n,t={}){return xUn(e,n,{...t,onError:t.onError??TGn})}const $M=e=>aUn(e),MGn=e=>Xq(e);function zU(e){return T.forwardRef(e)}const OGn=typeof window<"u"?T.useLayoutEffect:T.useEffect;function BM(e){const[n,t]=T.useState(BigInt(0)),[r]=T.useState(()=>DGn(()=>t(s=>s+BigInt(1))));return OGn(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function DGn(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const jU=T.createContext(null);function LGn({children:e}){const n=Ar(),t=T.useCallback(o=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:h,onNodesChange:_,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:w}=n.getState();let k=c;for(const b of o)k=typeof b=="function"?b(k):b;let v=LM({items:k,lookup:p});for(const b of w.values())v=b(v);h&&u(k),v.length>0?_==null||_(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:x,setNodes:y}=n.getState();b&&y(x)})},[]),r=BM(t),s=T.useCallback(o=>{const{edges:c=[],setEdges:u,hasDefaultEdges:h,onEdgesChange:_,edgeLookup:p}=n.getState();let m=c;for(const w of o)m=typeof w=="function"?w(m):w;h?u(m):_&&_(LM({items:m,lookup:p}))},[]),i=BM(s),a=T.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(jU.Provider,{value:a,children:e})}function IGn(){const e=T.useContext(jU);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const $Gn=e=>!!e.panZoom;function DC(){const e=NGn(),n=Ar(),t=IGn(),r=Ln($Gn),s=T.useMemo(()=>{const i=_=>n.getState().nodeLookup.get(_),a=_=>{t.nodeQueue.push(_)},o=_=>{t.edgeQueue.push(_)},c=_=>{var b,x;const{nodeLookup:p,nodeOrigin:m}=n.getState(),w=$M(_)?_:p.get(_.id),k=w.parentId?rU(w.position,w.measured,w.parentId,p,m):w.position,v={...w,position:k,width:((b=w.measured)==null?void 0:b.width)??w.width,height:((x=w.measured)==null?void 0:x.height)??w.height};return tm(v)},u=(_,p,m={replace:!1})=>{a(w=>w.map(k=>{if(k.id===_){const v=typeof p=="function"?p(k):p;return m.replace&&$M(v)?v:{...k,...v}}return k}))},h=(_,p,m={replace:!1})=>{o(w=>w.map(k=>{if(k.id===_){const v=typeof p=="function"?p(k):p;return m.replace&&MGn(v)?v:{...k,...v}}return k}))};return{getNodes:()=>n.getState().nodes.map(_=>({..._})),getNode:_=>{var p;return(p=i(_))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:_=[]}=n.getState();return _.map(p=>({...p}))},getEdge:_=>n.getState().edgeLookup.get(_),setNodes:a,setEdges:o,addNodes:_=>{const p=Array.isArray(_)?_:[_];t.nodeQueue.push(m=>[...m,...p])},addEdges:_=>{const p=Array.isArray(_)?_:[_];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:_=[],edges:p=[],transform:m}=n.getState(),[w,k,v]=m;return{nodes:_.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x:w,y:k,zoom:v}}},deleteElements:async({nodes:_=[],edges:p=[]})=>{const{nodes:m,edges:w,onNodesDelete:k,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:x,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:N,edges:z}=await _Un({nodesToRemove:_,edgesToRemove:p,nodes:m,edges:w,onBeforeDelete:C}),A=z.length>0,j=N.length>0;if(A){const M=z.map(IM);v==null||v(z),x(M)}if(j){const M=N.map(IM);k==null||k(N),b(M)}return(j||A)&&(y==null||y({nodes:N,edges:z})),{deletedNodes:N,deletedEdges:z}},getIntersectingNodes:(_,p=!0,m)=>{const w=dM(_),k=w?_:c(_),v=m!==void 0;return k?(m||n.getState().nodes).filter(b=>{const x=n.getState().nodeLookup.get(b.id);if(x&&!w&&(b.id===_.id||!x.internals.positionAbsolute))return!1;const y=tm(v?b:x),C=bb(y,k);return p&&C>0||C>=y.width*y.height||C>=k.width*k.height}):[]},isNodeIntersecting:(_,p,m=!0)=>{const k=dM(_)?_:c(_);if(!k)return!1;const v=bb(k,p);return m&&v>0||v>=p.width*p.height||v>=k.width*k.height},updateNode:u,updateNodeData:(_,p,m={replace:!1})=>{u(_,w=>{const k=typeof p=="function"?p(w):p;return m.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},m)},updateEdge:h,updateEdgeData:(_,p,m={replace:!1})=>{h(_,w=>{const k=typeof p=="function"?p(w):p;return m.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},m)},getNodesBounds:_=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return oUn(_,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:_,id:p,nodeId:m})=>{var w;return Array.from(((w=n.getState().connectionLookup.get(`${m}-${_}${p?`-${p}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:_,handleId:p,nodeId:m})=>{var w;return Array.from(((w=n.getState().connectionLookup.get(`${m}${_?p?`-${_}-${p}`:`-${_}`:""}`))==null?void 0:w.values())??[])},fitView:async _=>{const p=n.getState().fitViewResolver??hUn();return n.setState({fitViewQueued:!0,fitViewOptions:_,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return T.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const PM=e=>e.selected,BGn=typeof window<"u"?window:void 0;function PGn({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Ar(),{deleteElements:r}=DC(),s=rm(e,{actInsideInputWithModifier:!1}),i=rm(n,{target:BGn});T.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(PM),edges:a.filter(PM)}),t.setState({nodesSelectionActive:!1})}},[s]),T.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function FGn(e){const n=Ar();T.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=jC(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",bo.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const Ky={position:"absolute",width:"100%",height:"100%",top:0,left:0},HGn=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function qGn({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=rf.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:u,minZoom:h,maxZoom:_,zoomActivationKeyCode:p,preventScrolling:m=!0,children:w,noWheelClassName:k,noPanClassName:v,onViewportChange:b,isControlledViewport:x,paneClickDistance:y,selectionOnDrag:C}){const N=Ar(),z=T.useRef(null),{userSelectionActive:A,lib:j,connectionInProgress:M}=Ln(HGn,zr),D=rm(p),I=T.useRef();FGn(z);const B=T.useCallback(U=>{b==null||b({x:U[0],y:U[1],zoom:U[2]}),x||N.setState({transform:U})},[b,x]);return T.useEffect(()=>{if(z.current){I.current=YUn({domNode:z.current,minZoom:h,maxZoom:_,translateExtent:u,viewport:c,onDraggingChange:V=>N.setState(Z=>Z.paneDragging===V?Z:{paneDragging:V}),onPanZoomStart:(V,Z)=>{const{onViewportChangeStart:Y,onMoveStart:$}=N.getState();$==null||$(V,Z),Y==null||Y(Z)},onPanZoom:(V,Z)=>{const{onViewportChange:Y,onMove:$}=N.getState();$==null||$(V,Z),Y==null||Y(Z)},onPanZoomEnd:(V,Z)=>{const{onViewportChangeEnd:Y,onMoveEnd:$}=N.getState();$==null||$(V,Z),Y==null||Y(Z)}});const{x:U,y:H,zoom:Q}=I.current.getViewport();return N.setState({panZoom:I.current,transform:[U,H,Q],domNode:z.current.closest(".react-flow")}),()=>{var V;(V=I.current)==null||V.destroy()}}},[]),T.useEffect(()=>{var U;(U=I.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:D,preventScrolling:m,noPanClassName:v,userSelectionActive:A,noWheelClassName:k,lib:j,onTransformChange:B,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,D,m,v,A,k,j,B,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:z,style:Ky,children:w})}const UGn=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function GGn(){const{userSelectionActive:e,userSelectionRect:n}=Ln(UGn,zr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const A4=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},VGn=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function KGn({isSelecting:e,selectionKeyPressed:n,selectionMode:t=em.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:h,onPaneScroll:_,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:w,children:k}){const v=T.useRef(0),b=Ar(),{userSelectionActive:x,elementsSelectable:y,dragging:C,panBy:N,autoPanSpeed:z}=Ln(VGn,zr),A=y&&(e||x),j=T.useRef(null),M=T.useRef(),D=T.useRef(new Set),I=T.useRef(new Set),B=T.useRef(!1),U=T.useRef(!1),H=T.useRef({x:0,y:0}),Q=T.useRef(!1),V=G=>{if(U.current||B.current||b.getState().connection.inProgress){U.current=!1,B.current=!1;return}u==null||u(G),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},Z=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}h==null||h(G)},Y=_?G=>_(G):void 0,$=G=>{U.current&&(G.stopPropagation(),U.current=!1)},L=G=>{var xe,rt;const{domNode:oe,transform:ce}=b.getState();if(M.current=oe==null?void 0:oe.getBoundingClientRect(),!M.current)return;const he=G.target===j.current;if(!he&&!!G.target.closest(".nokey")||!e||!(a&&he||n)||G.button!==0||!G.isPrimary)return;(rt=(xe=G.target)==null?void 0:xe.setPointerCapture)==null||rt.call(xe,G.pointerId),U.current=!1;const{x:Le,y:Ke}=ho(G.nativeEvent,M.current),Ne=qm({x:Le,y:Ke},ce);b.setState({userSelectionRect:{width:0,height:0,startX:Ne.x,startY:Ne.y,x:Le,y:Ke}}),he||(G.stopPropagation(),G.preventDefault())};function F(G,oe){const{userSelectionRect:ce}=b.getState();if(!ce)return;const{transform:he,nodeLookup:be,edgeLookup:Re,connectionLookup:Le,triggerNodeChanges:Ke,triggerEdgeChanges:Ne,defaultEdgeOptions:xe}=b.getState(),rt={x:ce.startX,y:ce.startY},{x:Ze,y:ot}=Dh(rt,he),kt={startX:rt.x,startY:rt.y,x:GIe.id)),I.current=new Set;const pt=(xe==null?void 0:xe.selectable)??!0;for(const Ie of D.current){const pe=Le.get(Ie);if(pe)for(const{edgeId:je}of pe.values()){const He=Re.get(je);He&&(He.selectable??pt)&&I.current.add(je)}}if(!hM(qt,D.current)){const Ie=Dd(be,D.current,!0);Ke(Ie)}if(!hM(dt,I.current)){const Ie=Dd(Re,I.current);Ne(Ie)}b.setState({userSelectionRect:kt,userSelectionActive:!0,nodesSelectionActive:!1})}function q(){if(!s||!M.current)return;const[G,oe]=NC(H.current,M.current,z);N({x:G,y:oe}).then(ce=>{if(!U.current||!ce){v.current=requestAnimationFrame(q);return}const{x:he,y:be}=H.current;F(he,be),v.current=requestAnimationFrame(q)})}const K=()=>{cancelAnimationFrame(v.current),v.current=0,Q.current=!1};T.useEffect(()=>()=>K(),[]);const ne=G=>{const{userSelectionRect:oe,transform:ce,resetSelectedElements:he}=b.getState();if(!M.current||!oe)return;const{x:be,y:Re}=ho(G.nativeEvent,M.current);H.current={x:be,y:Re};const Le=Dh({x:oe.startX,y:oe.startY},ce);if(!U.current){const Ke=n?0:i;if(Math.hypot(be-Le.x,Re-Le.y)<=Ke)return;he(),o==null||o(G)}U.current=!0,Q.current||(q(),Q.current=!0),F(be,Re)},ae=G=>{var oe,ce;if(!A){G.target===j.current&&b.getState().connection.inProgress&&(B.current=!0);return}G.button===0&&((ce=(oe=G.target)==null?void 0:oe.releasePointerCapture)==null||ce.call(oe,G.pointerId),!x&&G.target===j.current&&b.getState().userSelectionRect&&(V==null||V(G)),b.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(c==null||c(G),b.setState({nodesSelectionActive:D.current.size>0})),K())},ue=G=>{var oe,ce;(ce=(oe=G.target)==null?void 0:oe.releasePointerCapture)==null||ce.call(oe,G.pointerId),K()},se=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:ms(["react-flow__pane",{draggable:se,dragging:C,selection:e}]),onClick:A?void 0:A4(V,j),onContextMenu:A4(Z,j),onWheel:A4(Y,j),onPointerEnter:A?void 0:p,onPointerMove:A?ne:m,onPointerUp:ae,onPointerCancel:A?ue:void 0,onPointerDownCapture:A?L:void 0,onClickCapture:A?$:void 0,onPointerLeave:w,ref:j,style:Ky,children:[k,f.jsx(GGn,{})]})}function gk({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:c}=n.getState(),u=o.get(e);if(!u){c==null||c("012",bo.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function AU({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Ar(),[c,u]=T.useState(!1),h=T.useRef();return T.useEffect(()=>{h.current=IUn({getStoreItems:()=>o.getState(),onNodeMouseDown:_=>{gk({id:_,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),T.useEffect(()=>{if(!(n||!e.current||!h.current))return h.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var _;(_=h.current)==null||_.destroy()}},[t,r,n,i,e,s,a]),c}const WGn=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function TU(){const e=Ar();return T.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:c,nodeLookup:u,nodeOrigin:h}=e.getState(),_=new Map,p=WGn(a),m=s?i[0]:5,w=s?i[1]:5,k=t.direction.x*m*t.factor,v=t.direction.y*w*t.factor;for(const[,b]of u){if(!p(b))continue;let x={x:b.internals.positionAbsolute.x+k,y:b.internals.positionAbsolute.y+v};s&&(x=Hm(x,i));const{position:y,positionAbsolute:C}=Yq({nodeId:b.id,nextPosition:x,nodeLookup:u,nodeExtent:r,nodeOrigin:h,onError:o});b.position=y,b.internals.positionAbsolute=C,_.set(b.id,b)}c(_)},[])}const LC=T.createContext(null),QGn=LC.Provider;LC.Consumer;const RU=()=>T.useContext(LC),XGn=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),MU=T.createContext(null);function YGn({children:e}){const n=Ln(XGn,zr);return f.jsx(MU.Provider,{value:n,children:e})}function ZGn(){const e=T.useContext(MU);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const JGn={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},eVn=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:c,isValid:u}=a;if(!o&&!s)return JGn;const h=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===n&&(c==null?void 0:c.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:h,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===Mh.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:h&&u}};function tVn({type:e="source",position:n=Rt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:c,className:u,onMouseDown:h,onTouchStart:_,...p},m){var Q,V;const w=a||null,k=e==="target",v=Ar(),b=RU(),{connectOnClick:x,noPanClassName:y,rfId:C}=ZGn(),{connectingFrom:N,connectingTo:z,clickConnecting:A,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:D,valid:I}=Ln(eVn(b,w,e),zr);b||(V=(Q=v.getState()).onError)==null||V.call(Q,"010",bo.error010());const B=Z=>{const{defaultEdgeOptions:Y,onConnect:$,hasDefaultEdges:L}=v.getState(),F={...Y,...Z};if(L){const{edges:q,setEdges:K,onError:ne}=v.getState();K(RGn(F,q,{onError:ne}))}$==null||$(F),o==null||o(F)},U=Z=>{if(!b)return;const Y=aU(Z.nativeEvent);if(s&&(Y&&Z.button===0||!Y)){const $=v.getState();mk.onPointerDown(Z.nativeEvent,{handleDomNode:Z.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:k,handleId:w,nodeId:b,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:(...L)=>{var F,q;return(q=(F=v.getState()).onConnectEnd)==null?void 0:q.call(F,...L)},updateConnection:$.updateConnection,onConnect:B,isValidConnection:t||((...L)=>{var F,q;return((q=(F=v.getState()).isValidConnection)==null?void 0:q.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}Y?h==null||h(Z):_==null||_(Z)},H=Z=>{const{onClickConnectStart:Y,onClickConnectEnd:$,connectionClickStartHandle:L,connectionMode:F,isValidConnection:q,lib:K,rfId:ne,nodeLookup:ae,connection:ue}=v.getState();if(!b||!L&&!s)return;if(!L){Y==null||Y(Z.nativeEvent,{nodeId:b,handleId:w,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:w}});return}const se=sU(Z.target),G=t||q,{connection:oe,isValid:ce}=mk.isValid(Z.nativeEvent,{handle:{nodeId:b,id:w,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:G,flowId:ne,doc:se,lib:K,nodeLookup:ae});ce&&oe&&B(oe);const he=structuredClone(ue);delete he.inProgress,he.toPosition=he.toHandle?he.toHandle.position:null,$==null||$(Z,he),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":w,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${w}-${e}`,className:ms(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!k,target:k,connectable:r,connectablestart:s,connectableend:i,clickconnecting:A,connectingfrom:N,connectingto:z,valid:I,connectionindicator:r&&(!M||j)&&(M||D?i:s)}]),onMouseDown:U,onTouchStart:U,onClick:x?H:void 0,ref:m,...p,children:c})}const tc=T.memo(zU(tVn));function nVn({data:e,isConnectable:n,sourcePosition:t=Rt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(tc,{type:"source",position:t,isConnectable:n})]})}function rVn({data:e,isConnectable:n,targetPosition:t=Rt.Top,sourcePosition:r=Rt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(tc,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(tc,{type:"source",position:r,isConnectable:n})]})}function sVn(){return null}function iVn({data:e,isConnectable:n,targetPosition:t=Rt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(tc,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const yb={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},FM={input:nVn,default:rVn,output:iVn,group:sVn};function aVn(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const oVn=e=>{const{width:n,height:t,x:r,y:s}=Fm(e.nodeLookup,{filter:i=>!!i.selected});return{width:fo(n)?n:null,height:fo(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function cVn({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Ar(),{width:s,height:i,transformString:a,userSelectionActive:o}=Ln(oVn,zr),c=TU(),u=T.useRef(null);T.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const h=!o&&s!==null&&i!==null;if(AU({nodeRef:u,disabled:!h}),!h)return null;const _=e?m=>{const w=r.getState().nodes.filter(k=>k.selected);e(m,w)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(yb,m.key)&&(m.preventDefault(),c({direction:yb[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:ms(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:_,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const HM=typeof window<"u"?window:void 0,lVn=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function OU({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:h,selectionMode:_,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:w,panActivationKeyCode:k,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:N,panOnScrollMode:z,zoomOnDoubleClick:A,panOnDrag:j,autoPanOnSelection:M,defaultViewport:D,translateExtent:I,minZoom:B,maxZoom:U,preventScrolling:H,onSelectionContextMenu:Q,noWheelClassName:V,noPanClassName:Z,disableKeyboardA11y:Y,onViewportChange:$,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:q}=Ln(lVn,zr),K=rm(u,{target:HM}),ne=rm(k,{target:HM}),ae=ne||j,ue=ne||C,se=h&&ae!==!0,G=K||q||se;return PGn({deleteKeyCode:c,multiSelectionKeyCode:w}),f.jsx(qGn,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:ue,panOnScrollSpeed:N,panOnScrollMode:z,zoomOnDoubleClick:A,panOnDrag:!K&&ae,defaultViewport:D,translateExtent:I,minZoom:B,maxZoom:U,zoomActivationKeyCode:v,preventScrolling:H,noWheelClassName:V,noPanClassName:Z,onViewportChange:$,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:se,children:f.jsxs(KGn,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ae,autoPanOnSelection:M,isSelecting:!!G,selectionMode:_,selectionKeyPressed:K,paneClickDistance:o,selectionOnDrag:se,children:[e,F&&f.jsx(cVn,{onSelectionContextMenu:Q,noPanClassName:Z,disableKeyboardA11y:Y})]})})}OU.displayName="FlowRenderer";const uVn=T.memo(OU),_Vn=e=>n=>e?EC(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function fVn(e){return Ln(T.useCallback(_Vn(e),[e]),zr)}const dVn=e=>e.updateNodeInternals;function hVn(){const e=Ln(dVn),[n]=T.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return T.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function pVn({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Ar(),i=T.useRef(null),a=T.useRef(null),o=T.useRef(e.sourcePosition),c=T.useRef(e.targetPosition),u=T.useRef(n),h=t&&!!e.internals.handleBounds;return T.useEffect(()=>{i.current&&!e.hidden&&(!h||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[h,e.hidden]),T.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),T.useEffect(()=>{if(i.current){const _=u.current!==n,p=o.current!==e.sourcePosition,m=c.current!==e.targetPosition;(_||p||m)&&(u.current=n,o.current=e.sourcePosition,c.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function mVn({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:c,nodesConnectable:u,nodesFocusable:h,resizeObserver:_,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:w,rfId:k,nodeTypes:v,nodeClickDistance:b,onError:x}){const{node:y,internals:C,isParent:N}=Ln(G=>{const oe=G.nodeLookup.get(e),ce=G.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:ce}},zr);let z=y.type||"default",A=(v==null?void 0:v[z])||FM[z];A===void 0&&(x==null||x("003",bo.error003(z)),z="default",A=(v==null?void 0:v.default)||FM.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||c&&typeof y.selectable>"u"),D=!!(y.connectable||u&&typeof y.connectable>"u"),I=!!(y.focusable||h&&typeof y.focusable>"u"),B=Ar(),U=nU(y),H=pVn({node:y,nodeType:z,hasDimensions:U,resizeObserver:_}),Q=AU({nodeRef:H,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),V=TU();if(y.hidden)return null;const Z=yl(y),Y=aVn(y),$=M||j||n||t||r||s,L=t?G=>t(G,{...C.userNode}):void 0,F=r?G=>r(G,{...C.userNode}):void 0,q=s?G=>s(G,{...C.userNode}):void 0,K=i?G=>i(G,{...C.userNode}):void 0,ne=a?G=>a(G,{...C.userNode}):void 0,ae=G=>{const{selectNodesOnDrag:oe,nodeDragThreshold:ce}=B.getState();M&&(!oe||!j||ce>0)&&gk({id:e,store:B,nodeRef:H}),n&&n(G,{...C.userNode})},ue=G=>{if(!(iU(G.nativeEvent)||w)){if(Vq.includes(G.key)&&M){const oe=G.key==="Escape";gk({id:e,store:B,unselect:oe,nodeRef:H})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(yb,G.key)){G.preventDefault();const{ariaLabelConfig:oe}=B.getState();B.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:yb[G.key],factor:G.shiftKey?4:1})}}},se=()=>{var Le;if(w||!((Le=H.current)!=null&&Le.matches(":focus-visible")))return;const{transform:G,width:oe,height:ce,autoPanOnNodeFocus:he,setCenter:be}=B.getState();if(!he)return;EC(new Map([[e,y]]),{x:0,y:0,width:oe,height:ce},G,!0).length>0||be(y.position.x+Z.width/2,y.position.y+Z.height/2,{zoom:G[2]})};return f.jsx("div",{className:ms(["react-flow__node",`react-flow__node-${z}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:N,draggable:j,dragging:Q}]),ref:H,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:U?"visible":"hidden",...y.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:q,onContextMenu:K,onClick:ae,onDoubleClick:ne,onKeyDown:I?ue:void 0,tabIndex:I?0:void 0,onFocus:I?se:void 0,role:y.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${SU}-${k}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(QGn,{value:e,children:f.jsx(A,{id:e,data:y.data,type:z,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:D,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Q,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...Z})})})}var gVn=T.memo(mVn);const vVn=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function DU(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=Ln(vVn,zr),a=fVn(e.onlyRenderVisibleElements),o=hVn();return f.jsx("div",{className:"react-flow__nodes",style:Ky,children:a.map(c=>f.jsx(gVn,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}DU.displayName="NodeRenderer";const bVn=T.memo(DU);function yVn(e){return Ln(T.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&vUn({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),zr)}const xVn=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},wVn=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},qM={[gb.Arrow]:xVn,[gb.ArrowClosed]:wVn};function kVn(e){const n=Ar();return T.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(qM,e)?qM[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",bo.error009(e)),null)},[e])}const SVn=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const c=kVn(n);return c?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(c,{color:t,strokeWidth:a})}):null},LU=({defaultColor:e,rfId:n})=>{const t=Ln(i=>i.edges),r=Ln(i=>i.defaultEdgeOptions),s=T.useMemo(()=>EUn(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(SVn,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};LU.displayName="MarkerDefinitions";var CVn=T.memo(LU);function IU({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:c,className:u,...h}){const[_,p]=T.useState({x:1,y:0,width:0,height:0}),m=ms(["react-flow__edge-textwrapper",u]),w=T.useRef(null);return T.useEffect(()=>{if(w.current){const k=w.current.getBBox();p({x:k.x,y:k.y,width:k.width,height:k.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-_.width/2} ${n-_.height/2})`,className:m,visibility:_.width?"visible":"hidden",...h,children:[s&&f.jsx("rect",{width:_.width+2*a[0],x:-a[0],y:-a[1],height:_.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:_.height/2,dy:"0.3em",ref:w,style:r,children:t}),c]}):null}IU.displayName="EdgeText";const EVn=T.memo(IU);function Wy({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:u=20,...h}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...h,d:e,fill:"none",className:ms(["react-flow__edge-path",h.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&fo(n)&&fo(t)?f.jsx(EVn,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function UM({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Rt.Left||e===Rt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function $U({sourceX:e,sourceY:n,sourcePosition:t=Rt.Bottom,targetX:r,targetY:s,targetPosition:i=Rt.Top}){const[a,o]=UM({pos:t,x1:e,y1:n,x2:r,y2:s}),[c,u]=UM({pos:i,x1:r,y1:s,x2:e,y2:n}),[h,_,p,m]=oU({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:c,targetControlY:u});return[`M${e},${n} C${a},${o} ${c},${u} ${r},${s}`,h,_,p,m]}function BU(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:b})=>{const[x,y,C]=$U({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),N=e.isInternal?void 0:n;return f.jsx(Wy,{id:N,path:x,labelX:y,labelY:C,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:b})})}const NVn=BU({isInternal:!1}),PU=BU({isInternal:!0});NVn.displayName="SimpleBezierEdge";PU.displayName="SimpleBezierEdgeInternal";function FU(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,sourcePosition:m=Rt.Bottom,targetPosition:w=Rt.Top,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:x})=>{const[y,C,N]=dk({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:w,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),z=e.isInternal?void 0:n;return f.jsx(Wy,{id:z,path:y,labelX:C,labelY:N,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:k,markerStart:v,interactionWidth:x})})}const HU=FU({isInternal:!1}),qU=FU({isInternal:!0});HU.displayName="SmoothStepEdge";qU.displayName="SmoothStepEdgeInternal";function UU(e){return T.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(HU,{...t,id:r,pathOptions:T.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const zVn=UU({isInternal:!1}),GU=UU({isInternal:!0});zVn.displayName="StepEdge";GU.displayName="StepEdgeInternal";function VU(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:m,markerStart:w,interactionWidth:k})=>{const[v,b,x]=uU({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(Wy,{id:y,path:v,labelX:b,labelY:x,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:m,markerStart:w,interactionWidth:k})})}const jVn=VU({isInternal:!1}),KU=VU({isInternal:!0});jVn.displayName="StraightEdge";KU.displayName="StraightEdgeInternal";function WU(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Rt.Bottom,targetPosition:o=Rt.Top,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:x})=>{const[y,C,N]=cU({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),z=e.isInternal?void 0:n;return f.jsx(Wy,{id:z,path:y,labelX:C,labelY:N,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:x})})}const AVn=WU({isInternal:!1}),QU=WU({isInternal:!0});AVn.displayName="BezierEdge";QU.displayName="BezierEdgeInternal";const GM={default:QU,straight:KU,step:GU,smoothstep:qU,simplebezier:PU},VM={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},TVn=(e,n,t)=>t===Rt.Left?e-n:t===Rt.Right?e+n:e,RVn=(e,n,t)=>t===Rt.Top?e-n:t===Rt.Bottom?e+n:e,KM="react-flow__edgeupdater";function WM({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:ms([KM,`${KM}-${o}`]),cx:TVn(n,r,e),cy:RVn(t,r,e),r,stroke:"transparent",fill:"transparent"})}function MVn({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:c,onReconnect:u,onReconnectStart:h,onReconnectEnd:_,setReconnecting:p,setUpdateHover:m}){const w=Ar(),k=(C,N)=>{if(C.button!==0)return;const{autoPanOnConnect:z,domNode:A,connectionMode:j,connectionRadius:M,lib:D,onConnectStart:I,cancelConnection:B,nodeLookup:U,rfId:H,panBy:Q,updateConnection:V}=w.getState(),Z=N.type==="target",Y=(F,q)=>{p(!1),_==null||_(F,t,N.type,q)},$=F=>u==null?void 0:u(t,F),L=(F,q)=>{p(!0),h==null||h(C,t,N.type),I==null||I(F,q)};mk.onPointerDown(C.nativeEvent,{autoPanOnConnect:z,connectionMode:j,connectionRadius:M,domNode:A,handleId:N.id,nodeId:N.nodeId,nodeLookup:U,isTarget:Z,edgeUpdaterType:N.type,lib:D,flowId:H,cancelConnection:B,panBy:Q,isValidConnection:(...F)=>{var q,K;return((K=(q=w.getState()).isValidConnection)==null?void 0:K.call(q,...F))??!0},onConnect:$,onConnectStart:L,onConnectEnd:(...F)=>{var q,K;return(K=(q=w.getState()).onConnectEnd)==null?void 0:K.call(q,...F)},onReconnectEnd:Y,updateConnection:V,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>k(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>k(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),x=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(WM,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:x,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(WM,{position:c,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:x,onMouseOut:y,type:"target"})]})}function OVn({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,reconnectRadius:h,onReconnect:_,onReconnectStart:p,onReconnectEnd:m,rfId:w,edgeTypes:k,noPanClassName:v,onError:b,disableKeyboardA11y:x}){let y=Ln(be=>be.edgeLookup.get(e));const C=Ln(be=>be.defaultEdgeOptions);y=C?{...C,...y}:y;let N=y.type||"default",z=(k==null?void 0:k[N])||GM[N];z===void 0&&(b==null||b("011",bo.error011(N)),N="default",z=(k==null?void 0:k.default)||GM.default);const A=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof _<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),D=T.useRef(null),[I,B]=T.useState(!1),[U,H]=T.useState(!1),Q=Ar(),{zIndex:V=y.zIndex,sourceX:Z,sourceY:Y,targetX:$,targetY:L,sourcePosition:F,targetPosition:q}=Ln(T.useCallback(be=>{const Re=be.nodeLookup.get(y.source),Le=be.nodeLookup.get(y.target);if(!Re||!Le)return VM;const Ke=CUn({id:e,sourceNode:Re,targetNode:Le,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:be.connectionMode,onError:b}),Ne=gUn({selected:y.selected,zIndex:y.zIndex,sourceNode:Re,targetNode:Le,elevateOnSelect:be.elevateEdgesOnSelect,zIndexMode:be.zIndexMode});return{...Ke||VM,zIndex:Ne}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),zr),K=T.useMemo(()=>y.markerStart?`url('#${hk(y.markerStart,w)}')`:void 0,[y.markerStart,w]),ne=T.useMemo(()=>y.markerEnd?`url('#${hk(y.markerEnd,w)}')`:void 0,[y.markerEnd,w]);if(y.hidden||Z===null||Y===null||$===null||L===null)return null;const ae=be=>{var Ne;const{addSelectedEdges:Re,unselectNodesAndEdges:Le,multiSelectionActive:Ke}=Q.getState();M&&(Q.setState({nodesSelectionActive:!1}),y.selected&&Ke?(Le({nodes:[],edges:[y]}),(Ne=D.current)==null||Ne.blur()):Re([e])),s&&s(be,y)},ue=i?be=>{i(be,{...y})}:void 0,se=a?be=>{a(be,{...y})}:void 0,G=o?be=>{o(be,{...y})}:void 0,oe=c?be=>{c(be,{...y})}:void 0,ce=u?be=>{u(be,{...y})}:void 0,he=be=>{var Re;if(!x&&Vq.includes(be.key)&&M){const{unselectNodesAndEdges:Le,addSelectedEdges:Ke}=Q.getState();be.key==="Escape"?((Re=D.current)==null||Re.blur(),Le({edges:[y]})):Ke([e])}};return f.jsx("svg",{style:{zIndex:V},children:f.jsxs("g",{className:ms(["react-flow__edge",`react-flow__edge-${N}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:I,selectable:M}]),onClick:ae,onDoubleClick:ue,onContextMenu:se,onMouseEnter:G,onMouseMove:oe,onMouseLeave:ce,onKeyDown:A?he:void 0,tabIndex:A?0:void 0,role:y.ariaRole??(A?"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":A?`${CU}-${w}`:void 0,ref:D,...y.domAttributes,children:[!U&&f.jsx(z,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,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:Y,targetX:$,targetY:L,sourcePosition:F,targetPosition:q,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:K,markerEnd:ne,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(MVn,{edge:y,isReconnectable:j,reconnectRadius:h,onReconnect:_,onReconnectStart:p,onReconnectEnd:m,sourceX:Z,sourceY:Y,targetX:$,targetY:L,sourcePosition:F,targetPosition:q,setUpdateHover:B,setReconnecting:H})]})})}var DVn=T.memo(OVn);const LVn=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function XU({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:h,reconnectRadius:_,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:w,disableKeyboardA11y:k}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,onError:y}=Ln(LVn,zr),C=yVn(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(CVn,{defaultColor:e,rfId:t}),C.map(N=>f.jsx(DVn,{id:N,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,onClick:h,reconnectRadius:_,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:w,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:k},N))]})}XU.displayName="EdgeRenderer";const IVn=T.memo(XU),$Vn=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function BVn({children:e}){const n=Ln($Vn);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function PVn(e){const n=DC(),t=T.useRef(!1);T.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const FVn=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function HVn(e){const n=Ln(FVn),t=Ar();return T.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function qVn(e){return e.connection.inProgress?{...e.connection,to:qm(e.connection.to,e.transform)}:{...e.connection}}function UVn(e){return qVn}function GVn(e){const n=UVn();return Ln(n,zr)}const VVn=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function KVn({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:c}=Ln(VVn,zr);return!(i&&s&&c)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:ms(["react-flow__connection",Qq(o)]),children:f.jsx(YU,{style:n,type:t,CustomComponent:r,isValid:o})})})}const YU=({style:e,type:n=gu.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:c,to:u,toNode:h,toHandle:_,toPosition:p,pointer:m}=GVn();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:p,connectionStatus:Qq(r),toNode:h,toHandle:_,pointer:m});let w="";const k={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case gu.Bezier:[w]=cU(k);break;case gu.SimpleBezier:[w]=$U(k);break;case gu.Step:[w]=dk({...k,borderRadius:0});break;case gu.SmoothStep:[w]=dk(k);break;default:[w]=uU(k)}return f.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};YU.displayName="ConnectionLine";const WVn={};function QM(e=WVn){T.useRef(e),Ar(),T.useEffect(()=>{},[e])}function QVn(){Ar(),T.useRef(!1),T.useEffect(()=>{},[])}function ZU({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,onSelectionContextMenu:_,onSelectionStart:p,onSelectionEnd:m,connectionLineType:w,connectionLineStyle:k,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:x,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:N,panActivationKeyCode:z,zoomActivationKeyCode:A,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:D,defaultViewport:I,translateExtent:B,minZoom:U,maxZoom:H,preventScrolling:Q,defaultMarkerColor:V,zoomOnScroll:Z,zoomOnPinch:Y,panOnScroll:$,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:q,panOnDrag:K,autoPanOnSelection:ne,onPaneClick:ae,onPaneMouseEnter:ue,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneScroll:oe,onPaneContextMenu:ce,paneClickDistance:he,nodeClickDistance:be,onEdgeContextMenu:Re,onEdgeMouseEnter:Le,onEdgeMouseMove:Ke,onEdgeMouseLeave:Ne,reconnectRadius:xe,onReconnect:rt,onReconnectStart:Ze,onReconnectEnd:ot,noDragClassName:kt,noWheelClassName:qt,noPanClassName:dt,disableKeyboardA11y:pt,nodeExtent:Ie,rfId:pe,viewport:je,onViewportChange:He}){return QM(e),QM(n),QVn(),PVn(t),HVn(je),f.jsx(uVn,{onPaneClick:ae,onPaneMouseEnter:ue,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneContextMenu:ce,onPaneScroll:oe,paneClickDistance:he,deleteKeyCode:j,selectionKeyCode:x,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:N,panActivationKeyCode:z,zoomActivationKeyCode:A,elementsSelectable:D,zoomOnScroll:Z,zoomOnPinch:Y,zoomOnDoubleClick:q,panOnScroll:$,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:K,autoPanOnSelection:ne,defaultViewport:I,translateExtent:B,minZoom:U,maxZoom:H,onSelectionContextMenu:_,preventScrolling:Q,noDragClassName:kt,noWheelClassName:qt,noPanClassName:dt,disableKeyboardA11y:pt,onViewportChange:He,isControlledViewport:!!je,children:f.jsxs(BVn,{children:[f.jsx(IVn,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:rt,onReconnectStart:Ze,onReconnectEnd:ot,onlyRenderVisibleElements:M,onEdgeContextMenu:Re,onEdgeMouseEnter:Le,onEdgeMouseMove:Ke,onEdgeMouseLeave:Ne,reconnectRadius:xe,defaultMarkerColor:V,noPanClassName:dt,disableKeyboardA11y:pt,rfId:pe}),f.jsx(KVn,{style:k,type:w,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(bVn,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,nodeClickDistance:be,onlyRenderVisibleElements:M,noPanClassName:dt,noDragClassName:kt,disableKeyboardA11y:pt,nodeExtent:Ie,rfId:pe}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}ZU.displayName="GraphView";const XVn=T.memo(ZU),YVn=tU(),XM=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c=.5,maxZoom:u=2,nodeOrigin:h,nodeExtent:_,zIndexMode:p="basic"}={})=>{const m=new Map,w=new Map,k=new Map,v=new Map,b=r??n??[],x=t??e??[],y=h??[0,0],C=_??J0;dU(k,v,b);const{nodesInitialized:N}=pk(x,m,w,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let z=[0,0,1];if(a&&s&&i){const A=Fm(m,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:j,y:M,zoom:D}=zC(A,s,i,c,u,(o==null?void 0:o.padding)??.1);z=[j,M,D]}return{rfId:"1",width:s??0,height:i??0,transform:z,nodes:x,nodesInitialized:N,nodeLookup:m,parentLookup:w,edges:b,edgeLookup:v,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:J0,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Mh.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:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...Wq},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:YVn,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Kq,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},ZVn=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:_,zIndexMode:p})=>cGn((m,w)=>{async function k(){const{nodeLookup:v,panZoom:b,fitViewOptions:x,fitViewResolver:y,width:C,height:N,minZoom:z,maxZoom:A}=w();b&&(await uUn({nodes:v,width:C,height:N,panZoom:b,minZoom:z,maxZoom:A},x),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...XM({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:_,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:x,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:N,zIndexMode:z,nodesSelectionActive:A}=w(),{nodesInitialized:j,hasSelectedNodes:M}=pk(v,b,x,{nodeOrigin:y,nodeExtent:_,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:z}),D=A&&M;N&&j?(k(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:D})},setEdges:v=>{const{connectionLookup:b,edgeLookup:x}=w();dU(b,x,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:x}=w();x(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:x}=w();x(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:x,parentLookup:y,domNode:C,nodeOrigin:N,nodeExtent:z,debug:A,fitViewQueued:j,zIndexMode:M}=w(),{changes:D,updatedInternals:I}=MUn(v,x,y,C,N,z,M);I&&(jUn(x,y,{nodeOrigin:N,nodeExtent:z,zIndexMode:M}),j?(k(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(D==null?void 0:D.length)>0&&(A&&console.log("React Flow: trigger node changes",D),b==null||b(D)))},updateNodePositions:(v,b=!1)=>{const x=[];let y=[];const{nodeLookup:C,triggerNodeChanges:N,connection:z,updateConnection:A,onNodesChangeMiddlewareMap:j}=w();for(const[M,D]of v){const I=C.get(M),B=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(D!=null&&D.position)),U={id:M,type:"position",position:B?{x:Math.max(0,D.position.x),y:Math.max(0,D.position.y)}:D.position,dragging:b};if(I&&z.inProgress&&z.fromNode.id===I.id){const H=wf(I,z.fromHandle,Rt.Left,!0);A({...z,from:H})}B&&I.parentId&&x.push({id:M,parentId:I.parentId,rect:{...D.internals.positionAbsolute,width:D.measured.width??0,height:D.measured.height??0}}),y.push(U)}if(x.length>0){const{parentLookup:M,nodeOrigin:D}=w(),I=OC(x,C,M,D);y.push(...I)}for(const M of j.values())y=M(y);N(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:x,nodes:y,hasDefaultNodes:C,debug:N}=w();if(v!=null&&v.length){if(C){const z=jGn(v,y);x(z)}N&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:x,edges:y,hasDefaultEdges:C,debug:N}=w();if(v!=null&&v.length){if(C){const z=AGn(v,y);x(z)}N&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=w();if(b){const z=v.map(A=>T_(A,!0));C(z);return}C(Dd(y,new Set([...v]),!0)),N(Dd(x))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=w();if(b){const z=v.map(A=>T_(A,!0));N(z);return}N(Dd(x,new Set([...v]))),C(Dd(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:x,nodes:y,nodeLookup:C,triggerNodeChanges:N,triggerEdgeChanges:z}=w(),A=v||y,j=b||x,M=[];for(const I of A){if(!I.selected)continue;const B=C.get(I.id);B&&(B.selected=!1),M.push(T_(I.id,!1))}const D=[];for(const I of j)I.selected&&D.push(T_(I.id,!1));N(M),z(D)},setMinZoom:v=>{const{panZoom:b,maxZoom:x}=w();b==null||b.setScaleExtent([v,x]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:x}=w();b==null||b.setScaleExtent([x,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=w().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:x,triggerEdgeChanges:y,elementsSelectable:C}=w();if(!C)return;const N=b.reduce((A,j)=>j.selected?[...A,T_(j.id,!1)]:A,[]),z=v.reduce((A,j)=>j.selected?[...A,T_(j.id,!1)]:A,[]);x(N),y(z)},setNodeExtent:v=>{const{nodes:b,nodeLookup:x,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:N,nodeExtent:z,zIndexMode:A}=w();v[0][0]===z[0][0]&&v[0][1]===z[0][1]&&v[1][0]===z[1][0]&&v[1][1]===z[1][1]||(pk(b,x,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:A}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:x,height:y,panZoom:C,translateExtent:N}=w();return OUn({delta:v,panZoom:C,transform:b,translateExtent:N,width:x,height:y})},setCenter:async(v,b,x)=>{const{width:y,height:C,maxZoom:N,panZoom:z}=w();if(!z)return!1;const A=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:N;return await z.setViewport({x:y/2-v*A,y:C/2-b*A,zoom:A},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{m({connection:{...Wq}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...XM()})}},Object.is);function JVn({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:c,fitView:u,nodeOrigin:h,nodeExtent:_,zIndexMode:p,children:m}){const[w]=T.useState(()=>ZVn({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:c,nodeOrigin:h,nodeExtent:_,zIndexMode:p}));return f.jsx(lGn,{value:w,children:f.jsx(LGn,{children:f.jsx(YGn,{children:m})})})}function eKn({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:c,minZoom:u,maxZoom:h,nodeOrigin:_,nodeExtent:p,zIndexMode:m}){return T.useContext(Gy)?f.jsx(f.Fragment,{children:e}):f.jsx(JVn,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:h,nodeOrigin:_,nodeExtent:p,zIndexMode:m,children:e})}const tKn={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function nKn({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:c,onInit:u,onMove:h,onMoveStart:_,onMoveEnd:p,onConnect:m,onConnectStart:w,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:z,onNodeDragStart:A,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:D,onEdgesDelete:I,onDelete:B,onSelectionChange:U,onSelectionDragStart:H,onSelectionDrag:Q,onSelectionDragStop:V,onSelectionContextMenu:Z,onSelectionStart:Y,onSelectionEnd:$,onBeforeDelete:L,connectionMode:F,connectionLineType:q=gu.Bezier,connectionLineStyle:K,connectionLineComponent:ne,connectionLineContainerStyle:ae,deleteKeyCode:ue="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:G=!1,selectionMode:oe=em.Full,panActivationKeyCode:ce="Space",multiSelectionKeyCode:he=nm()?"Meta":"Control",zoomActivationKeyCode:be=nm()?"Meta":"Control",snapToGrid:Re,snapGrid:Le,onlyRenderVisibleElements:Ke=!1,selectNodesOnDrag:Ne,nodesDraggable:xe,autoPanOnNodeFocus:rt,nodesConnectable:Ze,nodesFocusable:ot,nodeOrigin:kt=EU,edgesFocusable:qt,edgesReconnectable:dt,elementsSelectable:pt=!0,defaultViewport:Ie=wGn,minZoom:pe=.5,maxZoom:je=2,translateExtent:He=J0,preventScrolling:st=!0,nodeExtent:_t,defaultMarkerColor:Ct="#b1b1b7",zoomOnScroll:bt=!0,zoomOnPinch:Yt=!0,panOnScroll:un=!1,panOnScrollSpeed:Tt=.5,panOnScrollMode:ht=rf.Free,zoomOnDoubleClick:mt=!0,panOnDrag:_n=!0,onPaneClick:gs,onPaneMouseEnter:br,onPaneMouseMove:Kt,onPaneMouseLeave:Bn,onPaneScroll:_r,onPaneContextMenu:yr,paneClickDistance:Wr=1,nodeClickDistance:Nt=0,children:vn,onReconnect:fn,onReconnectStart:hn,onReconnectEnd:Ir,onEdgeContextMenu:bn,onEdgeDoubleClick:yn,onEdgeMouseEnter:Pn,onEdgeMouseMove:Et,onEdgeMouseLeave:Bt,reconnectRadius:In=10,onNodesChange:xr,onEdgesChange:fr,noDragClassName:Fn="nodrag",noWheelClassName:sr="nowheel",noPanClassName:Qr="nopan",fitView:On,fitViewOptions:We,connectOnClick:yt,attributionPosition:Jn,proOptions:pr,defaultEdgeOptions:pn,elevateNodesOnSelect:Tr=!0,elevateEdgesOnSelect:An=!1,disableKeyboardA11y:ii=!1,autoPanOnConnect:wr,autoPanOnNodeDrag:er,autoPanOnSelection:Va=!0,autoPanSpeed:_c,connectionRadius:$r,isValidConnection:ai,onError:xo,style:Ka,id:Pi,nodeDragThreshold:xl,connectionDragThreshold:Lt,viewport:Rs,onViewportChange:Br,width:Xr,height:ct,colorMode:Wt="light",debug:xi,onScroll:Fi,ariaLabelConfig:Hi,zIndexMode:Yr="basic",...Rr},wo){const wi=Pi||"1",Hs=EGn(Wt),oi=T.useCallback(Zr=>{Zr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Fi==null||Fi(Zr)},[Fi]);return f.jsx("div",{"data-testid":"rf__wrapper",...Rr,onScroll:oi,style:{...Ka,...tKn},ref:wo,className:ms(["react-flow",s,Hs]),id:Pi,role:"application",children:f.jsxs(eKn,{nodes:e,edges:n,width:Xr,height:ct,fitView:On,fitViewOptions:We,minZoom:pe,maxZoom:je,nodeOrigin:kt,nodeExtent:_t,zIndexMode:Yr,children:[f.jsx(CGn,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:w,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:xe,autoPanOnNodeFocus:rt,nodesConnectable:Ze,nodesFocusable:ot,edgesFocusable:qt,edgesReconnectable:dt,elementsSelectable:pt,elevateNodesOnSelect:Tr,elevateEdgesOnSelect:An,minZoom:pe,maxZoom:je,nodeExtent:_t,onNodesChange:xr,onEdgesChange:fr,snapToGrid:Re,snapGrid:Le,connectionMode:F,translateExtent:He,connectOnClick:yt,defaultEdgeOptions:pn,fitView:On,fitViewOptions:We,onNodesDelete:D,onEdgesDelete:I,onDelete:B,onNodeDragStart:A,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Q,onSelectionDragStart:H,onSelectionDragStop:V,onMove:h,onMoveStart:_,onMoveEnd:p,noPanClassName:Qr,nodeOrigin:kt,rfId:wi,autoPanOnConnect:wr,autoPanOnNodeDrag:er,autoPanSpeed:_c,onError:xo,connectionRadius:$r,isValidConnection:ai,selectNodesOnDrag:Ne,nodeDragThreshold:xl,connectionDragThreshold:Lt,onBeforeDelete:L,debug:xi,ariaLabelConfig:Hi,zIndexMode:Yr}),f.jsx(XVn,{onInit:u,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:z,nodeTypes:i,edgeTypes:a,connectionLineType:q,connectionLineStyle:K,connectionLineComponent:ne,connectionLineContainerStyle:ae,selectionKeyCode:se,selectionOnDrag:G,selectionMode:oe,deleteKeyCode:ue,multiSelectionKeyCode:he,panActivationKeyCode:ce,zoomActivationKeyCode:be,onlyRenderVisibleElements:Ke,defaultViewport:Ie,translateExtent:He,minZoom:pe,maxZoom:je,preventScrolling:st,zoomOnScroll:bt,zoomOnPinch:Yt,zoomOnDoubleClick:mt,panOnScroll:un,panOnScrollSpeed:Tt,panOnScrollMode:ht,panOnDrag:_n,autoPanOnSelection:Va,onPaneClick:gs,onPaneMouseEnter:br,onPaneMouseMove:Kt,onPaneMouseLeave:Bn,onPaneScroll:_r,onPaneContextMenu:yr,paneClickDistance:Wr,nodeClickDistance:Nt,onSelectionContextMenu:Z,onSelectionStart:Y,onSelectionEnd:$,onReconnect:fn,onReconnectStart:hn,onReconnectEnd:Ir,onEdgeContextMenu:bn,onEdgeDoubleClick:yn,onEdgeMouseEnter:Pn,onEdgeMouseMove:Et,onEdgeMouseLeave:Bt,reconnectRadius:In,defaultMarkerColor:Ct,noDragClassName:Fn,noWheelClassName:sr,noPanClassName:Qr,rfId:wi,disableKeyboardA11y:ii,nodeExtent:_t,viewport:Rs,onViewportChange:Br}),f.jsx(xGn,{onSelectionChange:U}),vn,f.jsx(mGn,{proOptions:pr,position:Jn}),f.jsx(pGn,{rfId:wi,disableKeyboardA11y:ii})]})})}var rKn=zU(nKn);function sKn({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ms(["react-flow__background-pattern",t,r])})}function iKn({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:ms(["react-flow__background-pattern","dots",n])})}var ul;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ul||(ul={}));const aKn={[ul.Dots]:1,[ul.Lines]:1,[ul.Cross]:6},oKn=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function JU({id:e,variant:n=ul.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:c,className:u,patternClassName:h}){const _=T.useRef(null),{transform:p,patternId:m}=Ln(oKn,zr),w=r||aKn[n],k=n===ul.Dots,v=n===ul.Cross,b=Array.isArray(t)?t:[t,t],x=[b[0]*p[2]||1,b[1]*p[2]||1],y=w*p[2],C=Array.isArray(i)?i:[i,i],N=v?[y,y]:x,z=[C[0]*p[2]||1+N[0]/2,C[1]*p[2]||1+N[1]/2],A=`${m}${e||""}`;return f.jsxs("svg",{className:ms(["react-flow__background",u]),style:{...c,...Ky,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:_,"data-testid":"rf__background",children:[f.jsx("pattern",{id:A,x:p[0]%x[0],y:p[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${z[0]},-${z[1]})`,children:k?f.jsx(iKn,{radius:y/2,className:h}):f.jsx(sKn,{dimensions:N,lineWidth:s,variant:n,className:h})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}JU.displayName="Background";const cKn=T.memo(JU);function lKn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function uKn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function _Kn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.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 fKn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 dKn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 I1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:ms(["react-flow__controls-button",n]),...t,children:e})}const hKn=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function eG({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:c,className:u,children:h,position:_="bottom-left",orientation:p="vertical","aria-label":m}){const w=Ar(),{isInteractive:k,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:x}=Ln(hKn,zr),{zoomIn:y,zoomOut:C,fitView:N}=DC(),z=()=>{y(),i==null||i()},A=()=>{C(),a==null||a()},j=()=>{N(s),o==null||o()},M=()=>{w.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),c==null||c(!k)},D=p==="horizontal"?"horizontal":"vertical";return f.jsxs(Vy,{className:ms(["react-flow__controls",D,u]),position:_,style:e,"data-testid":"rf__controls","aria-label":m??x["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(I1,{onClick:z,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(lKn,{})}),f.jsx(I1,{onClick:A,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(uKn,{})})]}),t&&f.jsx(I1,{className:"react-flow__controls-fitview",onClick:j,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:f.jsx(_Kn,{})}),r&&f.jsx(I1,{className:"react-flow__controls-interactive",onClick:M,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:k?f.jsx(dKn,{}):f.jsx(fKn,{})}),h]})}eG.displayName="Controls";T.memo(eG);function pKn({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:c,className:u,borderRadius:h,shapeRendering:_,selected:p,onClick:m}){const{background:w,backgroundColor:k}=i||{},v=a||w||k;return f.jsx("rect",{className:ms(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:h,ry:h,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:c},shapeRendering:_,onClick:m?b=>m(b,e):void 0})}const mKn=T.memo(pKn),gKn=e=>e.nodes.map(n=>n.id),T4=e=>e instanceof Function?e:()=>e;function vKn({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=mKn,onClick:a}){const o=Ln(gKn,zr),c=T4(n),u=T4(e),h=T4(t),_=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(yKn,{id:p,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:_},p))})}function bKn({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:c}){const{node:u,x:h,y:_,width:p,height:m}=Ln(w=>{const k=w.nodeLookup.get(e);if(!k)return{node:void 0,x:0,y:0,width:0,height:0};const v=k.internals.userNode,{x:b,y:x}=k.internals.positionAbsolute,{width:y,height:C}=yl(v);return{node:v,x:b,y:x,width:y,height:C}},zr);return!u||u.hidden||!nU(u)?null:f.jsx(o,{x:h,y:_,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:c,id:u.id})}const yKn=T.memo(bKn);var xKn=T.memo(vKn);const wKn=200,kKn=150,SKn=e=>!e.hidden,CKn=e=>{const n={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:n,boundingRect:e.nodeLookup.size>0?Jq(Fm(e.nodeLookup,{filter:SKn}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},EKn="react-flow__minimap-desc";function tG({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:c,maskColor:u,maskStrokeColor:h,maskStrokeWidth:_,position:p="bottom-right",onClick:m,onNodeClick:w,pannable:k=!1,zoomable:v=!1,ariaLabel:b,inversePan:x,zoomStep:y=1,offsetScale:C=5}){const N=Ar(),z=T.useRef(null),{boundingRect:A,viewBB:j,rfId:M,panZoom:D,translateExtent:I,flowWidth:B,flowHeight:U,ariaLabelConfig:H}=Ln(CKn,zr),Q=(e==null?void 0:e.width)??wKn,V=(e==null?void 0:e.height)??kKn,Z=A.width/Q,Y=A.height/V,$=Math.max(Z,Y),L=$*Q,F=$*V,q=C*$,K=A.x-(L-A.width)/2-q,ne=A.y-(F-A.height)/2-q,ae=L+q*2,ue=F+q*2,se=`${EKn}-${M}`,G=T.useRef(0),oe=T.useRef();G.current=$,T.useEffect(()=>{if(z.current&&D)return oe.current=qUn({domNode:z.current,panZoom:D,getTransform:()=>N.getState().transform,getViewScale:()=>G.current}),()=>{var Re;(Re=oe.current)==null||Re.destroy()}},[D]),T.useEffect(()=>{var Re;(Re=oe.current)==null||Re.update({translateExtent:I,width:B,height:U,inversePan:x,pannable:k,zoomStep:y,zoomable:v})},[k,v,x,y,I,B,U]);const ce=m?Re=>{var Ne;const[Le,Ke]=((Ne=oe.current)==null?void 0:Ne.pointer(Re))||[0,0];m(Re,{x:Le,y:Ke})}:void 0,he=w?T.useCallback((Re,Le)=>{const Ke=N.getState().nodeLookup.get(Le).internals.userNode;w(Re,Ke)},[]):void 0,be=b??H["minimap.ariaLabel"];return f.jsx(Vy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof _=="number"?_*$:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:ms(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Q,height:V,viewBox:`${K} ${ne} ${ae} ${ue}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:z,onClick:ce,children:[be&&f.jsx("title",{id:se,children:be}),f.jsx(xKn,{onClick:he,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${K-q},${ne-q}h${ae+q*2}v${ue+q*2}h${-ae-q*2}z +`)),h=u.reduce((_,p)=>_.concat(...p),[]);return[u,h]}return[[],[]]},[e]);return T.useEffect(()=>{const c=(n==null?void 0:n.target)??MM,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const h=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&iU(m))return!1;const k=DM(m.code,o);if(i.current.add(m[k]),OM(a,i.current,!1)){const x=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},_=m=>{const w=DM(m.code,o);OM(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[w]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",_),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",_),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function OM(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function DM(e,n){return n.includes(e)?"code":"key"}const NGn=()=>{const e=Ar();return T.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),c=zC(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(c,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:c}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-c},h=t.snapGrid??s,_=t.snapToGrid??i;return qm(u,r,_,h)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=Dh(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function NU(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const c of a)zGn(c,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function zGn(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function jGn(e,n){return NU(e,n)}function AGn(e,n){return NU(e,n)}function T_(e,n){return{id:e,type:"select",selected:n}}function Dd(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(T_(i.id,a)))}return r}function LM({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),c=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;c!==void 0&&c!==a&&t.push({id:a.id,item:a,type:"replace"}),c===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function IM(e){return{id:e.id,type:"remove"}}const TGn=tU();function RGn(e,n,t={}){return xUn(e,n,{...t,onError:t.onError??TGn})}const $M=e=>aUn(e),MGn=e=>Xq(e);function zU(e){return T.forwardRef(e)}const OGn=typeof window<"u"?T.useLayoutEffect:T.useEffect;function BM(e){const[n,t]=T.useState(BigInt(0)),[r]=T.useState(()=>DGn(()=>t(s=>s+BigInt(1))));return OGn(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function DGn(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const jU=T.createContext(null);function LGn({children:e}){const n=Ar(),t=T.useCallback(o=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:h,onNodesChange:_,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:w}=n.getState();let k=c;for(const b of o)k=typeof b=="function"?b(k):b;let v=LM({items:k,lookup:p});for(const b of w.values())v=b(v);h&&u(k),v.length>0?_==null||_(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:x,setNodes:y}=n.getState();b&&y(x)})},[]),r=BM(t),s=T.useCallback(o=>{const{edges:c=[],setEdges:u,hasDefaultEdges:h,onEdgesChange:_,edgeLookup:p}=n.getState();let m=c;for(const w of o)m=typeof w=="function"?w(m):w;h?u(m):_&&_(LM({items:m,lookup:p}))},[]),i=BM(s),a=T.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(jU.Provider,{value:a,children:e})}function IGn(){const e=T.useContext(jU);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const $Gn=e=>!!e.panZoom;function DC(){const e=NGn(),n=Ar(),t=IGn(),r=Ln($Gn),s=T.useMemo(()=>{const i=_=>n.getState().nodeLookup.get(_),a=_=>{t.nodeQueue.push(_)},o=_=>{t.edgeQueue.push(_)},c=_=>{var b,x;const{nodeLookup:p,nodeOrigin:m}=n.getState(),w=$M(_)?_:p.get(_.id),k=w.parentId?rU(w.position,w.measured,w.parentId,p,m):w.position,v={...w,position:k,width:((b=w.measured)==null?void 0:b.width)??w.width,height:((x=w.measured)==null?void 0:x.height)??w.height};return tm(v)},u=(_,p,m={replace:!1})=>{a(w=>w.map(k=>{if(k.id===_){const v=typeof p=="function"?p(k):p;return m.replace&&$M(v)?v:{...k,...v}}return k}))},h=(_,p,m={replace:!1})=>{o(w=>w.map(k=>{if(k.id===_){const v=typeof p=="function"?p(k):p;return m.replace&&MGn(v)?v:{...k,...v}}return k}))};return{getNodes:()=>n.getState().nodes.map(_=>({..._})),getNode:_=>{var p;return(p=i(_))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:_=[]}=n.getState();return _.map(p=>({...p}))},getEdge:_=>n.getState().edgeLookup.get(_),setNodes:a,setEdges:o,addNodes:_=>{const p=Array.isArray(_)?_:[_];t.nodeQueue.push(m=>[...m,...p])},addEdges:_=>{const p=Array.isArray(_)?_:[_];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:_=[],edges:p=[],transform:m}=n.getState(),[w,k,v]=m;return{nodes:_.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x:w,y:k,zoom:v}}},deleteElements:async({nodes:_=[],edges:p=[]})=>{const{nodes:m,edges:w,onNodesDelete:k,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:x,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:N,edges:z}=await _Un({nodesToRemove:_,edgesToRemove:p,nodes:m,edges:w,onBeforeDelete:C}),A=z.length>0,j=N.length>0;if(A){const M=z.map(IM);v==null||v(z),x(M)}if(j){const M=N.map(IM);k==null||k(N),b(M)}return(j||A)&&(y==null||y({nodes:N,edges:z})),{deletedNodes:N,deletedEdges:z}},getIntersectingNodes:(_,p=!0,m)=>{const w=dM(_),k=w?_:c(_),v=m!==void 0;return k?(m||n.getState().nodes).filter(b=>{const x=n.getState().nodeLookup.get(b.id);if(x&&!w&&(b.id===_.id||!x.internals.positionAbsolute))return!1;const y=tm(v?b:x),C=bb(y,k);return p&&C>0||C>=y.width*y.height||C>=k.width*k.height}):[]},isNodeIntersecting:(_,p,m=!0)=>{const k=dM(_)?_:c(_);if(!k)return!1;const v=bb(k,p);return m&&v>0||v>=p.width*p.height||v>=k.width*k.height},updateNode:u,updateNodeData:(_,p,m={replace:!1})=>{u(_,w=>{const k=typeof p=="function"?p(w):p;return m.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},m)},updateEdge:h,updateEdgeData:(_,p,m={replace:!1})=>{h(_,w=>{const k=typeof p=="function"?p(w):p;return m.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},m)},getNodesBounds:_=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return oUn(_,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:_,id:p,nodeId:m})=>{var w;return Array.from(((w=n.getState().connectionLookup.get(`${m}-${_}${p?`-${p}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:_,handleId:p,nodeId:m})=>{var w;return Array.from(((w=n.getState().connectionLookup.get(`${m}${_?p?`-${_}-${p}`:`-${_}`:""}`))==null?void 0:w.values())??[])},fitView:async _=>{const p=n.getState().fitViewResolver??hUn();return n.setState({fitViewQueued:!0,fitViewOptions:_,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return T.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const PM=e=>e.selected,BGn=typeof window<"u"?window:void 0;function PGn({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Ar(),{deleteElements:r}=DC(),s=rm(e,{actInsideInputWithModifier:!1}),i=rm(n,{target:BGn});T.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(PM),edges:a.filter(PM)}),t.setState({nodesSelectionActive:!1})}},[s]),T.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function FGn(e){const n=Ar();T.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=jC(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",bo.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const Ky={position:"absolute",width:"100%",height:"100%",top:0,left:0},HGn=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function qGn({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=rf.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:u,minZoom:h,maxZoom:_,zoomActivationKeyCode:p,preventScrolling:m=!0,children:w,noWheelClassName:k,noPanClassName:v,onViewportChange:b,isControlledViewport:x,paneClickDistance:y,selectionOnDrag:C}){const N=Ar(),z=T.useRef(null),{userSelectionActive:A,lib:j,connectionInProgress:M}=Ln(HGn,zr),D=rm(p),I=T.useRef();FGn(z);const B=T.useCallback(U=>{b==null||b({x:U[0],y:U[1],zoom:U[2]}),x||N.setState({transform:U})},[b,x]);return T.useEffect(()=>{if(z.current){I.current=YUn({domNode:z.current,minZoom:h,maxZoom:_,translateExtent:u,viewport:c,onDraggingChange:V=>N.setState(Z=>Z.paneDragging===V?Z:{paneDragging:V}),onPanZoomStart:(V,Z)=>{const{onViewportChangeStart:Y,onMoveStart:$}=N.getState();$==null||$(V,Z),Y==null||Y(Z)},onPanZoom:(V,Z)=>{const{onViewportChange:Y,onMove:$}=N.getState();$==null||$(V,Z),Y==null||Y(Z)},onPanZoomEnd:(V,Z)=>{const{onViewportChangeEnd:Y,onMoveEnd:$}=N.getState();$==null||$(V,Z),Y==null||Y(Z)}});const{x:U,y:H,zoom:Q}=I.current.getViewport();return N.setState({panZoom:I.current,transform:[U,H,Q],domNode:z.current.closest(".react-flow")}),()=>{var V;(V=I.current)==null||V.destroy()}}},[]),T.useEffect(()=>{var U;(U=I.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:D,preventScrolling:m,noPanClassName:v,userSelectionActive:A,noWheelClassName:k,lib:j,onTransformChange:B,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,D,m,v,A,k,j,B,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:z,style:Ky,children:w})}const UGn=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function GGn(){const{userSelectionActive:e,userSelectionRect:n}=Ln(UGn,zr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const A4=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},VGn=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function KGn({isSelecting:e,selectionKeyPressed:n,selectionMode:t=em.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:h,onPaneScroll:_,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:w,children:k}){const v=T.useRef(0),b=Ar(),{userSelectionActive:x,elementsSelectable:y,dragging:C,panBy:N,autoPanSpeed:z}=Ln(VGn,zr),A=y&&(e||x),j=T.useRef(null),M=T.useRef(),D=T.useRef(new Set),I=T.useRef(new Set),B=T.useRef(!1),U=T.useRef(!1),H=T.useRef({x:0,y:0}),Q=T.useRef(!1),V=G=>{if(U.current||B.current||b.getState().connection.inProgress){U.current=!1,B.current=!1;return}u==null||u(G),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},Z=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}h==null||h(G)},Y=_?G=>_(G):void 0,$=G=>{U.current&&(G.stopPropagation(),U.current=!1)},L=G=>{var xe,rt;const{domNode:oe,transform:ce}=b.getState();if(M.current=oe==null?void 0:oe.getBoundingClientRect(),!M.current)return;const he=G.target===j.current;if(!he&&!!G.target.closest(".nokey")||!e||!(a&&he||n)||G.button!==0||!G.isPrimary)return;(rt=(xe=G.target)==null?void 0:xe.setPointerCapture)==null||rt.call(xe,G.pointerId),U.current=!1;const{x:Le,y:Ke}=ho(G.nativeEvent,M.current),Ne=qm({x:Le,y:Ke},ce);b.setState({userSelectionRect:{width:0,height:0,startX:Ne.x,startY:Ne.y,x:Le,y:Ke}}),he||(G.stopPropagation(),G.preventDefault())};function F(G,oe){const{userSelectionRect:ce}=b.getState();if(!ce)return;const{transform:he,nodeLookup:be,edgeLookup:Re,connectionLookup:Le,triggerNodeChanges:Ke,triggerEdgeChanges:Ne,defaultEdgeOptions:xe}=b.getState(),rt={x:ce.startX,y:ce.startY},{x:Ze,y:ot}=Dh(rt,he),kt={startX:rt.x,startY:rt.y,x:GIe.id)),I.current=new Set;const pt=(xe==null?void 0:xe.selectable)??!0;for(const Ie of D.current){const pe=Le.get(Ie);if(pe)for(const{edgeId:je}of pe.values()){const He=Re.get(je);He&&(He.selectable??pt)&&I.current.add(je)}}if(!hM(qt,D.current)){const Ie=Dd(be,D.current,!0);Ke(Ie)}if(!hM(dt,I.current)){const Ie=Dd(Re,I.current);Ne(Ie)}b.setState({userSelectionRect:kt,userSelectionActive:!0,nodesSelectionActive:!1})}function q(){if(!s||!M.current)return;const[G,oe]=NC(H.current,M.current,z);N({x:G,y:oe}).then(ce=>{if(!U.current||!ce){v.current=requestAnimationFrame(q);return}const{x:he,y:be}=H.current;F(he,be),v.current=requestAnimationFrame(q)})}const K=()=>{cancelAnimationFrame(v.current),v.current=0,Q.current=!1};T.useEffect(()=>()=>K(),[]);const ne=G=>{const{userSelectionRect:oe,transform:ce,resetSelectedElements:he}=b.getState();if(!M.current||!oe)return;const{x:be,y:Re}=ho(G.nativeEvent,M.current);H.current={x:be,y:Re};const Le=Dh({x:oe.startX,y:oe.startY},ce);if(!U.current){const Ke=n?0:i;if(Math.hypot(be-Le.x,Re-Le.y)<=Ke)return;he(),o==null||o(G)}U.current=!0,Q.current||(q(),Q.current=!0),F(be,Re)},ae=G=>{var oe,ce;if(!A){G.target===j.current&&b.getState().connection.inProgress&&(B.current=!0);return}G.button===0&&((ce=(oe=G.target)==null?void 0:oe.releasePointerCapture)==null||ce.call(oe,G.pointerId),!x&&G.target===j.current&&b.getState().userSelectionRect&&(V==null||V(G)),b.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(c==null||c(G),b.setState({nodesSelectionActive:D.current.size>0})),K())},ue=G=>{var oe,ce;(ce=(oe=G.target)==null?void 0:oe.releasePointerCapture)==null||ce.call(oe,G.pointerId),K()},se=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:ms(["react-flow__pane",{draggable:se,dragging:C,selection:e}]),onClick:A?void 0:A4(V,j),onContextMenu:A4(Z,j),onWheel:A4(Y,j),onPointerEnter:A?void 0:p,onPointerMove:A?ne:m,onPointerUp:ae,onPointerCancel:A?ue:void 0,onPointerDownCapture:A?L:void 0,onClickCapture:A?$:void 0,onPointerLeave:w,ref:j,style:Ky,children:[k,f.jsx(GGn,{})]})}function gk({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:c}=n.getState(),u=o.get(e);if(!u){c==null||c("012",bo.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function AU({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Ar(),[c,u]=T.useState(!1),h=T.useRef();return T.useEffect(()=>{h.current=IUn({getStoreItems:()=>o.getState(),onNodeMouseDown:_=>{gk({id:_,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),T.useEffect(()=>{if(!(n||!e.current||!h.current))return h.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var _;(_=h.current)==null||_.destroy()}},[t,r,n,i,e,s,a]),c}const WGn=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function TU(){const e=Ar();return T.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:c,nodeLookup:u,nodeOrigin:h}=e.getState(),_=new Map,p=WGn(a),m=s?i[0]:5,w=s?i[1]:5,k=t.direction.x*m*t.factor,v=t.direction.y*w*t.factor;for(const[,b]of u){if(!p(b))continue;let x={x:b.internals.positionAbsolute.x+k,y:b.internals.positionAbsolute.y+v};s&&(x=Hm(x,i));const{position:y,positionAbsolute:C}=Yq({nodeId:b.id,nextPosition:x,nodeLookup:u,nodeExtent:r,nodeOrigin:h,onError:o});b.position=y,b.internals.positionAbsolute=C,_.set(b.id,b)}c(_)},[])}const LC=T.createContext(null),QGn=LC.Provider;LC.Consumer;const RU=()=>T.useContext(LC),XGn=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),MU=T.createContext(null);function YGn({children:e}){const n=Ln(XGn,zr);return f.jsx(MU.Provider,{value:n,children:e})}function ZGn(){const e=T.useContext(MU);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const JGn={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},eVn=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:c,isValid:u}=a;if(!o&&!s)return JGn;const h=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===n&&(c==null?void 0:c.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:h,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===Mh.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:h&&u}};function tVn({type:e="source",position:n=Rt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:c,className:u,onMouseDown:h,onTouchStart:_,...p},m){var Q,V;const w=a||null,k=e==="target",v=Ar(),b=RU(),{connectOnClick:x,noPanClassName:y,rfId:C}=ZGn(),{connectingFrom:N,connectingTo:z,clickConnecting:A,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:D,valid:I}=Ln(eVn(b,w,e),zr);b||(V=(Q=v.getState()).onError)==null||V.call(Q,"010",bo.error010());const B=Z=>{const{defaultEdgeOptions:Y,onConnect:$,hasDefaultEdges:L}=v.getState(),F={...Y,...Z};if(L){const{edges:q,setEdges:K,onError:ne}=v.getState();K(RGn(F,q,{onError:ne}))}$==null||$(F),o==null||o(F)},U=Z=>{if(!b)return;const Y=aU(Z.nativeEvent);if(s&&(Y&&Z.button===0||!Y)){const $=v.getState();mk.onPointerDown(Z.nativeEvent,{handleDomNode:Z.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:k,handleId:w,nodeId:b,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:(...L)=>{var F,q;return(q=(F=v.getState()).onConnectEnd)==null?void 0:q.call(F,...L)},updateConnection:$.updateConnection,onConnect:B,isValidConnection:t||((...L)=>{var F,q;return((q=(F=v.getState()).isValidConnection)==null?void 0:q.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}Y?h==null||h(Z):_==null||_(Z)},H=Z=>{const{onClickConnectStart:Y,onClickConnectEnd:$,connectionClickStartHandle:L,connectionMode:F,isValidConnection:q,lib:K,rfId:ne,nodeLookup:ae,connection:ue}=v.getState();if(!b||!L&&!s)return;if(!L){Y==null||Y(Z.nativeEvent,{nodeId:b,handleId:w,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:w}});return}const se=sU(Z.target),G=t||q,{connection:oe,isValid:ce}=mk.isValid(Z.nativeEvent,{handle:{nodeId:b,id:w,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:G,flowId:ne,doc:se,lib:K,nodeLookup:ae});ce&&oe&&B(oe);const he=structuredClone(ue);delete he.inProgress,he.toPosition=he.toHandle?he.toHandle.position:null,$==null||$(Z,he),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":w,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${w}-${e}`,className:ms(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!k,target:k,connectable:r,connectablestart:s,connectableend:i,clickconnecting:A,connectingfrom:N,connectingto:z,valid:I,connectionindicator:r&&(!M||j)&&(M||D?i:s)}]),onMouseDown:U,onTouchStart:U,onClick:x?H:void 0,ref:m,...p,children:c})}const tc=T.memo(zU(tVn));function nVn({data:e,isConnectable:n,sourcePosition:t=Rt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(tc,{type:"source",position:t,isConnectable:n})]})}function rVn({data:e,isConnectable:n,targetPosition:t=Rt.Top,sourcePosition:r=Rt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(tc,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(tc,{type:"source",position:r,isConnectable:n})]})}function sVn(){return null}function iVn({data:e,isConnectable:n,targetPosition:t=Rt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(tc,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const yb={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},FM={input:nVn,default:rVn,output:iVn,group:sVn};function aVn(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const oVn=e=>{const{width:n,height:t,x:r,y:s}=Fm(e.nodeLookup,{filter:i=>!!i.selected});return{width:fo(n)?n:null,height:fo(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function cVn({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Ar(),{width:s,height:i,transformString:a,userSelectionActive:o}=Ln(oVn,zr),c=TU(),u=T.useRef(null);T.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const h=!o&&s!==null&&i!==null;if(AU({nodeRef:u,disabled:!h}),!h)return null;const _=e?m=>{const w=r.getState().nodes.filter(k=>k.selected);e(m,w)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(yb,m.key)&&(m.preventDefault(),c({direction:yb[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:ms(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:_,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const HM=typeof window<"u"?window:void 0,lVn=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function OU({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:h,selectionMode:_,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:w,panActivationKeyCode:k,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:N,panOnScrollMode:z,zoomOnDoubleClick:A,panOnDrag:j,autoPanOnSelection:M,defaultViewport:D,translateExtent:I,minZoom:B,maxZoom:U,preventScrolling:H,onSelectionContextMenu:Q,noWheelClassName:V,noPanClassName:Z,disableKeyboardA11y:Y,onViewportChange:$,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:q}=Ln(lVn,zr),K=rm(u,{target:HM}),ne=rm(k,{target:HM}),ae=ne||j,ue=ne||C,se=h&&ae!==!0,G=K||q||se;return PGn({deleteKeyCode:c,multiSelectionKeyCode:w}),f.jsx(qGn,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:ue,panOnScrollSpeed:N,panOnScrollMode:z,zoomOnDoubleClick:A,panOnDrag:!K&&ae,defaultViewport:D,translateExtent:I,minZoom:B,maxZoom:U,zoomActivationKeyCode:v,preventScrolling:H,noWheelClassName:V,noPanClassName:Z,onViewportChange:$,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:se,children:f.jsxs(KGn,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ae,autoPanOnSelection:M,isSelecting:!!G,selectionMode:_,selectionKeyPressed:K,paneClickDistance:o,selectionOnDrag:se,children:[e,F&&f.jsx(cVn,{onSelectionContextMenu:Q,noPanClassName:Z,disableKeyboardA11y:Y})]})})}OU.displayName="FlowRenderer";const uVn=T.memo(OU),_Vn=e=>n=>e?EC(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function fVn(e){return Ln(T.useCallback(_Vn(e),[e]),zr)}const dVn=e=>e.updateNodeInternals;function hVn(){const e=Ln(dVn),[n]=T.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return T.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function pVn({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Ar(),i=T.useRef(null),a=T.useRef(null),o=T.useRef(e.sourcePosition),c=T.useRef(e.targetPosition),u=T.useRef(n),h=t&&!!e.internals.handleBounds;return T.useEffect(()=>{i.current&&!e.hidden&&(!h||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[h,e.hidden]),T.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),T.useEffect(()=>{if(i.current){const _=u.current!==n,p=o.current!==e.sourcePosition,m=c.current!==e.targetPosition;(_||p||m)&&(u.current=n,o.current=e.sourcePosition,c.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function mVn({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:c,nodesConnectable:u,nodesFocusable:h,resizeObserver:_,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:w,rfId:k,nodeTypes:v,nodeClickDistance:b,onError:x}){const{node:y,internals:C,isParent:N}=Ln(G=>{const oe=G.nodeLookup.get(e),ce=G.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:ce}},zr);let z=y.type||"default",A=(v==null?void 0:v[z])||FM[z];A===void 0&&(x==null||x("003",bo.error003(z)),z="default",A=(v==null?void 0:v.default)||FM.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||c&&typeof y.selectable>"u"),D=!!(y.connectable||u&&typeof y.connectable>"u"),I=!!(y.focusable||h&&typeof y.focusable>"u"),B=Ar(),U=nU(y),H=pVn({node:y,nodeType:z,hasDimensions:U,resizeObserver:_}),Q=AU({nodeRef:H,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),V=TU();if(y.hidden)return null;const Z=yl(y),Y=aVn(y),$=M||j||n||t||r||s,L=t?G=>t(G,{...C.userNode}):void 0,F=r?G=>r(G,{...C.userNode}):void 0,q=s?G=>s(G,{...C.userNode}):void 0,K=i?G=>i(G,{...C.userNode}):void 0,ne=a?G=>a(G,{...C.userNode}):void 0,ae=G=>{const{selectNodesOnDrag:oe,nodeDragThreshold:ce}=B.getState();M&&(!oe||!j||ce>0)&&gk({id:e,store:B,nodeRef:H}),n&&n(G,{...C.userNode})},ue=G=>{if(!(iU(G.nativeEvent)||w)){if(Vq.includes(G.key)&&M){const oe=G.key==="Escape";gk({id:e,store:B,unselect:oe,nodeRef:H})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(yb,G.key)){G.preventDefault();const{ariaLabelConfig:oe}=B.getState();B.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:yb[G.key],factor:G.shiftKey?4:1})}}},se=()=>{var Le;if(w||!((Le=H.current)!=null&&Le.matches(":focus-visible")))return;const{transform:G,width:oe,height:ce,autoPanOnNodeFocus:he,setCenter:be}=B.getState();if(!he)return;EC(new Map([[e,y]]),{x:0,y:0,width:oe,height:ce},G,!0).length>0||be(y.position.x+Z.width/2,y.position.y+Z.height/2,{zoom:G[2]})};return f.jsx("div",{className:ms(["react-flow__node",`react-flow__node-${z}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:N,draggable:j,dragging:Q}]),ref:H,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:U?"visible":"hidden",...y.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:q,onContextMenu:K,onClick:ae,onDoubleClick:ne,onKeyDown:I?ue:void 0,tabIndex:I?0:void 0,onFocus:I?se:void 0,role:y.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${SU}-${k}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(QGn,{value:e,children:f.jsx(A,{id:e,data:y.data,type:z,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:D,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Q,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...Z})})})}var gVn=T.memo(mVn);const vVn=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function DU(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=Ln(vVn,zr),a=fVn(e.onlyRenderVisibleElements),o=hVn();return f.jsx("div",{className:"react-flow__nodes",style:Ky,children:a.map(c=>f.jsx(gVn,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}DU.displayName="NodeRenderer";const bVn=T.memo(DU);function yVn(e){return Ln(T.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&vUn({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),zr)}const xVn=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},wVn=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},qM={[gb.Arrow]:xVn,[gb.ArrowClosed]:wVn};function kVn(e){const n=Ar();return T.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(qM,e)?qM[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",bo.error009(e)),null)},[e])}const SVn=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const c=kVn(n);return c?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(c,{color:t,strokeWidth:a})}):null},LU=({defaultColor:e,rfId:n})=>{const t=Ln(i=>i.edges),r=Ln(i=>i.defaultEdgeOptions),s=T.useMemo(()=>EUn(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(SVn,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};LU.displayName="MarkerDefinitions";var CVn=T.memo(LU);function IU({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:c,className:u,...h}){const[_,p]=T.useState({x:1,y:0,width:0,height:0}),m=ms(["react-flow__edge-textwrapper",u]),w=T.useRef(null);return T.useEffect(()=>{if(w.current){const k=w.current.getBBox();p({x:k.x,y:k.y,width:k.width,height:k.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-_.width/2} ${n-_.height/2})`,className:m,visibility:_.width?"visible":"hidden",...h,children:[s&&f.jsx("rect",{width:_.width+2*a[0],x:-a[0],y:-a[1],height:_.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:_.height/2,dy:"0.3em",ref:w,style:r,children:t}),c]}):null}IU.displayName="EdgeText";const EVn=T.memo(IU);function Wy({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:u=20,...h}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...h,d:e,fill:"none",className:ms(["react-flow__edge-path",h.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&fo(n)&&fo(t)?f.jsx(EVn,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function UM({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Rt.Left||e===Rt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function $U({sourceX:e,sourceY:n,sourcePosition:t=Rt.Bottom,targetX:r,targetY:s,targetPosition:i=Rt.Top}){const[a,o]=UM({pos:t,x1:e,y1:n,x2:r,y2:s}),[c,u]=UM({pos:i,x1:r,y1:s,x2:e,y2:n}),[h,_,p,m]=oU({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:c,targetControlY:u});return[`M${e},${n} C${a},${o} ${c},${u} ${r},${s}`,h,_,p,m]}function BU(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:b})=>{const[x,y,C]=$U({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),N=e.isInternal?void 0:n;return f.jsx(Wy,{id:N,path:x,labelX:y,labelY:C,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:b})})}const NVn=BU({isInternal:!1}),PU=BU({isInternal:!0});NVn.displayName="SimpleBezierEdge";PU.displayName="SimpleBezierEdgeInternal";function FU(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,sourcePosition:m=Rt.Bottom,targetPosition:w=Rt.Top,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:x})=>{const[y,C,N]=dk({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:w,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),z=e.isInternal?void 0:n;return f.jsx(Wy,{id:z,path:y,labelX:C,labelY:N,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:k,markerStart:v,interactionWidth:x})})}const HU=FU({isInternal:!1}),qU=FU({isInternal:!0});HU.displayName="SmoothStepEdge";qU.displayName="SmoothStepEdgeInternal";function UU(e){return T.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(HU,{...t,id:r,pathOptions:T.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const zVn=UU({isInternal:!1}),GU=UU({isInternal:!0});zVn.displayName="StepEdge";GU.displayName="StepEdgeInternal";function VU(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:m,markerStart:w,interactionWidth:k})=>{const[v,b,x]=uU({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(Wy,{id:y,path:v,labelX:b,labelY:x,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:_,style:p,markerEnd:m,markerStart:w,interactionWidth:k})})}const jVn=VU({isInternal:!1}),KU=VU({isInternal:!0});jVn.displayName="StraightEdge";KU.displayName="StraightEdgeInternal";function WU(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Rt.Bottom,targetPosition:o=Rt.Top,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:x})=>{const[y,C,N]=cU({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),z=e.isInternal?void 0:n;return f.jsx(Wy,{id:z,path:y,labelX:C,labelY:N,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:_,labelBgPadding:p,labelBgBorderRadius:m,style:w,markerEnd:k,markerStart:v,interactionWidth:x})})}const AVn=WU({isInternal:!1}),QU=WU({isInternal:!0});AVn.displayName="BezierEdge";QU.displayName="BezierEdgeInternal";const GM={default:QU,straight:KU,step:GU,smoothstep:qU,simplebezier:PU},VM={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},TVn=(e,n,t)=>t===Rt.Left?e-n:t===Rt.Right?e+n:e,RVn=(e,n,t)=>t===Rt.Top?e-n:t===Rt.Bottom?e+n:e,KM="react-flow__edgeupdater";function WM({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:ms([KM,`${KM}-${o}`]),cx:TVn(n,r,e),cy:RVn(t,r,e),r,stroke:"transparent",fill:"transparent"})}function MVn({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:c,onReconnect:u,onReconnectStart:h,onReconnectEnd:_,setReconnecting:p,setUpdateHover:m}){const w=Ar(),k=(C,N)=>{if(C.button!==0)return;const{autoPanOnConnect:z,domNode:A,connectionMode:j,connectionRadius:M,lib:D,onConnectStart:I,cancelConnection:B,nodeLookup:U,rfId:H,panBy:Q,updateConnection:V}=w.getState(),Z=N.type==="target",Y=(F,q)=>{p(!1),_==null||_(F,t,N.type,q)},$=F=>u==null?void 0:u(t,F),L=(F,q)=>{p(!0),h==null||h(C,t,N.type),I==null||I(F,q)};mk.onPointerDown(C.nativeEvent,{autoPanOnConnect:z,connectionMode:j,connectionRadius:M,domNode:A,handleId:N.id,nodeId:N.nodeId,nodeLookup:U,isTarget:Z,edgeUpdaterType:N.type,lib:D,flowId:H,cancelConnection:B,panBy:Q,isValidConnection:(...F)=>{var q,K;return((K=(q=w.getState()).isValidConnection)==null?void 0:K.call(q,...F))??!0},onConnect:$,onConnectStart:L,onConnectEnd:(...F)=>{var q,K;return(K=(q=w.getState()).onConnectEnd)==null?void 0:K.call(q,...F)},onReconnectEnd:Y,updateConnection:V,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>k(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>k(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),x=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(WM,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:x,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(WM,{position:c,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:x,onMouseOut:y,type:"target"})]})}function OVn({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,reconnectRadius:h,onReconnect:_,onReconnectStart:p,onReconnectEnd:m,rfId:w,edgeTypes:k,noPanClassName:v,onError:b,disableKeyboardA11y:x}){let y=Ln(be=>be.edgeLookup.get(e));const C=Ln(be=>be.defaultEdgeOptions);y=C?{...C,...y}:y;let N=y.type||"default",z=(k==null?void 0:k[N])||GM[N];z===void 0&&(b==null||b("011",bo.error011(N)),N="default",z=(k==null?void 0:k.default)||GM.default);const A=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof _<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),D=T.useRef(null),[I,B]=T.useState(!1),[U,H]=T.useState(!1),Q=Ar(),{zIndex:V=y.zIndex,sourceX:Z,sourceY:Y,targetX:$,targetY:L,sourcePosition:F,targetPosition:q}=Ln(T.useCallback(be=>{const Re=be.nodeLookup.get(y.source),Le=be.nodeLookup.get(y.target);if(!Re||!Le)return VM;const Ke=CUn({id:e,sourceNode:Re,targetNode:Le,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:be.connectionMode,onError:b}),Ne=gUn({selected:y.selected,zIndex:y.zIndex,sourceNode:Re,targetNode:Le,elevateOnSelect:be.elevateEdgesOnSelect,zIndexMode:be.zIndexMode});return{...Ke||VM,zIndex:Ne}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),zr),K=T.useMemo(()=>y.markerStart?`url('#${hk(y.markerStart,w)}')`:void 0,[y.markerStart,w]),ne=T.useMemo(()=>y.markerEnd?`url('#${hk(y.markerEnd,w)}')`:void 0,[y.markerEnd,w]);if(y.hidden||Z===null||Y===null||$===null||L===null)return null;const ae=be=>{var Ne;const{addSelectedEdges:Re,unselectNodesAndEdges:Le,multiSelectionActive:Ke}=Q.getState();M&&(Q.setState({nodesSelectionActive:!1}),y.selected&&Ke?(Le({nodes:[],edges:[y]}),(Ne=D.current)==null||Ne.blur()):Re([e])),s&&s(be,y)},ue=i?be=>{i(be,{...y})}:void 0,se=a?be=>{a(be,{...y})}:void 0,G=o?be=>{o(be,{...y})}:void 0,oe=c?be=>{c(be,{...y})}:void 0,ce=u?be=>{u(be,{...y})}:void 0,he=be=>{var Re;if(!x&&Vq.includes(be.key)&&M){const{unselectNodesAndEdges:Le,addSelectedEdges:Ke}=Q.getState();be.key==="Escape"?((Re=D.current)==null||Re.blur(),Le({edges:[y]})):Ke([e])}};return f.jsx("svg",{style:{zIndex:V},children:f.jsxs("g",{className:ms(["react-flow__edge",`react-flow__edge-${N}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:I,selectable:M}]),onClick:ae,onDoubleClick:ue,onContextMenu:se,onMouseEnter:G,onMouseMove:oe,onMouseLeave:ce,onKeyDown:A?he:void 0,tabIndex:A?0:void 0,role:y.ariaRole??(A?"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":A?`${CU}-${w}`:void 0,ref:D,...y.domAttributes,children:[!U&&f.jsx(z,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,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:Y,targetX:$,targetY:L,sourcePosition:F,targetPosition:q,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:K,markerEnd:ne,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(MVn,{edge:y,isReconnectable:j,reconnectRadius:h,onReconnect:_,onReconnectStart:p,onReconnectEnd:m,sourceX:Z,sourceY:Y,targetX:$,targetY:L,sourcePosition:F,targetPosition:q,setUpdateHover:B,setReconnecting:H})]})})}var DVn=T.memo(OVn);const LVn=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function XU({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:h,reconnectRadius:_,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:w,disableKeyboardA11y:k}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,onError:y}=Ln(LVn,zr),C=yVn(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(CVn,{defaultColor:e,rfId:t}),C.map(N=>f.jsx(DVn,{id:N,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,onClick:h,reconnectRadius:_,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:w,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:k},N))]})}XU.displayName="EdgeRenderer";const IVn=T.memo(XU),$Vn=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function BVn({children:e}){const n=Ln($Vn);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function PVn(e){const n=DC(),t=T.useRef(!1);T.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const FVn=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function HVn(e){const n=Ln(FVn),t=Ar();return T.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function qVn(e){return e.connection.inProgress?{...e.connection,to:qm(e.connection.to,e.transform)}:{...e.connection}}function UVn(e){return qVn}function GVn(e){const n=UVn();return Ln(n,zr)}const VVn=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function KVn({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:c}=Ln(VVn,zr);return!(i&&s&&c)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:ms(["react-flow__connection",Qq(o)]),children:f.jsx(YU,{style:n,type:t,CustomComponent:r,isValid:o})})})}const YU=({style:e,type:n=gu.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:c,to:u,toNode:h,toHandle:_,toPosition:p,pointer:m}=GVn();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:p,connectionStatus:Qq(r),toNode:h,toHandle:_,pointer:m});let w="";const k={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case gu.Bezier:[w]=cU(k);break;case gu.SimpleBezier:[w]=$U(k);break;case gu.Step:[w]=dk({...k,borderRadius:0});break;case gu.SmoothStep:[w]=dk(k);break;default:[w]=uU(k)}return f.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};YU.displayName="ConnectionLine";const WVn={};function QM(e=WVn){T.useRef(e),Ar(),T.useEffect(()=>{},[e])}function QVn(){Ar(),T.useRef(!1),T.useEffect(()=>{},[])}function ZU({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,onSelectionContextMenu:_,onSelectionStart:p,onSelectionEnd:m,connectionLineType:w,connectionLineStyle:k,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:x,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:N,panActivationKeyCode:z,zoomActivationKeyCode:A,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:D,defaultViewport:I,translateExtent:B,minZoom:U,maxZoom:H,preventScrolling:Q,defaultMarkerColor:V,zoomOnScroll:Z,zoomOnPinch:Y,panOnScroll:$,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:q,panOnDrag:K,autoPanOnSelection:ne,onPaneClick:ae,onPaneMouseEnter:ue,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneScroll:oe,onPaneContextMenu:ce,paneClickDistance:he,nodeClickDistance:be,onEdgeContextMenu:Re,onEdgeMouseEnter:Le,onEdgeMouseMove:Ke,onEdgeMouseLeave:Ne,reconnectRadius:xe,onReconnect:rt,onReconnectStart:Ze,onReconnectEnd:ot,noDragClassName:kt,noWheelClassName:qt,noPanClassName:dt,disableKeyboardA11y:pt,nodeExtent:Ie,rfId:pe,viewport:je,onViewportChange:He}){return QM(e),QM(n),QVn(),PVn(t),HVn(je),f.jsx(uVn,{onPaneClick:ae,onPaneMouseEnter:ue,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneContextMenu:ce,onPaneScroll:oe,paneClickDistance:he,deleteKeyCode:j,selectionKeyCode:x,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:N,panActivationKeyCode:z,zoomActivationKeyCode:A,elementsSelectable:D,zoomOnScroll:Z,zoomOnPinch:Y,zoomOnDoubleClick:q,panOnScroll:$,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:K,autoPanOnSelection:ne,defaultViewport:I,translateExtent:B,minZoom:U,maxZoom:H,onSelectionContextMenu:_,preventScrolling:Q,noDragClassName:kt,noWheelClassName:qt,noPanClassName:dt,disableKeyboardA11y:pt,onViewportChange:He,isControlledViewport:!!je,children:f.jsxs(BVn,{children:[f.jsx(IVn,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:rt,onReconnectStart:Ze,onReconnectEnd:ot,onlyRenderVisibleElements:M,onEdgeContextMenu:Re,onEdgeMouseEnter:Le,onEdgeMouseMove:Ke,onEdgeMouseLeave:Ne,reconnectRadius:xe,defaultMarkerColor:V,noPanClassName:dt,disableKeyboardA11y:pt,rfId:pe}),f.jsx(KVn,{style:k,type:w,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(bVn,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,nodeClickDistance:be,onlyRenderVisibleElements:M,noPanClassName:dt,noDragClassName:kt,disableKeyboardA11y:pt,nodeExtent:Ie,rfId:pe}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}ZU.displayName="GraphView";const XVn=T.memo(ZU),YVn=tU(),XM=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c=.5,maxZoom:u=2,nodeOrigin:h,nodeExtent:_,zIndexMode:p="basic"}={})=>{const m=new Map,w=new Map,k=new Map,v=new Map,b=r??n??[],x=t??e??[],y=h??[0,0],C=_??J0;dU(k,v,b);const{nodesInitialized:N}=pk(x,m,w,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let z=[0,0,1];if(a&&s&&i){const A=Fm(m,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:j,y:M,zoom:D}=zC(A,s,i,c,u,(o==null?void 0:o.padding)??.1);z=[j,M,D]}return{rfId:"1",width:s??0,height:i??0,transform:z,nodes:x,nodesInitialized:N,nodeLookup:m,parentLookup:w,edges:b,edgeLookup:v,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:J0,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Mh.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:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...Wq},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:YVn,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Kq,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},ZVn=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:_,zIndexMode:p})=>cGn((m,w)=>{async function k(){const{nodeLookup:v,panZoom:b,fitViewOptions:x,fitViewResolver:y,width:C,height:N,minZoom:z,maxZoom:A}=w();b&&(await uUn({nodes:v,width:C,height:N,panZoom:b,minZoom:z,maxZoom:A},x),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...XM({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:_,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:x,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:N,zIndexMode:z,nodesSelectionActive:A}=w(),{nodesInitialized:j,hasSelectedNodes:M}=pk(v,b,x,{nodeOrigin:y,nodeExtent:_,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:z}),D=A&&M;N&&j?(k(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:D})},setEdges:v=>{const{connectionLookup:b,edgeLookup:x}=w();dU(b,x,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:x}=w();x(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:x}=w();x(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:x,parentLookup:y,domNode:C,nodeOrigin:N,nodeExtent:z,debug:A,fitViewQueued:j,zIndexMode:M}=w(),{changes:D,updatedInternals:I}=MUn(v,x,y,C,N,z,M);I&&(jUn(x,y,{nodeOrigin:N,nodeExtent:z,zIndexMode:M}),j?(k(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(D==null?void 0:D.length)>0&&(A&&console.log("React Flow: trigger node changes",D),b==null||b(D)))},updateNodePositions:(v,b=!1)=>{const x=[];let y=[];const{nodeLookup:C,triggerNodeChanges:N,connection:z,updateConnection:A,onNodesChangeMiddlewareMap:j}=w();for(const[M,D]of v){const I=C.get(M),B=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(D!=null&&D.position)),U={id:M,type:"position",position:B?{x:Math.max(0,D.position.x),y:Math.max(0,D.position.y)}:D.position,dragging:b};if(I&&z.inProgress&&z.fromNode.id===I.id){const H=wf(I,z.fromHandle,Rt.Left,!0);A({...z,from:H})}B&&I.parentId&&x.push({id:M,parentId:I.parentId,rect:{...D.internals.positionAbsolute,width:D.measured.width??0,height:D.measured.height??0}}),y.push(U)}if(x.length>0){const{parentLookup:M,nodeOrigin:D}=w(),I=OC(x,C,M,D);y.push(...I)}for(const M of j.values())y=M(y);N(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:x,nodes:y,hasDefaultNodes:C,debug:N}=w();if(v!=null&&v.length){if(C){const z=jGn(v,y);x(z)}N&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:x,edges:y,hasDefaultEdges:C,debug:N}=w();if(v!=null&&v.length){if(C){const z=AGn(v,y);x(z)}N&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=w();if(b){const z=v.map(A=>T_(A,!0));C(z);return}C(Dd(y,new Set([...v]),!0)),N(Dd(x))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:N}=w();if(b){const z=v.map(A=>T_(A,!0));N(z);return}N(Dd(x,new Set([...v]))),C(Dd(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:x,nodes:y,nodeLookup:C,triggerNodeChanges:N,triggerEdgeChanges:z}=w(),A=v||y,j=b||x,M=[];for(const I of A){if(!I.selected)continue;const B=C.get(I.id);B&&(B.selected=!1),M.push(T_(I.id,!1))}const D=[];for(const I of j)I.selected&&D.push(T_(I.id,!1));N(M),z(D)},setMinZoom:v=>{const{panZoom:b,maxZoom:x}=w();b==null||b.setScaleExtent([v,x]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:x}=w();b==null||b.setScaleExtent([x,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=w().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:x,triggerEdgeChanges:y,elementsSelectable:C}=w();if(!C)return;const N=b.reduce((A,j)=>j.selected?[...A,T_(j.id,!1)]:A,[]),z=v.reduce((A,j)=>j.selected?[...A,T_(j.id,!1)]:A,[]);x(N),y(z)},setNodeExtent:v=>{const{nodes:b,nodeLookup:x,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:N,nodeExtent:z,zIndexMode:A}=w();v[0][0]===z[0][0]&&v[0][1]===z[0][1]&&v[1][0]===z[1][0]&&v[1][1]===z[1][1]||(pk(b,x,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:A}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:x,height:y,panZoom:C,translateExtent:N}=w();return OUn({delta:v,panZoom:C,transform:b,translateExtent:N,width:x,height:y})},setCenter:async(v,b,x)=>{const{width:y,height:C,maxZoom:N,panZoom:z}=w();if(!z)return!1;const A=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:N;return await z.setViewport({x:y/2-v*A,y:C/2-b*A,zoom:A},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{m({connection:{...Wq}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...XM()})}},Object.is);function JVn({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:c,fitView:u,nodeOrigin:h,nodeExtent:_,zIndexMode:p,children:m}){const[w]=T.useState(()=>ZVn({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:c,nodeOrigin:h,nodeExtent:_,zIndexMode:p}));return f.jsx(lGn,{value:w,children:f.jsx(LGn,{children:f.jsx(YGn,{children:m})})})}function eKn({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:c,minZoom:u,maxZoom:h,nodeOrigin:_,nodeExtent:p,zIndexMode:m}){return T.useContext(Gy)?f.jsx(f.Fragment,{children:e}):f.jsx(JVn,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:h,nodeOrigin:_,nodeExtent:p,zIndexMode:m,children:e})}const tKn={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function nKn({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:c,onInit:u,onMove:h,onMoveStart:_,onMoveEnd:p,onConnect:m,onConnectStart:w,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:z,onNodeDragStart:A,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:D,onEdgesDelete:I,onDelete:B,onSelectionChange:U,onSelectionDragStart:H,onSelectionDrag:Q,onSelectionDragStop:V,onSelectionContextMenu:Z,onSelectionStart:Y,onSelectionEnd:$,onBeforeDelete:L,connectionMode:F,connectionLineType:q=gu.Bezier,connectionLineStyle:K,connectionLineComponent:ne,connectionLineContainerStyle:ae,deleteKeyCode:ue="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:G=!1,selectionMode:oe=em.Full,panActivationKeyCode:ce="Space",multiSelectionKeyCode:he=nm()?"Meta":"Control",zoomActivationKeyCode:be=nm()?"Meta":"Control",snapToGrid:Re,snapGrid:Le,onlyRenderVisibleElements:Ke=!1,selectNodesOnDrag:Ne,nodesDraggable:xe,autoPanOnNodeFocus:rt,nodesConnectable:Ze,nodesFocusable:ot,nodeOrigin:kt=EU,edgesFocusable:qt,edgesReconnectable:dt,elementsSelectable:pt=!0,defaultViewport:Ie=wGn,minZoom:pe=.5,maxZoom:je=2,translateExtent:He=J0,preventScrolling:st=!0,nodeExtent:_t,defaultMarkerColor:Ct="#b1b1b7",zoomOnScroll:bt=!0,zoomOnPinch:Yt=!0,panOnScroll:un=!1,panOnScrollSpeed:Tt=.5,panOnScrollMode:ht=rf.Free,zoomOnDoubleClick:mt=!0,panOnDrag:_n=!0,onPaneClick:gs,onPaneMouseEnter:br,onPaneMouseMove:Gt,onPaneMouseLeave:Bn,onPaneScroll:_r,onPaneContextMenu:yr,paneClickDistance:Wr=1,nodeClickDistance:Nt=0,children:vn,onReconnect:fn,onReconnectStart:hn,onReconnectEnd:Ir,onEdgeContextMenu:bn,onEdgeDoubleClick:yn,onEdgeMouseEnter:Pn,onEdgeMouseMove:Et,onEdgeMouseLeave:Bt,reconnectRadius:In=10,onNodesChange:xr,onEdgesChange:fr,noDragClassName:Fn="nodrag",noWheelClassName:sr="nowheel",noPanClassName:Qr="nopan",fitView:On,fitViewOptions:We,connectOnClick:yt,attributionPosition:Jn,proOptions:pr,defaultEdgeOptions:pn,elevateNodesOnSelect:Tr=!0,elevateEdgesOnSelect:An=!1,disableKeyboardA11y:ii=!1,autoPanOnConnect:wr,autoPanOnNodeDrag:er,autoPanOnSelection:Va=!0,autoPanSpeed:_c,connectionRadius:$r,isValidConnection:ai,onError:xo,style:Ka,id:Pi,nodeDragThreshold:xl,connectionDragThreshold:Lt,viewport:Rs,onViewportChange:Br,width:Xr,height:ct,colorMode:Wt="light",debug:xi,onScroll:Fi,ariaLabelConfig:Hi,zIndexMode:Yr="basic",...Rr},wo){const wi=Pi||"1",Hs=EGn(Wt),oi=T.useCallback(Zr=>{Zr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Fi==null||Fi(Zr)},[Fi]);return f.jsx("div",{"data-testid":"rf__wrapper",...Rr,onScroll:oi,style:{...Ka,...tKn},ref:wo,className:ms(["react-flow",s,Hs]),id:Pi,role:"application",children:f.jsxs(eKn,{nodes:e,edges:n,width:Xr,height:ct,fitView:On,fitViewOptions:We,minZoom:pe,maxZoom:je,nodeOrigin:kt,nodeExtent:_t,zIndexMode:Yr,children:[f.jsx(CGn,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:w,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:xe,autoPanOnNodeFocus:rt,nodesConnectable:Ze,nodesFocusable:ot,edgesFocusable:qt,edgesReconnectable:dt,elementsSelectable:pt,elevateNodesOnSelect:Tr,elevateEdgesOnSelect:An,minZoom:pe,maxZoom:je,nodeExtent:_t,onNodesChange:xr,onEdgesChange:fr,snapToGrid:Re,snapGrid:Le,connectionMode:F,translateExtent:He,connectOnClick:yt,defaultEdgeOptions:pn,fitView:On,fitViewOptions:We,onNodesDelete:D,onEdgesDelete:I,onDelete:B,onNodeDragStart:A,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Q,onSelectionDragStart:H,onSelectionDragStop:V,onMove:h,onMoveStart:_,onMoveEnd:p,noPanClassName:Qr,nodeOrigin:kt,rfId:wi,autoPanOnConnect:wr,autoPanOnNodeDrag:er,autoPanSpeed:_c,onError:xo,connectionRadius:$r,isValidConnection:ai,selectNodesOnDrag:Ne,nodeDragThreshold:xl,connectionDragThreshold:Lt,onBeforeDelete:L,debug:xi,ariaLabelConfig:Hi,zIndexMode:Yr}),f.jsx(XVn,{onInit:u,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:N,onNodeDoubleClick:z,nodeTypes:i,edgeTypes:a,connectionLineType:q,connectionLineStyle:K,connectionLineComponent:ne,connectionLineContainerStyle:ae,selectionKeyCode:se,selectionOnDrag:G,selectionMode:oe,deleteKeyCode:ue,multiSelectionKeyCode:he,panActivationKeyCode:ce,zoomActivationKeyCode:be,onlyRenderVisibleElements:Ke,defaultViewport:Ie,translateExtent:He,minZoom:pe,maxZoom:je,preventScrolling:st,zoomOnScroll:bt,zoomOnPinch:Yt,zoomOnDoubleClick:mt,panOnScroll:un,panOnScrollSpeed:Tt,panOnScrollMode:ht,panOnDrag:_n,autoPanOnSelection:Va,onPaneClick:gs,onPaneMouseEnter:br,onPaneMouseMove:Gt,onPaneMouseLeave:Bn,onPaneScroll:_r,onPaneContextMenu:yr,paneClickDistance:Wr,nodeClickDistance:Nt,onSelectionContextMenu:Z,onSelectionStart:Y,onSelectionEnd:$,onReconnect:fn,onReconnectStart:hn,onReconnectEnd:Ir,onEdgeContextMenu:bn,onEdgeDoubleClick:yn,onEdgeMouseEnter:Pn,onEdgeMouseMove:Et,onEdgeMouseLeave:Bt,reconnectRadius:In,defaultMarkerColor:Ct,noDragClassName:Fn,noWheelClassName:sr,noPanClassName:Qr,rfId:wi,disableKeyboardA11y:ii,nodeExtent:_t,viewport:Rs,onViewportChange:Br}),f.jsx(xGn,{onSelectionChange:U}),vn,f.jsx(mGn,{proOptions:pr,position:Jn}),f.jsx(pGn,{rfId:wi,disableKeyboardA11y:ii})]})})}var rKn=zU(nKn);function sKn({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ms(["react-flow__background-pattern",t,r])})}function iKn({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:ms(["react-flow__background-pattern","dots",n])})}var ul;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ul||(ul={}));const aKn={[ul.Dots]:1,[ul.Lines]:1,[ul.Cross]:6},oKn=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function JU({id:e,variant:n=ul.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:c,className:u,patternClassName:h}){const _=T.useRef(null),{transform:p,patternId:m}=Ln(oKn,zr),w=r||aKn[n],k=n===ul.Dots,v=n===ul.Cross,b=Array.isArray(t)?t:[t,t],x=[b[0]*p[2]||1,b[1]*p[2]||1],y=w*p[2],C=Array.isArray(i)?i:[i,i],N=v?[y,y]:x,z=[C[0]*p[2]||1+N[0]/2,C[1]*p[2]||1+N[1]/2],A=`${m}${e||""}`;return f.jsxs("svg",{className:ms(["react-flow__background",u]),style:{...c,...Ky,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:_,"data-testid":"rf__background",children:[f.jsx("pattern",{id:A,x:p[0]%x[0],y:p[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${z[0]},-${z[1]})`,children:k?f.jsx(iKn,{radius:y/2,className:h}):f.jsx(sKn,{dimensions:N,lineWidth:s,variant:n,className:h})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}JU.displayName="Background";const cKn=T.memo(JU);function lKn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function uKn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function _Kn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.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 fKn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 dKn(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 I1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:ms(["react-flow__controls-button",n]),...t,children:e})}const hKn=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function eG({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:c,className:u,children:h,position:_="bottom-left",orientation:p="vertical","aria-label":m}){const w=Ar(),{isInteractive:k,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:x}=Ln(hKn,zr),{zoomIn:y,zoomOut:C,fitView:N}=DC(),z=()=>{y(),i==null||i()},A=()=>{C(),a==null||a()},j=()=>{N(s),o==null||o()},M=()=>{w.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),c==null||c(!k)},D=p==="horizontal"?"horizontal":"vertical";return f.jsxs(Vy,{className:ms(["react-flow__controls",D,u]),position:_,style:e,"data-testid":"rf__controls","aria-label":m??x["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(I1,{onClick:z,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(lKn,{})}),f.jsx(I1,{onClick:A,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(uKn,{})})]}),t&&f.jsx(I1,{className:"react-flow__controls-fitview",onClick:j,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:f.jsx(_Kn,{})}),r&&f.jsx(I1,{className:"react-flow__controls-interactive",onClick:M,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:k?f.jsx(dKn,{}):f.jsx(fKn,{})}),h]})}eG.displayName="Controls";T.memo(eG);function pKn({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:c,className:u,borderRadius:h,shapeRendering:_,selected:p,onClick:m}){const{background:w,backgroundColor:k}=i||{},v=a||w||k;return f.jsx("rect",{className:ms(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:h,ry:h,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:c},shapeRendering:_,onClick:m?b=>m(b,e):void 0})}const mKn=T.memo(pKn),gKn=e=>e.nodes.map(n=>n.id),T4=e=>e instanceof Function?e:()=>e;function vKn({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=mKn,onClick:a}){const o=Ln(gKn,zr),c=T4(n),u=T4(e),h=T4(t),_=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(yKn,{id:p,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:_},p))})}function bKn({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:c}){const{node:u,x:h,y:_,width:p,height:m}=Ln(w=>{const k=w.nodeLookup.get(e);if(!k)return{node:void 0,x:0,y:0,width:0,height:0};const v=k.internals.userNode,{x:b,y:x}=k.internals.positionAbsolute,{width:y,height:C}=yl(v);return{node:v,x:b,y:x,width:y,height:C}},zr);return!u||u.hidden||!nU(u)?null:f.jsx(o,{x:h,y:_,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:c,id:u.id})}const yKn=T.memo(bKn);var xKn=T.memo(vKn);const wKn=200,kKn=150,SKn=e=>!e.hidden,CKn=e=>{const n={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:n,boundingRect:e.nodeLookup.size>0?Jq(Fm(e.nodeLookup,{filter:SKn}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},EKn="react-flow__minimap-desc";function tG({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:c,maskColor:u,maskStrokeColor:h,maskStrokeWidth:_,position:p="bottom-right",onClick:m,onNodeClick:w,pannable:k=!1,zoomable:v=!1,ariaLabel:b,inversePan:x,zoomStep:y=1,offsetScale:C=5}){const N=Ar(),z=T.useRef(null),{boundingRect:A,viewBB:j,rfId:M,panZoom:D,translateExtent:I,flowWidth:B,flowHeight:U,ariaLabelConfig:H}=Ln(CKn,zr),Q=(e==null?void 0:e.width)??wKn,V=(e==null?void 0:e.height)??kKn,Z=A.width/Q,Y=A.height/V,$=Math.max(Z,Y),L=$*Q,F=$*V,q=C*$,K=A.x-(L-A.width)/2-q,ne=A.y-(F-A.height)/2-q,ae=L+q*2,ue=F+q*2,se=`${EKn}-${M}`,G=T.useRef(0),oe=T.useRef();G.current=$,T.useEffect(()=>{if(z.current&&D)return oe.current=qUn({domNode:z.current,panZoom:D,getTransform:()=>N.getState().transform,getViewScale:()=>G.current}),()=>{var Re;(Re=oe.current)==null||Re.destroy()}},[D]),T.useEffect(()=>{var Re;(Re=oe.current)==null||Re.update({translateExtent:I,width:B,height:U,inversePan:x,pannable:k,zoomStep:y,zoomable:v})},[k,v,x,y,I,B,U]);const ce=m?Re=>{var Ne;const[Le,Ke]=((Ne=oe.current)==null?void 0:Ne.pointer(Re))||[0,0];m(Re,{x:Le,y:Ke})}:void 0,he=w?T.useCallback((Re,Le)=>{const Ke=N.getState().nodeLookup.get(Le).internals.userNode;w(Re,Ke)},[]):void 0,be=b??H["minimap.ariaLabel"];return f.jsx(Vy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof _=="number"?_*$:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:ms(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Q,height:V,viewBox:`${K} ${ne} ${ae} ${ue}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:z,onClick:ce,children:[be&&f.jsx("title",{id:se,children:be}),f.jsx(xKn,{onClick:he,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${K-q},${ne-q}h${ae+q*2}v${ue+q*2}h${-ae-q*2}z M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}tG.displayName="MiniMap";T.memo(tG);const NKn=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,zKn={[Lh.Line]:"right",[Lh.Handle]:"bottom-right"};function jKn({nodeId:e,position:n,variant:t=Lh.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:_=!1,resizeDirection:p,autoScale:m=!0,shouldResize:w,onResizeStart:k,onResize:v,onResizeEnd:b}){const x=RU(),y=typeof e=="string"?e:x,C=Ar(),N=T.useRef(null),z=t===Lh.Handle,A=Ln(T.useCallback(NKn(z&&m),[z,m]),zr),j=T.useRef(null),M=n??zKn[t];T.useEffect(()=>{if(!(!N.current||!y))return j.current||(j.current=nGn({domNode:N.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:I,transform:B,snapGrid:U,snapToGrid:H,nodeOrigin:Q,domNode:V}=C.getState();return{nodeLookup:I,transform:B,snapGrid:U,snapToGrid:H,nodeOrigin:Q,paneDomNode:V}},onChange:(I,B)=>{const{triggerNodeChanges:U,nodeLookup:H,parentLookup:Q,nodeOrigin:V}=C.getState(),Z=[],Y={x:I.x,y:I.y},$=H.get(y);if($&&$.expandParent&&$.parentId){const L=$.origin??V,F=I.width??$.measured.width??0,q=I.height??$.measured.height??0,K={id:$.id,parentId:$.parentId,rect:{width:F,height:q,...rU({x:I.x??$.position.x,y:I.y??$.position.y},{width:F,height:q},$.parentId,H,L)}},ne=OC([K],H,Q,V);Z.push(...ne),Y.x=I.x?Math.max(L[0]*F,I.x):void 0,Y.y=I.y?Math.max(L[1]*q,I.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const L={id:y,type:"position",position:{...Y}};Z.push(L)}if(I.width!==void 0&&I.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};Z.push(F)}for(const L of B){const F={...L,type:"position"};Z.push(F)}U(Z)},onEnd:({width:I,height:B})=>{const U={id:y,type:"dimensions",resizing:!1,dimensions:{width:I,height:B}};C.getState().triggerNodeChanges([U])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:c,maxWidth:u,maxHeight:h},keepAspectRatio:_,resizeDirection:p,onResizeStart:k,onResize:v,onResizeEnd:b,shouldResize:w}),()=>{var I;(I=j.current)==null||I.destroy()}},[M,o,c,u,h,_,k,v,b,w]);const D=M.split("-");return f.jsx("div",{className:ms(["react-flow__resize-control","nodrag",...D,t,r]),ref:N,style:{...s,scale:A,...a&&{[z?"backgroundColor":"borderColor"]:a}},children:i})}T.memo(jKn);function AKn(){const[e,n]=T.useState(0),[t,r]=T.useState(0);return{ref:T.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),c=new MutationObserver(a);return o.observe(i),c.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const $1=8;function TKn(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=T.useState({viewWidth:0,viewHeight:0});T.useEffect(()=>{function h(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",h),h(),()=>window.removeEventListener("resize",h)},[]);let o=0,c=0,u=0;if(e){const{distance:h}=e;switch(e.anchor){case"left":o=e.x-t-h,c=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+h,c=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,c=e.y+e.height+h;break;case"above":o=e.x+e.width/2-t/2,c=e.y-r-h;break}const _=o,p=c;o=Math.min(Math.max(o,$1),i-t-$1),c=Math.min(Math.max(c,$1),s-r-$1),u=e.anchor==="left"||e.anchor==="right"?p-c:_-o}return{x:o,y:c,arrowAdjustment:u}}const R4=380,M4=12,RKn=350,MKn=150,vk=new EventTarget;function OKn(){vk.dispatchEvent(new Event("move"))}function DKn(e,n){const[t,r]=T.useState(null),s=T.useRef(void 0),i=T.useRef(void 0);T.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return vk.addEventListener("move",u),()=>{vk.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),T.useEffect(()=>{r(u=>{var _;if(!u)return u;const h=((_=e.current)==null?void 0:_.getBoundingClientRect())??null;return h&&u.x===h.x&&u.y===h.y&&u.width===h.width&&u.height===h.height?u:h})},[e,n]);const a=T.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},RKn)},[e]),o=T.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),MKn)},[]),c=T.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:c}}function LKn(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(E(),t)}function IKn({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:c}){const u=AKn(),h=s.right+M4+R4<=window.innerWidth,_=s.x-M4-R4>=0,p=h?"right":_?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:w}=TKn({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:M4},u),k=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ut({...bCn(k??""),enabled:!!k,subscribed:!!k}),b=T.useMemo(()=>{if(!v)return null;const I=v;let B=I.diff;if(I.truncated){const V=B.lastIndexOf(` diff --git `);B=V!==-1?B.slice(0,V+1):B.slice(0,B.lastIndexOf(` -`)+1)}let U=[];try{U=B.trim()?J3(B):[]}catch{return null}if(I.truncated&&U.every(V=>V.hunks.length===0))return null;let H=0,Q=0;for(const V of U){const Z=uy(V);H+=Z.additions,Q+=Z.deletions}return{fileCount:U.length,additions:H,deletions:Q,truncated:I.truncated}},[v]),x={done:0,failed:0,cancelled:0,live:0};for(const I of n)I.status==="done"?x.done+=1:I.status==="failed"?x.failed+=1:I.status==="cancelled"?x.cancelled+=1:x.live+=1;const y=t?T0((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,N=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,z=T.useRef(null),[A,j]=T.useState(!1),[M,D]=T.useState(!1);return T.useEffect(()=>{j(!1)},[N]),T.useEffect(()=>{const I=z.current;I&&D(I.scrollHeight>I.clientHeight+1)},[N,A]),ri.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.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-border-hover-strong [&_.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-sm [&_.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]: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-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:R4,left:m,top:w,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:c,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx(cl,{status:t?aa(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Vr(i),children:[f.jsx(vo,{size:13}),tDe()]}),f.jsxs("button",{type:"button",...Vr(a),children:[f.jsx($b,{size:13}),OOe()]})]}),N&&f.jsx("div",{className:`hc-body${A?" expanded":""}`,ref:z,children:N}),N&&(M||A)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(I=>!I),children:A?MD():Dje()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(E(),{style:"short"}).format([n.length===1?hYe():xYe({count:Xt(n.length)}),...x.done>0?[EXe({count:Xt(x.done)})]:[],...x.failed>0?[MXe({count:Xt(x.failed)})]:[],...x.cancelled>0?[bXe({count:Xt(x.cancelled)})]:[],...x.live>0?[eYe({count:Xt(x.live)})]:[]])}),t&&oS(t.backend)&&f.jsx(RS,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:go(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(Nm,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[WOe()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?zX({parent:Ce(r??"parent")}):xX({parent:Ce(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?oYe():b.truncated?KXe({count:Xt(b.fileCount)}):PXe({count:Xt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[FOe()," ",LKn(e.createdAt)]})]})]}),document.body)}const YM=["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-sm [&_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(" "),$Kn=264,BKn=132,uv=44,PKn=72,FKn=148,HKn=44,qKn=160,UKn=64;function GKn(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function VKn(e,n){const t=new Map,r=o=>{const c=t.get(o)??1+o.children.reduce((u,h)=>u+r(h),0);return t.set(o,c),c},s=new Map,i=o=>{const c=s.get(o)??(n(o)||o.children.some(i));return s.set(o,c),c};function a(o){if(n(o)){const h=[];let _=0;for(const p of o.children)i(p)?h.push(...a(p)):_+=r(p);return _>0&&h.push({kind:"elided",id:`el-${o.exp.id}`,count:_,children:[]}),[{kind:"exp",exp:o.exp,children:h}]}if(!i(o))return[];let c=0;const u=[];return(function h(_){c+=1;for(const p of _.children)n(p)?u.push(...a(p)):i(p)?h(p):c+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:c,children:u}]}return e.flatMap(a)}function KKn(e){function n(t){if(t.kind!=="exp"||!t.exp.archived)return{...t,children:t.children.map(n)};let r=0;const s=[];function i(a){r+=1;for(const o of a.children)o.kind==="exp"&&o.exp.archived?i(o):s.push(n(o))}return i(t),{kind:"archived",id:`ar-${t.exp.id}`,rootId:t.exp.id,count:r,children:s}}return e.map(n)}function bk(e){return e.kind==="exp"?$Kn:e.kind==="archived"?qKn:FKn}function WKn(e){return e.kind==="exp"?BKn:HKn}function B1(e){return e.kind==="exp"?e.exp.id:e.id}function _v(e){if(e.children.length===0)return bk(e);const n=e.children.reduce((t,r)=>t+_v(r),0)+uv*(e.children.length-1);return Math.max(bk(e),n)}function QKn(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const XKn=T.memo(function({data:n}){Vu();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:c,onOpenView:u,onOpenCode:h,onArchive:_,actions:p}=n,m=r?aa(r):void 0,w=m==="running"||m==="starting"||m==="cancelling",k=i?r0n():w?umn():Wc(),v=s.slice(-8),b=T.useRef(null),x=DKn(b,n);return f.jsxs("div",{ref:b,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.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-start [&_.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-xs [&_.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]: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-xs [&_.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-sm [&_.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]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${w?"live":""} ${t.archived?"opacity-80":""}`,onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,children:[f.jsx(tc,{type:"target",position:Rt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Vr(y=>u(t.id,"overview",y)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:t.archived?OL():k}),f.jsx(cl,{status:m??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:vgn()}),v.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:v.map(y=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${QKn(aa(y))}`,title:h6(aa(y))},y.id))}):f.jsx("span",{children:sgn()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:go(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:y=>y.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:_gn(),...Vr(y=>u(t.id,"terminal",y)),children:[f.jsx(vo,{size:13}),LL()]}),f.jsxs("button",{className:"node-action",title:vD({branch:Ce(t.branchName)}),...Vr(y=>h(t.id,t.branchName,"files",y)),children:[f.jsx($b,{size:13}),Tmn()]}),o&&c&&f.jsx("a",{className:"node-action",title:Sv({name:Ce(t.branchName)}),"aria-label":Sv({name:Ce(t.branchName)}),href:Mb(o,c,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:y=>y.stopPropagation(),children:f.jsx(Ub,{size:13})}),f.jsx(pq,{id:t.id,name:t.slug,actions:p,onArchive:_,compact:!0})]}),f.jsx(tc,{type:"source",position:Rt.Bottom}),x.rect&&f.jsx(IKn,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:x.rect,onOpenLogs:s.length>0?y=>u(t.id,"terminal",y):void 0,onOpenCode:y=>h(t.id,t.branchName,"files",y),onMouseEnter:x.keepOpen,onMouseLeave:x.onMouseLeave})]})}),YKn=T.memo(function({data:n}){Vu();const{rootId:t,count:r,onRestoreRegion:s}=n,i=T.useRef(null),a=ga(i),[o,c]=T.useState({top:0,left:0}),u=()=>{if(!a.open&&i.current){const h=i.current.getBoundingClientRect(),_=window.innerHeight-h.bottom>=44;c({top:_?h.bottom+4:Math.max(4,h.top-44),left:Math.max(4,Math.min(h.left,window.innerWidth-232))})}a.setOpen(h=>!h)};return f.jsxs("div",{className:"archived-node w-40 h-11",children:[f.jsx(tc,{type:"target",position:Rt.Top}),f.jsxs("button",{type:"button",ref:i,className:"nodrag w-full h-full flex items-center justify-center gap-2 px-3 border border-border rounded-full bg-background text-text text-sm font-medium whitespace-nowrap transition-[background-color,border-color] duration-120 ease-standard hover:bg-surface hover:border-text","aria-haspopup":"menu","aria-expanded":a.open,onClick:u,children:[f.jsx(Z3n,{size:15,className:"shrink-0 text-subtext","aria-hidden":"true"}),f.jsx("span",{children:Xpn({count:Xt(r)})})]}),f.jsx(tc,{type:"source",position:Rt.Bottom}),a.open&&ri.createPortal(f.jsx("div",{ref:a.ref,className:"option-menu fixed z-70 min-w-56 rounded-lg border border-border bg-background p-1.5 shadow-menu",style:o,children:f.jsx(Cn,{onClick:()=>{a.setOpen(!1),s(t)},children:r===1?DL():U0n({count:Xt(r)})})}),document.body)]})}),ZKn=T.memo(function({data:n}){Vu();const{count:t,onShowProjectScope:r}=n;return f.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-hover-faint text-muted text-sm font-medium text-start 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:Cgn(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(tc,{type:"target",position:Rt.Top}),f.jsx(Lb,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?A0n():m0n({count:Xt(t)}),f.jsx("span",{className:"elided-node-sub",children:k0n()})]}),f.jsx(tc,{type:"source",position:Rt.Bottom})]})}),JKn={exp:XKn,archived:YKn,elided:ZKn},nG={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},eWn={...nG.style,strokeDasharray:"4 4"};function tWn({experiments:e,archiveActions:n,showArchived:t,runs:r,project:s,onOpenView:i,onOpenCode:a,onArchive:o,agentSessionId:c,onShowProjectScope:u,onRestoreRegion:h,viewport:_,onViewportChange:p}){const{nodes:m,edges:w}=T.useMemo(()=>{const k=new Map;for(const j of r){const M=k.get(j.experimentId);M?M.push(j):k.set(j.experimentId,[j])}for(const j of k.values())j.sort((M,D)=>M.createdAt-D.createdAt);const v=[],b=[],x=j=>!c||j.exp.chatSessionId===c,y=VKn(GKn(e),x),C=t?y:KKn(y),N=new Map(e.map(j=>[j.id,j.slug]));function z(j,M,D){const I=M-bk(j)/2;if(j.kind==="exp"){const H=k.get(j.exp.id)??[];v.push({id:j.exp.id,type:"exp",position:{x:I,y:D},data:{exp:j.exp,latestRun:H[H.length-1]??null,runs:H,isBaseline:!j.exp.parentExperimentId,parentSlug:j.exp.parentExperimentId?N.get(j.exp.parentExperimentId)??null:null,githubOwner:s.githubEnabled?s.githubOwner:"",githubRepo:s.githubEnabled?s.githubRepo:"",onOpenView:i,onOpenCode:a,onArchive:o,actions:n.get(j.exp.id)}})}else j.kind==="archived"?v.push({id:j.id,type:"archived",position:{x:I,y:D},data:{rootId:j.rootId,count:j.count,onRestoreRegion:h}}):v.push({id:j.id,type:"elided",position:{x:I,y:D},data:{count:j.count,onShowProjectScope:u}});if(j.children.length===0)return;const B=j.children.reduce((H,Q)=>H+_v(Q),0)+uv*(j.children.length-1);let U=M-B/2;for(const H of j.children){const Q=_v(H),V=j.kind!=="exp"||H.kind!=="exp"||j.exp.archived||H.exp.archived;b.push({id:`e-${B1(j)}-${B1(H)}`,source:B1(j),target:B1(H),...V?{style:eWn}:{}}),z(H,U+Q/2,D+WKn(j)+(H.kind==="archived"?UKn:PKn)),U+=Q+uv}}let A=0;for(const j of C){const M=_v(j);z(j,A+M/2,0),A+=M+uv}return{nodes:v,edges:b}},[e,n,t,r,i,a,o,s.githubOwner,s.githubRepo,s.githubEnabled,c,u,h]);return e.length===0?f.jsxs("div",{className:YM,children:[f.jsx("p",{className:"empty-state-title",children:Ymn()}),f.jsx("p",{className:"empty-state-hint",children:Smn()})]}):m.length===0&&c?f.jsxs("div",{className:YM,children:[f.jsx("p",{className:"empty-state-title",children:Umn()}),f.jsx("p",{className:"empty-state-hint",children:gmn()})]}):f.jsx(rKn,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-archived.selectable]:cursor-pointer [&_.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:m,edges:w,nodeTypes:JKn,defaultEdgeOptions:nG,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:OKn,onMoveEnd:(k,v)=>{k&&p(v)},minZoom:.15,defaultViewport:_??void 0,fitView:_===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(cKn,{variant:ul.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},c??"project")}const e0=["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-sm [&_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(" ");function nWn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rWn(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),c=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/")||E6(i))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[w,k]=[m(i),m(p)];return w===k?"":w.startsWith(`${k}/`)?w.slice(k.length).replace(/^\/+/,""):null},h=i.startsWith("/")&&c?u(c):null,_=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(h!==null)return h?{path:h,source:"artifacts"}:null;if(_!==null)i=_;else{const p=s?nWn(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),w=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),k=m||w?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};w?(a=w[1],i=w[2]):k&&(i=k[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function sWn(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const iWn=10,ZM=1448,aWn=80,oWn=48;function JM(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function eO(e){const n=T.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function cWn({runtime:e,projectId:n,pane:t}){var Dn,rn,Sr;const r=dn({mutationFn:qyn}),s=vi(),i=uD({select:J=>J.location}),a=ff(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",c=T.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:c.current;(a==null?void 0:a.kind)==="task"&&(c.current=u);const h=t!==void 0,_=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=T.useState(null),[w,k]=T.useState(0),v=T.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==w)&&(v.current={href:i.href,jump:w,value:v.current.value+1});const b=T.useMemo(()=>{const J=t?oo(t):"experiments";return typeof J=="object"&&"path"in J&&J.line&&p!==v.current.value?{...J,lineScrollRequest:v.current.value}:J},[t,p,i.href,w]),x=ut(Fa(n)),y=T.useMemo(()=>{var J;return((J=x.data)==null?void 0:J.map(ge=>ge.id))??null},[x.data]),C=T.useRef(new Set),N=T.useRef(new Set),z=T.useRef({}),[A,j]=T.useState(0),M=T.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const D=T.useCallback((J,ge=!1)=>{const Ae=M.current;Ae.projectId&&s.navigate({href:Q1(Ae.projectId,Ae.activeSessionId,J),replace:ge})},[s]),I=T.useCallback(J=>{const ge=rl(J);D(ge.kind==="file"?{...ge,line:void 0}:ge)},[D]),B=T.useCallback(()=>D(void 0),[D]),U=T.useCallback(J=>{(t==null?void 0:t.kind)==="experiment"&&D({...t,runId:J??void 0})},[t,D]),H=T.useCallback(J=>{s.navigate({href:J?`/projects/${encodeURIComponent(J)}`:"/projects"})},[s]),Q=T.useCallback(J=>{var ge;if(n)if(J==="chat"){const Ae=c.current;s.navigate({href:Q1(n,Ae,(ge=Ru(ir.current,Ae??"new"))==null?void 0:ge.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${J==="skills"?"skills":`settings/${J}`}`})},[s,n]),V=Vu(),{status:Z}=u6(e.kind==="local"),Y=T.useMemo(()=>gh(),[n]),$=ut(Y),L=$.data??null,F=T.useCallback(J=>{is(Y.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[Y]),q=T.useMemo(()=>Cm(),[n]),K=ut(q),ne=K.data??null,ae=T.useCallback(J=>{is(q.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[q]),ue=T.useRef(void 0);ue.current=ne==null?void 0:ne.tourCompleted;const se=[!x.data&&x.error?SD():null,!$.data&&$.error?_0():null,!K.data&&K.error?d_e():null].filter(J=>J!==null),G=se.length?N_e({items:new Intl.ListFormat(V).format(se)}):null,oe=T.useRef(null),ce=ut(Dv(n)),he=ce.data??[],be=!ce.isPending,[Re,Le]=T.useState(!1),Ne=ut(zu(n)).data??[],xe=T.useRef(Ne);xe.current=Ne;const rt=T.useRef(new Map),Ze=T.useRef(new Set),ot=T.useRef(null),kt=T.useRef(!1),qt=T.useRef(new Map),dt=T.useRef(new Map),pt=T.useRef(0),Ie=T.useRef(he);Ie.current=he;const je=ut(yCn(n)).data??null,[He,st]=T.useState("table"),[_t,Ct]=T.useState(!1),[bt,Yt]=T.useState("project"),un=T.useRef(null),{open:Tt,setOpen:ht,ref:mt}=ga(un),[_n,gs]=T.useState(!1),br=he.every(J=>J.chatSessionId),Kt=u&&br?bt:"project",Bn=T.useMemo(()=>Kt!=="agent"?he:he.filter(J=>J.chatSessionId===u),[he,Kt,u]),_r=T.useMemo(()=>Bn.filter(J=>_t||!J.archived),[Bn,_t]),yr=T.useMemo(()=>SPn(he),[he]),Wr=T.useCallback(async(J,ge,Ae)=>{try{await sxn(J,ge,Ae),await et.invalidateQueries({queryKey:Dv(n).queryKey})}catch($e){xn($e instanceof Error?$e.message:String($e),"error")}},[n]),Nt=T.useCallback(J=>{Wr(J,"region",!1)},[Wr]),vn=T.useMemo(()=>{if(Kt!=="agent")return Ne;const J=new Set(Bn.map(ge=>ge.id));return Ne.filter(ge=>J.has(ge.experimentId))},[Ne,Bn,Kt]),[fn,hn]=T.useState([]),[Ir,bn]=T.useState(!1),[yn,Pn]=T.useState(!1),[Et,Bt]=T.useState(!1),[In,xr]=T.useState(!1),[fr,Fn]=T.useState(null),[sr,Qr]=T.useState([]),[On,We]=T.useState([]),yt=T.useRef(new Map),Jn=T.useRef(new Map),pr=J=>{let ge=Jn.current.get(J);return ge||(ge=new nPn,Jn.current.set(J,ge)),ge},[pn,Tr]=T.useState([]),[An,ii]=T.useState([]),[wr,er]=T.useState([]),[Va,_c]=T.useState([]),[$r,ai]=T.useState(null),[xo,Ka]=T.useState("files"),[Pi,xl]=T.useState(new Set),[Lt,Rs]=T.useState(!1),[Br,Xr]=T.useState(null),[ct,Wt]=T.useState(_$),[xi,Fi]=T.useState(()=>window.innerWidth>=ZM),Hi=o==="chat"&&!h&&xi,[Yr,Rr]=T.useState(!0),[wo,wi]=T.useState(!1),Hs=T.useRef(zS()),oi=T.useRef(u);oi.current=u;const Zr=T.useRef(fn);Zr.current=fn;const Zt=T.useRef(Va);Zt.current=Va;const Ms=T.useRef(null),ya=T.useCallback(J=>{const ge=[...J];Zt.current=ge,_c(ge)},[]),kr=T.useCallback(J=>{Ms.current=J,ai(J)},[]),Wa=T.useCallback(J=>{const ge=It(J);Qr(Te=>Hp(Te,ge)),We(Te=>Hp(Te,ge)),Tr(Te=>Hp(Te,ge)),ii(Te=>Hp(Te,ge)),er(Te=>Hp(Te,ge));const Ae=$n.current;if(Ae&&"path"in J){const Te=Fs(Ae,oi.current,J);yt.current.delete(Te),Jn.current.delete(Te),N.current.delete(Te),C.current.delete(Te)}const $e=Zr.current.filter(Te=>It(Te)!==ge);Zr.current=$e,hn($e)},[]),Jr=T.useCallback(J=>{const ge=It(J),Ae=[...Zr.current.filter($e=>It($e)!==ge),o1(J)];Zr.current=Ae,hn(Ae),I(J)},[I]),qs=T.useCallback((J,ge,Ae)=>{const $e=It(J),Te=Ms.current,at=oLn({order:Zt.current,previewKey:Te?It(Te):null},$e,ge);at.replacedKey&&Te&&typeof Te!="string"&&It(Te)===at.replacedKey&&Wa(Te),ya(at.order),at.previewKey===null?kr(null):at.previewKey===$e&&kr(o1(J));const Je=[...Zr.current.filter(Mt=>It(Mt)!==$e),o1(J)];Zr.current=Je,hn(Je),D(rl(J,Ae))},[Wa,ya,kr,D]),Us=T.useCallback(J=>{const ge=Ms.current;ge&&It(ge)===It(J)&&kr(null)},[kr]);T.useEffect(()=>{let J=!1;const ge=$e=>{const Te=Ms.current,at=$e.target;if(at instanceof Element&&at.closest("input, textarea, [contenteditable='true']")!==null){J=!1;return}if(Te&&It(Te)===It(Hs.current.rightTab)&&($e.metaKey||$e.ctrlKey)&&!$e.altKey&&!$e.shiftKey&&$e.key.toLowerCase()==="k"){$e.preventDefault(),J=!0;return}if(J&&$e.key==="Enter"){$e.preventDefault(),J=!1;const Mt=Ms.current;Mt&&Us(Mt);return}J=!1},Ae=()=>{J=!1};return window.addEventListener("keydown",ge),window.addEventListener("blur",Ae),window.addEventListener("pointerdown",Ae),()=>{window.removeEventListener("keydown",ge),window.removeEventListener("blur",Ae),window.removeEventListener("pointerdown",Ae)}},[Us]);const es=T.useCallback((J,ge)=>{const Ae=It(J),$e=Ms.current;$e&&It($e)===Ae&&kr(null);const Te=cLn({order:Zt.current,previewKey:$e?It($e):null},Ae,Zr.current.map(It));ya(Te.order);const at=Zr.current.filter(Mt=>It(Mt)!==Ae);if(Zr.current=at,hn(at),!ge)return;const Je=Te.fallbackKey?at.find(Mt=>It(Mt)===Te.fallbackKey):void 0;Je?I(Je):(B(),Rs(!1))},[ya,kr,I,B]),Gs=Q,wl=T.useMemo(()=>({rightTab:o1(b),tabHistory:fn,experimentsTabOpen:Ir,filesTabOpen:yn,artifactsTabOpen:Et,terminalTabOpen:In,expTabs:sr,fileTabs:On,planTabs:pn,subagentTabs:An,codeTabs:wr,contentTabOrder:Zt.current,previewTab:Ms.current,filesView:xo,filesToggled:Pi,selectedRunId:_,scope:bt,panelOpen:h,panelMax:Lt,treeViewport:Br}),[b,fn,Ir,yn,Et,In,sr,On,pn,An,wr,Va,$r,xo,Pi,_,bt,h,Lt,Br]);Hs.current=wl;const kl=T.useCallback(()=>Object.fromEntries(yt.current),[]),xa=T.useRef(void 0),Qa=T.useCallback(()=>{clearTimeout(xa.current),xa.current=setTimeout(()=>j(J=>J+1),200)},[]);T.useEffect(()=>()=>clearTimeout(xa.current),[]);const If=T.useCallback((J,ge,Ae)=>{if(hn(J.tabHistory),Zr.current=J.tabHistory,bn(J.experimentsTabOpen),Pn(J.filesTabOpen),Bt(J.artifactsTabOpen),xr(J.terminalTabOpen),Qr(J.expTabs),We(J.fileTabs),Tr(Te=>Te===J.planTabs?Te:J.planTabs.map(at=>{var Je;return{...at,plan:((Je=Te.find(Mt=>Mt.sessionId===at.sessionId&&Mt.promptId===at.promptId))==null?void 0:Je.plan)??""}})),ii(J.subagentTabs),er(J.codeTabs),ya(J.contentTabOrder),kr(J.previewTab),Ka(J.filesView),xl(J.filesToggled),Yt(J.scope),Rs(J.panelMax),Xr(J.treeViewport),gs(M.current.activeSessionId===Pd&&J.fileTabs.some(Te=>k_(Te,{path:sw,source:"artifacts"}))),Ae){for(const[Te,at]of Object.entries((ge==null?void 0:ge.scroll)??{}))yt.current.set(Te,at);Object.assign(z.current,ge==null?void 0:ge.sourceModes)}const $e=M.current;if($e.projectId)for(const Te of J.fileTabs){const at=Fs($e.projectId,$e.activeSessionId,Te);N.current.has(at)||C.current.add(at)}},[ya,kr]),{ready:ci,loaded:wa,error:Os,retry:Vs,capture:ko,workspace:ir}=NSn({projectId:ne&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",firstDemoOpen:(ne==null?void 0:ne.tourCompleted)===!1,state:wl,apply:If,getScroll:kl,sourceModes:z.current,revision:A}),ki=T.useRef(null);T.useLayoutEffect(()=>{if(!ci||!be||(a==null?void 0:a.kind)!=="task")return;const J=ki.current;(J==null?void 0:J.projectId)===n&&J.taskId===u&&J.scope!==Kt&&Xr(null),ki.current={projectId:n,taskId:u,scope:Kt}},[ci,be,a==null?void 0:a.kind,n,u,Kt]);const dr=T.useCallback((J,ge)=>{var Mt;const Ae=(ge==null?void 0:ge.projectId)??n;if(!Ae)return;const $e=Ae===n;J&&$e&&ge!=null&&ge.replace&&u===null&&(ko(),CSn(Ae,J));const Te=Ru(o$(Ae),J??"new"),at=Te?Te.active:Vc(Ae)?(Mt=jS(J??void 0,ue.current===!1))==null?void 0:Mt.active:void 0,Je=$e&&(ge!=null&&ge.replace)&&J&&u===null?M.current.pane:at;s.navigate({href:Q1(Ae,J,Je),replace:$e&&(ge==null?void 0:ge.replace)})},[s,n,u,ko]);T.useEffect(()=>{ci&&(a==null?void 0:a.kind)!=="task"&&!c.current&&ir.current.lastTaskId&&(y!=null&&y.includes(ir.current.lastTaskId))&&(c.current=ir.current.lastTaskId,j(J=>J+1))},[ci,a==null?void 0:a.kind,ir,y]),uQ({shouldBlockFn:({next:J})=>{var ge;return((ge=ff(J.pathname))==null?void 0:ge.projectId)!==n&&[...Jn.current.values()].some(Ae=>Ae.needsProtection)&&!FR(BN())},enableBeforeUnload:()=>[...Jn.current.values()].some(J=>J.needsProtection)});const fc=T.useRef(null);T.useEffect(()=>{const J=Bb(i.href);!ne||!ci||!J||(Hb.queue({lastLocation:J,railOpen:Yr,panelWidth:ct,experimentsView:He},fc.current===J?250:0),fc.current=J)},[i.href,ne,ci,Yr,ct,He]);const Yu=(ne==null?void 0:ne.onboardingCompleted)??!1,[Sl,Ks]=T.useState(!1),[Zu,vs]=T.useState(null),[Si,Cl]=T.useState(0),ka=T.useCallback(()=>Ks(!0),[]),El=T.useCallback(async J=>{const ge=ue.current===!1,Ae=await r.mutateAsync({tourCompleted:!0});ge&&pu({name:"demo_welcome_choice",choice:J}),ae($e=>$e&&{...$e,tourCompleted:Ae.tourCompleted}),Ks(!1),J==="explore_demo"&&Cl($e=>$e+1)},[]),Nl=T.useCallback(async()=>{await El("create_project"),wi(!0)},[El]);T.useEffect(()=>{!n||!Vc(n)||!Yu||ne!=null&&ne.tourCompleted||ka()},[n,Yu,ka,ne==null?void 0:ne.tourCompleted]);const sn=(L==null?void 0:L.find(J=>J.id===n))??null;T.useEffect(()=>{const J=G||ne===null?null:sn==null?void 0:sn.name;document.title=J?`${na(J)} — OpenResearch`:"OpenResearch"},[G,ne,sn]);const $n=T.useRef(n);$n.current=n;const qi=T.useCallback(J=>{n&&pu({name:"first_action",surface:Vc(n)?"demo":"project",action:J})},[n]);T.useEffect(()=>{o!=="chat"&&o!=="skills"&&qi("open_settings")},[o,qi]);const ts=T.useCallback((J=!1)=>{J&&(!M.current.isTask||M.current.pane)||(qi("open_experiment"),bn(!0),D({kind:"home",view:"experiments"},J))},[D,qi]),Ci=()=>{$.refetch(),K.refetch(),x.refetch()},Ui=T.useRef(!1);T.useEffect(()=>{if(!ne||Ui.current)return;Ui.current=!0,oe.current=ne.preferredAgent;const J=ES()??ne.workspace;J&&(Rr(J.railOpen),Wt(Math.min(J.panelWidth,s0())),st(J.experimentsView))},[ne]),T.useEffect(()=>{y&&c.current&&!y.includes(c.current)&&(c.current=null)},[y]);const Ju=T.useRef(Promise.resolve()),dc=T.useRef(0),Sa=T.useCallback(J=>{const ge=++dc.current;ae($e=>$e&&{...$e,preferredAgent:J});const Ae=Ju.current.then(()=>r.mutateAsync({preferredAgent:J})).then($e=>{oe.current=$e.preferredAgent,ge===dc.current&&ae(Te=>Te&&{...Te,preferredAgent:$e.preferredAgent})}).catch($e=>{throw ge===dc.current&&ae(Te=>Te&&{...Te,preferredAgent:oe.current}),$e});return Ju.current=Ae.catch(()=>{}),Ae},[]);T.useEffect(()=>{const J=()=>{Wt(ge=>Math.min(ge,s0())),Fi(window.innerWidth>=ZM)};return window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]);const zl=T.useCallback(J=>{kt.current=!1,qt.current.clear(),dt.current.clear();const ge=++pt.current;et.fetchQuery(zu(J)).then(Ae=>{if($n.current!==J||ot.current!==J||pt.current!==ge)return;qt.current=new Map(Ae.map(Te=>[Te.id,Te]));const $e=[...dt.current.values()].some(Te=>{const at=qt.current.get(Te.id);return!at||at.status!=="running"&&at.updatedAt<=Te.updatedAt});dt.current.clear();for(const Te of Ae){const at=rt.current.get(Te.id);(!at||at.updatedAt{var at;return Ae.some(Je=>Je.id===Te&&Je.status==="running")?Te:((at=Ae.find(Je=>Je.status==="running"))==null?void 0:at.id)??null}),$e&&ts(!0)}).catch(()=>{pt.current===ge&&(dt.current.clear(),Le(!0))})},[ts]);T.useEffect(()=>{if(n)return ot.current=n,rt.current.clear(),Ze.current.clear(),txn(n).catch(()=>{}),zl(n),()=>{pt.current++}},[zl,n]);const $f=T.useCallback(()=>{Bt(!0),Jr("artifacts")},[Jr]),Yh=T.useCallback(()=>{xr(!0),Jr("terminal")},[Jr]),So=u??(n?`project:${n}`:null);T.useEffect(()=>{Fn(h?b==="terminal"?So:J=>J===So?J:null:null)},[h,b,So]),e4n({onReconnect:()=>{const J=$n.current;J&&(ot.current=J,rt.current.clear(),Ze.current.clear(),zl(J))},onRun:J=>{if(J.projectId!==$n.current||J.projectId!==ot.current)return;const ge=rt.current.get(J.id),Ae=Ze.current.has(J.id);if(ge&&ge.updatedAt>J.updatedAt||(rt.current.set(J.id,J),Ze.current.add(J.id),Vc(J.projectId)&&vs(at=>J.status==="running"?at??J.id:at===J.id?null:at),J.status!=="running"||(ge==null?void 0:ge.status)==="running"))return;const $e=qt.current.get(J.id),Te=kt.current&&(!$e||$e.status!=="running"&&$e.updatedAt<=J.updatedAt);Ae&&ge||Te?ts(!0):kt.current||dt.current.set(J.id,J)}});const hc=T.useCallback(()=>Yt("project"),[]),Gi=T.useCallback((J,ge="overview",Ae="preview",$e)=>{qi("open_experiment");const Te={id:J,view:ge};Qr(at=>at.some(Je=>_w(Je,Te))?at:[...at,Te]),qs(Te,Ae,$e)},[qs]),Bf=T.useCallback((J,ge="preview")=>{const Ae=xe.current.filter(Te=>Te.id===J||Te.id.startsWith(J)),$e=Ae.length===1?Ae[0]:null;$e&&Gi($e.experimentId,"terminal",ge,$e.id)},[Gi]),jl=T.useMemo(()=>new Map(he.map(J=>{var ge;return[J.id,((ge=J.title)==null?void 0:ge.trim())||J.slug||Wc()]})),[he,V]),Ca=eO(jl),e_=T.useMemo(()=>{const J=new Map;for(const ge of Ne)J.set(ge.id,Ca.get(ge.experimentId)??Wc());return J},[Ca,Ne,V]),pc=eO(e_),t_=T.useCallback(J=>{const ge=pc.get(J);if(ge)return ge;const Ae=[...pc].filter(([$e])=>$e.startsWith(J));return Ae.length===1?Ae[0][1]:""},[pc]),Al=T.useCallback(J=>{const ge=Ca.get(J);if(ge)return ge;const Ae=[...Ca].filter(([$e])=>$e.startsWith(J));return Ae.length===1?Ae[0][1]:""},[Ca]),mc=T.useCallback((J,ge="preview")=>{const Ae=Ie.current.filter($e=>$e.id===J||$e.id.startsWith(J));Ae.length===1&&Gi(Ae[0].id,"overview",ge)},[Gi]),Zh=T.useCallback(J=>{const ge=sr.findIndex(Ae=>_w(Ae,J));ge!==-1&&(Qr(Ae=>Ae.filter(($e,Te)=>Te!==ge)),es(J,It(b)===It(J)))},[sr,es,b]),Xa=T.useCallback((J,ge="preview")=>{J.line!=null&&k(Te=>Te+1);const Ae=$n.current;if(Ae){const Te=Fs(Ae,oi.current,J);Hs.current.fileTabs.some(at=>k_(at,J))||C.current.delete(Te),N.current.add(Te)}const $e=i$(J);We(Te=>{const at=Te.findIndex(Mt=>k_(Mt,J));if(at===-1)return[...Te,$e];const Je=Te.slice();return Je[at]=$e,Je}),qs(J,ge)},[qs]),Tl=T.useCallback((J,ge,Ae,$e,Te,at)=>{const Je=L==null?void 0:L.find(js=>js.id===n),Mt=rWn(J,Je==null?void 0:Je.repoPath,ge,(Je==null?void 0:Je.artifactsDir)??(Je==null?void 0:Je.filesDir),Je==null?void 0:Je.slug);if(!Mt)return null;const Xn=Te?Ie.current.find(js=>js.id===Te||Te.length>=6&&js.id.startsWith(Te)):void 0,as=Ae??(Xn==null?void 0:Xn.branchName),Ls=Mt.source==null||Mt.source==="repo";return as&&Ls&&(Mt.ref=as),at&&!Mt.ref&&Ls&&(Mt.branchLabel=at),$e!=null&&(Mt.line=$e),Mt},[L,n]),gc=T.useCallback((J,ge,Ae,$e,Te,at,Je="preview")=>{const Mt=Tl(J,ge,Ae,$e,Te,at);Mt&&Xa(Mt,Je)},[Xa,Tl]),n_=T.useCallback(J=>Xa({path:J,source:"artifacts"},"keepOpen"),[Xa]),Pf=T.useCallback((J,ge,Ae,$e,Te,at="preview")=>{const Je=Tl(J,ge,Te,Ae,$e);Je&&Xa(Je,at)},[Xa,Tl]),bs=T.useCallback((J,ge)=>{Us(J),ge()},[Us]),Jh=T.useCallback(J=>{var $e;const ge=On.findIndex(Te=>k_(Te,J));if(ge===-1)return;const Ae=n?Fs(n,u,J):null;Ae&&(($e=Jn.current.get(Ae))!=null&&$e.needsProtection)&&!FR(BN())||(We(Te=>Te.filter((at,Je)=>Je!==ge)),Ae&&(yt.current.delete(Ae),Jn.current.delete(Ae),N.current.delete(Ae),C.current.delete(Ae),delete z.current[Ae]),u===Pd&&k_(J,{path:sw,source:"artifacts"})&&gs(!1),es(J,It(b)===It(J)))},[u,On,es,n,b]),Ff=T.useCallback(J=>{J.lineScrollRequest!==void 0&&m(J.lineScrollRequest)},[]),vc=T.useCallback((J,ge,Ae,$e="preview")=>{const Te={kind:"plan",sessionId:ge,promptId:Ae,plan:J};Tr(at=>{const Je=at.findIndex(Xn=>Xn.promptId===Ae);if(Je===-1)return[...at,Te];const Mt=at.slice();return Mt[Je]=Te,Mt}),qs(Te,$e)},[qs]),bc=T.useCallback(J=>{const ge=pn.findIndex(Ae=>Ae.promptId===J.promptId);ge!==-1&&(Tr(Ae=>Ae.filter(($e,Te)=>Te!==ge)),es(J,It(b)===It(J)))},[es,pn,b]),r_=T.useCallback((J,ge,Ae,$e="preview")=>{const Te={kind:"subagent",sessionId:J,spawnPartId:ge,label:Ae};ii(at=>at.some(Je=>Je.spawnPartId===ge)?at:[...at,Te]),qs(Te,$e)},[qs]),s_=T.useCallback(J=>{const ge=An.findIndex(Ae=>Ae.spawnPartId===J.spawnPartId);ge!==-1&&(ii(Ae=>Ae.filter(($e,Te)=>Te!==ge)),es(J,It(b)===It(J)))},[es,b,An]),[i_,a_]=T.useState({});T.useEffect(()=>{if(a_(Je=>{const Mt=new Set(An.map(Xn=>Xn.spawnPartId));return Object.keys(Je).every(Xn=>Mt.has(Xn))?Je:Object.fromEntries(Object.entries(Je).filter(([Xn])=>Mt.has(Xn)))}),An.length===0)return;let J=!0;const ge=new Set,Ae=(Je,Mt,Xn)=>{a_(as=>{var js;let Ls=as;for(const os of Mt)if(!(Xn&&ge.has(os.spawnPartId)))for(const $l of Je){const Ja=cb($l.parts,os.spawnPartId);if(!Ja)continue;Xn||ge.add(os.spawnPartId);const wc={label:F$n(Ja),running:((js=Ja.state)==null?void 0:js.status)==="running"},No=Ls[os.spawnPartId];(!No||No.label!==wc.label||No.running!==wc.running)&&(Ls===as&&(Ls={...as}),Ls[os.spawnPartId]=wc);break}return Ls})};let $e=0;const Te=()=>{const Je=++$e;for(const Mt of new Set(An.map(Xn=>Xn.sessionId)))et.fetchQuery({...ol(Mt),staleTime:0}).then(({messages:Xn})=>{J&&Je===$e&&Ae(Xn,An.filter(as=>as.sessionId===Mt),!0)}).catch(()=>{})};Te();const at=Mv(Je=>{if(Je.type==="reconnected"){ge.clear(),Te();return}if(Je.type!=="message")return;const Mt=An.filter(Xn=>Xn.sessionId===Je.sessionId);Mt.length&&Ae([Je.message],Mt,!1)});return()=>{J=!1,at()}},[An]);const Rl=T.useCallback((J,ge,Ae="files",$e="preview")=>{const Te={code:!0,experimentId:J,branch:ge,view:Ae,toggled:new Set};er(at=>at.some(Je=>md(Je,Te))?at.map(Je=>md(Je,Te)?{...Je,experimentId:J,view:Ae}:Je):[...at,Te]),qs(Te,$e)},[qs]),Ml=T.useCallback((J,ge)=>{er(Ae=>Ae.map($e=>md($e,J)?{...$e,...ge}:$e)),ge.view&&D(rl({...J,...ge}))},[]),Co=T.useCallback(J=>{const ge=wr.findIndex(Ae=>md(Ae,J));ge!==-1&&(er(Ae=>Ae.filter(($e,Te)=>Te!==ge)),es(J,It(b)===It(J)))},[wr,es,b]),Ol=T.useCallback(()=>{Pn(!0),Jr("files")},[Jr]),Dl=T.useCallback(J=>{J==="experiments"?bn(!1):J==="files"?Pn(!1):J==="terminal"?(xr(!1),Fn(null)):Bt(!1),es(J,b===J)},[es,b]),ep=J=>{J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId);const Ae=document.body.style.userSelect;document.body.style.userSelect="none";const $e=Lt,Te=J.clientX,at=ct;let Je=!1;function Mt(){window.removeEventListener("pointermove",Xn),window.removeEventListener("pointerup",Mt),window.removeEventListener("pointercancel",Mt),document.body.style.userSelect=Ae}function Xn(as){if($e){const $l=as.clientX-Te;if(Je||$ljs+aWn){Rs(!0);return}Rs(!1);const os=Math.min(Math.max(Ls,Bv),js);Wt(os)}window.addEventListener("pointermove",Xn),window.addEventListener("pointerup",Mt),window.addEventListener("pointercancel",Mt)},Hf=(J,ge)=>{F(Ae=>Ae?JM(Ae,J):[J]),s.navigate({href:`/projects/${encodeURIComponent(J.id)}${ge?"/settings/git":""}`}),ge&&xn(ge,"error")},ns=typeof b=="object"&&"id"in b?b:null,Nn=typeof b=="object"&&"path"in b?b:null,Ea=(Nn==null?void 0:Nn.source)==="artifacts"&&je?W0(je.entries,Nn.path):null,tp=Ea?`${Ea.modifiedAt}:${Ea.size}`:null,Ya=u===Pd&&_n?On.find(J=>k_(J,{path:sw,source:"artifacts"})):void 0,yc=Ya?[Ya]:[],ys=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,Vi=ys==null?void 0:ys.sessionId,Za=ys==null?void 0:ys.promptId,Ll=!!(Vi&&Za&&(y!=null&&y.includes(Vi))),xc=ut({...ol(Vi??""),enabled:Ll,subscribed:Ll}),Eo=T.useMemo(()=>{var ge;if(!Vi||!Za||!xc.data)return null;const J=xc.data.messages.flatMap(Ae=>{const $e=cb(Ae.parts,Za);return $e?[$e]:[]})[0];return{key:`${Vi}:${Za}`,text:((ge=J==null?void 0:J.prompt)==null?void 0:ge.plan)??null}},[Vi,Za,xc.data]),Ds=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Il=typeof b=="object"&&"code"in b?b:null,zs=Il?wr.find(J=>md(J,Il))??null:null,o_=new Map;for(const J of[...sr,...On,...pn,...An,...wr])o_.set(It(J),J);const qf=Ya?It(Ya):null,te=Va.filter(J=>J!==qf).map(J=>o_.get(J)).filter(wSn),me=J=>$r!==null&&It($r)===It(J),Ee=J=>f.jsx(qc,{active:Nn!==null&&k_(Nn,J),label:J.path.split("/").pop()||J.path,icon:f.jsx(FI,{size:12,className:"shrink-0"}),preview:me(J),onSelect:()=>Jr(J),onPromote:()=>Us(J),onClose:()=>Jh(J)},`file:${NS(J)}`),Oe=ns?he.find(J=>J.id===ns.id)??null:null,Pe=zs?he.find(J=>J.id===zs.experimentId&&J.branchName===zs.branch)??null:null,Jt=J=>{var Ae,$e;if("path"in J)return Ee(J);if("id"in J){const Te=he.find(at=>at.id===J.id);return f.jsx(qc,{active:ns!==null&&_w(ns,J),label:Te?Te.title||Te.slug:"…",icon:J.view==="overview"?f.jsx(u5n,{size:12,className:"shrink-0"}):f.jsx(vo,{size:12,className:"shrink-0"}),preview:me(J),onSelect:()=>Jr(J),onPromote:()=>Us(J),onClose:()=>Zh(J)},It(J))}if("kind"in J&&J.kind==="plan")return f.jsx(qc,{active:ys!==null&&ys.promptId===J.promptId,label:AD(),icon:f.jsx(yS,{size:12,className:"shrink-0"}),preview:me(J),onSelect:()=>Jr(J),onPromote:()=>Us(J),onClose:()=>bc(J)},It(J));if("kind"in J)return f.jsx(qc,{active:Ds!==null&&Ds.spawnPartId===J.spawnPartId,label:((Ae=i_[J.spawnPartId])==null?void 0:Ae.label)??J.label??O_e(),shimmer:(($e=i_[J.spawnPartId])==null?void 0:$e.running)??!1,icon:f.jsx(kS,{size:12,className:"shrink-0"}),preview:me(J),onSelect:()=>Jr(J),onPromote:()=>Us(J),onClose:()=>s_(J)},It(J));const ge=he.find(Te=>Te.id===J.experimentId);return f.jsx(qc,{active:zs!==null&&md(zs,J),label:(ge==null?void 0:ge.slug)??J.branch,icon:f.jsx(Lu,{size:12,className:"shrink-0"}),preview:me(J),onSelect:()=>Jr(J),onPromote:()=>Us(J),onClose:()=>Co(J)},It(J))};if(!a||a.kind==="resume")return null;if(G)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:e0,children:[f.jsx("p",{children:G}),f.jsx(De,{variant:"primary",onClick:Ci,children:ti()})]}),e.kind==="ssh"&&f.jsx(G3,{runtime:e,corner:!0})]});if(L&&!sn)return f.jsxs("div",{className:e0,children:[_o(),f.jsx(De,{onClick:()=>H(null),children:_0()})]});if(Os&&!ci)return f.jsxs("div",{className:e0,children:[f.jsx("p",{role:"alert",children:Os}),f.jsx(De,{onClick:Vs,children:ti()})]});if(L===null||ne===null||!wa||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:e0,children:f.jsx(jt,{})}),e.kind==="ssh"&&f.jsx(G3,{runtime:e,corner:!0})]});if(!sn||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:e0,children:[_o(),f.jsx(De,{onClick:()=>H(null),children:_0()})]});const mn=f.jsx(kPn,{projectName:((Dn=L.find(J=>J.id===n))==null?void 0:Dn.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>wi(!0),onRepository:()=>Gs("git"),onCollapse:()=>Rr(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(p$,{}),e.kind==="local"&&f.jsx(G$,{status:Z}),Os&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:Os}),f.jsx(De,{onClick:Vs,children:ti()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Hi?"workspace-card-visible":""}`,children:[n&&f.jsx(nBn,{projectId:n,projectName:(sn==null?void 0:sn.name)??"",railHeader:mn,railOpen:Yr,onShowRail:()=>Rr(!0),mainView:o,onSelectMainView:Gs,onOpenFile:Pf,onOpenRun:Bf,runExperimentName:t_,onOpenExperiment:mc,experimentName:Al,onOpenPlan:vc,onOpenSubagent:r_,composerFocusNonce:Si,demoRunningRunId:Zu,runtime:e,onOpenDemoWelcome:sn&&Vc(sn.id)?ka:void 0,activeSessionId:u,onActiveSessionChange:dr,preferredAgent:ne.preferredAgent,onPreferredAgentChange:Sa,children:o==="skills"?f.jsx(VBn,{}):o!=="chat"?f.jsx(gIn,{remote:e.kind==="ssh",tab:o,project:sn,onProjectUpdate:J=>{F(ge=>ge?JM(ge,J):[J])},onSelectTab:Gs}):null}),o==="chat"&&f.jsx(q9n,{expanded:Hi,experiments:he,runs:Ne,onOpenExperiment:(J,ge)=>Gi(J,"overview","preview",ge),rightOffset:h?ct+28:void 0,activeView:h&&(b==="files"||b==="artifacts"||b==="experiments"||b==="terminal")?b:null,projectId:sn.id,onCompute:()=>Gs("compute"),sessionId:u,busy:((rn=x.data)==null?void 0:rn.some(J=>J.id===u&&J.busy))??!1,onChanges:()=>{Ka("changes"),Ol()},onFiles:()=>{Ka("files"),Ol()},onTerminal:Yh,onArtifacts:$f,onExperiments:()=>ts()}),o==="chat"&&h&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Lt?"max":""}`,style:Lt?void 0:{width:ct},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Lt?"cursor-e-resize":"cursor-col-resize"}`,title:Lt?kle():mle(),onPointerDown:ep}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.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:[yc.map(Ee),yn&&f.jsx(qc,{active:b==="files",label:c3(),icon:f.jsx(Lu,{size:12,className:"shrink-0"}),onSelect:()=>Jr("files"),onClose:()=>Dl("files")}),In&&f.jsx(qc,{active:b==="terminal",label:jv(),icon:f.jsx(vo,{size:12,className:"shrink-0"}),onSelect:()=>Jr("terminal"),onClose:()=>Dl("terminal")}),Et&&f.jsx(qc,{active:b==="artifacts",label:xD(),icon:f.jsx(vS,{size:12,className:"shrink-0"}),onSelect:()=>Jr("artifacts"),onClose:()=>Dl("artifacts")}),Ir&&f.jsx(qc,{active:b==="experiments",label:wD(),icon:f.jsx(yh,{size:12,className:"shrink-0"}),onSelect:()=>Jr("experiments"),onClose:()=>Dl("experiments")}),te.map(Jt)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Pt,{title:Lt?YE():XE(),"aria-label":Lt?YE():XE(),onClick:()=>Rs(J=>!J),children:Lt?f.jsx(pkn,{size:14}):f.jsx(fkn,{size:14})}),f.jsx(Pt,{title:A0(),"aria-label":A0(),onClick:()=>{B(),Rs(!1)},children:f.jsx(cr,{size:14})})]})]}),b==="terminal"&&In?null:!ci||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!be||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Re?f.jsx(La,{children:f.jsx(jt,{})}):ns&&(!Oe||_&&!Ne.some(J=>J.id===_&&J.experimentId===ns.id))||Il&&!Pe||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(La,{children:f.jsx("div",{className:"p-6 text-subtext",children:_o()})}):b==="artifacts"?f.jsx(La,{children:sn&&f.jsx(IBn,{project:sn,artifacts:je,onOpenFile:n_,canRenameFile:J=>{var ge;return!((ge=Jn.current.get(Fs(sn.id,u,{path:J,source:"artifacts"})))!=null&&ge.needsProtection)}},sn.id)}):b==="experiments"?f.jsxs(La,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:mt,children:[f.jsx(Pt,{size:"small",ref:un,className:"experiment-scope-trigger",active:Kt==="agent",title:Hle({scope:Kt==="agent"?WE():QE()}),"aria-label":hue(),"aria-expanded":Tt,onClick:()=>ht(J=>!J),children:f.jsx(V5n,{size:16,strokeWidth:2.5})}),Tt&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-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:[f.jsxs(Cn,{"aria-pressed":Kt==="agent",disabled:!u||!br,title:u?br?void 0:xue():Due(),onClick:()=>{Yt("agent"),ht(!1)},children:[f.jsx("span",{children:WE()}),Kt==="agent"&&f.jsx(gi,{size:13})]}),f.jsxs(Cn,{"aria-pressed":Kt==="project",onClick:()=>{Yt("project"),ht(!1)},children:[f.jsx("span",{children:QE()}),Kt==="project"&&f.jsx(gi,{size:13})]}),f.jsx("div",{className:"my-1 border-t border-border-variant"}),f.jsxs(Cn,{"aria-pressed":_t,onClick:()=>{Ct(J=>!J),ht(!1)},children:[f.jsx("span",{children:y_e()}),_t&&f.jsx(gi,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_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":Qle(),children:[f.jsx("button",{className:He==="table"?"active":"","aria-pressed":He==="table",onClick:()=>st("table"),children:F_e()}),f.jsx("button",{className:He==="tree"?"active":"","aria-pressed":He==="tree",onClick:()=>st("tree"),children:W_e()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:He==="tree"?sn&&f.jsx(tWn,{experiments:he,archiveActions:yr,showArchived:_t,runs:vn,project:sn,onOpenView:Gi,onOpenCode:Rl,onArchive:Wr,agentSessionId:Kt==="agent"?u:null,onShowProjectScope:hc,onRestoreRegion:Nt,viewport:Br,onViewportChange:Xr}):f.jsx(CPn,{archiveActions:yr,runs:vn,emptyHint:!_t&&Bn.length>0&&_r.length===0?rpn():Kt==="agent"&&he.length>0?zue():void 0,experiments:_r,onOpen:(J,ge)=>{Gi(J.id,"overview",ge)},onOpenLogs:(J,ge,Ae)=>{Gi(J,"terminal",Ae,ge)},onOpenCode:(J,ge)=>{const Ae=he.find($e=>$e.id===J);Ae&&Rl(Ae.id,Ae.branchName,"files",ge)},onArchive:Wr,onCancel:HL})})]}):b==="files"?f.jsx(La,{children:sn?f.jsx(yBn,{sessionId:u??void 0,project:sn,view:xo,toggled:Pi,onViewChange:Ka,onToggledChange:xl,canRenameFile:J=>{var ge;return!((ge=Jn.current.get(Fs(sn.id,u,{path:J,source:"repo",sessionId:u??void 0})))!=null&&ge.needsProtection)},onOpenFile:(J,ge,Ae,$e)=>gc(J,ge,Ae,void 0,void 0,void 0,$e)},`files:${u??`project:${sn.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(Vd,{children:f.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:[f.jsx(HI,{size:22}),f.jsx("p",{children:a_e()})]})})})}):Nn?f.jsx(La,{children:n&&f.jsx(wPn,{remote:e.kind==="ssh",restored:C.current.has(Fs(n,u,Nn)),onRestoreActivated:()=>{const J=Fs(n,u,Nn);C.current.delete(J),N.current.add(J)},showSource:z.current[Fs(n,u,Nn)]??!1,onShowSourceChange:J=>{z.current[Fs(n,u,Nn)]=J,j(ge=>ge+1)},projectId:n,path:Nn.path,source:Nn.source,sessionId:Nn.source==="artifacts"?u??void 0:Nn.sessionId,gitRef:Nn.ref,line:Nn.line,branchLabel:sWn(Nn,sn==null?void 0:sn.baselineBranch),artifactVersion:tp,artifactEntries:Nn.source==="artifacts"?je==null?void 0:je.entries:void 0,bufferSession:pr(Fs(n,u,Nn)),onOpenFile:(J,ge,Ae,$e)=>bs(Nn,()=>gc(J,ge,Ae,void 0,void 0,void 0,$e)),scrollPosition:yt.current.get(Fs(n,u,Nn)),onScrollPositionChange:J=>{yt.current.set(Fs(n,u,Nn),J),Qa()},lineScrollRequest:Nn.lineScrollRequest,onLineScrollRequestHandled:()=>Ff(Nn),onEdit:()=>Us(Nn)},Fs(n,u,Nn))}):ys?f.jsx(La,{children:f.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:f.jsx(Jo,{text:(Eo==null?void 0:Eo.key)===`${ys.sessionId}:${ys.promptId}`?Eo.text??_o():((Sr=pn.find(J=>J.promptId===ys.promptId))==null?void 0:Sr.plan)||kD(),onOpenFile:(J,ge,Ae,$e,Te)=>bs(ys,()=>gc(J,ys.sessionId,$e,ge,Ae,void 0,Te))})})}):Ds?f.jsx(iBn,{projectId:n,sessionId:Ds.sessionId,spawnPartId:Ds.spawnPartId,onOpenFile:(J,ge,Ae,$e,Te)=>bs(Ds,()=>Pf(J,Ds.sessionId,ge,Ae,$e,Te)),onOpenRun:(J,ge)=>bs(Ds,()=>Bf(J,ge)),runExperimentName:t_,onOpenExperiment:(J,ge)=>bs(Ds,()=>mc(J,ge)),experimentName:Al,onOpenSubagent:(J,ge,Ae)=>bs(Ds,()=>r_(Ds.sessionId,J,ge,Ae))},Ds.spawnPartId):zs?f.jsx(La,{children:n&&sn&&zs&&Pe&&f.jsx(bBn,{projectId:n,project:sn,experiment:Pe,view:zs.view,toggled:zs.toggled,onViewChange:J=>Ml(zs,{view:J}),onToggledChange:J=>Ml(zs,{toggled:J}),onOpenFile:(J,ge,Ae,$e)=>bs(zs,()=>gc(J,ge,Ae,void 0,void 0,Pe.branchName,$e))},`code:${zs.branch}`)}):f.jsx(La,{children:ns&&Oe&&sn&&f.jsx(YBn,{experiment:Oe,project:sn,view:ns.view,runs:Ne,selectedRunId:_,onSelectRun:U,parentExperiment:he.find(J=>J.id===Oe.parentExperimentId)??null,onOpenView:(J,ge,Ae)=>{bs(ns,()=>Gi(Oe.id,J,Ae,ge))},onOpenCode:(J,ge)=>bs(ns,()=>Rl(Oe.id,Oe.branchName,J,ge))},`${ns.id}:${ns.view}`)}),In&&fr!==null&&fr===So&&sn&&f.jsx(La,{className:b==="terminal"?void 0:"hidden",children:f.jsx(G9n,{projectId:sn.id,sessionId:u,active:b==="terminal"},So)})]})]}),wo&&f.jsx(h$,{remote:e.kind==="ssh",onClose:()=>wi(!1),onCreated:(J,ge)=>{wi(!1),Hf(J,ge)}}),Sl&&sn&&Vc(sn.id)&&f.jsx(EPn,{onClose:El,onCreateProject:Nl})]})}const yk=nc()({validateSearch:e=>({pane:SS(e.pane)}),beforeLoad:({location:e})=>{if(!ff(e.pathname))throw IK()},component:lWn});function lWn(){const{projectId:e}=yk.useParams(),{pane:n}=yk.useSearch(),t=vi(),r=uD({select:s=>s.location});return T.useEffect(()=>{const s=uWn(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(N0,{}),f.jsx(cWn,{projectId:e,pane:n,runtime:c$()},e)]})}function uWn(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&SS(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const rG=nc()({component:_Wn});function _Wn(){const{projectId:e}=rG.useParams();return f.jsx(dCn,{projectId:e})}const fWn=nc()({}),dWn=nc()({}),hWn=nc()({}),pWn=nc()({}),mWn=pCn.update({id:"/",path:"/",getParentRoute:()=>qb}),IC=mCn.update({id:"/projects",path:"/projects",getParentRoute:()=>qb}),gWn=gCn.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>qb}),vWn=vCn.update({id:"/",path:"/",getParentRoute:()=>IC}),Xh=yk.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>IC}),bWn=rG.update({id:"/",path:"/",getParentRoute:()=>Xh}),yWn=fWn.update({id:"/skills",path:"/skills",getParentRoute:()=>Xh}),xWn=dWn.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>Xh}),wWn=hWn.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>Xh}),kWn=pWn.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>Xh}),SWn={ProjectsProjectIdSkillsRoute:yWn,ProjectsProjectIdIndexRoute:bWn,ProjectsProjectIdSettingsTabRoute:xWn,ProjectsProjectIdTasksSessionIdRoute:wWn,ProjectsProjectIdTasksNewRoute:kWn},CWn=Xh._addFileChildren(SWn),EWn={ProjectsProjectIdRoute:CWn,ProjectsIndexRoute:vWn},NWn=IC._addFileChildren(EWn),zWn={IndexRoute:mWn,ProjectsRoute:NWn,RemoteLaunchRoute:gWn},jWn=qb._addFileChildren(zWn)._addFileTypes(),AWn=iQ({routeTree:jWn,context:{queryClient:et},trailingSlash:"never",defaultPendingComponent:_6,defaultErrorComponent:f6,defaultNotFoundComponent:_Cn}),sG=E();document.documentElement.lang=sG;document.documentElement.dir="ltr";ZL(sG);dK.createRoot(document.getElementById("root")).render(f.jsxs(T.StrictMode,{children:[f.jsx(NV,{client:et,children:f.jsx(cQ,{router:AWn})}),f.jsx(q3n,{})]}));export{sc as C,Pt as I,lb as M,Ph as P,QI as S,gkn as a,QN as b,it as c,Gr as d,SBn as e,Xt as f,E as g,ri as h,XN as i,f as j,T as r}; +`)+1)}let U=[];try{U=B.trim()?J3(B):[]}catch{return null}if(I.truncated&&U.every(V=>V.hunks.length===0))return null;let H=0,Q=0;for(const V of U){const Z=uy(V);H+=Z.additions,Q+=Z.deletions}return{fileCount:U.length,additions:H,deletions:Q,truncated:I.truncated}},[v]),x={done:0,failed:0,cancelled:0,live:0};for(const I of n)I.status==="done"?x.done+=1:I.status==="failed"?x.failed+=1:I.status==="cancelled"?x.cancelled+=1:x.live+=1;const y=t?T0((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,N=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,z=T.useRef(null),[A,j]=T.useState(!1),[M,D]=T.useState(!1);return T.useEffect(()=>{j(!1)},[N]),T.useEffect(()=>{const I=z.current;I&&D(I.scrollHeight>I.clientHeight+1)},[N,A]),ri.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.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-border-hover-strong [&_.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-sm [&_.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]: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-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:R4,left:m,top:w,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:c,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx(cl,{status:t?aa(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Vr(i),children:[f.jsx(vo,{size:13}),tDe()]}),f.jsxs("button",{type:"button",...Vr(a),children:[f.jsx($b,{size:13}),OOe()]})]}),N&&f.jsx("div",{className:`hc-body${A?" expanded":""}`,ref:z,children:N}),N&&(M||A)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(I=>!I),children:A?MD():Dje()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(E(),{style:"short"}).format([n.length===1?hYe():xYe({count:Xt(n.length)}),...x.done>0?[EXe({count:Xt(x.done)})]:[],...x.failed>0?[MXe({count:Xt(x.failed)})]:[],...x.cancelled>0?[bXe({count:Xt(x.cancelled)})]:[],...x.live>0?[eYe({count:Xt(x.live)})]:[]])}),t&&oS(t.backend)&&f.jsx(RS,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:go(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(Nm,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[WOe()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?zX({parent:Ce(r??"parent")}):xX({parent:Ce(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?oYe():b.truncated?KXe({count:Xt(b.fileCount)}):PXe({count:Xt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[FOe()," ",LKn(e.createdAt)]})]})]}),document.body)}const YM=["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-sm [&_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(" "),$Kn=264,BKn=132,uv=44,PKn=72,FKn=148,HKn=44,qKn=160,UKn=64;function GKn(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function VKn(e,n){const t=new Map,r=o=>{const c=t.get(o)??1+o.children.reduce((u,h)=>u+r(h),0);return t.set(o,c),c},s=new Map,i=o=>{const c=s.get(o)??(n(o)||o.children.some(i));return s.set(o,c),c};function a(o){if(n(o)){const h=[];let _=0;for(const p of o.children)i(p)?h.push(...a(p)):_+=r(p);return _>0&&h.push({kind:"elided",id:`el-${o.exp.id}`,count:_,children:[]}),[{kind:"exp",exp:o.exp,children:h}]}if(!i(o))return[];let c=0;const u=[];return(function h(_){c+=1;for(const p of _.children)n(p)?u.push(...a(p)):i(p)?h(p):c+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:c,children:u}]}return e.flatMap(a)}function KKn(e){function n(t){if(t.kind!=="exp"||!t.exp.archived)return{...t,children:t.children.map(n)};let r=0;const s=[];function i(a){r+=1;for(const o of a.children)o.kind==="exp"&&o.exp.archived?i(o):s.push(n(o))}return i(t),{kind:"archived",id:`ar-${t.exp.id}`,rootId:t.exp.id,count:r,children:s}}return e.map(n)}function bk(e){return e.kind==="exp"?$Kn:e.kind==="archived"?qKn:FKn}function WKn(e){return e.kind==="exp"?BKn:HKn}function B1(e){return e.kind==="exp"?e.exp.id:e.id}function _v(e){if(e.children.length===0)return bk(e);const n=e.children.reduce((t,r)=>t+_v(r),0)+uv*(e.children.length-1);return Math.max(bk(e),n)}function QKn(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const XKn=T.memo(function({data:n}){Vu();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:c,onOpenView:u,onOpenCode:h,onArchive:_,actions:p}=n,m=r?aa(r):void 0,w=m==="running"||m==="starting"||m==="cancelling",k=i?r0n():w?umn():Wc(),v=s.slice(-8),b=T.useRef(null),x=DKn(b,n);return f.jsxs("div",{ref:b,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.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-start [&_.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-xs [&_.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]: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-xs [&_.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-sm [&_.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]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${w?"live":""} ${t.archived?"opacity-80":""}`,onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,children:[f.jsx(tc,{type:"target",position:Rt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Vr(y=>u(t.id,"overview",y)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:t.archived?OL():k}),f.jsx(cl,{status:m??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:vgn()}),v.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:v.map(y=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${QKn(aa(y))}`,title:h6(aa(y))},y.id))}):f.jsx("span",{children:sgn()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:go(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:y=>y.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:_gn(),...Vr(y=>u(t.id,"terminal",y)),children:[f.jsx(vo,{size:13}),LL()]}),f.jsxs("button",{className:"node-action",title:vD({branch:Ce(t.branchName)}),...Vr(y=>h(t.id,t.branchName,"files",y)),children:[f.jsx($b,{size:13}),Tmn()]}),o&&c&&f.jsx("a",{className:"node-action",title:Sv({name:Ce(t.branchName)}),"aria-label":Sv({name:Ce(t.branchName)}),href:Mb(o,c,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:y=>y.stopPropagation(),children:f.jsx(Ub,{size:13})}),f.jsx(pq,{id:t.id,name:t.slug,actions:p,onArchive:_,compact:!0})]}),f.jsx(tc,{type:"source",position:Rt.Bottom}),x.rect&&f.jsx(IKn,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:x.rect,onOpenLogs:s.length>0?y=>u(t.id,"terminal",y):void 0,onOpenCode:y=>h(t.id,t.branchName,"files",y),onMouseEnter:x.keepOpen,onMouseLeave:x.onMouseLeave})]})}),YKn=T.memo(function({data:n}){Vu();const{rootId:t,count:r,onRestoreRegion:s}=n,i=T.useRef(null),a=ga(i),[o,c]=T.useState({top:0,left:0}),u=()=>{if(!a.open&&i.current){const h=i.current.getBoundingClientRect(),_=window.innerHeight-h.bottom>=44;c({top:_?h.bottom+4:Math.max(4,h.top-44),left:Math.max(4,Math.min(h.left,window.innerWidth-232))})}a.setOpen(h=>!h)};return f.jsxs("div",{className:"archived-node w-40 h-11",children:[f.jsx(tc,{type:"target",position:Rt.Top}),f.jsxs("button",{type:"button",ref:i,className:"nodrag w-full h-full flex items-center justify-center gap-2 px-3 border border-border rounded-full bg-background text-text text-sm font-medium whitespace-nowrap transition-[background-color,border-color] duration-120 ease-standard hover:bg-surface hover:border-text","aria-haspopup":"menu","aria-expanded":a.open,onClick:u,children:[f.jsx(Z3n,{size:15,className:"shrink-0 text-subtext","aria-hidden":"true"}),f.jsx("span",{children:Xpn({count:Xt(r)})})]}),f.jsx(tc,{type:"source",position:Rt.Bottom}),a.open&&ri.createPortal(f.jsx("div",{ref:a.ref,className:"option-menu fixed z-70 min-w-56 rounded-lg border border-border bg-background p-1.5 shadow-menu",style:o,children:f.jsx(Cn,{onClick:()=>{a.setOpen(!1),s(t)},children:r===1?DL():U0n({count:Xt(r)})})}),document.body)]})}),ZKn=T.memo(function({data:n}){Vu();const{count:t,onShowProjectScope:r}=n;return f.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-hover-faint text-muted text-sm font-medium text-start 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:Cgn(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(tc,{type:"target",position:Rt.Top}),f.jsx(Lb,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?A0n():m0n({count:Xt(t)}),f.jsx("span",{className:"elided-node-sub",children:k0n()})]}),f.jsx(tc,{type:"source",position:Rt.Bottom})]})}),JKn={exp:XKn,archived:YKn,elided:ZKn},nG={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},eWn={...nG.style,strokeDasharray:"4 4"};function tWn({experiments:e,archiveActions:n,showArchived:t,runs:r,project:s,onOpenView:i,onOpenCode:a,onArchive:o,agentSessionId:c,onShowProjectScope:u,onRestoreRegion:h,viewport:_,onViewportChange:p}){const{nodes:m,edges:w}=T.useMemo(()=>{const k=new Map;for(const j of r){const M=k.get(j.experimentId);M?M.push(j):k.set(j.experimentId,[j])}for(const j of k.values())j.sort((M,D)=>M.createdAt-D.createdAt);const v=[],b=[],x=j=>!c||j.exp.chatSessionId===c,y=VKn(GKn(e),x),C=t?y:KKn(y),N=new Map(e.map(j=>[j.id,j.slug]));function z(j,M,D){const I=M-bk(j)/2;if(j.kind==="exp"){const H=k.get(j.exp.id)??[];v.push({id:j.exp.id,type:"exp",position:{x:I,y:D},data:{exp:j.exp,latestRun:H[H.length-1]??null,runs:H,isBaseline:!j.exp.parentExperimentId,parentSlug:j.exp.parentExperimentId?N.get(j.exp.parentExperimentId)??null:null,githubOwner:s.githubEnabled?s.githubOwner:"",githubRepo:s.githubEnabled?s.githubRepo:"",onOpenView:i,onOpenCode:a,onArchive:o,actions:n.get(j.exp.id)}})}else j.kind==="archived"?v.push({id:j.id,type:"archived",position:{x:I,y:D},data:{rootId:j.rootId,count:j.count,onRestoreRegion:h}}):v.push({id:j.id,type:"elided",position:{x:I,y:D},data:{count:j.count,onShowProjectScope:u}});if(j.children.length===0)return;const B=j.children.reduce((H,Q)=>H+_v(Q),0)+uv*(j.children.length-1);let U=M-B/2;for(const H of j.children){const Q=_v(H),V=j.kind!=="exp"||H.kind!=="exp"||j.exp.archived||H.exp.archived;b.push({id:`e-${B1(j)}-${B1(H)}`,source:B1(j),target:B1(H),...V?{style:eWn}:{}}),z(H,U+Q/2,D+WKn(j)+(H.kind==="archived"?UKn:PKn)),U+=Q+uv}}let A=0;for(const j of C){const M=_v(j);z(j,A+M/2,0),A+=M+uv}return{nodes:v,edges:b}},[e,n,t,r,i,a,o,s.githubOwner,s.githubRepo,s.githubEnabled,c,u,h]);return e.length===0?f.jsxs("div",{className:YM,children:[f.jsx("p",{className:"empty-state-title",children:Ymn()}),f.jsx("p",{className:"empty-state-hint",children:Smn()})]}):m.length===0&&c?f.jsxs("div",{className:YM,children:[f.jsx("p",{className:"empty-state-title",children:Umn()}),f.jsx("p",{className:"empty-state-hint",children:gmn()})]}):f.jsx(rKn,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-archived.selectable]:cursor-pointer [&_.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:m,edges:w,nodeTypes:JKn,defaultEdgeOptions:nG,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:OKn,onMoveEnd:(k,v)=>{k&&p(v)},minZoom:.15,defaultViewport:_??void 0,fitView:_===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(cKn,{variant:ul.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},c??"project")}const e0=["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-sm [&_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(" ");function nWn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rWn(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),c=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/")||E6(i))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[w,k]=[m(i),m(p)];return w===k?"":w.startsWith(`${k}/`)?w.slice(k.length).replace(/^\/+/,""):null},h=i.startsWith("/")&&c?u(c):null,_=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(h!==null)return h?{path:h,source:"artifacts"}:null;if(_!==null)i=_;else{const p=s?nWn(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),w=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),k=m||w?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};w?(a=w[1],i=w[2]):k&&(i=k[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function sWn(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const iWn=10,ZM=1448,aWn=80,oWn=48;function JM(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function eO(e){const n=T.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function cWn({runtime:e,projectId:n,pane:t}){var Dn,rn,Sr;const r=dn({mutationFn:qyn}),s=vi(),i=uD({select:J=>J.location}),a=ff(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",c=T.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:c.current;(a==null?void 0:a.kind)==="task"&&(c.current=u);const h=t!==void 0,_=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=T.useState(null),[w,k]=T.useState(0),v=T.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==w)&&(v.current={href:i.href,jump:w,value:v.current.value+1});const b=T.useMemo(()=>{const J=t?oo(t):"experiments";return typeof J=="object"&&"path"in J&&J.line&&p!==v.current.value?{...J,lineScrollRequest:v.current.value}:J},[t,p,i.href,w]),x=ut(Fa(n)),y=T.useMemo(()=>{var J;return((J=x.data)==null?void 0:J.map(ge=>ge.id))??null},[x.data]),C=T.useRef(new Set),N=T.useRef(new Set),z=T.useRef({}),[A,j]=T.useState(0),M=T.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const D=T.useCallback((J,ge=!1)=>{const Ae=M.current;Ae.projectId&&s.navigate({href:Q1(Ae.projectId,Ae.activeSessionId,J),replace:ge})},[s]),I=T.useCallback(J=>{const ge=rl(J);D(ge.kind==="file"?{...ge,line:void 0}:ge)},[D]),B=T.useCallback(()=>D(void 0),[D]),U=T.useCallback(J=>{(t==null?void 0:t.kind)==="experiment"&&D({...t,runId:J??void 0})},[t,D]),H=T.useCallback(J=>{s.navigate({href:J?`/projects/${encodeURIComponent(J)}`:"/projects"})},[s]),Q=T.useCallback(J=>{var ge;if(n)if(J==="chat"){const Ae=c.current;s.navigate({href:Q1(n,Ae,(ge=Ru(ir.current,Ae??"new"))==null?void 0:ge.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${J==="skills"?"skills":`settings/${J}`}`})},[s,n]),V=Vu(),{status:Z}=u6(e.kind==="local"),Y=T.useMemo(()=>gh(),[n]),$=ut(Y),L=$.data??null,F=T.useCallback(J=>{is(Y.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[Y]),q=T.useMemo(()=>Cm(),[n]),K=ut(q),ne=K.data??null,ae=T.useCallback(J=>{is(q.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[q]),ue=T.useRef(void 0);ue.current=ne==null?void 0:ne.tourCompleted;const se=[!x.data&&x.error?SD():null,!$.data&&$.error?_0():null,!K.data&&K.error?d_e():null].filter(J=>J!==null),G=se.length?N_e({items:new Intl.ListFormat(V).format(se)}):null,oe=T.useRef(null),ce=ut(Dv(n)),he=ce.data??[],be=!ce.isPending,[Re,Le]=T.useState(!1),Ne=ut(zu(n)).data??[],xe=T.useRef(Ne);xe.current=Ne;const rt=T.useRef(new Map),Ze=T.useRef(new Set),ot=T.useRef(null),kt=T.useRef(!1),qt=T.useRef(new Map),dt=T.useRef(new Map),pt=T.useRef(0),Ie=T.useRef(he);Ie.current=he;const je=ut(yCn(n)).data??null,[He,st]=T.useState("table"),[_t,Ct]=T.useState(!1),[bt,Yt]=T.useState("project"),un=T.useRef(null),{open:Tt,setOpen:ht,ref:mt}=ga(un),[_n,gs]=T.useState(!1),br=he.every(J=>J.chatSessionId),Gt=u&&br?bt:"project",Bn=T.useMemo(()=>Gt!=="agent"?he:he.filter(J=>J.chatSessionId===u),[he,Gt,u]),_r=T.useMemo(()=>Bn.filter(J=>_t||!J.archived),[Bn,_t]),yr=T.useMemo(()=>SPn(he),[he]),Wr=T.useCallback(async(J,ge,Ae)=>{try{await sxn(J,ge,Ae),await et.invalidateQueries({queryKey:Dv(n).queryKey})}catch($e){xn($e instanceof Error?$e.message:String($e),"error")}},[n]),Nt=T.useCallback(J=>{Wr(J,Gt==="agent"?"taskRegion":"region",!1)},[Wr,Gt]),vn=T.useMemo(()=>{if(Gt!=="agent")return Ne;const J=new Set(Bn.map(ge=>ge.id));return Ne.filter(ge=>J.has(ge.experimentId))},[Ne,Bn,Gt]),[fn,hn]=T.useState([]),[Ir,bn]=T.useState(!1),[yn,Pn]=T.useState(!1),[Et,Bt]=T.useState(!1),[In,xr]=T.useState(!1),[fr,Fn]=T.useState(null),[sr,Qr]=T.useState([]),[On,We]=T.useState([]),yt=T.useRef(new Map),Jn=T.useRef(new Map),pr=J=>{let ge=Jn.current.get(J);return ge||(ge=new nPn,Jn.current.set(J,ge)),ge},[pn,Tr]=T.useState([]),[An,ii]=T.useState([]),[wr,er]=T.useState([]),[Va,_c]=T.useState([]),[$r,ai]=T.useState(null),[xo,Ka]=T.useState("files"),[Pi,xl]=T.useState(new Set),[Lt,Rs]=T.useState(!1),[Br,Xr]=T.useState(null),[ct,Wt]=T.useState(_$),[xi,Fi]=T.useState(()=>window.innerWidth>=ZM),Hi=o==="chat"&&!h&&xi,[Yr,Rr]=T.useState(!0),[wo,wi]=T.useState(!1),Hs=T.useRef(zS()),oi=T.useRef(u);oi.current=u;const Zr=T.useRef(fn);Zr.current=fn;const Zt=T.useRef(Va);Zt.current=Va;const Ms=T.useRef(null),ya=T.useCallback(J=>{const ge=[...J];Zt.current=ge,_c(ge)},[]),kr=T.useCallback(J=>{Ms.current=J,ai(J)},[]),Wa=T.useCallback(J=>{const ge=It(J);Qr(Te=>Hp(Te,ge)),We(Te=>Hp(Te,ge)),Tr(Te=>Hp(Te,ge)),ii(Te=>Hp(Te,ge)),er(Te=>Hp(Te,ge));const Ae=$n.current;if(Ae&&"path"in J){const Te=Fs(Ae,oi.current,J);yt.current.delete(Te),Jn.current.delete(Te),N.current.delete(Te),C.current.delete(Te)}const $e=Zr.current.filter(Te=>It(Te)!==ge);Zr.current=$e,hn($e)},[]),Jr=T.useCallback(J=>{const ge=It(J),Ae=[...Zr.current.filter($e=>It($e)!==ge),o1(J)];Zr.current=Ae,hn(Ae),I(J)},[I]),qs=T.useCallback((J,ge,Ae)=>{const $e=It(J),Te=Ms.current,at=oLn({order:Zt.current,previewKey:Te?It(Te):null},$e,ge);at.replacedKey&&Te&&typeof Te!="string"&&It(Te)===at.replacedKey&&Wa(Te),ya(at.order),at.previewKey===null?kr(null):at.previewKey===$e&&kr(o1(J));const Je=[...Zr.current.filter(Mt=>It(Mt)!==$e),o1(J)];Zr.current=Je,hn(Je),D(rl(J,Ae))},[Wa,ya,kr,D]),Us=T.useCallback(J=>{const ge=Ms.current;ge&&It(ge)===It(J)&&kr(null)},[kr]);T.useEffect(()=>{let J=!1;const ge=$e=>{const Te=Ms.current,at=$e.target;if(at instanceof Element&&at.closest("input, textarea, [contenteditable='true']")!==null){J=!1;return}if(Te&&It(Te)===It(Hs.current.rightTab)&&($e.metaKey||$e.ctrlKey)&&!$e.altKey&&!$e.shiftKey&&$e.key.toLowerCase()==="k"){$e.preventDefault(),J=!0;return}if(J&&$e.key==="Enter"){$e.preventDefault(),J=!1;const Mt=Ms.current;Mt&&Us(Mt);return}J=!1},Ae=()=>{J=!1};return window.addEventListener("keydown",ge),window.addEventListener("blur",Ae),window.addEventListener("pointerdown",Ae),()=>{window.removeEventListener("keydown",ge),window.removeEventListener("blur",Ae),window.removeEventListener("pointerdown",Ae)}},[Us]);const es=T.useCallback((J,ge)=>{const Ae=It(J),$e=Ms.current;$e&&It($e)===Ae&&kr(null);const Te=cLn({order:Zt.current,previewKey:$e?It($e):null},Ae,Zr.current.map(It));ya(Te.order);const at=Zr.current.filter(Mt=>It(Mt)!==Ae);if(Zr.current=at,hn(at),!ge)return;const Je=Te.fallbackKey?at.find(Mt=>It(Mt)===Te.fallbackKey):void 0;Je?I(Je):(B(),Rs(!1))},[ya,kr,I,B]),Gs=Q,wl=T.useMemo(()=>({rightTab:o1(b),tabHistory:fn,experimentsTabOpen:Ir,filesTabOpen:yn,artifactsTabOpen:Et,terminalTabOpen:In,expTabs:sr,fileTabs:On,planTabs:pn,subagentTabs:An,codeTabs:wr,contentTabOrder:Zt.current,previewTab:Ms.current,filesView:xo,filesToggled:Pi,selectedRunId:_,scope:bt,panelOpen:h,panelMax:Lt,treeViewport:Br}),[b,fn,Ir,yn,Et,In,sr,On,pn,An,wr,Va,$r,xo,Pi,_,bt,h,Lt,Br]);Hs.current=wl;const kl=T.useCallback(()=>Object.fromEntries(yt.current),[]),xa=T.useRef(void 0),Qa=T.useCallback(()=>{clearTimeout(xa.current),xa.current=setTimeout(()=>j(J=>J+1),200)},[]);T.useEffect(()=>()=>clearTimeout(xa.current),[]);const If=T.useCallback((J,ge,Ae)=>{if(hn(J.tabHistory),Zr.current=J.tabHistory,bn(J.experimentsTabOpen),Pn(J.filesTabOpen),Bt(J.artifactsTabOpen),xr(J.terminalTabOpen),Qr(J.expTabs),We(J.fileTabs),Tr(Te=>Te===J.planTabs?Te:J.planTabs.map(at=>{var Je;return{...at,plan:((Je=Te.find(Mt=>Mt.sessionId===at.sessionId&&Mt.promptId===at.promptId))==null?void 0:Je.plan)??""}})),ii(J.subagentTabs),er(J.codeTabs),ya(J.contentTabOrder),kr(J.previewTab),Ka(J.filesView),xl(J.filesToggled),Yt(J.scope),Rs(J.panelMax),Xr(J.treeViewport),gs(M.current.activeSessionId===Pd&&J.fileTabs.some(Te=>k_(Te,{path:sw,source:"artifacts"}))),Ae){for(const[Te,at]of Object.entries((ge==null?void 0:ge.scroll)??{}))yt.current.set(Te,at);Object.assign(z.current,ge==null?void 0:ge.sourceModes)}const $e=M.current;if($e.projectId)for(const Te of J.fileTabs){const at=Fs($e.projectId,$e.activeSessionId,Te);N.current.has(at)||C.current.add(at)}},[ya,kr]),{ready:ci,loaded:wa,error:Os,retry:Vs,capture:ko,workspace:ir}=NSn({projectId:ne&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",firstDemoOpen:(ne==null?void 0:ne.tourCompleted)===!1,state:wl,apply:If,getScroll:kl,sourceModes:z.current,revision:A}),ki=T.useRef(null);T.useLayoutEffect(()=>{if(!ci||!be||(a==null?void 0:a.kind)!=="task")return;const J=ki.current;(J==null?void 0:J.projectId)===n&&J.taskId===u&&J.scope!==Gt&&Xr(null),ki.current={projectId:n,taskId:u,scope:Gt}},[ci,be,a==null?void 0:a.kind,n,u,Gt]);const dr=T.useCallback((J,ge)=>{var Mt;const Ae=(ge==null?void 0:ge.projectId)??n;if(!Ae)return;const $e=Ae===n;J&&$e&&ge!=null&&ge.replace&&u===null&&(ko(),CSn(Ae,J));const Te=Ru(o$(Ae),J??"new"),at=Te?Te.active:Vc(Ae)?(Mt=jS(J??void 0,ue.current===!1))==null?void 0:Mt.active:void 0,Je=$e&&(ge!=null&&ge.replace)&&J&&u===null?M.current.pane:at;s.navigate({href:Q1(Ae,J,Je),replace:$e&&(ge==null?void 0:ge.replace)})},[s,n,u,ko]);T.useEffect(()=>{ci&&(a==null?void 0:a.kind)!=="task"&&!c.current&&ir.current.lastTaskId&&(y!=null&&y.includes(ir.current.lastTaskId))&&(c.current=ir.current.lastTaskId,j(J=>J+1))},[ci,a==null?void 0:a.kind,ir,y]),uQ({shouldBlockFn:({next:J})=>{var ge;return((ge=ff(J.pathname))==null?void 0:ge.projectId)!==n&&[...Jn.current.values()].some(Ae=>Ae.needsProtection)&&!FR(BN())},enableBeforeUnload:()=>[...Jn.current.values()].some(J=>J.needsProtection)});const fc=T.useRef(null);T.useEffect(()=>{const J=Bb(i.href);!ne||!ci||!J||(Hb.queue({lastLocation:J,railOpen:Yr,panelWidth:ct,experimentsView:He},fc.current===J?250:0),fc.current=J)},[i.href,ne,ci,Yr,ct,He]);const Yu=(ne==null?void 0:ne.onboardingCompleted)??!1,[Sl,Ks]=T.useState(!1),[Zu,vs]=T.useState(null),[Si,Cl]=T.useState(0),ka=T.useCallback(()=>Ks(!0),[]),El=T.useCallback(async J=>{const ge=ue.current===!1,Ae=await r.mutateAsync({tourCompleted:!0});ge&&pu({name:"demo_welcome_choice",choice:J}),ae($e=>$e&&{...$e,tourCompleted:Ae.tourCompleted}),Ks(!1),J==="explore_demo"&&Cl($e=>$e+1)},[]),Nl=T.useCallback(async()=>{await El("create_project"),wi(!0)},[El]);T.useEffect(()=>{!n||!Vc(n)||!Yu||ne!=null&&ne.tourCompleted||ka()},[n,Yu,ka,ne==null?void 0:ne.tourCompleted]);const sn=(L==null?void 0:L.find(J=>J.id===n))??null;T.useEffect(()=>{const J=G||ne===null?null:sn==null?void 0:sn.name;document.title=J?`${na(J)} — OpenResearch`:"OpenResearch"},[G,ne,sn]);const $n=T.useRef(n);$n.current=n;const qi=T.useCallback(J=>{n&&pu({name:"first_action",surface:Vc(n)?"demo":"project",action:J})},[n]);T.useEffect(()=>{o!=="chat"&&o!=="skills"&&qi("open_settings")},[o,qi]);const ts=T.useCallback((J=!1)=>{J&&(!M.current.isTask||M.current.pane)||(qi("open_experiment"),bn(!0),D({kind:"home",view:"experiments"},J))},[D,qi]),Ci=()=>{$.refetch(),K.refetch(),x.refetch()},Ui=T.useRef(!1);T.useEffect(()=>{if(!ne||Ui.current)return;Ui.current=!0,oe.current=ne.preferredAgent;const J=ES()??ne.workspace;J&&(Rr(J.railOpen),Wt(Math.min(J.panelWidth,s0())),st(J.experimentsView))},[ne]),T.useEffect(()=>{y&&c.current&&!y.includes(c.current)&&(c.current=null)},[y]);const Ju=T.useRef(Promise.resolve()),dc=T.useRef(0),Sa=T.useCallback(J=>{const ge=++dc.current;ae($e=>$e&&{...$e,preferredAgent:J});const Ae=Ju.current.then(()=>r.mutateAsync({preferredAgent:J})).then($e=>{oe.current=$e.preferredAgent,ge===dc.current&&ae(Te=>Te&&{...Te,preferredAgent:$e.preferredAgent})}).catch($e=>{throw ge===dc.current&&ae(Te=>Te&&{...Te,preferredAgent:oe.current}),$e});return Ju.current=Ae.catch(()=>{}),Ae},[]);T.useEffect(()=>{const J=()=>{Wt(ge=>Math.min(ge,s0())),Fi(window.innerWidth>=ZM)};return window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]);const zl=T.useCallback(J=>{kt.current=!1,qt.current.clear(),dt.current.clear();const ge=++pt.current;et.fetchQuery(zu(J)).then(Ae=>{if($n.current!==J||ot.current!==J||pt.current!==ge)return;qt.current=new Map(Ae.map(Te=>[Te.id,Te]));const $e=[...dt.current.values()].some(Te=>{const at=qt.current.get(Te.id);return!at||at.status!=="running"&&at.updatedAt<=Te.updatedAt});dt.current.clear();for(const Te of Ae){const at=rt.current.get(Te.id);(!at||at.updatedAt{var at;return Ae.some(Je=>Je.id===Te&&Je.status==="running")?Te:((at=Ae.find(Je=>Je.status==="running"))==null?void 0:at.id)??null}),$e&&ts(!0)}).catch(()=>{pt.current===ge&&(dt.current.clear(),Le(!0))})},[ts]);T.useEffect(()=>{if(n)return ot.current=n,rt.current.clear(),Ze.current.clear(),txn(n).catch(()=>{}),zl(n),()=>{pt.current++}},[zl,n]);const $f=T.useCallback(()=>{Bt(!0),Jr("artifacts")},[Jr]),Yh=T.useCallback(()=>{xr(!0),Jr("terminal")},[Jr]),So=u??(n?`project:${n}`:null);T.useEffect(()=>{Fn(h?b==="terminal"?So:J=>J===So?J:null:null)},[h,b,So]),e4n({onReconnect:()=>{const J=$n.current;J&&(ot.current=J,rt.current.clear(),Ze.current.clear(),zl(J))},onRun:J=>{if(J.projectId!==$n.current||J.projectId!==ot.current)return;const ge=rt.current.get(J.id),Ae=Ze.current.has(J.id);if(ge&&ge.updatedAt>J.updatedAt||(rt.current.set(J.id,J),Ze.current.add(J.id),Vc(J.projectId)&&vs(at=>J.status==="running"?at??J.id:at===J.id?null:at),J.status!=="running"||(ge==null?void 0:ge.status)==="running"))return;const $e=qt.current.get(J.id),Te=kt.current&&(!$e||$e.status!=="running"&&$e.updatedAt<=J.updatedAt);Ae&&ge||Te?ts(!0):kt.current||dt.current.set(J.id,J)}});const hc=T.useCallback(()=>Yt("project"),[]),Gi=T.useCallback((J,ge="overview",Ae="preview",$e)=>{qi("open_experiment");const Te={id:J,view:ge};Qr(at=>at.some(Je=>_w(Je,Te))?at:[...at,Te]),qs(Te,Ae,$e)},[qs]),Bf=T.useCallback((J,ge="preview")=>{const Ae=xe.current.filter(Te=>Te.id===J||Te.id.startsWith(J)),$e=Ae.length===1?Ae[0]:null;$e&&Gi($e.experimentId,"terminal",ge,$e.id)},[Gi]),jl=T.useMemo(()=>new Map(he.map(J=>{var ge;return[J.id,((ge=J.title)==null?void 0:ge.trim())||J.slug||Wc()]})),[he,V]),Ca=eO(jl),e_=T.useMemo(()=>{const J=new Map;for(const ge of Ne)J.set(ge.id,Ca.get(ge.experimentId)??Wc());return J},[Ca,Ne,V]),pc=eO(e_),t_=T.useCallback(J=>{const ge=pc.get(J);if(ge)return ge;const Ae=[...pc].filter(([$e])=>$e.startsWith(J));return Ae.length===1?Ae[0][1]:""},[pc]),Al=T.useCallback(J=>{const ge=Ca.get(J);if(ge)return ge;const Ae=[...Ca].filter(([$e])=>$e.startsWith(J));return Ae.length===1?Ae[0][1]:""},[Ca]),mc=T.useCallback((J,ge="preview")=>{const Ae=Ie.current.filter($e=>$e.id===J||$e.id.startsWith(J));Ae.length===1&&Gi(Ae[0].id,"overview",ge)},[Gi]),Zh=T.useCallback(J=>{const ge=sr.findIndex(Ae=>_w(Ae,J));ge!==-1&&(Qr(Ae=>Ae.filter(($e,Te)=>Te!==ge)),es(J,It(b)===It(J)))},[sr,es,b]),Xa=T.useCallback((J,ge="preview")=>{J.line!=null&&k(Te=>Te+1);const Ae=$n.current;if(Ae){const Te=Fs(Ae,oi.current,J);Hs.current.fileTabs.some(at=>k_(at,J))||C.current.delete(Te),N.current.add(Te)}const $e=i$(J);We(Te=>{const at=Te.findIndex(Mt=>k_(Mt,J));if(at===-1)return[...Te,$e];const Je=Te.slice();return Je[at]=$e,Je}),qs(J,ge)},[qs]),Tl=T.useCallback((J,ge,Ae,$e,Te,at)=>{const Je=L==null?void 0:L.find(js=>js.id===n),Mt=rWn(J,Je==null?void 0:Je.repoPath,ge,(Je==null?void 0:Je.artifactsDir)??(Je==null?void 0:Je.filesDir),Je==null?void 0:Je.slug);if(!Mt)return null;const Xn=Te?Ie.current.find(js=>js.id===Te||Te.length>=6&&js.id.startsWith(Te)):void 0,as=Ae??(Xn==null?void 0:Xn.branchName),Ls=Mt.source==null||Mt.source==="repo";return as&&Ls&&(Mt.ref=as),at&&!Mt.ref&&Ls&&(Mt.branchLabel=at),$e!=null&&(Mt.line=$e),Mt},[L,n]),gc=T.useCallback((J,ge,Ae,$e,Te,at,Je="preview")=>{const Mt=Tl(J,ge,Ae,$e,Te,at);Mt&&Xa(Mt,Je)},[Xa,Tl]),n_=T.useCallback(J=>Xa({path:J,source:"artifacts"},"keepOpen"),[Xa]),Pf=T.useCallback((J,ge,Ae,$e,Te,at="preview")=>{const Je=Tl(J,ge,Te,Ae,$e);Je&&Xa(Je,at)},[Xa,Tl]),bs=T.useCallback((J,ge)=>{Us(J),ge()},[Us]),Jh=T.useCallback(J=>{var $e;const ge=On.findIndex(Te=>k_(Te,J));if(ge===-1)return;const Ae=n?Fs(n,u,J):null;Ae&&(($e=Jn.current.get(Ae))!=null&&$e.needsProtection)&&!FR(BN())||(We(Te=>Te.filter((at,Je)=>Je!==ge)),Ae&&(yt.current.delete(Ae),Jn.current.delete(Ae),N.current.delete(Ae),C.current.delete(Ae),delete z.current[Ae]),u===Pd&&k_(J,{path:sw,source:"artifacts"})&&gs(!1),es(J,It(b)===It(J)))},[u,On,es,n,b]),Ff=T.useCallback(J=>{J.lineScrollRequest!==void 0&&m(J.lineScrollRequest)},[]),vc=T.useCallback((J,ge,Ae,$e="preview")=>{const Te={kind:"plan",sessionId:ge,promptId:Ae,plan:J};Tr(at=>{const Je=at.findIndex(Xn=>Xn.promptId===Ae);if(Je===-1)return[...at,Te];const Mt=at.slice();return Mt[Je]=Te,Mt}),qs(Te,$e)},[qs]),bc=T.useCallback(J=>{const ge=pn.findIndex(Ae=>Ae.promptId===J.promptId);ge!==-1&&(Tr(Ae=>Ae.filter(($e,Te)=>Te!==ge)),es(J,It(b)===It(J)))},[es,pn,b]),r_=T.useCallback((J,ge,Ae,$e="preview")=>{const Te={kind:"subagent",sessionId:J,spawnPartId:ge,label:Ae};ii(at=>at.some(Je=>Je.spawnPartId===ge)?at:[...at,Te]),qs(Te,$e)},[qs]),s_=T.useCallback(J=>{const ge=An.findIndex(Ae=>Ae.spawnPartId===J.spawnPartId);ge!==-1&&(ii(Ae=>Ae.filter(($e,Te)=>Te!==ge)),es(J,It(b)===It(J)))},[es,b,An]),[i_,a_]=T.useState({});T.useEffect(()=>{if(a_(Je=>{const Mt=new Set(An.map(Xn=>Xn.spawnPartId));return Object.keys(Je).every(Xn=>Mt.has(Xn))?Je:Object.fromEntries(Object.entries(Je).filter(([Xn])=>Mt.has(Xn)))}),An.length===0)return;let J=!0;const ge=new Set,Ae=(Je,Mt,Xn)=>{a_(as=>{var js;let Ls=as;for(const os of Mt)if(!(Xn&&ge.has(os.spawnPartId)))for(const $l of Je){const Ja=cb($l.parts,os.spawnPartId);if(!Ja)continue;Xn||ge.add(os.spawnPartId);const wc={label:F$n(Ja),running:((js=Ja.state)==null?void 0:js.status)==="running"},No=Ls[os.spawnPartId];(!No||No.label!==wc.label||No.running!==wc.running)&&(Ls===as&&(Ls={...as}),Ls[os.spawnPartId]=wc);break}return Ls})};let $e=0;const Te=()=>{const Je=++$e;for(const Mt of new Set(An.map(Xn=>Xn.sessionId)))et.fetchQuery({...ol(Mt),staleTime:0}).then(({messages:Xn})=>{J&&Je===$e&&Ae(Xn,An.filter(as=>as.sessionId===Mt),!0)}).catch(()=>{})};Te();const at=Mv(Je=>{if(Je.type==="reconnected"){ge.clear(),Te();return}if(Je.type!=="message")return;const Mt=An.filter(Xn=>Xn.sessionId===Je.sessionId);Mt.length&&Ae([Je.message],Mt,!1)});return()=>{J=!1,at()}},[An]);const Rl=T.useCallback((J,ge,Ae="files",$e="preview")=>{const Te={code:!0,experimentId:J,branch:ge,view:Ae,toggled:new Set};er(at=>at.some(Je=>md(Je,Te))?at.map(Je=>md(Je,Te)?{...Je,experimentId:J,view:Ae}:Je):[...at,Te]),qs(Te,$e)},[qs]),Ml=T.useCallback((J,ge)=>{er(Ae=>Ae.map($e=>md($e,J)?{...$e,...ge}:$e)),ge.view&&D(rl({...J,...ge}))},[]),Co=T.useCallback(J=>{const ge=wr.findIndex(Ae=>md(Ae,J));ge!==-1&&(er(Ae=>Ae.filter(($e,Te)=>Te!==ge)),es(J,It(b)===It(J)))},[wr,es,b]),Ol=T.useCallback(()=>{Pn(!0),Jr("files")},[Jr]),Dl=T.useCallback(J=>{J==="experiments"?bn(!1):J==="files"?Pn(!1):J==="terminal"?(xr(!1),Fn(null)):Bt(!1),es(J,b===J)},[es,b]),ep=J=>{J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId);const Ae=document.body.style.userSelect;document.body.style.userSelect="none";const $e=Lt,Te=J.clientX,at=ct;let Je=!1;function Mt(){window.removeEventListener("pointermove",Xn),window.removeEventListener("pointerup",Mt),window.removeEventListener("pointercancel",Mt),document.body.style.userSelect=Ae}function Xn(as){if($e){const $l=as.clientX-Te;if(Je||$ljs+aWn){Rs(!0);return}Rs(!1);const os=Math.min(Math.max(Ls,Bv),js);Wt(os)}window.addEventListener("pointermove",Xn),window.addEventListener("pointerup",Mt),window.addEventListener("pointercancel",Mt)},Hf=(J,ge)=>{F(Ae=>Ae?JM(Ae,J):[J]),s.navigate({href:`/projects/${encodeURIComponent(J.id)}${ge?"/settings/git":""}`}),ge&&xn(ge,"error")},ns=typeof b=="object"&&"id"in b?b:null,Nn=typeof b=="object"&&"path"in b?b:null,Ea=(Nn==null?void 0:Nn.source)==="artifacts"&&je?W0(je.entries,Nn.path):null,tp=Ea?`${Ea.modifiedAt}:${Ea.size}`:null,Ya=u===Pd&&_n?On.find(J=>k_(J,{path:sw,source:"artifacts"})):void 0,yc=Ya?[Ya]:[],ys=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,Vi=ys==null?void 0:ys.sessionId,Za=ys==null?void 0:ys.promptId,Ll=!!(Vi&&Za&&(y!=null&&y.includes(Vi))),xc=ut({...ol(Vi??""),enabled:Ll,subscribed:Ll}),Eo=T.useMemo(()=>{var ge;if(!Vi||!Za||!xc.data)return null;const J=xc.data.messages.flatMap(Ae=>{const $e=cb(Ae.parts,Za);return $e?[$e]:[]})[0];return{key:`${Vi}:${Za}`,text:((ge=J==null?void 0:J.prompt)==null?void 0:ge.plan)??null}},[Vi,Za,xc.data]),Ds=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Il=typeof b=="object"&&"code"in b?b:null,zs=Il?wr.find(J=>md(J,Il))??null:null,o_=new Map;for(const J of[...sr,...On,...pn,...An,...wr])o_.set(It(J),J);const qf=Ya?It(Ya):null,te=Va.filter(J=>J!==qf).map(J=>o_.get(J)).filter(wSn),me=J=>$r!==null&&It($r)===It(J),Ee=J=>f.jsx(qc,{active:Nn!==null&&k_(Nn,J),label:J.path.split("/").pop()||J.path,icon:f.jsx(FI,{size:12,className:"shrink-0"}),preview:me(J),onSelect:()=>Jr(J),onPromote:()=>Us(J),onClose:()=>Jh(J)},`file:${NS(J)}`),Oe=ns?he.find(J=>J.id===ns.id)??null:null,Pe=zs?he.find(J=>J.id===zs.experimentId&&J.branchName===zs.branch)??null:null,Jt=J=>{var Ae,$e;if("path"in J)return Ee(J);if("id"in J){const Te=he.find(at=>at.id===J.id);return f.jsx(qc,{active:ns!==null&&_w(ns,J),label:Te?Te.title||Te.slug:"…",icon:J.view==="overview"?f.jsx(u5n,{size:12,className:"shrink-0"}):f.jsx(vo,{size:12,className:"shrink-0"}),preview:me(J),onSelect:()=>Jr(J),onPromote:()=>Us(J),onClose:()=>Zh(J)},It(J))}if("kind"in J&&J.kind==="plan")return f.jsx(qc,{active:ys!==null&&ys.promptId===J.promptId,label:AD(),icon:f.jsx(yS,{size:12,className:"shrink-0"}),preview:me(J),onSelect:()=>Jr(J),onPromote:()=>Us(J),onClose:()=>bc(J)},It(J));if("kind"in J)return f.jsx(qc,{active:Ds!==null&&Ds.spawnPartId===J.spawnPartId,label:((Ae=i_[J.spawnPartId])==null?void 0:Ae.label)??J.label??O_e(),shimmer:(($e=i_[J.spawnPartId])==null?void 0:$e.running)??!1,icon:f.jsx(kS,{size:12,className:"shrink-0"}),preview:me(J),onSelect:()=>Jr(J),onPromote:()=>Us(J),onClose:()=>s_(J)},It(J));const ge=he.find(Te=>Te.id===J.experimentId);return f.jsx(qc,{active:zs!==null&&md(zs,J),label:(ge==null?void 0:ge.slug)??J.branch,icon:f.jsx(Lu,{size:12,className:"shrink-0"}),preview:me(J),onSelect:()=>Jr(J),onPromote:()=>Us(J),onClose:()=>Co(J)},It(J))};if(!a||a.kind==="resume")return null;if(G)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:e0,children:[f.jsx("p",{children:G}),f.jsx(De,{variant:"primary",onClick:Ci,children:ti()})]}),e.kind==="ssh"&&f.jsx(G3,{runtime:e,corner:!0})]});if(L&&!sn)return f.jsxs("div",{className:e0,children:[_o(),f.jsx(De,{onClick:()=>H(null),children:_0()})]});if(Os&&!ci)return f.jsxs("div",{className:e0,children:[f.jsx("p",{role:"alert",children:Os}),f.jsx(De,{onClick:Vs,children:ti()})]});if(L===null||ne===null||!wa||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:e0,children:f.jsx(jt,{})}),e.kind==="ssh"&&f.jsx(G3,{runtime:e,corner:!0})]});if(!sn||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:e0,children:[_o(),f.jsx(De,{onClick:()=>H(null),children:_0()})]});const mn=f.jsx(kPn,{projectName:((Dn=L.find(J=>J.id===n))==null?void 0:Dn.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>wi(!0),onRepository:()=>Gs("git"),onCollapse:()=>Rr(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(p$,{}),e.kind==="local"&&f.jsx(G$,{status:Z}),Os&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:Os}),f.jsx(De,{onClick:Vs,children:ti()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Hi?"workspace-card-visible":""}`,children:[n&&f.jsx(nBn,{projectId:n,projectName:(sn==null?void 0:sn.name)??"",railHeader:mn,railOpen:Yr,onShowRail:()=>Rr(!0),mainView:o,onSelectMainView:Gs,onOpenFile:Pf,onOpenRun:Bf,runExperimentName:t_,onOpenExperiment:mc,experimentName:Al,onOpenPlan:vc,onOpenSubagent:r_,composerFocusNonce:Si,demoRunningRunId:Zu,runtime:e,onOpenDemoWelcome:sn&&Vc(sn.id)?ka:void 0,activeSessionId:u,onActiveSessionChange:dr,preferredAgent:ne.preferredAgent,onPreferredAgentChange:Sa,children:o==="skills"?f.jsx(VBn,{}):o!=="chat"?f.jsx(gIn,{remote:e.kind==="ssh",tab:o,project:sn,onProjectUpdate:J=>{F(ge=>ge?JM(ge,J):[J])},onSelectTab:Gs}):null}),o==="chat"&&f.jsx(q9n,{expanded:Hi,experiments:he,runs:Ne,onOpenExperiment:(J,ge)=>Gi(J,"overview","preview",ge),rightOffset:h?ct+28:void 0,activeView:h&&(b==="files"||b==="artifacts"||b==="experiments"||b==="terminal")?b:null,projectId:sn.id,onCompute:()=>Gs("compute"),sessionId:u,busy:((rn=x.data)==null?void 0:rn.some(J=>J.id===u&&J.busy))??!1,onChanges:()=>{Ka("changes"),Ol()},onFiles:()=>{Ka("files"),Ol()},onTerminal:Yh,onArtifacts:$f,onExperiments:()=>ts()}),o==="chat"&&h&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Lt?"max":""}`,style:Lt?void 0:{width:ct},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Lt?"cursor-e-resize":"cursor-col-resize"}`,title:Lt?kle():mle(),onPointerDown:ep}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.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:[yc.map(Ee),yn&&f.jsx(qc,{active:b==="files",label:c3(),icon:f.jsx(Lu,{size:12,className:"shrink-0"}),onSelect:()=>Jr("files"),onClose:()=>Dl("files")}),In&&f.jsx(qc,{active:b==="terminal",label:jv(),icon:f.jsx(vo,{size:12,className:"shrink-0"}),onSelect:()=>Jr("terminal"),onClose:()=>Dl("terminal")}),Et&&f.jsx(qc,{active:b==="artifacts",label:xD(),icon:f.jsx(vS,{size:12,className:"shrink-0"}),onSelect:()=>Jr("artifacts"),onClose:()=>Dl("artifacts")}),Ir&&f.jsx(qc,{active:b==="experiments",label:wD(),icon:f.jsx(yh,{size:12,className:"shrink-0"}),onSelect:()=>Jr("experiments"),onClose:()=>Dl("experiments")}),te.map(Jt)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Pt,{title:Lt?YE():XE(),"aria-label":Lt?YE():XE(),onClick:()=>Rs(J=>!J),children:Lt?f.jsx(pkn,{size:14}):f.jsx(fkn,{size:14})}),f.jsx(Pt,{title:A0(),"aria-label":A0(),onClick:()=>{B(),Rs(!1)},children:f.jsx(cr,{size:14})})]})]}),b==="terminal"&&In?null:!ci||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!be||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Re?f.jsx(La,{children:f.jsx(jt,{})}):ns&&(!Oe||_&&!Ne.some(J=>J.id===_&&J.experimentId===ns.id))||Il&&!Pe||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(La,{children:f.jsx("div",{className:"p-6 text-subtext",children:_o()})}):b==="artifacts"?f.jsx(La,{children:sn&&f.jsx(IBn,{project:sn,artifacts:je,onOpenFile:n_,canRenameFile:J=>{var ge;return!((ge=Jn.current.get(Fs(sn.id,u,{path:J,source:"artifacts"})))!=null&&ge.needsProtection)}},sn.id)}):b==="experiments"?f.jsxs(La,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:mt,children:[f.jsx(Pt,{size:"small",ref:un,className:"experiment-scope-trigger",active:Gt==="agent",title:Hle({scope:Gt==="agent"?WE():QE()}),"aria-label":hue(),"aria-expanded":Tt,onClick:()=>ht(J=>!J),children:f.jsx(V5n,{size:16,strokeWidth:2.5})}),Tt&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-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:[f.jsxs(Cn,{"aria-pressed":Gt==="agent",disabled:!u||!br,title:u?br?void 0:xue():Due(),onClick:()=>{Yt("agent"),ht(!1)},children:[f.jsx("span",{children:WE()}),Gt==="agent"&&f.jsx(gi,{size:13})]}),f.jsxs(Cn,{"aria-pressed":Gt==="project",onClick:()=>{Yt("project"),ht(!1)},children:[f.jsx("span",{children:QE()}),Gt==="project"&&f.jsx(gi,{size:13})]}),f.jsx("div",{className:"my-1 border-t border-border-variant"}),f.jsxs(Cn,{"aria-pressed":_t,onClick:()=>{Ct(J=>!J),ht(!1)},children:[f.jsx("span",{children:y_e()}),_t&&f.jsx(gi,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_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":Qle(),children:[f.jsx("button",{className:He==="table"?"active":"","aria-pressed":He==="table",onClick:()=>st("table"),children:F_e()}),f.jsx("button",{className:He==="tree"?"active":"","aria-pressed":He==="tree",onClick:()=>st("tree"),children:W_e()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:He==="tree"?sn&&f.jsx(tWn,{experiments:he,archiveActions:yr,showArchived:_t,runs:vn,project:sn,onOpenView:Gi,onOpenCode:Rl,onArchive:Wr,agentSessionId:Gt==="agent"?u:null,onShowProjectScope:hc,onRestoreRegion:Nt,viewport:Br,onViewportChange:Xr}):f.jsx(CPn,{archiveActions:yr,runs:vn,emptyHint:!_t&&Bn.length>0&&_r.length===0?rpn():Gt==="agent"&&he.length>0?zue():void 0,experiments:_r,onOpen:(J,ge)=>{Gi(J.id,"overview",ge)},onOpenLogs:(J,ge,Ae)=>{Gi(J,"terminal",Ae,ge)},onOpenCode:(J,ge)=>{const Ae=he.find($e=>$e.id===J);Ae&&Rl(Ae.id,Ae.branchName,"files",ge)},onArchive:Wr,onCancel:HL})})]}):b==="files"?f.jsx(La,{children:sn?f.jsx(yBn,{sessionId:u??void 0,project:sn,view:xo,toggled:Pi,onViewChange:Ka,onToggledChange:xl,canRenameFile:J=>{var ge;return!((ge=Jn.current.get(Fs(sn.id,u,{path:J,source:"repo",sessionId:u??void 0})))!=null&&ge.needsProtection)},onOpenFile:(J,ge,Ae,$e)=>gc(J,ge,Ae,void 0,void 0,void 0,$e)},`files:${u??`project:${sn.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(Vd,{children:f.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:[f.jsx(HI,{size:22}),f.jsx("p",{children:a_e()})]})})})}):Nn?f.jsx(La,{children:n&&f.jsx(wPn,{remote:e.kind==="ssh",restored:C.current.has(Fs(n,u,Nn)),onRestoreActivated:()=>{const J=Fs(n,u,Nn);C.current.delete(J),N.current.add(J)},showSource:z.current[Fs(n,u,Nn)]??!1,onShowSourceChange:J=>{z.current[Fs(n,u,Nn)]=J,j(ge=>ge+1)},projectId:n,path:Nn.path,source:Nn.source,sessionId:Nn.source==="artifacts"?u??void 0:Nn.sessionId,gitRef:Nn.ref,line:Nn.line,branchLabel:sWn(Nn,sn==null?void 0:sn.baselineBranch),artifactVersion:tp,artifactEntries:Nn.source==="artifacts"?je==null?void 0:je.entries:void 0,bufferSession:pr(Fs(n,u,Nn)),onOpenFile:(J,ge,Ae,$e)=>bs(Nn,()=>gc(J,ge,Ae,void 0,void 0,void 0,$e)),scrollPosition:yt.current.get(Fs(n,u,Nn)),onScrollPositionChange:J=>{yt.current.set(Fs(n,u,Nn),J),Qa()},lineScrollRequest:Nn.lineScrollRequest,onLineScrollRequestHandled:()=>Ff(Nn),onEdit:()=>Us(Nn)},Fs(n,u,Nn))}):ys?f.jsx(La,{children:f.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:f.jsx(Jo,{text:(Eo==null?void 0:Eo.key)===`${ys.sessionId}:${ys.promptId}`?Eo.text??_o():((Sr=pn.find(J=>J.promptId===ys.promptId))==null?void 0:Sr.plan)||kD(),onOpenFile:(J,ge,Ae,$e,Te)=>bs(ys,()=>gc(J,ys.sessionId,$e,ge,Ae,void 0,Te))})})}):Ds?f.jsx(iBn,{projectId:n,sessionId:Ds.sessionId,spawnPartId:Ds.spawnPartId,onOpenFile:(J,ge,Ae,$e,Te)=>bs(Ds,()=>Pf(J,Ds.sessionId,ge,Ae,$e,Te)),onOpenRun:(J,ge)=>bs(Ds,()=>Bf(J,ge)),runExperimentName:t_,onOpenExperiment:(J,ge)=>bs(Ds,()=>mc(J,ge)),experimentName:Al,onOpenSubagent:(J,ge,Ae)=>bs(Ds,()=>r_(Ds.sessionId,J,ge,Ae))},Ds.spawnPartId):zs?f.jsx(La,{children:n&&sn&&zs&&Pe&&f.jsx(bBn,{projectId:n,project:sn,experiment:Pe,view:zs.view,toggled:zs.toggled,onViewChange:J=>Ml(zs,{view:J}),onToggledChange:J=>Ml(zs,{toggled:J}),onOpenFile:(J,ge,Ae,$e)=>bs(zs,()=>gc(J,ge,Ae,void 0,void 0,Pe.branchName,$e))},`code:${zs.branch}`)}):f.jsx(La,{children:ns&&Oe&&sn&&f.jsx(YBn,{experiment:Oe,project:sn,view:ns.view,runs:Ne,selectedRunId:_,onSelectRun:U,parentExperiment:he.find(J=>J.id===Oe.parentExperimentId)??null,onOpenView:(J,ge,Ae)=>{bs(ns,()=>Gi(Oe.id,J,Ae,ge))},onOpenCode:(J,ge)=>bs(ns,()=>Rl(Oe.id,Oe.branchName,J,ge))},`${ns.id}:${ns.view}`)}),In&&fr!==null&&fr===So&&sn&&f.jsx(La,{className:b==="terminal"?void 0:"hidden",children:f.jsx(G9n,{projectId:sn.id,sessionId:u,active:b==="terminal"},So)})]})]}),wo&&f.jsx(h$,{remote:e.kind==="ssh",onClose:()=>wi(!1),onCreated:(J,ge)=>{wi(!1),Hf(J,ge)}}),Sl&&sn&&Vc(sn.id)&&f.jsx(EPn,{onClose:El,onCreateProject:Nl})]})}const yk=nc()({validateSearch:e=>({pane:SS(e.pane)}),beforeLoad:({location:e})=>{if(!ff(e.pathname))throw IK()},component:lWn});function lWn(){const{projectId:e}=yk.useParams(),{pane:n}=yk.useSearch(),t=vi(),r=uD({select:s=>s.location});return T.useEffect(()=>{const s=uWn(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(N0,{}),f.jsx(cWn,{projectId:e,pane:n,runtime:c$()},e)]})}function uWn(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&SS(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const rG=nc()({component:_Wn});function _Wn(){const{projectId:e}=rG.useParams();return f.jsx(dCn,{projectId:e})}const fWn=nc()({}),dWn=nc()({}),hWn=nc()({}),pWn=nc()({}),mWn=pCn.update({id:"/",path:"/",getParentRoute:()=>qb}),IC=mCn.update({id:"/projects",path:"/projects",getParentRoute:()=>qb}),gWn=gCn.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>qb}),vWn=vCn.update({id:"/",path:"/",getParentRoute:()=>IC}),Xh=yk.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>IC}),bWn=rG.update({id:"/",path:"/",getParentRoute:()=>Xh}),yWn=fWn.update({id:"/skills",path:"/skills",getParentRoute:()=>Xh}),xWn=dWn.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>Xh}),wWn=hWn.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>Xh}),kWn=pWn.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>Xh}),SWn={ProjectsProjectIdSkillsRoute:yWn,ProjectsProjectIdIndexRoute:bWn,ProjectsProjectIdSettingsTabRoute:xWn,ProjectsProjectIdTasksSessionIdRoute:wWn,ProjectsProjectIdTasksNewRoute:kWn},CWn=Xh._addFileChildren(SWn),EWn={ProjectsProjectIdRoute:CWn,ProjectsIndexRoute:vWn},NWn=IC._addFileChildren(EWn),zWn={IndexRoute:mWn,ProjectsRoute:NWn,RemoteLaunchRoute:gWn},jWn=qb._addFileChildren(zWn)._addFileTypes(),AWn=iQ({routeTree:jWn,context:{queryClient:et},trailingSlash:"never",defaultPendingComponent:_6,defaultErrorComponent:f6,defaultNotFoundComponent:_Cn}),sG=E();document.documentElement.lang=sG;document.documentElement.dir="ltr";ZL(sG);dK.createRoot(document.getElementById("root")).render(f.jsxs(T.StrictMode,{children:[f.jsx(NV,{client:et,children:f.jsx(cQ,{router:AWn})}),f.jsx(q3n,{})]}));export{sc as C,Pt as I,lb as M,Ph as P,QI as S,gkn as a,QN as b,it as c,Gr as d,SBn as e,Xt as f,E as g,ri as h,XN as i,f as j,T as r}; diff --git a/ui/dist/index.html b/ui/dist/index.html index 1fb71ed5..769cfece 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -49,7 +49,7 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - + diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 5e98e8e8..4586058b 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -376,7 +376,7 @@ export default function App({ runtime, projectId, pane }: { runtime: RuntimeInfo [scopedExperiments, showArchivedExperiments], ); const archiveActions = useMemo(() => archiveActionsByExperiment(experiments), [experiments]); - const archiveExperiment = useCallback(async (id: string, direction: "ancestors" | "descendants" | "only" | "region", archived: boolean) => { + const archiveExperiment = useCallback(async (id: string, direction: "ancestors" | "descendants" | "only" | "region" | "taskRegion", archived: boolean) => { try { await setExperimentArchived(id, direction, archived); await queryClient.invalidateQueries({ queryKey: listExperimentsQuery(projectId).queryKey }); @@ -385,8 +385,8 @@ export default function App({ runtime, projectId, pane }: { runtime: RuntimeInfo } }, [projectId]); const restoreArchivedRegion = useCallback((id: string) => { - void archiveExperiment(id, "region", false); - }, [archiveExperiment]); + void archiveExperiment(id, effectiveScope === "agent" ? "taskRegion" : "region", false); + }, [archiveExperiment, effectiveScope]); // Runs are scoped by their experiment's owner, not by which session launched them. const scopedRuns = useMemo(() => { if (effectiveScope !== "agent") return runs; diff --git a/ui/src/api.ts b/ui/src/api.ts index 68e5bbea..03436344 100644 --- a/ui/src/api.ts +++ b/ui/src/api.ts @@ -374,7 +374,7 @@ export const listExperiments = (projectId: string, signal?: AbortSignal) => (r) => r.experiments, ); -export const setExperimentArchived = (id: string, direction: "ancestors" | "descendants" | "only" | "region", archived: boolean) => +export const setExperimentArchived = (id: string, direction: "ancestors" | "descendants" | "only" | "region" | "taskRegion", archived: boolean) => patch<{ ids: string[] }>(`/api/experiments/${id}/archive`, { direction, archived }); export const listRuns = (projectId: string, signal?: AbortSignal) =>